@Override
    public void handleMessage(final Message message) {
        if (message.obj instanceof CancelHolder) {
            final CancelHolder holder = (CancelHolder) message.obj;
            if (holder.kind == CancelHolder.CANCEL && !isDisposed()) {
                disposables.dispose();
                handleDispose();
            } else if (holder.kind == CancelHolder.CANCEL_CALLBACK) {
                // We have been disposed already but the callback has not been called yet.
                handleDispose();
            }
        } else if (!isDisposed()) {
            handleRegularMessage(message);
        }
    }
Handler with a dispose policy. Once disposed, the handler will not handle
any more dispose or regular message.
main/src/main/java/cgeo/geocaching/utils/DisposableHandler.java