@Override public Observable<Void> call() throws Exception { return delegate.unregister(); } });
@Override public Observable<Void> unregister() { hasUnregistered = true; return delegate.unregister(); } }
@Override public Observable<Void> call() throws Exception { return delegate.unregister(); }
@Override public void shutdown() { shutdown = true; channelFactory.shutdown(); Set<Map.Entry<String, RegistrationChannel>> entries = instanceIdVsChannel.entrySet(); for (final Map.Entry<String, RegistrationChannel> entry : entries) { String instanceId = entry.getKey(); logger.info("Shutting down registration handler. Unregister instance Id: " + instanceId); entry.getValue().unregister().doOnTerminate(new Action0() { @Override public void call() { entry.getValue().close(); } }).subscribe(); } } }
@Override public Observable<Void> unregister() { instanceInfo = null; return getStateWithChannel().getChannel().unregister(); }
@Override public Observable<Void> unregister(InstanceInfo instanceInfo) { if (shutdown) { return Observable.error(new IllegalStateException("Registration handler is already shutdown.")); } final RegistrationChannel registrationChannel = instanceIdVsChannel.remove(instanceInfo.getId()); if (null == registrationChannel) { logger.info("Instance: %s is not registered. Ignoring unregister", instanceInfo); return Observable.empty(); // Be more acceptable to errors from user as unregister for non-existent instance is a no-op. } return registrationChannel.unregister().doOnTerminate(new Action0() { @Override public void call() { // Since we do not reuse the channel, we must shut it down with the underlying connection. registrationChannel.close(); } }); }