1 26 package chat; 27 28 import org.objectweb.joram.client.jms.admin.*; 29 import org.objectweb.joram.client.jms.*; 30 import org.objectweb.joram.client.jms.tcp.*; 31 32 40 public class ChatAdmin 41 { 42 public static void main(String args[]) throws Exception 43 { 44 System.out.println(); 45 System.out.println("Chat administration phase... "); 46 47 AdminModule.connect("root", "root", 60); 49 50 javax.jms.ConnectionFactory connFactory = 52 TcpConnectionFactory.create("localhost", 16010); 53 54 Topic topic = (Topic) Topic.create(0); 55 56 User user = User.create("anonymous", "anonymous", 0); 58 59 topic.setFreeReading(); 61 topic.setFreeWriting(); 62 63 javax.naming.Context jndiCtx = new javax.naming.InitialContext (); 65 jndiCtx.bind("factoryChat", connFactory); 66 jndiCtx.bind("topicChat", topic); 67 jndiCtx.close(); 68 69 AdminModule.disconnect(); 70 System.out.println("Admin closed."); 71 } 72 } 73 | Popular Tags |