Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-7511

Distinguish between lifecycle termination and stop behaviour via [Non]BlockingLifecycle

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • 32.0.0.Beta4
    • 32.0.0.Beta3
    • Management
    • None

      Follows up on WFCORE-7491 & WFCORE-7492.

      WFCORE-7491 added BlockingLifecycle & NonBlockingLifecycle abstractions for use with the ServiceInstaller framework.
      WFCORE-7492 added support for creating simple suspendable MSC services, where [Non]BlockingLifecycle.start()/stop() can be triggered independently via SuspendableActivity.

      However, while integrating these changes into WildFly, I realise that I neglected to consider objects with terminal lifecycle methods, i.e. logic that must execute on MSC Service.stop() but, if utilising the WFCORE-7492 mechanisms, cannot reside within [Non]BlockingLifecycle.stop() (as this would otherwise preclude lifeycle restart). This means that any such MSC service would need to be split into two, where one service encapulates object construction/destrucution while a second service, requiring the first, handles the object start/stop lifecycle.
      e.g.
      A service providing a restartable JGroups channel can be expressed as BlockingLifecycle.compose(JChannel::connect, JChannel::disconnect), however, there is no mechanism for separately specifying JChannel.close() behaviour, nor, in general, any terminal lifecycle behaviour.

      By adding a terminal lifecycle method to [Non]BlockingLifecycle, we can create simple suspendable services for these types of objects without requiring 2 MSC services.

              pferraro@redhat.com Paul Ferraro
              pferraro@redhat.com Paul Ferraro
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: