You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by "Hensley, Richard" <Ri...@McKesson.com> on 2005/05/04 00:37:19 UTC

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


RE: RegistryShutdownListener interface

Posted by James Carman <ja...@carmanconsulting.com>.
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