org.mule.transport
Class AbstractPollingMessageReceiver
java.lang.Object
org.mule.transport.AbstractConnectable
org.mule.transport.AbstractMessageReceiver
org.mule.transport.AbstractPollingMessageReceiver
- All Implemented Interfaces:
- ExceptionListener, Disposable, Initialisable, Startable, Stoppable, Connectable, MessageReceiver
- Direct Known Subclasses:
- FileMessageReceiver, FtpMessageReceiver, PollingHttpMessageReceiver, RetrieveMessageReceiver, RmiMessageReceiver, StdioMessageReceiver, TransactedPollingMessageReceiver
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.
Methods inherited from class org.mule.transport.AbstractMessageReceiver |
dispose, getConnectEventId, getConnectionDescription, getEndpoint, getEndpointURI, getListener, getReceiverKey, getService, getWorkManager, handleUnacceptedFilter, initialise, routeMessage, routeMessage, routeMessage, routeMessage, routeMessage, routeMessage, setEndpoint, setExceptionDetails, setListener, setReceiverKey, setService, toString |
Methods inherited from class org.mule.transport.AbstractConnectable |
activate, connect, disconnect, disposeAndLogException, doConnect, doDisconnect, doDispose, doInitialise, exceptionThrown, getConnectEventId, getConnector, handleException, isConnected, isDoThreading, isStarted, passivate, setEndpoint, start, stop, validate, validateConnection |
Methods inherited from interface org.mule.api.lifecycle.Startable |
start |
Methods inherited from interface org.mule.api.lifecycle.Stoppable |
stop |
DEFAULT_POLL_FREQUENCY
public static final long DEFAULT_POLL_FREQUENCY
- See Also:
- Constant Field Values
DEFAULT_POLL_TIMEUNIT
public static final edu.emory.mathcs.backport.java.util.concurrent.TimeUnit DEFAULT_POLL_TIMEUNIT
DEFAULT_STARTUP_DELAY
public static final long DEFAULT_STARTUP_DELAY
- See Also:
- Constant Field Values
schedules
protected final List schedules
AbstractPollingMessageReceiver
public AbstractPollingMessageReceiver(Connector connector,
Service service,
InboundEndpoint endpoint)
throws CreateException
- Throws:
CreateException
doStart
protected void doStart()
throws MuleException
- Overrides:
doStart
in class AbstractConnectable
- Throws:
MuleException
doStop
protected void doStop()
throws MuleException
- Overrides:
doStop
in class AbstractConnectable
- Throws:
MuleException
schedule
protected void schedule()
throws edu.emory.mathcs.backport.java.util.concurrent.RejectedExecutionException,
NullPointerException,
IllegalArgumentException
- This method registers this receiver for periodic polling ticks with the connectors
scheduler. Subclasses can override this in case they want to handle their polling
differently.
- Throws:
edu.emory.mathcs.backport.java.util.concurrent.RejectedExecutionException
NullPointerException
IllegalArgumentException
- See Also:
ScheduledExecutorService#scheduleWithFixedDelay(Runnable, long, long, TimeUnit)}
unschedule
protected void unschedule()
- This method cancels the schedules which were created in
schedule()
.
- See Also:
Future#cancel(boolean)}
createWork
protected PollingReceiverWorker createWork()
getFrequency
public long getFrequency()
setFrequency
public void setFrequency(long value)
getTimeUnit
public edu.emory.mathcs.backport.java.util.concurrent.TimeUnit getTimeUnit()
setTimeUnit
public void setTimeUnit(edu.emory.mathcs.backport.java.util.concurrent.TimeUnit timeUnit)
poll
public abstract void poll()
throws Exception
- Throws:
Exception
Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.