Enum Class PushbackPolicyOption

java.lang.Object
java.lang.Enum<PushbackPolicyOption>
org.osgi.util.pushstream.PushbackPolicyOption
All Implemented Interfaces:
Serializable, Comparable<PushbackPolicyOption>, Constable

public enum PushbackPolicyOption extends Enum<PushbackPolicyOption>
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 Constants
    Enum Constant
    Description
    Returns a fixed amount of back pressure, independent of how full the buffer is
    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.
    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 Type
    Method
    Description
    abstract <T, U extends BlockingQueue<PushEvent<? extends T>>>
    PushbackPolicy<T,U>
    getPolicy(long value)
    Create a PushbackPolicy 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.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • FIXED

      public static final PushbackPolicyOption FIXED
      Returns a fixed amount of back pressure, independent of how full the buffer is
    • ON_FULL_FIXED

      public static final PushbackPolicyOption ON_FULL_FIXED
      Returns zero back pressure until the buffer is full, then it returns a fixed value
    • ON_FULL_EXPONENTIAL

      public static final PushbackPolicyOption 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

      public static final PushbackPolicyOption 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

      public static PushbackPolicyOption[] 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

      public static PushbackPolicyOption valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getPolicy

      public abstract <T, U extends BlockingQueue<PushEvent<? extends T>>> PushbackPolicy<T,U> getPolicy(long value)
      Create a PushbackPolicy 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