Class QueueMessageProcessor
- java.lang.Object
-
- com.swiftmq.swiftlet.queue.MessageProcessor
-
- com.swiftmq.impl.streams.processor.QueueMessageProcessor
-
- All Implemented Interfaces:
AsyncTask
,java.lang.Runnable
public class QueueMessageProcessor extends MessageProcessor
-
-
Constructor Summary
Constructors Constructor Description QueueMessageProcessor(StreamContext ctx, Input input, QueueReceiver receiver, Selector selector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deregister()
Input
getInput()
MessageImpl
getMessage()
QueuePullTransaction
getTransaction()
boolean
isValid()
Returns whether the task is valid.void
processException(java.lang.Exception e)
Process an exception.void
processMessage(MessageEntry messageEntry)
Process a message.void
restart()
java.lang.String
toString()
-
Methods inherited from class com.swiftmq.swiftlet.queue.MessageProcessor
createBulkBuffer, getBulkBuffer, getCurrentBulkSize, getDescription, getDispatchToken, getMaxBulkSize, getReceiverId, getRegistrationId, getRegistrationTime, getSelector, getTimeout, getTransactionId, getViewId, isAutoCommit, isBulkMode, processMessages, reset, run, setAutoCommit, setBulkMode, setCurrentBulkSize, setReceiverId, setRegistrationId, setRegistrationTime, setTransactionId, setViewId, stop
-
-
-
-
Constructor Detail
-
QueueMessageProcessor
public QueueMessageProcessor(StreamContext ctx, Input input, QueueReceiver receiver, Selector selector)
-
-
Method Detail
-
deregister
public void deregister()
-
restart
public void restart() throws java.lang.Exception
- Throws:
java.lang.Exception
-
getTransaction
public QueuePullTransaction getTransaction()
-
getInput
public Input getInput()
-
getMessage
public MessageImpl getMessage()
-
processMessage
public void processMessage(MessageEntry messageEntry)
Description copied from class:MessageProcessor
Process a message. Called when a message is available and the selector matches, if specified. Use this method to store the message and dispatch the MessageProcessor to a thread pool. Implement the processing itself inside therun()
method.- Specified by:
processMessage
in classMessageProcessor
- Parameters:
messageEntry
- message entry.
-
processException
public void processException(java.lang.Exception e)
Description copied from class:MessageProcessor
Process an exception. A timeout is indicated by aQueueTimeoutException
.- Specified by:
processException
in classMessageProcessor
- Parameters:
e
- exception.- See Also:
QueueTimeoutException
-
isValid
public boolean isValid()
Description copied from interface:AsyncTask
Returns whether the task is valid. This is application dependent. As long as a task stays in the thread pool queue, this state can change. If the task is going to execute, it will be checked whether the task is valid. If not, the task isn't executed anymore. For example, if a task depends on a connection and the connection closes before the task is executed, this method should return false which leads to drop the task out of the pool without executing it.- Returns:
- true/false.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-