org.objectweb.joram.client.jms.connection
Class Requestor

java.lang.Object
  extended by org.objectweb.joram.client.jms.connection.Requestor
All Implemented Interfaces:
ErrorListener, ReplyListener

public class Requestor
extends java.lang.Object
implements ReplyListener, ErrorListener


Nested Class Summary
private static class Requestor.Status
           
 
Field Summary
static java.lang.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  java.lang.Object reply
           
private  int requestId
           
private  int status
           
 
Constructor Summary
Requestor(RequestMultiplexer mtpx)
           
 
Method Summary
 void abortRequest()
           
 void close()
           
 void errorReceived(int replyId, javax.jms.JMSException exc)
           
 int getRequestId()
           
private  void init()
           
 void replyAborted(int replyId)
           
 boolean replyReceived(AbstractJmsReply reply)
           
 AbstractJmsReply request(AbstractJmsRequest request)
           
 AbstractJmsReply request(AbstractJmsRequest request, long timeout)
          Method sending a synchronous request to the server and waiting for an answer.
private  void setStatus(int status)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static org.objectweb.util.monolog.api.Logger logger

DEFAULT_REQUEST_TIMEOUT_PROPERTY

public static final java.lang.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 java.lang.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 javax.jms.JMSException
Throws:
javax.jms.JMSException

request

public AbstractJmsReply request(AbstractJmsRequest request,
                                long timeout)
                         throws javax.jms.JMSException
Method sending a synchronous request to the server and waiting for an answer.

Throws:
java.lang.IllegalStateException - If the connection is closed or broken, if the server state does not allow to process the request.
javax.jms.JMSSecurityException - When sending a request to a destination not accessible because of security.
javax.jms.InvalidDestinationException - When sending a request to a destination that no longer exists.
javax.jms.JMSException - If the request failed for any other reason.

replyReceived

public boolean replyReceived(AbstractJmsReply reply)
                      throws AbortedRequestException
Specified by:
replyReceived in interface ReplyListener
Returns:
whether the request must be aborted or not.
Throws:
AbortedRequestException

errorReceived

public void errorReceived(int replyId,
                          javax.jms.JMSException exc)
Specified by:
errorReceived in interface ErrorListener

replyAborted

public void replyAborted(int replyId)
Specified by:
replyAborted in interface ReplyListener

abortRequest

public void abortRequest()

close

public void close()


Copyright © 2010 ScalAgent D.T.. All Rights Reserved.