Joram 5.2.6

org.objectweb.joram.client.jms.admin
Class AdminRequestor

java.lang.Object
  extended by org.objectweb.joram.client.jms.admin.AdminRequestor

public final class AdminRequestor
extends java.lang.Object

The AdminRequestor class allows making administration service requests. The AdminRequestor constructor is given a Connection, it creates a session and a TemporaryTopic for the responses. It provides a request method that sends the request message to the administration topic of the connected server and waits for its reply.

See Also:
AdminWrapper

Field Summary
static long DEFAULT_REQUEST_TIMEOUT
          Defines the default value for timeout before aborting a request.
static org.objectweb.util.monolog.api.Logger logger
           
static java.lang.String REQUEST_TIMEOUT_PROP
          Property allowing to set the timeout before aborting a request.
 
Constructor Summary
AdminRequestor(javax.jms.Connection cnx)
          Constructor for the AdminRequestor class.
 
Method Summary
 void abort()
          Aborts the running request.
 void close()
          Closes the AdminRequestor and its session.
 long getRequestTimeout()
          Returns the maximum time in ms before aborting a request.
 AdminReply request(AdminRequest request)
          Sends an administration request and waits for a reply.
 void setRequestTimeout(long requestTimeout)
          Set the maximum time in ms before aborting arequest.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REQUEST_TIMEOUT_PROP

public static final java.lang.String REQUEST_TIMEOUT_PROP
Property allowing to set the timeout before aborting a request.

See Also:
requestTimeout, Constant Field Values

DEFAULT_REQUEST_TIMEOUT

public static final long DEFAULT_REQUEST_TIMEOUT
Defines the default value for timeout before aborting a request.

Default value is 60.000 ms.

See Also:
requestTimeout, Constant Field Values

logger

public static org.objectweb.util.monolog.api.Logger logger
Constructor Detail

AdminRequestor

public AdminRequestor(javax.jms.Connection cnx)
               throws javax.jms.JMSException
Constructor for the AdminRequestor class. This implementation assumes an unified connection and uses a non-transacted session with an AUTO_ACKNOWLEDGE delivery mode. The Connection needs to be started.

Parameters:
cnx - A Joram connection.
Throws:
javax.jms.JMSException - if Joram fails to create the AdminRequestor due to some internal error.
Method Detail

setRequestTimeout

public void setRequestTimeout(long requestTimeout)
Set the maximum time in ms before aborting arequest.

Parameters:
requestTimeout - the maximum time in ms before aborting request.

getRequestTimeout

public long getRequestTimeout()
Returns the maximum time in ms before aborting a request.

Returns:
the maximum time in ms before aborting request.

request

public AdminReply request(AdminRequest request)
                   throws AdminException,
                          java.net.ConnectException
Sends an administration request and waits for a reply. A temporary topic is used for the JMSReplyTo destination and the request JMSMessageID as JMSCorrelationID to select the corresponding reply; any other replies are discarded.

Parameters:
request - the administration request to send
Returns:
the reply message
Throws:
javax.jms.JMSException - if Joram fails to complete the request due to some internal error.
AdminException
java.net.ConnectException

abort

public void abort()
           throws java.net.ConnectException
Aborts the running request.

Throws:
ConnectConnection - A problem occurs with the connection.
java.net.ConnectException

close

public void close()
Closes the AdminRequestor and its session. All internals allocated resources are closed and freed. Note that this method does not close the Connection object passed to the AdminRequestor constructor.


Joram 5.2.6

Copyright © 2000 - 2009 Scalagent D.T. - All rights reserved