public class MessageAdmin extends Object
| Modifier and Type | Method | Description |
|---|---|---|
Message |
get(String id) |
Get the reply message.
|
static MessageAdmin |
getAdmin() |
Get the singleton MessageAdmin object
|
void |
putReply(String id,
Message reply) |
Try to associate a reply to a previously stored request.
|
void |
putRequest(String id,
Message request,
CountDownLatch latch) |
Store a request under the given id, so that an arriving reply can be
associated with this request and the waiting party can be signaled by
means of a
CountDownLatch |
public static MessageAdmin getAdmin()
public void putRequest(String id, Message request, CountDownLatch latch)
CountDownLatchid - id of the requestrequest - request object to store under idlatch - communication latch to signal when a reply for this request
was receivedpublic void putReply(String id, Message reply)
CountDownLatchid - id of the requestreply - object with the replypublic Message get(String id)
id - the id of the messagenullCopyright © 1998-2018 Apache Software Foundation. All Rights Reserved.