public abstract class AbstractLifecycle extends Object implements Lifecycle
| Constructor and Description |
|---|
AbstractLifecycle() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isNotRunning()
True if this lifecycle is not running, i.e.
|
boolean |
isRunning()
True if this lifecycle is running, i.e.
|
protected abstract void |
onShutdown()
Execute shutdown logic, if there is any.
|
protected abstract void |
onStartup()
Execute startup logic, if there is any.
|
void |
shutdown()
Execute shutdown logic, if there is any.
|
void |
startup()
Execute startup logic, if there is any.
|
public final void startup()
throws IllegalStateException
Subsequent invocations throw IllegalStateException.
startup in interface LifecycleIllegalStateException - on subsequent invocations.public final void shutdown()
throws IllegalStateException
If startup() hasn't been called yet IllegalStateException is thrown.
Subsequent invocations have no effect.
shutdown in interface LifecycleIllegalStateException - if not started yet.public final boolean isRunning()
startup() is called and before shutdown() is
called.true if this lifecycle is running.public final boolean isNotRunning()
startup() is called or after
shutdown()} is called.true if this lifecycle is not running.protected abstract void onStartup()
protected abstract void onShutdown()
Copyright © 2021. All rights reserved.