Пример #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;
  }