You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Christian Essl <ch...@yahoo.de> on 2003/09/28 23:46:14 UTC

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




Re: [HiveMind] Destroy service

Posted by Christian Essl <ch...@yahoo.de>.
I totally agree (also in the refactoring of the ServiceModel). Maybe we 
could also find a saver way to build up the dependences.

(By the way dependencies are also a good way to prevent some deadlock 
problems. Have you thought about patterns on how to synchronize services. 
It seems to me a bit hard because from the interface you can't see which 
methods are synchronized.)   <hl...@comcast.net> wrote:

> I'd prefer something where the core service instance implemented the 
> interface, and was registered
> for the notification automatically, using logic similar to how 
> Initializable is recognized.
>
> Actually, I'm more picturing this as the responsibility of the service 
> extension point to manage
> (side note: I'm going to refactor things to have a single implementation 
> of ServiceExtensionPoint
> and multiple implementations of ServiceModel that plug into the point).  
> So the ServiceModel will
> register itself for the right events (with the Registry and/or 
> ThreadEventNotifier) and will
> reinvoke the right Manageable methods on the core service instance.
>
> --
> 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: Monday, 
>> September 29, 2003 7:04 AM
>> To: Jakarta Commons Developers List
>> Subject: Re: [HiveMind] Destroy service
>>
>>
>> Thank you for your intrest and the suggestion of 'Manageable'.
>>
>> I agree with you that a `Manageable` Interface, which contains a pair 
>> start/destroy would be cleaner. I did not add the start method because 
>> there is the Initilizable Interface. As you said very precisily my 
>> service is an event service (I did not see that so clearly before), but 
>> the Initilizable is not. The Initilizable is managed by the framework, 
>> does not need user interaction, is called during runtime and the Service 
>> Interface does not have to implement it. If the methods would be paired 
>> up some (rather small) changes to the framework had to be done.
>>
>> Resulting from the event-way I think the biggest disadvantage of my 
>> aproach is that the destroy method will be always called wheter the 
>> Service has ever been used or not. While this has the little advantage 
>> that it is possible to implement special shut-down Servies, but 
>> generally it is unneeded (very) resource intensive. The only way I see 
>> this could be changed would be if the ServiceExtensionPoint had a method 
>> isLoaded() (but this is of course again a framework chance which 
>> increses the interfaces size).
>> On Mon, 29 Sep 2003 10:10:30 +0200, Johan Lindquist <jo...@kawoo.co.uk> 
>> wrote:
>>
>> > Definately interested in a service such as you describe - life-cycle
>> > events has been chucked around in the group for a bit and I think it > 
>> would be a valueable service.
>> >
>> > Any chans of changing it [the interface] to (perhaps) 'Manageable' to
>> > allow for future 'start' events too or would it be too much to put it 
>> all > into one interface?
>> >
>> > Regards,
>> >
>> > Johan
>> >
>> > On Sun, 28 Sep 2003 23:46:14 +0200, Christian Essl
>> > <ch...@yahoo.de> wrote:
>> >
>> >> 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
>> >>
>> >>
>> >
>> >
>> >
>>
>>
>>
>> -- Using M2, Opera's revolutionary e-mail client: 
>> http://www.opera.com/m2/
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

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


Re: [HiveMind] Destroy service

Posted by Christian Essl <ch...@yahoo.de>.
I totally agree (also in the refactoring of the ServiceModel). Maybe we 
could also find a saver way to build up the dependences.

(By the way dependencies are also a good way to prevent some deadlock 
problems. Have you thought about patterns on how to synchronize services. 
It seems to me a bit hard because from the interface you can't see which 
methods are synchronized.)   <hl...@comcast.net> wrote:

> I'd prefer something where the core service instance implemented the 
> interface, and was registered
> for the notification automatically, using logic similar to how 
> Initializable is recognized.
>
> Actually, I'm more picturing this as the responsibility of the service 
> extension point to manage
> (side note: I'm going to refactor things to have a single implementation 
> of ServiceExtensionPoint
> and multiple implementations of ServiceModel that plug into the point).  
> So the ServiceModel will
> register itself for the right events (with the Registry and/or 
> ThreadEventNotifier) and will
> reinvoke the right Manageable methods on the core service instance.
>
> --
> 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: Monday, 
>> September 29, 2003 7:04 AM
>> To: Jakarta Commons Developers List
>> Subject: Re: [HiveMind] Destroy service
>>
>>
>> Thank you for your intrest and the suggestion of 'Manageable'.
>>
>> I agree with you that a `Manageable` Interface, which contains a pair 
>> start/destroy would be cleaner. I did not add the start method because 
>> there is the Initilizable Interface. As you said very precisily my 
>> service is an event service (I did not see that so clearly before), but 
>> the Initilizable is not. The Initilizable is managed by the framework, 
>> does not need user interaction, is called during runtime and the Service 
>> Interface does not have to implement it. If the methods would be paired 
>> up some (rather small) changes to the framework had to be done.
>>
>> Resulting from the event-way I think the biggest disadvantage of my 
>> aproach is that the destroy method will be always called wheter the 
>> Service has ever been used or not. While this has the little advantage 
>> that it is possible to implement special shut-down Servies, but 
>> generally it is unneeded (very) resource intensive. The only way I see 
>> this could be changed would be if the ServiceExtensionPoint had a method 
>> isLoaded() (but this is of course again a framework chance which 
>> increses the interfaces size).
>> On Mon, 29 Sep 2003 10:10:30 +0200, Johan Lindquist <jo...@kawoo.co.uk> 
>> wrote:
>>
>> > Definately interested in a service such as you describe - life-cycle
>> > events has been chucked around in the group for a bit and I think it > 
>> would be a valueable service.
>> >
>> > Any chans of changing it [the interface] to (perhaps) 'Manageable' to
>> > allow for future 'start' events too or would it be too much to put it 
>> all > into one interface?
>> >
>> > Regards,
>> >
>> > Johan
>> >
>> > On Sun, 28 Sep 2003 23:46:14 +0200, Christian Essl
>> > <ch...@yahoo.de> wrote:
>> >
>> >> 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
>> >>
>> >>
>> >
>> >
>> >
>>
>>
>>
>> -- Using M2, Opera's revolutionary e-mail client: 
>> http://www.opera.com/m2/
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

RE: [HiveMind] Destroy service

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
I'd prefer something where the core service instance implemented the interface, and was registered
for the notification automatically, using logic similar to how Initializable is recognized.

Actually, I'm more picturing this as the responsibility of the service extension point to manage
(side note: I'm going to refactor things to have a single implementation of ServiceExtensionPoint
and multiple implementations of ServiceModel that plug into the point).  So the ServiceModel will
register itself for the right events (with the Registry and/or ThreadEventNotifier) and will
reinvoke the right Manageable methods on the core service instance.

--
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: Monday, September 29, 2003 7:04 AM
> To: Jakarta Commons Developers List
> Subject: Re: [HiveMind] Destroy service
> 
> 
> Thank you for your intrest and the suggestion of 'Manageable'.
> 
> I agree with you that a `Manageable` Interface, which contains a pair 
> start/destroy would be cleaner. I did not add the start 
> method because 
> there is the Initilizable Interface. As you said very 
> precisily my service 
> is an event service (I did not see that so clearly before), but the 
> Initilizable is not. The Initilizable is managed by the 
> framework, does not 
> need user interaction, is called during runtime and the 
> Service Interface 
> does not have to implement it. If the methods would be paired up some 
> (rather small) changes to the framework had to be done.
> 
> Resulting from the event-way I think the biggest disadvantage 
> of my aproach 
> is that the destroy method will be always called wheter the 
> Service has 
> ever been used or not. While this has the little advantage that it is 
> possible to implement special shut-down Servies, but generally it is 
> unneeded (very) resource intensive. The only way I see this could be 
> changed would be if the ServiceExtensionPoint had a method 
> isLoaded() (but 
> this is of course again a framework chance which increses the 
> interfaces 
> size).
>   On Mon, 29 Sep 2003 10:10:30 +0200, Johan Lindquist 
> <jo...@kawoo.co.uk> 
> wrote:
> 
> > Definately interested in a service such as you describe - life-cycle
> > events has been chucked around in the group for a bit and I 
> think it 
> > would be a valueable service.
> >
> > Any chans of changing it [the interface] to (perhaps) 
> 'Manageable' to
> > allow for future 'start' events too or would it be too much 
> to put it all 
> > into one interface?
> >
> > Regards,
> >
> > Johan
> >
> > On Sun, 28 Sep 2003 23:46:14 +0200, Christian Essl
> > <ch...@yahoo.de> wrote:
> >
> >> 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
> >>
> >>
> >
> >
> >
> 
> 
> 
> -- 
> Using M2, Opera's revolutionary e-mail client: 
> http://www.opera.com/m2/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


RE: [HiveMind] Destroy service

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
I'd prefer something where the core service instance implemented the interface, and was registered
for the notification automatically, using logic similar to how Initializable is recognized.

Actually, I'm more picturing this as the responsibility of the service extension point to manage
(side note: I'm going to refactor things to have a single implementation of ServiceExtensionPoint
and multiple implementations of ServiceModel that plug into the point).  So the ServiceModel will
register itself for the right events (with the Registry and/or ThreadEventNotifier) and will
reinvoke the right Manageable methods on the core service instance.

--
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: Monday, September 29, 2003 7:04 AM
> To: Jakarta Commons Developers List
> Subject: Re: [HiveMind] Destroy service
> 
> 
> Thank you for your intrest and the suggestion of 'Manageable'.
> 
> I agree with you that a `Manageable` Interface, which contains a pair 
> start/destroy would be cleaner. I did not add the start 
> method because 
> there is the Initilizable Interface. As you said very 
> precisily my service 
> is an event service (I did not see that so clearly before), but the 
> Initilizable is not. The Initilizable is managed by the 
> framework, does not 
> need user interaction, is called during runtime and the 
> Service Interface 
> does not have to implement it. If the methods would be paired up some 
> (rather small) changes to the framework had to be done.
> 
> Resulting from the event-way I think the biggest disadvantage 
> of my aproach 
> is that the destroy method will be always called wheter the 
> Service has 
> ever been used or not. While this has the little advantage that it is 
> possible to implement special shut-down Servies, but generally it is 
> unneeded (very) resource intensive. The only way I see this could be 
> changed would be if the ServiceExtensionPoint had a method 
> isLoaded() (but 
> this is of course again a framework chance which increses the 
> interfaces 
> size).
>   On Mon, 29 Sep 2003 10:10:30 +0200, Johan Lindquist 
> <jo...@kawoo.co.uk> 
> wrote:
> 
> > Definately interested in a service such as you describe - life-cycle
> > events has been chucked around in the group for a bit and I 
> think it 
> > would be a valueable service.
> >
> > Any chans of changing it [the interface] to (perhaps) 
> 'Manageable' to
> > allow for future 'start' events too or would it be too much 
> to put it all 
> > into one interface?
> >
> > Regards,
> >
> > Johan
> >
> > On Sun, 28 Sep 2003 23:46:14 +0200, Christian Essl
> > <ch...@yahoo.de> wrote:
> >
> >> 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
> >>
> >>
> >
> >
> >
> 
> 
> 
> -- 
> Using M2, Opera's revolutionary e-mail client: 
> http://www.opera.com/m2/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


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


Re: [HiveMind] Destroy service

Posted by Christian Essl <ch...@yahoo.de>.
Thank you for your intrest and the suggestion of 'Manageable'.

I agree with you that a `Manageable` Interface, which contains a pair 
start/destroy would be cleaner. I did not add the start method because 
there is the Initilizable Interface. As you said very precisily my service 
is an event service (I did not see that so clearly before), but the 
Initilizable is not. The Initilizable is managed by the framework, does not 
need user interaction, is called during runtime and the Service Interface 
does not have to implement it. If the methods would be paired up some 
(rather small) changes to the framework had to be done.

Resulting from the event-way I think the biggest disadvantage of my aproach 
is that the destroy method will be always called wheter the Service has 
ever been used or not. While this has the little advantage that it is 
possible to implement special shut-down Servies, but generally it is 
unneeded (very) resource intensive. The only way I see this could be 
changed would be if the ServiceExtensionPoint had a method isLoaded() (but 
this is of course again a framework chance which increses the interfaces 
size).
  On Mon, 29 Sep 2003 10:10:30 +0200, Johan Lindquist <jo...@kawoo.co.uk> 
wrote:

> Definately interested in a service such as you describe - life-cycle 
> events has been chucked around in the group for a bit and I think it 
> would be a valueable service.
>
> Any chans of changing it [the interface] to (perhaps) 'Manageable' to 
> allow for future 'start' events too or would it be too much to put it all 
> into one interface?
>
> Regards,
>
> Johan
>
> On Sun, 28 Sep 2003 23:46:14 +0200, Christian Essl 
> <ch...@yahoo.de> wrote:
>
>> 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
>>
>>
>
>
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

Re: [HiveMind] Destroy service

Posted by Christian Essl <ch...@yahoo.de>.
Thank you for your intrest and the suggestion of 'Manageable'.

I agree with you that a `Manageable` Interface, which contains a pair 
start/destroy would be cleaner. I did not add the start method because 
there is the Initilizable Interface. As you said very precisily my service 
is an event service (I did not see that so clearly before), but the 
Initilizable is not. The Initilizable is managed by the framework, does not 
need user interaction, is called during runtime and the Service Interface 
does not have to implement it. If the methods would be paired up some 
(rather small) changes to the framework had to be done.

Resulting from the event-way I think the biggest disadvantage of my aproach 
is that the destroy method will be always called wheter the Service has 
ever been used or not. While this has the little advantage that it is 
possible to implement special shut-down Servies, but generally it is 
unneeded (very) resource intensive. The only way I see this could be 
changed would be if the ServiceExtensionPoint had a method isLoaded() (but 
this is of course again a framework chance which increses the interfaces 
size).
  On Mon, 29 Sep 2003 10:10:30 +0200, Johan Lindquist <jo...@kawoo.co.uk> 
wrote:

> Definately interested in a service such as you describe - life-cycle 
> events has been chucked around in the group for a bit and I think it 
> would be a valueable service.
>
> Any chans of changing it [the interface] to (perhaps) 'Manageable' to 
> allow for future 'start' events too or would it be too much to put it all 
> into one interface?
>
> Regards,
>
> Johan
>
> On Sun, 28 Sep 2003 23:46:14 +0200, Christian Essl 
> <ch...@yahoo.de> wrote:
>
>> 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
>>
>>
>
>
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

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


Re: [HiveMind] Destroy service

Posted by Johan Lindquist <jo...@kawoo.co.uk>.
Definately interested in a service such as you describe - life-cycle 
events has been chucked around in the group for a bit and I think it would 
be a valueable service.

Any chans of changing it [the interface] to (perhaps) 'Manageable' to 
allow for future 'start' events too or would it be too much to put it all 
into one interface?

Regards,

Johan

On Sun, 28 Sep 2003 23:46:14 +0200, Christian Essl 
<ch...@yahoo.de> wrote:

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



-- 
you too?

Re: [HiveMind] Destroy service

Posted by Johan Lindquist <jo...@kawoo.co.uk>.
Definately interested in a service such as you describe - life-cycle 
events has been chucked around in the group for a bit and I think it would 
be a valueable service.

Any chans of changing it [the interface] to (perhaps) 'Manageable' to 
allow for future 'start' events too or would it be too much to put it all 
into one interface?

Regards,

Johan

On Sun, 28 Sep 2003 23:46:14 +0200, Christian Essl 
<ch...@yahoo.de> wrote:

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



-- 
you too?

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


RE: [HiveMind] Destroy service

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
That's funny ... I started with enlist/passivate, and changed my mind.  Good idea though, I wasn't
thinking in terms of J2EE equivalents.

--
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: Johan Lindquist [mailto:johan@kawoo.co.uk] 
> Sent: Monday, September 29, 2003 8:58 AM
> To: Jakarta Commons Developers List
> Subject: Re: [HiveMind] Destroy service
> 
> 
> Blatantly stolen from EJB land:
> 
> enlistService == activateService
> poolService == passivateService
> 
> Johan
> 
> On Mon, 29 Sep 2003 08:14:31 -0400, Howard M. Lewis Ship 
> <hl...@comcast.net> wrote:
> 
> > 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
> >>
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> >
> >
> 
> 
> 
> -- 
> you too?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


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


RE: [HiveMind] Destroy service

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
That's funny ... I started with enlist/passivate, and changed my mind.  Good idea though, I wasn't
thinking in terms of J2EE equivalents.

--
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: Johan Lindquist [mailto:johan@kawoo.co.uk] 
> Sent: Monday, September 29, 2003 8:58 AM
> To: Jakarta Commons Developers List
> Subject: Re: [HiveMind] Destroy service
> 
> 
> Blatantly stolen from EJB land:
> 
> enlistService == activateService
> poolService == passivateService
> 
> Johan
> 
> On Mon, 29 Sep 2003 08:14:31 -0400, Howard M. Lewis Ship 
> <hl...@comcast.net> wrote:
> 
> > 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
> >>
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> >
> >
> 
> 
> 
> -- 
> you too?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


Re: [HiveMind] Destroy service

Posted by Johan Lindquist <jo...@kawoo.co.uk>.
Blatantly stolen from EJB land:

enlistService == activateService
poolService == passivateService

Johan

On Mon, 29 Sep 2003 08:14:31 -0400, Howard M. Lewis Ship 
<hl...@comcast.net> wrote:

> 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
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
>



-- 
you too?

Re: [HiveMind] Destroy service

Posted by Johan Lindquist <jo...@kawoo.co.uk>.
Blatantly stolen from EJB land:

enlistService == activateService
poolService == passivateService

Johan

On Mon, 29 Sep 2003 08:14:31 -0400, Howard M. Lewis Ship 
<hl...@comcast.net> wrote:

> 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
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
>



-- 
you too?

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


Re: [HiveMind] Destroy service

Posted by Harish Krishnaswamy <hk...@comcast.net>.
I agree on different interfaces for all the reasons pointed out.

Christian Essl wrote:

> I like Manageable enlistService() and shutdownService(). Also Pooling 
> is certainly as much needed as shut-down. However I'd rather like to 
> see separeted interfaces (Avalon style). The service-implementor only 
> implements what she supports and the user sees immideatly what is 
> supported.
>
> Additional I think pooling and init/shut-down are - while somekind 
> dependent - different concepts. Init/destroy is about existenc 
> (construction/gargabe-collection - nothing before after). Pooling is 
> about looping state-change (passivated/activated). Ie it is quite 
> often the case that a poolable-object holds some resources for it's 
> whole life-time and others only while it is active.
>
> PS.: Sorry for the minor-documentation post - I oversaw it and it's 
> just very hard to critice the documentation :-(.
>
> On Mon, 29 Sep 2003 08:14:31 -0400, Howard M. Lewis Ship 
> <hl...@comcast.net> wrote:
>
>> 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
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
>
>
>


Re: [HiveMind] Destroy service

Posted by Harish Krishnaswamy <hk...@comcast.net>.
I agree on different interfaces for all the reasons pointed out.

Christian Essl wrote:

> I like Manageable enlistService() and shutdownService(). Also Pooling 
> is certainly as much needed as shut-down. However I'd rather like to 
> see separeted interfaces (Avalon style). The service-implementor only 
> implements what she supports and the user sees immideatly what is 
> supported.
>
> Additional I think pooling and init/shut-down are - while somekind 
> dependent - different concepts. Init/destroy is about existenc 
> (construction/gargabe-collection - nothing before after). Pooling is 
> about looping state-change (passivated/activated). Ie it is quite 
> often the case that a poolable-object holds some resources for it's 
> whole life-time and others only while it is active.
>
> PS.: Sorry for the minor-documentation post - I oversaw it and it's 
> just very hard to critice the documentation :-(.
>
> On Mon, 29 Sep 2003 08:14:31 -0400, Howard M. Lewis Ship 
> <hl...@comcast.net> wrote:
>
>> 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
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
>
>
>


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


Re: [HiveMind] Destroy service

Posted by Christian Essl <ch...@yahoo.de>.
I like Manageable enlistService() and shutdownService(). Also Pooling is 
certainly as much needed as shut-down. However I'd rather like to see 
separeted interfaces (Avalon style). The service-implementor only 
implements what she supports and the user sees immideatly what is 
supported.

Additional I think pooling and init/shut-down are - while somekind 
dependent - different concepts. Init/destroy is about existenc 
(construction/gargabe-collection - nothing before after). Pooling is about 
looping state-change (passivated/activated). Ie it is quite often the case 
that a poolable-object holds some resources for it's whole life-time and 
others only while it is active.

PS.: Sorry for the minor-documentation post - I oversaw it and it's just 
very hard to critice the documentation :-(.

On Mon, 29 Sep 2003 08:14:31 -0400, Howard M. Lewis Ship 
<hl...@comcast.net> wrote:

> 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
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

Re: [HiveMind] Destroy service

Posted by Harish Krishnaswamy <hk...@comcast.net>.
How about something like onPoolService() or handlePoolService() etc. to 
make them more apparent event listeners?

-Harish

Howard M. Lewis Ship wrote:

>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
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
>  
>

Re: [HiveMind] Destroy service

Posted by Christian Essl <ch...@yahoo.de>.
I like Manageable enlistService() and shutdownService(). Also Pooling is 
certainly as much needed as shut-down. However I'd rather like to see 
separeted interfaces (Avalon style). The service-implementor only 
implements what she supports and the user sees immideatly what is 
supported.

Additional I think pooling and init/shut-down are - while somekind 
dependent - different concepts. Init/destroy is about existenc 
(construction/gargabe-collection - nothing before after). Pooling is about 
looping state-change (passivated/activated). Ie it is quite often the case 
that a poolable-object holds some resources for it's whole life-time and 
others only while it is active.

PS.: Sorry for the minor-documentation post - I oversaw it and it's just 
very hard to critice the documentation :-(.

On Mon, 29 Sep 2003 08:14:31 -0400, Howard M. Lewis Ship 
<hl...@comcast.net> wrote:

> 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
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

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


RE: [HiveMind] Destroy service

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
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
> 


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


RE: [HiveMind] Destroy service

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
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
>