Class JerseyPublisher.SubscriberWrapper<T>
- java.lang.Object
-
- org.glassfish.jersey.internal.util.JerseyPublisher.SubscriberWrapper<T>
-
- All Implemented Interfaces:
Flow.Subscriber<T>
- Enclosing class:
- JerseyPublisher<T>
public static class JerseyPublisher.SubscriberWrapper<T> extends java.lang.Object implements Flow.Subscriber<T>
-
-
Field Summary
Fields Modifier and Type Field Description private Flow.Subscriber<? super T>subscriberprivate Flow.Subscriptionsubscription
-
Constructor Summary
Constructors Constructor Description SubscriberWrapper(Flow.Subscriber<? super T> subscriber)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Flow.SubscriptiongetSubscription()Get reference to subscriber'sFlow.Subscription.Flow.Subscriber<? super T>getWrappedSubscriber()voidonComplete()Method invoked when it is known that no additional Subscriber method invocations will occur for a Subscription that is not already terminated by error, after which no other Subscriber methods are invoked by the Subscription.voidonError(java.lang.Throwable throwable)Method invoked upon an unrecoverable error encountered by a Publisher or Subscription, after which no other Subscriber methods are invoked by the Subscription.voidonNext(T item)Method invoked with a Subscription's next item.voidonSubscribe(Flow.Subscription subscription)Method invoked prior to invoking any other Subscriber methods for the given Subscription.
-
-
-
Field Detail
-
subscriber
private Flow.Subscriber<? super T> subscriber
-
subscription
private Flow.Subscription subscription
-
-
Constructor Detail
-
SubscriberWrapper
public SubscriberWrapper(Flow.Subscriber<? super T> subscriber)
-
-
Method Detail
-
onSubscribe
public void onSubscribe(Flow.Subscription subscription)
Description copied from interface:Flow.SubscriberMethod invoked prior to invoking any other Subscriber methods for the given Subscription. If this method throws an exception, resulting behavior is not guaranteed, but may cause the Subscription not to be established or to be cancelled.Typically, implementations of this method invoke
subscription.requestto enable receiving items.- Specified by:
onSubscribein interfaceFlow.Subscriber<T>- Parameters:
subscription- a new subscription
-
onNext
public void onNext(T item)
Description copied from interface:Flow.SubscriberMethod invoked with a Subscription's next item. If this method throws an exception, resulting behavior is not guaranteed, but may cause the Subscription to be cancelled.- Specified by:
onNextin interfaceFlow.Subscriber<T>- Parameters:
item- the item
-
onError
public void onError(java.lang.Throwable throwable)
Description copied from interface:Flow.SubscriberMethod invoked upon an unrecoverable error encountered by a Publisher or Subscription, after which no other Subscriber methods are invoked by the Subscription. If this method itself throws an exception, resulting behavior is undefined.- Specified by:
onErrorin interfaceFlow.Subscriber<T>- Parameters:
throwable- the exception
-
onComplete
public void onComplete()
Description copied from interface:Flow.SubscriberMethod invoked when it is known that no additional Subscriber method invocations will occur for a Subscription that is not already terminated by error, after which no other Subscriber methods are invoked by the Subscription. If this method throws an exception, resulting behavior is undefined.- Specified by:
onCompletein interfaceFlow.Subscriber<T>
-
getWrappedSubscriber
public Flow.Subscriber<? super T> getWrappedSubscriber()
-
getSubscription
public Flow.Subscription getSubscription()
Get reference to subscriber'sFlow.Subscription.- Returns:
- subscriber's
subscription
-
-