Class EventManager
- java.lang.Object
-
- org.linuxforhealth.fhir.core.lifecycle.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 completedstatic EventManager
getInstance()
Get the singleton instancestatic void
register(EventCallback cb)
Register the givenEventCallback
to receive lifecycle eventsstatic 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 readystatic void
startShutdown(java.lang.Object serviceManagerId)
Called by the lifecycle manager to advertise that the server shutdown has been initiated
-
-
-
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 givenEventCallback
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
-
-
-