Package org.apache.avalon.framework.component

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


            if (objects[3] == ONE) {
                final Map components = (Map)objects[2];
                final Iterator iter = components.values().iterator();
                while (iter.hasNext()) {
                    final Object[] o = (Object[])iter.next();
                    final Component component = (Component)o[0];
                    ((CocoonComponentManager)o[1]).releaseRLComponent( component );
                }
            }
        }
    }
View Full Code Here


        if ( null != stack && !stack.empty()) {
            final Object[] objects = (Object[])stack.peek();
            final Map components = (Map)objects[2];
            final Object[] o = (Object[])components.get(role);
            if ( null != o  ) {
                final Component component = (Component) o[0];
                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("ComponentManager has no Environment Stack.");
            }
            final Object[] objects = (Object[]) stack.peek();
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

     * @param environment an <code>Environment</code> value
     * @exception Exception if an error occurs
     */
    public void generateSitemap(Environment environment)
    throws Exception {
        Component processor = this.componentManager.lookup(Processor.ROLE);
        try {
            if (processor instanceof SitemapManager) {
                ((SitemapManager)processor).generateSitemap(environment);
            }
        } finally {
View Full Code Here

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

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

            throw new RuntimeException("Inbound spool not defined");
        }
    }

    public boolean hasComponent( Object hint ) {
        Component comp = null;
        try {
            comp = select(hint);
        } catch(ComponentException ex) {
            getLogger().error("Exception AvalonMailStore.hasComponent-"+ex.toString());
        }
View Full Code Here

            return super.select(hint);
        } catch (Exception e) {
            // if it isn't loaded, it may already be compiled...
            try {
                ComponentHandler handler = (ComponentHandler) this.componentHandlers.get(hint);
                Component component = (Component) handler.get();
                componentMapping.put(component, handler);
                return component;
            } catch (Exception ce) {
                getLogger().debug("Could not access component for hint: " + hint);
                throw new ComponentException("Could not access component for hint: " + hint, 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

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.