You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Jochen Kemnade <jo...@eddyson.de> on 2014/07/03 17:33:40 UTC
Execution time of registry-will-shutdown listeners
Hi,
since Tapestry 5.3, there's
RegistryShutdownHub.addRegistryWillShutdownListener(Runnable). The
JavaDoc says "RegistryWillShutdownListeners are notified before any
standard listeners, and before service proxies and other parts of the
Registry are disabled.". However, the Registry Lock is locked before
the RegistryWillShutdownListeners are notified, so it's not possible to
acquire services in a RegistryWillShutdownListener.
The main reason I see for RegistryWillShutdownListeners is to perform
final cleanup tasks before the Registry goes down and I think the
registry should be fully functional at that point. Or wasn't that the
original intention?
Jochen
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
Re: Execution time of registry-will-shutdown listeners
Posted by Jochen Kemnade <jo...@eddyson.de>.
Am 03.07.2014 20:23, schrieb Howard Lewis Ship:
> The intent was that no additional services would be acquired once the
> shutdown began since that raises ambiguities (what if those services add
> further shutdown listeners, will they get invoke).
Good point, I didn't think of that.
> That being said, we may be a little too strict here.
I think so too. If you have services that use other services to shut
down properly, that means that you'll have to realize them eagerly so
they are available in the shutdown listeners.
I think we should make an exception for the will-shutdown listeners. If
those add new *shutdown* listeners, that shouldn't be much of a problem.
Those will be invoked at a later point anyway.
If they add other will-shutdown listeners, those should probably be
invoked too. AFAICT, that should not cause an issue either as we use a
copy-on-write list for the preListeners already.
>
>
> On Thu, Jul 3, 2014 at 11:04 AM, Jochen Kemnade <ke...@gmail.com> wrote:
>
>> Hi,
>>
>> yes, I know that's the purpose of the Shutdown hub. I'm not questioning the
>> hub/listener thing as such, only that those listeners that are registered
>> to observe when the registry is *about* to shut down *after* essentially
>> shutting it down. I wonder if that behavior is intentional.
>>
>> Jochen
>>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
Re: Execution time of registry-will-shutdown listeners
Posted by Howard Lewis Ship <hl...@gmail.com>.
The intent was that no additional services would be acquired once the
shutdown began since that raises ambiguities (what if those services add
further shutdown listeners, will they get invoke). That being said, we may
be a little too strict here.
On Thu, Jul 3, 2014 at 11:04 AM, Jochen Kemnade <ke...@gmail.com> wrote:
> Hi,
>
> yes, I know that's the purpose of the Shutdown hub. I'm not questioning the
> hub/listener thing as such, only that those listeners that are registered
> to observe when the registry is *about* to shut down *after* essentially
> shutting it down. I wonder if that behavior is intentional.
>
> Jochen
>
--
Howard M. Lewis Ship
Creator of Apache Tapestry
The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!
(971) 678-5210
http://howardlewisship.com
@hlship
Re: Execution time of registry-will-shutdown listeners
Posted by Jochen Kemnade <ke...@gmail.com>.
Hi,
yes, I know that's the purpose of the Shutdown hub. I'm not questioning the
hub/listener thing as such, only that those listeners that are registered
to observe when the registry is *about* to shut down *after* essentially
shutting it down. I wonder if that behavior is intentional.
Jochen
Re: Execution time of registry-will-shutdown listeners
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Thu, 03 Jul 2014 12:33:40 -0300, Jochen Kemnade
<jo...@eddyson.de> wrote:
> Hi,
Hi!
> since Tapestry 5.3, there's
> RegistryShutdownHub.addRegistryWillShutdownListener(Runnable). The
> JavaDoc says "RegistryWillShutdownListeners are notified before any
> standard listeners, and before service proxies and other parts of the
> Registry are disabled.". However, the Registry Lock is locked before
> the RegistryWillShutdownListeners are notified, so it's not possible to
> acquire services in a RegistryWillShutdownListener.
> The main reason I see for RegistryWillShutdownListeners is to perform
> final cleanup tasks before the Registry goes down and I think the
> registry should be fully functional at that point. Or wasn't that the
> original intention?
I'd guess the original intention is having the services themselves or
their build methods to invoke their shutdown code, not having something
else grab the services and then call their shutdown methods.
But that's just a guess. :)
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org