001package org.intellimate.izou.output; 002 003import com.google.common.reflect.TypeToken; 004import org.intellimate.izou.events.EventModel; 005import org.intellimate.izou.identification.Identifiable; 006import org.intellimate.izou.identification.Identification; 007 008/** 009 * The OutputPlugin class gets Event and then starts threads filled with output-extension tasks to create the final 010 * output and then render it on its own medium 011 */ 012public interface OutputPluginModel<X, T> extends Runnable, Identifiable { 013 /** 014 * Adds an event to blockingQueue 015 * 016 * @param event the event to add 017 * @throws IllegalStateException raised if problems adding an event to blockingQueue 018 */ 019 void addToEventList(EventModel event); 020 021 /** 022 * callback method to notify that an OutputExtension was added 023 * @param identification the Identification of the OutputExtension added 024 */ 025 void outputExtensionAdded(Identification identification); 026 027 /** 028 * callback method to notify that an OutputExtension was added 029 * @param identification the Identification of the OutputExtension added 030 */ 031 void outputExtensionRemoved(Identification identification); 032 033 /** 034 * returns whether the OutputPlugin is running 035 * @return true if it is running, false if not 036 */ 037 boolean isRunning(); 038 039 /** 040 * stops the OutputPlugin 041 */ 042 void stop(); 043 044 /** 045 * returns the Type of the one wants to receive from the OutputExtensions 046 * @return the type of the generic 047 */ 048 //i don't think there is another way 049 TypeToken<T> getReceivingType(); 050 051 /** 052 * returns the Type of the argument for the OutputExtensions, or null if none 053 * @return the type of the Argument 054 */ 055 //i don't think there is another way 056 TypeToken<X> getArgumentType(); 057}