1 17 package org.apache.slide.event; 18 19 import org.apache.slide.common.Domain; 20 import org.apache.slide.store.ExtendedStore; 21 import org.apache.slide.store.Store; 22 import org.apache.slide.util.logger.Logger; 23 24 29 public class UncacheModifiedUriListener implements UriModifiedListener { 30 31 public static final String LOG_CHANNEL = UncacheModifiedUriListener.class.getName(); 32 33 public UncacheModifiedUriListener() { 34 Domain.log( "Creating UncacheModifiedUriListener.", LOG_CHANNEL, Logger.DEBUG ); 35 } 36 37 public void modified(UriModifiedEvent event) { 38 Store store = event.getUri().getStore(); 39 43 if ( store instanceof ExtendedStore ) { 44 ((ExtendedStore)store).removeObjectFromCache( event.getUri() ); 45 } else { 46 Domain.log( 47 "Invalid store type " + store + " while uncaching " + event.getUri().toString(), 48 LOG_CHANNEL, 49 Logger.WARNING ); 50 } 51 } 52 53 } 54 | Popular Tags |