public class TestMessageListener extends Object implements javax.jms.MessageListener
Modifier and Type | Field and Description |
---|---|
protected List<NetarkivetMessage> |
received |
Constructor and Description |
---|
TestMessageListener() |
Modifier and Type | Method and Description |
---|---|
List<NetarkivetMessage> |
getAllReceived()
get a list of all messages received.
|
NetarkivetMessage |
getLastInstance(Class msgClass)
Looks up the messages that are instances of the given class.
|
int |
getNumNotOk()
Returns the number of received messages that were not ok.
|
int |
getNumOk()
Returns the number of received messages that were ok.
|
int |
getNumReceived()
Return the number of messages received so far.
|
NetarkivetMessage |
getReceived()
Get the last message received.
|
void |
onMessage(javax.jms.Message msg) |
void |
reset()
Reset the list of messages returned.
|
protected List<NetarkivetMessage> received
public TestMessageListener()
public void onMessage(javax.jms.Message msg)
onMessage
in interface javax.jms.MessageListener
public NetarkivetMessage getReceived()
IndexOutOfBoundsException
- if no messages have been received.public int getNumReceived()
public List<NetarkivetMessage> getAllReceived()
public void reset()
public int getNumOk()
public int getNumNotOk()
public NetarkivetMessage getLastInstance(Class msgClass)
msgClass
- A subclass of NetarkivetMessage, e.g. BatchMessage.class;Copyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.