Java Code Examples for org.ehcache.event.EventType#UPDATED

The following examples show how to use org.ehcache.event.EventType#UPDATED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EventNotificationTest.java    From ehcache3 with Apache License 2.0 6 votes vote down vote up
@Override
public void onEvent(CacheEvent<? extends Object, ? extends Object> event) {
  Logger logger = LoggerFactory.getLogger(Ehcache.class + "-" + "EventNotificationTest");
  logger.info(event.getType().toString());
  eventTypeHashMap.put(event.getType(), eventCounter.get());
  eventCounter.getAndIncrement();
  if(event.getType() == EventType.EVICTED){
    evicted.getAndIncrement();
  }
  if(event.getType() == EventType.CREATED){
    created.getAndIncrement();
  }
  if(event.getType() == EventType.UPDATED){
    updated.getAndIncrement();
  }
  if(event.getType() == EventType.REMOVED){
    removed.getAndIncrement();
  }
  if(event.getType() == EventType.EXPIRED){
    expired.getAndIncrement();
  }
}
 
Example 2
Source File: EventNotificationTest.java    From ehcache3 with Apache License 2.0 6 votes vote down vote up
@Override
public void onEvent(final CacheEvent<? extends Object, ? extends Object> event) {
  Logger logger = LoggerFactory.getLogger(EventNotificationTest.class + "-" + "EventNotificationTest");
  logger.info(event.getType().toString());
  if(event.getType() == EventType.EVICTED){
    evicted.getAndIncrement();
  }
  if(event.getType() == EventType.CREATED){
    created.getAndIncrement();
  }
  if(event.getType() == EventType.UPDATED){
    updated.getAndIncrement();
  }
  if(event.getType() == EventType.REMOVED){
    removed.getAndIncrement();
  }
  if(event.getType() == EventType.EXPIRED){
    expired.getAndIncrement();
  }
  latch.countDown();
}
 
Example 3
Source File: StoreEvents.java    From ehcache3 with Apache License 2.0 4 votes vote down vote up
public static <K, V> StoreEvent<K, V> updateEvent(K key, V oldValue, V newValue) {
  return new StoreEventImpl<>(EventType.UPDATED, key, oldValue, newValue);
}
 
Example 4
Source File: CacheEvents.java    From ehcache3 with Apache License 2.0 4 votes vote down vote up
@Override
public EventType getType() {
  return EventType.UPDATED;
}
 
Example 5
Source File: IsUpdated.java    From ehcache3 with Apache License 2.0 4 votes vote down vote up
public boolean matches(CacheEvent<K, V> event) {
  return (event.getType() == EventType.UPDATED);
}