io.dropwizard.discovery.client.DiscoveryClientManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dropwizard-discovery Show documentation
Show all versions of dropwizard-discovery Show documentation
Service discovery for Dropwizard using Curator
package io.dropwizard.discovery.client;
import static com.google.common.base.Preconditions.checkNotNull;
import io.dropwizard.lifecycle.Managed;
import javax.annotation.Nonnull;
public class DiscoveryClientManager implements Managed {
private final DiscoveryClient client;
/**
* Constructor
*
* @param client
* {@link DiscoveryClient}
*/
public DiscoveryClientManager(@Nonnull final DiscoveryClient client) {
this.client = checkNotNull(client);
}
@Override
public void start() throws Exception {
client.start();
}
@Override
public void stop() throws Exception {
client.close();
}
}