private void write_codebase(String str, int pos) { if (codebaseCache != null && codebaseCache.containsKey(str)) { writeIndirection(INDIRECTION_TAG, codebaseCache.getVal(str)); } else { write_string(str); if (codebaseCache == null) codebaseCache = new CacheTable(orb, true); codebaseCache.put(str, pos); } }
public final boolean containsOrderedVal(int val) { return containsVal(val); }
private final void updateIndirectionTable(int indirection, Object object, Object key) { // int indirection = get_offset(); if (valueCache == null) valueCache = new CacheTable(orb, true); valueCache.put(object, indirection); if (key != object) valueCache.put(key, indirection); }
private void grow() { if (size == MAX_SIZE) return; Entry[] oldMap = map; int oldSize = size; size <<= 1; initTables(); // now rehash the entries into the new table for (int i = 0; i < oldSize; i++) { for (Entry e = oldMap[i]; e != null; e = e.next) put_table(e.key, e.val); } }
private final String read_codebase_URL() { String result = readStringOrIndirection(true); if (result == null) { // Indirection int indirection = read_long() + get_offset() - 4; if (codebaseCache != null && codebaseCache.containsVal(indirection)) return (String) codebaseCache.getKey(indirection); else throw wrapper.badCodebaseIndirection(CompletionStatus.COMPLETED_MAYBE, new Integer(bbwi.position())); } else { if (codebaseCache == null) codebaseCache = new CacheTable(orb, false); codebaseCache.put(result, stringIndirection); } return result; }
private final String read_repositoryId() { String result = readStringOrIndirection(true); if (result == null) { // Indirection int indirection = read_long() + get_offset() - 4; if (repositoryIdCache != null && repositoryIdCache.containsOrderedVal(indirection)) return (String) repositoryIdCache.getKey(indirection); else throw wrapper.badRepIdIndirection(CompletionStatus.COMPLETED_MAYBE, new Integer(bbwi.position())); } else { if (repositoryIdCache == null) repositoryIdCache = new CacheTable(orb, false); repositoryIdCache.put(result, stringIndirection); } return result; }
if (valueCache != null && valueCache.containsKey(object)) writeIndirection(INDIRECTION_TAG, valueCache.getVal(object)); return;
private Serializable handleIndirection() { int indirection = read_long() + get_offset() - 4; if (valueCache != null && valueCache.containsVal(indirection)) { java.io.Serializable cachedValue = (java.io.Serializable) valueCache.getKey(indirection); return cachedValue; } else { // In RMI-IIOP the ValueHandler will recognize this exception and use the provided indirection value to // lookup a possible indirection to an object currently on the deserialization stack. throw new IndirectionException(indirection); } }
public final int getVal(java.lang.Object key) { int index = hash(key); for (Entry e = map[index]; e != null; e = e.next) { if (e.key == key) return e.val; } return -1; }
public final boolean containsVal(int val) { return (getKey(val) != null); }
public CacheTable(ORB orb, boolean u) { // System.out.println("using new cache table"); wrapper = ORBUtilSystemException.get(orb, CORBALogDomains.RPC_ENCODING); noReverseMap = u; size = INITIAL_SIZE; entryCount = 0; initTables(); }
public final boolean containsKey(java.lang.Object key) { return (getVal(key) != -1); }
private final String read_codebase_URL() { String result = readStringOrIndirection(true); if (result == null) { // Indirection int indirection = read_long() + get_offset() - 4; if (codebaseCache != null && codebaseCache.containsVal(indirection)) return (String) codebaseCache.getKey(indirection); else throw wrapper.badCodebaseIndirection(CompletionStatus.COMPLETED_MAYBE, new Integer(bbwi.position())); } else { if (codebaseCache == null) codebaseCache = new CacheTable(orb, false); codebaseCache.put(result, stringIndirection); } return result; }
private final String read_repositoryId() { String result = readStringOrIndirection(true); if (result == null) { // Indirection int indirection = read_long() + get_offset() - 4; if (repositoryIdCache != null && repositoryIdCache.containsOrderedVal(indirection)) return (String) repositoryIdCache.getKey(indirection); else throw wrapper.badRepIdIndirection(CompletionStatus.COMPLETED_MAYBE, new Integer(bbwi.position())); } else { if (repositoryIdCache == null) repositoryIdCache = new CacheTable(orb, false); repositoryIdCache.put(result, stringIndirection); } return result; }
private final void updateIndirectionTable(int indirection, Object object, Object key) { // int indirection = get_offset(); if (valueCache == null) valueCache = new CacheTable(orb, true); valueCache.put(object, indirection); if (key != object) valueCache.put(key, indirection); }
if (valueCache != null && valueCache.containsKey(object)) writeIndirection(INDIRECTION_TAG, valueCache.getVal(object)); return;
private Serializable handleIndirection() { int indirection = read_long() + get_offset() - 4; if (valueCache != null && valueCache.containsVal(indirection)) { java.io.Serializable cachedValue = (java.io.Serializable) valueCache.getKey(indirection); return cachedValue; } else { // In RMI-IIOP the ValueHandler will recognize this exception and use the provided indirection value to // lookup a possible indirection to an object currently on the deserialization stack. throw new IndirectionException(indirection); } }