/** * Release the tryClaim of the coordinate. It means that nobody owns the coordinate anymore. * Requires that that this instance owns the tryClaim to the coordinate. */ public void releaseClaim() throws CloudnameException { scheduler.shutdown(); zkClient.deregisterListener(this); while (true) { final TrackedConfig config; synchronized (trackedConfigList) { if (trackedConfigList.isEmpty()) { break; } config = trackedConfigList.remove(0); } config.stop(); } sendEventToCoordinateListener( CoordinateListener.Event.NOT_OWNER, "Released claim of coordinate"); synchronized (lastStatusVersionMonitor) { try { zkClient.getZookeeper().delete(path, lastStatusVersion); } catch (InterruptedException e) { throw new CloudnameException(e); } catch (KeeperException e) { throw new CloudnameException(e); } } }
public void deregisterCoordinateListener(final CoordinateListener coordinateListener) { coordinateListenerList.remove(coordinateListener); }