Examples of ClassFactory


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

    }

    @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

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

    @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

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

        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

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

    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

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

    @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

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

   
    @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

Examples of org.pentaho.reporting.engine.classic.core.modules.parser.ext.factory.base.ClassFactory

  public Iterator getRegisteredClasses()
  {
    final ArrayList list = new ArrayList();
    for (int i = 0; i < factories.size(); i++)
    {
      final ClassFactory f = (ClassFactory) factories.get(i);
      final Iterator keys = f.getRegisteredClasses();
      while (keys.hasNext())
      {
        list.add(keys.next());
      }
    }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.modules.parser.ext.factory.base.ClassFactory

  private void addClassFactoryCollector(final ClassFactoryCollector cf)
  {
    final Iterator it = cf.getFactories();
    while (it.hasNext())
    {
      final ClassFactory cfact = (ClassFactory) it.next();
      if (cfact instanceof ClassFactoryCollector)
      {
        addClassFactoryCollector((ClassFactoryCollector) cfact);
      }
      else
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.modules.parser.ext.factory.base.ClassFactory

    final ClassFactoryCollector fc =
        (ClassFactoryCollector) getRootHandler().getHelperObject
            (ReportDefinitionReadHandler.CLASS_FACTORY_KEY);

    final ClassFactory factory = (ClassFactory)
        ObjectUtilities.loadAndInstantiate(className, getClass(), ClassFactory.class);
    if (factory != null)
    {
      factory.configure(getRootHandler().getParserConfiguration());
      fc.addFactory(factory);
    }
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.modules.parser.ext.factory.base.ClassFactory

  }

  public void testFactories()
  {
    final ReportWriter writer = createWriter();
    final ClassFactory cc = writer.getClassFactoryCollector();
    assertNotNull(cc.getDescriptionForClass(DataRowDataSource.class));
    assertEquals(cc.getDescriptionForClass
      (DataRowDataSource.class).getObjectClass(), DataRowDataSource.class);
    System.out.println(cc.getDescriptionForClass(DataRowDataSource.class));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.