commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard M. Lewis Ship" <hls...@comcast.net>
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
pool
and enlisted/attached to a thread.

poolService() -- invoked during thread cleanup, before returning a service to a pool (if the
service
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
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: Christian Essl [mailto:christianessl@yahoo.de] 
> Sent: Sunday, September 28, 2003 5:46 PM
> To: commons-dev@jakarta.apache.org
> 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: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


Mime
View raw message