@Override public Observable<Void> submit(Object message) { return delegate.submit(message); }
@Override public Observable<Void> submit(Object message) { return delegate.submit(message); }
@Override public Observable<Void> call(MessageConnection connection) { return connection.submit(new UpdateCopy(newInfo)); } });
protected void sendNotificationOnTransport(ChangeNotification<InstanceInfo> notification) { if (logger.isDebugEnabled()) { logger.debug("Sending change notification on the transport: {}", notification); } subscribeToTransportSend(transport.submit(notification), "notification"); }
protected Observable<Void> sendNotificationOnTransport(ChangeNotification<InstanceInfo> notification) { if (logger.isDebugEnabled()) { logger.debug("Sending change notification on the transport: {}", notification); } return subscribeToTransportSend(transport.submit(notification), "notification"); }
protected <T> Observable<Void> sendOnConnection(MessageConnection connection, T message) { if (logger.isDebugEnabled()) { logger.debug("Sending message to the server: {}", message); } return subscribeToTransportSend(connection.submit(message), message.getClass().getSimpleName()); }
protected <T> Observable<Void> sendOnTransport(T message) { if (logger.isDebugEnabled()) { logger.debug("Sending message on the transport: {}", message); } return subscribeToTransportSend(transport.submit(message), message.getClass().getSimpleName()); }
@Override public Observable<Void> call(MessageConnection connection) { return connection.submit(new RegisterCopy(instanceInfo)); } });
@Override public Observable<Void> call(MessageConnection connection) { return connection.submit(new UnregisterCopy(instanceId)); } });
protected <T> void sendOnTransport(T message) { if (logger.isDebugEnabled()) { logger.debug("Sending message on the transport: {}", message); } subscribeToTransportSend(transport.submit(message), message.getClass().getSimpleName()); }
@Override public Observable<ReplicationHelloReply> call(final MessageConnection connection) { return connection.submit(hello) .cast(ReplicationHelloReply.class) .concatWith( connection.incoming().flatMap(new Func1<Object, Observable<ReplicationHelloReply>>() { @Override public Observable<ReplicationHelloReply> call(Object o) { if (o instanceof ReplicationHelloReply) { return Observable.just((ReplicationHelloReply) o); } return Observable.error(new Exception("Unexpected message of type " + o.getClass() + " received")); } }) ); } });