Merge pull request #3130 from dotnet-maestro-bot/merge/release/2.2-to-master
[automated] Merge branch 'release/2.2' => 'master'
This commit is contained in:
commit
df88a82a80
|
|
@ -144,7 +144,7 @@ public class HubConnection {
|
||||||
HubMessage[] messages = protocol.parseMessages(payload, connectionState);
|
HubMessage[] messages = protocol.parseMessages(payload, connectionState);
|
||||||
|
|
||||||
for (HubMessage message : messages) {
|
for (HubMessage message : messages) {
|
||||||
logger.debug("Received message of type %s.", message.getMessageType());
|
logger.debug("Received message of type {}.", message.getMessageType());
|
||||||
switch (message.getMessageType()) {
|
switch (message.getMessageType()) {
|
||||||
case INVOCATION:
|
case INVOCATION:
|
||||||
InvocationMessage invocationMessage = (InvocationMessage) message;
|
InvocationMessage invocationMessage = (InvocationMessage) message;
|
||||||
|
|
@ -154,7 +154,7 @@ public class HubConnection {
|
||||||
handler.getAction().invoke(invocationMessage.getArguments());
|
handler.getAction().invoke(invocationMessage.getArguments());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.warn("Failed to find handler for '%s' method.", invocationMessage.getTarget());
|
logger.warn("Failed to find handler for '{}' method.", invocationMessage.getTarget());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CLOSE:
|
case CLOSE:
|
||||||
|
|
@ -169,7 +169,7 @@ public class HubConnection {
|
||||||
CompletionMessage completionMessage = (CompletionMessage)message;
|
CompletionMessage completionMessage = (CompletionMessage)message;
|
||||||
InvocationRequest irq = connectionState.tryRemoveInvocation(completionMessage.getInvocationId());
|
InvocationRequest irq = connectionState.tryRemoveInvocation(completionMessage.getInvocationId());
|
||||||
if (irq == null) {
|
if (irq == null) {
|
||||||
logger.warn("Dropped unsolicited Completion message for invocation '%s'.", completionMessage.getInvocationId());
|
logger.warn("Dropped unsolicited Completion message for invocation '{}'.", completionMessage.getInvocationId());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
irq.complete(completionMessage);
|
irq.complete(completionMessage);
|
||||||
|
|
@ -177,7 +177,7 @@ public class HubConnection {
|
||||||
case STREAM_INVOCATION:
|
case STREAM_INVOCATION:
|
||||||
case STREAM_ITEM:
|
case STREAM_ITEM:
|
||||||
case CANCEL_INVOCATION:
|
case CANCEL_INVOCATION:
|
||||||
logger.error("This client does not support %s messages.", message.getMessageType());
|
logger.error("This client does not support {} messages.", message.getMessageType());
|
||||||
|
|
||||||
throw new UnsupportedOperationException(String.format("The message type %s is not supported yet.", message.getMessageType()));
|
throw new UnsupportedOperationException(String.format("The message type %s is not supported yet.", message.getMessageType()));
|
||||||
}
|
}
|
||||||
|
|
@ -290,7 +290,7 @@ public class HubConnection {
|
||||||
sendHubMessage(PingMessage.getInstance());
|
sendHubMessage(PingMessage.getInstance());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn(String.format("Error sending ping: %s", e.getMessage()));
|
logger.warn(String.format("Error sending ping: {}", e.getMessage()));
|
||||||
// The connection is probably in a bad or closed state now, cleanup the timer so
|
// The connection is probably in a bad or closed state now, cleanup the timer so
|
||||||
// it stops triggering
|
// it stops triggering
|
||||||
pingTimer.cancel();
|
pingTimer.cancel();
|
||||||
|
|
@ -351,7 +351,7 @@ public class HubConnection {
|
||||||
|
|
||||||
if (errorMessage != null) {
|
if (errorMessage != null) {
|
||||||
stopError = errorMessage;
|
stopError = errorMessage;
|
||||||
logger.error("HubConnection disconnected with an error: %s.", errorMessage);
|
logger.error("HubConnection disconnected with an error: {}.", errorMessage);
|
||||||
} else {
|
} else {
|
||||||
logger.debug("Stopping HubConnection.");
|
logger.debug("Stopping HubConnection.");
|
||||||
}
|
}
|
||||||
|
|
@ -381,7 +381,7 @@ public class HubConnection {
|
||||||
}
|
}
|
||||||
if (errorMessage != null) {
|
if (errorMessage != null) {
|
||||||
exception = new RuntimeException(errorMessage);
|
exception = new RuntimeException(errorMessage);
|
||||||
logger.error("HubConnection disconnected with an error %s.", errorMessage);
|
logger.error("HubConnection disconnected with an error {}.", errorMessage);
|
||||||
}
|
}
|
||||||
connectionState.cancelOutstandingInvocations(exception);
|
connectionState.cancelOutstandingInvocations(exception);
|
||||||
connectionState = null;
|
connectionState = null;
|
||||||
|
|
@ -451,9 +451,9 @@ public class HubConnection {
|
||||||
private void sendHubMessage(HubMessage message) {
|
private void sendHubMessage(HubMessage message) {
|
||||||
String serializedMessage = protocol.writeMessage(message);
|
String serializedMessage = protocol.writeMessage(message);
|
||||||
if (message.getMessageType() == HubMessageType.INVOCATION) {
|
if (message.getMessageType() == HubMessageType.INVOCATION) {
|
||||||
logger.debug("Sending %s message '%s'.", message.getMessageType().name(), ((InvocationMessage)message).getInvocationId());
|
logger.debug("Sending {} message '{}'.", message.getMessageType().name(), ((InvocationMessage)message).getInvocationId());
|
||||||
} else {
|
} else {
|
||||||
logger.debug("Sending %s message.", message.getMessageType().name());
|
logger.debug("Sending {} message.", message.getMessageType().name());
|
||||||
}
|
}
|
||||||
transport.send(serializedMessage);
|
transport.send(serializedMessage);
|
||||||
|
|
||||||
|
|
@ -475,7 +475,7 @@ public class HubConnection {
|
||||||
*/
|
*/
|
||||||
public void remove(String name) {
|
public void remove(String name) {
|
||||||
handlers.remove(name);
|
handlers.remove(name);
|
||||||
logger.trace("Removing handlers for client method: %s.", name);
|
logger.trace("Removing handlers for client method: {}.", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClosed(Consumer<Exception> callback) {
|
public void onClosed(Consumer<Exception> callback) {
|
||||||
|
|
@ -693,7 +693,7 @@ public class HubConnection {
|
||||||
|
|
||||||
private Subscription registerHandler(String target, ActionBase action, Class<?>... types) {
|
private Subscription registerHandler(String target, ActionBase action, Class<?>... types) {
|
||||||
InvocationHandler handler = handlers.put(target, action, types);
|
InvocationHandler handler = handlers.put(target, action, types);
|
||||||
logger.debug("Registering handler for client method: '%s'.", target);
|
logger.debug("Registering handler for client method: '{}'.", target);
|
||||||
return new Subscription(handlers, handler, target);
|
return new Subscription(handlers, handler, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -777,7 +777,7 @@ public class HubConnection {
|
||||||
public List<Class<?>> getParameterTypes(String methodName) {
|
public List<Class<?>> getParameterTypes(String methodName) {
|
||||||
List<InvocationHandler> handlers = connection.handlers.get(methodName);
|
List<InvocationHandler> handlers = connection.handlers.get(methodName);
|
||||||
if (handlers == null) {
|
if (handlers == null) {
|
||||||
logger.warn("Failed to find handler for '%s' method.", methodName);
|
logger.warn("Failed to find handler for '{}' method.", methodName);
|
||||||
return emptyArray;
|
return emptyArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ class OkHttpWebSocketWrapper extends WebSocketWrapper {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(WebSocket webSocket, Throwable t, Response response) {
|
public void onFailure(WebSocket webSocket, Throwable t, Response response) {
|
||||||
logger.error("Websocket closed from an error: %s.", t.getMessage());
|
logger.error("Websocket closed from an error: {}.", t.getMessage());
|
||||||
closeFuture.completeExceptionally(new RuntimeException(t));
|
closeFuture.completeExceptionally(new RuntimeException(t));
|
||||||
onClose.accept(null, t.getMessage());
|
onClose.accept(null, t.getMessage());
|
||||||
checkStartFailure();
|
checkStartFailure();
|
||||||
|
|
@ -109,7 +109,7 @@ class OkHttpWebSocketWrapper extends WebSocketWrapper {
|
||||||
// exceptionally.
|
// exceptionally.
|
||||||
if (!startFuture.isDone()) {
|
if (!startFuture.isDone()) {
|
||||||
String errorMessage = "There was an error starting the Websockets transport.";
|
String errorMessage = "There was an error starting the Websockets transport.";
|
||||||
logger.error("Websocket closed from an error: %s.", errorMessage);
|
logger.error("Websocket closed from an error: {}.", errorMessage);
|
||||||
startFuture.completeExceptionally(new RuntimeException(errorMessage));
|
startFuture.completeExceptionally(new RuntimeException(errorMessage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ class WebSocketTransport implements Transport {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return webSocketClient.start().thenRun(() -> logger.info("WebSocket transport connected to: %s.", this.url));
|
return webSocketClient.start().thenRun(() -> logger.info("WebSocket transport connected to: {}.", this.url));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -88,7 +88,7 @@ class WebSocketTransport implements Transport {
|
||||||
|
|
||||||
void onClose(int code, String reason) {
|
void onClose(int code, String reason) {
|
||||||
logger.info("WebSocket connection stopping with " +
|
logger.info("WebSocket connection stopping with " +
|
||||||
"code %d and reason '%s'.", code, reason);
|
"code {} and reason '{}'.", code, reason);
|
||||||
if (code != 1000) {
|
if (code != 1000) {
|
||||||
onClose.accept(reason);
|
onClose.accept(reason);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue