avalon-phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <pe...@apache.org>
Subject Re: managing applications
Date Wed, 06 Mar 2002 09:15:52 GMT
On Wed, 6 Mar 2002 19:50, Leo Simons wrote:
> > In this case I believe it is the responsibility of the Block to kill the
> > connection - I usually do it in dispose.
> so should Block extend Disposable? Dunno.

If it allocates any resources in an initialize() it should ;)

> Should a stop() of an application dispose()
> a block?

No. but a stop on an application MBean should ;)

ie I would not have made the Application object implement the 
ApplicationMBean interface. I would have created a wrapper "manager" object 
that would then delegate to Kernel to do the work (including undeploying and 
redeploying etc). 

> > > Or should there be
> > > more intelligence in DefaultApplication
> > > to avoid problems like aforementioned?
> >
> > Got any ideas on how we would do this?
> 1) check whether Block implements Stoppable
> 2) if yes, stop()
> 3) if not, check for Disposable
> 4) if yes, dispose()
> 5) if not, dereference the block completely,
> then call System.gc()

That would still not work unfortunatatly as System.gc() is not really 
guarenteed to do anything ;(

> if:
> - the Block binds resources during initialize()
> - the Block does not bind resource during start()
> - the Block does not unbing resource during stop()
> - the Block unbinds resource during dispose()

Thats the way I do it.

> - calling initialize() on the Application calls
>   initialize() on its Blocks
> - calling start() on the Application calls start()
>   on its Blocks
> - calling stop() on the Application calls stop()
>   on its Blocks
> - calling dispose() on the Application calls
>   dispose() on its Blocks
> there is no problem. I'm guessing there's a little
> logic error in both XCommander and in
> DefaultApplication, which results in a bigger problem.

As I said I had planned to make wrapper MBeans rather than directly exposing 
DefaultApplication as a MBean directly.

> Anyway, going away for 1 1/2 week, so this will have
> to wait a little =)

Have fun. I am getting ready for a 5 day music festival and leaving tomorrow 
morning so I wont be around much either.



 Mark Twain: "In the real world, the right thing never
happens in the right place at the right time. It is 
the task of journalists and historians to rectify 
this error."

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

View raw message