Methods Summary |
---|
public void | handleChange(com.sun.enterprise.admin.monitor.registry.MonitoredObjectType t, com.sun.enterprise.admin.monitor.registry.MonitoringLevel from, com.sun.enterprise.admin.monitor.registry.MonitoringLevel to)
if (isEjbContainerType(t)) {
handleChange(from, to, t);
}
else {
successor.handleChange(t, from, to);
}
|
private void | handleChange(com.sun.enterprise.admin.monitor.registry.MonitoringLevel from, com.sun.enterprise.admin.monitor.registry.MonitoringLevel to, com.sun.enterprise.admin.monitor.registry.MonitoredObjectType t)
if (off2Low(from, to) || off2High(from, to)) {
boolean includeMethods = false;
notifyListeners(from, to, t);
// register the ejb method mbeans only if the "to" level is HIGH
if(to == MonitoringLevel.HIGH)
includeMethods = true;
registerMBeans(includeMethods);
}
if (low2Off(from, to) || high2Off(from, to)) {
boolean includeMethods = false;
// need to include the ejb method mbeans, if the "from" level is HIGH
if(from == MonitoringLevel.HIGH)
includeMethods = true;
unregisterMBeans(includeMethods);
notifyListeners(from, to, t);
}
if (low2High(from, to)) {
// register the ejb method mbeans
notifyListeners(from, to, t);
registerMethodMBeans();
}
if (high2Low(from, to)) {
// unregister the ejb method mbeans
unregisterMethodMBeans();
notifyListeners(from, to, t);
}
|
private boolean | high2Low(com.sun.enterprise.admin.monitor.registry.MonitoringLevel from, com.sun.enterprise.admin.monitor.registry.MonitoringLevel to)
return ( from == MonitoringLevel.HIGH && to == MonitoringLevel.LOW );
|
private boolean | high2Off(com.sun.enterprise.admin.monitor.registry.MonitoringLevel from, com.sun.enterprise.admin.monitor.registry.MonitoringLevel to)
return ( from == MonitoringLevel.HIGH && to == MonitoringLevel.OFF );
|
private boolean | isEjbContainerType(com.sun.enterprise.admin.monitor.registry.MonitoredObjectType t)
return (
t == MonitoredObjectType.BEAN_CACHE ||
t == MonitoredObjectType.BEAN_METHOD ||
t == MonitoredObjectType.BEAN_POOL ||
t == MonitoredObjectType.ENTITY_BEAN ||
t == MonitoredObjectType.STATEFUL_BEAN ||
t == MonitoredObjectType.STATELESS_BEAN ||
t == MonitoredObjectType.MESSAGE_DRIVEN_BEAN );
|
private boolean | low2High(com.sun.enterprise.admin.monitor.registry.MonitoringLevel from, com.sun.enterprise.admin.monitor.registry.MonitoringLevel to)
return ( from == MonitoringLevel.LOW && to == MonitoringLevel.HIGH);
|
private boolean | low2Off(com.sun.enterprise.admin.monitor.registry.MonitoringLevel from, com.sun.enterprise.admin.monitor.registry.MonitoringLevel to)
return ( from == MonitoringLevel.LOW && to == MonitoringLevel.OFF);
|
private void | notifyListeners(com.sun.enterprise.admin.monitor.registry.MonitoringLevel from, com.sun.enterprise.admin.monitor.registry.MonitoringLevel to, com.sun.enterprise.admin.monitor.registry.MonitoredObjectType t)
logger.finer("DynamicReconfigurator: Now notifying the listeners for ejb stats --- from = " + from.toString() + " to = " + to.toString());
final Map l = (Map)listeners.get(t); // map of listeners;
if (l == null)
return; //do nothing
final Iterator it = l.keySet().iterator();
while (it.hasNext()) {
final MonitoringLevelListener ml = (MonitoringLevelListener)it.next();
ml.changeLevel(from, to, t);
}
|
private boolean | off2High(com.sun.enterprise.admin.monitor.registry.MonitoringLevel from, com.sun.enterprise.admin.monitor.registry.MonitoringLevel to)
return ( from == MonitoringLevel.OFF && to == MonitoringLevel.HIGH );
|
private boolean | off2Low(com.sun.enterprise.admin.monitor.registry.MonitoringLevel from, com.sun.enterprise.admin.monitor.registry.MonitoringLevel to)
return ( from == MonitoringLevel.OFF && to == MonitoringLevel.LOW );
|
private void | registerMBeans(boolean includeMethods)
final MonitoringRegistrationHelper registryImpl =
(MonitoringRegistrationHelper) MonitoringRegistrationHelper.getInstance();
//note that the above refers to the actual implementation rather than interface.
//registers MBeans pertaining to ejbs, pools, caches, methods
final Iterator iter = registryImpl.getEjbContainerNodes(includeMethods).iterator();
while (iter.hasNext()) {
final StatsHolder c = (StatsHolder) iter.next();
c.registerMBean();
logger.finer("DynamicReconfigurator: Now Registering MBean for --- " + c.getName());
}
|
private void | registerMethodMBeans()
final MonitoringRegistrationHelper registryImpl =
(MonitoringRegistrationHelper) MonitoringRegistrationHelper.getInstance();
final Iterator iter = registryImpl.getEjbMethodNodes().iterator();
while (iter.hasNext()) {
final StatsHolder c = (StatsHolder) iter.next();
c.registerMBean();
logger.finer("DynamicReconfigurator: Now Registering MBean for --- " + c.getName());
}
|
private void | unregisterMBeans(boolean includeMethods)
final MonitoringRegistrationHelper registryImpl =
(MonitoringRegistrationHelper) MonitoringRegistrationHelper.getInstance();
//note that the above refers to the actual implementation rather than interface.
final Iterator iter = registryImpl.getEjbContainerNodes(includeMethods).iterator();
while (iter.hasNext()) {
final StatsHolder c = (StatsHolder) iter.next();
c.unregisterMBean();
logger.finer("DynamicReconfigurator: Now UnRegistering MBean for --- " + c.getName());
}
|
private void | unregisterMethodMBeans()
final MonitoringRegistrationHelper registryImpl =
(MonitoringRegistrationHelper) MonitoringRegistrationHelper.getInstance();
final Iterator iter = registryImpl.getEjbMethodNodes().iterator();
while (iter.hasNext()) {
final StatsHolder c = (StatsHolder) iter.next();
c.unregisterMBean();
logger.finer("DynamicReconfigurator: Now UnRegistering MBean for --- " + c.getName());
}
|