|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.common.distribute.Synchronizer
public class Synchronizer
Converts an asynchronous call to a synchronous call. The method sendAndWaitForOneReply() is a blocking call which responds when a reply is received or returns null on timeout.
Constructor Summary | |
---|---|
Synchronizer()
Initialise maps containing requests and replies. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Synchronizer()
Method Detail |
---|
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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |