1 23 package org.objectweb.joram.client.connector; 24 25 import org.objectweb.joram.client.jms.Destination; 26 import org.objectweb.joram.client.jms.Queue; 27 import org.objectweb.joram.client.jms.Topic; 28 import org.objectweb.joram.client.jms.admin.AdminModule; 29 30 import java.util.Iterator ; 31 import java.util.List ; 32 import java.util.Vector ; 33 34 35 38 public class RemoteServer implements RemoteServerMBean 39 { 40 41 private short id; 42 43 44 45 public RemoteServer(short id) 46 { 47 this.id = id; 48 } 49 50 51 public String getRemoteServerId() 52 { 53 return "" + id; 54 } 55 56 57 public List retrieveRemoteQueuesNames() throws Exception 58 { 59 List list = AdminModule.getDestinations(id); 60 Iterator it = list.iterator(); 61 Destination dest; 62 Vector names = new Vector (); 63 while (it.hasNext()) { 64 dest = (Destination) it.next(); 65 if (dest instanceof Queue) 66 names.add(dest.getAdminName()); 67 } 68 return names; 69 } 70 71 public List retrieveRemoteTopicsNames() throws Exception 72 { 73 List list = AdminModule.getDestinations(id); 74 Iterator it = list.iterator(); 75 Destination dest; 76 Vector names = new Vector (); 77 while (it.hasNext()) { 78 dest = (Destination) it.next(); 79 if (dest instanceof Topic) 80 names.add(dest.getAdminName()); 81 } 82 return names; 83 } 84 } 85 | Popular Tags |