javax.management.NotificationBroadcaster#removeNotificationListener ( )源码实例Demo

下面列出了javax.management.NotificationBroadcaster#removeNotificationListener ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: dragonwell8_jdk   文件: OldMBeanServerTest.java
public void removeNotificationListener(
        ObjectName name, NotificationListener listener)
        throws InstanceNotFoundException, ListenerNotFoundException {
    NotificationBroadcaster userMBean =
            (NotificationBroadcaster) getUserMBean(name);
    NotificationListener wrappedListener =
          wrappedListener(name, userMBean, listener);
    userMBean.removeNotificationListener(wrappedListener);
}
 
源代码2 项目: TencentKona-8   文件: OldMBeanServerTest.java
public void removeNotificationListener(
        ObjectName name, NotificationListener listener)
        throws InstanceNotFoundException, ListenerNotFoundException {
    NotificationBroadcaster userMBean =
            (NotificationBroadcaster) getUserMBean(name);
    NotificationListener wrappedListener =
          wrappedListener(name, userMBean, listener);
    userMBean.removeNotificationListener(wrappedListener);
}
 
源代码3 项目: openjdk-8   文件: OldMBeanServerTest.java
public void removeNotificationListener(
        ObjectName name, NotificationListener listener)
        throws InstanceNotFoundException, ListenerNotFoundException {
    NotificationBroadcaster userMBean =
            (NotificationBroadcaster) getUserMBean(name);
    NotificationListener wrappedListener =
          wrappedListener(name, userMBean, listener);
    userMBean.removeNotificationListener(wrappedListener);
}
 
源代码4 项目: jdk8u60   文件: OldMBeanServerTest.java
public void removeNotificationListener(
        ObjectName name, NotificationListener listener)
        throws InstanceNotFoundException, ListenerNotFoundException {
    NotificationBroadcaster userMBean =
            (NotificationBroadcaster) getUserMBean(name);
    NotificationListener wrappedListener =
          wrappedListener(name, userMBean, listener);
    userMBean.removeNotificationListener(wrappedListener);
}
 
源代码5 项目: jdk8u_jdk   文件: OldMBeanServerTest.java
public void removeNotificationListener(
        ObjectName name, NotificationListener listener)
        throws InstanceNotFoundException, ListenerNotFoundException {
    NotificationBroadcaster userMBean =
            (NotificationBroadcaster) getUserMBean(name);
    NotificationListener wrappedListener =
          wrappedListener(name, userMBean, listener);
    userMBean.removeNotificationListener(wrappedListener);
}
 
源代码6 项目: openjdk-jdk8u   文件: OldMBeanServerTest.java
public void removeNotificationListener(
        ObjectName name, NotificationListener listener)
        throws InstanceNotFoundException, ListenerNotFoundException {
    NotificationBroadcaster userMBean =
            (NotificationBroadcaster) getUserMBean(name);
    NotificationListener wrappedListener =
          wrappedListener(name, userMBean, listener);
    userMBean.removeNotificationListener(wrappedListener);
}
 
private void removeNotificationListener(ObjectName name,
                                        NotificationListener listener,
                                        NotificationFilter filter,
                                        Object handback,
                                        boolean removeAll)
        throws InstanceNotFoundException, ListenerNotFoundException {

    if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
        MBEANSERVER_LOGGER.log(Level.TRACE, "ObjectName = " + name);
    }

    DynamicMBean instance = getMBean(name);
    checkMBeanPermission(instance, null, name, "removeNotificationListener");

    /* We could simplify the code by assigning broadcaster after
       assigning listenerWrapper, but that would change the error
       behavior when both the broadcaster and the listener are
       erroneous.  */

    Class<? extends NotificationBroadcaster> reqClass =
        removeAll ? NotificationBroadcaster.class : NotificationEmitter.class;
    NotificationBroadcaster broadcaster =
        getNotificationBroadcaster(name, instance, reqClass);

    NotificationListener listenerWrapper =
        getListenerWrapper(listener, name, instance, false);

    if (listenerWrapper == null)
        throw new ListenerNotFoundException("Unknown listener");

    if (removeAll)
        broadcaster.removeNotificationListener(listenerWrapper);
    else {
        NotificationEmitter emitter = (NotificationEmitter) broadcaster;
        emitter.removeNotificationListener(listenerWrapper,
                                           filter,
                                           handback);
    }
}
 
源代码8 项目: openjdk-jdk9   文件: OldMBeanServerTest.java
public void removeNotificationListener(
        ObjectName name, NotificationListener listener)
        throws InstanceNotFoundException, ListenerNotFoundException {
    NotificationBroadcaster userMBean =
            (NotificationBroadcaster) getUserMBean(name);
    NotificationListener wrappedListener =
          wrappedListener(name, userMBean, listener);
    userMBean.removeNotificationListener(wrappedListener);
}
 
源代码9 项目: jdk8u-jdk   文件: OldMBeanServerTest.java
public void removeNotificationListener(
        ObjectName name, NotificationListener listener)
        throws InstanceNotFoundException, ListenerNotFoundException {
    NotificationBroadcaster userMBean =
            (NotificationBroadcaster) getUserMBean(name);
    NotificationListener wrappedListener =
          wrappedListener(name, userMBean, listener);
    userMBean.removeNotificationListener(wrappedListener);
}
 
源代码10 项目: hottub   文件: OldMBeanServerTest.java
public void removeNotificationListener(
        ObjectName name, NotificationListener listener)
        throws InstanceNotFoundException, ListenerNotFoundException {
    NotificationBroadcaster userMBean =
            (NotificationBroadcaster) getUserMBean(name);
    NotificationListener wrappedListener =
          wrappedListener(name, userMBean, listener);
    userMBean.removeNotificationListener(wrappedListener);
}
 
源代码11 项目: openjdk-8-source   文件: OldMBeanServerTest.java
public void removeNotificationListener(
        ObjectName name, NotificationListener listener)
        throws InstanceNotFoundException, ListenerNotFoundException {
    NotificationBroadcaster userMBean =
            (NotificationBroadcaster) getUserMBean(name);
    NotificationListener wrappedListener =
          wrappedListener(name, userMBean, listener);
    userMBean.removeNotificationListener(wrappedListener);
}
 
private void removeNotificationListener(ObjectName name,
                                        NotificationListener listener,
                                        NotificationFilter filter,
                                        Object handback,
                                        boolean removeAll)
        throws InstanceNotFoundException, ListenerNotFoundException {

    if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
        MBEANSERVER_LOGGER.logp(Level.FINER,
                DefaultMBeanServerInterceptor.class.getName(),
                "removeNotificationListener", "ObjectName = " + name);
    }

    DynamicMBean instance = getMBean(name);
    checkMBeanPermission(instance, null, name, "removeNotificationListener");

    /* We could simplify the code by assigning broadcaster after
       assigning listenerWrapper, but that would change the error
       behavior when both the broadcaster and the listener are
       erroneous.  */

    Class<? extends NotificationBroadcaster> reqClass =
        removeAll ? NotificationBroadcaster.class : NotificationEmitter.class;
    NotificationBroadcaster broadcaster =
        getNotificationBroadcaster(name, instance, reqClass);

    NotificationListener listenerWrapper =
        getListenerWrapper(listener, name, instance, false);

    if (listenerWrapper == null)
        throw new ListenerNotFoundException("Unknown listener");

    if (removeAll)
        broadcaster.removeNotificationListener(listenerWrapper);
    else {
        NotificationEmitter emitter = (NotificationEmitter) broadcaster;
        emitter.removeNotificationListener(listenerWrapper,
                                           filter,
                                           handback);
    }
}
 
private void removeNotificationListener(ObjectName name,
                                        NotificationListener listener,
                                        NotificationFilter filter,
                                        Object handback,
                                        boolean removeAll)
        throws InstanceNotFoundException, ListenerNotFoundException {

    if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
        MBEANSERVER_LOGGER.logp(Level.FINER,
                DefaultMBeanServerInterceptor.class.getName(),
                "removeNotificationListener", "ObjectName = " + name);
    }

    DynamicMBean instance = getMBean(name);
    checkMBeanPermission(instance, null, name, "removeNotificationListener");

    /* We could simplify the code by assigning broadcaster after
       assigning listenerWrapper, but that would change the error
       behavior when both the broadcaster and the listener are
       erroneous.  */

    Class<? extends NotificationBroadcaster> reqClass =
        removeAll ? NotificationBroadcaster.class : NotificationEmitter.class;
    NotificationBroadcaster broadcaster =
        getNotificationBroadcaster(name, instance, reqClass);

    NotificationListener listenerWrapper =
        getListenerWrapper(listener, name, instance, false);

    if (listenerWrapper == null)
        throw new ListenerNotFoundException("Unknown listener");

    if (removeAll)
        broadcaster.removeNotificationListener(listenerWrapper);
    else {
        NotificationEmitter emitter = (NotificationEmitter) broadcaster;
        emitter.removeNotificationListener(listenerWrapper,
                                           filter,
                                           handback);
    }
}
 
private void removeNotificationListener(ObjectName name,
                                        NotificationListener listener,
                                        NotificationFilter filter,
                                        Object handback,
                                        boolean removeAll)
        throws InstanceNotFoundException, ListenerNotFoundException {

    if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
        MBEANSERVER_LOGGER.logp(Level.FINER,
                DefaultMBeanServerInterceptor.class.getName(),
                "removeNotificationListener", "ObjectName = " + name);
    }

    DynamicMBean instance = getMBean(name);
    checkMBeanPermission(instance, null, name, "removeNotificationListener");

    /* We could simplify the code by assigning broadcaster after
       assigning listenerWrapper, but that would change the error
       behavior when both the broadcaster and the listener are
       erroneous.  */

    Class<? extends NotificationBroadcaster> reqClass =
        removeAll ? NotificationBroadcaster.class : NotificationEmitter.class;
    NotificationBroadcaster broadcaster =
        getNotificationBroadcaster(name, instance, reqClass);

    NotificationListener listenerWrapper =
        getListenerWrapper(listener, name, instance, false);

    if (listenerWrapper == null)
        throw new ListenerNotFoundException("Unknown listener");

    if (removeAll)
        broadcaster.removeNotificationListener(listenerWrapper);
    else {
        NotificationEmitter emitter = (NotificationEmitter) broadcaster;
        emitter.removeNotificationListener(listenerWrapper,
                                           filter,
                                           handback);
    }
}
 
private void removeNotificationListener(ObjectName name,
                                        NotificationListener listener,
                                        NotificationFilter filter,
                                        Object handback,
                                        boolean removeAll)
        throws InstanceNotFoundException, ListenerNotFoundException {

    if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
        MBEANSERVER_LOGGER.logp(Level.FINER,
                DefaultMBeanServerInterceptor.class.getName(),
                "removeNotificationListener", "ObjectName = " + name);
    }

    DynamicMBean instance = getMBean(name);
    checkMBeanPermission(instance, null, name, "removeNotificationListener");

    /* We could simplify the code by assigning broadcaster after
       assigning listenerWrapper, but that would change the error
       behavior when both the broadcaster and the listener are
       erroneous.  */

    Class<? extends NotificationBroadcaster> reqClass =
        removeAll ? NotificationBroadcaster.class : NotificationEmitter.class;
    NotificationBroadcaster broadcaster =
        getNotificationBroadcaster(name, instance, reqClass);

    NotificationListener listenerWrapper =
        getListenerWrapper(listener, name, instance, false);

    if (listenerWrapper == null)
        throw new ListenerNotFoundException("Unknown listener");

    if (removeAll)
        broadcaster.removeNotificationListener(listenerWrapper);
    else {
        NotificationEmitter emitter = (NotificationEmitter) broadcaster;
        emitter.removeNotificationListener(listenerWrapper,
                                           filter,
                                           handback);
    }
}
 
private void removeNotificationListener(ObjectName name,
                                        NotificationListener listener,
                                        NotificationFilter filter,
                                        Object handback,
                                        boolean removeAll)
        throws InstanceNotFoundException, ListenerNotFoundException {

    if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
        MBEANSERVER_LOGGER.logp(Level.FINER,
                DefaultMBeanServerInterceptor.class.getName(),
                "removeNotificationListener", "ObjectName = " + name);
    }

    DynamicMBean instance = getMBean(name);
    checkMBeanPermission(instance, null, name, "removeNotificationListener");

    /* We could simplify the code by assigning broadcaster after
       assigning listenerWrapper, but that would change the error
       behavior when both the broadcaster and the listener are
       erroneous.  */

    Class<? extends NotificationBroadcaster> reqClass =
        removeAll ? NotificationBroadcaster.class : NotificationEmitter.class;
    NotificationBroadcaster broadcaster =
        getNotificationBroadcaster(name, instance, reqClass);

    NotificationListener listenerWrapper =
        getListenerWrapper(listener, name, instance, false);

    if (listenerWrapper == null)
        throw new ListenerNotFoundException("Unknown listener");

    if (removeAll)
        broadcaster.removeNotificationListener(listenerWrapper);
    else {
        NotificationEmitter emitter = (NotificationEmitter) broadcaster;
        emitter.removeNotificationListener(listenerWrapper,
                                           filter,
                                           handback);
    }
}
 
源代码17 项目: jdk8u_jdk   文件: DefaultMBeanServerInterceptor.java
private void removeNotificationListener(ObjectName name,
                                        NotificationListener listener,
                                        NotificationFilter filter,
                                        Object handback,
                                        boolean removeAll)
        throws InstanceNotFoundException, ListenerNotFoundException {

    if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
        MBEANSERVER_LOGGER.logp(Level.FINER,
                DefaultMBeanServerInterceptor.class.getName(),
                "removeNotificationListener", "ObjectName = " + name);
    }

    DynamicMBean instance = getMBean(name);
    checkMBeanPermission(instance, null, name, "removeNotificationListener");

    /* We could simplify the code by assigning broadcaster after
       assigning listenerWrapper, but that would change the error
       behavior when both the broadcaster and the listener are
       erroneous.  */

    Class<? extends NotificationBroadcaster> reqClass =
        removeAll ? NotificationBroadcaster.class : NotificationEmitter.class;
    NotificationBroadcaster broadcaster =
        getNotificationBroadcaster(name, instance, reqClass);

    NotificationListener listenerWrapper =
        getListenerWrapper(listener, name, instance, false);

    if (listenerWrapper == null)
        throw new ListenerNotFoundException("Unknown listener");

    if (removeAll)
        broadcaster.removeNotificationListener(listenerWrapper);
    else {
        NotificationEmitter emitter = (NotificationEmitter) broadcaster;
        emitter.removeNotificationListener(listenerWrapper,
                                           filter,
                                           handback);
    }
}
 
源代码18 项目: openjdk-8   文件: DefaultMBeanServerInterceptor.java
private void removeNotificationListener(ObjectName name,
                                        NotificationListener listener,
                                        NotificationFilter filter,
                                        Object handback,
                                        boolean removeAll)
        throws InstanceNotFoundException, ListenerNotFoundException {

    if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
        MBEANSERVER_LOGGER.logp(Level.FINER,
                DefaultMBeanServerInterceptor.class.getName(),
                "removeNotificationListener", "ObjectName = " + name);
    }

    DynamicMBean instance = getMBean(name);
    checkMBeanPermission(instance, null, name, "removeNotificationListener");

    /* We could simplify the code by assigning broadcaster after
       assigning listenerWrapper, but that would change the error
       behavior when both the broadcaster and the listener are
       erroneous.  */

    Class<? extends NotificationBroadcaster> reqClass =
        removeAll ? NotificationBroadcaster.class : NotificationEmitter.class;
    NotificationBroadcaster broadcaster =
        getNotificationBroadcaster(name, instance, reqClass);

    NotificationListener listenerWrapper =
        getListenerWrapper(listener, name, instance, false);

    if (listenerWrapper == null)
        throw new ListenerNotFoundException("Unknown listener");

    if (removeAll)
        broadcaster.removeNotificationListener(listenerWrapper);
    else {
        NotificationEmitter emitter = (NotificationEmitter) broadcaster;
        emitter.removeNotificationListener(listenerWrapper,
                                           filter,
                                           handback);
    }
}
 
源代码19 项目: hottub   文件: DefaultMBeanServerInterceptor.java
private void removeNotificationListener(ObjectName name,
                                        NotificationListener listener,
                                        NotificationFilter filter,
                                        Object handback,
                                        boolean removeAll)
        throws InstanceNotFoundException, ListenerNotFoundException {

    if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
        MBEANSERVER_LOGGER.logp(Level.FINER,
                DefaultMBeanServerInterceptor.class.getName(),
                "removeNotificationListener", "ObjectName = " + name);
    }

    DynamicMBean instance = getMBean(name);
    checkMBeanPermission(instance, null, name, "removeNotificationListener");

    /* We could simplify the code by assigning broadcaster after
       assigning listenerWrapper, but that would change the error
       behavior when both the broadcaster and the listener are
       erroneous.  */

    Class<? extends NotificationBroadcaster> reqClass =
        removeAll ? NotificationBroadcaster.class : NotificationEmitter.class;
    NotificationBroadcaster broadcaster =
        getNotificationBroadcaster(name, instance, reqClass);

    NotificationListener listenerWrapper =
        getListenerWrapper(listener, name, instance, false);

    if (listenerWrapper == null)
        throw new ListenerNotFoundException("Unknown listener");

    if (removeAll)
        broadcaster.removeNotificationListener(listenerWrapper);
    else {
        NotificationEmitter emitter = (NotificationEmitter) broadcaster;
        emitter.removeNotificationListener(listenerWrapper,
                                           filter,
                                           handback);
    }
}
 
private void removeNotificationListener(ObjectName name,
                                        NotificationListener listener,
                                        NotificationFilter filter,
                                        Object handback,
                                        boolean removeAll)
        throws InstanceNotFoundException, ListenerNotFoundException {

    if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
        MBEANSERVER_LOGGER.logp(Level.FINER,
                DefaultMBeanServerInterceptor.class.getName(),
                "removeNotificationListener", "ObjectName = " + name);
    }

    DynamicMBean instance = getMBean(name);
    checkMBeanPermission(instance, null, name, "removeNotificationListener");

    /* We could simplify the code by assigning broadcaster after
       assigning listenerWrapper, but that would change the error
       behavior when both the broadcaster and the listener are
       erroneous.  */

    Class<? extends NotificationBroadcaster> reqClass =
        removeAll ? NotificationBroadcaster.class : NotificationEmitter.class;
    NotificationBroadcaster broadcaster =
        getNotificationBroadcaster(name, instance, reqClass);

    NotificationListener listenerWrapper =
        getListenerWrapper(listener, name, instance, false);

    if (listenerWrapper == null)
        throw new ListenerNotFoundException("Unknown listener");

    if (removeAll)
        broadcaster.removeNotificationListener(listenerWrapper);
    else {
        NotificationEmitter emitter = (NotificationEmitter) broadcaster;
        emitter.removeNotificationListener(listenerWrapper,
                                           filter,
                                           handback);
    }
}