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();
}
}
RMIConnectionImpl.java 文件源码
java
阅读 28
收藏 0
点赞 0
评论 0
项目:OpenJSharp
作者:
评论列表
文章目录