hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <ja...@carmanconsulting.com>
Subject RE: RegistryShutdownListener interface
Date Wed, 04 May 2005 01:10:24 GMT
Richard,

I asked for this before, I think.  What I wanted was to make a Hibernate
Session a service and have the registry actually call the close() method for
me upon thread cleanup (we should probably name the attribute
"destroy-method" rather than "shutdown-method" so folks know that it can be
called on thread cleanup as well as registry shutdown).  Now, I have to
perform a little trick like I did in the code that came with my article to
automatically close the session on thread cleanup.  I think the service
models would have to take responsibility for making sure that the
destroy-method is called at the appropriate time (registry shutdown for
pooled, singleton, and primitive and upon thread cleanup for threaded),
similar to how I did it in my custom service implementation factory.  I
would recommend creating a JIRA issue for this enhancement request and we
can discuss/vote there.  What do you think?

James

-----Original Message-----
From: Hensley, Richard [mailto:Richard.Hensley@McKesson.com] 
Sent: Tuesday, May 03, 2005 6:37 PM
To: hivemind-user@jakarta.apache.org
Subject: RegistryShutdownListener interface


Would it be possible to make the RegistryShutdownListener interface an
optional thing?

It should be possible to add a shutdown-method attribute to the construct
element of the BuilderFactory, and possible to have the
hivemind.BuilderFactory look for a shutdownService() method.

It seems that this would allow service implementations to be one step closer
to being container agnostic.

We might also want to consider using the shutdownService() method, or
something similiarly named, for when a threaded service is discarded.

I'm reusing some services that have been previously used in Spring. Spring
has a an attribute called destroy-method that is analogous to what I'm
talking about. The beans I'm reusing happen to use this feature of Spring
instead of implementing a Spring specific interface of DisposableBean. 

Fortunately, Hivemind already has the initialize-method attribute, which
these beans also make use of because there is a similar feature in Spring.

Richard


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Mime
View raw message