1 25 package archi; 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 34 public class ArchiAdmin 35 { 36 public static void main(String args[]) throws Exception 37 { 38 System.out.println(); 39 System.out.println("Archi administration..."); 40 41 AdminModule.connect("root", "root", 60); 43 44 User user0 = User.create("anonymous", "anonymous", 0); 46 User user2 = User.create("anonymous", "anonymous", 2); 47 48 Queue queue = (Queue) Queue.create(1); 50 Topic topic = (Topic) Topic.create(1); 51 52 queue.setFreeReading(); 54 topic.setFreeReading(); 55 queue.setFreeWriting(); 56 topic.setFreeWriting(); 57 58 javax.jms.ConnectionFactory cf0 = 60 TcpConnectionFactory.create("localhost", 16010); 61 javax.jms.ConnectionFactory cf2 = 62 TcpConnectionFactory.create("localhost", 16012); 63 64 javax.naming.Context jndiCtx = new javax.naming.InitialContext (); 66 jndiCtx.bind("queue", queue); 67 jndiCtx.bind("topic", topic); 68 jndiCtx.bind("cf0", cf0); 69 jndiCtx.bind("cf2", cf2); 70 jndiCtx.close(); 71 72 AdminModule.disconnect(); 73 System.out.println("Admin closed."); 74 } 75 } 76 | Popular Tags |