Example usage for org.apache.commons.collections.map ReferenceIdentityMap ReferenceIdentityMap

List of usage examples for org.apache.commons.collections.map ReferenceIdentityMap ReferenceIdentityMap

Introduction

In this page you can find the example usage for org.apache.commons.collections.map ReferenceIdentityMap ReferenceIdentityMap.

Prototype

public ReferenceIdentityMap(int keyType, int valueType, boolean purgeValues) 

Source Link

Document

Constructs a new ReferenceIdentityMap that will use the specified types of references.

Usage

From source file:org.apache.ojb.broker.core.IdentityFactoryImpl.java

public IdentityFactoryImpl(PersistenceBroker broker) {
    this.broker = broker;
    this.objectToIdentityMap = new ReferenceIdentityMap(ReferenceIdentityMap.WEAK, ReferenceIdentityMap.HARD,
            true);//w w  w . j ava  2s. co  m
    this.transientSequenceManager = new SequenceManagerTransientImpl(broker);
    broker.addListener(this, true);
}

From source file:org.apache.ojb.broker.metadata.fieldaccess.AnonymousPersistentField.java

protected void putToFieldCache(Object key, Object value) {
    if (key != null) {
        if (fkCache == null) {
            fkCache = new ReferenceIdentityMap(ReferenceIdentityMap.WEAK, ReferenceIdentityMap.HARD, true);
        }//from  ww  w  .  java2  s  .  c o m
        if (value != null)
            fkCache.put(key, value);
        else
            fkCache.remove(key);
    }
}