@Test public void example() throws InterruptedException { AsyncListenerExample.example(); }
public static void example() throws InterruptedException { final StringDAO stringDAO = new StringDAO(); final Cache<String, String> cache = CacheBuilder.heapCache() .evictionListener(new ScheduledEvictionListener<String, String>() { @Override public void save(List<CacheTask<String, String>> cacheTasks) { for (final CacheTask<String, String> task : cacheTasks) { stringDAO.update(task.getKey(), task.getValue()); } } }).build(); cache.put("key", "value"); }
AsyncListenerExample { public static void example() throws InterruptedException { final StringDAO stringDAO = new StringDAO(); final Cache<String, String> cache = CacheBuilder.heapCache() .evictionListener(new ScheduledEvictionListener<String, String>() { @Override public void save(List<CacheTask<String, String>> cacheTasks) { for (final CacheTask<String, String> task : cacheTasks) { stringDAO.update(task.getKey(), task.getValue()); } } }).build(); cache.put("key", "value"); } }
AsyncListenerExample { public static void example() throws InterruptedException { final StringDAO stringDAO = new StringDAO(); final Cache<String, String> cache = CacheBuilder.heapCache() .evictionListener(new ScheduledEvictionListener<String, String>() { @Override public void save(List<CacheTask<String, String>> cacheTasks) { for (final CacheTask<String, String> task : cacheTasks) { stringDAO.update(task.getKey(), task.getValue()); } } }).build(); cache.put("key", "value"); }  }
AsyncListenerExample { public static void example() throws InterruptedException { final StringDAO stringDAO = new StringDAO(); final Cache<String, String> cache = CacheBuilder.heapCache() .evictionListener(new ScheduledEvictionListener<String, String>() { @Override public void save(List<CacheTask<String, String>> cacheTasks) { for (final CacheTask<String, String> task : cacheTasks) { stringDAO.update(task.getKey(), task.getValue()); } } }).build(); cache.put("key", "value"); }  static void example(); static void main(String[] args); }
AsyncListenerExample { public static void example() throws InterruptedException { final StringDAO stringDAO = new StringDAO(); final Cache<String, String> cache = CacheBuilder.heapCache() .evictionListener(new ScheduledEvictionListener<String, String>() { @Override public void save(List<CacheTask<String, String>> cacheTasks) { for (final CacheTask<String, String> task : cacheTasks) { stringDAO.update(task.getKey(), task.getValue()); } } }).build(); cache.put("key", "value"); }  static void example(); static void main(String[] args);  }