/** * Remove an active operation. * * @param id the operation id * @return the removed active operation, {@code null} if there was no registered operation */ protected <T, A> ActiveOperation<T, A> removeActiveOperation(final Integer id) { lock.lock(); try { final ActiveOperation<?, ?> removed = activeRequests.remove(id); if(removed != null) { activeCount--; operationIdManager.freeBatchId(id); condition.signalAll(); } //noinspection unchecked return (ActiveOperation<T, A>) removed; } finally { lock.unlock(); } }
if(id == null) { operationId = operationIdManager.createBatchId(); } else { if(! operationIdManager.lockBatchId(id)) { throw ProtocolMessages.MESSAGES.operationIdAlreadyExists(id);
if(id == null) { operationId = operationIdManager.createBatchId(); } else { if(! operationIdManager.lockBatchId(id)) { throw ProtocolLogger.ROOT_LOGGER.operationIdAlreadyExists(id);
if(id == null) { operationId = operationIdManager.createBatchId(); } else { if(! operationIdManager.lockBatchId(id)) { throw ProtocolLogger.ROOT_LOGGER.operationIdAlreadyExists(id);
private <T, A> ActiveOperation<T, A> removeUnderLock(final Integer id) { lock.lock(); try { final ActiveOperation<?, ?> removed = activeRequests.remove(id); if(removed != null) { ProtocolLogger.ROOT_LOGGER.tracef("Deregistered active operation %d", id); activeCount--; operationIdManager.freeBatchId(id); condition.signalAll(); } //noinspection unchecked return (ActiveOperation<T, A>) removed; } finally { lock.unlock(); } }
private <T, A> ActiveOperation<T, A> removeUnderLock(final Integer id) { lock.lock(); try { final ActiveOperation<?, ?> removed = activeRequests.remove(id); if(removed != null) { ProtocolLogger.ROOT_LOGGER.tracef("Deregistered active operation %d", id); activeCount--; operationIdManager.freeBatchId(id); condition.signalAll(); } //noinspection unchecked return (ActiveOperation<T, A>) removed; } finally { lock.unlock(); } }