@Singleton @Named public class DefaultRepositorySystemLifecycle extends java.lang.Object implements RepositorySystemLifecycle
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.CopyOnWriteArrayList<java.lang.Runnable> |
onSystemEndedHandlers |
private java.util.concurrent.atomic.AtomicBoolean |
shutdown |
Constructor and Description |
---|
DefaultRepositorySystemLifecycle() |
Modifier and Type | Method and Description |
---|---|
void |
addOnSystemEndedHandler(java.lang.Runnable handler)
Registers an "on repository system end" handler.
|
private void |
requireNotShutdown() |
void |
systemEnded()
Marks the repository system as ended (shut down): all "on close" handlers will be invoked.
|
private final java.util.concurrent.atomic.AtomicBoolean shutdown
private final java.util.concurrent.CopyOnWriteArrayList<java.lang.Runnable> onSystemEndedHandlers
@Inject public DefaultRepositorySystemLifecycle()
public void systemEnded()
RepositorySystemLifecycle
systemEnded
in interface RepositorySystemLifecycle
public void addOnSystemEndedHandler(java.lang.Runnable handler)
RepositorySystemLifecycle
Throws if repository system is already shut down.
addOnSystemEndedHandler
in interface RepositorySystemLifecycle
private void requireNotShutdown()