curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jordan Zimmerman <jor...@jordanzimmerman.com>
Subject Re: Static/Permanent service type
Date Tue, 11 Feb 2014 14:14:54 GMT
Hmm - that’s a good point. I wonder if PERMANENT should be excluded. The idea here is that
the instance is going down so any services that it registered should go down too. But, I can
see an argument that PERMANENT should not. However, this implementation has been released
for a long time so I’d be concerned about breaking existing code. Maybe a method could be
added to designate which service types are unregistered when the ServiceDiscovery instance
is closed.

-JZ

From: Huang, Ying-Yi Huang, Ying-Yi
Reply: Huang, Ying-Yi yhuang@etrade.com
Date: February 10, 2014 at 7:43:59 PM
To: Jordan Zimmerman jordan@jordanzimmerman.com
Subject:  Re: Static/Permanent service type  
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