Package org.apache.pluto.factory

Examples of org.apache.pluto.factory.Factory


            factoryInterface = Class.forName (factoryInterfaceName);

            String factoryImplName = (String)factories.get(factoryInterfaceName);
            Class factoryImpl = Class.forName (factoryImplName);
            Factory factory = (Factory) factoryImpl.newInstance ();

            ContainerUtil.enableLogging(factory, this.getLogger());
            ContainerUtil.contextualize(factory, this.context);
            ContainerUtil.service(factory, this.manager);
            ContainerUtil.initialize(factory);
           
            factory.init(this.servletConfig, new HashMap());

            factoryMap.put (factoryInterface.getName(), factory);

            // build up list in reverse order for later destruction
            factoryList.add (0, factory);
View Full Code Here


     */
    public void dispose() {

        // destroy the services in reverse order
        for (Iterator iterator = factoryList.iterator (); iterator.hasNext (); ) {
            Factory factory = (Factory) iterator.next ();

            try {
                factory.destroy ();
            } catch (Exception exc) {
            }
        }

        factoryList.clear();
View Full Code Here

            factoryInterface = Class.forName (factoryInterfaceName);

            String factoryImplName = (String)factories.get(factoryInterfaceName);
            Class factoryImpl = Class.forName (factoryImplName);
            Factory factory = (Factory) factoryImpl.newInstance ();

            ContainerUtil.enableLogging(factory, this.getLogger());
            ContainerUtil.contextualize(factory, this.context);
            ContainerUtil.service(factory, this.manager);
            ContainerUtil.initialize(factory);
           
            factory.init(this.servletConfig, new HashMap());

            factoryMap.put (factoryInterface.getName(), factory);

            // build up list in reverse order for later destruction
            factoryList.add (0, factory);
View Full Code Here

     */
    public void dispose() {

        // destroy the services in reverse order
        for (Iterator iterator = factoryList.iterator (); iterator.hasNext (); ) {
            Factory factory = (Factory) iterator.next ();

            try {
                factory.destroy ();
            } catch (Exception exc) {
            }
        }

        factoryList.clear();
View Full Code Here

    // Additional methods
   
    private void addFactory(String factoryInterfaceName, String factoryImplName) throws Exception {
        Class factoryInterface = Class.forName(factoryInterfaceName);
        Class factoryImpl = Class.forName(factoryImplName);
        Factory factory = (Factory)factoryImpl.newInstance();
        factory.init(servletConfig, properties);
        addFactory(factoryInterface, factory);
    }
View Full Code Here

     * @return
     * @throws java.lang.Exception
     */
    protected Object createInstance() throws Exception
    {
        Factory factory;
        if(bean == null && className != null)           
        {
            factory = (Factory)Thread.currentThread()
                .getContextClassLoader().loadClass(className).newInstance();
        }
        else if(bean != null)
        {
            factory = (Factory)bean;
        }
        else
        {
            throw new BeanCreationException("PlutoFactoryFactoryBean requires either a 'className' or a 'bean' reference to be set.");
        }
       
        if(props == null)
        {
            props = new HashMap();
        }
       
        factory.init(servletConfig, props);
        return factory; 
    }
View Full Code Here

     * @return
     * @throws java.lang.Exception
     */
    protected Object createInstance() throws Exception
    {
        Factory factory;
        if(bean == null && className != null)           
        {
            factory = (Factory)Thread.currentThread()
                .getContextClassLoader().loadClass(className).newInstance();
        }
        else if(bean != null)
        {
            factory = (Factory)bean;
        }
        else
        {
            throw new BeanCreationException("PlutoFactoryFactoryBean requires either a 'className' or a 'bean' reference to be set.");
        }
       
        if(props == null)
        {
            props = new HashMap();
        }
       
        factory.init(servletConfig, props);
        return factory; 
    }
View Full Code Here

            factoryInterface = Class.forName (factoryInterfaceName);

            String factoryImplName = (String)me.getValue();
            Class factoryImpl = Class.forName (factoryImplName);
            Factory factory = (Factory) factoryImpl.newInstance ();

            ContainerUtil.enableLogging(factory, this.getLogger());
            ContainerUtil.contextualize(factory, this.context);
            ContainerUtil.service(factory, this.manager);
            ContainerUtil.initialize(factory);
           
            factory.init(this.servletConfig, new HashMap());

            factoryMap.put (factoryInterface.getName(), factory);

            // build up list in reverse order for later destruction
            factoryList.add (0, factory);
View Full Code Here

     */
    public void dispose() {

        // destroy the services in reverse order
        for (Iterator iterator = factoryList.iterator (); iterator.hasNext (); ) {
            Factory factory = (Factory) iterator.next ();

            try {
                factory.destroy ();
            } catch (Exception exc) {
                // ignore it
            }
        }

View Full Code Here

            String factoryImplName = (String)factoryImpls.get(factoryInterfaceName);

            Class factoryImpl = null;

            Factory factory = null;

            try
            {
                factoryImpl = Class.forName (factoryImplName);

                factory = (Factory) factoryImpl.newInstance ();

                Map props = (Map)factoryProps.get(factoryInterfaceName);

                if (context != null)
                    context.log (StringUtils.nameOf (factoryInterface) + " initializing...");

                factory.init (config, props);

                if (context != null)
                    context.log (StringUtils.nameOf (factoryInterface) + " done.");
            }
            catch (ClassNotFoundException exc)
View Full Code Here

TOP

Related Classes of org.apache.pluto.factory.Factory

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.