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


Java MBeanServerNotification.getMBeanName方法代码示例

本文整理汇总了Java中javax.management.MBeanServerNotification.getMBeanName方法的典型用法代码示例。如果您正苦于以下问题:Java MBeanServerNotification.getMBeanName方法的具体用法?Java MBeanServerNotification.getMBeanName怎么用?Java MBeanServerNotification.getMBeanName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.management.MBeanServerNotification的用法示例。


在下文中一共展示了MBeanServerNotification.getMBeanName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createdNotification

import javax.management.MBeanServerNotification; //导入方法依赖的package包/类
private void createdNotification(MBeanServerNotification n) {
    final String shouldEqual =
        MBeanServerNotification.REGISTRATION_NOTIFICATION;
    if (!n.getType().equals(shouldEqual)) {
        logger.warning("createNotification", "bad type: " + n.getType());
        return;
    }

    ObjectName name = n.getMBeanName();
    if (logger.debugOn())
        logger.debug("createdNotification", "for: " + name);

    synchronized (this) {
        if (createdDuringQuery != null) {
            createdDuringQuery.add(name);
            return;
        }
    }

    if (isInstanceOf(mBeanServer, name, broadcasterClass)) {
        addBufferListener(name);
        if (isDisposed())
            removeBufferListener(name);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:ArrayNotificationBuffer.java

示例2: snoopOnUnregister

import javax.management.MBeanServerNotification; //导入方法依赖的package包/类
private void snoopOnUnregister(NotificationResult nr) {
    Set<IdAndFilter> delegateSet = listenerMap.get(MBeanServerDelegate.DELEGATE_NAME);
    if (delegateSet == null || delegateSet.isEmpty()) {
        return;
    }
    for (TargetedNotification tn : nr.getTargetedNotifications()) {
        Integer id = tn.getListenerID();
        for (IdAndFilter idaf : delegateSet) {
            if (idaf.id == id) {
                // This is a notification from the MBeanServerDelegate.
                Notification n = tn.getNotification();
                if (n instanceof MBeanServerNotification &&
                        n.getType().equals(MBeanServerNotification.UNREGISTRATION_NOTIFICATION)) {
                    MBeanServerNotification mbsn = (MBeanServerNotification) n;
                    ObjectName gone = mbsn.getMBeanName();
                    synchronized (listenerMap) {
                        listenerMap.remove(gone);
                    }
                }
            }
        }
    }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:24,代码来源:ServerNotifForwarder.java

示例3: handleNotificationInAwtEventThread

import javax.management.MBeanServerNotification; //导入方法依赖的package包/类
private void handleNotificationInAwtEventThread(final Notification notif, final Object paramObject) {
    if (StatusLoggerAdminMBean.NOTIF_TYPE_MESSAGE.equals(notif.getType())) {
        if (!(paramObject instanceof ObjectName)) {
            handle("Invalid notification object type", new ClassCastException(paramObject.getClass().getName()));
            return;
        }
        final ObjectName param = (ObjectName) paramObject;
        final JTextArea text = statusLogTextAreaMap.get(param);
        if (text != null) {
            text.append(notif.getMessage() + '\n');
        }
        return;
    }
    if (notif instanceof MBeanServerNotification) {
        final MBeanServerNotification mbsn = (MBeanServerNotification) notif;
        final ObjectName mbeanName = mbsn.getMBeanName();
        if (MBeanServerNotification.REGISTRATION_NOTIFICATION.equals(notif.getType())) {
            onMBeanRegistered(mbeanName);
        } else if (MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(notif.getType())) {
            onMBeanUnregistered(mbeanName);
        }
    }
}
 
开发者ID:apache,项目名称:logging-log4j2,代码行数:24,代码来源:ClientGui.java

示例4: 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

示例5: snoopOnUnregister

import javax.management.MBeanServerNotification; //导入方法依赖的package包/类
private void snoopOnUnregister(NotificationResult nr) {
    List<IdAndFilter> copy = null;
    synchronized (listenerMap) {
        Set<IdAndFilter> delegateSet = listenerMap.get(MBeanServerDelegate.DELEGATE_NAME);
        if (delegateSet == null || delegateSet.isEmpty()) {
            return;
        }
        copy = new ArrayList<>(delegateSet);
    }

    for (TargetedNotification tn : nr.getTargetedNotifications()) {
        Integer id = tn.getListenerID();
        for (IdAndFilter idaf : copy) {
            if (idaf.id == id) {
                // This is a notification from the MBeanServerDelegate.
                Notification n = tn.getNotification();
                if (n instanceof MBeanServerNotification &&
                        n.getType().equals(MBeanServerNotification.UNREGISTRATION_NOTIFICATION)) {
                    MBeanServerNotification mbsn = (MBeanServerNotification) n;
                    ObjectName gone = mbsn.getMBeanName();
                    synchronized (listenerMap) {
                        listenerMap.remove(gone);
                    }
                }
            }
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:ServerNotifForwarder.java

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