User: kimptoc 
  Date: 01/04/01 12:34:02

  Added:       src/main/javax/jms QueueRequestor.java TopicRequestor.java
  Log:
  added jms helper classes - queue requestor is still incomplete
  
  Revision  Changes    Path
  1.1                  jboss-j2ee/src/main/javax/jms/QueueRequestor.java
  
  Index: QueueRequestor.java
  ===================================================================
  /*
   * JBoss, the OpenSource EJB server
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  
  package javax.jms;
  
  /**
    *
    * @author Chris Kimpton ([EMAIL PROTECTED])
    * @version $Revision: 1.1 $
   **/
  public class QueueRequestor
  {
      // CONSTRUCTOR ------------------------------------------
  
      public QueueRequestor(QueueSession session,
                            Queue queue) throws JMSException
      {
          _queueSession = session;
          _queue = queue;
      }
  
      // PUBLIC METHODS ------------------------------------------
  
      public Message request(Message message) throws JMSException
      {
          // FIXME
          return null;
      }
  
      public void close() throws JMSException
      {
          // FIXME
      }
  
      // INSTANCE VARIABLES ----------------------------------------
  
      private QueueSession _queueSession = null;
      private Queue _queue = null;
  
  }
  
  
  
  1.1                  jboss-j2ee/src/main/javax/jms/TopicRequestor.java
  
  Index: TopicRequestor.java
  ===================================================================
  /*
   * JBoss, the OpenSource EJB server
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  
  package javax.jms;
  
  /**
    * Provides a basic request/reply layer ontop of JMS.
    * Pass the constructor details of the session/topic to send requests upon.
    * Then call the request method to send a request.  The method will block
    * until the reply is received.
    *
    * @author Chris Kimpton ([EMAIL PROTECTED])
    * @version $Revision: 1.1 $
   **/
  public class TopicRequestor
  {
      // CONSTRUCTOR -----------------------------------------
  
  
      public TopicRequestor(TopicSession session,
                            Topic topic) throws JMSException
      {
          _topicSession = session;
          _topic = topic;
          _requestPublisher   = _topicSession.createPublisher(_topic);
          _responseTopic      = _topicSession.createTemporaryTopic();
          _responseSubscriber = _topicSession.createSubscriber(_responseTopic);
      }
  
      // METHODS -------------------------------------------------
  
      public Message request(Message message) throws JMSException
      {
          message.setJMSReplyTo(_responseTopic);
          _requestPublisher.publish(message);
          return _responseSubscriber.receive();
      }
  
      public void close() throws JMSException
      {
          _requestPublisher.close();
          _responseSubscriber.close();
      }
  
  
      // INSTANCE VARIABLES -------------------------------------
  
      private TopicSession _topicSession = null;
      private Topic _topic = null;
      private TopicPublisher _requestPublisher = null;
      private TemporaryTopic _responseTopic = null;
      private TopicSubscriber _responseSubscriber = null;
  }
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to