/**
* Handles creation and deletion of new "worker" threads.
*
* @param notification the notification
* @param object the object
*/
@Override
public synchronized void handleNotification(Notification notification, Object object) {
if (notification instanceof MBeanServerNotification
&& notification.getType().equals(MBeanServerNotification.REGISTRATION_NOTIFICATION)
|| notification.getType().equals(MBeanServerNotification.UNREGISTRATION_NOTIFICATION)) {
ObjectName objectName = ((MBeanServerNotification) notification).getMBeanName();
if ("RequestProcessor".equals(objectName.getKeyProperty("type"))) {
ThreadPoolObjectName threadPoolObjectName = findPool(objectName.getKeyProperty("worker"));
if (threadPoolObjectName != null) {
if (notification.getType().equals(MBeanServerNotification.REGISTRATION_NOTIFICATION)) {
threadPoolObjectName.getRequestProcessorNames().add(objectName);
} else {
threadPoolObjectName.getRequestProcessorNames().remove(objectName);
}
}
}
}
}
ContainerListenerBean.java 文件源码
java
阅读 18
收藏 0
点赞 0
评论 0
项目:psi-probe
作者:
评论列表
文章目录