public class AbstractLifeCycle extends Object implements LifeCycle2
Wraps a LifeCycle.State.
LifeCycle.State| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_STOP_TIMEOUT |
static TimeUnit |
DEFAULT_STOP_TIMEUNIT |
protected static org.apache.logging.log4j.Logger |
LOGGER
Allow subclasses access to the status logger without creating another instance.
|
| Constructor and Description |
|---|
AbstractLifeCycle() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
equalsImpl(Object obj) |
LifeCycle.State |
getState()
Gets the life-cycle state.
|
protected static org.apache.logging.log4j.Logger |
getStatusLogger()
Gets the status logger.
|
protected int |
hashCodeImpl() |
void |
initialize() |
boolean |
isInitialized() |
boolean |
isStarted() |
boolean |
isStarting() |
boolean |
isStopped() |
boolean |
isStopping() |
protected void |
setStarted() |
protected void |
setStarting() |
protected void |
setState(LifeCycle.State newState) |
protected void |
setStopped() |
protected void |
setStopping() |
void |
start() |
void |
stop() |
protected boolean |
stop(Future<?> future) |
boolean |
stop(long timeout,
TimeUnit timeUnit)
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current
thread is interrupted, whichever happens first.
|
public static final int DEFAULT_STOP_TIMEOUT
public static final TimeUnit DEFAULT_STOP_TIMEUNIT
protected static final org.apache.logging.log4j.Logger LOGGER
public AbstractLifeCycle()
protected static org.apache.logging.log4j.Logger getStatusLogger()
protected boolean equalsImpl(Object obj)
public LifeCycle.State getState()
LifeCycleprotected int hashCodeImpl()
public boolean isInitialized()
public boolean isStarting()
public boolean isStopping()
protected void setStarted()
protected void setStarting()
protected void setState(LifeCycle.State newState)
protected void setStopped()
protected void setStopping()
public void initialize()
initialize in interface LifeCyclepublic boolean stop(long timeout, TimeUnit timeUnit)
LifeCycle2stop in interface LifeCycle2timeout - the maximum time to waittimeUnit - the time unit of the timeout argumentCopyright © 1999-1969 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.