当前位置: 首页>>代码示例>>Java>>正文


Java MBeanServerNotification.getType方法代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:16,代码来源:JmxConnection.java

示例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);
            }
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:41,代码来源:MBeanListener.java


注:本文中的javax.management.MBeanServerNotification.getType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。