public abstract class AbstractDataGenerator extends AbstractPlatformConnectorComponent
| Modifier and Type | Field and Description |
|---|---|
private int |
generatorId |
private int |
numberOfGenerators |
protected DataSender |
sender2System |
protected DataSender |
sender2TaskGen |
private Semaphore |
startDataGenMutex |
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 |
|---|
AbstractDataGenerator() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected abstract void |
generateData() |
int |
getGeneratorId() |
int |
getNumberOfGenerators() |
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 |
sendDataToSystemAdapter(byte[] data) |
protected void |
sendDataToTaskGenerator(byte[] data) |
addContainerObserver, createContainer, getFactoryForIncomingCmdQueues, getFactoryForIncomingDataQueues, getFactoryForOutgoingCmdQueues, getFactoryForOutgoingDataQueues, stopContaineraddCommandHeaderId, createContainer, createContainer, handleCmd, sendToCmdQueue, sendToCmdQueue, sendToCmdQueuecreateConnection, generateSessionQueueName, getHobbitSessionIdprivate Semaphore startDataGenMutex
private int generatorId
private int numberOfGenerators
protected DataSender sender2TaskGen
protected DataSender sender2System
public void init()
throws Exception
Componentinit in interface Componentinit in class AbstractCommandReceivingComponentException - if an error occurs during the initializationpublic void run()
throws Exception
ComponentException - if an error occurs during the executionpublic 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 sendDataToTaskGenerator(byte[] data)
throws IOException
IOExceptionprotected void sendDataToSystemAdapter(byte[] data)
throws IOException
IOExceptionpublic int getGeneratorId()
public int getNumberOfGenerators()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class AbstractCommandReceivingComponentIOExceptionCopyright © 2017–2018. All rights reserved.