public Map makeEmptyMap() { ReferenceMap map = new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.WEAK); return map; }
public Map buildRefMap() { Object key = new Object(); Object value = new Object(); keyReference = new WeakReference(key); valueReference = new WeakReference(value); Map testMap = new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.HARD, true); testMap.put(key, value); assertEquals("In map", value, testMap.get(key)); assertNotNull("Weak reference released early (1)", keyReference.get()); assertNotNull("Weak reference released early (2)", valueReference.get()); return testMap; }
/** * internal * * @return reference map */ private ReferenceMap getCache() { if(this.cache == null) { this.cache = new ReferenceMap(); } return this.cache; }
/** * Creates a cache of singleton instances. * * @param itf a interface or class that should be implemented by all classes cached by this object */ public JRSingletonCache(Class itf) { cache = new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.SOFT); this.itf = itf; }
protected Map newRowMap() { return new ReferenceMap(); } }
/** * internal * * @return reference map */ private ReferenceMap getCache() { if(this.cache == null) { this.cache = new ReferenceMap(); } return this.cache; }
protected Map newRowMap() { return new ReferenceMap(); } }
protected Map newRowMap() { return new ReferenceMap(); } }
protected Map newRowMap() { return new ReferenceMap(); } }
/** * @param maxSize * the maximum size (in JRVirtualizable objects) of the paged in * cache. */ protected JRAbstractLRUVirtualizer(int maxSize) { this.pagedIn = new Cache(maxSize); this.pagedOut = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK); this.lastObject = null; this.lastObjectMap = new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.WEAK); this.lastObjectSet = new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.HARD); }
protected static synchronized void putClassInCache(String className, Class loadedClass) { Object key = classCacheKey(); Map contextMap = (Map) classCache.get(key); if (contextMap == null) { contextMap = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT); classCache.put(key, contextMap); } contextMap.put(className, loadedClass); } }
/** * inernal, clear cache */ private void clearCache() { if(this.cache == null) { this.cache = new ReferenceMap(); } else { this.cache.clear(); } }
/** * inernal, clear cache */ private void clearCache() { if(this.cache == null) { this.cache = new ReferenceMap(); } else { this.cache.clear(); } }
/** * Constructs a PersistentContext, bound to the given session. * * @param session The session "owning" this context. */ public StatefulPersistenceContext(SessionImplementor session) { this.session = session; entitiesByKey = new HashMap( INIT_COLL_SIZE ); entitiesByUniqueKey = new HashMap( INIT_COLL_SIZE ); proxiesByKey = new ReferenceMap( ReferenceMap.HARD, ReferenceMap.WEAK ); entitySnapshotsByKey = new HashMap( INIT_COLL_SIZE ); entityEntries = IdentityMap.instantiateSequenced( INIT_COLL_SIZE ); collectionEntries = IdentityMap.instantiateSequenced( INIT_COLL_SIZE ); collectionsByKey = new HashMap( INIT_COLL_SIZE ); arrayHolders = IdentityMap.instantiate( INIT_COLL_SIZE ); nullifiableEntityKeys = new HashSet(); initTransientState(); }
/** * Constructs a PersistentContext, bound to the given session. * * @param session The session "owning" this context. */ public PersistenceContext(SessionImplementor session) { this.session = session; entitiesByKey = new HashMap(INIT_MAP_SIZE); entitiesByUniqueKey = new HashMap(INIT_MAP_SIZE); proxiesByKey = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK); entitySnapshotsByKey = new HashMap(INIT_MAP_SIZE); //nonExistantEntityKeys = new HashSet(INIT_MAP_SIZE); //nonExistentEntityUniqueKeys = new HashSet(INIT_MAP_SIZE); entityEntries = IdentityMap.instantiateSequenced(INIT_MAP_SIZE); collectionEntries = IdentityMap.instantiateSequenced(INIT_MAP_SIZE); collectionsByKey = new HashMap(INIT_MAP_SIZE); arrayHolders = IdentityMap.instantiate(INIT_MAP_SIZE); initTransientState(); }
protected Map getContextInstanceCache() { Object contextKey = getContextKey(); Map contextCache = (Map) cache.get(contextKey); if (contextCache == null) { contextCache = new ReferenceMap(); cache.put(contextKey, contextCache); } return contextCache; }
proxiesByKey = new ReferenceMap( ReferenceMap.HARD, ReferenceMap.WEAK ); Map map = ( Map ) ois.readObject(); proxiesByKey.putAll( map );
protected JRFillCellContents(JRFillCellContents cellContents, JRFillCloneFactory factory) { super(cellContents, factory); defaultStyleProvider = cellContents.defaultStyleProvider; parentCell = cellContents.parentCell; cellType = cellContents.cellType; lineBox = cellContents.getLineBox().clone(this); width = cellContents.width; height = cellContents.height; initStyle = cellContents.initStyle; initElements(); initConditionalStyles(); this.templateFrames = cellContents.templateFrames; this.originProvider = cellContents.originProvider; transformedContentsCache = new ReferenceMap(); boxContentsCache = new HashMap(); clonePool = new JRClonePool(this, true, true); verticalPositionType = cellContents.verticalPositionType; }
public JRFillCellContents(JRBaseFiller filler, JRCellContents cell, String cellType, JRFillCrosstabObjectFactory factory) { super(filler, cell, factory); defaultStyleProvider = factory.getDefaultStyleProvider(); parentCell = cell; this.cellType = cellType; lineBox = cell.getLineBox().clone(this); width = cell.getWidth(); height = cell.getHeight(); factory.registerDelayedStyleSetter(this, parentCell); initElements(); initConditionalStyles(); initTemplatesMap(); this.originProvider = factory.getParentOriginProvider(); setElementOriginProvider(this.originProvider); transformedContentsCache = new ReferenceMap(); boxContentsCache = new HashMap(); clonePool = new JRClonePool(this, true, true); }
private static Map hssfColorsCache = new ReferenceMap();