/*
(non-Javadoc)
@see com.popbill.api.MessageService#cancelReserveRN(java.lang.String, java.lang.String)
16610
@Override
    public Response cancelReserveRN(String CorpNum, String requestNum) throws PopbillException {
        return cancelReserveRN(CorpNum, requestNum, null);
    }
527465
public void cancel(String[] protocol, int[] reasonCode, String[] reasonText) {
		if(ackReceived) 
			throw new IllegalStateException("There has been an ACK received. Can not cancel more brnaches, the INVITE tx has finished.");
		cancelAllExcept(null, protocol, reasonCode, reasonText, true);
	}
29186
private final void cancelCancellable() {
        if (timeoutMessageCancellable != null
                && !timeoutMessageCancellable.isCancelled()) {
            timeoutMessageCancellable.cancel();
        }
        if (pollMessageCancellable != null
                && !pollMessageCancellable.isCancelled()) {
            pollMessageCancellable.cancel();
        }
    }
180228
public void cancelPendingTake() {
        CompletableFuture<Queue<T>> pending;
        synchronized (this.contents) {
            pending = this.pendingTake;
            this.pendingTake = null;
        }

        // Cancel any pending poll request.
        if (pending != null) {
            pending.cancel(true);
        }
    }
262681
public void cancelCancellable() {

        if (timeoutMessageCancellable != null) {
            timeoutMessageCancellable.cancel();
        }
        if (getResponseFuture() != null && !getResponseFuture().isDone()) {
            getResponseFuture().cancel(true);
        }
    }
1035930
@Override
    protected void cancelFaxJobImpl(FaxJob faxJob)
    {
        //get connection
        Connection<MailResourcesHolder> mailConnection=this.getMailConnection();

        //get holder
        MailResourcesHolder mailResourcesHolder=mailConnection.getResource();

        //create message
        Message message=this.createCancelFaxJobMessage(faxJob,mailResourcesHolder);
        
        //send message
        this.sendMail(faxJob,mailConnection,message);
    }
333164
public void cancel() {

        if (m_lockActionRecord.getChange() == LockChange.locked) {
            CmsObject cms = A_CmsUI.getCmsObject();
            try {
                CmsResource res = cms.readResource(m_editId);
                cms.unlockResource(res);
            } catch (CmsException e) {
                LOG.warn("Failed to unlock resource " + m_editId.toString(), e);
            }
        }
        CmsAppWorkplaceUi.get().enableGlobalShortcuts();
    }
1197609
@Override
  public void cancel(final Status reason) {
    checkNotNull(reason, "reason");
    boolean delegateToRealStream = true;
    ClientStreamListener listenerToClose = null;
    synchronized (this) {
      // If realStream != null, then either setStream() or cancel() has been called
      if (realStream == null) {
        realStream = NoopClientStream.INSTANCE;
        delegateToRealStream = false;

        // If listener == null, then start() will later call listener with 'error'
        listenerToClose = listener;
        error = reason;
      }
    }
    if (delegateToRealStream) {
      delayOrExecute(new Runnable() {
        @Override
        public void run() {
          realStream.cancel(reason);
        }
      });
    } else {
      if (listenerToClose != null) {
        listenerToClose.closed(reason, new Metadata());
      }
      drainPendingCalls();
    }
  }
278755
@Override
    public Response cancelReserve(String CorpNum, String receiptNum) throws PopbillException {
        return cancelReserve(CorpNum, receiptNum, null);
    }
553065
@Override
  public void cancel(Serializable id) {
    logger.debug("Cancelling timer with id {}", id);
    this.ftScheduler.cancel(id);
  }
437607
public void cancel(ResponseCallback responseCallback) {
    // To avoid creating an extra message, we adopt the convention that writing the callback
    // directly means cancellation
    writeCoalescer.writeAndFlush(channel, responseCallback).addListener(UncaughtExceptions::log);
  }
495071
public void cancel(final int id) {
        final BaseNotificationItem notification = remove(id);

        if (notification == null) {
            return;
        }

        notification.cancel();
    }
856642
public Subscription cancelSubscription(final Subscription subscription) {
        return doPUT(Subscription.SUBSCRIPTION_RESOURCE + "/" + subscription.getUuid() + "/cancel",
                     subscription, Subscription.class);
    }
891142
private void cancelNameResolverBackoff() {
    syncContext.throwIfNotInThisSynchronizationContext();
    if (scheduledNameResolverRefresh != null) {
      scheduledNameResolverRefresh.cancel();
      scheduledNameResolverRefresh = null;
      nameResolverBackoffPolicy = null;
    }
  }
253687
@Override
  public synchronized boolean cancel(boolean mayInterruptIfRunning) {
    if (isDone())
      return false;

    boolean cancelResult = super.cancel(mayInterruptIfRunning);
    if (delegate != null)
      cancelResult = delegate.cancel(mayInterruptIfRunning);
    Throwable failure = new CancellationException();
    complete(null, failure);
    executor.handleComplete(ExecutionResult.failure(failure), execution);
    return cancelResult;
  }
1329008
@Override
    public boolean cancel() {
        if (Config.DEBUG) {
            Log.v(TAG, "cancel() " + getName());
        }
        return mInfo.queue.cancel(getName());
    }
318153
void terminateRequest() {
        int oldVal = state;
        if (allAreSet(oldVal, FLAG_REQUEST_TERMINATED)) {
            // idempotent
            return;
        }
        if (requestChannel != null) {
            requestChannel.requestDone();
        }
        this.state = oldVal | FLAG_REQUEST_TERMINATED;
        if (anyAreSet(oldVal, FLAG_RESPONSE_TERMINATED)) {
            invokeExchangeCompleteListeners();
        }
    }