Java 类javax.management.remote.NotificationResult 实例源码

项目:jdk7-jdk    文件:ServerNotifForwarder.java   
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);
                    }
                }
            }
        }
    }
}
项目:openjdk-source-code-learn    文件:ServerNotifForwarder.java   
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);
                    }
                }
            }
        }
    }
}
项目:openjdk-jdk7u-jdk    文件:ServerNotifForwarder.java   
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);
                    }
                }
            }
        }
    }
}
项目:openjdk-icedtea7    文件:ServerNotifForwarder.java   
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);
                    }
                }
            }
        }
    }
}
项目:OpenJSharp    文件:ClientNotifForwarder.java   
private NotificationResult fetchNotifs() {
    try {
        NotificationResult nr = ClientNotifForwarder.this.
            fetchNotifs(clientSequenceNumber,maxNotifications,
                        timeout);

        if (logger.traceOn()) {
            logger.trace("NotifFetcher-run",
                         "Got notifications from the server: "+nr);
        }

        return nr;
    } catch (ClassNotFoundException | NotSerializableException | UnmarshalException e) {
        logger.trace("NotifFetcher.fetchNotifs", e);
        return fetchOneNotif();
    } catch (IOException ioe) {
        if (!shouldStop()) {
            logger.error("NotifFetcher-run",
                         "Failed to fetch notification, " +
                         "stopping thread. Error is: " + ioe, ioe);
            logger.debug("NotifFetcher-run",ioe);
        }

        // no more fetching
        return null;
    }
}
项目:OpenJSharp    文件:ServerNotifForwarder.java   
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);
                    }
                }
            }
        }
    }
}
项目:OpenJSharp    文件:ArrayNotificationBuffer.java   
public NotificationResult
    fetchNotifications(NotificationBufferFilter filter,
                       long startSequenceNumber,
                       long timeout,
                       int maxNotifications)
        throws InterruptedException {
    NotificationBuffer buf = ArrayNotificationBuffer.this;
    return buf.fetchNotifications(filter, startSequenceNumber,
                                  timeout, maxNotifications);
}
项目:OpenJSharp    文件:RMIConnectionImpl.java   
public NotificationResult fetchNotifications(long clientSequenceNumber,
                                             int maxNotifications,
                                             long timeout)
    throws IOException {

    if (logger.debugOn()) logger.debug("fetchNotifications",
                           "connectionId=" + connectionId
                           +", timeout=" + timeout);

    if (maxNotifications < 0 || timeout < 0)
        throw new IllegalArgumentException("Illegal negative argument");

    final boolean serverTerminated =
        serverCommunicatorAdmin.reqIncoming();
    try {
        if (serverTerminated) {
            // we must not call fetchNotifs() if the server is
            // terminated (timeout elapsed).
            //
            return new NotificationResult(0L, 0L,
                                          new TargetedNotification[0]);

        }
        final long csn = clientSequenceNumber;
        final int mn = maxNotifications;
        final long t = timeout;
        PrivilegedAction<NotificationResult> action =
            new PrivilegedAction<NotificationResult>() {
                public NotificationResult run() {
                    return getServerNotifFwd().fetchNotifs(csn, t, mn);
                }
        };
        if (acc == null)
            return action.run();
        else
            return AccessController.doPrivileged(action, acc);
    } finally {
        serverCommunicatorAdmin.rspOutgoing();
    }
}
项目:jdk8u-jdk    文件:ClientNotifForwarder.java   
private NotificationResult fetchNotifs() {
    try {
        NotificationResult nr = ClientNotifForwarder.this.
            fetchNotifs(clientSequenceNumber,maxNotifications,
                        timeout);

        if (logger.traceOn()) {
            logger.trace("NotifFetcher-run",
                         "Got notifications from the server: "+nr);
        }

        return nr;
    } catch (ClassNotFoundException | NotSerializableException | UnmarshalException e) {
        logger.trace("NotifFetcher.fetchNotifs", e);
        return fetchOneNotif();
    } catch (IOException ioe) {
        if (!shouldStop()) {
            logger.error("NotifFetcher-run",
                         "Failed to fetch notification, " +
                         "stopping thread. Error is: " + ioe, ioe);
            logger.debug("NotifFetcher-run",ioe);
        }

        // no more fetching
        return null;
    }
}
项目:jdk8u-jdk    文件:ServerNotifForwarder.java   
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);
                    }
                }
            }
        }
    }
}
项目:jdk8u-jdk    文件:ArrayNotificationBuffer.java   
public NotificationResult
    fetchNotifications(NotificationBufferFilter filter,
                       long startSequenceNumber,
                       long timeout,
                       int maxNotifications)
        throws InterruptedException {
    NotificationBuffer buf = ArrayNotificationBuffer.this;
    return buf.fetchNotifications(filter, startSequenceNumber,
                                  timeout, maxNotifications);
}
项目:openjdk-jdk10    文件:ClientNotifForwarder.java   
private NotificationResult fetchNotifs() {
    try {
        NotificationResult nr = ClientNotifForwarder.this.
            fetchNotifs(clientSequenceNumber,maxNotifications,
                        timeout);

        if (logger.traceOn()) {
            logger.trace("NotifFetcher-run",
                         "Got notifications from the server: "+nr);
        }

        return nr;
    } catch (ClassNotFoundException | NotSerializableException e) {
        logger.trace("NotifFetcher.fetchNotifs", e);
        return fetchOneNotif();
    } catch (IOException ioe) {
        if (!shouldStop()) {
            logger.error("NotifFetcher-run",
                         "Failed to fetch notification, " +
                         "stopping thread. Error is: " + ioe, ioe);
            logger.debug("NotifFetcher-run",ioe);
        }

        // no more fetching
        return null;
    }
}
项目:openjdk-jdk10    文件:ServerNotifForwarder.java   
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);
                    }
                }
            }
        }
    }
}
项目:openjdk-jdk10    文件:ArrayNotificationBuffer.java   
public NotificationResult
    fetchNotifications(NotificationBufferFilter filter,
                       long startSequenceNumber,
                       long timeout,
                       int maxNotifications)
        throws InterruptedException {
    NotificationBuffer buf = ArrayNotificationBuffer.this;
    return buf.fetchNotifications(filter, startSequenceNumber,
                                  timeout, maxNotifications);
}
项目:openjdk9    文件:ClientNotifForwarder.java   
private NotificationResult fetchNotifs() {
    try {
        NotificationResult nr = ClientNotifForwarder.this.
            fetchNotifs(clientSequenceNumber,maxNotifications,
                        timeout);

        if (logger.traceOn()) {
            logger.trace("NotifFetcher-run",
                         "Got notifications from the server: "+nr);
        }

        return nr;
    } catch (ClassNotFoundException | NotSerializableException | UnmarshalException e) {
        logger.trace("NotifFetcher.fetchNotifs", e);
        return fetchOneNotif();
    } catch (IOException ioe) {
        if (!shouldStop()) {
            logger.error("NotifFetcher-run",
                         "Failed to fetch notification, " +
                         "stopping thread. Error is: " + ioe, ioe);
            logger.debug("NotifFetcher-run",ioe);
        }

        // no more fetching
        return null;
    }
}
项目:openjdk9    文件:ServerNotifForwarder.java   
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);
                    }
                }
            }
        }
    }
}
项目:openjdk9    文件:ArrayNotificationBuffer.java   
public NotificationResult
    fetchNotifications(NotificationBufferFilter filter,
                       long startSequenceNumber,
                       long timeout,
                       int maxNotifications)
        throws InterruptedException {
    NotificationBuffer buf = ArrayNotificationBuffer.this;
    return buf.fetchNotifications(filter, startSequenceNumber,
                                  timeout, maxNotifications);
}
项目:jdk8u_jdk    文件:ClientNotifForwarder.java   
private NotificationResult fetchNotifs() {
    try {
        NotificationResult nr = ClientNotifForwarder.this.
            fetchNotifs(clientSequenceNumber,maxNotifications,
                        timeout);

        if (logger.traceOn()) {
            logger.trace("NotifFetcher-run",
                         "Got notifications from the server: "+nr);
        }

        return nr;
    } catch (ClassNotFoundException | NotSerializableException | UnmarshalException e) {
        logger.trace("NotifFetcher.fetchNotifs", e);
        return fetchOneNotif();
    } catch (IOException ioe) {
        if (!shouldStop()) {
            logger.error("NotifFetcher-run",
                         "Failed to fetch notification, " +
                         "stopping thread. Error is: " + ioe, ioe);
            logger.debug("NotifFetcher-run",ioe);
        }

        // no more fetching
        return null;
    }
}
项目:jdk8u_jdk    文件:ServerNotifForwarder.java   
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);
                    }
                }
            }
        }
    }
}
项目:jdk8u_jdk    文件:ArrayNotificationBuffer.java   
public NotificationResult
    fetchNotifications(NotificationBufferFilter filter,
                       long startSequenceNumber,
                       long timeout,
                       int maxNotifications)
        throws InterruptedException {
    NotificationBuffer buf = ArrayNotificationBuffer.this;
    return buf.fetchNotifications(filter, startSequenceNumber,
                                  timeout, maxNotifications);
}
项目:lookaside_java-1.8.0-openjdk    文件:ClientNotifForwarder.java   
private NotificationResult fetchNotifs() {
    try {
        NotificationResult nr = ClientNotifForwarder.this.
            fetchNotifs(clientSequenceNumber,maxNotifications,
                        timeout);

        if (logger.traceOn()) {
            logger.trace("NotifFetcher-run",
                         "Got notifications from the server: "+nr);
        }

        return nr;
    } catch (ClassNotFoundException | NotSerializableException | UnmarshalException e) {
        logger.trace("NotifFetcher.fetchNotifs", e);
        return fetchOneNotif();
    } catch (IOException ioe) {
        if (!shouldStop()) {
            logger.error("NotifFetcher-run",
                         "Failed to fetch notification, " +
                         "stopping thread. Error is: " + ioe, ioe);
            logger.debug("NotifFetcher-run",ioe);
        }

        // no more fetching
        return null;
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:ServerNotifForwarder.java   
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);
                    }
                }
            }
        }
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:ArrayNotificationBuffer.java   
public NotificationResult
    fetchNotifications(NotificationBufferFilter filter,
                       long startSequenceNumber,
                       long timeout,
                       int maxNotifications)
        throws InterruptedException {
    NotificationBuffer buf = ArrayNotificationBuffer.this;
    return buf.fetchNotifications(filter, startSequenceNumber,
                                  timeout, maxNotifications);
}
项目:infobip-open-jdk-8    文件:ClientNotifForwarder.java   
private NotificationResult fetchNotifs() {
    try {
        NotificationResult nr = ClientNotifForwarder.this.
            fetchNotifs(clientSequenceNumber,maxNotifications,
                        timeout);

        if (logger.traceOn()) {
            logger.trace("NotifFetcher-run",
                         "Got notifications from the server: "+nr);
        }

        return nr;
    } catch (ClassNotFoundException | NotSerializableException | UnmarshalException e) {
        logger.trace("NotifFetcher.fetchNotifs", e);
        return fetchOneNotif();
    } catch (IOException ioe) {
        if (!shouldStop()) {
            logger.error("NotifFetcher-run",
                         "Failed to fetch notification, " +
                         "stopping thread. Error is: " + ioe, ioe);
            logger.debug("NotifFetcher-run",ioe);
        }

        // no more fetching
        return null;
    }
}
项目:infobip-open-jdk-8    文件:ServerNotifForwarder.java   
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);
                    }
                }
            }
        }
    }
}
项目:infobip-open-jdk-8    文件:ArrayNotificationBuffer.java   
public NotificationResult
    fetchNotifications(NotificationBufferFilter filter,
                       long startSequenceNumber,
                       long timeout,
                       int maxNotifications)
        throws InterruptedException {
    NotificationBuffer buf = ArrayNotificationBuffer.this;
    return buf.fetchNotifications(filter, startSequenceNumber,
                                  timeout, maxNotifications);
}
项目:infobip-open-jdk-8    文件:RMIConnectionImpl.java   
public NotificationResult fetchNotifications(long clientSequenceNumber,
                                             int maxNotifications,
                                             long timeout)
    throws IOException {

    if (logger.debugOn()) logger.debug("fetchNotifications",
                           "connectionId=" + connectionId
                           +", timeout=" + timeout);

    if (maxNotifications < 0 || timeout < 0)
        throw new IllegalArgumentException("Illegal negative argument");

    final boolean serverTerminated =
        serverCommunicatorAdmin.reqIncoming();
    try {
        if (serverTerminated) {
            // we must not call fetchNotifs() if the server is
            // terminated (timeout elapsed).
            //
            return new NotificationResult(0L, 0L,
                                          new TargetedNotification[0]);

        }
        final long csn = clientSequenceNumber;
        final int mn = maxNotifications;
        final long t = timeout;
        PrivilegedAction<NotificationResult> action =
            new PrivilegedAction<NotificationResult>() {
                public NotificationResult run() {
                    return getServerNotifFwd().fetchNotifs(csn, t, mn);
                }
        };
        if (acc == null)
            return action.run();
        else
            return AccessController.doPrivileged(action, acc);
    } finally {
        serverCommunicatorAdmin.rspOutgoing();
    }
}
项目:jdk8u-dev-jdk    文件:ClientNotifForwarder.java   
private NotificationResult fetchNotifs() {
    try {
        NotificationResult nr = ClientNotifForwarder.this.
            fetchNotifs(clientSequenceNumber,maxNotifications,
                        timeout);

        if (logger.traceOn()) {
            logger.trace("NotifFetcher-run",
                         "Got notifications from the server: "+nr);
        }

        return nr;
    } catch (ClassNotFoundException | NotSerializableException | UnmarshalException e) {
        logger.trace("NotifFetcher.fetchNotifs", e);
        return fetchOneNotif();
    } catch (IOException ioe) {
        if (!shouldStop()) {
            logger.error("NotifFetcher-run",
                         "Failed to fetch notification, " +
                         "stopping thread. Error is: " + ioe, ioe);
            logger.debug("NotifFetcher-run",ioe);
        }

        // no more fetching
        return null;
    }
}
项目:jdk8u-dev-jdk    文件:ServerNotifForwarder.java   
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);
                    }
                }
            }
        }
    }
}
项目:jdk8u-dev-jdk    文件:ArrayNotificationBuffer.java   
public NotificationResult
    fetchNotifications(NotificationBufferFilter filter,
                       long startSequenceNumber,
                       long timeout,
                       int maxNotifications)
        throws InterruptedException {
    NotificationBuffer buf = ArrayNotificationBuffer.this;
    return buf.fetchNotifications(filter, startSequenceNumber,
                                  timeout, maxNotifications);
}
项目:jdk7-jdk    文件:ArrayNotificationBuffer.java   
public NotificationResult
    fetchNotifications(NotificationBufferFilter filter,
                       long startSequenceNumber,
                       long timeout,
                       int maxNotifications)
        throws InterruptedException {
    NotificationBuffer buf = ArrayNotificationBuffer.this;
    return buf.fetchNotifications(filter, startSequenceNumber,
                                  timeout, maxNotifications);
}
项目:jdk7-jdk    文件:RMIConnectionImpl.java   
public NotificationResult fetchNotifications(long clientSequenceNumber,
                                             int maxNotifications,
                                             long timeout)
    throws IOException {

    if (logger.debugOn()) logger.debug("fetchNotifications",
                           "connectionId=" + connectionId
                           +", timeout=" + timeout);

    if (maxNotifications < 0 || timeout < 0)
        throw new IllegalArgumentException("Illegal negative argument");

    final boolean serverTerminated =
        serverCommunicatorAdmin.reqIncoming();
    try {
        if (serverTerminated) {
            // we must not call fetchNotifs() if the server is
            // terminated (timeout elapsed).
            //
            return new NotificationResult(0L, 0L,
                                          new TargetedNotification[0]);

        }
        final long csn = clientSequenceNumber;
        final int mn = maxNotifications;
        final long t = timeout;
        PrivilegedAction<NotificationResult> action =
            new PrivilegedAction<NotificationResult>() {
                public NotificationResult run() {
                    return getServerNotifFwd().fetchNotifs(csn, t, mn);
                }
        };
        if (acc == null)
            return action.run();
        else
            return AccessController.doPrivileged(action, acc);
    } finally {
        serverCommunicatorAdmin.rspOutgoing();
    }
}
项目:openjdk-source-code-learn    文件:ArrayNotificationBuffer.java   
public NotificationResult
    fetchNotifications(NotificationBufferFilter filter,
                       long startSequenceNumber,
                       long timeout,
                       int maxNotifications)
        throws InterruptedException {
    NotificationBuffer buf = ArrayNotificationBuffer.this;
    return buf.fetchNotifications(filter, startSequenceNumber,
                                  timeout, maxNotifications);
}
项目:openjdk-source-code-learn    文件:RMIConnectionImpl.java   
public NotificationResult fetchNotifications(long clientSequenceNumber,
                                             int maxNotifications,
                                             long timeout)
    throws IOException {

    if (logger.debugOn()) logger.debug("fetchNotifications",
                           "connectionId=" + connectionId
                           +", timeout=" + timeout);

    if (maxNotifications < 0 || timeout < 0)
        throw new IllegalArgumentException("Illegal negative argument");

    final boolean serverTerminated =
        serverCommunicatorAdmin.reqIncoming();
    try {
        if (serverTerminated) {
            // we must not call fetchNotifs() if the server is
            // terminated (timeout elapsed).
            //
            return new NotificationResult(0L, 0L,
                                          new TargetedNotification[0]);

        }
        final long csn = clientSequenceNumber;
        final int mn = maxNotifications;
        final long t = timeout;
        PrivilegedAction<NotificationResult> action =
            new PrivilegedAction<NotificationResult>() {
                public NotificationResult run() {
                    return getServerNotifFwd().fetchNotifs(csn, t, mn);
                }
        };
        if (acc == null)
            return action.run();
        else
            return AccessController.doPrivileged(action, acc);
    } finally {
        serverCommunicatorAdmin.rspOutgoing();
    }
}
项目:OLD-OpenJDK8    文件:ClientNotifForwarder.java   
private NotificationResult fetchNotifs() {
    try {
        NotificationResult nr = ClientNotifForwarder.this.
            fetchNotifs(clientSequenceNumber,maxNotifications,
                        timeout);

        if (logger.traceOn()) {
            logger.trace("NotifFetcher-run",
                         "Got notifications from the server: "+nr);
        }

        return nr;
    } catch (ClassNotFoundException | NotSerializableException | UnmarshalException e) {
        logger.trace("NotifFetcher.fetchNotifs", e);
        return fetchOneNotif();
    } catch (IOException ioe) {
        if (!shouldStop()) {
            logger.error("NotifFetcher-run",
                         "Failed to fetch notification, " +
                         "stopping thread. Error is: " + ioe, ioe);
            logger.debug("NotifFetcher-run",ioe);
        }

        // no more fetching
        return null;
    }
}
项目:OLD-OpenJDK8    文件:ServerNotifForwarder.java   
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);
                    }
                }
            }
        }
    }
}
项目:OLD-OpenJDK8    文件:ArrayNotificationBuffer.java   
public NotificationResult
    fetchNotifications(NotificationBufferFilter filter,
                       long startSequenceNumber,
                       long timeout,
                       int maxNotifications)
        throws InterruptedException {
    NotificationBuffer buf = ArrayNotificationBuffer.this;
    return buf.fetchNotifications(filter, startSequenceNumber,
                                  timeout, maxNotifications);
}
项目:OLD-OpenJDK8    文件:RMIConnectionImpl.java   
public NotificationResult fetchNotifications(long clientSequenceNumber,
                                             int maxNotifications,
                                             long timeout)
    throws IOException {

    if (logger.debugOn()) logger.debug("fetchNotifications",
                           "connectionId=" + connectionId
                           +", timeout=" + timeout);

    if (maxNotifications < 0 || timeout < 0)
        throw new IllegalArgumentException("Illegal negative argument");

    final boolean serverTerminated =
        serverCommunicatorAdmin.reqIncoming();
    try {
        if (serverTerminated) {
            // we must not call fetchNotifs() if the server is
            // terminated (timeout elapsed).
            //
            return new NotificationResult(0L, 0L,
                                          new TargetedNotification[0]);

        }
        final long csn = clientSequenceNumber;
        final int mn = maxNotifications;
        final long t = timeout;
        PrivilegedAction<NotificationResult> action =
            new PrivilegedAction<NotificationResult>() {
                public NotificationResult run() {
                    return getServerNotifFwd().fetchNotifs(csn, t, mn);
                }
        };
        if (acc == null)
            return action.run();
        else
            return AccessController.doPrivileged(action, acc);
    } finally {
        serverCommunicatorAdmin.rspOutgoing();
    }
}
项目:openjdk-jdk7u-jdk    文件:ArrayNotificationBuffer.java   
public NotificationResult
    fetchNotifications(NotificationBufferFilter filter,
                       long startSequenceNumber,
                       long timeout,
                       int maxNotifications)
        throws InterruptedException {
    NotificationBuffer buf = ArrayNotificationBuffer.this;
    return buf.fetchNotifications(filter, startSequenceNumber,
                                  timeout, maxNotifications);
}
项目:openjdk-jdk7u-jdk    文件:RMIConnectionImpl.java   
public NotificationResult fetchNotifications(long clientSequenceNumber,
                                             int maxNotifications,
                                             long timeout)
    throws IOException {

    if (logger.debugOn()) logger.debug("fetchNotifications",
                           "connectionId=" + connectionId
                           +", timeout=" + timeout);

    if (maxNotifications < 0 || timeout < 0)
        throw new IllegalArgumentException("Illegal negative argument");

    final boolean serverTerminated =
        serverCommunicatorAdmin.reqIncoming();
    try {
        if (serverTerminated) {
            // we must not call fetchNotifs() if the server is
            // terminated (timeout elapsed).
            //
            return new NotificationResult(0L, 0L,
                                          new TargetedNotification[0]);

        }
        final long csn = clientSequenceNumber;
        final int mn = maxNotifications;
        final long t = timeout;
        PrivilegedAction<NotificationResult> action =
            new PrivilegedAction<NotificationResult>() {
                public NotificationResult run() {
                    return getServerNotifFwd().fetchNotifs(csn, t, mn);
                }
        };
        if (acc == null)
            return action.run();
        else
            return AccessController.doPrivileged(action, acc);
    } finally {
        serverCommunicatorAdmin.rspOutgoing();
    }
}