This commit is contained in:
@@ -260,7 +260,7 @@ public abstract class WebSocketNode {
|
|||||||
if (this.source == null || this.remoteNode == null) {
|
if (this.source == null || this.remoteNode == null) {
|
||||||
if (logger.isLoggable(Level.FINEST)) logger.finest("websocket remote node is null");
|
if (logger.isLoggable(Level.FINEST)) logger.finest("websocket remote node is null");
|
||||||
//没有CacheSource就不会有分布式节点
|
//没有CacheSource就不会有分布式节点
|
||||||
return localFuture;
|
return localFuture == null ? CompletableFuture.completedFuture(false) : localFuture;
|
||||||
}
|
}
|
||||||
//远程节点关闭
|
//远程节点关闭
|
||||||
tryAcquireSemaphore();
|
tryAcquireSemaphore();
|
||||||
@@ -289,12 +289,11 @@ public abstract class WebSocketNode {
|
|||||||
*/
|
*/
|
||||||
@Local
|
@Local
|
||||||
public CompletableFuture<Boolean> existsWebSocket(final WebSocketUserAddress userAddress) {
|
public CompletableFuture<Boolean> existsWebSocket(final WebSocketUserAddress userAddress) {
|
||||||
CompletableFuture<Boolean> localFuture = null;
|
if (this.localEngine != null && localEngine.existsLocalWebSocket(userAddress.userid())) return CompletableFuture.completedFuture(true);
|
||||||
if (this.localEngine != null) localFuture = CompletableFuture.completedFuture(localEngine.existsLocalWebSocket(userAddress.userid()));
|
|
||||||
if (this.source == null || this.remoteNode == null) {
|
if (this.source == null || this.remoteNode == null) {
|
||||||
if (logger.isLoggable(Level.FINEST)) logger.finest("websocket remote node is null");
|
if (logger.isLoggable(Level.FINEST)) logger.finest("websocket remote node is null");
|
||||||
//没有CacheSource就不会有分布式节点
|
//没有CacheSource就不会有分布式节点
|
||||||
return localFuture;
|
return CompletableFuture.completedFuture(false);
|
||||||
}
|
}
|
||||||
Collection<WebSocketAddress> addrs = userAddress.addresses();
|
Collection<WebSocketAddress> addrs = userAddress.addresses();
|
||||||
if (addrs != null) addrs = new ArrayList<>(addrs); //不能修改参数内部值
|
if (addrs != null) addrs = new ArrayList<>(addrs); //不能修改参数内部值
|
||||||
@@ -342,7 +341,7 @@ public abstract class WebSocketNode {
|
|||||||
if (this.source == null || this.remoteNode == null) {
|
if (this.source == null || this.remoteNode == null) {
|
||||||
if (logger.isLoggable(Level.FINEST)) logger.finest("websocket remote node is null");
|
if (logger.isLoggable(Level.FINEST)) logger.finest("websocket remote node is null");
|
||||||
//没有CacheSource就不会有分布式节点
|
//没有CacheSource就不会有分布式节点
|
||||||
return localFuture;
|
return localFuture == null ? CompletableFuture.completedFuture(0) : localFuture;
|
||||||
}
|
}
|
||||||
//远程节点关闭
|
//远程节点关闭
|
||||||
CompletableFuture<Collection<WebSocketAddress>> addrsFuture;
|
CompletableFuture<Collection<WebSocketAddress>> addrsFuture;
|
||||||
|
|||||||
Reference in New Issue
Block a user