T
- the type of the ArgumentX
- the return typepublic abstract class OutputPluginArgument<T,X> extends AddOnModule implements OutputPluginModel<T,X>, ThreadPoolUser
Constructor and Description |
---|
OutputPluginArgument(Context context,
String id)
creates a new output-plugin with a new id
|
Modifier and Type | Method and Description |
---|---|
void |
addToEventList(EventModel event)
Adds an event to blockingQueue
|
EventModel |
blockingQueueHandling()
Default implementation waits until a new Event has been received and then processes it.
|
abstract T |
getArgument()
returns the argument for the OutputExtensions
|
com.google.common.reflect.TypeToken<T> |
getArgumentType()
returns the Type of the argument for the OutputExtensions, or null if none
|
BlockingQueue<EventModel> |
getEventBlockingQueue()
gets the blocking-queue that stores the backlog of Events
|
List<Identification> |
getOutputExtensionList()
get the outputExtensionList
|
com.google.common.reflect.TypeToken<X> |
getReceivingType()
returns the Type of the one wants to receive from the OutputExtensions
|
int |
getTimeoutLimit()
gets the timeout-limit in Milliseconds
|
void |
handleFutures(List<CompletableFuture<X>> futures,
EventModel eventModel) |
void |
isDone(EventModel event) |
boolean |
isRunning() |
void |
outputExtensionAdded(Identification identification)
callback method to notify that an OutputExtension was added
|
void |
outputExtensionRemoved(Identification identification)
callback method to notify that an OutputExtension was added
|
abstract void |
renderFinalOutput(List<X> data,
EventModel eventModel)
method that uses tDoneList to generate a final output that will then be rendered.
|
void |
run()
main method for outputPlugin, runs the data-conversion and output-renderer
it will instruct the outputManager to let the outputExtensions generate the data.
|
void |
stop() |
void |
terminate()
terminates the outputPlugin (will not listen to events anymore)
|
getContext, getID
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getID, isOwner
submit, submit, submit, submitRun, timeOut, timeOut
debug, debug, error, error, getContext
debug, debug, error, error, fatal, fatal, warn, warn
exceptionThrown
public OutputPluginArgument(Context context, String id)
context
- contextid
- the id of the new output-pluginpublic List<Identification> getOutputExtensionList()
public BlockingQueue<EventModel> getEventBlockingQueue()
public void outputExtensionAdded(Identification identification)
outputExtensionAdded
in interface OutputPluginModel<T,X>
identification
- the Identification of the OutputExtension addedpublic void outputExtensionRemoved(Identification identification)
outputExtensionRemoved
in interface OutputPluginModel<T,X>
identification
- the Identification of the OutputExtension addedpublic com.google.common.reflect.TypeToken<X> getReceivingType()
getReceivingType
in interface OutputPluginModel<T,X>
public com.google.common.reflect.TypeToken<T> getArgumentType()
getArgumentType
in interface OutputPluginModel<T,X>
public void addToEventList(EventModel event)
addToEventList
in interface OutputPluginModel<T,X>
event
- the event to addIllegalStateException
- raised if problems adding an event to blockingQueuepublic boolean isRunning()
isRunning
in interface OutputPluginModel<T,X>
public void stop()
stop
in interface OutputPluginModel<T,X>
public void isDone(EventModel event)
event
- the current processed Eventpublic void terminate()
public void handleFutures(List<CompletableFuture<X>> futures, EventModel eventModel)
public void run()
public EventModel blockingQueueHandling() throws InterruptedException
InterruptedException
- if interrupted while waitingpublic int getTimeoutLimit()
public abstract void renderFinalOutput(List<X> data, EventModel eventModel)
data
- the data generatedeventModel
- the Event which caused the whole thingpublic abstract T getArgument()
Copyright © 2016. All rights reserved.