Package org.apache.avalon.framework.component

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


        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

     * is <code>ThreadSafe</code>, and return it if true.
     * <p>
     * Note : this method must be called <i>after</i> <code>setSelector()</code>.
     */
    protected Component getThreadSafeComponent(String name) throws ComponentException {
        Component component = this.selector.select(name);
        if (component instanceof ThreadSafe) {
            return component;
        } else {
            this.selector.release(component);
            return null;
View Full Code Here

            this.parentSelector = newSelector;
        }
    }

    public Component select(Object hint) throws ComponentException {
        Component component = null;

        try {
            component = super.select(hint);
        } catch (ComponentException ce) {
            if (this.parentSelector != null) {
View Full Code Here

     * @exception ComponentException if a bundle is not found
     */
    public Component select(String name, Locale loc, boolean cacheAtStartup)
        throws ComponentException
    {
        Component bundle = _select(name, loc, cacheAtStartup);
        if (bundle == null)
            throw new ComponentException("Unable to locate resource: " + name);
        return bundle;
    }
View Full Code Here

     * @exception ComponentException if a bundle is not found
     */
    public Component selectFromFilename(String fileName, boolean cacheAtStartup)
        throws ComponentException
    {
        Component bundle = _select(fileName, null, cacheAtStartup);
        if (bundle == null)
            throw new ComponentException("Unable to locate resource: " + fileName);
        return bundle;
    }
View Full Code Here

     * @param fileName          file name of the bundle
     * @return                  the cached bundle; null, if not found
     */
    protected Component selectCached(String fileName)
    {
        Component bundle = null;
        try
        {
            bundle = super.select(fileName);
            if (logger.isDebugEnabled()) logger.debug("Returning from cache: " + fileName);
        }
View Full Code Here

            try {
                return super.select(hint);

            } catch(ComponentException ce) {
                // Doesn't exist here : try in parent selector
                Component component = this.parentSelector.select(hint);
                this.parentComponents.add(component);
                return component;
            }
        }
    }
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.