|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.qpid.test.framework.MessageMonitor
public class MessageMonitor
MessageMonitor is used to record information about messages received. This will provide methods to check various properties, such as the type, number and content of messages received in order to verify the correct behaviour of tests.
Responsibilities | Collaborations |
---|---|
Count incoming messages. | |
Record time ellapsed since the arrival of the first message. | |
Reset all counts and timings. |
Field Summary | |
---|---|
protected Long |
firstMessageTime
Holds the time of arrival of the first message. |
protected AtomicInteger |
numMessages
Holds the count of messages received since the last query. |
Constructor Summary | |
---|---|
MessageMonitor()
|
Method Summary | |
---|---|
int |
getNumMessage()
Gets the count of messages. |
long |
getTime()
Gets the time elapsed since the first message arrived, in nanos, or zero if no messages have arrived yet. |
void |
onMessage(Message message)
Handles received messages. |
void |
reset()
Resets the message count and timer to zero. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected AtomicInteger numMessages
protected Long firstMessageTime
Constructor Detail |
---|
public MessageMonitor()
Method Detail |
---|
public void onMessage(Message message)
onMessage
in interface MessageListener
message
- The message. Ignored.public int getNumMessage()
public long getTime()
public void reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |