Java Code Examples for com.sun.jmx.remote.util.EnvHelp#getNotifBufferSize()

The following examples show how to use com.sun.jmx.remote.util.EnvHelp#getNotifBufferSize() . 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 jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public static NotificationBuffer getNotificationBuffer(
        MBeanServer mbs, Map<String, ?> env) {

    if (env == null)
        env = Collections.emptyMap();

    //Find out queue size
    int queueSize = EnvHelp.getNotifBufferSize(env);

    ArrayNotificationBuffer buf;
    boolean create;
    NotificationBuffer sharer;
    synchronized (globalLock) {
        buf = mbsToBuffer.get(mbs);
        create = (buf == null);
        if (create) {
            buf = new ArrayNotificationBuffer(mbs, queueSize);
            mbsToBuffer.put(mbs, buf);
        }
        sharer = buf.new ShareBuffer(queueSize);
    }
    /* We avoid holding any locks while calling createListeners.
     * This prevents possible deadlocks involving user code, but
     * does mean that a second ConnectorServer created and started
     * in this window will return before all the listeners are ready,
     * which could lead to surprising behaviour.  The alternative
     * would be to block the second ConnectorServer until the first
     * one has finished adding all the listeners, but that would then
     * be subject to deadlock.
     */
    if (create)
        buf.createListeners();
    return sharer;
}
 
Example 2
Source File: ArrayNotificationBuffer.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static NotificationBuffer getNotificationBuffer(
        MBeanServer mbs, Map<String, ?> env) {

    if (env == null)
        env = Collections.emptyMap();

    //Find out queue size
    int queueSize = EnvHelp.getNotifBufferSize(env);

    ArrayNotificationBuffer buf;
    boolean create;
    NotificationBuffer sharer;
    synchronized (globalLock) {
        buf = mbsToBuffer.get(mbs);
        create = (buf == null);
        if (create) {
            buf = new ArrayNotificationBuffer(mbs, queueSize);
            mbsToBuffer.put(mbs, buf);
        }
        sharer = buf.new ShareBuffer(queueSize);
    }
    /* We avoid holding any locks while calling createListeners.
     * This prevents possible deadlocks involving user code, but
     * does mean that a second ConnectorServer created and started
     * in this window will return before all the listeners are ready,
     * which could lead to surprising behaviour.  The alternative
     * would be to block the second ConnectorServer until the first
     * one has finished adding all the listeners, but that would then
     * be subject to deadlock.
     */
    if (create)
        buf.createListeners();
    return sharer;
}
 
Example 3
Source File: ArrayNotificationBuffer.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static NotificationBuffer getNotificationBuffer(
        MBeanServer mbs, Map<String, ?> env) {

    if (env == null)
        env = Collections.emptyMap();

    //Find out queue size
    int queueSize = EnvHelp.getNotifBufferSize(env);

    ArrayNotificationBuffer buf;
    boolean create;
    NotificationBuffer sharer;
    synchronized (globalLock) {
        buf = mbsToBuffer.get(mbs);
        create = (buf == null);
        if (create) {
            buf = new ArrayNotificationBuffer(mbs, queueSize);
            mbsToBuffer.put(mbs, buf);
        }
        sharer = buf.new ShareBuffer(queueSize);
    }
    /* We avoid holding any locks while calling createListeners.
     * This prevents possible deadlocks involving user code, but
     * does mean that a second ConnectorServer created and started
     * in this window will return before all the listeners are ready,
     * which could lead to surprising behaviour.  The alternative
     * would be to block the second ConnectorServer until the first
     * one has finished adding all the listeners, but that would then
     * be subject to deadlock.
     */
    if (create)
        buf.createListeners();
    return sharer;
}
 
Example 4
Source File: ArrayNotificationBuffer.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static NotificationBuffer getNotificationBuffer(
        MBeanServer mbs, Map<String, ?> env) {

    if (env == null)
        env = Collections.emptyMap();

    //Find out queue size
    int queueSize = EnvHelp.getNotifBufferSize(env);

    ArrayNotificationBuffer buf;
    boolean create;
    NotificationBuffer sharer;
    synchronized (globalLock) {
        buf = mbsToBuffer.get(mbs);
        create = (buf == null);
        if (create) {
            buf = new ArrayNotificationBuffer(mbs, queueSize);
            mbsToBuffer.put(mbs, buf);
        }
        sharer = buf.new ShareBuffer(queueSize);
    }
    /* We avoid holding any locks while calling createListeners.
     * This prevents possible deadlocks involving user code, but
     * does mean that a second ConnectorServer created and started
     * in this window will return before all the listeners are ready,
     * which could lead to surprising behaviour.  The alternative
     * would be to block the second ConnectorServer until the first
     * one has finished adding all the listeners, but that would then
     * be subject to deadlock.
     */
    if (create)
        buf.createListeners();
    return sharer;
}
 
Example 5
Source File: ArrayNotificationBuffer.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public static NotificationBuffer getNotificationBuffer(
        MBeanServer mbs, Map<String, ?> env) {

    if (env == null)
        env = Collections.emptyMap();

    //Find out queue size
    int queueSize = EnvHelp.getNotifBufferSize(env);

    ArrayNotificationBuffer buf;
    boolean create;
    NotificationBuffer sharer;
    synchronized (globalLock) {
        buf = mbsToBuffer.get(mbs);
        create = (buf == null);
        if (create) {
            buf = new ArrayNotificationBuffer(mbs, queueSize);
            mbsToBuffer.put(mbs, buf);
        }
        sharer = buf.new ShareBuffer(queueSize);
    }
    /* We avoid holding any locks while calling createListeners.
     * This prevents possible deadlocks involving user code, but
     * does mean that a second ConnectorServer created and started
     * in this window will return before all the listeners are ready,
     * which could lead to surprising behaviour.  The alternative
     * would be to block the second ConnectorServer until the first
     * one has finished adding all the listeners, but that would then
     * be subject to deadlock.
     */
    if (create)
        buf.createListeners();
    return sharer;
}
 
Example 6
Source File: ArrayNotificationBuffer.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static NotificationBuffer getNotificationBuffer(
        MBeanServer mbs, Map<String, ?> env) {

    if (env == null)
        env = Collections.emptyMap();

    //Find out queue size
    int queueSize = EnvHelp.getNotifBufferSize(env);

    ArrayNotificationBuffer buf;
    boolean create;
    NotificationBuffer sharer;
    synchronized (globalLock) {
        buf = mbsToBuffer.get(mbs);
        create = (buf == null);
        if (create) {
            buf = new ArrayNotificationBuffer(mbs, queueSize);
            mbsToBuffer.put(mbs, buf);
        }
        sharer = buf.new ShareBuffer(queueSize);
    }
    /* We avoid holding any locks while calling createListeners.
     * This prevents possible deadlocks involving user code, but
     * does mean that a second ConnectorServer created and started
     * in this window will return before all the listeners are ready,
     * which could lead to surprising behaviour.  The alternative
     * would be to block the second ConnectorServer until the first
     * one has finished adding all the listeners, but that would then
     * be subject to deadlock.
     */
    if (create)
        buf.createListeners();
    return sharer;
}
 
Example 7
Source File: ArrayNotificationBuffer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static NotificationBuffer getNotificationBuffer(
        MBeanServer mbs, Map<String, ?> env) {

    if (env == null)
        env = Collections.emptyMap();

    //Find out queue size
    int queueSize = EnvHelp.getNotifBufferSize(env);

    ArrayNotificationBuffer buf;
    boolean create;
    NotificationBuffer sharer;
    synchronized (globalLock) {
        buf = mbsToBuffer.get(mbs);
        create = (buf == null);
        if (create) {
            buf = new ArrayNotificationBuffer(mbs, queueSize);
            mbsToBuffer.put(mbs, buf);
        }
        sharer = buf.new ShareBuffer(queueSize);
    }
    /* We avoid holding any locks while calling createListeners.
     * This prevents possible deadlocks involving user code, but
     * does mean that a second ConnectorServer created and started
     * in this window will return before all the listeners are ready,
     * which could lead to surprising behaviour.  The alternative
     * would be to block the second ConnectorServer until the first
     * one has finished adding all the listeners, but that would then
     * be subject to deadlock.
     */
    if (create)
        buf.createListeners();
    return sharer;
}
 
Example 8
Source File: ArrayNotificationBuffer.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static NotificationBuffer getNotificationBuffer(
        MBeanServer mbs, Map<String, ?> env) {

    if (env == null)
        env = Collections.emptyMap();

    //Find out queue size
    int queueSize = EnvHelp.getNotifBufferSize(env);

    ArrayNotificationBuffer buf;
    boolean create;
    NotificationBuffer sharer;
    synchronized (globalLock) {
        buf = mbsToBuffer.get(mbs);
        create = (buf == null);
        if (create) {
            buf = new ArrayNotificationBuffer(mbs, queueSize);
            mbsToBuffer.put(mbs, buf);
        }
        sharer = buf.new ShareBuffer(queueSize);
    }
    /* We avoid holding any locks while calling createListeners.
     * This prevents possible deadlocks involving user code, but
     * does mean that a second ConnectorServer created and started
     * in this window will return before all the listeners are ready,
     * which could lead to surprising behaviour.  The alternative
     * would be to block the second ConnectorServer until the first
     * one has finished adding all the listeners, but that would then
     * be subject to deadlock.
     */
    if (create)
        buf.createListeners();
    return sharer;
}
 
Example 9
Source File: ArrayNotificationBuffer.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static NotificationBuffer getNotificationBuffer(
        MBeanServer mbs, Map<String, ?> env) {

    if (env == null)
        env = Collections.emptyMap();

    //Find out queue size
    int queueSize = EnvHelp.getNotifBufferSize(env);

    ArrayNotificationBuffer buf;
    boolean create;
    NotificationBuffer sharer;
    synchronized (globalLock) {
        buf = mbsToBuffer.get(mbs);
        create = (buf == null);
        if (create) {
            buf = new ArrayNotificationBuffer(mbs, queueSize);
            mbsToBuffer.put(mbs, buf);
        }
        sharer = buf.new ShareBuffer(queueSize);
    }
    /* We avoid holding any locks while calling createListeners.
     * This prevents possible deadlocks involving user code, but
     * does mean that a second ConnectorServer created and started
     * in this window will return before all the listeners are ready,
     * which could lead to surprising behaviour.  The alternative
     * would be to block the second ConnectorServer until the first
     * one has finished adding all the listeners, but that would then
     * be subject to deadlock.
     */
    if (create)
        buf.createListeners();
    return sharer;
}
 
Example 10
Source File: ArrayNotificationBuffer.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static NotificationBuffer getNotificationBuffer(
        MBeanServer mbs, Map<String, ?> env) {

    if (env == null)
        env = Collections.emptyMap();

    //Find out queue size
    int queueSize = EnvHelp.getNotifBufferSize(env);

    ArrayNotificationBuffer buf;
    boolean create;
    NotificationBuffer sharer;
    synchronized (globalLock) {
        buf = mbsToBuffer.get(mbs);
        create = (buf == null);
        if (create) {
            buf = new ArrayNotificationBuffer(mbs, queueSize);
            mbsToBuffer.put(mbs, buf);
        }
        sharer = buf.new ShareBuffer(queueSize);
    }
    /* We avoid holding any locks while calling createListeners.
     * This prevents possible deadlocks involving user code, but
     * does mean that a second ConnectorServer created and started
     * in this window will return before all the listeners are ready,
     * which could lead to surprising behaviour.  The alternative
     * would be to block the second ConnectorServer until the first
     * one has finished adding all the listeners, but that would then
     * be subject to deadlock.
     */
    if (create)
        buf.createListeners();
    return sharer;
}
 
Example 11
Source File: ArrayNotificationBuffer.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static NotificationBuffer getNotificationBuffer(
        MBeanServer mbs, Map<String, ?> env) {

    if (env == null)
        env = Collections.emptyMap();

    //Find out queue size
    int queueSize = EnvHelp.getNotifBufferSize(env);

    ArrayNotificationBuffer buf;
    boolean create;
    NotificationBuffer sharer;
    synchronized (globalLock) {
        buf = mbsToBuffer.get(mbs);
        create = (buf == null);
        if (create) {
            buf = new ArrayNotificationBuffer(mbs, queueSize);
            mbsToBuffer.put(mbs, buf);
        }
        sharer = buf.new ShareBuffer(queueSize);
    }
    /* We avoid holding any locks while calling createListeners.
     * This prevents possible deadlocks involving user code, but
     * does mean that a second ConnectorServer created and started
     * in this window will return before all the listeners are ready,
     * which could lead to surprising behaviour.  The alternative
     * would be to block the second ConnectorServer until the first
     * one has finished adding all the listeners, but that would then
     * be subject to deadlock.
     */
    if (create)
        buf.createListeners();
    return sharer;
}
 
Example 12
Source File: ArrayNotificationBuffer.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static NotificationBuffer getNotificationBuffer(
        MBeanServer mbs, Map<String, ?> env) {

    if (env == null)
        env = Collections.emptyMap();

    //Find out queue size
    int queueSize = EnvHelp.getNotifBufferSize(env);

    ArrayNotificationBuffer buf;
    boolean create;
    NotificationBuffer sharer;
    synchronized (globalLock) {
        buf = mbsToBuffer.get(mbs);
        create = (buf == null);
        if (create) {
            buf = new ArrayNotificationBuffer(mbs, queueSize);
            mbsToBuffer.put(mbs, buf);
        }
        sharer = buf.new ShareBuffer(queueSize);
    }
    /* We avoid holding any locks while calling createListeners.
     * This prevents possible deadlocks involving user code, but
     * does mean that a second ConnectorServer created and started
     * in this window will return before all the listeners are ready,
     * which could lead to surprising behaviour.  The alternative
     * would be to block the second ConnectorServer until the first
     * one has finished adding all the listeners, but that would then
     * be subject to deadlock.
     */
    if (create)
        buf.createListeners();
    return sharer;
}
 
Example 13
Source File: ArrayNotificationBuffer.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static NotificationBuffer getNotificationBuffer(
        MBeanServer mbs, Map<String, ?> env) {

    if (env == null)
        env = Collections.emptyMap();

    //Find out queue size
    int queueSize = EnvHelp.getNotifBufferSize(env);

    ArrayNotificationBuffer buf;
    boolean create;
    NotificationBuffer sharer;
    synchronized (globalLock) {
        buf = mbsToBuffer.get(mbs);
        create = (buf == null);
        if (create) {
            buf = new ArrayNotificationBuffer(mbs, queueSize);
            mbsToBuffer.put(mbs, buf);
        }
        sharer = buf.new ShareBuffer(queueSize);
    }
    /* We avoid holding any locks while calling createListeners.
     * This prevents possible deadlocks involving user code, but
     * does mean that a second ConnectorServer created and started
     * in this window will return before all the listeners are ready,
     * which could lead to surprising behaviour.  The alternative
     * would be to block the second ConnectorServer until the first
     * one has finished adding all the listeners, but that would then
     * be subject to deadlock.
     */
    if (create)
        buf.createListeners();
    return sharer;
}
 
Example 14
Source File: ArrayNotificationBuffer.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static NotificationBuffer getNotificationBuffer(
        MBeanServer mbs, Map<String, ?> env) {

    if (env == null)
        env = Collections.emptyMap();

    //Find out queue size
    int queueSize = EnvHelp.getNotifBufferSize(env);

    ArrayNotificationBuffer buf;
    boolean create;
    NotificationBuffer sharer;
    synchronized (globalLock) {
        buf = mbsToBuffer.get(mbs);
        create = (buf == null);
        if (create) {
            buf = new ArrayNotificationBuffer(mbs, queueSize);
            mbsToBuffer.put(mbs, buf);
        }
        sharer = buf.new ShareBuffer(queueSize);
    }
    /* We avoid holding any locks while calling createListeners.
     * This prevents possible deadlocks involving user code, but
     * does mean that a second ConnectorServer created and started
     * in this window will return before all the listeners are ready,
     * which could lead to surprising behaviour.  The alternative
     * would be to block the second ConnectorServer until the first
     * one has finished adding all the listeners, but that would then
     * be subject to deadlock.
     */
    if (create)
        buf.createListeners();
    return sharer;
}
 
Example 15
Source File: ArrayNotificationBuffer.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static NotificationBuffer getNotificationBuffer(
        MBeanServer mbs, Map<String, ?> env) {

    if (env == null)
        env = Collections.emptyMap();

    //Find out queue size
    int queueSize = EnvHelp.getNotifBufferSize(env);

    ArrayNotificationBuffer buf;
    boolean create;
    NotificationBuffer sharer;
    synchronized (globalLock) {
        buf = mbsToBuffer.get(mbs);
        create = (buf == null);
        if (create) {
            buf = new ArrayNotificationBuffer(mbs, queueSize);
            mbsToBuffer.put(mbs, buf);
        }
        sharer = buf.new ShareBuffer(queueSize);
    }
    /* We avoid holding any locks while calling createListeners.
     * This prevents possible deadlocks involving user code, but
     * does mean that a second ConnectorServer created and started
     * in this window will return before all the listeners are ready,
     * which could lead to surprising behaviour.  The alternative
     * would be to block the second ConnectorServer until the first
     * one has finished adding all the listeners, but that would then
     * be subject to deadlock.
     */
    if (create)
        buf.createListeners();
    return sharer;
}