public class ClientRequestor extends java.lang.Object
Constructor and Description |
---|
ClientRequestor(ClientSession session,
SimpleString requestAddress)
Constructor for the ClientRequestor.
|
ClientRequestor(ClientSession session,
java.lang.String requestAddress) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the ClientRequestor and its session.
|
ClientMessage |
request(ClientMessage request)
Sends a message to the request address and wait indefinitely for a reply.
|
ClientMessage |
request(ClientMessage request,
long timeout)
Sends a message to the request address and wait for the given timeout for a reply.
|
public ClientRequestor(ClientSession session, SimpleString requestAddress) throws java.lang.Exception
session
- a ClientSession uses to handle requests and repliesrequestAddress
- the address to send request messages tojava.lang.Exception
public ClientRequestor(ClientSession session, java.lang.String requestAddress) throws java.lang.Exception
java.lang.Exception
ClientRequestor(ClientSession, SimpleString)
public ClientMessage request(ClientMessage request) throws java.lang.Exception
request
- the message to sendjava.lang.Exception
public ClientMessage request(ClientMessage request, long timeout) throws java.lang.Exception
request
- the message to sendtimeout
- the timeout to wait for a reply (in milliseconds)null
if no message is replied before the timeout elapsesjava.lang.Exception
public void close() throws java.lang.Exception
java.lang.Exception
- if an exception occurs while closing the ClientRequestorCopyright © 2009 Red Hat Inc. All Rights Reserved.