/** * {@inheritDoc} * * <p>This implementation simply delegates to {@link #onCompleteImpl()} after ensuring consistent * state. */ public final void onComplete() { Preconditions.checkState(!isClosed, getClass() + " tried to double close."); isClosed = true; onCompleteImpl(); }
/** * {@inheritDoc} * * <p>This implementation simply delegates to {@link #onStartImpl(StreamController)} after * ensuring consistent state. */ public final void onStart(StreamController controller) { Preconditions.checkState(!isStarted, getClass() + " is already started."); isStarted = true; onStartImpl(controller); }
/** * {@inheritDoc} * * <p>This implementation simply delegates to {@link #onResponseImpl(Object)} after ensuring * consistent state. */ public final void onResponse(V response) { Preconditions.checkState(!isClosed, getClass() + " received a response after being closed."); onResponseImpl(response); }
/** * {@inheritDoc} * * <p>This implementation simply delegates to {@link #onErrorImpl(Throwable)} after ensuring * consistent state. */ public final void onError(Throwable t) { Preconditions.checkState(!isClosed, getClass() + " received error after being closed", t); isClosed = true; onErrorImpl(t); }
/** * {@inheritDoc} * * <p>This implementation simply delegates to {@link #onResponseImpl(Object)} after ensuring * consistent state. */ public final void onResponse(V response) { Preconditions.checkState(!isClosed, getClass() + " received a response after being closed."); onResponseImpl(response); }
/** * {@inheritDoc} * * <p>This implementation simply delegates to {@link #onErrorImpl(Throwable)} after ensuring * consistent state. */ public final void onError(Throwable t) { Preconditions.checkState(!isClosed, getClass() + " received error after being closed", t); isClosed = true; onErrorImpl(t); }
/** * {@inheritDoc} * * <p>This implementation simply delegates to {@link #onStartImpl(StreamController)} after * ensuring consistent state. */ public final void onStart(StreamController controller) { Preconditions.checkState(!isStarted, getClass() + " is already started."); isStarted = true; onStartImpl(controller); }
/** * {@inheritDoc} * * <p>This implementation simply delegates to {@link #onCompleteImpl()} after ensuring consistent * state. */ public final void onComplete() { Preconditions.checkState(!isClosed, getClass() + " tried to double close."); isClosed = true; onCompleteImpl(); }