public void complete() { if (remaining.decrementAndGet() == 0) { originalCallback.receivedStatus(mostRecentStatus); originalCallback.complete(); } }
@Override public synchronized void timeOut() { timedout = true; callback.receivedStatus(TIMED_OUT); callback.complete(); }
public void complete() { if (remaining.decrementAndGet() == 0) { originalCallback.receivedStatus(mostRecentStatus); originalCallback.complete(); } }
public final void cancel() { cancelled=true; wasCancelled(); callback.complete(); }
public void complete() { if (--remaining == 0) { originalCallback.receivedStatus(mostRecentStatus); originalCallback.complete(); } }
public final void cancel() { cancelled=true; wasCancelled(); callback.complete(); }
public void complete() { if (--remaining == 0) { originalCallback.receivedStatus(mostRecentStatus); originalCallback.complete(); } }
public void complete() { if(--remaining == 0) { originalCallback.receivedStatus(mostRecentStatus); originalCallback.complete(); } }
public void complete() { if(--remaining == 0) { originalCallback.receivedStatus(mostRecentStatus); originalCallback.complete(); } }
public final void cancel(String cause) { cancelled = true; cancelCause = "Cancelled (" + cause + ")"; wasCancelled(); callback.complete(); }
@Override public synchronized boolean isTimedOut(long ttlMillis) { long elapsed = System.nanoTime(); long ttlNanos = ttlMillis * 1000 * 1000; if (elapsed - creationTime > ttlNanos) { timedOutUnsent = true; timedout = true; callback.receivedStatus(TIMED_OUT); callback.complete(); } // else // timedout would be false, but we cannot allow you to untimeout an // operation. This can happen when the latch timeout is shorter than the // default operation timeout. return timedout; }
@Override public synchronized boolean isTimedOut(long ttlMillis) { long elapsed = System.nanoTime(); long ttlNanos = ttlMillis * 1000 * 1000; if (elapsed - creationTime > ttlNanos) { timedOutUnsent = true; timedout = true; callback.receivedStatus(TIMED_OUT); callback.complete(); } // else // timedout would be false, but we cannot allow you to untimeout an // operation. This can happen when the latch timeout is shorter than the // default operation timeout. return timedout; }
@Override public synchronized void timeOut() { timedout = true; synchronized (clones) { Iterator<Operation> i = clones.iterator(); while(i.hasNext()) { i.next().timeOut(); } } callback.receivedStatus(TIMED_OUT); callback.complete(); }
@Override public synchronized void timeOut() { timedout = true; synchronized (clones) { Iterator<Operation> i = clones.iterator(); while(i.hasNext()) { i.next().timeOut(); } } callback.receivedStatus(TIMED_OUT); callback.complete(); }
public final synchronized void cancel() { cancelled = true; synchronized (clones) { Iterator<Operation> i = clones.iterator(); while(i.hasNext()) { i.next().cancel(); } } wasCancelled(); callback.receivedStatus(CANCELLED); callback.complete(); }
public final synchronized void cancel() { cancelled = true; synchronized (clones) { Iterator<Operation> i = clones.iterator(); while(i.hasNext()) { i.next().cancel(); } } wasCancelled(); callback.receivedStatus(CANCELLED); callback.complete(); }
public final synchronized void cancel() { cancelled = true; wasCancelled(); callback.receivedStatus(CANCELLED); callback.complete(); }
/** * Transition the state of this operation to the given state. */ protected final void transitionState(OperationState newState) { getLogger().debug("Transitioned state from %s to %s", state, newState); state=newState; // Discard our buffer when we no longer need it. if(state != OperationState.WRITING) { cmd=null; } if(state == OperationState.COMPLETE) { callback.complete(); } }
/** * Transition the state of this operation to the given state. */ protected final synchronized void transitionState(OperationState newState) { getLogger().debug("Transitioned state from %s to %s", state, newState); state = newState; // Discard our buffer when we no longer need it. if(state != OperationState.WRITE_QUEUED && state != OperationState.WRITING) { cmd = null; } if (state == OperationState.COMPLETE) { callback.complete(); } }
@Override public void handleResponse(HttpResponse response) { String json = getEntityString(response); int errorcode = response.getStatusLine().getStatusCode(); try { OperationStatus status = parseViewForStatus(json, errorcode); callback.receivedStatus(status); } catch (ParseException e) { setException(new OperationException(OperationErrorType.GENERAL, "Error parsing JSON" + e)); } callback.complete(); }