Package net.logstash.logback.appender
Class WaitStrategyFactory
java.lang.Object
net.logstash.logback.appender.WaitStrategyFactory
Creates
WaitStrategy
objects from strings.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.lmax.disruptor.WaitStrategy
createWaitStrategyFromString
(String waitStrategyType) Creates aWaitStrategy
from a string.
-
Constructor Details
-
WaitStrategyFactory
public WaitStrategyFactory()
-
-
Method Details
-
createWaitStrategyFromString
Creates aWaitStrategy
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
andyieldTimeout
are long values.timeUnit
is a string name of one of theTimeUnit
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 theTimeUnit
values.liteTimeoutBlocking{timeout,timeUnit}
-LiteTimeoutBlockingWaitStrategy
-timeout
is a long value.timeUnit
is a string name of one of theTimeUnit
values.
- Parameters:
waitStrategyType
- the name of the desired wait strategy- Returns:
- a
WaitStrategy
instance ornull
if the supplied name isnull
or empty - Throws:
IllegalArgumentException
- if an unknown wait strategy type is given, or the parameters are unable to be parsed.
-