public final class AdminRequestor extends Object
AdminWrapper
Modifier and Type | Field and Description |
---|---|
private MessageConsumer |
consumer |
static long |
DEFAULT_REQUEST_TIMEOUT
Defines the default value for timeout before aborting a request.
|
static Logger |
logger |
private MessageProducer |
producer |
static String |
REQUEST_TIMEOUT_PROP
Property allowing to set the timeout before aborting a request.
|
private long |
requestTimeout
Defines the maximum time in milliseconds before aborting a request.
|
private Session |
session |
private TemporaryTopic |
tmpTopic |
private Topic |
topic |
Constructor and Description |
---|
AdminRequestor(Connection cnx)
Constructor for the AdminRequestor class.
|
Modifier and Type | Method and Description |
---|---|
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.
|
private void |
throwException(AdminReply reply)
Throws an exception corresponding to the error code of the reply if needed.
|
private Session session
private Topic topic
private TemporaryTopic tmpTopic
private MessageProducer producer
private MessageConsumer consumer
public static final String REQUEST_TIMEOUT_PROP
requestTimeout
,
Constant Field Valuespublic static final long DEFAULT_REQUEST_TIMEOUT
Default value is 60.000 ms.
requestTimeout
,
Constant Field Valuesprivate long requestTimeout
Default value is 60.000 ms.
This value can be adjusted by setting
org.objectweb.joram.client.jms.admin.requestTimeout
property.
DEFAULT_REQUEST_TIMEOUT
,
REQUEST_TIMEOUT_PROP
public static Logger logger
public AdminRequestor(Connection cnx) throws JMSException
cnx
- A Joram connection.JMSException
- if Joram fails to create the AdminRequestor due to some internal error.public void setRequestTimeout(long requestTimeout)
requestTimeout
- the maximum time in ms before aborting request.public long getRequestTimeout()
public AdminReply request(AdminRequest request) throws AdminException, ConnectException
JMSReplyTo
destination and the request
JMSMessageID
as JMSCorrelationID
to select the corresponding
reply; any other replies are discarded.request
- the administration request to sendAdminException
- internal error.ConnectException
- network error.private final void throwException(AdminReply reply) throws AdminException
reply
- The reply to verify.AdminException
- The exception corresponding to the error code in the reply.public void abort() throws ConnectException
ConnectException
- A problem occurs with the connection.public void close()
Copyright © 2023 ScalAgent D.T.. All rights reserved.