private final ServiceInstance<InstanceDetails> thisInstance;
public ExampleServer(CuratorFramework client, String path, String serviceName, String description) throws Exception
{
// in a real application, you'd have a convention of some kind for the URI layout
UriSpec uriSpec = new UriSpec("{scheme}://foo.com:{port}");
thisInstance = ServiceInstance.<InstanceDetails>builder()
.name(serviceName)
.payload(new InstanceDetails(description))
.port((int)(65535 * Math.random())) // in a real application, you'd use a common port