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