Cacheladeprogramm

Im folgenden Beispiel wird die Klasse 'CacheLoaderAdapter' für die Implementierung von 'MyCacheLoader' verwendet.

Abbildung 1. 'CacheLoaderAdapter' zur Implementierung des Cacheladeprogramms verwenden
...
public class MyCacheLoader extends
    CacheLoaderAdapter<Integer, ReadWorkQueueDetails> {
  /* (non-Javadoc)
   * @see curam.util.cache.CacheLoader#load(java.lang.Object)
   */
  public ReadWorkQueueDetails load(Integer workQueueID)
       throws AppException, InformationalException {
    WorkAllocation wa = (WorkAllocation)WorkAllocationFactory
                                   .newInstance();
    ReadWorkQueueKey key = new ReadWorkQueueKey();
    key.key = new ReadWorkQueueKey();
    key.key.key = new WorkQueueKey();
    key.key.key.workQueueID = workQueueID;
    ReadWorkQueueDetails item = wa.readWorkQueue(key);
    if(item != null) {
      return item.dtls;
    }
    return null;
  }
}
...