org.mycore.common.events
Interface MCREventHandler

All Known Implementing Classes:
MCRAccessEventHandler, MCRContentIndexEventHandler, MCRDataExtractor, MCRDataExtractorJPEG, MCRDataExtractorMP3, MCRDataExtractorPDF, MCREventHandlerBase, MCRImgCacheEventHandler, MCRIndexBrowserEventHandler, MCRIViewEventHandler, MCRJDOMEventHandlerIndexMeta, MCRJDOMSearcher, MCRLinkTableEventHandler, MCRLuceneSearcher, MCROldLuceneSearcher, MCRRemoveAclEventHandler, MCRSearcher, MCRXMLTableEventHandler

public interface MCREventHandler

Objects that implement this interface can react when some kind of predefined event happens in MyCoRe. Implementing classes are registered using the configuration property MCR.EventHandler.[objType].X.Class=[package and class name] where [objType] is the object type like "MCRObject" or "MCRFile" and X is a number starting from 1. For event handlers that are indexers of the searcher package, there is a special syntax MCR.EventHandler.[objType].X.Indexer=[searcherID] where [searcherID] is the ID of the searcher that also is an indexer. Event handlers are called in the same order as they are registered in the properties file.

Author:
Frank Lützenkirchen

Method Summary
 void doHandleEvent(MCREvent evt)
          Handles an event.
 void undoHandleEvent(MCREvent evt)
          Handles rollback of event handling.
 

Method Detail

doHandleEvent

void doHandleEvent(MCREvent evt)
                   throws MCRException
Handles an event. The handler is responsible for filtering the event type it is interested in and wants to react on.

Parameters:
evt - the Event object containing information about the event
Throws:
MCRException

undoHandleEvent

void undoHandleEvent(MCREvent evt)
                     throws MCRException
Handles rollback of event handling. The handler should roll back the changes that previously were made for this event, because a successor in the event handler list caused an exception.

Parameters:
evt - the Event object containing information about the event
Throws:
MCRException