Examples of ExcaliburComponentManager


Examples of org.apache.avalon.excalibur.component.ExcaliburComponentManager

        roles.enableLogging(logger);
        roles.configure(roleConfig);

        // Setup ECM
        manager = new ExcaliburComponentManager();

        manager.setLoggerManager(lm);
        manager.enableLogging(logger);

        DefaultContext context = new DefaultContext();
View Full Code Here

Examples of org.apache.avalon.excalibur.component.ExcaliburComponentManager

            parser = System.getProperty(Constants.PARSER_PROPERTY, Constants.DEFAULT_PARSER);
        }
        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Using parser: " + parser);
        }
        ExcaliburComponentManager startupManager = new ExcaliburComponentManager((ClassLoader)this.context.get(Constants.CONTEXT_CLASS_LOADER));
        startupManager.enableLogging(getLogger().getChildLogger("startup"));
        startupManager.contextualize(this.context);
        startupManager.setLogKitManager(this.logKitManager);

        try {
            startupManager.addComponent(SAXParser.ROLE, ClassUtils.loadClass(parser), new org.apache.avalon.framework.configuration.DefaultConfiguration("", "empty"));
        } catch (Exception e) {
            throw new ConfigurationException("Could not load parser " + parser, e);
        }

        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Classpath = " + classpath);
            getLogger().debug("Work directory = " + workDir.getCanonicalPath());
        }
        startupManager.initialize();

        this.configure(startupManager);
        startupManager.dispose();
        startupManager = null;

        this.componentManager.initialize();

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

Examples of org.apache.avalon.excalibur.component.ExcaliburComponentManager

        this.logKitManager = logKitManager;
    }

    public void initialize() throws Exception {
        if(parentComponentManager != null)
            this.componentManager = new ExcaliburComponentManager(parentComponentManager,(ClassLoader)this.context.get(Constants.CONTEXT_CLASS_LOADER));
        else
            this.componentManager = new ExcaliburComponentManager((ClassLoader)this.context.get(Constants.CONTEXT_CLASS_LOADER));
        this.componentManager.setLogger(getLogger());
        this.componentManager.contextualize(this.context);

        getLogger().debug("New Cocoon object.");

        // Log the System Properties.
        dumpSystemProperties();

        // Setup the default parser, for parsing configuration.
        // If one need to use a different parser, set the given system property
        String parser = System.getProperty(Constants.PARSER_PROPERTY, Constants.DEFAULT_PARSER);
        getLogger().debug("Using parser: " + parser);
        ExcaliburComponentManager startupManager = new ExcaliburComponentManager((ClassLoader)this.context.get(Constants.CONTEXT_CLASS_LOADER));
        startupManager.setLogger(getLogger());
        startupManager.contextualize(this.context);
        startupManager.setLogKitManager(this.logKitManager);

        try {
            startupManager.addComponent(Parser.ROLE, ClassUtils.loadClass(parser), null);
        } catch (Exception e) {
            getLogger().error("Could not load parser, Cocoon object not created.", e);
            throw new ConfigurationException("Could not load parser " + parser, e);
        }

        try {
            getLogger().debug("Creating Repository with this directory: " + this.workDir);
            FilesystemStore repository = new FilesystemStore();
            repository.setLogger(getLogger());
            repository.setDirectory(this.workDir);
            this.componentManager.addComponentInstance(Store.ROLE + "/Filesystem", repository);
        } catch (IOException e) {
            getLogger().error("Could not create repository!", e);
            throw new ConfigurationException("Could not create the repository!", e);
        }

        getLogger().debug("Classpath = " + classpath);
        getLogger().debug("Work directory = " + workDir.getCanonicalPath());
        startupManager.initialize();

        Configuration conf = this.configure(startupManager);
        startupManager.dispose();

        this.componentManager.initialize();

        getLogger().debug("Setting up the sitemap.");
        // Create the sitemap
View Full Code Here

Examples of org.apache.avalon.excalibur.component.ExcaliburComponentManager

     *
     * @exception Exception if an error occurs
     */
    public void initialize() throws Exception {
        if (parentComponentManager != null) {
            this.componentManager = new ExcaliburComponentManager(parentComponentManager,(ClassLoader)this.context.get(Constants.CONTEXT_CLASS_LOADER));
        } else {
            this.componentManager = new ExcaliburComponentManager((ClassLoader)this.context.get(Constants.CONTEXT_CLASS_LOADER));
        }
        this.componentManager.setLogger(getLogger().getChildLogger("manager"));
        this.componentManager.contextualize(this.context);

        if (getLogger().isDebugEnabled()) {
            getLogger().debug("New Cocoon object.");
        }

        // Log the System Properties.
        dumpSystemProperties();

        // Setup the default parser, for parsing configuration.
        // If one need to use a different parser, set the given system property
        // first check for deprecated property to be compatible:
        String parser = System.getProperty(Constants.DEPRECATED_PARSER_PROPERTY, Constants.DEFAULT_PARSER);
        if ( !Constants.DEFAULT_PARSER.equals( parser ) ) {
            this.getLogger().warn("Deprecated property " +Constants.DEPRECATED_PARSER_PROPERTY+ " is used. Please use "+Constants.PARSER_PROPERTY+" instead.");
            if ( "org.apache.cocoon.components.parser.XercesParser".equals(parser) ) {
                parser = "org.apache.avalon.excalibur.xml.XercesParser";
            } else {
                this.getLogger().warn("Unknown value for deprecated property: " +
                                      Constants.DEPRECATED_PARSER_PROPERTY + ", value: " + parser +
                                      ". If you experience problems during startup, check the parser configuration section of the documentation.");
            }
        } else {
            parser = System.getProperty(Constants.PARSER_PROPERTY, Constants.DEFAULT_PARSER);
        }
        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Using parser: " + parser);
        }
        ExcaliburComponentManager startupManager = new ExcaliburComponentManager((ClassLoader)this.context.get(Constants.CONTEXT_CLASS_LOADER));
        startupManager.setLogger(getLogger().getChildLogger("startup"));
        startupManager.contextualize(this.context);
        startupManager.setLogKitManager(this.logKitManager);

        try {
            startupManager.addComponent(Parser.ROLE, ClassUtils.loadClass(parser), new org.apache.avalon.framework.configuration.DefaultConfiguration("", "empty"));
        } catch (Exception e) {
            getLogger().error("Could not load parser, Cocoon object not created.", e);
            throw new ConfigurationException("Could not load parser " + parser, e);
        }

        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Classpath = " + classpath);
            getLogger().debug("Work directory = " + workDir.getCanonicalPath());
        }
        startupManager.initialize();

        this.configure(startupManager);
        startupManager.dispose();
        startupManager = null;

        this.componentManager.initialize();

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

Examples of org.apache.avalon.excalibur.component.ExcaliburComponentManager

    /**
     * Set the current <code>ComponentManager</code> instance used by this
     * <code>Composable</code>.
     */
    public void compose(ComponentManager manager) throws ComponentException {
        this.manager = new ExcaliburComponentManager(manager);
        this.manager.setLogger(getLogger());
        this.manager.contextualize(this.context);
        this.manager.setRoleManager(AbstractSitemap.roleManager);
        this.manager.setLogKitManager(AbstractSitemap.logKitManager);

View Full Code Here

Examples of org.apache.avalon.excalibur.component.ExcaliburComponentManager

            getLogger().debug("Using parser: " + parser);
            getLogger().debug("Classpath = " + classpath);
            getLogger().debug("Work directory = " + workDir.getCanonicalPath());
        }

        ExcaliburComponentManager startupManager = new ExcaliburComponentManager((ClassLoader)this.context.get(Constants.CONTEXT_CLASS_LOADER));
        ContainerUtil.enableLogging(startupManager, getLogger().getChildLogger("startup"));
        ContainerUtil.contextualize(startupManager, this.context);
        startupManager.setLogKitManager(this.logKitManager);

        try {
            startupManager.addComponent(SAXParser.ROLE, ClassUtils.loadClass(parser), new org.apache.avalon.framework.configuration.DefaultConfiguration("", "empty"));
        } catch (Exception e) {
            throw new ConfigurationException("Could not load parser " + parser, e);
        }

        ContainerUtil.initialize(startupManager);
View Full Code Here

Examples of org.apache.avalon.excalibur.component.ExcaliburComponentManager

            getLogger().debug("Using parser: " + parser);
            getLogger().debug("Classpath = " + classpath);
            getLogger().debug("Work directory = " + workDir.getCanonicalPath());
        }

        ExcaliburComponentManager startupManager = new ExcaliburComponentManager((ClassLoader) this.context.get(Constants.CONTEXT_CLASS_LOADER));
        ContainerUtil.enableLogging(startupManager, getLogger().getChildLogger("startup"));
        ContainerUtil.contextualize(startupManager, this.context);
        startupManager.setLoggerManager(this.loggerManager);

        try {
            startupManager.addComponent(SAXParser.ROLE,
                                        ClassUtils.loadClass(parser),
                                        new DefaultConfiguration("", "empty"));
        } catch (Exception e) {
            throw new ConfigurationException("Could not load parser " + parser, e);
        }
View Full Code Here

Examples of org.apache.avalon.excalibur.component.ExcaliburComponentManager

        DefaultRoleManager roleManager = new DefaultRoleManager();
        roleManager.enableLogging(getLogger());
        roleManager.configure(confRM);

        // Set up the ComponentLocator
        ExcaliburComponentManager ecManager = new ExcaliburComponentManager();
        ecManager.enableLogging(getLogger());
        ecManager.contextualize(context);
        ecManager.setRoleManager(roleManager);
        ecManager.setLoggerManager(new DefaultLoggerManager(getLogger()));
        ecManager.configure(confCM);
        ecManager.initialize();
        this.manager = new WrapperServiceManager(ecManager);
    }
View Full Code Here

Examples of org.apache.avalon.excalibur.component.ExcaliburComponentManager

        roles.enableLogging(logger);
        roles.configure(roleConfig);

        // Setup ECM
        manager = new ExcaliburComponentManager();

        manager.setLoggerManager(lm);
        manager.enableLogging(logger);

        DefaultContext context = new DefaultContext();
View Full Code Here

Examples of org.apache.avalon.excalibur.component.ExcaliburComponentManager

        roleManager.setLogger(
            logManager.getLogger( rolesConfig.getAttribute( "logger", "rm" ) ) );
        roleManager.configure( rolesConfig );

        // Set up the ComponentManager
        ExcaliburComponentManager manager = new ExcaliburComponentManager();
        manager.setLogger(
            logManager.getLogger( componentsConfig.getAttribute( "logger", "cm" ) ) );
        manager.setLogKitManager( logManager );
        manager.contextualize( context );
        manager.setRoleManager( roleManager );
        manager.configure( componentsConfig );
        manager.initialize();

        return manager;
    }
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.