Thanks it helped a lot...
But I must be doing somewhing wrong as the "registryDidShutdown" never get called.
I have this interface->
public interface ClientSource {
public abstract Client getClient();
public abstract void releaseClient(Client client);
}this is the core service ->
public class ClientSourceImpl implements ClientSource, RegistryShutdownListener {
....
public void registryDidShutdown() {
System.out.println("!!!!! SHUTDOWN !!!!!!");
}
public void initializeService() {
System.out.println("!!!!! STARTUP !!!!!!");
}}
<?xml version="1.0"?>
<module id="service" version="1.0.0">
<contribution configuration-id="hivemind.EagerLoad">
<load service-id="MyClientSource"/>
</contribution>
<service-point id="MyClientSource" interface="....ClientSource">
<invoke-factory service-id="hivemind.BuilderFactory"> <construct class="....ClientSourceImpl">
<set property="configFile" value="my.properties"/>
</construct> </invoke-factory>
<interceptor service-id="hivemind.LoggingInterceptor"/>
</service-point> </module>
everything works fine
Registry registry = RegistryBuilder.constructDefaultRegistry(); ClientSource cs = (ClientSource) registry.getService(ClientSource.class);
.......
System.out.println("before Shutdown");
registry.shutdown();
System.out.println("after Shutdown");
log:
Creating SingletonProxy for service service.MyClientSource
Constructing core service implementation for service service.MyClientSource
Autowired property log to [EMAIL PROTECTED]
Set property configFile to my.properties
Applying interceptor factory hivemind.LoggingInterceptor
.....
before Shutdown
after Shutdown
Any idea what I'm doing wrong ???
THANKS A LOT!!!!
Please check out the following API docs:
http://jakarta.apache.org/hivemind/hivemind/apidocs/org/apache/hivemind/Regi stry.html#shutdown()
http://jakarta.apache.org/hivemind/hivemind/apidocs/org/apache/hivemind/even ts/RegistryShutdownListener.html
http://jakarta.apache.org/hivemind/hivemind/apidocs/org/apache/hivemind/Disc ardable.html
Hope this helps.
-Filip
-----Original Message----- From: Istvan Orban [mailto:[EMAIL PROTECTED] Sent: Saturday, October 16, 2004 2:53 PM To: [email protected] Subject: Multi-threaded question
Hi,
I have some services which are loaded <contribution configuration-id="hivemind.EagerLoad"> one of this service creates a pool to a server. and manages the pool itself.
I'm supposed to delete this pool from the remote server when I do not need it anymore.
the final application will run inside Tomcat, and many Threads will requests clients from the Pool which is managed by the service I wrote. When the application is stopped I guess I should stop Hivemind too, with all my services, and do the necessary clean-ups.
Is there a standard way of doing this??
Thanks, sorrry for the lame question..
Istvano
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
