You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Christian Edward Gruber <cg...@google.com> on 2010/04/21 21:52:56 UTC

service shutdown hook in tapestry-ioc

Hi,

     We're building a service that connects to an RPC system for use  
in a t5 app (5.2-snap) but can't find anywhere to declare/identify  
shutdown logic.  Is there any sort of event the service impl can hook  
into either with an annotation or a module contribution somewhere to  
allow us to cleanly close up any state or resources in the service  
when the registry shuts down, or when it goes out of scope?  Noodling  
around the T5-ioc docs didn't bear any fruit, though clearly there was  
shutdown state transition in the registry itself.

Christian.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: service shutdown hook in tapestry-ioc

Posted by Christian Edward Gruber <ch...@gmail.com>.
Nope, but that's awesome, and exactly what we were looking for, i think.

Christian.

On Apr 21, 2010, at 4:08 PM, Shing Hing Man wrote:

> Have you tried registering service with the RegistryShutdownHub ?
> Below is an example.
>
>    @ServiceId("connectionManager")
>        public static SageConnectionManager  
> buildSageConnectionManager(RegistryShutdownHub hub) {
>                PooledSageConnectionManager connManager= new  
> PooledSageConnectionManager();
>        hub.addRegistryShutdownListener(connManager);
>                return connManager;
>        }
>
> Note that PooledSageConnectionManager implements interface  
> RegistryShutdownListener{
>  public void registryDidShutdown()
>
> }
>
> When the register shuts down, the method registryDidShutdown will be  
> called.
>
> Shing
>
>
> --- On Thu, 22/4/10, Christian Edward Gruber <cg...@google.com>  
> wrote:
>
>> From: Christian Edward Gruber <cg...@google.com>
>> Subject: service shutdown hook in tapestry-ioc
>> To: "Tapestry users" <us...@tapestry.apache.org>
>> Cc: "Michael Taylor" <mi...@google.com>
>> Date: Thursday, 22 April, 2010, 3:52
>> Hi,
>>
>>     We're building a service that connects to an
>> RPC system for use in a t5 app (5.2-snap) but can't find
>> anywhere to declare/identify shutdown logic.  Is there
>> any sort of event the service impl can hook into either with
>> an annotation or a module contribution somewhere to allow us
>> to cleanly close up any state or resources in the service
>> when the registry shuts down, or when it goes out of
>> scope?  Noodling around the T5-ioc docs didn't bear any
>> fruit, though clearly there was shutdown state transition in
>> the registry itself.
>>
>> Christian.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: service shutdown hook in tapestry-ioc

Posted by Shing Hing Man <ma...@yahoo.com>.
Have you tried registering service with the RegistryShutdownHub ?
Below is an example.

    @ServiceId("connectionManager")
        public static SageConnectionManager buildSageConnectionManager(RegistryShutdownHub hub) {
                PooledSageConnectionManager connManager= new PooledSageConnectionManager();
        hub.addRegistryShutdownListener(connManager);
                return connManager;
        }

Note that PooledSageConnectionManager implements interface RegistryShutdownListener{
  public void registryDidShutdown()

}

When the register shuts down, the method registryDidShutdown will be called.

Shing


--- On Thu, 22/4/10, Christian Edward Gruber <cg...@google.com> wrote:

> From: Christian Edward Gruber <cg...@google.com>
> Subject: service shutdown hook in tapestry-ioc
> To: "Tapestry users" <us...@tapestry.apache.org>
> Cc: "Michael Taylor" <mi...@google.com>
> Date: Thursday, 22 April, 2010, 3:52
> Hi,
> 
>     We're building a service that connects to an
> RPC system for use in a t5 app (5.2-snap) but can't find
> anywhere to declare/identify shutdown logic.  Is there
> any sort of event the service impl can hook into either with
> an annotation or a module contribution somewhere to allow us
> to cleanly close up any state or resources in the service
> when the registry shuts down, or when it goes out of
> scope?  Noodling around the T5-ioc docs didn't bear any
> fruit, though clearly there was shutdown state transition in
> the registry itself.
> 
> Christian.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 


      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org