Examples of newInstance()


Examples of net.sourceforge.stripes.controller.DefaultObjectFactory.newInstance()

        ServletContext sc = configuration.getServletContext();
        sc.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, this.ctx);
        DefaultObjectFactory factory = new DefaultObjectFactory();
        factory.init(configuration);
        factory.addPostProcessor(new SpringInjectionPostProcessor());
        PostProcessorTarget target = factory.newInstance(PostProcessorTarget.class);
        Assert.assertNotNull(target.getBean());
    }

    ///////////////////////////////////////////////////////////////////////////
View Full Code Here

Examples of net.sourceforge.stripes.controller.ObjectFactory.newInstance()

            try {
                T component;

                ObjectFactory objectFactory = getObjectFactory();
                if (objectFactory != null) {
                    component = objectFactory.newInstance((Class<T>) clazz);
                }
                else {
                    component = (T) clazz.newInstance();
                }
View Full Code Here

Examples of net.sourceforge.urlrewriter4j.core.configuration.DefaultBeanFactory.newInstance()

public class DefaultBeanFactoryTest {

  @Test
  public void newInstance() throws Exception {
    DefaultBeanFactory oFactory = new DefaultBeanFactory();
    Object oActual = oFactory.newInstance(MyAction.class, MyAction.class.getName());
    assertNotNull(oActual);
    assertEquals(MyAction.class, oActual.getClass());
  }
}
View Full Code Here

Examples of net.sourceforge.urlrewriter4j.core.configuration.SpringBeanFactory.newInstance()

    String oClassName = MyAction.class.getName();
    oContext.registerSingleton(oClassName, MyAction.class);
   
    SpringBeanFactory oFactory = new SpringBeanFactory();
    oFactory.setApplicationContext(oContext);
    Object oActual = oFactory.newInstance(MyAction.class, oClassName);
    assertNotNull(oActual);
    assertEquals(MyAction.class, oActual.getClass());
  }
}
View Full Code Here

Examples of net.xoetrope.builder.w3c.html.tags.XHtmlTagHandler.newInstance()

 
  public XHtmlTagHandler getTagHandler( HTML.Tag t )
  {
    XHtmlTagHandler tagHandler = (XHtmlTagHandler)htmlTags.get( t );
    if ( tagHandler != null )
      tagHandler = tagHandler.newInstance( this, lastHandler );
    else {
      tagHandler = new XDefaultTagHandler( t );
      tagHandler.setParent( lastHandler );
    }
   
View Full Code Here

Examples of org.apache.InstanceManager.newInstance()

                    (sm.getString("standardWrapper.notClass", getName()));
            }

            InstanceManager instanceManager = ((StandardContext)getParent()).getInstanceManager();
            try {
                servlet = (Servlet) instanceManager.newInstance(actualClass);
            } catch (ClassCastException e) {
                unavailable(null);
                // Restore the context ClassLoader
                throw new ServletException
                    (sm.getString("standardWrapper.notServlet", actualClass), e);
View Full Code Here

Examples of org.apache.activemq.util.FactoryFinder.newInstance()

        return handler;
    }

    private CommandHandler createHandler() throws IllegalAccessException, IOException, ClassNotFoundException, InstantiationException {
        FactoryFinder factoryFinder = new FactoryFinder("META-INF/services/org/apache/activemq/broker/");
        return (CommandHandler) factoryFinder.newInstance("agent");
    }
}
View Full Code Here

Examples of org.apache.beehive.netui.pageflow.handler.ReloadableClassHandler.newInstance()

                        _log.debug( "Creating form bean of type " + _outputFormBeanType );
                    }
                   
                    ServletContext servletContext = InternalUtils.getServletContext( request );
                    ReloadableClassHandler rch = Handlers.get( servletContext ).getReloadableClassHandler();
                    Object formBean = rch.newInstance( _outputFormBeanType );
                    ActionForm wrappedFormBean = InternalUtils.wrapFormBean( formBean );
                    addOutputForm( wrappedFormBean );
                    return wrappedFormBean;
                }
                catch ( Exception e )
View Full Code Here

Examples of org.apache.camel.spi.FactoryFinder.newInstance()

     * Lazily create a default implementation
     */
    protected Injector createInjector() {
        FactoryFinder finder = getDefaultFactoryFinder();
        try {
            return (Injector) finder.newInstance("Injector");
        } catch (NoFactoryAvailableException e) {
            // lets use the default injector
            return new DefaultInjector(this);
        }
    }
View Full Code Here

Examples of org.apache.camel.spi.Injector.newInstance()

    }

    public void testNewInstance() throws Exception {
        Injector injector = context.getInjector();

        MyFoo foo = injector.newInstance(MyFoo.class);
        foo.setName("Claus");

        MyFoo foo2 = injector.newInstance(MyFoo.class);
        assertNotSame(foo, foo2);
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.