|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.common.config.StartupStateController
public final class StartupStateController
This tool, which is to be used only by the
com.metamatrix.platform.util.MetaMatrixController
during
system startup, works with CurrentConfiguration
to
initialize system state, and also the system configurations, in the
configuration database.
All MetaMatrixControllers
will call #beginSystemInitialization
,
in an attempt to be the first one to start system initialization.
System startup state ensures that initialization happens
exactly once.
The #beginSystemInitialization
method will attempt to simultaneously
read, then set, the system startup state as a transaction. The state will
be set to STATE_STARTING
by this method, but only under the
following conditions:
STATE_STOPPED
.If the #beginSystemInitialization
method executes without
an exception, the client should call #finishSystemInitialization
after doing any startup work. This will put the system into a
state of STATE_STARTED
. MetaMatrixController should only
call this method if the #beginSystemInitialization
method
executed without exception.
Field Summary | |
---|---|
static int |
STATE_STARTED
This state indicates that either the system is successfully started, or this state also may be stored this way in the database because the system crashed and did not reset it. |
static java.lang.String |
STATE_STARTED_LABEL
descriptive label for STATE_STARTED state |
static int |
STATE_STARTING
This state indicates the system is in the process of starting. |
static java.lang.String |
STATE_STARTING_LABEL
descriptive label for STATE_STARTING state |
static int |
STATE_STOPPED
This state indicates the system is stopped, and ready to be started. |
static java.lang.String |
STATE_STOPPED_LABEL
descriptive label for STATE_STOPPED state |
Constructor Summary | |
---|---|
StartupStateController()
|
Method Summary | |
---|---|
static java.lang.String |
getStateLabel(int state)
|
static void |
performSystemInitialization(boolean forceInitialization)
This method should be called only by com.metamatrix.platform.util.MetaMatrixController
to initialize the system configurations during bootstrapping. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int STATE_STOPPED
public static final java.lang.String STATE_STOPPED_LABEL
STATE_STOPPED
state
public static final int STATE_STARTING
public static final java.lang.String STATE_STARTING_LABEL
STATE_STARTING
state
public static final int STATE_STARTED
public static final java.lang.String STATE_STARTED_LABEL
STATE_STARTED
state
Constructor Detail |
---|
public StartupStateController()
Method Detail |
---|
public static final java.lang.String getStateLabel(int state)
public static final void performSystemInitialization(boolean forceInitialization) throws StartupStateException, ConfigurationException
com.metamatrix.platform.util.MetaMatrixController
to initialize the system configurations during bootstrapping.
This method will attempt to put the system state into
STATE_STARTING
, and then
commence with initialization. If the state is already
STATE_STARTING
, then another
MetaMatrixController is already currently in the process of
starting the system, and a StartupStateException
will be thrown. If this method returns without an
exception, then the system state will be in state
STATE_STARTING
, and the calling
code should proceed with startup.
forceInitialization
- if the system is in a state other than
STATE_STOPPED
, and the
administrator thinks the system actually crashed and is
not really running, he can choose to force the
initialization. Otherwise, if the system is in one of these states,
an exception will be thrown.
StartupStateException
- if the system is
not in a state in which initialization can proceed. This
exception will indicate the current system state.
ConfigurationException
- if the current configuration and/or
bootstrap properties could not be obtained
NOTE: This method replaces the begin... and finish.. SystemInitialization methods
for the new configuration implementations.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |