public abstract class AbstractDataGenerator extends AbstractPlatformConnectorComponent
| Modifier and Type | Field and Description |
|---|---|
protected RabbitQueue |
dataGen2SystemQueue |
protected RabbitQueue |
dataGen2TaskGenQueue |
private int |
generatorId |
private static org.slf4j.Logger |
LOGGER |
private int |
numberOfGenerators |
private Semaphore |
startDataGenMutex |
cmdChannel, defaultContainerTypeconnection, NUMBER_OF_RETRIES_TO_CONNECT_TO_RABBIT_MQ, 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) |
createContainer, createDefaultRabbitQueue, stopContaineraddCommandHeaderId, createContainer, createContainer, handleCmd, sendToCmdQueue, sendToCmdQueue, sendToCmdQueuegenerateSessionQueueName, getHobbitSessionIdprivate static final org.slf4j.Logger LOGGER
private Semaphore startDataGenMutex
private int generatorId
private int numberOfGenerators
protected RabbitQueue dataGen2TaskGenQueue
protected RabbitQueue dataGen2SystemQueue
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. All rights reserved.