Enum JerseyPublisher.PublisherStrategy
- java.lang.Object
-
- java.lang.Enum<JerseyPublisher.PublisherStrategy>
-
- org.glassfish.jersey.internal.util.JerseyPublisher.PublisherStrategy
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<JerseyPublisher.PublisherStrategy>
- Enclosing class:
- JerseyPublisher<T>
public static enum JerseyPublisher.PublisherStrategy extends java.lang.Enum<JerseyPublisher.PublisherStrategy>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BEST_EFFORT
Best effort publisher strategy - tries to deliver to all subscribers if possible without blocking the processing.BLOCKING
Blocking publisher strategy - tries to deliver to all subscribers regardless the cost.
-
Constructor Summary
Constructors Modifier Constructor Description private
PublisherStrategy()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static JerseyPublisher.PublisherStrategy
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static JerseyPublisher.PublisherStrategy[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BLOCKING
public static final JerseyPublisher.PublisherStrategy BLOCKING
Blocking publisher strategy - tries to deliver to all subscribers regardless the cost. The thread is blocked uninterruptibly while resources for any subscriber are unavailable. This strategy comes with a risk of thread exhaustion, that will lead to publisher being completely blocked by slow or incorrectly implemented subscribers.
-
BEST_EFFORT
public static final JerseyPublisher.PublisherStrategy BEST_EFFORT
Best effort publisher strategy - tries to deliver to all subscribers if possible without blocking the processing. If the buffer is full, publisher invokesonError()
and cancels subscription on a subscriber, that is not capable of read the messages at a speed sufficient to unblock the processing.
-
-
Method Detail
-
values
public static JerseyPublisher.PublisherStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (JerseyPublisher.PublisherStrategy c : JerseyPublisher.PublisherStrategy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static JerseyPublisher.PublisherStrategy valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-