1 25 package org.objectweb.joram.mom.proxies; 26 27 import org.objectweb.joram.shared.excepts.MomException; 28 import org.objectweb.joram.shared.client.AbstractJmsReply; 29 import org.objectweb.joram.shared.client.AbstractJmsRequest; 30 import org.objectweb.joram.shared.client.MomExceptionReply; 31 import org.objectweb.joram.shared.client.CnxCloseRequest; 32 33 import fr.dyade.aaa.util.Queue; 34 35 38 public class StandardConnectionContext 39 implements ConnectionContext, java.io.Serializable { 40 41 private int key; 42 43 private Queue queue; 44 45 private ProxyImpl proxyImpl; 46 47 private boolean closed; 48 49 StandardConnectionContext(ProxyImpl proxyImpl, int key) { 50 this.key = key; 51 this.proxyImpl = proxyImpl; 52 queue = new Queue(); 53 closed = false; 54 } 55 56 public int getKey() { 57 return key; 58 } 59 60 public void send(Object obj) { 61 queue.push(obj); 62 } 63 64 public Queue getQueue() { 65 return queue; 66 } 67 68 public void pushReply(AbstractJmsReply reply) { 69 queue.push(reply); 70 } 71 72 public AbstractJmsRequest getRequest(Object req) { 73 AbstractJmsRequest request = (AbstractJmsRequest) req; 74 if (request instanceof CnxCloseRequest) { 75 closed = true; 76 } 77 return request; 78 } 79 80 public void pushError(MomException exc) { 81 queue.push(new MomExceptionReply(exc)); 82 } 83 84 public boolean isClosed() { 85 return closed; 86 } 87 88 } 89 | Popular Tags |