Package org.apache.tapestry5.ioc.services

Examples of org.apache.tapestry5.ioc.services.ClassFactory


        ClassPath path = new LoaderClassPath(loader);

        classPool.appendClassPath(path);

        classSource = new CtClassSourceImpl(classPool, loader);

        try
        {
            loader.addTranslator(classPool, this);
        }
View Full Code Here


    @Test
    public void handle_beans_from_unexpected_classloader() throws Exception
    {
        // First, create something that looks like a Hibernate proxy.

        ClassFactory factory = new ClassFactoryImpl();

        Class clazz = SimpleBean.class;

        ClassFab cf = factory.newClass(clazz.getName() + "$$Proxy", clazz);

        cf.addInterface(Serializable.class);

        Class proxyClass = cf.createClass();
View Full Code Here

        Loader loader = new TestPackageAwareLoader(contextClassLoader, pool);

        pool.appendClassPath(new LoaderClassPath(loader));

        ClassFactory cf = new ClassFactoryImpl(loader, pool, logger);

        CtClass ctClass = pool.get(componentClassName);

        replay();
View Full Code Here

    private synchronized EntityManager getOrCreateProxy(
            final AnnotationProvider annotationProvider, final ObjectLocator objectLocator)
    {
        if (proxy == null)
        {
            final ClassFactory classFactory = objectLocator.getService("ClassFactory",
                    ClassFactory.class);

             final PersistenceContext annotation = annotationProvider
                            .getAnnotation(PersistenceContext.class);

            proxy = classFactory.createProxy(EntityManager.class, new ObjectCreator()
            {
                public Object createObject()
                {
                    final EntityManagerManager entityManagerManager = objectLocator
                            .getService(EntityManagerManager.class);
View Full Code Here

    @Test
    public void handle_beans_from_unexpected_classloader() throws Exception
    {
        // First, create something that looks like a Hibernate proxy.

        ClassFactory factory = new ClassFactoryImpl();

        Class clazz = SimpleBean.class;

        ClassFab cf = factory.newClass(clazz.getName() + "$$Proxy", clazz);

        cf.addInterface(Serializable.class);

        Class proxyClass = cf.createClass();
View Full Code Here

   
    @Test
    public void build_and_startup_registry_from_moduledef_and_modules()
    {
        Logger logger = LoggerFactory.getLogger(getClass());
        ClassFactory classFactory = new ClassFactoryImpl();

        ModuleDef module = new DefaultModuleDefImpl(ServiceBuilderModule.class, logger, null);
       
        Registry r = RegistryBuilder.buildAndStartupRegistry(module, MasterModule.class);
       
View Full Code Here

    @Test
    public void handle_beans_from_unexpected_classloader() throws Exception
    {
        // First, create something that looks like a Hibernate proxy.

        ClassFactory factory = new ClassFactoryImpl();

        Class clazz = SimpleBean.class;

        ClassFab cf = factory.newClass(clazz.getName() + "$$Proxy", clazz);

        cf.addInterface(Serializable.class);

        Class proxyClass = cf.createClass();
View Full Code Here

    }

    @Test
    public void new_class_with_name_and_base_class() throws Exception
    {
        ClassFactory factory = new ClassFactoryImpl();
        String name = ClassFabUtils.generateClassName(Runnable.class);

        ClassFab cf = factory.newClass(name, Object.class);
        cf.addInterface(Runnable.class);

        addRunMethod(cf);

        Class newClass = cf.createClass();
View Full Code Here

    }

    @Test
    public void new_class_with_non_object_base_class() throws Exception
    {
        ClassFactory factory = new ClassFactoryImpl();
        String name = ClassFabUtils.generateClassName(Runnable.class);

        ClassFab cf = factory.newClass(name, BaseClass.class);
        cf.addInterface(Runnable.class);

        Class newClass = cf.createClass();

        Runnable instance = (Runnable) newClass.newInstance();
View Full Code Here

    }

    @Test
    public void new_class_with_interface() throws Exception
    {
        ClassFactory factory = new ClassFactoryImpl();

        ClassFab cf = factory.newClass(Runnable.class);

        addRunMethod(cf);

        Class newClass = cf.createClass();
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.ioc.services.ClassFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.