avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leif Mortenson <l...@silveregg.co.jp>
Subject Re: Avoiding disposal of unreleased components at system shutdown
Date Wed, 13 Feb 2002 08:57:47 GMT

Peter Donald wrote:

>On Tue, 12 Feb 2002 14:47, Ryan Shaw wrote:
>>I have a question about the disposal of unreleased components
>>at system shutdown.
>>In the example above, this would force users
>>to release MyComponent at system shutdown before disposing of
>>the ExcaliburComponentManager to avoid warnings.
>>What do you think?
>It is a problem and the way I would solve it was being able to specify 
>dependencies between services. So service 1 can depend on service2 and so 
>forth and then you can explicitly determine the order that it is acceptable 
>to shutdown things. At least thats the way Phoenix does it ;)
Wouldn't it also be possible just to keep track of the number of lookups 
- releases.  Then when you want to dispose the ComponentManager go into 
a loop.  Call dispose on any components whose count is 0. Disposing them 
should release other components.  Repeat.  If you reach a point where 
you don't have any components with a count of 0, then this is an error 
and a warning should be displayed before going ahead and disposing the 
rest of them.

This way the ComponentManager takes care of the dependencies on its own 
without requiring the developer to set up their dependencies correctly.


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

View raw message