Examples of ComponentException


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

        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(ROLE, "Could not add repository to ClassLoaderManager", e);
        }
    }
View Full Code Here

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

    public Component select(Object hint) throws ComponentException {

        ComponentHandler handler = (ComponentHandler) this.componentHandlers.get(hint);
        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);
            throw new ComponentException(ROLE, "Could not access component for hint: " + hint, ce);
        }
    }
View Full Code Here

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

        try {
            this.preparedPattern = matcher.preparePattern(this.pattern);

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

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

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

        = (ComponentSelector)manager.lookup(Interpreter.ROLE);
      // Obtain the Interpreter instance for this language
      interpreter = (Interpreter)selector.select(language);
    }
    catch (Exception ex) {
      throw new ComponentException("ScriptNode: Couldn't obtain a flow "
                                   + "interpreter for " + language
                                   + ": " + ex);
    }
  }
View Full Code Here

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

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

            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

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

        }

        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

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

    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

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

    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

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

            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
TOP
Copyright © 2018 www.massapi.com. 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.