public abstract class AbstractStreamingSystemAdapter extends AbstractPlatformConnectorComponent implements StreamingGeneratedDataReceivingComponent, TaskReceivingComponent
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractStreamingSystemAdapter.GeneratedDataHandler
A simple internal handler class that calls
StreamingGeneratedDataReceivingComponent.receiveGeneratedData(InputStream) with
the given InputStream. |
protected class |
AbstractStreamingSystemAdapter.GeneratedTaskHandler
A simple internal handler class that calls
AbstractStreamingTaskGenerator.generateTask(InputStream) with the
given InputStream. |
| Modifier and Type | Field and Description |
|---|---|
private Exception |
cause
The cause for an unusual termination.
|
private Semaphore |
causeMutex
Mutex used to manage access to the
cause object. |
protected DataReceiver |
dataReceiver |
private static int |
DEFAULT_MAX_PARALLEL_PROCESSED_MESSAGES
Default value of the
maxParallelProcessedMsgs attribute. |
private static org.slf4j.Logger |
LOGGER |
private int |
maxParallelProcessedMsgs
The maximum number of incoming messages that are processed in parallel.
|
protected DataSender |
sender2EvalStore |
protected org.apache.jena.rdf.model.Model |
systemParamModel
The RDF model containing the system parameters.
|
protected DataReceiver |
taskReceiver |
private Semaphore |
terminateMutex
Mutex used to wait for the terminate signal.
|
cmdChannel, cmdQueueFactory, DEFAULT_CMD_RESPONSE_TIMEOUT, defaultContainerTypeconnectionFactory, incomingDataQueueFactory, NUMBER_OF_RETRIES_TO_CONNECT_TO_RABBIT_MQ, outgoingDataQueuefactory, rabbitMQHostName, START_WAITING_TIME_BEFORE_RETRY| Constructor and Description |
|---|
AbstractStreamingSystemAdapter() |
AbstractStreamingSystemAdapter(DataSender sender2EvalStore,
DataReceiver dataReceiver,
DataReceiver taskReceiver) |
AbstractStreamingSystemAdapter(int maxParallelProcessedMsgs) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
init()
This method initializes the component.
|
void |
receiveCommand(byte command,
byte[] data)
This method is called if a command is received and might be interesting
for this particular component.
|
void |
run()
This method executes the component.
|
protected void |
sendResultToEvalStorage(String taskIdString,
InputStream dataStream)
This method sends the given result data for the task with the given task id
to the evaluation storage.
|
protected void |
terminate(Exception cause)
Starts termination of the main thread of this system adapter.
|
addContainerObserver, createContainer, getFactoryForIncomingCmdQueues, getFactoryForIncomingDataQueues, getFactoryForOutgoingCmdQueues, getFactoryForOutgoingDataQueues, stopContaineraddCommandHeaderId, createContainer, createContainer, handleCmd, sendToCmdQueue, sendToCmdQueue, sendToCmdQueuecreateConnection, generateSessionQueueName, getHobbitSessionIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreceiveGeneratedDatareceiveGeneratedTaskreceiveGeneratedTaskprivate static final org.slf4j.Logger LOGGER
private static final int DEFAULT_MAX_PARALLEL_PROCESSED_MESSAGES
maxParallelProcessedMsgs attribute.private Semaphore terminateMutex
private final int maxParallelProcessedMsgs
protected org.apache.jena.rdf.model.Model systemParamModel
protected DataSender sender2EvalStore
protected DataReceiver dataReceiver
protected DataReceiver taskReceiver
private Exception cause
public AbstractStreamingSystemAdapter()
public AbstractStreamingSystemAdapter(int maxParallelProcessedMsgs)
public AbstractStreamingSystemAdapter(DataSender sender2EvalStore, DataReceiver dataReceiver, DataReceiver taskReceiver)
public void init()
throws Exception
Componentinit in interface Componentinit in class AbstractCommandReceivingComponentException - if an error occurs during the initializationpublic void run()
throws Exception
Componentpublic void receiveCommand(byte command,
byte[] data)
CommandReceivingComponentreceiveCommand in interface CommandReceivingComponentreceiveCommand in class AbstractPlatformConnectorComponentcommand - the byte encoding the commanddata - additional data that was sent together with the commandprotected void terminate(Exception cause)
cause - the cause for an abortion of the process or {code null} if the
component should terminate in a normal way.protected void sendResultToEvalStorage(String taskIdString, InputStream dataStream) throws IOException
taskIdString - the id of the taskdata - the data of the taskIOException - if there is an error during the sendingpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class AbstractCommandReceivingComponentIOExceptionCopyright © 2017–2018. All rights reserved.