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

The following examples show how to use org.ehcache.event.EventType#EVICTED . 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: ListenerObject.java    From ehcache3 with Apache License 2.0 5 votes vote down vote up
@Override
public void onEvent(CacheEvent<? extends Object, ? extends Object> event) {
  Logger logger = LoggerFactory.getLogger(Ehcache.class + "-" + "GettingStarted");
  logger.info(event.getType().toString());
  if(event.getType() == EventType.EVICTED){
    evicted++;
  }
}
 
Example 4
Source File: StoreEvents.java    From ehcache3 with Apache License 2.0 4 votes vote down vote up
public static <K, V> StoreEvent<K, V> evictEvent(K key, V oldValue) {
  return new StoreEventImpl<>(EventType.EVICTED, key, oldValue, null);
}
 
Example 5
Source File: CacheEvents.java    From ehcache3 with Apache License 2.0 4 votes vote down vote up
@Override
public EventType getType() {
  return EventType.EVICTED;
}