Methods Summary |
---|
public static void | addEJBMonitorable(java.lang.Object monitorable)
if (isMonitoring() && needEJBMonitoring) {
monitorableList.add(monitorable);
}
|
public static void | addJDBCMonitorable(java.lang.Object monitorable)
if (isMonitoring() && needJDBCMonitoring) {
monitorableList.add(monitorable);
}
|
public static void | addORBMonitorable(java.lang.Object monitorable)Other subsystems in the ORB can use this method to add monitorable
entities which are then dumped at the preset intervals.
The only requirement for adding an object to the list is that it should
implement the toString interface so that details about the object are
dumped
if (isMonitoring() && needORBMonitoring) {
monitorableList.add(monitorable);
}
|
public static java.util.ArrayList | getMonitorableList()
return monitorableList;
|
protected java.util.Timer | getTimer()
return timer;
|
private static synchronized boolean | isMonitoring()This method will read the System properties and look for
"MONITOR_ORB".
"MONITOR_EJB".
"MONITOR_JDBC".
If the string exists, the
monitoring task shall be created at every
MONITOR_TIME_PERIOD_SECONDS
if provided too, otherwise defaults will be taken for scheduling period.
if (!initialized) {
try {
String str1=System.getProperties().getProperty("MONITOR_ORB");
String str2=System.getProperties().getProperty("MONITOR_EJB");
String str3=System.getProperties().getProperty("MONITOR_JDBC");
String strm=System.getProperties().getProperty("MONITOR_TIME_PERIOD_SECONDS");
if( null!=str1 ) {
if ( str1.startsWith("true") || str1.startsWith("TRUE") ) {
needORBMonitoring = true;
}
}
if ( null!=str2 ) {
if ( str2.startsWith("true") || str2.startsWith("TRUE") ) {
needEJBMonitoring = true;
}
}
if ( null!=str3 ) {
if ( str3.startsWith("true") || str3.startsWith("TRUE") ) {
needJDBCMonitoring = true;
}
}
if (needORBMonitoring || needEJBMonitoring || needJDBCMonitoring) {
if(null!=strm) {
schedPeriod = 1000 * Long.parseLong(strm);
}
}
} catch(Exception e) {
LogWrap.logger.log(Level.FINE,
"MINOR: Unable to start a performance monitoring task > " + e);
}
if (needORBMonitoring || needEJBMonitoring || needJDBCMonitoring) {
monitorableList = new ArrayList();
timer = new java.util.Timer();
timer.schedule(new MonitorTask(), schedPeriod, schedPeriod);
LogWrap.logger.log(Level.SEVERE,
"Starting the MonitorTask every "+schedPeriod+" milliseconds.");
}
initialized = true;
}
return (needORBMonitoring || needEJBMonitoring || needJDBCMonitoring);
|
public void | run()When an object implementing interface Runnable is used
to create a thread, starting the thread causes the object's
run method to be called in that separately executing
thread.
The general contract of the method run is that it may
take any action whatsoever.
StringBuffer sb = new StringBuffer ();
try {
boolean first = true;
sb.append("MONITORING : ");
Iterator iter = MonitorTask.getMonitorableList().iterator();
while (iter.hasNext()) {
if (first == false) {
sb.append(", ");
} else {
first = false;
}
sb.append(iter.next().toString());
}
LogWrap.logger.log(Level.SEVERE, sb.toString() );
} catch(Exception e) {
LogWrap.logger.log(Level.FINE, "MonitorTask received an exception > " + e);
}
|