Class WaitConditionShutdownListener
java.lang.Object
org.keycloak.connections.infinispan.shutdown.WaitConditionShutdownListener
- All Implemented Interfaces:
ShutdownListener
A
ShutdownListener that blocks the shutdown thread until a ShutdownCondition is no longer
in progress, or until the provided deadline elapses.
External events should invoke check() whenever the condition may have changed (e.g. after a topology change
event). If the condition has cleared, the waiting shutdown thread is unblocked and
ShutdownCondition.complete() is called. If the timeout expires first, ShutdownCondition.onTimeout()
is called instead.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheck()Checks whether theShutdownConditionis still in progress and, if not, signals the waiting shutdown thread to proceed.voidonShutdown(Instant shutdownTime, Date deadline) Called when the server shutdown is initiated.
-
Constructor Details
-
WaitConditionShutdownListener
-
-
Method Details
-
onShutdown
Description copied from interface:ShutdownListenerCalled when the server shutdown is initiated.- Specified by:
onShutdownin interfaceShutdownListener- Parameters:
shutdownTime- The instant at which the shutdown was initiated.deadline- The absolute deadline by which this listener must return.
-
check
public void check()Checks whether theShutdownConditionis still in progress and, if not, signals the waiting shutdown thread to proceed.This method should be called from external event handlers (e.g. topology change listeners) whenever the condition may have changed.
-