1 24 package topicTree; 25 26 import org.objectweb.joram.client.jms.admin.*; 27 import org.objectweb.joram.client.jms.*; 28 import org.objectweb.joram.client.jms.tcp.*; 29 30 33 public class TreeAdmin 34 { 35 public static void main(String [] args) throws Exception 36 { 37 System.out.println(); 38 System.out.println("Tree administration..."); 39 40 AdminModule.connect("root", "root", 60); 41 42 Topic news = (Topic) Topic.create(0); 43 Topic business = (Topic) Topic.create(0); 44 Topic sports = (Topic) Topic.create(0); 45 Topic tennis = (Topic) Topic.create(0); 46 47 business.setParent(news); 48 sports.setParent(news); 49 tennis.setParent(sports); 50 51 javax.jms.ConnectionFactory cf = 52 TcpConnectionFactory.create("localhost", 16010); 53 54 User user = User.create("anonymous", "anonymous", 0); 55 56 news.setFreeReading(); 57 news.setFreeWriting(); 58 business.setFreeReading(); 59 business.setFreeWriting(); 60 sports.setFreeReading(); 61 sports.setFreeWriting(); 62 tennis.setFreeReading(); 63 tennis.setFreeWriting(); 64 65 javax.naming.Context jndiCtx = new javax.naming.InitialContext (); 66 jndiCtx.bind("news", news); 67 jndiCtx.bind("business", business); 68 jndiCtx.bind("sports", sports); 69 jndiCtx.bind("tennis", tennis); 70 jndiCtx.bind("cf", cf); 71 jndiCtx.close(); 72 73 AdminModule.disconnect(); 74 System.out.println("Admin closed."); 75 } 76 } 77 | Popular Tags |