示例#1
0
 public boolean fail(long id, String reason) {
   Coordination c = getCoordinationById(id);
   if (c != null) {
     return c.fail(new Exception(reason));
   }
   return false;
 }
示例#2
0
  void cleanUp() {
    // terminate coordination timeout timer
    coordinationTimer.purge();
    coordinationTimer.cancel();

    // terminate all active coordinations
    final Exception reason = new Exception();
    for (Coordination c : coordinations.values()) {
      c.fail(reason);
    }
    coordinations.clear();

    // release all participants
    participants.clear();

    // cannot really clear out the thread local but we can let it go
    threadStacks = null;
  }
示例#3
0
 public void addTimeout(long id, long timeout) {
   Coordination c = getCoordinationById(id);
   if (c != null) {
     c.extendTimeout(timeout);
   }
 }