Package org.osgi.util.pushstream
Enum Class PushbackPolicyOption
- All Implemented Interfaces:
Serializable
,Comparable<PushbackPolicyOption>
,Constable
PushbackPolicyOption
provides a standard set of simple
PushbackPolicy
implementations.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionReturns a fixed amount of back pressure, independent of how full the buffer isReturns zero back pressure when the buffer is empty, then it returns a linearly increasing amount of back pressure based on how full the buffer is.Returns zero back pressure until the buffer is full, then it returns an exponentially increasing amount, starting with the supplied value and doubling it each time.Returns zero back pressure until the buffer is full, then it returns a fixed value -
Method Summary
Modifier and TypeMethodDescriptionabstract <T,
U extends BlockingQueue<PushEvent<? extends T>>>
PushbackPolicy<T,U> getPolicy
(long value) Create aPushbackPolicy
instance configured with a base back pressure time in nanoseconds The actual backpressure returned will vary based on the selected implementation, the base value, and the state of the buffer.static PushbackPolicyOption
Returns the enum constant of this class with the specified name.static PushbackPolicyOption[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FIXED
Returns a fixed amount of back pressure, independent of how full the buffer is -
ON_FULL_FIXED
Returns zero back pressure until the buffer is full, then it returns a fixed value -
ON_FULL_EXPONENTIAL
Returns zero back pressure until the buffer is full, then it returns an exponentially increasing amount, starting with the supplied value and doubling it each time. Once the buffer is no longer full the back pressure returns to zero. -
LINEAR
Returns zero back pressure when the buffer is empty, then it returns a linearly increasing amount of back pressure based on how full the buffer is. The maximum value will be returned when the buffer is full.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getPolicy
public abstract <T,U extends BlockingQueue<PushEvent<? extends T>>> PushbackPolicy<T,U> getPolicy(long value) Create aPushbackPolicy
instance configured with a base back pressure time in nanoseconds The actual backpressure returned will vary based on the selected implementation, the base value, and the state of the buffer.- Parameters:
value
-- Returns:
- A
PushbackPolicy
to use
-