|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.mmm.util.component.base.InitializationState
public class InitializationState
This class represents the state of an initialization.
It therefore offers the method requireNotInitilized()
that can be
called before initialization e.g. from injection-setters
so nothing can be re-injected after
initialization
. Additionally there is
requireInitilized()
that can be called after initialization e.g.
from functional methods of the component to ensure that the component has
been initialized
.
PostConstruct
Field Summary | |
---|---|
private AtomicInteger |
state
This field holds the atomic state of this object. |
private static int |
STATE_INITIALIZED
The state if initialization has
completed. |
private static int |
STATE_INITIALIZING
The state during initialization . |
private static int |
STATE_UNINITIALIZED
The initial state . |
Constructor Summary | |
---|---|
InitializationState()
The constructor. |
Method Summary | |
---|---|
boolean |
isInitialized()
This method gets the status of the initialization
. |
void |
requireInitilized()
This method checks that this state has already been initialized . |
void |
requireNotInitilized()
This method checks that this state has NOT yet been initialized . |
void |
setInitialized()
This method sets the state to initialized . |
boolean |
setInitializing()
This method sets the state to initializing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int STATE_UNINITIALIZED
state
.
private static final int STATE_INITIALIZING
state
during initialization
.
private static final int STATE_INITIALIZED
state
if initialization
has
completed.
private AtomicInteger state
Constructor Detail |
---|
public InitializationState()
Method Detail |
---|
public boolean setInitializing()
setInitialized()
should
be invoked.
true
if the state was NOT initialized
and is now initialized
,
false
if the state is already initialized
.public void setInitialized()
initialized
.setInitializing()
before you invoke this method!
public boolean isInitialized()
initialization
.
true
if this component has been
initialized
, false
otherwise.public void requireInitilized() throws NotInitializedException
initialized
.
NotInitializedException
- if this state has NOT been initialized yet.public void requireNotInitilized() throws AlreadyInitializedException
initialized
.
AlreadyInitializedException
- if this state has already been
initialized.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |