1 23 package org.objectweb.joram.client.connector; 24 25 import org.objectweb.joram.client.jms.Topic; 26 27 28 32 public class LocalTopic implements LocalTopicMBean 33 { 34 35 private Topic topic; 36 37 38 41 public LocalTopic(Topic topic) 42 { 43 this.topic = topic; 44 } 45 46 47 public String getAgentId() 48 { 49 try { 50 return topic.getTopicName(); 51 } 52 catch (Exception exc) { 53 return null; 54 } 55 } 56 57 public String getJndiName() 58 { 59 return topic.getAdminName(); 60 } 61 62 public int getNumberOfSubscribers() 63 { 64 try { 65 return topic.getSubscriptions(); 66 } 67 catch (Exception exc) { 68 return -1; 69 } 70 } 71 72 73 public void delete() throws Exception 74 { 75 topic.delete(); 76 JoramAdapter.unregister(this); 77 JoramAdapter.unbind(topic.getAdminName()); 78 } 79 } 80 | Popular Tags |