125126127128129130131132133134135
public void onSuccess(byte[] value) { promise.onSuccess(value); } public void onFailure(Throwable value) { promise.onFailure(value); connection.disconnect(null); } }); } else { promise.onSuccess(value);
136137138139140141142143144145146
} } public void onFailure(Throwable value) { promise.onFailure(value); connection.disconnect(null); } }); promise.await(configuration.getConnectWaitInSeconds(), TimeUnit.SECONDS); }
152153154155156157158159160161162
public void onSuccess(Void value) { promise.onSuccess(value); } public void onFailure(Throwable value) { promise.onFailure(value); } }); promise.await(configuration.getDisconnectWaitInSeconds(), TimeUnit.SECONDS); } super.doStop();