private final void removeElementReaper(ReaperElement reaperElement) { _reaperElements.remove(reaperElement); _timeouts.remove(reaperElement._control); synchronized (this) { // TODO set needs tobe atomic to getFirst? ReaperElement first = _reaperElements.getFirst(); if(first != null) { nextDynamicCheckTime.set(first.getAbsoluteTimeout()); } else { nextDynamicCheckTime.set(Long.MAX_VALUE); if(_inShutdown) { this.notifyAll(); // TODO: use different lock for shutdown? } } } }
private final void removeElementReaper(ReaperElement reaperElement) { _reaperElements.remove(reaperElement); _timeouts.remove(reaperElement._control); synchronized (this) { // TODO set needs tobe atomic to getFirst? ReaperElement first = _reaperElements.getFirst(); if(first != null) { nextDynamicCheckTime.set(first.getAbsoluteTimeout()); } else { nextDynamicCheckTime.set(Long.MAX_VALUE); if(_inShutdown) { this.notifyAll(); // TODO: use different lock for shutdown? } } } }
private final void removeElementReaper(ReaperElement reaperElement) { _reaperElements.remove(reaperElement); _timeouts.remove(reaperElement._control); synchronized (this) { // TODO set needs tobe atomic to getFirst? ReaperElement first = _reaperElements.getFirst(); if(first != null) { nextDynamicCheckTime.set(first.getAbsoluteTimeout()); } else { nextDynamicCheckTime.set(Long.MAX_VALUE); if(_inShutdown) { this.notifyAll(); // TODO: use different lock for shutdown? } } } }
private final void removeElementReaper(ReaperElement reaperElement) { _reaperElements.remove(reaperElement); _timeouts.remove(reaperElement._control); synchronized (this) { // TODO set needs tobe atomic to getFirst? ReaperElement first = _reaperElements.getFirst(); if(first != null) { nextDynamicCheckTime.set(first.getAbsoluteTimeout()); } else { nextDynamicCheckTime.set(Long.MAX_VALUE); if(_inShutdown) { this.notifyAll(); // TODO: use different lock for shutdown? } } } }
private final void removeElementReaper(ReaperElement reaperElement) { _reaperElements.remove(reaperElement); _timeouts.remove(reaperElement._control); synchronized (this) { // TODO set needs tobe atomic to getFirst? ReaperElement first = _reaperElements.getFirst(); if(first != null) { nextDynamicCheckTime.set(first.getAbsoluteTimeout()); } else { nextDynamicCheckTime.set(Long.MAX_VALUE); if(_inShutdown) { this.notifyAll(); // TODO: use different lock for shutdown? } } } }
private final void removeElementReaper(ReaperElement reaperElement) { _reaperElements.remove(reaperElement); _timeouts.remove(reaperElement._control); synchronized (this) { // TODO set needs tobe atomic to getFirst? ReaperElement first = _reaperElements.getFirst(); if(first != null) { nextDynamicCheckTime.set(first.getAbsoluteTimeout()); } else { nextDynamicCheckTime.set(Long.MAX_VALUE); if(_inShutdown) { this.notifyAll(); // TODO: use different lock for shutdown? } } } }
private final void removeElementReaper(ReaperElement reaperElement) { _reaperElements.remove(reaperElement); _timeouts.remove(reaperElement._control); synchronized (this) { // TODO set needs tobe atomic to getFirst? ReaperElement first = _reaperElements.getFirst(); if(first != null) { nextDynamicCheckTime.set(first.getAbsoluteTimeout()); } else { nextDynamicCheckTime.set(Long.MAX_VALUE); if(_inShutdown) { this.notifyAll(); // TODO: use different lock for shutdown? } } } }
private final void removeElementReaper(ReaperElement reaperElement) { _reaperElements.remove(reaperElement); _timeouts.remove(reaperElement._control); synchronized (this) { // TODO set needs tobe atomic to getFirst? ReaperElement first = _reaperElements.getFirst(); if(first != null) { nextDynamicCheckTime.set(first.getAbsoluteTimeout()); } else { nextDynamicCheckTime.set(Long.MAX_VALUE); if(_inShutdown) { this.notifyAll(); // TODO: use different lock for shutdown? } } } }
private final void removeElementReaper(ReaperElement reaperElement) { _reaperElements.remove(reaperElement); _timeouts.remove(reaperElement._control); synchronized (this) { // TODO set needs tobe atomic to getFirst? ReaperElement first = _reaperElements.getFirst(); if(first != null) { nextDynamicCheckTime.set(first.getAbsoluteTimeout()); } else { nextDynamicCheckTime.set(Long.MAX_VALUE); if(_inShutdown) { this.notifyAll(); // TODO: use different lock for shutdown? } } } }
/** * @param reaperElement the reaper element to reorder in the sorted set. * @param delayMillis the amount of time to increment the element's timeout by. * @return the new soonest timeout in the set (not necessarily that of the reordered element) */ public synchronized long reorder(ReaperElement reaperElement, long delayMillis) { // assume it must be in the sorted list, as it was likely obtained via getFirst... removeSorted(reaperElement); // we could add delay to the original timeout, but using current time is probably safer. reaperElement.setAbsoluteTimeout((System.currentTimeMillis() + delayMillis)); // reinsert into its new position. insertSorted(reaperElement); // getFirst takes care of flushing the pending set for us. return getFirst().getAbsoluteTimeout(); }
/** * @param reaperElement the reaper element to reorder in the sorted set. * @param delayMillis the amount of time to increment the element's timeout by. * @return the new soonest timeout in the set (not necessarily that of the reordered element) */ public synchronized long reorder(ReaperElement reaperElement, long delayMillis) { // assume it must be in the sorted list, as it was likely obtained via getFirst... removeSorted(reaperElement); // we could add delay to the original timeout, but using current time is probably safer. reaperElement.setAbsoluteTimeout((System.currentTimeMillis() + delayMillis)); // reinsert into its new position. insertSorted(reaperElement); // getFirst takes care of flushing the pending set for us. return getFirst().getAbsoluteTimeout(); }
/** * @param reaperElement the reaper element to reorder in the sorted set. * @param delayMillis the amount of time to increment the element's timeout by. * @return the new soonest timeout in the set (not necessarily that of the reordered element) */ public synchronized long reorder(ReaperElement reaperElement, long delayMillis) { // assume it must be in the sorted list, as it was likely obtained via getFirst... removeSorted(reaperElement); // we could add delay to the original timeout, but using current time is probably safer. reaperElement.setAbsoluteTimeout((System.currentTimeMillis() + delayMillis)); // reinsert into its new position. insertSorted(reaperElement); // getFirst takes care of flushing the pending set for us. return getFirst().getAbsoluteTimeout(); }
/** * @param reaperElement the reaper element to reorder in the sorted set. * @param delayMillis the amount of time to increment the element's timeout by. * @return the new soonest timeout in the set (not necessarily that of the reordered element) */ public synchronized long reorder(ReaperElement reaperElement, long delayMillis) { // assume it must be in the sorted list, as it was likely obtained via getFirst... removeSorted(reaperElement); // we could add delay to the original timeout, but using current time is probably safer. reaperElement.setAbsoluteTimeout((System.currentTimeMillis() + delayMillis)); // reinsert into its new position. insertSorted(reaperElement); // getFirst takes care of flushing the pending set for us. return getFirst().getAbsoluteTimeout(); }
/** * @param reaperElement the reaper element to reorder in the sorted set. * @param delayMillis the amount of time to increment the element's timeout by. * @return the new soonest timeout in the set (not necessarily that of the reordered element) */ public synchronized long reorder(ReaperElement reaperElement, long delayMillis) { // assume it must be in the sorted list, as it was likely obtained via getFirst... removeSorted(reaperElement); // we could add delay to the original timeout, but using current time is probably safer. reaperElement.setAbsoluteTimeout((System.currentTimeMillis() + delayMillis)); // reinsert into its new position. insertSorted(reaperElement); // getFirst takes care of flushing the pending set for us. return getFirst().getAbsoluteTimeout(); }
/** * @param reaperElement the reaper element to reorder in the sorted set. * @param delayMillis the amount of time to increment the element's timeout by. * @return the new soonest timeout in the set (not necessarily that of the reordered element) */ public synchronized long reorder(ReaperElement reaperElement, long delayMillis) { // assume it must be in the sorted list, as it was likely obtained via getFirst... removeSorted(reaperElement); // we could add delay to the original timeout, but using current time is probably safer. reaperElement.setAbsoluteTimeout((System.currentTimeMillis() + delayMillis)); // reinsert into its new position. insertSorted(reaperElement); // getFirst takes care of flushing the pending set for us. return getFirst().getAbsoluteTimeout(); }
/** * @param reaperElement the reaper element to reorder in the sorted set. * @param delayMillis the amount of time to increment the element's timeout by. * @return the new soonest timeout in the set (not necessarily that of the reordered element) */ public synchronized long reorder(ReaperElement reaperElement, long delayMillis) { // assume it must be in the sorted list, as it was likely obtained via getFirst... removeSorted(reaperElement); // we could add delay to the original timeout, but using current time is probably safer. reaperElement.setAbsoluteTimeout((System.currentTimeMillis() + delayMillis)); // reinsert into its new position. insertSorted(reaperElement); // getFirst takes care of flushing the pending set for us. return getFirst().getAbsoluteTimeout(); }
/** * @param reaperElement the reaper element to reorder in the sorted set. * @param delayMillis the amount of time to increment the element's timeout by. * @return the new soonest timeout in the set (not necessarily that of the reordered element) */ public synchronized long reorder(ReaperElement reaperElement, long delayMillis) { // assume it must be in the sorted list, as it was likely obtained via getFirst... removeSorted(reaperElement); // we could add delay to the original timeout, but using current time is probably safer. reaperElement.setAbsoluteTimeout((System.currentTimeMillis() + delayMillis)); // reinsert into its new position. insertSorted(reaperElement); // getFirst takes care of flushing the pending set for us. return getFirst().getAbsoluteTimeout(); }
/** * @param reaperElement the reaper element to reorder in the sorted set. * @param delayMillis the amount of time to increment the element's timeout by. * @return the new soonest timeout in the set (not necessarily that of the reordered element) */ public synchronized long reorder(ReaperElement reaperElement, long delayMillis) { // assume it must be in the sorted list, as it was likely obtained via getFirst... removeSorted(reaperElement); // we could add delay to the original timeout, but using current time is probably safer. reaperElement.setAbsoluteTimeout((System.currentTimeMillis() + delayMillis)); // reinsert into its new position. insertSorted(reaperElement); // getFirst takes care of flushing the pending set for us. return getFirst().getAbsoluteTimeout(); }
/** * @param reaperElement the reaper element to reorder in the sorted set. * @param delayMillis the amount of time to increment the element's timeout by. * @return the new soonest timeout in the set (not necessarily that of the reordered element) */ public synchronized long reorder(ReaperElement reaperElement, long delayMillis) { // assume it must be in the sorted list, as it was likely obtained via getFirst... removeSorted(reaperElement); // we could add delay to the original timeout, but using current time is probably safer. reaperElement.setAbsoluteTimeout((System.currentTimeMillis() + delayMillis)); // reinsert into its new position. insertSorted(reaperElement); // getFirst takes care of flushing the pending set for us. return getFirst().getAbsoluteTimeout(); }
/** * @param reaperElement the reaper element to reorder in the sorted set. * @param delayMillis the amount of time to increment the element's timeout by. * @return the new soonest timeout in the set (not necessarily that of the reordered element) */ public synchronized long reorder(ReaperElement reaperElement, long delayMillis) { // assume it must be in the sorted list, as it was likely obtained via getFirst... removeSorted(reaperElement); // we could add delay to the original timeout, but using current time is probably safer. reaperElement.setAbsoluteTimeout((System.currentTimeMillis() + delayMillis)); // reinsert into its new position. insertSorted(reaperElement); // getFirst takes care of flushing the pending set for us. return getFirst().getAbsoluteTimeout(); }