public StoreFactoryVirtualizer(int maxSize, VirtualizerStoreFactory storeFactory) { super(maxSize); this.storeFactory = storeFactory; this.contextStores = new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.HARD); }
/** * @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.lastObjectRef = null; this.lastObjectMap = new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.WEAK); this.lastObjectSet = new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.HARD); }
/** * @param dir * @param parent * @throws RemoteException * If registration of the directory fails. */ public DirectoryDelegate(@Nonnull File dir, @Nonnull DirectoryDelegate parent) throws RemoteException { super(); this.localCache = new ReferenceMap(); this.dir = dir; this.parent = parent; }
@PostConstruct @SuppressWarnings("unchecked") public void init() throws Exception { getLogger().info("JamesMailStore init..."); repositories = new ReferenceMap(); classes = new HashMap<String, String>(); defaultConfigs = new HashMap<String, HierarchicalConfiguration>(); List<HierarchicalConfiguration> registeredClasses = configuration.configurationsAt("mailrepositories.mailrepository"); for (int i = 0; i < registeredClasses.size(); i++) { registerRepository(registeredClasses.get(i)); } }
@Override protected ThreadLocal<ReferenceMap> getGrammarPoolCache() { return GRAMMAR_POOL_CACHE; }
private XmlValueHandlerUtils() { cache = new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.HARD); }
/** * 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<T> itf) { cache = new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.SOFT); this.itf = itf; }
public JRFillCellContents(JRBaseFiller filler, JRCellContents cell, String cellType, JRFillCrosstabObjectFactory factory) { super(filler, cell, factory); defaultStyleProvider = factory.getDefaultStyleProvider(); parentCell = cell; this.cellType = cellType; int elementId = filler.getFillContext().generateFillElementId(); printElementOriginator = new DefaultPrintElementOriginator(elementId); 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<BoxContents,JRFillCellContents>(); clonePool = new JRClonePool(this, true, true); }
protected JRFillCellContents(JRFillCellContents cellContents, JRFillCloneFactory factory) { super(cellContents, factory); defaultStyleProvider = cellContents.defaultStyleProvider; parentCell = cellContents.parentCell; cellType = cellContents.cellType; printElementOriginator = cellContents.printElementOriginator; 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<BoxContents,JRFillCellContents>(); clonePool = new JRClonePool(this, true, true); verticalPositionType = cellContents.verticalPositionType; }
/** * This implementation spares its clients from the unspecified, * generally chaotic ordering provided by normally Struct , * without incurring the increased cost associated with TreeMap. * It can be used to produce a copy of a map that has the same order as the original * @param type * @param initialCapacity initial capacity - MUST be a power of two. */ public StructImpl(int type, int initialCapacity) { if(type==TYPE_WEAKED) map=new SyncMap<Collection.Key, Object>(new WeakHashMapPro<Collection.Key,Object>(initialCapacity)); else if(type==TYPE_SOFT) map=new SyncMap<Collection.Key, Object>(new MapProWrapper<Collection.Key, Object>(new ReferenceMap(ReferenceMap.HARD,ReferenceMap.SOFT,initialCapacity,0.75f),new SerializableObject())); else if(type==TYPE_LINKED) map=new SyncMap<Collection.Key, Object>(new LinkedHashMapPro<Collection.Key,Object>(initialCapacity)); else map=MapFactory.getConcurrentMap(initialCapacity); }
protected abstract ThreadLocal<ReferenceMap> getGrammarPoolCache();