I have a bunch of threads that I've spawned off that I'd like to shut down 
gracefully.  

On Oct 14, 2011, at 4:14 PM, Steve Eynon wrote:

> Alas no, there is no other method (I'm aware of) that lets you know
> the registry is "about to shutdown", just the one that tells you it's
> in the process of.
> 
> There have been a couple of situations when I wished there was though!
> (e.g. to log the shutdown event to a database.)
> 
> Steve.
> 
> On 15 October 2011 03:51, Tony Nelson <tnel...@starpoint.com> wrote:
>> I have successfully registered a shutdown listener as described in the 
>> document ion.  It seems that registryDidShutdown() is called after the 
>> registry is done shutting down and I no longer have access to any of the 
>> services the registry previously held.  Is there another method I can use to 
>> be notified just before the registry is shut down?  The exception I'm seeing 
>> is this:
>> 
>> [ERROR] TapestryIOCModule.RegistryShutdownHub Error notifying 
>> com.starpoint.instihire.services.AppModule$ThreadShutdownListener@54030e7b 
>> of registry shutdown: Exception constructing service 'EmailQueue': Proxy for 
>> service EmailQueue is no longer active because the IOC Registry has been 
>> shut down.
>> java.lang.RuntimeException: Exception constructing service 'EmailQueue': 
>> Proxy for service EmailQueue is no longer active because the IOC Registry 
>> has been shut down.
>>        at 
>> org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.obtainObjectFromCreator(JustInTimeObjectCreator.java:78)
>>        at 
>> org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:56)
>>        at $InstiHireQueue_124caf428070f755.delegate(Unknown Source)
>>        at $InstiHireQueue_124caf428070f755.getQueueReader(Unknown Source)
>>        at 
>> com.starpoint.instihire.services.AppModule$ThreadShutdownListener.registryDidShutdown(AppModule.java:292)
>>        at 
>> org.apache.tapestry5.ioc.internal.services.RegistryShutdownHubImpl.fireRegistryDidShutdown(RegistryShutdownHubImpl.java:57)
>>        at 
>> org.apache.tapestry5.ioc.internal.RegistryImpl.shutdown(RegistryImpl.java:384)
>>        at 
>> org.apache.tapestry5.ioc.internal.RegistryWrapper.shutdown(RegistryWrapper.java:41)
>>        at 
>> org.apache.tapestry5.TapestryFilter.destroy(TapestryFilter.java:192)
>>        at 
>> org.mortbay.jetty.servlet.FilterHolder.destroyInstance(FilterHolder.java:127)
>>        at 
>> org.mortbay.jetty.servlet.FilterHolder.doStop(FilterHolder.java:107)
>>        at 
>> org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76)
>>        at 
>> org.mortbay.jetty.servlet.ServletHandler.doStop(ServletHandler.java:176)
>>        at 
>> org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76)
>>        at 
>> org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:142)
>>        at 
>> org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76)
>>        at 
>> org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:142)
>>        at 
>> org.mortbay.jetty.servlet.SessionHandler.doStop(SessionHandler.java:125)
>>        at 
>> org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76)
>>        at 
>> org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:142)
>>        at 
>> org.mortbay.jetty.handler.ContextHandler.doStop(ContextHandler.java:592)
>>        at 
>> org.mortbay.jetty.webapp.WebAppContext.doStop(WebAppContext.java:537)
>>        at 
>> org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStop(Jetty6PluginWebAppContext.java:123)
>>        at 
>> org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76)
>>        at 
>> org.mortbay.jetty.handler.HandlerCollection.doStop(HandlerCollection.java:169)
>>        at 
>> org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76)
>>        at 
>> org.mortbay.jetty.handler.HandlerCollection.doStop(HandlerCollection.java:169)
>>        at 
>> org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76)
>>        at 
>> org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:142)
>>        at org.mortbay.jetty.Server.doStop(Server.java:283)
>>        at 
>> org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76)
>>        at org.mortbay.jetty.Server$ShutdownHookThread.run(Server.java:561)
>> Caused by: java.lang.IllegalStateException: Proxy for service EmailQueue is 
>> no longer active because the IOC Registry has been shut down.
>>        at 
>> org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator$1.createObject(JustInTimeObjectCreator.java:101)
>>        at 
>> org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.obtainObjectFromCreator(JustInTimeObjectCreator.java:68)
>>        ... 31 more
>> 
>> 
>> 
>> 
>> Thanks in advance
>> Tony Nelson
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


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

Reply via email to