Package javax.jms

Examples of javax.jms.ServerSessionPool


   * @throws JMSException if creation of the ServerSessionPool failed
   * @see #setServerSessionFactory
   * @see ServerSessionFactory#getServerSession(ListenerSessionManager)
   */
  protected ServerSessionPool createServerSessionPool() throws JMSException {
    return new ServerSessionPool() {
      public ServerSession getServerSession() throws JMSException {
        logger.debug("JMS ConnectionConsumer requests ServerSession");
        return getServerSessionFactory().getServerSession(ServerSessionMessageListenerContainer.this);
      }
    };
View Full Code Here


      QueueSender sender = session.createSender(testQueue);
      sender.send(session.createTextMessage("Hi"));
      sender.send(session.createTextMessage("There"));
      sender.send(session.createTextMessage("Guys"));
      queueConnection.createConnectionConsumer(testQueue, null, new ServerSessionPool()
      {
         public ServerSession getServerSession()
         {
            Logger.getLogger(getClass().getName()).debug("Getting server session.");
            return new ServerSession()
View Full Code Here

      }
      finally {
        JmsUtils.closeSession(session);
      }
    }
    ServerSessionPool pool = createServerSessionPool();
    this.consumer = createConsumer(con, destination, pool);
  }
View Full Code Here

   * @throws JMSException if creation of the ServerSessionPool failed
   * @see #setServerSessionFactory
   * @see ServerSessionFactory#getServerSession(ListenerSessionManager)
   */
  protected ServerSessionPool createServerSessionPool() throws JMSException {
    return new ServerSessionPool() {
      public ServerSession getServerSession() throws JMSException {
        logger.debug("JMS ConnectionConsumer requests ServerSession");
        return getServerSessionFactory().getServerSession(ServerSessionMessageListenerContainer.this);
      }
    };
View Full Code Here

      }
      finally {
        JmsUtils.closeSession(session);
      }
    }
    ServerSessionPool pool = createServerSessionPool();
    this.consumer = createConsumer(con, destination, pool);
  }
View Full Code Here

   * @throws JMSException if creation of the ServerSessionPool failed
   * @see #setServerSessionFactory
   * @see ServerSessionFactory#getServerSession(ListenerSessionManager)
   */
  protected ServerSessionPool createServerSessionPool() throws JMSException {
    return new ServerSessionPool() {
      public ServerSession getServerSession() throws JMSException {
        logger.debug("JMS ConnectionConsumer requests ServerSession");
        return getServerSessionFactory().getServerSession(ServerSessionMessageListenerContainer.this);
      }
    };
View Full Code Here

        Session session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
        Queue destination = session.createQueue(QUEUE_NAME);

        final CountDownLatch connectionConsumerGotOne = new CountDownLatch(1);
        final Session poolSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        connection.createConnectionConsumer(destination, null, new ServerSessionPool() {
            public ServerSession getServerSession() throws JMSException {
                return new ServerSession() {
                    public Session getSession() throws JMSException {
                        return poolSession;
                    }
View Full Code Here

        Session session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
        Queue destination = session.createQueue(QUEUE_NAME);

        final CountDownLatch connectionConsumerGotOne = new CountDownLatch(1);
        final Session poolSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        connection.createConnectionConsumer(destination, null, new ServerSessionPool() {
            public ServerSession getServerSession() throws JMSException {
                return new ServerSession() {
                    public Session getSession() throws JMSException {
                        return poolSession;
                    }
View Full Code Here

      MethodInvocation mi = (MethodInvocation)invocation;
     
      JBossDestination dest = (JBossDestination)mi.getArguments()[0];
      String subscriptionName = (String)mi.getArguments()[1];
      String messageSelector = (String)mi.getArguments()[2];
      ServerSessionPool sessionPool = (ServerSessionPool)mi.getArguments()[3];
      int maxMessages = ((Integer)mi.getArguments()[4]).intValue();
     
      return new JBossConnectionConsumer((ConnectionDelegate)mi.getTargetObject(), dest,
                                         subscriptionName, messageSelector, sessionPool,
                                         maxMessages);
View Full Code Here

         xaconn.start();
         XASession xasession = xaconn.createXASession();
         DummyListener listener = new DummyListener();
         xasession.setMessageListener(listener);

         ServerSessionPool pool = new MockServerSessionPool(xasession);

         xaconn.createConnectionConsumer(queue1, null, pool, 1);

         Thread.sleep(1000);
         assertEquals(1, listener.messages.size());
View Full Code Here

TOP

Related Classes of javax.jms.ServerSessionPool

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.