1 23 package ha; 24 25 import org.objectweb.joram.client.jms.admin.AdminModule; 26 import org.objectweb.joram.client.jms.admin.User; 27 import org.objectweb.joram.client.jms.ConnectionFactory; 28 import org.objectweb.joram.client.jms.Topic; 29 import org.objectweb.joram.client.jms.ha.tcp.TopicHATcpConnectionFactory; 30 31 32 public class HAAdmin { 33 public static void main(String [] args) 34 throws Exception { 35 System.out.println(); 36 System.out.println("HA administration..."); 37 38 javax.jms.TopicConnectionFactory tcf = 39 TopicHATcpConnectionFactory.create("hajoram://localhost:2560,localhost:2561,localhost:2562"); 40 ((ConnectionFactory) tcf).getParameters().connectingTimer = 30; 41 42 AdminModule.connect(tcf, "root", "root"); 43 44 Topic topic = (Topic) Topic.create(0,"topic"); 45 User user = User.create("anonymous", "anonymous"); 46 47 topic.setFreeReading(); 48 topic.setFreeWriting(); 49 50 AdminModule.disconnect(); 51 System.out.println("Admin closed."); 52 } 53 } 54 | Popular Tags |