org.ow2.jonas.lib.management.domain.proxy.clusterd
Class ClusterDaemonProxy

java.lang.Object
  extended by org.ow2.jonas.lib.management.domain.proxy.JMXProxy
      extended by org.ow2.jonas.lib.management.domain.proxy.clusterd.ClusterDaemonProxy
All Implemented Interfaces:
ClusterDaemonProxyMBean

public class ClusterDaemonProxy
extends JMXProxy
implements ClusterDaemonProxyMBean

ClusterDaemon proxy. It is created when a new element has been found in domain.xml It holds all the necessary information to go to the ClusterDaemon

Author:
durieuxp, eyindanga, danesa

Field Summary
 
Fields inherited from class org.ow2.jonas.lib.management.domain.proxy.JMXProxy
logger
 
Constructor Summary
ClusterDaemonProxy(DomainMonitor dm, String name, Collection urls)
          Constructor.
 
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 checkit()
          Check the MBean server connection and possibly change state.
 Hashtable<String,String> dynamicRemoteHostInfos()
           
 ArrayList getControlledServersNames()
           
 String getHostName()
           
 String getOperatingSystemArch()
           
 String getOperatingSystemAvailableProcessors()
           
 String getOperatingSystemName()
           
 String getOperatingSystemVersion()
           
 String getOsCurrentUsedSpace()
          Getting Operating system Current used space
 String getOsTotalSpace()
          Getting Operating system Current used space
 void getRemoteHostInfo()
           
 String getRunTimeSpecVendor()
           
 String getRunTimeSpecVersion()
           
 String getRunTimeVmName()
           
 String getRunTimeVmVendor()
           
 String getRunTimeVmVersion()
           
 void getServersNames()
          remote call to the cluster daemon mbaen, by using jmx connection.
 String getVmCurrentUsedHeapMemory()
          Getting remote Vm's Current used Heap memory
 String getVmCurrentUsedMemory()
          Getting remote Vm used Memory
 String getVmCurrentUsedNonHeapMemory()
          Getting remote Vm's Current used non Heap memory
 String getVmTotalMemory()
          Getting remote Vm Total Memory
 boolean haltServer(String serverName, String otherParams)
          Halt a Remote JOnAS Server
 void notifyStarting(Collection urls)
          Notification from discovery: RUNNING.
 void notifyStopping()
          Notification from discovery: STOPPING.
 String pingAllJOnAS()
           
 int pingJOnAS(String name)
           
 void reloadConfiguration()
          Reload clusterd configuration
 void removeServer(String serverName, String saveIt)
          Remove this server from cluster daemon control.
 void save(String name)
           
 void setControlledServersNames(ArrayList controlledServersNames)
           
 void setHostName(String hostName)
           
 void setName(String name)
           
 void startAllServers(String otherParams)
           
 boolean startServer(String serverName, String otherParams)
          Start a Remote JOnAS Server.
 void stopAllServers(String otherParams)
           
 boolean stopServer(String serverName, String otherParams)
          Stop a Remote JOnAS Server.
 
Methods inherited from class org.ow2.jonas.lib.management.domain.proxy.JMXProxy
checkConnection, connect, disconnect, getAttribute, getAttributes, getConnection, getConnectionUrl, getDm, getDomain, getJ2EEServerState, getName, getObjectName, getState, getUrls, isRegistered, queryNames, setAttribute, setConnection, setObjectName, setState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ow2.jonas.lib.management.domain.proxy.clusterd.ClusterDaemonProxyMBean
getConnectionUrl, getName, getState
 

Constructor Detail

ClusterDaemonProxy

public ClusterDaemonProxy(DomainMonitor dm,
                          String name,
                          Collection urls)
Constructor. This is called when a ClusterDaemon element has been found in domain.xml.

Parameters:
dm - the DomainMonitor object reference
name - cluster daemon name
urls - possible urls that can be used for connection with the CD
Method Detail

checkit

public void checkit()
Check the MBean server connection and possibly change state.


startServer

public boolean startServer(String serverName,
                           String otherParams)
Start a Remote JOnAS Server.

Specified by:
startServer in interface ClusterDaemonProxyMBean
Parameters:
serverName - Name of the jonas server
otherParams - additional parameters to start a server via the ClusterDaemon
Returns:
true if operation succeeded

stopServer

public boolean stopServer(String serverName,
                          String otherParams)
Stop a Remote JOnAS Server.

Specified by:
stopServer in interface ClusterDaemonProxyMBean
Parameters:
daemonName - ClusterDaemon used to start the jonas server
serverName - Name of the jonas server
domainName - Domain name
Returns:
true if operation succeded

haltServer

public boolean haltServer(String serverName,
                          String otherParams)
Halt a Remote JOnAS Server

Parameters:
daemonName - ClusterDaemon used to start the jonas server
serverName - Name of the jonas server
domainName - Domain name
Returns:
true if operation succeded

startAllServers

public void startAllServers(String otherParams)
Specified by:
startAllServers in interface ClusterDaemonProxyMBean

stopAllServers

public void stopAllServers(String otherParams)
Specified by:
stopAllServers in interface ClusterDaemonProxyMBean

pingAllJOnAS

public String pingAllJOnAS()

pingJOnAS

public int pingJOnAS(String name)
Specified by:
pingJOnAS in interface ClusterDaemonProxyMBean
Returns:

reloadConfiguration

public void reloadConfiguration()
Description copied from interface: ClusterDaemonProxyMBean
Reload clusterd configuration

Specified by:
reloadConfiguration in interface ClusterDaemonProxyMBean

save

public void save(String name)
Specified by:
save in interface ClusterDaemonProxyMBean

getServersNames

public void getServersNames()
remote call to the cluster daemon mbaen, by using jmx connection.


getControlledServersNames

public ArrayList getControlledServersNames()
Specified by:
getControlledServersNames in interface ClusterDaemonProxyMBean
Returns:
controlled server names

getHostName

public String getHostName()
Specified by:
getHostName in interface ClusterDaemonProxyMBean
Returns:
the clusterd host name

setName

public void setName(String name)
Specified by:
setName in interface ClusterDaemonProxyMBean

setControlledServersNames

public void setControlledServersNames(ArrayList controlledServersNames)

setHostName

public void setHostName(String hostName)

getRemoteHostInfo

public void getRemoteHostInfo()

dynamicRemoteHostInfos

public Hashtable<String,String> dynamicRemoteHostInfos()
Specified by:
dynamicRemoteHostInfos in interface ClusterDaemonProxyMBean
Returns:

getOperatingSystemAvailableProcessors

public String getOperatingSystemAvailableProcessors()
Specified by:
getOperatingSystemAvailableProcessors in interface ClusterDaemonProxyMBean
Returns:
the operatingSystemAvailableProcessors

getOperatingSystemName

public String getOperatingSystemName()
Specified by:
getOperatingSystemName in interface ClusterDaemonProxyMBean
Returns:
the operatingSystemName

getOperatingSystemVersion

public String getOperatingSystemVersion()
Specified by:
getOperatingSystemVersion in interface ClusterDaemonProxyMBean
Returns:
the operatingSystemVersion

getRunTimeSpecVendor

public String getRunTimeSpecVendor()
Specified by:
getRunTimeSpecVendor in interface ClusterDaemonProxyMBean
Returns:
the runTimeSpecVendor

getRunTimeSpecVersion

public String getRunTimeSpecVersion()
Specified by:
getRunTimeSpecVersion in interface ClusterDaemonProxyMBean
Returns:
the runTimeSpecVersion

getRunTimeVmName

public String getRunTimeVmName()
Specified by:
getRunTimeVmName in interface ClusterDaemonProxyMBean
Returns:
the runTimeVmName

getRunTimeVmVendor

public String getRunTimeVmVendor()
Specified by:
getRunTimeVmVendor in interface ClusterDaemonProxyMBean
Returns:
the runTimeVmVendor

getRunTimeVmVersion

public String getRunTimeVmVersion()
Specified by:
getRunTimeVmVersion in interface ClusterDaemonProxyMBean
Returns:
the runTimeVmVersion

getOperatingSystemArch

public String getOperatingSystemArch()
Specified by:
getOperatingSystemArch in interface ClusterDaemonProxyMBean
Returns:
the OperatingSystem Architecture

getVmCurrentUsedMemory

public String getVmCurrentUsedMemory()
Getting remote Vm used Memory

Specified by:
getVmCurrentUsedMemory in interface ClusterDaemonProxyMBean
Returns:
the value of current used memory

getVmTotalMemory

public String getVmTotalMemory()
Getting remote Vm Total Memory

Specified by:
getVmTotalMemory in interface ClusterDaemonProxyMBean
Returns:
the value of Vm Total memory

getVmCurrentUsedHeapMemory

public String getVmCurrentUsedHeapMemory()
Getting remote Vm's Current used Heap memory

Specified by:
getVmCurrentUsedHeapMemory in interface ClusterDaemonProxyMBean
Returns:
the value of Vm's Current used Heap memory

getVmCurrentUsedNonHeapMemory

public String getVmCurrentUsedNonHeapMemory()
Getting remote Vm's Current used non Heap memory

Specified by:
getVmCurrentUsedNonHeapMemory in interface ClusterDaemonProxyMBean
Returns:
the value of Vm's Current used non Heap memory

getOsCurrentUsedSpace

public String getOsCurrentUsedSpace()
Getting Operating system Current used space

Specified by:
getOsCurrentUsedSpace in interface ClusterDaemonProxyMBean
Returns:
the value of Operating system Current used space

getOsTotalSpace

public String getOsTotalSpace()
Getting Operating system Current used space

Specified by:
getOsTotalSpace in interface ClusterDaemonProxyMBean
Returns:
the value of Operating system Total space

addServer

public 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

Specified by:
addServer in interface ClusterDaemonProxyMBean
Parameters:
name - the server name
description - server description
javaHome - path to JRE
jonasRoot - path to bin repository
JonasBase - path to lib repository
xprem - extra parameter e.g: -Djava.net.preferIPv4Stack=true
autoBoot - true if the server is launched when cluster daemon starts
jonasCmd - user command
saveIt - true to flush the clusterd configuration

removeServer

public void removeServer(String serverName,
                         String saveIt)
Remove this server from cluster daemon control.

Specified by:
removeServer in interface ClusterDaemonProxyMBean
Parameters:
serverName - the server to remove
saveIt - true to flush the clusterd configuration

notifyStarting

public void notifyStarting(Collection urls)
Notification from discovery: RUNNING.

Parameters:
urls - for connection

notifyStopping

public void notifyStopping()
Notification from discovery: STOPPING.



Copyright © 2010 OW2 Consortium. All Rights Reserved.