org.logicblaze.lingo.jms.impl
Class SingleThreadedRequestor

java.lang.Object
  extended byorg.logicblaze.lingo.jms.impl.OneWayRequestor
      extended byorg.logicblaze.lingo.jms.impl.SingleThreadedRequestor
All Implemented Interfaces:
Requestor
Direct Known Subclasses:
MultiplexingRequestor

public class SingleThreadedRequestor
extends OneWayRequestor

A simple Requestor which can only be used by one thread at once and only used for one message exchange at once.

Version:
$Revision: 1.3 $

Constructor Summary
SingleThreadedRequestor(Session session, JmsProducer producer, Destination serverDestination)
           
SingleThreadedRequestor(Session session, JmsProducer producer, Destination serverDestination, Destination clientDestination)
           
 
Method Summary
 void close()
          Closes the Requestor and its session.
protected  TemporaryQueue createTemporaryDestination(Session session)
           
protected  MessageConsumer getReceiver()
           
static Requestor newInstance(ConnectionFactory connectionFactory, Destination serverDestination)
           
protected  void populateHeaders(Message message)
           
 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.
 
Methods inherited from class org.logicblaze.lingo.jms.impl.OneWayRequestor
createCorrelationID, doSend, getDeliveryMode, getPriority, getSession, getTimeToLive, nextCounter, oneWay, oneWay, setDeliveryMode, setPriority, setTimeToLive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleThreadedRequestor

public SingleThreadedRequestor(Session session,
                               JmsProducer producer,
                               Destination serverDestination,
                               Destination clientDestination)
                        throws JMSException

SingleThreadedRequestor

public SingleThreadedRequestor(Session session,
                               JmsProducer producer,
                               Destination serverDestination)
                        throws JMSException
Method Detail

newInstance

public static Requestor newInstance(ConnectionFactory connectionFactory,
                                    Destination serverDestination)
                             throws JMSException
Throws:
JMSException

request

public Message request(Destination destination,
                       Message message)
                throws JMSException
Description copied from interface: Requestor
Sends a request and waits for a reply. The temporary queue is used for the JMSReplyTo destination, and only one reply per request is expected.

Specified by:
request in interface Requestor
Overrides:
request in class OneWayRequestor
Throws:
JMSException

request

public Message request(Destination destination,
                       Message message,
                       long timeout)
                throws JMSException
Description copied from interface: Requestor
Sends a request and waits for a reply up to a maximum timeout. The temporary queue is used for the JMSReplyTo destination, and only one reply per request is expected.

Specified by:
request in interface Requestor
Overrides:
request in class OneWayRequestor
Throws:
JMSException

receive

public Message receive(long timeout)
                throws JMSException
Description copied from interface: Requestor
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

Specified by:
receive in interface Requestor
Overrides:
receive in class OneWayRequestor
Throws:
JMSException

close

public void close()
           throws JMSException
Description copied from interface: Requestor
Closes the 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.

Specified by:
close in interface Requestor
Overrides:
close in class OneWayRequestor
Throws:
JMSException

createTemporaryDestination

protected TemporaryQueue createTemporaryDestination(Session session)
                                             throws JMSException
Throws:
JMSException

populateHeaders

protected void populateHeaders(Message message)
                        throws JMSException
Overrides:
populateHeaders in class OneWayRequestor
Throws:
JMSException

getReceiver

protected MessageConsumer getReceiver()


Copyright © 2005 LogicBlaze, Inc.. All Rights Reserved.