Examples of IZkStateListener


Examples of org.I0Itec.zkclient.IZkStateListener

    // Logger.getRootLogger().setLevel(Level.DEBUG);
  }
 
  public static void disconnectSession(final ZkClient zkClient) throws Exception
  {
    IZkStateListener listener = new IZkStateListener()
    {
      @Override
      public void handleStateChanged(KeeperState state) throws Exception
      {
//         System.err.println("disconnectSession handleStateChanged. state: " + state);
View Full Code Here

Examples of org.I0Itec.zkclient.IZkStateListener

  public static void expireSession(final ZkClient zkClient) throws Exception
  {
    final CountDownLatch waitExpire = new CountDownLatch(1);

    IZkStateListener listener = new IZkStateListener()
    {
      @Override
      public void handleStateChanged(KeeperState state) throws Exception
      {
//         System.err.println("handleStateChanged. state: " + state);
View Full Code Here

Examples of org.I0Itec.zkclient.IZkStateListener

  }

  protected void simulateSessionExpiry(ZkClient zkClient) throws IOException,
      InterruptedException
  {
    IZkStateListener listener = new IZkStateListener()
    {
      @Override
      public void handleStateChanged(KeeperState state) throws Exception
      {
        LOG.info("In Old connection, state changed:" + state);
View Full Code Here

Examples of org.I0Itec.zkclient.IZkStateListener

  private volatile KeeperState state = KeeperState.SyncConnected;

  public ZkclientZookeeperClient(URL url) {
    super(url);
    client = new ZkClient(url.getBackupAddress());
    client.subscribeStateChanges(new IZkStateListener() {
      public void handleStateChanged(KeeperState state) throws Exception {
        ZkclientZookeeperClient.this.state = state;
        if (state == KeeperState.Disconnected) {
          stateChanged(StateListener.DISCONNECTED);
        } else if (state == KeeperState.SyncConnected) {
View Full Code Here

Examples of org.I0Itec.zkclient.IZkStateListener

                        try {
                            if (zkclientx != null) {
                                final String path = ZookeeperPathUtils.getDestinationClusterNode(destination, ip + ":"
                                                                                                              + port);
                                initCid(path);
                                zkclientx.subscribeStateChanges(new IZkStateListener() {

                                    public void handleStateChanged(KeeperState state) throws Exception {

                                    }
View Full Code Here

Examples of org.I0Itec.zkclient.IZkStateListener

        logger.info("## start the canal server[{}:{}]", ip, port);
        // 创建整个canal的工作节点
        final String path = ZookeeperPathUtils.getCanalClusterNode(ip + ":" + port);
        initCid(path);
        if (zkclientx != null) {
            this.zkclientx.subscribeStateChanges(new IZkStateListener() {

                public void handleStateChanged(KeeperState state) throws Exception {

                }
View Full Code Here

Examples of org.I0Itec.zkclient.IZkStateListener

  private volatile KeeperState state = KeeperState.SyncConnected;

  public ZkclientZookeeperClient(URL url) {
    super(url);
    client = new ZkClient(url.getBackupAddress());
    client.subscribeStateChanges(new IZkStateListener() {
      public void handleStateChanged(KeeperState state) throws Exception {
        ZkclientZookeeperClient.this.state = state;
        if (state == KeeperState.Disconnected) {
          stateChanged(StateListener.DISCONNECTED);
        } else if (state == KeeperState.SyncConnected) {
View Full Code Here

Examples of org.I0Itec.zkclient.IZkStateListener

                address.append(",");
                address.append(appendDefaultPort(backup));
            }
        }
        zkClient = new ZkClient(address.toString());
        zkClient.subscribeStateChanges(new IZkStateListener() {
            public void handleStateChanged(KeeperState state) throws Exception {
                ZookeeperRegistry.this.zkState = state;
            }
            public void handleNewSession() throws Exception {
              recover();
View Full Code Here

Examples of org.I0Itec.zkclient.IZkStateListener

  @Test(enabled = false)
  private static void testChrootWithZkClient() throws Exception
  {
    ZkClient client = new ZkClient("localhost:2181/foo");
    IZkStateListener stateChangeListener = new IZkStateListener()
    {

      @Override
      public void handleStateChanged(KeeperState state) throws Exception
      {
View Full Code Here

Examples of org.I0Itec.zkclient.IZkStateListener

    String logDir = "/tmp/logDir";
    // ZkServer server = new ZkServer(dataDir, logDir, defaultNameSpace, 2181);
    // server.start();

    ZkClient client = new ZkClient("localhost:2181/foo");
    IZkStateListener stateChangeListener = new IZkStateListener()
    {

      @Override
      public void handleStateChanged(KeeperState state) throws Exception
      {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.