public abstract class AbstractSystemAdapter extends AbstractPlatformConnectorComponent implements GeneratedDataReceivingComponent, TaskReceivingComponent
| 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 |
dataGenReceiver
Receiver for data coming from the data generator.
|
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 of a single queue that are
processed in parallel.
|
protected DataSender |
sender2EvalStore
Sender for sending messages from the benchmarked system to the evaluation
storage.
|
protected org.apache.jena.rdf.model.Model |
systemParamModel
The RDF model containing the system parameters.
|
protected DataReceiver |
taskGenReceiver
Receiver for tasks coming from the task generator.
|
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 |
|---|
AbstractSystemAdapter()
Constructor using the
DEFAULT_MAX_PARALLEL_PROCESSED_MESSAGES=
100. |
AbstractSystemAdapter(int maxParallelProcessedMsgs)
Constructor setting the maximum number of messages processed in parallel.
|
| 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,
byte[] data)
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, waitreceiveGeneratedDatareceiveGeneratedTaskprivate static final org.slf4j.Logger LOGGER
private static final int DEFAULT_MAX_PARALLEL_PROCESSED_MESSAGES
maxParallelProcessedMsgs attribute.private Semaphore terminateMutex
private Exception cause
private final int maxParallelProcessedMsgs
protected DataReceiver dataGenReceiver
protected DataReceiver taskGenReceiver
protected DataSender sender2EvalStore
protected org.apache.jena.rdf.model.Model systemParamModel
public AbstractSystemAdapter()
DEFAULT_MAX_PARALLEL_PROCESSED_MESSAGES=
100.public AbstractSystemAdapter(int maxParallelProcessedMsgs)
maxParallelProcessedMsgs - The maximum number of incoming messages of a single queue that
are processed in parallel. Additional messages have to wait.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 sendResultToEvalStorage(String taskIdString, byte[] data) throws IOException
taskIdString - the id of the taskdata - the data of the taskIOException - if there is an error during the sendingprotected 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.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class AbstractCommandReceivingComponentIOExceptionCopyright © 2017–2018. All rights reserved.