Search in sources :

Example 1 with Cacheable

use of org.vcell.util.Cacheable in project vcell by virtualcell.

the class DBCacheTable method getCloned.

public synchronized Cacheable getCloned(KeyValue key) {
    TimeWrapper timeWrapper = (TimeWrapper) hashTable.get(key);
    if (timeWrapper != null) {
        DbObjectWrapper objWrapper = (DbObjectWrapper) timeWrapper.getObject();
        Cacheable cacheable = objWrapper.getClonedCopy();
        // System.out.println("DBCacheTable.get: "+cacheable.getClass().getName());
        return cacheable;
    } else {
        // System.out.println("DBCacheTable.get: null");
        return null;
    }
}
Also used : TimeWrapper(org.vcell.util.TimeWrapper) Cacheable(org.vcell.util.Cacheable)

Example 2 with Cacheable

use of org.vcell.util.Cacheable in project vcell by virtualcell.

the class DBCacheTable method get.

public synchronized Cacheable get(KeyValue key) {
    TimeWrapper timeWrapper = (TimeWrapper) hashTable.get(key);
    if (timeWrapper != null) {
        DbObjectWrapper objWrapper = (DbObjectWrapper) timeWrapper.getObject();
        Cacheable cacheable = objWrapper.getWorkingCopy();
        // System.out.println("DBCacheTable.get: "+cacheable.getClass().getName());
        return cacheable;
    } else {
        // System.out.println("DBCacheTable.get: null");
        return null;
    }
}
Also used : TimeWrapper(org.vcell.util.TimeWrapper) Cacheable(org.vcell.util.Cacheable)

Aggregations

Cacheable (org.vcell.util.Cacheable)2 TimeWrapper (org.vcell.util.TimeWrapper)2