|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jlf.dataMap.DataObject | +--org.jlf.dataMap.DataMappedObject | +--org.jlf.dataMap.CachedObject
This class is used to cache
DataMappedObject
instances read
from the default data source.
DataMappedObject
,
Serialized FormField Summary | |
protected static java.lang.String |
READ_ALL_CACHE_NAME
The "read all" cache is a vector which holds ALL instances of the object, so they are kept in the correct order. |
protected static java.lang.String |
READ_ONE_CACHE_NAME
The "read one" cache is used to cache individual instances of objects. |
Fields inherited from class org.jlf.dataMap.DataObject |
ATTRIBUTE_DESCRIPTOR_VECTOR_VARIABLE_NAME, attributes, INITIAL_ATTRIBUTE_DESCRIPTOR_HASHTABLE_SIZE, INITIAL_ATTRIBUTE_HASHTABLE_SIZE |
Constructor Summary | |
CachedObject()
|
Method Summary | |
protected void |
addObjectsToReadOneCache(java.util.Vector dmos)
Adds all elements of the vector into the read one cache. |
protected void |
addObjectToReadOneCache(DataMappedObject dmo)
Adds one entry to the read one cache |
java.util.Vector |
findAll()
Quick accessor method to read all of this particular object's type from the default data location. |
DataMappedObject |
findByPrimaryKey()
Quick accessor method to read one object of this particular object's type from the default data location, using its already populated primary key. |
protected DataMappedObject |
findByPrimaryKeyFromCache()
Tries to find an entry in the read one cache which matches the primary key of this object. |
protected int |
getCacheSizeAllocation()
This method is used to size the cache so it is not too large (wasted cache entries) or small (cache has to grow at a performance hit). |
protected java.util.Vector |
getReadAllCache()
Get the "read all" cache. |
protected java.util.Hashtable |
getReadOneCache()
Get the "read one" cache. |
protected void |
setReadAllCache(java.util.Vector dmos)
Sets all elements of the read all cache vector to the objects passed in the input vector. |
Methods inherited from class org.jlf.dataMap.DataObject |
attributeEquals, basicGetAttributeDescriptors, equals, getAllAttributeNames, getAttribute, getAttributeDescriptor, getAttributeDescriptors, getAttributeValue, getDoubleAttribute, getLongAttribute, getStringAttribute, hasAttributeDefined, hashCode, setAttributeValue, setDoubleAttribute, setLongAttribute, setStringAttribute |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static java.lang.String READ_ONE_CACHE_NAME
protected static java.lang.String READ_ALL_CACHE_NAME
Constructor Detail |
public CachedObject()
Method Detail |
protected int getCacheSizeAllocation()
protected java.util.Hashtable getReadOneCache()
protected java.util.Vector getReadAllCache()
protected DataMappedObject findByPrimaryKeyFromCache()
protected void addObjectToReadOneCache(DataMappedObject dmo)
protected void addObjectsToReadOneCache(java.util.Vector dmos)
protected void setReadAllCache(java.util.Vector dmos)
public DataMappedObject findByPrimaryKey()
This method is an override of the superclass to additionally try to find the object in the "read one" cache first instead of going directly to the data source.
findByPrimaryKey
in class DataMappedObject
public java.util.Vector findAll()
This method overrides the superclass to try and see if the cache is populated. If it is, it returns the cache. if not, it tries to populate the cache.
findAll
in class DataMappedObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |