1 22 package org.jboss.mq.server; 23 24 import javax.jms.Destination ; 25 import javax.jms.JMSException ; 26 import javax.jms.Queue ; 27 import javax.jms.TemporaryQueue ; 28 import javax.jms.TemporaryTopic ; 29 import javax.jms.Topic ; 30 import javax.transaction.xa.Xid ; 31 32 import org.jboss.logging.Logger; 33 import org.jboss.mq.AcknowledgementRequest; 34 import org.jboss.mq.ConnectionToken; 35 import org.jboss.mq.DurableSubscriptionID; 36 import org.jboss.mq.Recoverable; 37 import org.jboss.mq.SpyDestination; 38 import org.jboss.mq.SpyMessage; 39 import org.jboss.mq.SpyTopic; 40 import org.jboss.mq.Subscription; 41 import org.jboss.mq.TransactionRequest; 42 43 50 public class JMSServerInterceptorSupport implements JMSServerInterceptor, Recoverable 51 { 52 protected Logger log; 53 56 protected JMSServerInterceptor nextInterceptor = null; 57 58 public JMSServerInterceptorSupport() 59 { 60 log = Logger.getLogger(this.getClass().getName()); 61 } 62 63 public void setNext(JMSServerInterceptor server) 64 { 65 this.nextInterceptor = server; 66 } 67 68 public JMSServerInterceptor getNext() 69 { 70 return this.nextInterceptor; 71 } 72 73 public ThreadGroup getThreadGroup() 74 { 75 return nextInterceptor.getThreadGroup(); 76 } 77 78 public String getID() throws JMSException 79 { 80 String ID = nextInterceptor.getID(); 81 return ID; 82 } 83 84 public TemporaryTopic getTemporaryTopic(ConnectionToken dc) throws JMSException 85 { 86 return nextInterceptor.getTemporaryTopic(dc); 87 } 88 89 public TemporaryQueue getTemporaryQueue(ConnectionToken dc) throws JMSException 90 { 91 return nextInterceptor.getTemporaryQueue(dc); 92 } 93 94 public void connectionClosing(ConnectionToken dc) throws JMSException 95 { 96 nextInterceptor.connectionClosing(dc); 97 } 98 99 public void checkID(String ID) throws JMSException 100 { 101 nextInterceptor.checkID(ID); 102 } 103 104 public void addMessage(ConnectionToken dc, SpyMessage message) throws JMSException 105 { 106 nextInterceptor.addMessage(dc, message); 107 } 108 109 public Queue createQueue(ConnectionToken dc, String dest) throws JMSException 110 { 111 return nextInterceptor.createQueue(dc, dest); 112 } 113 114 public Topic createTopic(ConnectionToken dc, String dest) throws JMSException 115 { 116 return nextInterceptor.createTopic(dc, dest); 117 } 118 119 public void deleteTemporaryDestination(ConnectionToken dc, SpyDestination dest) throws JMSException 120 { 121 nextInterceptor.deleteTemporaryDestination(dc, dest); 122 } 123 124 public void transact(ConnectionToken dc, TransactionRequest t) throws JMSException 125 { 126 nextInterceptor.transact(dc, t); 127 } 128 129 public void acknowledge(ConnectionToken dc, AcknowledgementRequest item) throws JMSException 130 { 131 nextInterceptor.acknowledge(dc, item); 132 } 133 134 public SpyMessage[] browse(ConnectionToken dc, Destination dest, String selector) throws JMSException 135 { 136 return nextInterceptor.browse(dc, dest, selector); 137 } 138 139 public SpyMessage receive(ConnectionToken dc, int subscriberId, long wait) throws JMSException 140 { 141 return nextInterceptor.receive(dc, subscriberId, wait); 142 } 143 144 public void setEnabled(ConnectionToken dc, boolean enabled) throws JMSException 145 { 146 nextInterceptor.setEnabled(dc, enabled); 147 } 148 149 public void unsubscribe(ConnectionToken dc, int subscriptionId) throws JMSException 150 { 151 nextInterceptor.unsubscribe(dc, subscriptionId); 152 } 153 154 public void destroySubscription(ConnectionToken dc, DurableSubscriptionID id) throws JMSException 155 { 156 nextInterceptor.destroySubscription(dc, id); 157 } 158 159 public String checkUser(String userName, String password) throws JMSException 160 { 161 return nextInterceptor.checkUser(userName, password); 162 } 163 164 public String authenticate(String userName, String password) throws JMSException 165 { 166 return nextInterceptor.authenticate(userName, password); 167 } 168 169 public void subscribe(org.jboss.mq.ConnectionToken dc, org.jboss.mq.Subscription s) throws JMSException 170 { 171 nextInterceptor.subscribe(dc, s); 172 } 173 174 public void ping(ConnectionToken dc, long clientTime) throws JMSException 175 { 176 nextInterceptor.ping(dc, clientTime); 177 } 178 179 public SpyTopic getDurableTopic(DurableSubscriptionID sub) throws JMSException 180 { 181 return nextInterceptor.getDurableTopic(sub); 182 } 183 184 public Subscription getSubscription(ConnectionToken dc, int subscriberId) throws JMSException 185 { 186 return nextInterceptor.getSubscription(dc, subscriberId); 187 } 188 189 public Xid [] recover(ConnectionToken dc, int flags) throws Exception 190 { 191 JMSServerInterceptor next = nextInterceptor; 192 while (next != null && next instanceof Recoverable == false) 193 next = next.getNext(); 194 if (next == null) 195 throw new IllegalStateException ("No interceptor implements " + Recoverable.class.getName()); 196 Recoverable recoverable = (Recoverable) next; 197 return recoverable.recover(dc, flags); 198 } 199 } 200 | Popular Tags |