1 28 package org.objectweb.carol.rmi.jrmp.interceptor; 29 30 import java.util.ArrayList ; 32 import java.util.Collection ; 33 import java.util.Iterator ; 34 35 42 public class JRMPServerRequestInfoImpl implements JServerRequestInfo { 43 44 47 protected ArrayList scTable = new ArrayList (); 48 49 52 public JRMPServerRequestInfoImpl() { 53 } 54 55 60 public void add_reply_service_context(JServiceContext jServiceContext) { 61 scTable.add(jServiceContext); 62 } 63 64 68 public void add_all_reply_service_context(Collection c) { 69 scTable.addAll(c); 70 } 71 72 78 public JServiceContext get_request_service_context(int id) { 79 JServiceContext jc = null; 80 for (Iterator i = scTable.iterator(); i.hasNext();) { 81 jc = (JServiceContext) i.next(); 82 if (jc.getContextId() == id) { 83 return jc; 84 } 85 } 86 return null; 87 } 88 89 94 public Collection get_all_request_service_context() { 95 return scTable; 96 } 97 98 104 public JServiceContext get_reply_service_context(int id) { 105 JServiceContext jc = null; 106 for (Iterator i = scTable.iterator(); i.hasNext();) { 107 jc = (JServiceContext) i.next(); 108 if (jc.getContextId() == id) { 109 return jc; 110 } 111 } 112 return null; 113 } 114 115 119 public Collection get_all_reply_service_context() { 120 return scTable; 121 } 122 123 126 public boolean hasContexts() { 127 return !(scTable.isEmpty()); 128 } 129 130 133 public void clearAllContexts() { 134 scTable.clear(); 135 } 136 } | Popular Tags |