Package org.apache.logging.log4j.core
Class AbstractLifeCycle
java.lang.Object
org.apache.logging.log4j.core.AbstractLifeCycle
- All Implemented Interfaces:
LifeCycle,LifeCycle2
- Direct Known Subclasses:
AbstractConnectionSource,AbstractFilter,AbstractFilterable,AbstractTriggeringPolicy,AsyncLoggerConfigDisruptor,AsyncLoggerDisruptor,CompositeFilter,ConfigurationScheduler,IdlePurgePolicy,Log4jWebInitializerImpl,LoggerContext,WatchManager
A life cycle to be extended.
Wraps a LifeCycle.State.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle
LifeCycle.State -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final TimeUnitprotected static final LoggerAllow subclasses access to the status logger without creating another instance.private LifeCycle.State -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanequalsImpl(Object obj) getState()Gets the life-cycle state.protected static LoggerGets the status logger.protected intvoidbooleanbooleanbooleanbooleanbooleanprotected voidprotected voidprotected voidsetState(LifeCycle.State newState) protected voidprotected voidvoidstart()voidstop()booleanBlocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.protected boolean
-
Field Details
-
DEFAULT_STOP_TIMEOUT
public static final int DEFAULT_STOP_TIMEOUT- See Also:
-
DEFAULT_STOP_TIMEUNIT
-
LOGGER
Allow subclasses access to the status logger without creating another instance. -
state
-
-
Constructor Details
-
AbstractLifeCycle
public AbstractLifeCycle()
-
-
Method Details
-
getStatusLogger
Gets the status logger.- Returns:
- the status logger.
-
equalsImpl
-
getState
Description copied from interface:LifeCycleGets the life-cycle state. -
hashCodeImpl
protected int hashCodeImpl() -
isInitialized
public boolean isInitialized() -
isStarted
public boolean isStarted() -
isStarting
public boolean isStarting() -
isStopped
public boolean isStopped() -
isStopping
public boolean isStopping() -
setStarted
protected void setStarted() -
setStarting
protected void setStarting() -
setState
-
setStopped
protected void setStopped() -
setStopping
protected void setStopping() -
initialize
public void initialize()- Specified by:
initializein interfaceLifeCycle
-
start
public void start() -
stop
public void stop() -
stop
-
stop
Description copied from interface:LifeCycle2Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.- Specified by:
stopin interfaceLifeCycle2- Parameters:
timeout- the maximum time to waittimeUnit- the time unit of the timeout argument- Returns:
- true if the receiver was stopped cleanly and normally, false otherwise.
-