Package org.apache.avalon.framework.component

Examples of org.apache.avalon.framework.component.Component


        if ( null != stack && !stack.empty()) {
            final Object[] objects = (Object[])stack.getCurrent();
            final Map objectModel = ((Environment)objects[0]).getObjectModel();
            EnvironmentDescription desc = (EnvironmentDescription)objectModel.get(PROCESS_KEY);
            if ( null != desc ) {
                final Component component = desc.getRequestLifecycleComponent(role);
                if (null != component) {
                    return component;
                }
            }
        }

        final Component component = super.lookup( role );
        if (null != component && component instanceof RequestLifecycleComponent) {
            if (stack == null || stack.empty()) {
                throw new ComponentException(role, "ComponentManager has no Environment Stack.");
            }
            final Object[] objects = (Object[]) stack.getCurrent();
View Full Code Here


     */
    void release() {
        final Iterator iter = this.requestLifecycleComponents.values().iterator();
        while (iter.hasNext()) {
            final Object[] o = (Object[])iter.next();
            final Component component = (Component)o[0];
            ((CocoonComponentManager)o[1]).releaseRLComponent( component );
        }
       
        for(int i = 0; i < autoreleaseComponents.size(); i++) {
            final Object[] o = (Object[])autoreleaseComponents.get(i);
            final Component component = (Component)o[0];
            if (o[1] instanceof ComponentManager) {
                ((ComponentManager)o[1]).release( component );
            } else {
                ((ComponentSelector)o[1]).release( component );
                if (o[2] != null) {
View Full Code Here

        for (Iterator it = lookupComponents.iterator(); it.hasNext();)
        {
            String component = (String) it.next();
            try
            {
                Component c = manager.lookup(component);
                log.info("Lookup for Component " + component + " successful");
                manager.release(c);
            }
            catch (Exception e)
            {
View Full Code Here

        throws Exception
    {
        Integer testInt = new Integer( 7 );
        ComponentProxyGenerator proxyGen = new ComponentProxyGenerator();

        final Component component =
            proxyGen.getProxy( "java.lang.Comparable", testInt );
        assertTrue( component != null );
        assertTrue( component instanceof Comparable );

        Comparable comp = (Comparable)component;
View Full Code Here

        m_manager.addComponent( Dad.ROLE, dadClass, emptyConfig );
        m_manager.addComponent( Kid.ROLE, kidClass, emptyConfig );

        m_manager.initialize();

        Component mom = m_manager.lookup( Mom.ROLE );
        Component dad = m_manager.lookup( Dad.ROLE );

        m_manager.release( mom );
        m_manager.release( dad );

        m_manager.dispose();
View Full Code Here

                getLogger().debug( message );
            }
            throw new ComponentException( hint.toString(), message );
        }

        Component component = null;

        try
        {
            component = handler.get();
        }
View Full Code Here

            try {
                return super.select(hint);

            } catch(ComponentException ce) {
                // Doesn't exist here : try in parent selector
                final Component component = this.parentSelector.select(hint);
                return component;
            }
        }
    }
View Full Code Here

        if (handler == null) {
            throw new ComponentException(ROLE, "Could not find component for hint: " + hint);
        }

        try {
            Component component = handler.get();
            componentMapping.put(component, handler);
            return component;
        } catch (Exception ce) {
            if (getLogger().isDebugEnabled())
                getLogger().debug("Could not access component for hint: " + hint, ce);
View Full Code Here

                getLogger().debug( message + " for role: " + role );
            }
            throw new ComponentException( role, message );
        }

        Component component = null;

        try
        {
            component = handler.get();
        }
View Full Code Here

        //  with the ECM.  We need to remember to unwrap this when the component is
        //  decommissioned.
    //
    // note that ComponentHandler depends on this specific
    // component instanceof Component check to be made
        Component returnableComponent;
        if( !( component instanceof Component ) )
        {
            returnableComponent = m_proxyGenerator.getCompatibleProxy( component );
            m_componentProxies.put( returnableComponent, component );
        }
View Full Code Here

TOP

Related Classes of org.apache.avalon.framework.component.Component

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.