1 17 package org.apache.slide.event; 18 19 import org.apache.slide.common.Domain; 20 import org.apache.slide.common.Uri; 21 import org.apache.slide.util.conf.Configurable; 22 import org.apache.slide.util.conf.Configuration; 23 import org.apache.slide.util.conf.ConfigurationException; 24 import org.apache.slide.util.logger.Logger; 25 26 30 public class ContentModifiedNotifier extends ContentAdapter implements 31 Configurable { 32 33 protected static final String LOG_CHANNEL = ContentModifiedNotifier.class.getName(); 34 35 public ContentModifiedNotifier() { 36 Domain.log( "Creating ContentModifiedNotifier", LOG_CHANNEL, Logger.DEBUG ); 37 } 38 39 public void create( ContentEvent event ) { 40 notify( event ); 41 } 42 43 public void fork( ContentEvent event ) { 44 notify( event ); 46 } 47 48 public void merge( ContentEvent event ) { 49 notify( event ); 51 } 52 53 public void remove( ContentEvent event ) { 54 notify( event ); 55 } 56 57 public void retrieve( ContentEvent event ) { 58 notify( event ); 59 } 60 61 public void store( ContentEvent event ) { 62 notify( event ); 63 } 64 65 public void configure(Configuration configuration) 66 throws ConfigurationException { 67 70 } 71 72 public void notify( ContentEvent event ) { 73 77 Domain.log( "Called ContentModifiedNotifier.notify for " + event.getUri(), LOG_CHANNEL, Logger.DEBUG ); 78 if ( UriModifiedEvent.URIMODIFIED.isEnabled() ) { 79 EventDispatcher.getInstance().fireEvent( 80 UriModifiedEvent.URIMODIFIED, new UriModifiedEvent(this, new Uri( event.getNamespace(), event.getUri() ))); 81 } else { 82 Domain.log( "Can't notify, UriModifiedEvent is disabled.", LOG_CHANNEL, Logger.DEBUG ); 83 } 84 } 85 86 } 87 | Popular Tags |