Package com.sun.identity.common
Class ShutdownManager
- java.lang.Object
-
- com.sun.identity.common.ShutdownManager
-
- All Implemented Interfaces:
org.forgerock.util.thread.listener.ShutdownManager
public final class ShutdownManager extends Object implements org.forgerock.util.thread.listener.ShutdownManager
ShutdownManager is a static instance which is used to trigger all the ShutdownListener to call shutdown function.
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<org.forgerock.util.thread.listener.ShutdownListener>[]listenersprotected booleanshutdownCalled
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddApplicationSSOTokenDestroyer(org.forgerock.util.thread.listener.ShutdownListener listener)Adds application single-sign-on token destroyer.voidaddShutdownListener(org.forgerock.util.thread.listener.ShutdownListener listener)Adds a ShutdownListener to this ShutdownManager.voidaddShutdownListener(org.forgerock.util.thread.listener.ShutdownListener listener, org.forgerock.util.thread.listener.ShutdownPriority priority)Adds a ShutdownListener to this ShutdownManager with indicated level.static ShutdownManagergetInstance()Returns the static instance of ShutdownManager in the VM.voidremoveShutdownListener(org.forgerock.util.thread.listener.ShutdownListener listener)Removes a ShutdownListener from this ShutdownManager.voidreplaceShutdownListener(org.forgerock.util.thread.listener.ShutdownListener oldListener, org.forgerock.util.thread.listener.ShutdownListener newListener, org.forgerock.util.thread.listener.ShutdownPriority priority)Replaces an existing ShutdownListener with the new ShutdownListener.voidshutdown()Shuts down all the listeners in this ShutdownManager.
-
-
-
Field Detail
-
listeners
protected Set<org.forgerock.util.thread.listener.ShutdownListener>[] listeners
-
shutdownCalled
protected volatile boolean shutdownCalled
-
-
Method Detail
-
getInstance
public static ShutdownManager getInstance()
Returns the static instance of ShutdownManager in the VM.- Returns:
- The static instance of ShutdownManager
-
addShutdownListener
public void addShutdownListener(org.forgerock.util.thread.listener.ShutdownListener listener) throws IllegalMonitorStateExceptionAdds a ShutdownListener to this ShutdownManager.- Specified by:
addShutdownListenerin interfaceorg.forgerock.util.thread.listener.ShutdownManager- Parameters:
listener- The listener to be added- Throws:
IllegalMonitorStateException
-
addShutdownListener
public void addShutdownListener(org.forgerock.util.thread.listener.ShutdownListener listener, org.forgerock.util.thread.listener.ShutdownPriority priority) throws IllegalMonitorStateExceptionAdds a ShutdownListener to this ShutdownManager with indicated level.- Specified by:
addShutdownListenerin interfaceorg.forgerock.util.thread.listener.ShutdownManager- Parameters:
listener- The listener to be addedpriority- The priority to shutdown for the shutdown listener- Throws:
IllegalMonitorStateException
-
replaceShutdownListener
public void replaceShutdownListener(org.forgerock.util.thread.listener.ShutdownListener oldListener, org.forgerock.util.thread.listener.ShutdownListener newListener, org.forgerock.util.thread.listener.ShutdownPriority priority)Replaces an existing ShutdownListener with the new ShutdownListener.- Specified by:
replaceShutdownListenerin interfaceorg.forgerock.util.thread.listener.ShutdownManager- Parameters:
oldListener- To be replaced.newListener- The replacement.priority- Replacement listeners priority. If null default addShutdownListener method will be used.
-
removeShutdownListener
public void removeShutdownListener(org.forgerock.util.thread.listener.ShutdownListener listener) throws IllegalMonitorStateExceptionRemoves a ShutdownListener from this ShutdownManager.- Specified by:
removeShutdownListenerin interfaceorg.forgerock.util.thread.listener.ShutdownManager- Parameters:
listener- The listener to be removed- Throws:
IllegalMonitorStateException
-
shutdown
public void shutdown() throws IllegalMonitorStateExceptionShuts down all the listeners in this ShutdownManager.- Specified by:
shutdownin interfaceorg.forgerock.util.thread.listener.ShutdownManager- Throws:
IllegalMonitorStateException
-
addApplicationSSOTokenDestroyer
public void addApplicationSSOTokenDestroyer(org.forgerock.util.thread.listener.ShutdownListener listener)
Adds application single-sign-on token destroyer.- Parameters:
listener- Listener object.
-
-