Tapestry 5
  1. Tapestry 5
  2. TAP5-1359

Add way to be notified that the Registry is about to shutdown (but before service proxies are disabled)

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.3, 5.2.4
    • Fix Version/s: 5.3
    • Component/s: tapestry-ioc
    • Labels:
      None

      Description

      It is impossible to inject a service into a handler of 'RegistryShutdownListener .registryDidShutdown' since the registry is already shutdown at this point. this makes it difficult to perform some more intricate termination logic when multiple services need to collude.

      I propose the inclusion of a new interface 'RegistryAboutToShutdownListener' with the method 'registryAboutToShutDown'.

      In the case of a tapestry application, it would need to be called after Http requests have been disallowed, but before the registry becomes unusable.

      There may need to be some ordered configuration to control service dependencies as they shut down, and I expect some other considerations I haven't thought of....

        Activity

        Paul Stanton created issue -
        Hide
        Paul Stanton added a comment -

        for an example of when it would be useful see
        http://www.mail-archive.com/users@tapestry.apache.org/msg48540.html

        Show
        Paul Stanton added a comment - for an example of when it would be useful see http://www.mail-archive.com/users@tapestry.apache.org/msg48540.html
        Paul Stanton made changes -
        Field Original Value New Value
        Description It is impossible to inject a service into a handler of 'RegistryShutdownListener .registryDidShutdown' since the registry is already shutdown at this point. this makes it difficult to perform some more intricate termination logic when multiple services need to collude.

        I propose the inclusion of a new interface 'RegistryAboutToShutdownListener' with the method 'registryAboutToShutDown'.

        In the case of a tapestry application, it would need to be called after Http requests have been disallowed, but before the registry because unusable.

        There may need to be some ordered configuration to control service dependencies as they shut down, and I expect some other considerations I haven't thought of....
        It is impossible to inject a service into a handler of 'RegistryShutdownListener .registryDidShutdown' since the registry is already shutdown at this point. this makes it difficult to perform some more intricate termination logic when multiple services need to collude.

        I propose the inclusion of a new interface 'RegistryAboutToShutdownListener' with the method 'registryAboutToShutDown'.

        In the case of a tapestry application, it would need to be called after Http requests have been disallowed, but before the registry becomes unusable.

        There may need to be some ordered configuration to control service dependencies as they shut down, and I expect some other considerations I haven't thought of....
        Hide
        Howard M. Lewis Ship added a comment -

        We must be working on similar things, I hit a similar problem and was about to add a similar issue.

        I think I prefer the name registryWillShutdown(). It's really a change to RegistryShutdownHub: a new method, addRegistryWillShutdownListener(RegistryShutdownListener listener). I don't see it as a problem that we use the same interface for the two different cases.

        I'm also thinking about a @RegistryWillShutdown annotation that could be applied to a public void method that would handle the registration automatically, and perform last-minute injection as well. However, shutdown listeners are rare enough that this is not a huge win to implement.

        Show
        Howard M. Lewis Ship added a comment - We must be working on similar things, I hit a similar problem and was about to add a similar issue. I think I prefer the name registryWillShutdown(). It's really a change to RegistryShutdownHub: a new method, addRegistryWillShutdownListener(RegistryShutdownListener listener). I don't see it as a problem that we use the same interface for the two different cases. I'm also thinking about a @RegistryWillShutdown annotation that could be applied to a public void method that would handle the registration automatically, and perform last-minute injection as well. However, shutdown listeners are rare enough that this is not a huge win to implement.
        Hide
        Paul Stanton added a comment -

        sounds good, i have a workaround for my current case.

        cheers, p.

        Show
        Paul Stanton added a comment - sounds good, i have a workaround for my current case. cheers, p.
        Howard M. Lewis Ship made changes -
        Summary add 'registryAboutToShutdown' handler Add way to be notified that the Registry is about to shutdown (but before service proxies are disabled)
        Assignee Howard M. Lewis Ship [ hlship ]
        Affects Version/s 5.3 [ 12316024 ]
        Howard M. Lewis Ship made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Howard M. Lewis Ship made changes -
        Status In Progress [ 3 ] Closed [ 6 ]
        Fix Version/s 5.3 [ 12316024 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Paul Stanton
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development