|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--org.exolab.jmscts.core.ThreadedAction | +--org.exolab.jmscts.core.ThreadedReceiver
Helper class which performs message receipt in a separate thread
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
ThreadedReceiver(MessageReceiver receiver,
int count,
long timeout)
Construct a new ThreadedReceiver , for synchronous receipt |
|
ThreadedReceiver(MessageReceiver receiver,
int count,
long timeout,
CompletionListener completion)
Construct a new ThreadedReceiver , for synchronous receipt |
|
ThreadedReceiver(MessageReceiver receiver,
int count,
long timeout,
CountingListener listener,
CompletionListener completion)
Construct a new ThreadedReceiver , for asynchronous receipt |
|
ThreadedReceiver(MessageReceiver receiver,
long timeout,
CountingListener listener)
Construct a new ThreadedReceiver , for asynchronous receipt |
Method Summary | |
java.util.List |
getMessages()
The received messages, when synchronous receipt is used |
void |
runProtected()
Run the action |
Methods inherited from class org.exolab.jmscts.core.ThreadedAction |
getElapsedTime, getException, run, setException, waitForCompletion, waitForCompletion |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ThreadedReceiver(MessageReceiver receiver, int count, long timeout)
ThreadedReceiver
, for synchronous receiptreceiver
- the message receivercount
- the expected no. of messages to receivetimeout
- the maximum time to wait for each message. If set to 0,
then it waits until a message becomes available.public ThreadedReceiver(MessageReceiver receiver, int count, long timeout, CompletionListener completion)
ThreadedReceiver
, for synchronous receiptreceiver
- the message receivercount
- the expected no. of messages to receivetimeout
- the maximum time to wait for each message. If set to 0,
then it waits until a message becomes available.completion
- the listener to notify on completionpublic ThreadedReceiver(MessageReceiver receiver, long timeout, CountingListener listener)
ThreadedReceiver
, for asynchronous receiptreceiver
- the message receivertimeout
- the maximum time to wait for each message. If set to 0,
then it waits until a message becomes available.listener
- the listener to handle received messagespublic ThreadedReceiver(MessageReceiver receiver, int count, long timeout, CountingListener listener, CompletionListener completion)
ThreadedReceiver
, for asynchronous receiptreceiver
- the message receivercount
- the expected no. of messages to receivetimeout
- the maximum time to wait for each message. If set to 0,
then it waits until a message becomes available.listener
- the listener to handle received messagescompletion
- the listener to notify on completionMethod Detail |
public java.util.List getMessages()
null
if no message has been received or this hasn't
completedpublic void runProtected() throws java.lang.Exception
runProtected
in class ThreadedAction
java.lang.Exception
- for any error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |