public boolean cancel()

in core/src/main/java/org/apache/mina/util/AbstractIoFuture.java [92:120]


    public boolean cancel(boolean mayInterruptIfRunning) {

        LOG.debug("Attempting to cancel");

        CancellationException ce = null;
        synchronized (latch) {
            if (!isCancelled() && !isDone() && cancelOwner(mayInterruptIfRunning)) {

                LOG.debug("Successfully cancelled");

                ce = new CancellationException();
                result.set(ce);
            } else {
                LOG.debug("Unable to cancel");
            }

            latch.countDown();
        }

        if (ce != null) {
            LOG.debug("Calling listeners");

            for (IoFutureListener<V> listener : listeners) {
                scheduleException(listener, ce);
            }
        }

        return ce != null;
    }