public abstract class AbstractPollingMessageReceiver extends AbstractMessageReceiver
AbstractPollingMessageReceiver implements a base class for polling
message receivers. The receiver provides a poll() method that implementations
must implement to execute their custom code. Note that the receiver will not poll if
the associated connector is not started.| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_POLL_FREQUENCY |
static edu.emory.mathcs.backport.java.util.concurrent.TimeUnit |
DEFAULT_POLL_TIMEUNIT |
static long |
DEFAULT_STARTUP_DELAY |
protected List |
schedules |
connected, connecting, connectionStrategy, connector, disposing, endpoint, logger, receiverKey, responseEndpoint, service, stoppedPHASE_NAMEPHASE_NAMEPHASE_NAMEPHASE_NAME| Constructor and Description |
|---|
AbstractPollingMessageReceiver(Connector connector,
Service service,
InboundEndpoint endpoint) |
| Modifier and Type | Method and Description |
|---|---|
protected PollingReceiverWorker |
createWork() |
protected void |
doStart() |
protected void |
doStop() |
long |
getFrequency() |
edu.emory.mathcs.backport.java.util.concurrent.TimeUnit |
getTimeUnit() |
abstract void |
poll() |
protected void |
schedule()
This method registers this receiver for periodic polling ticks with the connectors
scheduler.
|
void |
setFrequency(long value) |
void |
setTimeUnit(edu.emory.mathcs.backport.java.util.concurrent.TimeUnit timeUnit) |
protected void |
unschedule()
This method cancels the schedules which were created in
schedule(). |
connect, disconnect, dispose, doConnect, doDisconnect, doDispose, doInitialise, getConnectEventId, getConnectionDescription, getConnector, getEndpoint, getEndpointURI, getListener, getReceiverKey, getService, getWorkManager, handleException, handleUnacceptedFilter, initialise, isConnected, routeMessage, routeMessage, routeMessage, routeMessage, routeMessage, routeMessage, setConnector, setEndpoint, setExceptionDetails, setListener, setReceiverKey, setService, setWorkManager, start, stop, toStringpublic static final long DEFAULT_POLL_FREQUENCY
public static final edu.emory.mathcs.backport.java.util.concurrent.TimeUnit DEFAULT_POLL_TIMEUNIT
public static final long DEFAULT_STARTUP_DELAY
protected final List schedules
public AbstractPollingMessageReceiver(Connector connector, Service service, InboundEndpoint endpoint) throws CreateException
CreateExceptionprotected void doStart()
throws MuleException
doStart in class AbstractMessageReceiverMuleExceptionprotected void doStop()
throws MuleException
doStop in class AbstractMessageReceiverMuleExceptionprotected void schedule()
throws edu.emory.mathcs.backport.java.util.concurrent.RejectedExecutionException,
NullPointerException,
IllegalArgumentException
edu.emory.mathcs.backport.java.util.concurrent.RejectedExecutionExceptionNullPointerExceptionIllegalArgumentExceptionScheduledExecutorService#scheduleWithFixedDelay(Runnable, long, long, TimeUnit)}protected void unschedule()
schedule().Future#cancel(boolean)}protected PollingReceiverWorker createWork()
public long getFrequency()
public void setFrequency(long value)
public edu.emory.mathcs.backport.java.util.concurrent.TimeUnit getTimeUnit()
public void setTimeUnit(edu.emory.mathcs.backport.java.util.concurrent.TimeUnit timeUnit)
Copyright © 2003-2012 MuleSource, Inc.. All Rights Reserved.