hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitry Kozakov <d...@java.crimea.com>
Subject Registry shutdown
Date Fri, 17 Jun 2005 09:56:06 GMT
Hi All
During startup HiveMind do all job for constructing and composing
services. But does it make any cleanup actions before shutdown?
(In source I see that it makes only shutdown notification).

Example: I wrote 2 services one of the them is a listener for events
from other. When HimeMind startup it adds service as a listener
for other automatically but during shutdown it does not remove this
listener.
<service-point id="Service1" interface="example1.IService1">
       <invoke-factory>
             <construct class="example1.Service1" 
autowire-services="false"/>
       </invoke-factory>
</service-point>
<service-point id="Service2" interface="example1.IService2">
       <invoke-factory>
             <construct class="example1.Service2" autowire-services="false">
                <event-listener service-id="Service1"/>
             </construct>
       </invoke-factory>
</service-point>
<contribution configuration-id="hivemind.EagerLoad">
    <load service-id="Service1" />
    <load service-id="Service2" />
</contribution>

I understand that I can do in other way

<service-point id="Service1" interface="example1.IService1">
       <invoke-factory>
             <construct class="example1.Service1" 
autowire-services="false"/>
       </invoke-factory>
</service-point>
<service-point id="Service2" interface="example1.IService2">
       <invoke-factory>
             <construct class="example1.Service2" autowire-services="false">
                <set-service property="service1" service-id="Service1"/>
             </construct>
       </invoke-factory>
</service-point>
<contribution configuration-id="hivemind.EagerLoad">
    <load service-id="Service1" />
    <load service-id="Service2" />
</contribution>

and in the initializeService() of the Service2 add it as listener of the 
Service1 manually
and on the shutdown event remove it. But in this case I must specify
methods addListener and removeListener as a part of the API

Thanks

-- 
Best Regards,
	Dmitry


---------------------------------------------------------------------
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