@SuppressWarnings("unchecked") private Map<Serializable, IEntity> createContractStoreMap() { return new ReferenceMap(AbstractReferenceMap.ReferenceStrength.HARD, AbstractReferenceMap.ReferenceStrength.WEAK, true); }
private <K, V> Map<K, V> createSoftHashMap() { return new ReferenceMap<K, V>(AbstractReferenceMap.ReferenceStrength.SOFT, AbstractReferenceMap.ReferenceStrength.HARD); } }
public BidiReferenceMap(AbstractReferenceMap.ReferenceStrength keyType, AbstractReferenceMap.ReferenceStrength valueType, int capacity, float loadFactor, boolean purgeValues){ super(new ReferenceMap<K,V>(keyType,valueType,capacity,loadFactor,purgeValues), new ReferenceMap<V,K>(keyType,valueType,capacity,loadFactor,purgeValues),null); }//end constructor()
private <K, V> Map<K, V> createSoftHashMap() { return new ReferenceMap<K, V>(AbstractReferenceMap.ReferenceStrength.SOFT, AbstractReferenceMap.ReferenceStrength.HARD); } }
protected Map getCacheTimeStep(TimeStep step) { Object key = step; if (step == null) { key = NULL; } Map result = (Map)cache.get(key); if (result == null) { result = new ReferenceMap(ReferenceStrength.HARD, ReferenceStrength.SOFT); cache.put(key, result); } return result; }
public LocatorLookup(String qname, TransactionIF txn, TopicMapIF tm, int lrusize, E nullObject) { this.qname = qname; this.txn = txn; this.tm = tm; this.lrusize = lrusize; this.cache = new ReferenceMap<LocatorIF, E>(AbstractReferenceMap.ReferenceStrength.SOFT, AbstractReferenceMap.ReferenceStrength.HARD); this.lru = new LRUMap<LocatorIF, E>(lrusize); NULLOBJECT = nullObject; }
public QueryLookup(String qname, TransactionIF txn, int lrusize, V nullObject) { this.qname = qname; this.txn = txn; this.cache = new ReferenceMap(AbstractReferenceMap.ReferenceStrength.SOFT, AbstractReferenceMap.ReferenceStrength.HARD); this.lru = new LRUMap(lrusize); NULLOBJECT = nullObject; }
/** * Constructs a new {@code BasicRemotePeerRegistry} instance. */ @SuppressWarnings("unchecked") public BasicRemotePeerRegistry() { backingStore = new RemotePeerReferenceMap(AbstractReferenceMap.ReferenceStrength.WEAK, AbstractReferenceMap.ReferenceStrength.WEAK, true); automationBackingStore = new ReferenceMap(AbstractReferenceMap.ReferenceStrength.WEAK, AbstractReferenceMap.ReferenceStrength.WEAK, true); automationIndices = new HashMap<>(); setAutomationEnabled(true); }
AbstractTransaction(String id, StorageAccessIF access) { this.id = id; this.access = access; this.mapping = access.getStorage().getMapping(); // Map containing named queries this.querymap = new HashMap<String, QueryIF>(); // Identity map - maintains the relationships between object // identities and the single(ton) instances used with the // transaction. This enforces the constraint that only one // instance per object identity should exist at a given time in a // transaction. // NOTE: Even though it's the keys that are garbage collected // there is a strict mapping between IdentityIF and PersistentIF // that lets us do this, i.e. the objects reference their // identities, so the identity will not be garbage collected as // long as the object is reachable. this.identity_map = new ReferenceMap<IdentityIF, PersistentIF>(AbstractReferenceMap.ReferenceStrength.HARD, AbstractReferenceMap.ReferenceStrength.SOFT); log.debug(getId() + ": Transaction created."); this.timestamp = System.currentTimeMillis(); }