001    package com.hammurapi.review;
002    
003    /**
004     * Reporters consume review observations.
005     * @author Pavel Vlasov
006     * @param <M> Model type.
007     */
008    public interface Reporter<M> {
009    
010            /**
011             * Creates observation sink for a module.
012             * @param moduleName
013             * @param customConfig
014             * @param model
015             * @return
016             * @throws ReviewException
017             */
018            ObservationSink createObservationSink(Module module) throws ReviewException;
019            
020            /**
021             * This method is invoked when exception is thrown before model and observation sinks are constructed.
022             * @param moduleName
023             * @param e
024             */
025            void onException(Exception e);
026            
027            /**
028             * Closes reporter.
029             * @throws ReviewException
030             */
031            void close() throws ReviewException;
032    }