* StoreIdentifier sid is found.
*/
public StorableObject use(StoreIdentifier sid) {
- StorableObject storeObject=null;
- StoreContainer stoc = getStoreContainerForSid( sid );
- if (stoc!=null) storeObject=stoc.use(sid);
- else System.out.println("Warning: container not found for: " + sid.toString());
- if (storeObject==null) storeMiss++; else storeHit++;
- return storeObject;
+ if (sid!=null ) {
+ StorableObject storeObject=null;
+ StoreContainer stoc = getStoreContainerForSid( sid );
+ if (stoc!=null) storeObject=stoc.use(sid);
+ else System.out.println("Warning: container not found for: " + sid.toString());
+ if (storeObject!=null) storeHit++;
+ return storeObject;
+ }
+ storeMiss++; return null;
+
}
/**
* sto and invalidates all relevant cache entries.
*/
- public void invalidate(StorableObject sto) {
+ public void invalidate(StoreIdentifier sid) {
// propagate invalidation to StoreContainer
- if (sto!=null) {
- StoreIdentifier sid = sto.getStoreIdentifier();
- if (sto!=null) {
- StoreContainer stoc = getStoreContainerForSid(sid);
- stoc.invalidate(sto);
- }
+ if (sid!=null) {
+ StoreContainer stoc = getStoreContainerForSid(sid);
+ stoc.invalidate(sid);
}
}
+ /**
+ * Method: invalidate(StoreContainerType)
+ * Description: serves to invalidate a whole StoreContainer
+ *
+ * @return
+ */
+ public void invalidate(StoreContainerType stoc_type) {
+ if ( stoc_type != null ) {
+ StoreContainer stoc = getStoreContainerForStocType(stoc_type);
+ if ( stoc!=null )
+ stoc.invalidate();
+ }
+
+ }
+
// internal methods for StoreContainer managment
/**
// find apropriate container for a specific sid
if (sid!=null) {
StoreContainerType stoc_type = sid.getStoreContainerType();
- if ( containerMap.containsKey(stoc_type) )
- return (StoreContainer)containerMap.get(stoc_type);
+ return getStoreContainerForStocType(stoc_type);
}
return null;
}
+ private StoreContainer getStoreContainerForStocType(StoreContainerType stoc_type) {
+ if ( stoc_type!=null && containerMap.containsKey(stoc_type) )
+ return (StoreContainer)containerMap.get(stoc_type);
+ return null;
+ }
+
/**
* Method: implementsStorableObject
* Description: internall helper method to find out if a class implements
*
* @return String
*/
- private String version() { return "00.d4";}
+ private String version() { return "00.d5";}
}
\ No newline at end of file