Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mule.transport
Class AbstractPollingMessageReceiver

    java.lang.Object
      org.mule.transport.AbstractConnectable
          org.mule.transport.AbstractMessageReceiver
              org.mule.transport.AbstractPollingMessageReceiver

All Implemented Interfaces:
  Disposable, Initialisable, Lifecycle, LifecycleStateEnabled, Startable, Stoppable, MessageSource, Connectable, MessageReceiver

Direct Known Subclasses:
  FileMessageReceiver, FtpMessageReceiver, IBeansMessageReceiver, PollingHttpMessageReceiver, PollingTcpMessageReceiver, RetrieveMessageReceiver, RmiMessageReceiver, StdioMessageReceiver, TransactedPollingMessageReceiver, XmppPollingMessageReceiver

    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.

Field Summary
`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`

Fields inherited from class org.mule.transport.AbstractMessageReceiver
`defaultInboundTransformers, defaultResponseTransformers, flowConstruct, listener, receiverKey`

Fields inherited from class org.mule.transport.AbstractConnectable
`connected, connecting, connector, endpoint, lifecycleManager, logger, muleMessageFactory, retryTemplate, startOnConnect`

Fields inherited from interface org.mule.api.lifecycle.Initialisable
`PHASE_NAME`

Fields inherited from interface org.mule.api.lifecycle.Startable
`PHASE_NAME`

Fields inherited from interface org.mule.api.lifecycle.Stoppable
`PHASE_NAME`

Fields inherited from interface org.mule.api.lifecycle.Disposable
`PHASE_NAME`

Constructor Summary
`AbstractPollingMessageReceiver(Connector connector, FlowConstruct flowConstruct, InboundEndpoint endpoint)`

Method Summary
`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()`.

Methods inherited from class org.mule.transport.AbstractMessageReceiver
`applyInboundTransformers, applyResponseTransformers, createLifecycleManager, createMuleEvent, getConnectEventId, getConnectionDescription, getEndpoint, getEndpointURI, getFlowConstruct, getReceiverKey, getWorkManager, handleUnacceptedFilter, initialise, routeMessage, routeMessage, routeMessage, routeMessage, setEndpoint, setListener, setReceiverKey, toString`

Methods inherited from class org.mule.transport.AbstractConnectable
`activate, callDoStartWhenItIsConnected, connect, connectAndThenStart, createMuleMessage, createMuleMessage, createMuleMessage, createMuleMessageFactory, createNullMuleMessage, disconnect, dispose, disposeAndLogException, doConnect, doDisconnect, doDispose, doInitialise, getConnectEventId, getConnector, getLifecycleState, initializeMessageFactory, initializeRetryPolicy, isConnected, isConnecting, isDoThreading, isStarted, passivate, setEndpoint, start, stop, validate, validateConnection`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.mule.api.transport.MessageReceiver
`createMuleMessage, createMuleMessage`

Methods inherited from interface org.mule.api.transport.Connectable
`connect, disconnect, isConnected, validateConnection`

Methods inherited from interface org.mule.api.lifecycle.Startable
`start`

Methods inherited from interface org.mule.api.lifecycle.Stoppable
`stop`

Methods inherited from interface org.mule.api.lifecycle.Disposable
`dispose`

Field Detail

### 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

Constructor Detail

### AbstractPollingMessageReceiver

    public AbstractPollingMessageReceiver(Connector connector,
                                          FlowConstruct flowConstruct,
                                          InboundEndpoint endpoint)
                                   throws CreateException

Throws:
  `CreateException`

Method Detail

### 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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.