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


Java MBeanServerNotification.REGISTRATION_NOTIFICATION属性代码示例

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


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

示例1: createdNotification

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,代码行数:25,代码来源:ArrayNotificationBuffer.java

示例2: unregisterMBean

public void unregisterMBean(ObjectName name)
throws InstanceNotFoundException, MBeanRegistrationException {

    forbidJMImpl(name);

    DynamicMBean mbean = getMBean(name);
    if (mbean == null)
        throw new InstanceNotFoundException(name.toString());

    MBeanRegistration reg = mbeanRegistration(mbean);
    try {
        reg.preDeregister();
    } catch (Exception e) {
        throw new MBeanRegistrationException(e);
    }
    if (!mbeans.remove(name, mbean))
        throw new InstanceNotFoundException(name.toString());
        // This is incorrect because we've invoked preDeregister

    Object userMBean = getUserMBean(mbean);
    if (userMBean instanceof ClassLoader)
        clr.removeLoader((ClassLoader) userMBean);

    Notification n = new MBeanServerNotification(
            MBeanServerNotification.REGISTRATION_NOTIFICATION,
            MBeanServerDelegate.DELEGATE_NAME,
            0,
            name);
    delegate.sendNotification(n);

    reg.postDeregister();
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:32,代码来源:OldMBeanServerTest.java

示例3: handleNotification

@Override
public void handleNotification(Notification notification) {
    String jmxType = notification.getType().equals(RESOURCE_ADDED_NOTIFICATION) ? MBeanServerNotification.REGISTRATION_NOTIFICATION : MBeanServerNotification.UNREGISTRATION_NOTIFICATION;
    ObjectName mbeanName = ObjectNameAddressUtil.createObjectName(domain, notification.getSource());
    javax.management.Notification jmxNotification = new MBeanServerNotification(jmxType, MBeanServerDelegate.DELEGATE_NAME, sequence.incrementAndGet(), mbeanName);
    delegate.sendNotification(jmxNotification);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:7,代码来源:ModelControllerMBeanServerPlugin.java

示例4: registerMBean

public ObjectInstance registerMBean(Object object, ObjectName name)
throws InstanceAlreadyExistsException, MBeanRegistrationException,
        NotCompliantMBeanException {
    forbidJMImpl(name);
    if (name.isPattern())
        throw new IllegalArgumentException(name.toString());
    // This is the only place we check for wildcards.  Since you
    // can't register a wildcard name, other operations that supply
    // one will get InstanceNotFoundException when they look it up.

    DynamicMBean mbean;
    if (object instanceof DynamicMBean)
        mbean = (DynamicMBean) object;
    else
        mbean = standardToDynamic(object);
    MBeanRegistration reg = mbeanRegistration(object);
    try {
        name = reg.preRegister(this, name);
    } catch (Exception e) {
        throw new MBeanRegistrationException(e);
    }
    DynamicMBean put = mbeans.putIfAbsent(name, mbean);
    if (put != null) {
        reg.postRegister(false);
        throw new InstanceAlreadyExistsException(name.toString());
    }
    reg.postRegister(true);

    if (object instanceof ClassLoader)
        clr.addLoader((ClassLoader) object);

    Notification n = new MBeanServerNotification(
            MBeanServerNotification.REGISTRATION_NOTIFICATION,
            MBeanServerDelegate.DELEGATE_NAME,
            0,
            name);
    delegate.sendNotification(n);

    String className = mbean.getMBeanInfo().getClassName();
    return new ObjectInstance(name, className);
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:41,代码来源:OldMBeanServerTest.java


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