|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ow2.jonas.cluster.daemon.ClusterDaemon
public class ClusterDaemon
ClusterDaemon is provided to control JOnAS instances remotely. The ClusterDaemon is an independent Java program, and runs on every node (machine) in the cluster. It receives remote commands (JMX), and does something such as starting or stopping JOnAS instances.
Field Summary | |
---|---|
static String |
JONAS_CMD_NAME_UNIX_DEF
JOnAS command name in unix environmment. |
static String |
JONAS_CMD_NAME_WIN_DEF
JOnAS command name in windows environmment. |
static String |
LONG_TYPE_DYN_INFO
Used to exclude attribute that are not Long typed when getting. |
static int |
SLEEP_DELAY
Sleep before exit of JVM. |
Method Summary | |
---|---|
void |
addServer(String name,
String description,
String jonasRoot,
String jonasBase,
String javaHome,
String xprem,
String autoBoot,
String jonasCmd,
String saveIt)
Add a server to cluster daemon control. |
void |
buildRuntimeInfo()
Gets runtime info of current platform. |
boolean |
checkServerState(String srvName)
Retrieve the state of the given controlled server. |
void |
displayDynamicAttributes()
displaying dynamic host attributes. |
String |
getAutoBoot4Server(String name)
True if autoboot is enabled for the given server. |
ArrayList |
getControlledServersNames()
Controlled servers. |
Hashtable<String,String> |
getDynamicHostAttributes()
Get dynamic host attributes. |
String |
getJavaHome4Server(String name)
(MBean interface). |
String |
getJmxUrl()
Get jmx url of the cluster daemon. |
String |
getJonasBase4Server(String name)
(MBean interface). |
String |
getJonasCmd4Server(String name)
Get command for the given server. |
String |
getJonasRoot4Server(String name)
(MBean interface). |
String |
getName()
|
String |
getobjectName()
|
String |
getOperatingSystemArch()
Gets OS architecture |
String |
getOperatingSystemAvailableProcessors()
Get available processors of the OS. |
String |
getOperatingSystemName()
Get OS name. |
String |
getOperatingSystemVersion()
Get OS version. |
String |
getOsCurrentUsedSpace()
Getting Operating system Current used space. |
String |
getOsTotalSpace()
Getting Operating system Current used space. |
String |
getRunTimeSpecVendor()
Get spec. |
String |
getRunTimeSpecVersion()
Get runtime spec. |
String |
getRunTimeVmName()
Get runtime vm name. |
String |
getRunTimeVmVendor()
Get runtime vendor. |
String |
getRunTimeVmVersion()
Get runtime vm version. |
String |
getVmCurrentUsedHeapMemory()
Getting remote Vm's Current used Heap memory. |
String |
getVmCurrentUsedMemory()
Get remote Vm used Memory. |
String |
getVmCurrentUsedNonHeapMemory()
Getting remote Vm's Current used non Heap memory. |
String |
getVmTotalMemory()
Getting remote Vm Total Memory. |
String |
getXprm4Server(String name)
Get extra parameters for the given server. |
void |
haltJOnAS(String name)
Halt a JOnAS instance (MBean interface). |
void |
initHostInfos()
Initializes platform infos. |
boolean |
iseventProvider()
|
boolean |
isstateManageable()
|
boolean |
isstatisticsProvider()
|
static void |
main(String[] args)
Main method |
void |
modifyServer(String name,
String description,
String javaHome,
String jonasRoot,
String jonasBase,
String xprm,
String autoBoot,
String jonasCmd)
Modify a server configuration (MBean interface). |
int |
pingJOnAS(String name)
Ping a JOnAS instance (MBean interface). |
void |
reloadConfiguration()
Reload the configuration (MBean interface). |
void |
removeServer(String serverName)
Remove a server configuration (MBean interface). |
void |
removeServer(String serverName,
String saveIt)
Remove This server from cluster daemon control. |
void |
saveConfiguration()
Save current configuration |
ArrayList |
serversNames()
Get jmx url of the cluster daemon. |
void |
setJmxUrl(String url)
|
void |
setobjectName(String name)
Sets the object name of this mbean. |
void |
setOperatingSystemArch(String operatingSystemArch)
Sets OS Architecture |
void |
setOperatingSystemAvailableProcessors(String operatingSystemAvailableProcessors)
|
void |
setOperatingSystemName(String operatingSystemName)
Sets operating system name. |
void |
setOperatingSystemVersion(String operatingSystemVersion)
Sets OS version |
void |
setRunTimeSpecVendor(String runTimeSpecVendor)
Sets Runtime vendor. |
void |
setRunTimeSpecVersion(String runTimeSpecVersion)
Sets Runtime spec. |
void |
setRunTimeVmName(String runTimeVmName)
|
void |
setRunTimeVmVendor(String runTimeVmVendor)
Sets Runtime VM vendor. |
void |
setRunTimeVmVersion(String runTimeVmVersion)
Sets runtime VM version. |
void |
start(String[] args)
Main function. |
String |
startAllJOnAS(String domainName,
String prm)
Start all the JOnAS instances configured with auto-reboot. |
void |
startJOnAS(String name,
String domainName,
String prm)
Start a JOnAS instance (MBean interface). |
String |
stopAllJOnAS()
Stop all the JOnAS instances. |
void |
stopClusterDaemon()
Stop the current instance. |
void |
stopJOnAS(String name)
Stop a JOnAS instance (MBean interface). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SLEEP_DELAY
public static final String LONG_TYPE_DYN_INFO
public static final String JONAS_CMD_NAME_WIN_DEF
public static final String JONAS_CMD_NAME_UNIX_DEF
Method Detail |
---|
public boolean checkServerState(String srvName) throws ClusterDaemonException
checkServerState
in interface ClusterDaemonMBean
srvName
- server's name.
ClusterDaemonException
- any.public void buildRuntimeInfo()
public void start(String[] args) throws ClusterDaemonException
args
- arguments list
ClusterDaemonException
- if an error occurspublic void displayDynamicAttributes()
public static void main(String[] args)
args
- the arguments of the cluster daemonpublic String getobjectName()
getobjectName
in interface ClusterDaemonMBean
public void setobjectName(String name)
setobjectName
in interface ClusterDaemonMBean
name
- the Object Namepublic boolean iseventProvider()
iseventProvider
in interface ClusterDaemonMBean
public boolean isstateManageable()
isstateManageable
in interface ClusterDaemonMBean
public boolean isstatisticsProvider()
isstatisticsProvider
in interface ClusterDaemonMBean
public String getJavaHome4Server(String name) throws ClusterDaemonException
getJavaHome4Server
in interface ClusterDaemonMBean
name
- JOnAS instance name
ClusterDaemonException
- any.public String getJonasBase4Server(String name) throws ClusterDaemonException
getJonasBase4Server
in interface ClusterDaemonMBean
name
- JOnAS instance name
ClusterDaemonException
- any.public String getJonasRoot4Server(String name) throws ClusterDaemonException
getJonasRoot4Server
in interface ClusterDaemonMBean
name
- JOnAS instance name
ClusterDaemonException
- any.public String getJonasCmd4Server(String name) throws ClusterDaemonException
ClusterDaemonMBean
getJonasCmd4Server
in interface ClusterDaemonMBean
name
- JOnAS instance name
ClusterDaemonException
- any.public String getXprm4Server(String name) throws ClusterDaemonException
ClusterDaemonMBean
getXprm4Server
in interface ClusterDaemonMBean
name
- JOnAS instance name
ClusterDaemonException
- any.public String getAutoBoot4Server(String name) throws ClusterDaemonException
ClusterDaemonMBean
autoboot
is enabled for the given server.
getAutoBoot4Server
in interface ClusterDaemonMBean
name
- JOnAS instance name
ClusterDaemonException
- any.public void removeServer(String serverName) throws ClusterDaemonException
removeServer
in interface ClusterDaemonMBean
name
- server name
ClusterDaemonException
- if an error occurspublic void modifyServer(String name, String description, String javaHome, String jonasRoot, String jonasBase, String xprm, String autoBoot, String jonasCmd) throws ClusterDaemonException
modifyServer
in interface ClusterDaemonMBean
name
- server namedescription
- server descriptionjavaHome
- JAVA_HOME dirjonasBase
- JONAS_BASE dirjonasRoot
- JONAS_ROOT dirxprm
- extra JVM parametersautoBoot
- automatic startjonasCmd
- user command
ClusterDaemonException
- if an error occurspublic void reloadConfiguration() throws ClusterDaemonException
reloadConfiguration
in interface ClusterDaemonMBean
ClusterDaemonException
- if an error occurspublic void startJOnAS(String name, String domainName, String prm)
startJOnAS
in interface ClusterDaemonMBean
name
- instance namedomainName
- domain nameprm
- extra parameters
ClusterDaemonException
- if an error occurspublic void stopJOnAS(String name) throws ClusterDaemonException
stopJOnAS
in interface ClusterDaemonMBean
name
- instance name
ClusterDaemonException
- if an error occurspublic void haltJOnAS(String name) throws ClusterDaemonException
haltJOnAS
in interface ClusterDaemonMBean
name
- instance name
ClusterDaemonException
- if an error occurspublic int pingJOnAS(String name) throws ClusterDaemonException
pingJOnAS
in interface ClusterDaemonMBean
name
- instance name
ClusterDaemonException
- if an error occurspublic String startAllJOnAS(String domainName, String prm) throws ClusterDaemonException
startAllJOnAS
in interface ClusterDaemonMBean
domainName
- domain nameprm
- extra parameters
ClusterDaemonException
- any.public String stopAllJOnAS()
stopAllJOnAS
in interface ClusterDaemonMBean
ClusterDaemonException
- any.public void stopClusterDaemon()
stopClusterDaemon
in interface ClusterDaemonMBean
public String getName()
public ArrayList getControlledServersNames() throws ClusterDaemonException
getControlledServersNames
in interface ClusterDaemonMBean
ClusterDaemonException
- any.public ArrayList serversNames() throws ClusterDaemonException
serversNames
in interface ClusterDaemonMBean
ClusterDaemonException
- any.public String getJmxUrl()
getJmxUrl
in interface ClusterDaemonMBean
public void setJmxUrl(String url)
url
- the url used by the JMX Remote connectorpublic String getOperatingSystemAvailableProcessors()
getOperatingSystemAvailableProcessors
in interface ClusterDaemonMBean
public void setOperatingSystemAvailableProcessors(String operatingSystemAvailableProcessors)
operatingSystemAvailableProcessors.
- public String getOperatingSystemName()
getOperatingSystemName
in interface ClusterDaemonMBean
ClusterDaemonException
- any.public void setOperatingSystemName(String operatingSystemName)
operatingSystemName
- public String getOperatingSystemVersion()
getOperatingSystemVersion
in interface ClusterDaemonMBean
ClusterDaemonException
- any.public void setOperatingSystemVersion(String operatingSystemVersion)
operatingSystemVersion
- public String getRunTimeSpecVendor()
getRunTimeSpecVendor
in interface ClusterDaemonMBean
ClusterDaemonException
- any.public void setRunTimeSpecVendor(String runTimeSpecVendor)
runTimeSpecVendor
- public String getRunTimeSpecVersion()
getRunTimeSpecVersion
in interface ClusterDaemonMBean
ClusterDaemonException
- any.public void setRunTimeSpecVersion(String runTimeSpecVersion)
runTimeSpecVersion
- public String getRunTimeVmName()
getRunTimeVmName
in interface ClusterDaemonMBean
ClusterDaemonException
- any.public void setRunTimeVmName(String runTimeVmName)
runTimeVmName
- public String getRunTimeVmVendor()
getRunTimeVmVendor
in interface ClusterDaemonMBean
ClusterDaemonException
- any.public void setRunTimeVmVendor(String runTimeVmVendor)
runTimeVmVendor
- public String getRunTimeVmVersion()
getRunTimeVmVersion
in interface ClusterDaemonMBean
ClusterDaemonException
- any.public void setRunTimeVmVersion(String runTimeVmVersion)
runTimeVmVersion
- public Hashtable<String,String> getDynamicHostAttributes() throws ClusterDaemonException
getDynamicHostAttributes
in interface ClusterDaemonMBean
ClusterDaemonException
- any.public void initHostInfos() throws ClusterDaemonException
ClusterDaemonException
- any.public String getOperatingSystemArch()
getOperatingSystemArch
in interface ClusterDaemonMBean
public void setOperatingSystemArch(String operatingSystemArch)
operatingSystemArch
- public String getVmCurrentUsedNonHeapMemory() throws ClusterDaemonException
getVmCurrentUsedNonHeapMemory
in interface ClusterDaemonMBean
ClusterDaemonException
- any.public String getOsCurrentUsedSpace() throws ClusterDaemonException
getOsCurrentUsedSpace
in interface ClusterDaemonMBean
ClusterDaemonException
- any.public String getOsTotalSpace() throws ClusterDaemonException
getOsTotalSpace
in interface ClusterDaemonMBean
ClusterDaemonException
- any.public String getVmCurrentUsedHeapMemory() throws ClusterDaemonException
getVmCurrentUsedHeapMemory
in interface ClusterDaemonMBean
ClusterDaemonException
- any.public String getVmCurrentUsedMemory() throws ClusterDaemonException
getVmCurrentUsedMemory
in interface ClusterDaemonMBean
ClusterDaemonException
- any.public String getVmTotalMemory() throws ClusterDaemonException
getVmTotalMemory
in interface ClusterDaemonMBean
ClusterDaemonException
- any.public void addServer(String name, String description, String jonasRoot, String jonasBase, String javaHome, String xprem, String autoBoot, String jonasCmd, String saveIt) throws ClusterDaemonException
addServer
in interface ClusterDaemonMBean
name
- the server namedescription
- server descriptionjavaHome
- path to JREjonasRoot
- path to bin repositoryJonasBase
- path to lib repositoryxprem
- extra parameter e.g: -Djava.net.preferIPv4Stack=trueautoBoot
- true if the server is launched when cluster daemon startsjonasCmd
- user commandsaveIt
- boolean
ClusterDaemonException
- any.public void removeServer(String serverName, String saveIt) throws ClusterDaemonException
removeServer
in interface ClusterDaemonMBean
serverName
- The server to removesaveIt
- True to flush clusterd configuration
ClusterDaemonException
- any.public void saveConfiguration() throws ClusterDaemonException
saveConfiguration
in interface ClusterDaemonMBean
ClusterDaemonException
- any.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |