Class Requestor
- java.lang.Object
-
- org.ow2.joram.jakarta.jms.connection.Requestor
-
- All Implemented Interfaces:
ErrorListener,ReplyListener
public class Requestor extends Object implements ReplyListener, ErrorListener
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classRequestor.Status
-
Field Summary
Fields Modifier and Type Field Description private static booleanDEBUGstatic StringDEFAULT_REQUEST_TIMEOUT_PROPERTYstatic longDEFAULT_REQUEST_TIMEOUT_VALUEprivate longdefaultRequestTimeoutprivate static Loggerloggerprivate RequestMultiplexermtpxprivate Objectreplyprivate intrequestIdprivate intstatus
-
Constructor Summary
Constructors Constructor Description Requestor(RequestMultiplexer mtpx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabortRequest()voidclose()voiderrorReceived(int replyId, MomExceptionReply exc)intgetRequestId()private voidinit()voidreplyAborted(int replyId)booleanreplyReceived(AbstractJmsReply reply)AbstractJmsReplyrequest(AbstractJmsRequest request)AbstractJmsReplyrequest(AbstractJmsRequest request, long timeout, CompletionListener completionListener)Method sending a synchronous request to the server and waiting for an answer.AbstractJmsReplyrequest(AbstractJmsRequest request, CompletionListener completionListener)private voidsetStatus(int status)voidstart()voidstop()
-
-
-
Field Detail
-
logger
private static Logger logger
-
DEBUG
private static final boolean DEBUG
-
DEFAULT_REQUEST_TIMEOUT_PROPERTY
public static final String DEFAULT_REQUEST_TIMEOUT_PROPERTY
- See Also:
- Constant Field Values
-
DEFAULT_REQUEST_TIMEOUT_VALUE
public static final long DEFAULT_REQUEST_TIMEOUT_VALUE
- See Also:
- Constant Field Values
-
defaultRequestTimeout
private long defaultRequestTimeout
-
mtpx
private RequestMultiplexer mtpx
-
reply
private Object reply
-
requestId
private int requestId
-
status
private int status
-
-
Constructor Detail
-
Requestor
public Requestor(RequestMultiplexer mtpx)
-
-
Method Detail
-
setStatus
private void setStatus(int status)
-
getRequestId
public final int getRequestId()
-
init
private void init()
-
request
public AbstractJmsReply request(AbstractJmsRequest request) throws jakarta.jms.JMSException
- Throws:
jakarta.jms.JMSException
-
request
public AbstractJmsReply request(AbstractJmsRequest request, CompletionListener completionListener) throws jakarta.jms.JMSException
- Throws:
jakarta.jms.JMSException
-
request
public AbstractJmsReply request(AbstractJmsRequest request, long timeout, CompletionListener completionListener) throws jakarta.jms.JMSException
Method sending a synchronous request to the server and waiting for an answer.- Throws:
IllegalStateException- If the connection is closed or broken, if the server state does not allow to process the request.jakarta.jms.JMSSecurityException- When sending a request to a destination not accessible because of security.jakarta.jms.InvalidDestinationException- When sending a request to a destination that no longer exists.jakarta.jms.JMSException- If the request failed for any other reason.
-
replyReceived
public boolean replyReceived(AbstractJmsReply reply) throws AbortedRequestException
- Specified by:
replyReceivedin interfaceReplyListener- Returns:
- whether the request must be aborted or not.
- Throws:
AbortedRequestException
-
errorReceived
public void errorReceived(int replyId, MomExceptionReply exc)- Specified by:
errorReceivedin interfaceErrorListener- Specified by:
errorReceivedin interfaceReplyListener
-
replyAborted
public void replyAborted(int replyId)
- Specified by:
replyAbortedin interfaceReplyListener
-
abortRequest
public void abortRequest()
-
close
public void close()
-
start
public void start()
-
stop
public void stop()
-
-