Java Code Examples for javax.management.MBeanServerNotification#REGISTRATION_NOTIFICATION

The following examples show how to use javax.management.MBeanServerNotification#REGISTRATION_NOTIFICATION . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ArrayNotificationBuffer.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example 2
Source File: ArrayNotificationBuffer.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example 3
Source File: ArrayNotificationBuffer.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example 4
Source File: ArrayNotificationBuffer.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example 5
Source File: ArrayNotificationBuffer.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example 6
Source File: ArrayNotificationBuffer.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example 7
Source File: ArrayNotificationBuffer.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example 8
Source File: ArrayNotificationBuffer.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example 9
Source File: ArrayNotificationBuffer.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
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);
    }
}
 
Example 10
Source File: ArrayNotificationBuffer.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example 11
Source File: ArrayNotificationBuffer.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
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);
    }
}
 
Example 12
Source File: OldMBeanServerTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
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();
}
 
Example 13
Source File: OldMBeanServerTest.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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();
}
 
Example 14
Source File: OldMBeanServerTest.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
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();
}
 
Example 15
Source File: OldMBeanServerTest.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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();
}
 
Example 16
Source File: OldMBeanServerTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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();
}
 
Example 17
Source File: OldMBeanServerTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
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();
}
 
Example 18
Source File: OldMBeanServerTest.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
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();
}
 
Example 19
Source File: OldMBeanServerTest.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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();
}
 
Example 20
Source File: OldMBeanServerTest.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
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();
}