1 28 package org.objectweb.carol.rmi.jrmp.interceptor; 29 30 import java.util.ArrayList ; 31 import java.util.Collection ; 32 import java.util.Iterator ; 33 34 41 public class JRMPClientRequestInfoImpl implements JClientRequestInfo { 42 43 46 protected ArrayList scTable = new ArrayList (); 47 48 51 public JRMPClientRequestInfoImpl() { 52 } 53 54 59 public void add_request_service_context(JServiceContext jServiceContext) { 60 scTable.add(jServiceContext); 61 } 62 63 69 public JServiceContext get_request_service_context(int id) { 70 JServiceContext jc = null; 71 for (Iterator i = scTable.iterator(); i.hasNext();) { 72 jc = (JServiceContext) i.next(); 73 if (jc.getContextId() == id) { 74 return jc; 75 } 76 } 77 return null; 78 } 79 80 85 public Collection get_all_request_service_context() { 86 return scTable; 87 } 88 89 95 public JServiceContext get_reply_service_context(int id) { 96 JServiceContext jc = null; 97 for (Iterator i = scTable.iterator(); i.hasNext();) { 98 jc = (JServiceContext) i.next(); 99 if (jc.getContextId() == id) { 100 return jc; 101 } 102 } 103 return null; 104 } 105 106 110 public Collection get_all_reply_service_context() { 111 return scTable; 112 } 113 114 118 public void add_all_request_service_context(Collection c) { 119 scTable.addAll(c); 120 } 121 122 125 public boolean hasContexts() { 126 return !(scTable.isEmpty()); 127 } 128 129 132 public void clearAllContexts() { 133 scTable.clear(); 134 } 135 } | Popular Tags |