Пример #1
0
 public JarSnapshot get(byte[] key, final Factory<JarSnapshot> factory) {
   return new JarSnapshot(
       cache.get(
           key,
           new Factory<JarSnapshotData>() {
             public JarSnapshotData create() {
               return factory.create().getData();
             }
           }));
 }
Пример #2
0
 public Map<File, JarSnapshot> getJarSnapshots(final Map<File, byte[]> jarHashes) {
   return cache
       .getCacheAccess()
       .useCache(
           "loading jar snapshots",
           new Factory<Map<File, JarSnapshot>>() {
             public Map<File, JarSnapshot> create() {
               final Map<File, JarSnapshot> out = new HashMap<File, JarSnapshot>();
               for (Map.Entry<File, byte[]> entry : jarHashes.entrySet()) {
                 JarSnapshot snapshot = new JarSnapshot(cache.getCache().get(entry.getValue()));
                 out.put(entry.getKey(), snapshot);
               }
               return out;
             }
           });
 }
Пример #3
0
 public void stop() {
   cache.stop();
 }