I've been thinking I may know the reason for what I'm facing but to make sure I need to confirm something after looking into this piece of code:
org.apache.tapestry5.ioc.internal.services.RegistryShutdownHubImpl.fireRegistryDidShutdown() This method calls the shutdown listeners one after another, correct ? not in a threaded way... Could someone from the dev team confirm that ? Thanks On Wed, Apr 3, 2013 at 10:39 PM, Muhammad Gelbana <m.gelb...@gmail.com>wrote: > addRegistryWillShutdownListener<http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/services/RegistryShutdownHub.html#addRegistryWillShutdownListener(java.lang.Runnable)> > is > used to contribute methods to be invoked right before proxies\registry are > destroyed > > > On Wed, Apr 3, 2013 at 10:32 PM, Michael Prescott < > michael.r.presc...@gmail.com> wrote: > >> What is 'log', is it an injected logger service? Once shutdown has >> started, other services may already have been deactivated, so those calls >> may fail. >> >> >> On 3 April 2013 16:27, Muhammad Gelbana <m.gelb...@gmail.com> wrote: >> >> > I use tapestry to develop windows services so this should be similar to >> a >> > desktop application I suppose and it's no where close to a web >> application. >> > >> > This method is supposed to register a registryWillShutdownListener >> > >> > @Startup >> > public void startup(RegistryShutdownHub registryShutdown, @IpK final >> > IMonitoredConfigurationSource ipkConfig, final Logger log) { >> > log.info(registryShutdown); // This is called >> > registryShutdown.addRegistryWillShutdownListener(new Runnable() { >> > @Override >> > public void run() { >> > log.warn("Announcing shutdown"); // This whole method as if >> it >> > doesn't exist ! >> > ipkConfig.shutdown(); >> > log.warn("IpkConfig: " + ipkConfig.isShuttingDown()); >> > } >> > }); >> > } >> > >> > What is really strange is that *there are other modules being >> contributed >> > just like this one and their shutdown listeners act as expected*, except >> > for this module ! In addition to the first logging call being actually >> > invoked and I can see it's output in the log files, I can also see the >> > module contribution message by tapestry so this module is definitely >> being >> > loaded, I just don't know why isn't this listener being invoked. >> > >> > Are their any other precaution I should consider for my shutdown >> listeners >> > to surely work ? >> > >> > Thank you. >> > >> > >