1 25 package dotcom; 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 37 public class DotcomAdmin 38 { 39 public static void main(String args[]) throws Exception 40 { 41 System.out.println(); 42 System.out.println("Dotcom administration..."); 43 44 AdminModule.connect("root", "root", 60); 46 47 User web = User.create("web", "web", 0); 49 User billing = User.create("billing", "billing", 0); 50 User inventory = User.create("inventory", "inventory", 0); 51 User customer = User.create("customer", "customer", 0); 52 User control = User.create("control", "control", 0); 53 User delivery = User.create("delivery", "delivery", 0); 54 55 javax.jms.QueueConnectionFactory qcf = 57 QueueTcpConnectionFactory.create("localhost", 16010); 58 javax.jms.TopicConnectionFactory tcf = 59 TopicTcpConnectionFactory.create("localhost", 16010); 60 61 Topic tOrders = (Topic) Topic.create(0); 62 Queue qItems = (Queue) Queue.create(0); 63 Queue qCheck = (Queue) Queue.create(0); 64 Queue qChecked = (Queue) Queue.create(0); 65 Queue qBills = (Queue) Queue.create(0); 66 Queue qDelivery = (Queue) Queue.create(0); 67 68 tOrders.setWriter(web); 70 tOrders.setReader(billing); 71 tOrders.setReader(inventory); 72 tOrders.setReader(customer); 73 qCheck.setWriter(billing); 74 qCheck.setReader(control); 75 qChecked.setWriter(control); 76 qChecked.setReader(billing); 77 qBills.setWriter(billing); 78 qBills.setReader(customer); 79 qItems.setWriter(inventory); 80 qItems.setReader(customer); 81 qDelivery.setWriter(customer); 82 qDelivery.setReader(delivery); 83 84 javax.naming.Context jndiCtx = new javax.naming.InitialContext (); 86 jndiCtx.bind("qcf", qcf); 87 jndiCtx.bind("tcf", tcf); 88 jndiCtx.bind("tOrders", tOrders); 89 jndiCtx.bind("qItems", qItems); 90 jndiCtx.bind("qCheck", qCheck); 91 jndiCtx.bind("qChecked", qChecked); 92 jndiCtx.bind("qBills", qBills); 93 jndiCtx.bind("qDelivery", qDelivery); 94 jndiCtx.close(); 95 96 AdminModule.disconnect(); 97 System.out.println("Admin closed."); 98 } 99 } 100 | Popular Tags |