Examples of ExcaliburComponentManager


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

        throws Exception
    {
        System.out.println( "Running the JdbcDataSource Example Application" );

        // Create the ComponentManager
        ExcaliburComponentManager manager = createComponentManager();
        try
        {
            // Obtain a reference to the HelloDBService instance
            HelloDBService helloDB = (HelloDBService)manager.lookup( HelloDBService.ROLE );
            try
            {
                handleRequests( helloDB );
            }
            finally
            {
                // Release the HelloDBService instance
                manager.release( helloDB );
                helloDB = null;
            }
        }
        finally
        {
            // Dispose the ComponentManager
            manager.dispose();
        }

        System.out.println();
        System.out.println( "Exiting..." );
        System.exit(0);
View Full Code Here

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

    public ParentComponentManager(final String jndiName) {
        this.jndiName = jndiName;

        // Initialize it here so we can let it be final.
        this.delegate = new ExcaliburComponentManager();
    }
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);
        }
       
        ContainerUtil.initialize(startupManager);
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

        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

    public void setUp() throws Exception
    {
        m_disposals = 0;

        m_manager = new ExcaliburComponentManager();

        final String pattern =
            ( "%5.5{priority} [%40.40{category}]: %{message}\n%{throwable}" );

        org.apache.log.Logger logger = Hierarchy.getDefaultHierarchy().getLoggerFor( getName() );
View Full Code Here

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

    public void compose( ComponentManager manager ) throws ComponentException {

        super.compose( manager );
        if (getLogger().isDebugEnabled())
            getLogger().debug("compose");
        this.manager2 = new ExcaliburComponentManager(manager);
        this.manager2.setLogger(getLogger());
        this.manager2.contextualize(this.context);
        this.manager2.setRoleManager(this.roleManager);

        try {
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());
        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
        String 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());
        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);
        }

        try {
            if (getLogger().isDebugEnabled()) {
                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);
        }

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

        Configuration conf = 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

            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

        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
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.