Methods Summary |
---|
static javax.management.ObjectName | formObjectName(java.lang.String sn, java.lang.String cName)
/* domain:type=impl-class,server=target-server*/
final String domain = AdminService.PRIVATE_MBEAN_DOMAIN_NAME;
final Hashtable<String, String> props = new Hashtable<String, String> ();
props.put("type", cName);
props.put("category", "monitor");
final String snk = SERVER_NAME_KEY_IN_ON;
props.put(snk, sn);
return ( new ObjectName(domain, props) );
|
static java.lang.String | formatLong(long sayBytes)
final NumberFormat n = NumberFormat.getInstance();
return ( n.format(sayBytes) );
|
public java.lang.String | getClassInformation(java.lang.String processName)
final ObjectName on = processTarget(processName);
final String title = sm.getString("class.info.title", getInstanceNameFromObjectName(on));
final String ci = title + "\n " + invokeMBean(on, "getClassInformation");
return ( ci );
|
private java.lang.String | getInstanceNameFromObjectName(javax.management.ObjectName on)
return ( on.getKeyProperty(SERVER_NAME_KEY_IN_ON) );
|
public java.lang.String | getMemoryInformation(java.lang.String processName)
final ObjectName on = processTarget(processName);
final String title = sm.getString("memory.info.title", getInstanceNameFromObjectName(on));
final String mi = title + "\n" + invokeMBean(on, "getMemoryInformation");
return ( mi );
|
public java.lang.String | getSummary(java.lang.String processName)
final ObjectName on = processTarget(processName);
final String title = sm.getString("summary.title", getInstanceNameFromObjectName(on));
final String s = title + "\n" + invokeMBean(on, "getSummary");
return ( s );
|
public java.lang.String | getThreadDump(java.lang.String processName)
final ObjectName on = processTarget(processName);
final String title = sm.getString("thread.dump.title", getInstanceNameFromObjectName(on));
final String td = title + "\n" + invokeMBean(on, "getThreadDump");
return ( td );
|
private java.lang.String | invokeMBean(javax.management.ObjectName jvm, java.lang.String method)
try {
//though proxies work fine, for now (jul 2005), I am not going to use them because I am not sure how they work with cascading
//it is okay to assume that the methods in this mbean take String as parameter
final Object[] params = {null};
final String[] sign = {"java.lang.String"};
final Object ret = this.mbsc.invoke(jvm, method, params, sign);
return ( (String) ret );
} catch (final Exception e) {
throw new RuntimeException(e);
}
|
static java.lang.String | millis2HoursMinutesSeconds(long millis)
final long secmin = millis / (long) 1000;
final long sec = secmin % 60;
final long minhr = secmin / 60;
final long min = minhr % 60;
final long hr = minhr / 60;
final String msg = sm.getString("m2hms", hr, min, sec);
return ( msg );
|
static java.lang.String | millis2SecondsMillis(long millis)
final long sec = millis / (long) 1000;
final long ms = millis % 1000;
final String msg = sm.getString("m2sms", sec, ms);
return ( msg );
|
public void | postDeregister()
|
public void | postRegister(java.lang.Boolean registrationDone)
|
public void | preDeregister()
|
public javax.management.ObjectName | preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
this.mbsc = server;
final String sn = System.getProperty(SystemPropertyConstants.SERVER_NAME);
final ObjectName on = formObjectName(sn, JVMInformationCollector.class.getSimpleName());
return ( on );
|
private javax.management.ObjectName | processTarget(java.lang.String processName)
try {
final TargetType[] vts = {TargetType.DAS, TargetType.SERVER};
final ConfigContext acc = AdminService.getAdminService().getAdminContext().getAdminConfigContext();
final Target t = TargetBuilder.INSTANCE.createTarget(null, vts, processName, acc); //DAS is the default target
//get the object-name of the "other" real implementation of JVMInformationMBean interface :)
final String sn = t.getName();
final String cn = JVMInformation.class.getSimpleName();
final ObjectName on = formObjectName(sn, cn);
if (! this.mbsc.isRegistered(on)) {
final String msg = sm.getString("server.unreachable", sn);
throw new RuntimeException(msg);
}
return (on);
} catch (final RuntimeException re) {
throw(re);
} catch (final Exception e) {
throw new RuntimeException(e);
}
|