public void run()

in modules/core/src/main/java/org/apache/fluo/core/oracle/OracleClient.java [89:125]


    public void run() {

      try {
        synchronized (this) {
          // want this code to be mutually exclusive with close() .. so if in middle of setup, close
          // method will wait till finished
          if (closed.get()) {
            return;
          }

          curatorFramework = CuratorUtil.newAppCurator(env.getConfiguration());
          CuratorCnxnListener cnxnListener = new CuratorCnxnListener();
          curatorFramework.getConnectionStateListenable().addListener(cnxnListener);
          curatorFramework.start();

          while (!cnxnListener.isConnected()) {
            UtilWaitThread.sleep(200);
          }

          leaderLatch = new LeaderLatch(curatorFramework, ZookeeperPath.ORACLE_SERVER);

          pathChildrenCache =
              new PathChildrenCache(curatorFramework, ZookeeperPath.ORACLE_SERVER, true);
          DeprecationUtil.addListener(pathChildrenCache.getListenable(), this);
          pathChildrenCache.start();

          connect();
        }
        doWork();
      } catch (Exception e) {
        if (!closed.get()) {
          log.error("Exception occurred in run() method", e);
        } else {
          log.debug("Exception occurred in run() method", e);
        }
      }
    }