Package org.apache.logging.log4j.core
Interface LifeCycle
-
- All Known Subinterfaces:
Appender,Configuration,ConnectionSource,Filter,Filterable,LifeCycle2,Log4jWebLifeCycle
- All Known Implementing Classes:
AbstractAppender,AbstractConfiguration,AbstractConnectionSource,AbstractDatabaseAppender,AbstractDriverManagerConnectionSource,AbstractFileAppender,AbstractFilter,AbstractFilterable,AbstractLifeCycle,AbstractOutputStreamAppender,AbstractTriggeringPolicy,AbstractWriterAppender,AppenderAdapter.Adapter,AppenderControl,AsyncAppender,AsyncLoggerConfig,AsyncLoggerConfig.RootLogger,AsyncLoggerConfigDisruptor,AsyncLoggerContext,AsyncLoggerDisruptor,BuiltConfiguration,BurstFilter,CompositeConfiguration,CompositeFilter,CompositeTriggeringPolicy,ConfigurationScheduler,ConsoleAppender,CountingNoOpAppender,CronTriggeringPolicy,DataSourceConnectionSource,DefaultConfiguration,DefaultShutdownCallbackRegistry,DenyAllFilter,DriverManagerConnectionSource,DynamicThresholdFilter,FactoryMethodConnectionSource,FailoverAppender,FileAppender,FilterAdapter,HttpAppender,IdlePurgePolicy,JdbcAppender,JeroMqAppender,JmsAppender,JsonConfiguration,LevelMatchFilter,LevelRangeFilter,Log4j1Configuration,Log4jWebInitializerImpl,LoggerConfig,LoggerConfig.RootLogger,LoggerContext,MapFilter,MarkerFilter,MemoryMappedFileAppender,NoMarkerFilter,NoOpTriggeringPolicy,NoSqlAppender,NullAppender,NullConfiguration,OnStartupTriggeringPolicy,OutputStreamAppender,PropertiesConfiguration,PropertiesConfiguration,RandomAccessFileAppender,RegexFilter,RewriteAppender,RollingFileAppender,RollingRandomAccessFileAppender,RoutingAppender,RoutingAppender.CreatedRouteAppenderControl,RoutingAppender.ReferencedRouteAppenderControl,RoutingAppender.RouteAppenderControl,ScriptAppenderSelector,ScriptFilter,ServletAppender,SizeBasedTriggeringPolicy,SocketAppender,StringMatchFilter,StructuredDataFilter,SyslogAppender,ThreadContextMapFilter,ThresholdFilter,TimeBasedTriggeringPolicy,TimeFilter,WatchManager,WriterAppender,XmlConfiguration,XmlConfiguration,YamlConfiguration
public interface LifeCycleAll proper Java frameworks implement some sort of object life cycle. In Log4j, the main interface for handling the life cycle context of an object is this one. An object first starts in theLifeCycle.State.INITIALIZEDstate by default to indicate the class has been loaded. From here, calling thestart()method will change this state toLifeCycle.State.STARTING. After successfully being started, this state is changed toLifeCycle.State.STARTED. When thestop()is called, this goes into theLifeCycle.State.STOPPINGstate. After successfully being stopped, this goes into theLifeCycle.State.STOPPEDstate. In most circumstances, implementation classes should store theirLifeCycle.Statein avolatilefield or inside anAtomicReferencedependent on synchronization and concurrency requirements.- See Also:
AbstractLifeCycle
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classLifeCycle.StateStatus of a life cycle like aLoggerContext.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LifeCycle.StategetState()Gets the life-cycle state.voidinitialize()booleanisStarted()booleanisStopped()voidstart()voidstop()
-
-
-
Method Detail
-
getState
LifeCycle.State getState()
Gets the life-cycle state.- Returns:
- the life-cycle state
-
initialize
void initialize()
-
start
void start()
-
stop
void stop()
-
isStarted
boolean isStarted()
-
isStopped
boolean isStopped()
-
-