Package org.apache.excalibur.event.command

Examples of org.apache.excalibur.event.command.CommandManager


           
            try
            {
                DefaultContext setup = (DefaultContext)this.context;
                threads = new TPCThreadManager();
                CommandManager commands = new CommandManager();
               
                Parameters params = new Parameters();
                params.setParameter("threads-per-processor", "1");
                params.setParameter("sleep-time", "100");
                params.setParameter("block-timeout", "1000");
                params.setParameter("force-shutdown", "false");
                params.makeReadOnly();
               
                ContainerUtil.enableLogging(threads, getLogger().getChildLogger("thread.manager"));
                ContainerUtil.parameterize(threads, params);
                ContainerUtil.initialize(threads);
               
                threads.register(commands);
               
                setup.put(Queue.ROLE, commands.getCommandSink());
               
                setup.makeReadOnly();
            }
            catch (Exception e)
            {
View Full Code Here


               
                ContainerUtil.enableLogging(this.threads, getLogger().getChildLogger("thread.manager"));
                ContainerUtil.parameterize(this.threads, params);
                ContainerUtil.initialize(this.threads);
               
                this.commands = new CommandManager();
                ContainerUtil.enableLogging(this.commands, getLogger().getChildLogger("thread.manager"));
                this.threads.register(this.commands);
               
                setup.put(Queue.ROLE, this.commands.getCommandSink());
               
View Full Code Here

               
                ContainerUtil.enableLogging(this.threads, getLogger().getChildLogger("thread.manager"));
                ContainerUtil.parameterize(this.threads, params);
                ContainerUtil.initialize(this.threads);
               
                this.commands = new CommandManager();
                ContainerUtil.enableLogging(this.commands, getLogger().getChildLogger("thread.manager"));
                this.threads.register(this.commands);
               
                setup.put(Queue.ROLE, this.commands.getCommandSink());
               
View Full Code Here

           
            try
            {
                DefaultContext setup = (DefaultContext)this.context;
                threads = new TPCThreadManager();
                CommandManager commands = new CommandManager();
               
                Parameters params = new Parameters();
                params.setParameter("threads-per-processor", "1");
                params.setParameter("sleep-time", "100");
                params.setParameter("block-timeout", "1000");
                params.setParameter("force-shutdown", "false");
                params.makeReadOnly();
               
                ContainerUtil.enableLogging(threads, getLogger().getChildLogger("thread.manager"));
                ContainerUtil.parameterize(threads, params);
                ContainerUtil.initialize(threads);
               
                threads.register(commands);
               
                setup.put(Queue.ROLE, commands.getCommandSink());
               
                setup.makeReadOnly();
            }
            catch (Exception e)
            {
View Full Code Here

               
                ContainerUtil.enableLogging(this.threads, getLogger().getChildLogger("thread.manager"));
                ContainerUtil.parameterize(this.threads, params);
                ContainerUtil.initialize(this.threads);
               
                this.commands = new CommandManager();
                ContainerUtil.enableLogging(this.commands, getLogger().getChildLogger("thread.manager"));
                this.threads.register(this.commands);
               
                setup.put(Queue.ROLE, this.commands.getCommandSink());
               
View Full Code Here

            this.context = new ComponentContext(context);
           
            try {
                DefaultContext setup = (DefaultContext)this.context;
                threads = new TPCThreadManager();
                CommandManager commands = new CommandManager();
               
                Parameters params = new Parameters();
                params.setParameter("threads-per-processor", "1");
                params.setParameter("sleep-time", "100");
                params.setParameter("block-timeout", "1000");
                params.setParameter("force-shutdown", "false");
                params.makeReadOnly();
               
                ContainerUtil.enableLogging(threads, getLogger().getChildLogger("thread.manager"));
                ContainerUtil.parameterize(threads, params);
                ContainerUtil.initialize(threads);
               
                threads.register(commands);
               
                setup.put(Queue.ROLE, commands.getCommandSink());
               
                setup.makeReadOnly();
            } catch (Exception e) {
                getLogger().error("Could not set up the Command Manager", e);
            }
View Full Code Here

            this.context = new ComponentContext(context);
           
            try {
                DefaultContext setup = (DefaultContext)this.context;
                threads = new TPCThreadManager();
                CommandManager commands = new CommandManager();
               
                Parameters params = new Parameters();
                params.setParameter("threads-per-processor", "1");
                params.setParameter("sleep-time", "100");
                params.setParameter("block-timeout", "1000");
                params.setParameter("force-shutdown", "false");
                params.makeReadOnly();
               
                ContainerUtil.enableLogging(threads, getLogger().getChildLogger("thread.manager"));
                ContainerUtil.parameterize(threads, params);
                ContainerUtil.initialize(threads);
               
                threads.register(commands);
               
                setup.put(Queue.ROLE, commands.getCommandSink());
               
                setup.makeReadOnly();
            } catch (Exception e) {
                getLogger().error("Could not set up the Command Manager", e);
            }
View Full Code Here

               
                ContainerUtil.enableLogging(this.threads, getLogger().getChildLogger("thread.manager"));
                ContainerUtil.parameterize(this.threads, params);
                ContainerUtil.initialize(this.threads);
               
                this.commands = new CommandManager();
                ContainerUtil.enableLogging(this.commands, getLogger().getChildLogger("thread.manager"));
                this.threads.register(this.commands);
               
                setup.put(Queue.ROLE, this.commands.getCommandSink());
               
View Full Code Here

               
                ContainerUtil.enableLogging(this.threads, getLogger().getChildLogger("thread.manager"));
                ContainerUtil.parameterize(this.threads, params);
                ContainerUtil.initialize(this.threads);
               
                this.commands = new CommandManager();
                ContainerUtil.enableLogging(this.commands, getLogger().getChildLogger("thread.manager"));
                this.threads.register(this.commands);
               
                setup.put(Queue.ROLE, this.commands.getCommandSink());
               
View Full Code Here

     * @return a default <code>CommandSink</code>
     * @throws Exception if an error occurs
     */
    private Sink createCommandSink() throws Exception
    {
        final CommandManager cm = new CommandManager();

        assumeOwnership( cm );

        // Set the CommandFailureHandler
        Class failureHandlerClass;
        try
        {
            failureHandlerClass = (Class)m_rootContext.get( COMMAND_FAILURE_HANDLER_CLASS );
        }
        catch ( ContextException ce )
        {
            // Not set.  Use the default.
            failureHandlerClass = FortressCommandFailureHandler.class;
        }
        CommandFailureHandler fh = (CommandFailureHandler)failureHandlerClass.newInstance();
        final Logger fhLogger = m_loggerManager.getLoggerForCategory( "system.command" );
        ContainerUtil.enableLogging( fh, fhLogger );
        ContainerUtil.initialize( fh );
        cm.setCommandFailureHandler( fh );

        m_threadManager.register( cm );

        return cm.getCommandSink();
    }
View Full Code Here

TOP

Related Classes of org.apache.excalibur.event.command.CommandManager

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.