|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.engine.runlevel.RunlevelManager
public final class RunlevelManager
This starts/stops xmlBlaster with different run levels.
Field Summary | |
---|---|
private boolean |
allowDynamicPlugins
|
private ContextNode |
contextNode
|
private int |
currRunlevel
|
private I_RunlevelListener[] |
DUMMY_ARR
|
private ServerScope |
glob
|
private static java.util.logging.Logger |
log
|
private JmxMBeanHandle |
mbeanHandle
My JMX registration |
private java.lang.String |
ME
|
static int |
RUNLEVEL_CLEANUP
|
static int |
RUNLEVEL_CLEANUP_POST
|
static int |
RUNLEVEL_CLEANUP_PRE
|
static int |
RUNLEVEL_HALTED
|
static int |
RUNLEVEL_HALTED_POST
|
static int |
RUNLEVEL_HALTED_PRE
|
static int |
RUNLEVEL_RUNNING
|
static int |
RUNLEVEL_RUNNING_POST
|
static int |
RUNLEVEL_RUNNING_PRE
|
static int |
RUNLEVEL_STANDBY
|
static int |
RUNLEVEL_STANDBY_POST
|
static int |
RUNLEVEL_STANDBY_PRE
|
private java.util.Set |
runlevelListenerSet
For listeners who want to be informed about runlevel changes. |
Constructor Summary | |
---|---|
RunlevelManager(ServerScope glob)
One instance of this represents one xmlBlaster server. |
Method Summary | |
---|---|
private void |
addPlugin(PluginConfig pluginConfig)
Add a new plugin, if it exists remove the old first. |
void |
addRunlevelListener(I_RunlevelListener l)
Adds the specified runlevel listener to receive runlevel change events. |
int |
changeRunlevel(int newRunlevel,
boolean force)
Change the run level to the given newRunlevel. |
int |
changeRunlevel(java.lang.String newRunlevel,
boolean force)
Allows to pass the newRunlevel as a String like "RUNLEVEL_STANDBY" or "6" |
static boolean |
checkRunlevel(int level)
|
private int |
fireRunlevelEvent(int from,
int to,
boolean force)
The static plugins are loaded from (exclusive) to (inclusive) when startup and the same when shutting down. |
ContextNode |
getContextNode()
|
int |
getCurrentRunlevel()
See java for runlevels |
java.lang.String |
getUsageUrl()
|
void |
initJmx()
|
void |
initPluginManagers()
Incarnate the different managers which handle run levels. |
boolean |
isCleanup()
|
boolean |
isHalted()
|
boolean |
isMajorLevel()
|
private static boolean |
isMajorLevel(int level)
|
boolean |
isRunning()
|
boolean |
isStandby()
|
java.lang.String |
publish(SessionInfo sessionInfo,
MsgUnit msgUnit,
PublishQosServer publishQos)
Called from RequestBroker when a new plugin XML is arriving. |
void |
removeRunlevelListener(I_RunlevelListener l)
Removes the specified listener. |
void |
setId(java.lang.String id)
Sets the cluster node ID as soon as it is known. |
java.lang.String |
setRunlevel(java.lang.String level)
JMX: Change the run level of xmlBlaster. |
void |
setUsageUrl(java.lang.String url)
|
void |
shutdown()
|
private void |
shutdownPlugins(int from,
int to)
|
private void |
startupPlugins(int from,
int to)
|
(package private) void |
toggleCreate(PluginConfig pluginConfig,
boolean create)
Called by JMX, throws IllegalArgumentExcetion instead of XmlBlasterException. |
static int |
toRunlevelInt(java.lang.String level)
Parses given string to extract the priority of a message |
static java.lang.String |
toRunlevelStr(int level)
Parses given string to extract the priority of a message |
java.lang.String |
usage()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String ME
private final ServerScope glob
private static java.util.logging.Logger log
private int currRunlevel
public static final int RUNLEVEL_HALTED_PRE
public static final int RUNLEVEL_HALTED
public static final int RUNLEVEL_HALTED_POST
public static final int RUNLEVEL_STANDBY_PRE
public static final int RUNLEVEL_STANDBY
public static final int RUNLEVEL_STANDBY_POST
public static final int RUNLEVEL_CLEANUP_PRE
public static final int RUNLEVEL_CLEANUP
public static final int RUNLEVEL_CLEANUP_POST
public static final int RUNLEVEL_RUNNING_PRE
public static final int RUNLEVEL_RUNNING
public static final int RUNLEVEL_RUNNING_POST
private final I_RunlevelListener[] DUMMY_ARR
private JmxMBeanHandle mbeanHandle
private ContextNode contextNode
private boolean allowDynamicPlugins
private final java.util.Set runlevelListenerSet
Constructor Detail |
---|
public RunlevelManager(ServerScope glob)
Method Detail |
---|
public void initJmx()
public ContextNode getContextNode()
public void setId(java.lang.String id)
public void initPluginManagers() throws XmlBlasterException
XmlBlasterException
public final java.lang.String publish(SessionInfo sessionInfo, MsgUnit msgUnit, PublishQosServer publishQos) throws XmlBlasterException
sessionInfo
- The publishermsgUnit
- The content contains the jar file, and some client properties the configurationpublishQos
-
XmlBlasterException
public void addRunlevelListener(I_RunlevelListener l)
public void removeRunlevelListener(I_RunlevelListener l)
public final int changeRunlevel(java.lang.String newRunlevel, boolean force) throws XmlBlasterException
XmlBlasterException
changeRunlevel(int, boolean)
public java.lang.String setRunlevel(java.lang.String level) throws java.lang.Exception
setRunlevel
in interface RunlevelManagerMBean
0
- is halted and 9 is fully operational
java.lang.Exception
public final int changeRunlevel(int newRunlevel, boolean force) throws XmlBlasterException
newRunlevel
- The new run level we want to switch toforce
- Ignore exceptions during change, currently only force == true is supported
XmlBlasterException
- for invalid run levelprivate void startupPlugins(int from, int to) throws XmlBlasterException
XmlBlasterException
void toggleCreate(PluginConfig pluginConfig, boolean create)
pluginConfig
- create
- private void addPlugin(PluginConfig pluginConfig) throws XmlBlasterException
pluginConfig
-
XmlBlasterException
private void shutdownPlugins(int from, int to) throws XmlBlasterException
XmlBlasterException
private final int fireRunlevelEvent(int from, int to, boolean force) throws XmlBlasterException
XmlBlasterException
public final int getCurrentRunlevel()
getCurrentRunlevel
in interface RunlevelManagerMBean
public boolean isHalted()
public boolean isStandby()
public boolean isCleanup()
public boolean isRunning()
public boolean isMajorLevel()
private static final boolean isMajorLevel(int level)
public static final boolean checkRunlevel(int level)
public static final java.lang.String toRunlevelStr(int level)
level
- For example 7
public static final int toRunlevelInt(java.lang.String level)
level
- For example "STANDBY" or 7defaultPriority
- Value to use if not parseable
public void shutdown()
public java.lang.String usage()
usage
in interface I_AdminUsage
public java.lang.String getUsageUrl()
getUsageUrl
in interface I_AdminUsage
public void setUsageUrl(java.lang.String url)
setUsageUrl
in interface I_AdminUsage
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |