Class EventManager


  • public class EventManager
    extends java.lang.Object
    Manages distribution of lifecycle events to registered callback handlers.
    • Constructor Summary

      Constructors 
      Constructor Description
      EventManager()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void finalShutdown​(java.lang.Object serviceManagerId)
      Called by the lifecycle manager to advertise that the server shutdown should be completed
      static EventManager getInstance()
      Get the singleton instance
      static void register​(EventCallback cb)
      Register the given EventCallback to receive lifecycle events
      static void registerServiceManagerId​(java.lang.Object serviceManagerId)
      Called once by the object managing the lifecycle of the system.
      static void serverReady​(java.lang.Object serviceManagerId)
      Called by the lifecycle manager to advertise that the server is ready
      static void startShutdown​(java.lang.Object serviceManagerId)
      Called by the lifecycle manager to advertise that the server shutdown has been initiated
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EventManager

        public EventManager()
    • Method Detail

      • getInstance

        public static EventManager getInstance()
        Get the singleton instance
        Returns:
      • registerServiceManagerId

        public static void registerServiceManagerId​(java.lang.Object serviceManagerId)
        Called once by the object managing the lifecycle of the system. The serviceManagerId is simply an object private to the managing object. The identity of this object is checked when making subsequent lifecycle calls, making it simple to enforce the restriction that only one component in the system can manage these lifecycle events.
        Parameters:
        serviceManagerId -
      • register

        public static void register​(EventCallback cb)
        Register the given EventCallback to receive lifecycle events
        Parameters:
        cb -
      • serverReady

        public static void serverReady​(java.lang.Object serviceManagerId)
        Called by the lifecycle manager to advertise that the server is ready
        Parameters:
        serviceManager -
      • startShutdown

        public static void startShutdown​(java.lang.Object serviceManagerId)
        Called by the lifecycle manager to advertise that the server shutdown has been initiated
        Parameters:
        serviceManagerId -
      • finalShutdown

        public static void finalShutdown​(java.lang.Object serviceManagerId)
        Called by the lifecycle manager to advertise that the server shutdown should be completed
        Parameters:
        serviceManagerId -