예제 #1
0
 /**
  * Convenience method to add an object with its key to the cache. This creates the CachedObject
  * wrapper to manage its state. If the object already exists in the cache, it updates its value.
  *
  * @param cacheable
  * @return
  */
 public CachedObject add(Cacheable cacheable) {
   Identifier key = cacheable.getIdentifier();
   CachedObject co = get(key);
   if (co == null) {
     co = new CachedObject();
     co.setKey(key.toString());
     put(key, co);
   }
   co.setValue(cacheable);
   return co;
 }