commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard M. Lewis Ship" <>
Subject RE: [HiveMind] Destroy service
Date Mon, 29 Sep 2003 12:14:31 GMT
I'm thinking something like (let's figure out better names):

public interface Manageable
  public void enlistService();

  public void poolService();

  public void shutdownService();

enlistService() -- invoked at creation, and as a pooled service instance is removed from the
and enlisted/attached to a thread.

poolService() -- invoked during thread cleanup, before returning a service to a pool (if the
model supports pooling).

shutdownService() -- invoked in response to Registry.shutdown(); affects both active (out
of the
pool) and inactive (in the pool) services.

Howard M. Lewis Ship
Creator, Tapestry: Java Web Components

> -----Original Message-----
> From: Christian Essl [] 
> Sent: Sunday, September 28, 2003 5:46 PM
> To:
> Subject: [HiveMind] Destroy service
> I've written a Service which registers Destroyable Services 
> (a special 
> interface which must be implemented by the service-interace) 
> and keeps 
> dependencies between Services. When the application using a 
> Registry shut- 
> downs (and no other thread is using the Registry anymore) it 
> calls on the 
> Service destroy() and the Service will call the destroy() 
> methods on all 
> the registered Services in the right order.
> This helps me in my project to easier maintain the right 
> shut-down for 
> Services which need information about ie when they should release 
> resources.
> Currently the dependencies and registration of the Services 
> happens through 
> contributions. However when Howard makes it possible to get 
> the Shema and I 
> can implement a ConfigurationBeanFactory I think of 
> implementing a special 
> rule and transformer which automaticly registers a 
> dependend/destryable 
> object when the user creates one or gives it to aother 
> service. This would 
> free the user of a service-implementation of filling in the 
> dependency- 
> contribution, which is of course error-prone.
> Is there any intrest in such a Service to be included in HiveMind?
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message