congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ZkConnection.close
Code IndexAdd Tabnine to your IDE (free)

How to use
close
method
in
info.xiancloud.zookeeper.ZkConnection

Best Java code snippets using info.xiancloud.zookeeper.ZkConnection.close (Showing top 3 results out of 315)

origin: xiancloud/xian

  @Override
  public void destroy() {
    close();
  }
}
origin: xiancloud/xian

  @Test
  public void setDataWithVersionTest() throws Exception {
    ZkConnection.start();
    try {
      /*ZkConnection.client.create().creatingParentsIfNeeded().forPath("/YY/11");*/
      ZkConnection.client.setData().withVersion(-1).forPath("/YY/11", "ss".getBytes());
    } finally {
      ZkConnection.close();
    }
  }
}
origin: xiancloud/xian

@Override
public void execute(UnitRequest msg, Handler<UnitResponse> handler) throws Exception {
  /**
   * 请设置此变量来删除指定路径下的脏节点
   */
  final String PATH = msg.get("basePath", "/xian_runtime_dev/unit");
  try {
    ZkConnection.start();
    for (String s : ZkConnection.client.getChildren().forPath(PATH)) {
      String fullPath = PATH.concat("/").concat(s);
      String data = new String(ZkConnection.client.getData().forPath(fullPath));
      System.out.println(data);
      if (StringUtil.isEmpty(data)) {
        LOG.debug("实现原理是xian服务注册会在unit和group节点data上写入其定义数据,如果没有定义数据的,那么一定是脏节点");
        ZkConnection.client.delete().forPath(fullPath);
      }
    }
  } finally {
    ZkConnection.close();
  }
  handler.handle(UnitResponse.createSuccess());
}
info.xiancloud.zookeeperZkConnectionclose

Popular methods of ZkConnection

  • start
  • getZkConnStr
  • isConnected

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSupportFragmentManager (FragmentActivity)
  • setRequestProperty (URLConnection)
  • runOnUiThread (Activity)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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