public class Synchronizer extends Object implements javax.jms.MessageListener
Constructor and Description |
---|
Synchronizer()
Initialise maps containing requests and replies.
|
Modifier and Type | Method and Description |
---|---|
void |
onMessage(javax.jms.Message msg)
Receives replies from a message queue and triggers the blocked call in sendAndWaitForOneReply().
|
NetarkivetMessage |
sendAndWaitForOneReply(NetarkivetMessage msg,
long timeout)
Sends a message to a message queue and blocks the method invocation until a reply arrives.
|
public Synchronizer()
public void onMessage(javax.jms.Message msg)
onMessage
in interface javax.jms.MessageListener
msg
- an ObjectMessage containing a NetarkivetMessage.public NetarkivetMessage sendAndWaitForOneReply(NetarkivetMessage msg, long timeout)
msg
- the request messagetimeout
- the timeout in milliseconds (or zero for no timeout)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.