1 25 package classic; 26 27 import org.objectweb.joram.client.jms.admin.*; 28 import org.objectweb.joram.client.jms.*; 29 import org.objectweb.joram.client.jms.tcp.*; 30 31 32 35 public class ClassicAdmin 36 { 37 public static void main(String [] args) throws Exception 38 { 39 System.out.println(); 40 System.out.println("Classic administration..."); 41 42 AdminModule.connect("root", "root", 60); 43 44 Queue queue = (Queue) Queue.create("queue"); 45 Topic topic = (Topic) Topic.create("topic"); 46 47 User user = User.create("anonymous", "anonymous"); 48 49 queue.setFreeReading(); 50 topic.setFreeReading(); 51 queue.setFreeWriting(); 52 topic.setFreeWriting(); 53 54 javax.jms.ConnectionFactory cf = 55 TcpConnectionFactory.create("localhost", 16010); 56 javax.jms.QueueConnectionFactory qcf = 57 QueueTcpConnectionFactory.create("localhost", 16010); 58 javax.jms.TopicConnectionFactory tcf = 59 TopicTcpConnectionFactory.create("localhost", 16010); 60 61 javax.naming.Context jndiCtx = new javax.naming.InitialContext (); 62 jndiCtx.bind("cf", cf); 63 jndiCtx.bind("qcf", qcf); 64 jndiCtx.bind("tcf", tcf); 65 jndiCtx.bind("queue", queue); 66 jndiCtx.bind("topic", topic); 67 jndiCtx.close(); 68 69 AdminModule.disconnect(); 70 System.out.println("Admin closed."); 71 } 72 } 73 | Popular Tags |