1 23 package org.objectweb.joram.client.connector; 24 25 import org.objectweb.joram.client.jms.Queue; 26 27 28 32 public class LocalQueue implements LocalQueueMBean 33 { 34 35 private Queue queue; 36 37 38 41 public LocalQueue(Queue queue) 42 { 43 this.queue = queue; 44 } 45 46 47 public String getAgentId() 48 { 49 try { 50 return queue.getQueueName(); 51 } 52 catch (Exception exc) { 53 return null; 54 } 55 } 56 57 public String getJndiName() 58 { 59 return queue.getAdminName(); 60 } 61 62 public int getNumberOfPendingMessages() 63 { 64 try { 65 return queue.getPendingMessages(); 66 } 67 catch (Exception exc) { 68 return -1; 69 } 70 } 71 72 public int getNumberOfPendingRequests() 73 { 74 try { 75 return queue.getPendingRequests(); 76 } 77 catch (Exception exc) { 78 return -1; 79 } 80 } 81 82 83 public void delete() throws Exception 84 { 85 queue.delete(); 86 JoramAdapter.unregister(this); 87 JoramAdapter.unbind(queue.getAdminName()); 88 } 89 } 90 | Popular Tags |