Package org.apache.avalon.framework.component

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


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

        Component component = null;

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


     * @return a <code>Component</code>
     * @exception Exception if an error occurs
     */
    public Component get() throws Exception
    {
        Component component = doGet();

        synchronized( m_referenceSemaphore )
        {
            m_references++;
        }
View Full Code Here

        ContainerUtil.dispose(startupManager);
        startupManager = null;

        // add the logger manager to the component locator
        final ComponentProxyGenerator proxyGenerator = new ComponentProxyGenerator();
        final Component loggerManagerProxy = proxyGenerator.getProxy(LoggerManager.class.getName(),loggerManager);
        componentManager.addComponentInstance(LoggerManager.ROLE,loggerManagerProxy);

        ContainerUtil.initialize(this.componentManager);

        // Get the Processor and keep it if it's ThreadSafe
View Full Code Here

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

        try {
            Component 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

     * 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

    void release() {
        if ( this.requestLifecycleComponents != null ) {
            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 );
            }
            this.requestLifecycleComponents.clear();
        }
       
        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

            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

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.