Class ScheduledTaskPoller
- java.lang.Object
-
- com.adaptris.core.PollerImp
-
- com.adaptris.core.ScheduledTaskPoller
-
- All Implemented Interfaces:
ComponentLifecycle
,Poller
- Direct Known Subclasses:
FixedIntervalPoller
,GaussianIntervalPoller
public abstract class ScheduledTaskPoller extends PollerImp
- Since:
- 3.4.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.adaptris.core.PollerImp
PollerImp.Callback
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.concurrent.ScheduledExecutorService
executor
protected java.util.concurrent.ScheduledFuture
pollerTask
-
Constructor Summary
Constructors Constructor Description ScheduledTaskPoller()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the component.TimeInterval
getShutdownWaitTime()
void
init()
Initialises the component.protected abstract void
scheduleTask()
void
setShutdownWaitTime(TimeInterval interval)
Set the shutdown wait timeout for the pool.void
start()
Starts the component.void
stop()
Stop the component-
Methods inherited from class com.adaptris.core.PollerImp
attemptLock, processMessages, registerConsumer, releaseLock, retrieveConsumer, retrieveConsumer, withPollerCallback
-
-
-
-
Method Detail
-
init
public void init() throws CoreException
Description copied from interface:ComponentLifecycle
Initialises the component.Component initialisation includes config verification, creation of connections etc.
- Throws:
CoreException
- wrapping any underlyingException
s
-
start
public void start() throws CoreException
Description copied from interface:ComponentLifecycle
Starts the component.Once a component is started it should be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling start will begin message delivery.- Throws:
CoreException
- wrapping any underlyingException
s
-
scheduleTask
protected abstract void scheduleTask()
-
stop
public void stop()
Description copied from interface:ComponentLifecycle
Stop the componentA stopped component is not expected to be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling stop will pause message delivery. Throwing aRuntimeException
may cause unintended consequences
-
close
public void close()
Description copied from interface:ComponentLifecycle
Closes the component.A closed component should release any connections it uses, etc. and clean up completely. Throwing a
RuntimeException
may cause unintended consequences
-
getShutdownWaitTime
public TimeInterval getShutdownWaitTime()
-
setShutdownWaitTime
public void setShutdownWaitTime(TimeInterval interval)
Set the shutdown wait timeout for the pool.When
stop()
is invoked, this causes a emptying and shutdown of the pool. The specified value is the amount of time to wait for a clean shutdown. If this timeout is exceeded then a forced shutdown ensues, which may mean messages are in an inconsistent state.- Parameters:
interval
- the shutdown time (default is 60 seconds)- See Also:
stop()
-
-