|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LifeCycle
All 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 the LifeCycle.State.INITIALIZED
state
by default to indicate the class has been loaded. From here, calling the start()
method will change this
state to LifeCycle.State.STARTING
. After successfully being started, this state is changed to LifeCycle.State.STARTED
.
When the stop()
is called, this goes into the LifeCycle.State.STOPPING
state. After successfully being
stopped, this goes into the LifeCycle.State.STOPPED
state. In most circumstances, implementation classes should
store their LifeCycle.State
in a volatile
field or inside an
AtomicReference
dependent on synchronization and concurrency requirements.
Nested Class Summary | |
---|---|
static class |
LifeCycle.State
Status of a life cycle like a LoggerContext . |
Method Summary | |
---|---|
LifeCycle.State |
getState()
Gets the life-cycle state |
boolean |
isStarted()
|
boolean |
isStopped()
|
void |
start()
|
void |
stop()
|
Method Detail |
---|
LifeCycle.State getState()
void start()
void stop()
boolean isStarted()
boolean isStopped()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1999-2015 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.