1 22 package org.jboss.mq.il.jvm; 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.mq.AcknowledgementRequest; 33 import org.jboss.mq.ConnectionToken; 34 import org.jboss.mq.DurableSubscriptionID; 35 import org.jboss.mq.Recoverable; 36 import org.jboss.mq.SpyDestination; 37 import org.jboss.mq.SpyMessage; 38 import org.jboss.mq.TransactionRequest; 39 import org.jboss.mq.il.Invoker; 40 import org.jboss.mq.il.ServerIL; 41 42 52 public class JVMServerIL implements ServerIL, Recoverable 53 { 54 private final Invoker server; 56 57 62 public JVMServerIL(Invoker s) 63 { 64 if (s == null) 65 throw new IllegalArgumentException ("JMSServer must be non null in constructor"); 66 server = s; 67 } 68 69 public void setConnectionToken(ConnectionToken newConnectionToken) 70 { 71 } 73 74 public void setEnabled(ConnectionToken dc, boolean enabled) throws Exception 75 { 76 server.setEnabled(dc, enabled); 77 } 78 79 public String getID() throws JMSException 80 { 81 return server.getID(); 82 } 83 84 public TemporaryQueue getTemporaryQueue(ConnectionToken dc) throws JMSException 85 { 86 return server.getTemporaryQueue(dc); 87 } 88 89 public TemporaryTopic getTemporaryTopic(ConnectionToken dc) throws JMSException 90 { 91 return server.getTemporaryTopic(dc); 92 } 93 94 public ServerIL cloneServerIL() 95 { 96 return this; 97 } 98 99 public void addMessage(ConnectionToken dc, SpyMessage val) throws JMSException 100 { 101 server.addMessage(dc, val.myClone()); 102 } 103 104 public Topic createTopic(ConnectionToken dc, String dest) throws JMSException 105 { 106 return server.createTopic(dc, dest); 107 } 108 109 public Queue createQueue(ConnectionToken dc, String dest) throws JMSException 110 { 111 return server.createQueue(dc, dest); 112 } 113 114 public void deleteTemporaryDestination(ConnectionToken dc, SpyDestination dest) throws JMSException 115 { 116 server.deleteTemporaryDestination(dc, dest); 117 } 118 119 public void checkID(String ID) throws JMSException 120 { 121 server.checkID(ID); 122 } 123 124 public void connectionClosing(ConnectionToken dc) throws JMSException 125 { 126 server.connectionClosing(dc); 127 } 128 129 public void acknowledge(ConnectionToken dc, AcknowledgementRequest item) throws Exception 130 { 131 server.acknowledge(dc, item); 132 } 133 134 public SpyMessage[] browse(ConnectionToken dc, Destination dest, String selector) throws Exception 135 { 136 return server.browse(dc, dest, selector); 137 } 138 139 public SpyMessage receive(ConnectionToken dc, int subscriberId, long wait) throws Exception 140 { 141 SpyMessage message = server.receive(dc, subscriberId, wait); 142 if (message != null) 144 message = message.myClone(); 145 return message; 146 } 147 148 public void unsubscribe(ConnectionToken dc, int subscriptionId) throws Exception 149 { 150 server.unsubscribe(dc, subscriptionId); 151 } 152 153 public void destroySubscription(ConnectionToken dc, DurableSubscriptionID id) throws Exception 154 { 155 server.destroySubscription(dc, id); 156 } 157 158 public String checkUser(String userName, String password) throws JMSException 159 { 160 return server.checkUser(userName, password); 161 } 162 163 public String authenticate(String userName, String password) throws JMSException 164 { 165 return server.authenticate(userName, password); 166 } 167 168 public void subscribe(ConnectionToken dc, org.jboss.mq.Subscription s) throws Exception 169 { 170 server.subscribe(dc, s.myClone()); 171 } 172 173 public void transact(org.jboss.mq.ConnectionToken dc, TransactionRequest t) throws JMSException 174 { 175 server.transact(dc, t); 176 } 177 178 public void ping(org.jboss.mq.ConnectionToken dc, long clientTime) throws JMSException 179 { 180 server.ping(dc, clientTime); 181 } 182 183 public Xid [] recover(ConnectionToken dc, int flags) throws Exception 184 { 185 if (server instanceof Recoverable) 186 { 187 Recoverable recoverable = (Recoverable) server; 188 return recoverable.recover(dc, flags); 189 } 190 throw new IllegalStateException ("Invoker does not implement recoverable " + server); 191 } 192 } 193 | Popular Tags |