on = JonasObjectName.clusterDaemon(getDomain()); String[] attributes = new String[] {"RunTimeSpecVendor", "RunTimeSpecVersion", "RunTimeVmName", "RunTimeVmVendor", "RunTimeVmVersion", "OperatingSystemAvailableProcessors", "OperatingSystemName", "OperatingSystemVersion",
/** * Getting remote Vm Total Memory * @return the value of Vm Total memory */ public String getVmTotalMemory() { // get remote static infos if it's not yet done of cluster daemon initRemoteHostInfos(); String ret = null; try { ObjectName on = JonasObjectName.clusterDaemon(getDomain()); ret = (String) getConnection().getAttribute(on, "VmTotalMemory"); } catch (Exception e) { logger.log(BasicLevel.ERROR, "Cannot get monitoring informations for cluster daemon remote host :" + e); return null; } logger.log(BasicLevel.DEBUG, "Finisched to get Vm Total Memory"); return ret; }
/** * Getting Operating system Current used space * @return the value of Operating system Total space */ public String getOsTotalSpace() { // get remote static infos if it's not yet done of cluster daemon initRemoteHostInfos(); String ret = null; try { ObjectName on = JonasObjectName.clusterDaemon(getDomain()); ret = (String) getConnection().getAttribute(on, "OsTotalSpace"); } catch (Exception e) { logger.log(BasicLevel.ERROR, "Cannot get monitoring informations for cluster daemon remote host :" + e); return null; } logger.log(BasicLevel.DEBUG, "Finisched to get clusterd host infos"); return ret; }
/** * Getting remote Vm used Memory * @return the value of current used memory */ public String getVmCurrentUsedMemory() { // get remote static infos if it's not yet done of cluster daemon initRemoteHostInfos(); String ret = null; try { ObjectName on = JonasObjectName.clusterDaemon(getDomain()); ret = (String) getConnection().getAttribute(on, "VmCurrentUsedMemory"); } catch (Exception e) { logger.log(BasicLevel.ERROR, "Cannot get monitoring informations for cluster daemon remote host :" + e); return null; } logger.log(BasicLevel.DEBUG, "Finisched to get clusterd host infos"); return ret; }
/** * Getting remote Vm's Current used Heap memory * @return the value of Vm's Current used Heap memory */ public String getVmCurrentUsedHeapMemory() { // get remote static infos if it's not yet done of cluster daemon initRemoteHostInfos(); String ret = null; try { ObjectName on = JonasObjectName.clusterDaemon(getDomain()); ret = (String) getConnection().getAttribute(on, "VmCurrentUsedHeapMemory"); } catch (Exception e) { logger.log(BasicLevel.ERROR, "Cannot get monitoring informations for cluster daemon remote host :" + e); return null; } logger.log(BasicLevel.DEBUG, "Finisched to get clusterd host infos"); return ret; }
/** * Getting remote Vm's Current used non Heap memory * @return the value of Vm's Current used non Heap memory */ public String getVmCurrentUsedNonHeapMemory() { // get remote static infos if it's not yet done of cluster daemon initRemoteHostInfos(); String ret = null; try { ObjectName on = JonasObjectName.clusterDaemon(getDomain()); ret = (String) getConnection().getAttribute(on, "VmCurrentUsedNonHeapMemory"); } catch (Exception e) { logger.log(BasicLevel.ERROR, "Cannot get monitoring informations for cluster daemon remote host :" + e); return null; } logger.log(BasicLevel.DEBUG, "Finisched to get clusterd host infos"); return ret; }
/** * Getting Operating system Current used space * @return the value of Operating system Current used space */ public String getOsCurrentUsedSpace() { // get remote static infos if it's not yet done of cluster daemon initRemoteHostInfos(); String ret = null; try { ObjectName on = JonasObjectName.clusterDaemon(getDomain()); ret = (String) getConnection().getAttribute(on, "OsCurrentUsedSpace"); } catch (Exception e) { logger.log(BasicLevel.ERROR, "Cannot get monitoring informations for cluster daemon remote host :" + e); return null; } logger.log(BasicLevel.DEBUG, "Finisched to get clusterd host infos"); return ret; }
/** * Remove this server from cluster daemon control. * @param serverName the server to remove * @param saveIt true to flush the clusterd configuration */ public void removeServer(final String serverName, final String saveIt) { // get remote host infos if we have not done it yet. initRemoteHostInfos(); try { // add the server to the current srv list controlledServersNames.remove(serverName); String[] opParams = {serverName, saveIt}; String[] opSignature = {"java.lang.String", "java.lang.String"}; ObjectName on = JonasObjectName.clusterDaemon(getDomain()); getConnection().invoke(on, "removeServer", opParams, opSignature); } catch (Exception e) { logger.log(BasicLevel.DEBUG, "Cannot Remove server named " + getName() + " to cluster daemon " + getName() + " control " + e); return; } }
String[] opSignature = {"java.lang.String", "java.lang.String", "java.lang.String", "java.lang.String", "java.lang.String", "java.lang.String", "java.lang.String", "java.lang.String", "java.lang.String"}; ObjectName on = JonasObjectName.clusterDaemon(getDomain()); getConnection().invoke(on, "addServer", opParams, opSignature); } catch (Exception e) {
public void stopAllServers(final String otherParams) { logger.log(BasicLevel.DEBUG, ""); if (!checkConnection()) { // Not yet connected. Try to connect now. if (!connect(getUrls())) { logger.log(BasicLevel.ERROR, "Unable to get connection to cluster daemon " + getName()); return; } } // Ask Cluster Daemon to start all the Servers. String opName = "stopAllJOnAS"; String[] opParams = {}; String[] opSignature = {}; try { ObjectName on = JonasObjectName.clusterDaemon(getDomain()); getConnection().invoke(on, opName, opParams, opSignature); } catch (Exception e) { logger.log(BasicLevel.ERROR, "Cannot stop server: " + e); // TODO } }
public void save(final String name) { // TODO Auto-generated method stub logger.log(BasicLevel.DEBUG, ""); if (!checkConnection()) { // Not yet connected. Try to connect now. if (!connect(getUrls())) { logger.log(BasicLevel.ERROR, "Unable to get connection to cluster daemon " + name); return; } } setName(name); String opName = "saveToXml"; String[] opParams = {name}; String[] opSignature = {"java.lang.String"}; try { ObjectName on = JonasObjectName.clusterDaemon(getDomain()); getConnection().invoke(on, opName, opParams, opSignature); } catch (Exception e) { logger.log(BasicLevel.ERROR, "Cannot save cluster daemon Info To xml file: " + e); // TODO } }
/** * remote call to the cluster daemon mbaen, by using jmx connection. */ @SuppressWarnings("unchecked") public void getServersNames() { logger.log(BasicLevel.DEBUG, "getting controlled server names"); if (!checkConnection()) { // Not yet connected. Try to connect now. if (!connect(getUrls())) { logger.log(BasicLevel.ERROR, "Unable to get connection to cluster daemon " + getName()); return; } } ArrayList ret = null; String opName = "serversNames"; try { ObjectName on = JonasObjectName.clusterDaemon(getDomain()); ret = (ArrayList) getConnection().invoke(on, opName, null, null); } catch (Exception e) { logger.log(BasicLevel.ERROR, "Cannot get Controlled server names:" + e); // TODO } this.controlledServersNames = ret; }
public void startAllServers(final String otherParams) { logger.log(BasicLevel.DEBUG, ""); if (!checkConnection()) { // Not yet connected. Try to connect now. if (!connect(getUrls())) { logger.log(BasicLevel.ERROR, "Unable to get connection to cluster daemon " + getName()); return; } } // Ask Cluster Daemon to start all the Servers. String opName = "startAllJOnAS"; String[] opParams = {getDomain(), otherParams}; String[] opSignature = {"java.lang.String", "java.lang.String"}; try { ObjectName on = JonasObjectName.clusterDaemon(getDomain()); getConnection().invoke(on, opName, opParams, opSignature); } catch (Exception e) { logger.log(BasicLevel.ERROR, "Cannot start server: " + e); // TODO } }
@SuppressWarnings("unchecked") public Hashtable<String, String> dynamicRemoteHostInfos() { logger.log(BasicLevel.DEBUG, "getting cluster daemon Dynamic host's infos"); if (!checkConnection()) { // Not yet connected. Try to connect now. if (!connect(getUrls())) { logger.log(BasicLevel.ERROR, "Unable to get connection to cluster daemon " + getName()); return null; } } Hashtable<String, String> ret = null; try { ObjectName on = JonasObjectName.clusterDaemon(getDomain()); ret = (Hashtable<String, String>) getConnection().getAttribute(on, "DynamicHostAttributes"); } catch (Exception e) { logger.log(BasicLevel.ERROR, "Cannot get monitoring informations for cluster daemon remote host :" + e); return null; } logger.log(BasicLevel.DEBUG, "Finisched to get clusterd host infos"); return ret; }
String[] opSignature = {"java.lang.String"}; try { ObjectName on = JonasObjectName.clusterDaemon(getDomain()); getConnection().invoke(on, opName, opParams, opSignature); } catch (Exception e) {
String[] opSignature = {"java.lang.String"}; try { ObjectName on = JonasObjectName.clusterDaemon(getDomain()); getConnection().invoke(on, opName, opParams, opSignature); } catch (Exception e) {
String[] opSignature = {"java.lang.String", "java.lang.String", "java.lang.String"}; try { ObjectName on = JonasObjectName.clusterDaemon(getDomain()); getConnection().invoke(on, opName, opParams, opSignature); } catch (Exception e) {