|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents a JMS based requestor which is capable of performing various Message Exchange Patterns such as one-way, synchronous request-response, receive etc.
Method Summary | |
void |
close()
Closes the Requestor and its session. |
String |
createCorrelationID()
Creates a new correlation ID. |
Session |
getSession()
Provides access to the underlying JMS session so that you can create messages. |
void |
oneWay(Destination destination,
Message message)
Sends a one way message, not waiting for the response. |
Message |
receive(long timeout)
Receives a message waiting for a maximum timeout if the timeout value is > 0 ir waiting forever if the timeout is < 0 or not waiting at all if the timeout is zero |
Message |
request(Destination destination,
Message message)
Sends a request and waits for a reply. |
Message |
request(Destination destination,
Message message,
long timeout)
Sends a request and waits for a reply up to a maximum timeout. |
Method Detail |
public void oneWay(Destination destination, Message message) throws JMSException
destination
- the server side destinationmessage
- the message to send
JMSException
public Message request(Destination destination, Message message) throws JMSException
JMSReplyTo
destination, and only one reply per request
is expected.
destination
- the server side destinationmessage
- the message to send
JMSException
- if the JMS provider fails to complete the
request due to some internal error.public Message request(Destination destination, Message message, long timeout) throws JMSException
JMSReplyTo
destination, and only one reply per request
is expected.
destination
- the server side destinationmessage
- the message to send
JMSException
- if the JMS provider fails to complete the
request due to some internal error.public Message receive(long timeout) throws JMSException
JMSException
public Session getSession()
public void close() throws JMSException
Requestor
and its session.
Since a provider may allocate some resources on behalf of a
Requestor
outside the Java virtual machine, clients
should close them when they
are not needed. Relying on garbage collection to eventually reclaim
these resources may not be timely enough.
Note that this method closes the Session
object
passed to the Requestor
constructor.
JMSException
- if the JMS provider fails to close the
Requestor
due to some internal
error.public String createCorrelationID()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |