|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
The Controllable interface defines the methods and constants associated with lifecycle management of a node. The lifecycle management methods are called by external agents, such as Sandman.
See NodeState.html for state descriptions and valid transitions.
| Field Summary | |
static int |
OPERATION_FAIL
|
static int |
OPERATION_RESUME
|
static int |
OPERATION_SHUTDOWN
|
static int |
OPERATION_STARTUP
|
static java.lang.String |
OPERATION_STR_FAIL
|
static java.lang.String |
OPERATION_STR_RESUME
|
static java.lang.String |
OPERATION_STR_SHUTDOWN
|
static java.lang.String |
OPERATION_STR_STARTUP
|
static java.lang.String |
OPERATION_STR_SUSPEND
|
static java.lang.String |
OPERATION_STR_UNDEFINED
|
static java.lang.String[] |
OPERATION_STRINGS
The order of elements in this array is important; it's set up so that you can use one of the OPERATION_* constants to look up a OPERATION_STR_* constant. |
static int |
OPERATION_SUSPEND
|
static int |
OPERATION_UNDEFINED
|
static int |
SHUTDOWN_ERROR_RESTART_GLOBAL
Report an error, signal all other servers bounce their local nodes, bounce our local nodes. |
static int |
SHUTDOWN_ERROR_RESTART_LOCAL
Report an error and bounce all local nodes. |
static int |
SHUTDOWN_ERROR_TERMINATE
Report an error, signal all other servers to terminate, shut down all local nodes. |
static int |
SHUTDOWN_NORMAL
Shut down all nodes with no error. |
static int |
STATE_FAILED
|
static int |
STATE_FAILING
|
static int |
STATE_RESUMING
|
static int |
STATE_RUNNING
|
static int |
STATE_STARTING
|
static int |
STATE_STOPPED
|
static int |
STATE_STOPPING
|
static java.lang.String |
STATE_STR_FAILED
|
static java.lang.String |
STATE_STR_FAILING
|
static java.lang.String |
STATE_STR_RESUMING
|
static java.lang.String |
STATE_STR_RUNNING
|
static java.lang.String |
STATE_STR_STARTING
|
static java.lang.String |
STATE_STR_STOPPED
|
static java.lang.String |
STATE_STR_STOPPING
|
static java.lang.String |
STATE_STR_SUSPENDED
|
static java.lang.String |
STATE_STR_SUSPENDING
|
static java.lang.String |
STATE_STR_UNDEFINED
|
static java.lang.String[] |
STATE_STRINGS
The order of elements in this array is important; it's set up so that you can use one of the STATE_* constants to look up a STATE_STR_* constant. |
static int |
STATE_SUSPENDED
|
static int |
STATE_SUSPENDING
|
static int |
STATE_UNDEFINED
|
| Method Summary | |
void |
addWrapper(ControlWrapper wrapper)
Add this ControlWrapper to our list of wrappers to notify in the event of a state change or parameter change. |
Controllable[] |
getHelperNodes()
Return all helper nodes configured for this node. |
NodeInstance |
getNodeInstance()
Return the NodeInstance for this node instance. |
Controllable |
getParent()
If this node was configured as a helper node, return a reference to the node it is helping. |
int |
getSandNodeState()
Returns the current state of the node as one of the STATE constants. |
SandRoot |
getSandRoot()
Return the SandRoot that launched this instance. |
void |
restart()
Calls shutdown() followed by startup(). |
void |
resume()
Transition a node from the suspended state to the running state. |
void |
setHelperNodes(Controllable[] nodes)
Set the helper nodes as the specified array. |
void |
setNodeInstance(NodeInstance instance)
Called once by the root when the node instance is created. |
void |
setSandRoot(SandRoot root)
Set our back reference to the root that launched this instance. |
void |
shutdown()
Transition a node from the running to the stopped state. |
void |
startup()
Transition a node from the stopped to the running state. |
void |
suspend()
Transition a node from the running state to the suspended state. |
void |
systemwideShutdown(int code)
Signal a systemwide shutdown with the appropriate SHUTDOWN_* code. |
| Field Detail |
public static final int STATE_UNDEFINED
public static final int STATE_RUNNING
public static final int STATE_SUSPENDED
public static final int STATE_STOPPED
public static final int STATE_FAILED
public static final int STATE_STARTING
public static final int STATE_STOPPING
public static final int STATE_SUSPENDING
public static final int STATE_RESUMING
public static final int STATE_FAILING
public static final java.lang.String STATE_STR_UNDEFINED
public static final java.lang.String STATE_STR_RUNNING
public static final java.lang.String STATE_STR_SUSPENDED
public static final java.lang.String STATE_STR_STOPPED
public static final java.lang.String STATE_STR_FAILED
public static final java.lang.String STATE_STR_STARTING
public static final java.lang.String STATE_STR_STOPPING
public static final java.lang.String STATE_STR_SUSPENDING
public static final java.lang.String STATE_STR_RESUMING
public static final java.lang.String STATE_STR_FAILING
public static final java.lang.String[] STATE_STRINGS
String stopped = STATE_STRINGS[STATE_STOPPED];
public static final int OPERATION_UNDEFINED
public static final int OPERATION_STARTUP
public static final int OPERATION_SHUTDOWN
public static final int OPERATION_SUSPEND
public static final int OPERATION_RESUME
public static final int OPERATION_FAIL
public static final java.lang.String OPERATION_STR_UNDEFINED
public static final java.lang.String OPERATION_STR_STARTUP
public static final java.lang.String OPERATION_STR_SHUTDOWN
public static final java.lang.String OPERATION_STR_SUSPEND
public static final java.lang.String OPERATION_STR_RESUME
public static final java.lang.String OPERATION_STR_FAIL
public static final java.lang.String[] OPERATION_STRINGS
String shutdown = OPERATION_STRINGS[OPERATION_SHUTDOWN];
public static final int SHUTDOWN_NORMAL
public static final int SHUTDOWN_ERROR_TERMINATE
public static final int SHUTDOWN_ERROR_RESTART_LOCAL
public static final int SHUTDOWN_ERROR_RESTART_GLOBAL
| Method Detail |
public void startup()
throws ControlException
ControlException
public void shutdown()
throws ControlException
ControlException
public void suspend()
throws ControlException
ControlException
public void resume()
throws ControlException
ControlException
public void restart()
throws ControlException
shutdown() followed by startup().
ControlExceptionpublic int getSandNodeState()
public Controllable getParent()
public Controllable[] getHelperNodes()
public void setHelperNodes(Controllable[] nodes)
public NodeInstance getNodeInstance()
public void setNodeInstance(NodeInstance instance)
public SandRoot getSandRoot()
public void setSandRoot(SandRoot root)
public void systemwideShutdown(int code)
throws ControlException
ControlExceptionpublic void addWrapper(ControlWrapper wrapper)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||