Package javax.jms

Examples of javax.jms.Queue


  public static void main(String[] args) throws Exception {
    System.out.println();
    System.out.println("update properties on the collector queue...");

    ictx = new InitialContext();
    Queue queue = (Queue) ictx.lookup("queue");
//    Topic topic = (Topic) ictx.lookup("topic");
    ConnectionFactory cf = (ConnectionFactory) ictx.lookup("cf");
    ictx.close();

    Connection cnx = cf.createConnection();
View Full Code Here


  public static void main(String[] args) throws Exception {
    System.out.println();
    System.out.println("Queries to the monitoring queue...");

    Context ictx = new InitialContext();
    Queue queue = (Queue) ictx.lookup("MonitoringQueue");
    ConnectionFactory cf = (ConnectionFactory) ictx.lookup("cf");
    ictx.close();

    Connection cnx = cf.createConnection();
    Session sess = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

        try
        {
            ic = new InitialContext(  );

            Queue                  queue = ( Queue ) ic.lookup( queueName );

            QueueConnectionFactory factory = ( QueueConnectionFactory ) ic.lookup( JNDINames.QUEUE_CONNECTION_FACTORY );
            cnn     = factory.createQueueConnection(  );
            session = cnn.createQueueSession( transacted, QueueSession.AUTO_ACKNOWLEDGE );
View Full Code Here

          catch (Exception te) {
          }
        }
        logger.info(getConsumerName() + " - Handling Request number: " +
                    messageCount);
        Queue replyQueue = (Queue)m.getJMSReplyTo();
        if (replyQueue != null) {
          // RequestTransaction will process the incoming message and
          // return a response.
          if (getThreadPool() != null) {
            boolean keepTrying = true;
View Full Code Here

                    m_inProcessMessages.size() +
                    " messages that were in progress when shutdown was started.");
        for (int i = 0; i < m_inProcessMessages.size(); i++) {
          Message msg = (Message)m_inProcessMessages.get(i);
          try {
            Queue replyQueue = (Queue)msg.getJMSReplyTo();
            if (replyQueue != null) {
              QueueSender m_replier = m_queueSession.createSender(null);
              new RequestTransaction(0, msg, m_replier, replyQueue).run();
            }
            else {
View Full Code Here

    }


    protected void subscribeToQueue(JmsServiceExporter exporter, String queueName) throws JMSException {
        Session serverSession = createSession();
        Queue queue = serverSession.createQueue(queueName);
        MessageConsumer consumer = serverSession.createConsumer(queue);
        consumer.setMessageListener(exporter);
    }
View Full Code Here

       
        if (!context.isOneWay()) {
            if (queueDestinationStyle) {
                try {
//                  send reply
                    Queue replyTo = getReplyToDestination(context, message);
                    replySession = sessionFactory.get(false);

                    Message reply = marshalResponse(message, context, replySession);
                    setReplyCorrelationID(message, reply);                                     
View Full Code Here

        }
    }
   
    public Queue getReplyToDestination(OutputStreamMessageContext context, Message message)
        throws JMSException, NamingException {
        Queue replyTo;
        //      If WS-Addressing had set the replyTo header.
        if  (context.get(JMSConstants.JMS_REBASED_REPLY_TO) != null) {
            replyTo = sessionFactory.getQueueFromInitialContext(
                                  (Stringcontext.get(JMSConstants.JMS_REBASED_REPLY_TO));
        } else {
View Full Code Here

                    //
                    ret = sendOnlySessionCache.poll();

                    if (ret != null) {
                        QueueSession session = (QueueSession)ret.session();
                        Queue destination = null;
                        String selector = null;
                       
                        if (null != theReplyDestination || null != replyDest) {
                            destination = null != replyDest ? (Queue) replyDest : (Queue)theReplyDestination;
                           
View Full Code Here

   */
  public QueueSender getSender(XBUSSystem system) throws XException {
    QueueSender sender = null;

    String pyhsQueuename = getPhysQueuename(system);
    Queue queue = getQueue(pyhsQueuename);

    try {
      if ((sender = (QueueSender) mSenders.get(pyhsQueuename)) == null) {
        sender = mSession.createSender(queue);
        sender.setDeliveryMode(DeliveryMode.PERSISTENT);
View Full Code Here

TOP

Related Classes of javax.jms.Queue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.