Package com.adaptris.core
Class GaussianIntervalPoller
- java.lang.Object
-
- com.adaptris.core.PollerImp
-
- com.adaptris.core.ScheduledTaskPoller
-
- com.adaptris.core.GaussianIntervalPoller
-
- All Implemented Interfaces:
ComponentLifecycle,Poller
public class GaussianIntervalPoller extends ScheduledTaskPoller
Implementation of Poller which polls at a random interval with a normal distribution.
Note: Logic is as follows:
Random.nextGaussian() * getMeanInterval() + getStandardDeviationInterval().In the adapter configuration file this class is aliased as gaussian-interval-poller which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.adaptris.core.PollerImp
PollerImp.Callback
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.ScheduledTaskPoller
executor, pollerTask
-
-
Constructor Summary
Constructors Constructor Description GaussianIntervalPoller()Creates a new instance.GaussianIntervalPoller(TimeInterval meanInterval, TimeInterval standardDeviationInterval)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TimeIntervalgetMeanInterval()TimeIntervalgetStandardDeviationInterval()voidinit()Initialises the component.protected voidscheduleTask()voidsetMeanInterval(TimeInterval meanInterval)Set the mean to be used in poll interval calculation.voidsetStandardDeviationInterval(TimeInterval standardDeviationInterval)Set the standard deviation to be used in poll interval calculation.-
Methods inherited from class com.adaptris.core.ScheduledTaskPoller
close, getShutdownWaitTime, setShutdownWaitTime, start, stop
-
Methods inherited from class com.adaptris.core.PollerImp
attemptLock, processMessages, registerConsumer, releaseLock, retrieveConsumer, retrieveConsumer, withPollerCallback
-
-
-
-
Constructor Detail
-
GaussianIntervalPoller
public GaussianIntervalPoller()
Creates a new instance. Default mean is 0 seconds and standard deviation is 20 seconds.
-
GaussianIntervalPoller
public GaussianIntervalPoller(TimeInterval meanInterval, TimeInterval standardDeviationInterval)
-
-
Method Detail
-
init
public void init() throws CoreExceptionDescription copied from interface:ComponentLifecycleInitialises the component.Component initialisation includes config verification, creation of connections etc.
- Specified by:
initin interfaceComponentLifecycle- Overrides:
initin classScheduledTaskPoller- Throws:
CoreException- wrapping any underlyingExceptions
-
scheduleTask
protected void scheduleTask()
- Specified by:
scheduleTaskin classScheduledTaskPoller
-
getMeanInterval
public TimeInterval getMeanInterval()
-
setMeanInterval
public void setMeanInterval(TimeInterval meanInterval)
Set the mean to be used in poll interval calculation.- Parameters:
meanInterval- the mean interval (default 0 seconds)
-
getStandardDeviationInterval
public TimeInterval getStandardDeviationInterval()
-
setStandardDeviationInterval
public void setStandardDeviationInterval(TimeInterval standardDeviationInterval)
Set the standard deviation to be used in poll interval calculation.- Parameters:
standardDeviationInterval- the standard deviation interval (default 20 seconds)
-
-