本文整理汇总了Java中javax.management.MBeanServerNotification.getType方法的典型用法代码示例。如果您正苦于以下问题:Java MBeanServerNotification.getType方法的具体用法?Java MBeanServerNotification.getType怎么用?Java MBeanServerNotification.getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.management.MBeanServerNotification
的用法示例。
在下文中一共展示了MBeanServerNotification.getType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleNotification
import javax.management.MBeanServerNotification; //导入方法依赖的package包/类
@Override
public void handleNotification(Notification notification, Object handback) {
if (notification instanceof MBeanServerNotification) {
MBeanServerNotification mbeanNotification = (MBeanServerNotification) notification;
String notificationType = mbeanNotification.getType();
ObjectName objectName = mbeanNotification.getMBeanName();
if (notificationType.equals(MBeanServerNotification.REGISTRATION_NOTIFICATION)) {
fireMBeanRegistered(objectName);
}
else if (notificationType.equals(MBeanServerNotification.UNREGISTRATION_NOTIFICATION)) {
fireMBeanUnregistered(objectName);
}
}
}
示例2: handleNotification
import javax.management.MBeanServerNotification; //导入方法依赖的package包/类
public void handleNotification(
final Notification notifIn,
final Object handback)
{
if (notifIn instanceof MBeanServerNotification)
{
final MBeanServerNotification notif = (MBeanServerNotification) notifIn;
final ObjectName objectName = notif.getMBeanName();
boolean match = false;
if ( mObjectName != null && mObjectName.equals(objectName) )
{
match = true;
}
else if ( objectName.getDomain().equals( mJMXDomain ) )
{
if ( mType != null && mType.equals(objectName.getKeyProperty(TYPE_KEY)) )
{
final String mbeanName = objectName.getKeyProperty(NAME_KEY);
if (mName != null && mName.equals(mbeanName))
{
match = true;
}
}
}
if ( match )
{
final String notifType = notif.getType();
if (MBeanServerNotification.REGISTRATION_NOTIFICATION.equals(notifType))
{
mCallback.mbeanRegistered(objectName, this);
}
else if (MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(notifType))
{
mCallback.mbeanUnregistered(objectName, this);
}
}
}
}