Package org.apache.avalon.framework.component

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


                    Web3DataSourceSelectorImpl.pools.put(obj, pool);
                }
            }
        } catch (Exception ex) {
            getLogger().error(ex.getMessage(), ex);
            throw new ComponentException(ex.getMessage());
        } finally {
            Web3DataSourceSelectorImpl.lock.release();
        }
        getLogger().debug("Returning Web3DataSource[" + pool + "]");
        return pool;
View Full Code Here


            this.manager.addComponentInstance(Action.ROLE + "Selector", this.actions);
            this.manager.addComponentInstance(Matcher.ROLE + "Selector", this.matchers);
            this.manager.addComponentInstance(Selector.ROLE + "Selector", this.selectors);
        } catch (Exception e) {
            getLogger().error("cannot obtain the Component", e);
            throw new ComponentException("cannot obtain the URLFactory", e);
        }
    }
View Full Code Here

        }

        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();
            final Map components = (Map)objects[2];
            try {
                if (component instanceof Recomposable) {
                    ((Recomposable) component).recompose(this);
                }
                ((RequestLifecycleComponent) component).setup((org.apache.cocoon.environment.SourceResolver)objects[0],
                                                              (Map)objects[1]);
            } catch (Exception local) {
                throw new ComponentException("Exception during setup of RequestLifecycleComponent with role '"+role+"'", local);
            }
            components.put(role, new Object[] {component, this});
        }
        return component;
    }
View Full Code Here

    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

    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

            this.preparedPattern = matcher.preparePattern(MapStackResolver.unescape(this.pattern));

        } catch(PatternException pe) {
            String msg = "Invalid pattern '" + this.pattern + "' for matcher at " + this.getLocation();
            getLogger().error(msg, pe);
            throw new ComponentException(msg, pe);

        } finally {
            if (this.threadSafeMatcher == null) {
                selector.release(matcher);
            }
View Full Code Here

        this.manager = manager;

        try {
            this.classManager = (ClassLoaderManager) manager.lookup(ClassLoaderManager.ROLE);
        } catch (ComponentException cme) {
            throw new ComponentException("GeneratorSelector", cme);
        }

        try {
            this.classManager.addDirectory((File) this.m_context.get(Constants.CONTEXT_WORK_DIR));
        } catch (Exception e) {
            throw new ComponentException("Could not add repository to ClassLoaderManager", e);
        }
    }
View Full Code Here

    public Component select(Object hint) throws ComponentException {

        ComponentHandler handler = (ComponentHandler) this.componentHandlers.get(hint);
        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

            return this.manager.lookup(roleName);
        }
        catch( Exception e )
        {
            String msg = "Failed to lookup role " + roleName;
            throw new ComponentException(roleName,msg,e);
        }
    }
View Full Code Here

            getLogger().debug(this.getClass().getName() + " created according to " + destination);
        } catch (Exception e) {
            final String message = "Failed to retrieve Store component:" + e.getMessage();
            getLogger().error(message, e);
            e.printStackTrace();
            throw new ComponentException(message, e);
        }
    }
View Full Code Here

TOP

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

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.