avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Sutic" <leo.su...@inspireinfrastructure.com>
Subject RE: Problem with asynchronous disposing in fortress
Date Tue, 06 Aug 2002 14:33:58 GMT
Berin, could you put this into CommandManager:

    public void dispose () 
    {
        QueueElement[] remainingElements =
getCommandQueue().dequeueAll();
        if (remainingElements != null)
        {
            for( int i = 0; i < remainingElements.length; i++ )
            {
                getEventHandler.handleEvent( remainingElements[i] );
            }
        }
    }

and have it implement Disposable:

import org.apache.avalon.framework.activity.Disposable;

/**
 * The CommandManager handles asynchronous commands from the rest of the
system.
 * The only exposed piece is the Queue that other components use to give
Commands
 * to this system.  You <strong>must</strong> register this with a
ThreadManager
 * for it to work.
 *
 * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
 */
public class CommandManager implements EventPipeline, Disposable


------------

I was just thinking... Shouldn't the CommandManager take a ThreadManager
as a parameter to its constructor and deregister itself when disposed?

/LS

> -----Original Message-----
> From: Leo Sutic [mailto:leo.sutic@inspireinfrastructure.com] 
> Sent: den 6 augusti 2002 16:27
> To: 'Avalon Developers List'; bloritsch@apache.org
> Subject: RE: Problem with asynchronous disposing in fortress
> 
> 
> Ran into a bit of a problem...
> 
> It doesn't compile. The instrument-manager etc. appear broken.
> 
> /LS
> 
> > -----Original Message-----
> > From: Berin Loritsch [mailto:bloritsch@apache.org]
> > Sent: den 6 augusti 2002 15:57
> > To: 'Avalon Developers List'
> > Subject: RE: Problem with asynchronous disposing in fortress
> > 
> > 
> > > From: Leo Sutic [mailto:leo.sutic@inspireinfrastructure.com]
> > > 
> > > > From: Leo Sutic [mailto:leo.sutic@inspireinfrastructure.com]
> > > > 
> > > > > From: Berin Loritsch [mailto:bloritsch@apache.org]
> > > > >
> > > > > Aha!  It is a bug introduced by the whole assume ownerhip
> > > stuff. I
> > > > > didn't like it because instead of *using* what someone
> > > else owned,
> > > > > it stole it from them.
> > > > 
> > > > Not really. The the contextmanager will only assume
> > ownership of the
> > > > managers it creates itself:
> > > > 
> > > >         CommandManager cm = new CommandManager();
> > > >         assumeOwnership( cm );
> > > >         childContext.put( COMMAND_QUEUE, cm.getCommandQueue() );
> > > > 
> > > > What should be done is to put a flush() operation in the command
> > > > manager's dispose method.
> > > 
> > > Berin,
> > > 
> > > if you agree with the solution outlined above, you fine 
> with letting 
> > > me implement it?
> > 
> > 
> > Go for it.
> > 
> > 
> > --
> > To unsubscribe, e-mail:   
> > <mailto:avalon-dev-> unsubscribe@jakarta.apache.org>
> > For
> > additional commands, 
> > e-mail: <mailto:avalon-dev-help@jakarta.apache.org>
> > 
> > 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:avalon-dev-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <mailto:avalon-dev-help@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message