Codota Logo
ServiceCache.addListener
Code IndexAdd Codota to your IDE (free)

How to use
addListener
method
in
org.apache.curator.x.discovery.ServiceCache

Best Java code snippets using org.apache.curator.x.discovery.ServiceCache.addListener (Showing top 6 results out of 315)

  • Common ways to obtain ServiceCache
private void myMethod () {
ServiceCache s =
  • Codota Iconnew NoopServiceCache<>()
  • Codota IconServiceDiscovery serviceDiscovery;String name;serviceDiscovery.serviceCacheBuilder().name(name).build()
  • Smart code suggestions by Codota
}
origin: apache/drill

@Override
public void start(long millisToWait) throws Exception {
 logger.debug("Starting ZKClusterCoordination.");
 discovery.start();
 if (millisToWait != 0) {
  boolean success = this.initialConnection.await(millisToWait,
    TimeUnit.MILLISECONDS);
  if (!success) {
   throw new IOException(String.format(
     "Failure to connect to the zookeeper cluster service within the allotted time of %d milliseconds.",
     millisToWait));
  }
 } else {
  this.initialConnection.await();
 }
 serviceCache = discovery.serviceCacheBuilder().name(serviceName).build();
 serviceCache.addListener(new EndpointListener());
 serviceCache.start();
 updateEndpoints();
}
origin: dremio/dremio-oss

@Override
public void start() throws Exception {
 serviceCache.start();
 serviceCache.addListener(new EndpointListener());
 updateEndpoints();
}
origin: org.apache.drill.exec/drill-java-exec

@Override
public void start(long millisToWait) throws Exception {
 logger.debug("Starting ZKClusterCoordination.");
 discovery.start();
 if(millisToWait != 0) {
  boolean success = this.initialConnection.await(millisToWait, TimeUnit.MILLISECONDS);
  if (!success) {
   throw new IOException(String.format("Failure to connect to the zookeeper cluster service within the allotted time of %d milliseconds.", millisToWait));
  }
 }else{
  this.initialConnection.await();
 }
 serviceCache = discovery
   .serviceCacheBuilder()
   .name(serviceName)
   .build();
 serviceCache.addListener(new EndpointListener());
 serviceCache.start();
 updateEndpoints();
}
origin: xiancloud/xian

    .build();
serviceProvider.start();
serviceProvider.serviceCache().addListener(new ServiceCacheListener<NodeStatus>() {
  @Override
  public void cacheChanged() {
origin: spring-cloud/spring-cloud-zookeeper

@Override
public void registerDependencyRegistrationHooks() {
  for (ZookeeperDependency zookeeperDependency : this.zookeeperDependencies.getDependencyConfigurations()) {
    String dependencyPath = zookeeperDependency.getPath();
    ServiceCache<?> serviceCache = getServiceDiscovery()
        .serviceCacheBuilder().name(dependencyPath).build();
    try {
      serviceCache.start();
    }
    catch (Exception e) {
      ReflectionUtils.rethrowRuntimeException(e);
    }
    this.dependencyPresenceOnStartupVerifier.verifyDependencyPresence(dependencyPath, serviceCache, zookeeperDependency.isRequired());
    this.dependencyRegistry.put(dependencyPath, serviceCache);
    serviceCache.addListener(new DependencyStateChangeListenerRegistry(this.listeners, dependencyPath, serviceCache));
  }
}
origin: NationalSecurityAgency/timely

serviceCache.addListener(listener);
serviceCache.start();
org.apache.curator.x.discoveryServiceCacheaddListener

Popular methods of ServiceCache

  • start
    The cache must be started before use
  • close
  • getInstances
    Return the current list of instances. NOTE: there is no guarantee of freshness. This is merely the l
  • getInstance
  • getNewestServiceDefinition

Popular in Java

  • Running tasks concurrently on multiple threads
  • compareTo (BigDecimal)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now