public class Requestor extends Object implements ReplyListener, ErrorListener
Modifier and Type | Class and Description |
---|---|
private static class |
Requestor.Status |
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_REQUEST_TIMEOUT_PROPERTY |
static long |
DEFAULT_REQUEST_TIMEOUT_VALUE |
private long |
defaultRequestTimeout |
private static org.objectweb.util.monolog.api.Logger |
logger |
private RequestMultiplexer |
mtpx |
private Object |
reply |
private int |
requestId |
private int |
status |
Constructor and Description |
---|
Requestor(RequestMultiplexer mtpx) |
Modifier and Type | Method and Description |
---|---|
void |
abortRequest() |
void |
close() |
void |
errorReceived(int replyId,
MomExceptionReply exc) |
int |
getRequestId() |
private void |
init() |
void |
replyAborted(int replyId) |
boolean |
replyReceived(AbstractJmsReply reply) |
AbstractJmsReply |
request(AbstractJmsRequest request) |
AbstractJmsReply |
request(AbstractJmsRequest request,
CompletionListener completionListener) |
AbstractJmsReply |
request(AbstractJmsRequest request,
long timeout,
CompletionListener completionListener)
Method sending a synchronous request to the server and waiting for an
answer.
|
private void |
setStatus(int status) |
void |
start() |
void |
stop() |
private static org.objectweb.util.monolog.api.Logger logger
public static final String DEFAULT_REQUEST_TIMEOUT_PROPERTY
public static final long DEFAULT_REQUEST_TIMEOUT_VALUE
private long defaultRequestTimeout
private RequestMultiplexer mtpx
private Object reply
private int requestId
private int status
public Requestor(RequestMultiplexer mtpx)
private void setStatus(int status)
public final int getRequestId()
private void init()
public AbstractJmsReply request(AbstractJmsRequest request) throws JMSException
JMSException
public AbstractJmsReply request(AbstractJmsRequest request, CompletionListener completionListener) throws JMSException
JMSException
public AbstractJmsReply request(AbstractJmsRequest request, long timeout, CompletionListener completionListener) throws JMSException
IllegalStateException
- If the connection is closed or broken,
if the server state does not allow to
process the request.JMSSecurityException
- When sending a request to a destination
not accessible because of security.InvalidDestinationException
- When sending a request to a
destination that no longer exists.JMSException
- If the request failed for any other reason.public boolean replyReceived(AbstractJmsReply reply) throws AbortedRequestException
replyReceived
in interface ReplyListener
AbortedRequestException
public void errorReceived(int replyId, MomExceptionReply exc)
errorReceived
in interface ErrorListener
errorReceived
in interface ReplyListener
public void replyAborted(int replyId)
replyAborted
in interface ReplyListener
public void abortRequest()
public void close()
public void start()
public void stop()
Copyright © 2016 ScalAgent D.T.. All Rights Reserved.