Package javax.jms

Examples of javax.jms.Topic


      try
      {        
         ic = new InitialContext();
        
         ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
         Topic topic = (Topic)ic.lookup(destinationName);
         log("Topic " + destinationName + " exists");
        
         connection = cf.createConnection();
         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer publisher = session.createProducer(topic);
View Full Code Here


   {
      String name = "testQueue";

      ServerManagement.deployTopic(name, null);

      Topic t = (Topic)initialContext.lookup(ServerManagement.DEFAULT_TOPIC_CONTEXT + "/" + name);

      assertEquals(name, t.getTopicName());
   }
View Full Code Here

      String name = "testTopic";
      String jndiName = "/a/b/c/testTopic2";

      ServerManagement.deployTopic(name, jndiName);

      Topic t = (Topic)initialContext.lookup(jndiName);
      assertEquals(name, t.getTopicName());
   }
View Full Code Here

      ServerManagement.deployQueue(name, null);

      ServerManagement.deployTopic(name, null);

      Queue q = (Queue)initialContext.lookup(ServerManagement.DEFAULT_QUEUE_CONTEXT + "/" + name);
      Topic t = (Topic)initialContext.lookup(ServerManagement.DEFAULT_TOPIC_CONTEXT + "/" + name);

      assertEquals(name, q.getQueueName());
      assertEquals(name, t.getTopicName());
   }
View Full Code Here

   {
      String name = "testTopic";

      ServerManagement.deployTopic(name, null);

      Topic t = (Topic)initialContext.lookup(ServerManagement.DEFAULT_TOPIC_CONTEXT + "/" + name);

      assertEquals(name, t.getTopicName());

      ServerManagement.undeployTopic(name);

      try
      {
View Full Code Here

   public void testCreateTopicProgramatically() throws Exception
   {
      String name = "SomeTopic";

      ServerManagement.createTopic(name, null);
      Topic t = (Topic)initialContext.lookup(ServerManagement.DEFAULT_TOPIC_CONTEXT + "/" + name);

      assertEquals(name, t.getTopicName());
   }
View Full Code Here

      ServerManagement.deployTopic(name, null);
      assertFalse(ServerManagement.destroyTopic("ADeployedTopic"));

      // the queue must not be destroyed

      Topic q = (Topic)initialContext.lookup(ServerManagement.DEFAULT_TOPIC_CONTEXT + "/" + name);
      assertEquals(name, q.getTopicName());     
   }
View Full Code Here

        
         InitialContext ic = new InitialContext(ServerManagement.getJNDIEnvironment());
        
         ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
        
         Topic topic = (Topic)ic.lookup("/topic/ReloadTopic");
  
         Connection conn = cf.createConnection();
        
         conn.start();
        
View Full Code Here

      ServerManagement.deployTopic("TopicRemoveAllMessages");
     
      try
      {
         Topic topic = (Topic)ic.lookup("/topic/TopicRemoveAllMessages");
  
         TopicConnection conn = cf.createTopicConnection();
  
         conn.setClientID("Client1");
  
View Full Code Here

      TopicConnection conn = null;
     
     
      try
      {                 
         Topic topic = (Topic)ic.lookup("/topic/TopicGetAllMessageCount");
  
         conn = cf.createTopicConnection();
  
         conn.setClientID("Client1");
  
View Full Code Here

TOP

Related Classes of javax.jms.Topic

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.