Tabnine Logo
ServiceCache.addListener
Code IndexAdd Tabnine 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)

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
  • findViewById (Activity)
  • getApplicationContext (Context)
  • addToBackStack (FragmentTransaction)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • JFrame (javax.swing)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now