@Override public void add(String name, int value) { mapNameToValue.put(name, Integer.valueOf(value)); mapValueToName.put(value, name); }
public void deserializePage(int id, String pageMapName, Page page, ObjectInputStream stream) throws IOException, ClassNotFoundException { // get the page instance registry IntHashMap<Page> pages = SecondLevelCacheSessionStore.getUsedPages(pageMapName); // register the new page instance so that when the same page is being deserialized // (curricular page references) we can use existing page instance (otherwise deadlock // would happen) pages.put(id, page); stream.defaultReadObject(); } }
/** * * @param pageId * @param windowIndex */ private void putWindowIndex(int pageId, int windowIndex) { if (idToWindowIndex != null && pageId != -1 && windowIndex != -1) { Integer oldPageId = windowIndexToPageId.remove(windowIndex); if (oldPageId != null) { idToWindowIndex.remove(oldPageId); } idToWindowIndex.put(pageId, windowIndex); windowIndexToPageId.put(windowIndex, pageId); } }
/** * * @param pageId * @param windowIndex */ private void putWindowIndex(int pageId, int windowIndex) { if (idToWindowIndex != null && pageId != -1 && windowIndex != -1) { Integer oldPageId = windowIndexToPageId.remove(windowIndex); if (oldPageId != null) { idToWindowIndex.remove(oldPageId); } idToWindowIndex.put(pageId, windowIndex); windowIndexToPageId.put(windowIndex, pageId); } }
private void putWindowIndex(int pageId, int windowIndex) { if (pageId != -1 && idToWindowIndices != null) { List indices = (List)idToWindowIndices.get(pageId); Integer index = new Integer(windowIndex); if (indices == null) { indices = new ArrayList(); indices.add(index); idToWindowIndices.put(pageId, indices); } else if (indices.contains(index) == false) { indices.add(index); } } }
private void putWindowIndex(int pageId, int windowIndex) { if (pageId != -1 && idToWindowIndices != null) { List<Integer> indices = idToWindowIndices.get(pageId); Integer index = new Integer(windowIndex); if (indices == null) { indices = new ArrayList<Integer>(); indices.add(index); idToWindowIndices.put(pageId, indices); } else if (indices.contains(index) == false) { indices.add(index); } } }
private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); int size = s.readInt(); queue = new ReferenceQueue(); directComponentRefs = new IntHashMap((int)(size * 1.25)); while (--size >= 0) { int uid = s.readInt(); Component component = (Component)s.readObject(); String interfaceName = s.readUTF(); IntKeyWeakReference ref = new IntKeyWeakReference(uid, component, queue); directComponentRefs.put(uid, new ComponentAndInterface(ref, interfaceName)); } }
private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); int size = s.readInt(); queue = new ReferenceQueue<Object>(); directComponentRefs = new IntHashMap<ComponentAndInterface>((int)(size * 1.25)); while (--size >= 0) { int uid = s.readInt(); Component component = (Component)s.readObject(); String interfaceName = s.readUTF(); IntKeyWeakReference ref = new IntKeyWeakReference(uid, component, queue); directComponentRefs.put(uid, new ComponentAndInterface(ref, interfaceName)); } }
public void deserializePage(int id, String pageMapName, Page page, ObjectInputStream stream) throws IOException, ClassNotFoundException { // get the page instance registry HashMap pageMaps = (HashMap)SecondLevelCacheSessionStore.getUsedPages().get(); if (pageMaps == null) { pageMaps = new HashMap(); SecondLevelCacheSessionStore.getUsedPages().set(pageMaps); } IntHashMap pages = (IntHashMap)pageMaps.get(pageMapName); if (pages == null) { pages = new IntHashMap(); pageMaps.put(pageMapName, pages); } // register the new page instance so that when the same page is being deserialized // (curricular page references) we can use existing page instance (otherwise deadlock // would happen) pages.put(id, page); stream.defaultReadObject(); } }
put(e.getKey(), e.getValue());
handledObjects.put(handleCounter++, value); handledObjects.put(handleCounter++, value); stack.push(value); if (!currentStreamHandler.invokeReadMethod(this, value)) int length = in.readInt(); Object[] array = (Object[])Array.newInstance(lookup.getStreamClass(), length); handledObjects.put(handleCounter++, array); for (int i = 0; i < array.length; i++) ClassStreamHandler lookup = ClassStreamHandler.lookup(classDef); value = lookup.readArray(this); handledObjects.put(handleCounter++, value);
put(e.getKey(), e.getValue());
handledObjects.put(handleCounter++, value); handledObjects.put(handleCounter++, value); stack.push(value); if (!currentStreamHandler.invokeReadMethod(this, value)) int length = in.readInt(); Object[] array = (Object[])Array.newInstance(lookup.getStreamClass(), length); handledObjects.put(handleCounter++, array); for (int i = 0; i < array.length; i++) ClassStreamHandler lookup = ClassStreamHandler.lookup(classDef); value = lookup.readArray(this); handledObjects.put(handleCounter++, value);
directComponentRefs.put(uid, new ComponentAndInterface(ref, interfaceName));
directComponentRefs.put(uid, new ComponentAndInterface(ref, interfaceName));
put(entry.getKey(), entry.getValue());