On Monday 08 July 2002 01:21 pm, Marcus Crafter wrote:
>       One of my ThreadSafe components wasn't being start()ed until I
>       actually looked it up. If I forced sync init, everything worked
>       fine, but with async init, it didn't.

Just guessing here, but could another component have stalled the queue?

>       Ok, so you created a command queue instead of using the default
>       one that's created if its not specified. Would be great if you
>       could post the code how its created & registered with the
>       ThreadManager ? :)

    private ContextBuilder createContextBuilder() throws Exception
    {
        final ContextBuilder builder = new ContextBuilder( createContext() );
        final CommandManager cm = new CommandManager();

        this.m_containerConfiguration =
          ConfigurationHelper.buildConfiguration( 
Thread.currentThread().getContextClassLoader(),
                                                  
this.m_blockConfiguration.getChild( Constants.CONFIG_XCONF_FILE ).getValue() 
);

        createThreadManager( cm );

        this.m_roleManager = createRoleManager();

        builder.setContainerClass( ObjectModelContainer.class );
        builder.setContextDirectory( m_blockContext.getBaseDirectory() );
        builder.setWorkDirectory( m_blockContext.getBaseDirectory() );
        builder.setComponentManagerParent( this.m_blocksManager );
        builder.setContainerConfiguration( this.m_containerConfiguration );
        builder.setRoleManager( this.m_roleManager );
        builder.setLoggerManager( new LoggerLoggerManager( 
getLogger().getChildLogger( "container" ) ) );
        builder.setCommandQueue( cm.getCommandQueue() );
//        builder.setCommandQueue( null );

        return builder;
    }

    private void createThreadManager( final CommandManager cm ) throws 
Exception
    {
        this.m_containerThreadManager = new TPCThreadManager();

        ContainerUtil.enableLogging( this.m_containerThreadManager, 
getLogger().getChildLogger( "thread-manager" ) );
        ContainerUtil.parameterize( this.m_containerThreadManager, 
createThreadManagerParameters() );
        ContainerUtil.initialize( this.m_containerThreadManager );

        this.m_containerThreadManager.register( cm );
    }

    private Parameters createThreadManagerParameters()
    {
        Parameters p = new Parameters();

        p.setParameter( "threads-per-processor", "2" );

        return p;
    }


>       Unfortunately setCommandQueue(null) does not disable async init,
>       as I thought it would due to OverridableContext which throws an
>       exception if a null is stored :(

imho we need an explicit way to disable the async.
-pete

-- 
peter royal -> [EMAIL PROTECTED]

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to