@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()
RepositorySystemLifecyclesystemEnded in interface RepositorySystemLifecyclepublic void addOnSystemEndedHandler(java.lang.Runnable handler)
RepositorySystemLifecycleThrows if repository system is already shut down.
addOnSystemEndedHandler in interface RepositorySystemLifecycleprivate void requireNotShutdown()