curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Huang, Ying-Yi" <yhu...@etrade.com>
Subject Re: Static/Permanent service type
Date Tue, 11 Feb 2014 00:43:58 GMT
Services registered with service discovery would get unregistered when  close() is called.
 This will remove all services including static and permanent. Is this the designed behavior?

public class ServiceDiscoveryImpl<T> implements ServiceDiscovery<T>
{
        @Override
    public void close() throws IOException
    {
        for ( ServiceCache<T> cache : Lists.newArrayList(caches) )
        {
            Closeables.closeQuietly(cache);
        }
        for ( ServiceProvider<T> provider : Lists.newArrayList(providers) )
        {
            Closeables.closeQuietly(provider);
        }

        for ( ServiceInstance<T> service : services.values() )
        {
            try
            {
                unregisterService(service);
            }
            catch ( Exception e )
            {
                log.error("Could not unregister instance: " + service.getName(), e);
            }
        }

        client.getConnectionStateListenable().removeListener(connectionStateListener);
    }
}

Thanks,
Ying-Yi
On Feb 7, 2014, at 6:24 PM, Jordan Zimmerman <jordan@jordanzimmerman.com<mailto:jordan@jordanzimmerman.com>>
 wrote:

ServiceType.DYNAMIC is not supported. It makes sense because there is no session for the REST
API.

-JZ

________________________________
From: Huang, Ying-Yi Huang, Ying-Yi<mailto:yhuang@etrade.com>
Reply: Huang, Ying-Yi yhuang@etrade.com<mailto:yhuang@etrade.com>
Date: February 7, 2014 at 1:29:12 PM
To: Jordan Zimmerman jordan@jordanzimmerman.com<mailto:jordan@jordanzimmerman.com>
Subject:  Re: Static/Permanent service type
A general question is that are all three types of services supported in Java API and RESTFul
API?


Mime
View raw message