Top Description Fields Constructors Methods
org.eclipse.jetty.reactive.client.internal

public abstract Class AbstractSingleProcessor<I, O>

extends AbstractSinglePublisher<O>
implements Processor<I, O>
Class Inheritance
All Implemented Interfaces
org.reactivestreams.Processor, org.reactivestreams.Publisher, org.reactivestreams.Subscriber
Known Direct Subclasses
org.eclipse.jetty.reactive.client.internal.DiscardingProcessor, org.eclipse.jetty.reactive.client.internal.PublisherContent, org.eclipse.jetty.reactive.client.internal.ResponseListenerProcessor, org.eclipse.jetty.reactive.client.internal.ResultProcessor, org.eclipse.jetty.reactive.client.internal.Transformer, org.eclipse.jetty.reactive.client.internal.AbstractBufferingProcessor
Type Parameters
<I>
the type of the input elements
<O>
the type of the output elements
Imports
java.util.Objects, org.eclipse.jetty.util.MathUtils, org.eclipse.jetty.util.thread.AutoLock, org.reactivestreams.Processor, .Publisher, .Subscriber, .Subscription

A Processor that allows a single Subscriber at a time, and can subscribe to only one Publisher at a time.

The implementation acts as a Subscriber to upstream input, and acts as a Publisher for the downstream output.

Subclasses implement the transformation of the input elements into the output elements by overriding onNext(Object).

Field Summary

Modifier and TypeField and Description
private long
private Subscription

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
cancel()

Overrides org.eclipse.jetty.reactive.client.internal.AbstractSinglePublisher.cancel.

Implements org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.
protected Subscriber<? super O>
private void
private void
protected void
public void
onComplete()

Implements org.reactivestreams.Subscriber.onComplete.

Successful terminal state.
public void
onError(Throwable
the throwable signaled
throwable
)

Implements org.reactivestreams.Subscriber.onError.

Failed terminal state.
protected void
protected void
public void
public String
toString()

Overrides org.eclipse.jetty.reactive.client.internal.AbstractSinglePublisher.toString.

Returns a string representation of the object.
private Subscription
protected void
protected void
private void
upStreamRequest(Subscription upStream, long demand)

Inherited from org.eclipse.jetty.reactive.client.internal.AbstractSinglePublisher:
emitOnCompleteemitOnErroremitOnNextlockrequestsubscribesubscriber

Field Detail

demandback to summary
private long demand
upStreamback to summary
private Subscription upStream

Constructor Detail

AbstractSingleProcessorback to summary
public AbstractSingleProcessor()

Method Detail

cancelback to summary
public void cancel()

Overrides org.eclipse.jetty.reactive.client.internal.AbstractSinglePublisher.cancel.

Implements org.reactivestreams.Subscription.cancel.

Doc from org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.

Data may still be sent to meet previously signalled demand after calling cancel.

Annotations
@Override
downStreamback to summary
protected Subscriber<? super O> downStream()
downStreamOnCompleteback to summary
private void downStreamOnComplete()
downStreamOnErrorback to summary
private void downStreamOnError(Throwable throwable)
downStreamOnNextback to summary
protected void downStreamOnNext(O item)
onCompleteback to summary
public void onComplete()

Implements org.reactivestreams.Subscriber.onComplete.

Doc from org.reactivestreams.Subscriber.onComplete.

Successful terminal state.

No further events will be sent even if Subscription#request(long) is invoked again.

Annotations
@Override
onErrorback to summary
public void onError(Throwable throwable)

Implements org.reactivestreams.Subscriber.onError.

Doc from org.reactivestreams.Subscriber.onError.

Failed terminal state.

No further events will be sent even if Subscription#request(long) is invoked again.

Parameters
throwable:Throwable

the throwable signaled

Annotations
@Override
onFailureback to summary
protected void onFailure(Subscriber<? super O> subscriber, Throwable failure)

Overrides org.eclipse.jetty.reactive.client.internal.AbstractSinglePublisher.onFailure.

Annotations
@Override
onRequestback to summary
protected void onRequest(Subscriber<? super O> subscriber, long n)

Implements abstract org.eclipse.jetty.reactive.client.internal.AbstractSinglePublisher.onRequest.

Annotations
@Override
onSubscribeback to summary
public void onSubscribe(Subscription subscription)

Implements org.reactivestreams.Subscriber.onSubscribe.

Doc from org.reactivestreams.Subscriber.onSubscribe.

Invoked after calling Publisher#subscribe(Subscriber).

No data will start flowing until Subscription#request(long) is invoked.

It is the responsibility of this Subscriber instance to call Subscription#request(long) whenever more data is wanted.

The Publisher will send notifications only in response to Subscription#request(long).

Parameters
subscription:Subscription

the Subscription that allows requesting data via Subscription#request(long)

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.eclipse.jetty.reactive.client.internal.AbstractSinglePublisher.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
upStreamback to summary
private Subscription upStream()
upStreamCancelback to summary
protected void upStreamCancel()
upStreamRequestback to summary
protected void upStreamRequest(long n)
upStreamRequestback to summary
private void upStreamRequest(Subscription upStream, long demand)