Package javax.jms

Examples of javax.jms.Queue


   */
  public QueueReceiver getReceiver(XBUSSystem system) throws XException {
    QueueReceiver receiver = null;

    String pyhsQueuename = getPhysQueuename(system);
    Queue queue = getQueue(pyhsQueuename);
    try {
      if ((receiver = (QueueReceiver) mReceivers.get(pyhsQueuename)) == null) {
        receiver = mSession.createReceiver(queue);
        mReceivers.put(pyhsQueuename, receiver);
      }
View Full Code Here


   */
  public QueueBrowser getBrowser(XBUSSystem system) throws XException {
    QueueBrowser browser = null;

    String pyhsQueuename = getPhysQueuename(system);
    Queue queue = getQueue(pyhsQueuename);
    try {
      if ((browser = (QueueBrowser) mBrowsers.get(pyhsQueuename)) == null) {
        browser = mSession.createBrowser(queue);
        mBrowsers.put(pyhsQueuename, browser);
      }
View Full Code Here

          "0", e);
    }
  }

  private Queue getQueue(String physQueuename) throws XException {
    Queue queue = (Queue) mQueues.get(physQueuename);
    if (queue == null) {
      try {
        if (Configuration.getInstance().getValue("Connection", "MQ",
            "ContextFactory").contains("activemq")) {
          /*
 
View Full Code Here

      InitialContext initialContext = new InitialContext(ServerManagement.getJNDIEnvironment());
      ConnectionFactory cf = (JBossConnectionFactory)initialContext.lookup("/ConnectionFactory");

      ServerManagement.deployQueue("Queue", 10000, 1000, 1000);
     
      Queue queue = (Queue)initialContext.lookup("/queue/Queue");
     
      Connection conn = cf.createConnection();

      Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

      InitialContext initialContext = new InitialContext(ServerManagement.getJNDIEnvironment());
      ConnectionFactory cf = (JBossConnectionFactory)initialContext.lookup("/ConnectionFactory");

      ServerManagement.deployQueue("Queue", 10000, 1000, 1000);
     
      Queue queue = (Queue)initialContext.lookup("/queue/Queue");
     
      Connection conn = cf.createConnection();

      Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

         // lookup the connection factory and the queue which we'll send to the client VM via a
         // serialized instances saved in file

         InitialContext ic = new InitialContext(ServerManagement.getJNDIEnvironment());
         ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
         Queue queue = (Queue)ic.lookup("/queue/Queue");

         serialized = writeToFile(cf, queue);

         // spawn a JVM that creates a JMS client, which sends a test message
View Full Code Here

   // Public --------------------------------------------------------

   public void testMultipleSenders() throws Exception
   {
      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
      Queue queue = (Queue)ic.lookup("/queue/StressTestQueue");
      drainDestination(cf, queue);

      Connection conn = cf.createConnection();

      Session[] sessions = new Session[PRODUCER_COUNT];
View Full Code Here

      ServerManagement.deployQueue("SomeQueue");
      Connection conn = null;

      try
      {
         Queue someQueue = (Queue)ic.lookup("/queue/SomeQueue");

         conn = cf.createConnection("john", "needle");
         assertTrue(canReadDestination(conn, someQueue));
         assertTrue(canWriteDestination(conn, someQueue));
View Full Code Here

         // configure the topic to prevent "def" from reading
         config = "<security><role name=\"def\" read=\"false\" write=\"false\" create=\"false\"/></security>";
         on = new ObjectName("jboss.messaging.destination:service=Topic,name=Accounting");
         ServerManagement.setAttribute(on, "SecurityConfig", config);

         Queue queue = (Queue)ic.lookup("/queue/Accounting");
         Topic topic = (Topic)ic.lookup("/topic/Accounting");

         conn = cf.createConnection("john", "needle");

         assertTrue(canReadDestination(conn, queue));
View Full Code Here

   }


   public void testGetQueue() throws Exception
   {
      Queue q = ((QueueReceiver)queueConsumer).getQueue();
      assertEquals(queue, q);
   }
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.