Example #1
0
 public boolean fail(long id, String reason) {
   Coordination c = getCoordinationById(id);
   if (c != null) {
     return c.fail(new Exception(reason));
   }
   return false;
 }
Example #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;
  }
Example #3
0
 public void addTimeout(long id, long timeout) {
   Coordination c = getCoordinationById(id);
   if (c != null) {
     c.extendTimeout(timeout);
   }
 }