Class WaitStrategyFactory

java.lang.Object
net.logstash.logback.appender.WaitStrategyFactory

public class WaitStrategyFactory extends Object
Creates WaitStrategy objects from strings.
  • Constructor Details

    • WaitStrategyFactory

      public WaitStrategyFactory()
  • Method Details

    • createWaitStrategyFromString

      public static com.lmax.disruptor.WaitStrategy createWaitStrategyFromString(String waitStrategyType)
      Creates a WaitStrategy from a string.

      The following strategies are supported:

      • blocking - BlockingWaitStrategy
      • busySpin - BusySpinWaitStrategy
      • liteBlocking - LiteBlockingWaitStrategy
      • sleeping{retries,sleepTimeNs} - SleepingWaitStrategy - retries an integer number of times to spin before sleeping. (default = 200) sleepTimeNs nanosecond time to sleep each iteration after spinning (default = 100)
      • yielding - YieldingWaitStrategy
      • phasedBackoff{spinTimeout,yieldTimeout,timeUnit,fallackStrategy} - PhasedBackoffWaitStrategy - spinTimeout and yieldTimeout are long values. timeUnit is a string name of one of the TimeUnit values. fallbackStrategy is a wait strategy string (e.g. blocking).
      • timeoutBlocking{timeout,timeUnit} - TimeoutBlockingWaitStrategy - timeout is a long value. timeUnit is a string name of one of the TimeUnit values.
      • liteTimeoutBlocking{timeout,timeUnit} - LiteTimeoutBlockingWaitStrategy - timeout is a long value. timeUnit is a string name of one of the TimeUnit values.
      Parameters:
      waitStrategyType - the name of the desired wait strategy
      Returns:
      a WaitStrategy instance or null if the supplied name is null or empty
      Throws:
      IllegalArgumentException - if an unknown wait strategy type is given, or the parameters are unable to be parsed.