Uploaded image for project: 'Spring Data Geode'
  1. Spring Data Geode
  2. DATAGEODE-361

Add Lifecycle management to LocatorFactoryBean to control Locator start and stop

    XMLWordPrintable

    Details

      Description

      Currently, when users declare the @LocatorApplication annotation on a Spring main class (e.g. a main class annotated with @SpringBootApplication), Spring will configure and bootstrap a Locator instance successfully, but then fall straight through, causing the JVM to exit (with exit code 0).

      This improvement will couple the Locator instance start and stop operations with Spring's Lifecycle management capabilities using the Lifecycle, or alternatively the SmartLifecycle interface.

      Technically, this means the LocatorLaucher.start() and LocatorLauncher.waitOnLocator() methods will be called in Lifecycle.start() and LocatorLauncher.stop() will be called in Lifecycle.stop(), while the (perceived) construction of the Locator object representing the distribution locator and location services will occur after initialization, as before.

      Additional attributes will be added to the @LocatorApplication to control this behavior:

      • phase - giving users precise control over when the Locator will start and stop during the Spring container lifecycle.
      • waitOnLocator - allowing the Locator JVM process to be blocked waiting for the Locator be be stopped, which will be useful in production Use Cases.

        Attachments

          Activity

            People

            Assignee:
            jblum John Blum
            Reporter:
            jblum John Blum
            Last updater:
            John Blum
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: