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 AbstractReceiverResourceWorker

    java.lang.Object
      org.mule.transport.AbstractReceiverWorker
          org.mule.transport.AbstractReceiverResourceWorker

All Implemented Interfaces:
  Runnable, javax.resource.spi.work.Work

Direct Known Subclasses:
  TcpMessageReceiver.TcpWorker

    public abstract class AbstractReceiverResourceWorker

extends AbstractReceiverWorker

This is a Message receiver worker used by transports that do not have a way for the underlying transport to call back to the receiver when a message is available such as Jms. This worker provides a callback `getNextMessage(Object)` where the receiver can read the next message from the underlying transport.

Field Summary
`protected Object` | `resource`

Fields inherited from class org.mule.transport.AbstractReceiverWorker
`endpoint, messages, out, receiver`

Constructor Summary
`AbstractReceiverResourceWorker(Object resource, AbstractMessageReceiver receiver)`
`AbstractReceiverResourceWorker(Object resource, AbstractMessageReceiver receiver, OutputStream out)`

Method Summary
`void` | `doRun()` The actual logic used to receive messages from the underlying transport.
`protected abstract Object` | `getNextMessage(Object resource)` The method used to read the next message from the underlying transport.
`protected boolean` | `hasMoreMessages(Object message)`

Methods inherited from class org.mule.transport.AbstractReceiverWorker
`bindTransaction, handleResults, postProcessMessage, preProcessMessage, preRouteMuleMessage, release, run`

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

Field Detail

### resource

    protected Object resource

Constructor Detail

### AbstractReceiverResourceWorker

    public AbstractReceiverResourceWorker(Object resource,
                                          AbstractMessageReceiver receiver)

### AbstractReceiverResourceWorker

    public AbstractReceiverResourceWorker(Object resource,
                                          AbstractMessageReceiver receiver,
                                          OutputStream out)

Method Detail

### doRun

    public void doRun()

  Description copied from class: `AbstractReceiverWorker`
  The actual logic used to receive messages from the underlying transport. The default implementation will execute the processing of messages within a TransactionTemplate. This template will manage the transaction lifecycle for the list of messages associated with this receiver worker.

  Overrides:
    `doRun` in class `AbstractReceiverWorker`

### hasMoreMessages

    protected boolean hasMoreMessages(Object message)

### getNextMessage

    protected abstract Object getNextMessage(Object resource)
                                      throws Exception

  The method used to read the next message from the underlying transport.

  Parameters:
    `resource` - the resource to read from, this may be a socket, a directory or some higher level representation.
  Returns:
    the message read from the resource. This can be raw data such as a byte[].
  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.