Ejemplo n.º 1
0
  void init() throws Exception {

    CheckWorker checkWorker = new CheckWorker();
    if (!checkWorker.isOK()) {
      throw new Exception("check pigeon.lic failed !!!");
    }

    nodesDispatcher.init();

    flexobjectFactory = new DistributedFlexObjectFactory(nodesDispatcher);
    flexobjectFactory.init();

    listFactory = new DistributedListFactory(nodesDispatcher);
    listFactory.init();

    atom = new DistributedAtom(nodesDispatcher);
    atom.init();

    lock = new DistributedNettyLock(nodesDispatcher);
    lock.init();

    long idNumPerRound = 10000L;
    idGenerator = new DistributedIdGenerator(nodesDispatcher, idNumPerRound);
    idGenerator.init();
  }
Ejemplo n.º 2
0
 @Override
 public void stop() throws InterruptedException {
   try {
     if (lock != null) {
       lock.stop();
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
 }