Package org.apache.http.concurrent

Examples of org.apache.http.concurrent.Cancellable.cancel()


        }
        state.setTerminated();
        closeHandlers(state, cause);
        final Cancellable cancellable = state.getCancellable();
        if (cancellable != null) {
            cancellable.cancel();
        }
        if (conn.isResponseSubmitted()
                || state.getResponseState().compareTo(MessageState.INIT) > 0) {
            // There is not much that we can do if a response
            // has already been submitted
View Full Code Here


        if (state != null) {
            state.setTerminated();
            closeHandlers(state);
            Cancellable cancellable = state.getCancellable();
            if (cancellable != null) {
                cancellable.cancel();
            }
            state.reset();
        }
    }
View Full Code Here

        if (state != null) {
            state.setTerminated();
            closeHandlers(state, cause);
            Cancellable cancellable = state.getCancellable();
            if (cancellable != null) {
                cancellable.cancel();
            }
            if (cause instanceof HttpException) {
                if (conn.isResponseSubmitted()
                        || state.getResponseState().compareTo(MessageState.INIT) > 0) {
                    // There is not much that we can do if a response
View Full Code Here

            synchronized (state) {
                state.setTerminated();
                closeHandlers(state);
                Cancellable cancellable = state.getCancellable();
                if (cancellable != null) {
                    cancellable.cancel();
                }
                state.reset();
            }
        }
    }
View Full Code Here

            synchronized (state) {
                state.setTerminated();
                closeHandlers(state, cause);
                Cancellable cancellable = state.getCancellable();
                if (cancellable != null) {
                    cancellable.cancel();
                }
                if (cause instanceof HttpException) {
                    if (conn.isResponseSubmitted()
                            || state.getResponseState().compareTo(MessageState.INIT) > 0) {
                        // There is not much that we can do if a response
View Full Code Here

        if (state != null) {
            state.setTerminated();
            closeHandlers(state);
            final Cancellable cancellable = state.getCancellable();
            if (cancellable != null) {
                cancellable.cancel();
            }
            state.reset();
        }
    }
View Full Code Here

        if (state != null) {
            state.setTerminated();
            closeHandlers(state, cause);
            final Cancellable cancellable = state.getCancellable();
            if (cancellable != null) {
                cancellable.cancel();
            }
            if (cause instanceof HttpException) {
                if (conn.isResponseSubmitted()
                        || state.getResponseState().compareTo(MessageState.INIT) > 0) {
                    // There is not much that we can do if a response
View Full Code Here

    @Override
    public void abort() {
        if (this.aborted.compareAndSet(false, true)) {
            final Cancellable cancellable = this.cancellableRef.getAndSet(null);
            if (cancellable != null) {
                cancellable.cancel();
            }
        }
    }

    @Override
View Full Code Here

     * @since 4.2
     */
    public void reset() {
        final Cancellable cancellable = this.cancellableRef.getAndSet(null);
        if (cancellable != null) {
            cancellable.cancel();
        }
        this.aborted.set(false);
    }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.