|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.logicblaze.lingo.jms.impl.OneWayRequestor
public class OneWayRequestor
A simple requestor which only supports one-way and so does not need a consumer.
| Constructor Summary | |
|---|---|
OneWayRequestor(Connection connection,
Session session,
MessageProducer producer,
Destination serverDestination,
boolean ownsConnection)
|
|
OneWayRequestor(JmsProducerConfig config,
Destination serverDestination)
|
|
| Method Summary | |
|---|---|
void |
close()
Closes the Requestor and its session. |
String |
createCorrelationID()
Creates a new correlation ID. |
void |
destroy()
|
protected void |
doSend(Destination destination,
Message message,
int deliveryMode,
int priority,
long timeToLive)
|
protected void |
doSend(Destination destination,
Message message,
long timeToLive)
|
Connection |
getConnection()
Provides access to the underlying Connection this requestor is using |
int |
getDeliveryMode()
|
MessageProducer |
getMessageProducer()
Returns the underying producer |
int |
getPriority()
|
Session |
getSession()
Provides access to the underlying JMS session so that you can create messages. |
long |
getTimeToLive()
The default time to live on request messages |
static OneWayRequestor |
newInstance(Connection connection,
JmsProducerConfig config,
boolean ownsConnection)
|
protected long |
nextCounter()
|
protected void |
populateHeaders(Message message)
A hook to allow custom implementations to process headers differently. |
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. |
void |
request(Destination destination,
Message requestMessage,
ReplyHandler handler,
long timeout)
Sends a request and provides a handler for all responses until the request is considered dead (or it is timed out). |
void |
send(Destination destination,
Message message)
Sends a one way message, not waiting for the response. |
void |
send(Destination destination,
Message message,
int deliveryMode,
int priority,
long timeToLive)
Sends a message to the given destination in a way that can be implemented in JMS 1.0.2b as well as using the JMS 1.1 send() method on MessageProducer |
void |
send(Destination destination,
Message message,
long timeToLive)
|
void |
setDeliveryMode(int deliveryMode)
Sets the default delivery mode of request messages |
void |
setPriority(int priority)
Sets the default priority of request messages |
void |
setTimeToLive(long timeToLive)
Sets the maximum time to live for requests |
protected Destination |
validateDestination(Destination destination)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OneWayRequestor(JmsProducerConfig config,
Destination serverDestination)
throws JMSException
JMSException
public OneWayRequestor(Connection connection,
Session session,
MessageProducer producer,
Destination serverDestination,
boolean ownsConnection)
| Method Detail |
|---|
public static OneWayRequestor newInstance(Connection connection,
JmsProducerConfig config,
boolean ownsConnection)
throws JMSException
JMSException
public void close()
throws JMSException
RequestorRequestor 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.
close in interface RequestorJMSException - if the JMS provider fails to close the Requestor
due to some internal error.
public void destroy()
throws Exception
destroy in interface org.springframework.beans.factory.DisposableBeanException
public void send(Destination destination,
Message message)
throws JMSException
Requestor
send in interface Requestordestination - the server side destinationmessage - the message to send
JMSException
public void send(Destination destination,
Message message,
long timeToLive)
throws JMSException
JMSException
public void send(Destination destination,
Message message,
int deliveryMode,
int priority,
long timeToLive)
throws JMSException
RequestorMessageProducer
send in interface RequestorJMSException - if the message could not be sent
public Message receive(long timeout)
throws JMSException
Requestor
receive in interface RequestorJMSException
public Message request(Destination destination,
Message message)
throws JMSException
RequestorJMSReplyTo destination, and only one reply per request
is expected.
request in interface Requestordestination - 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
RequestorJMSReplyTo destination,
and only one reply per request is expected.
request in interface Requestordestination - the server side destinationmessage - the message to send
JMSException - if the JMS provider fails to complete the request due to some
internal error.
public void request(Destination destination,
Message requestMessage,
ReplyHandler handler,
long timeout)
throws JMSException
Requestor
request in interface RequestorJMSExceptionpublic Connection getConnection()
Requestor
getConnection in interface Requestorpublic Session getSession()
Requestor
getSession in interface Requestorpublic MessageProducer getMessageProducer()
Requestor
getMessageProducer in interface Requestor
public int getDeliveryMode()
throws JMSException
JMSException
public void setDeliveryMode(int deliveryMode)
throws JMSException
JMSException
public int getPriority()
throws JMSException
JMSException
public void setPriority(int priority)
throws JMSException
JMSException
public long getTimeToLive()
throws JMSException
JMSException
public void setTimeToLive(long timeToLive)
throws JMSException
JMSException
protected void populateHeaders(Message message)
throws JMSException
JMSException
protected void doSend(Destination destination,
Message message,
long timeToLive)
throws JMSException
JMSException
protected void doSend(Destination destination,
Message message,
int deliveryMode,
int priority,
long timeToLive)
throws JMSException
JMSExceptionprotected Destination validateDestination(Destination destination)
public String createCorrelationID()
createCorrelationID in interface Requestorprotected long nextCounter()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||