Closeable, AutoCloseable, CommandReceivingComponent, Component, PlatformConnectorpublic abstract class AbstractDataGenerator extends AbstractPlatformConnectorComponent
| Modifier and Type | Field | Description |
|---|---|---|
private int |
generatorId |
|
private int |
numberOfGenerators |
|
protected DataSender |
sender2System |
|
protected DataSender |
sender2TaskGen |
|
private Semaphore |
startDataGenMutex |
cmdChannel, cmdQueueFactory, defaultContainerTypeconnectionFactory, incomingDataQueueFactory, NUMBER_OF_RETRIES_TO_CONNECT_TO_RABBIT_MQ, outgoingDataQueuefactory, rabbitMQHostName, START_WAITING_TIME_BEFORE_RETRY| Constructor | Description |
|---|---|
AbstractDataGenerator() |
| Modifier and Type | Method | 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) |
addCommandHeaderId, createContainer, createContainer, handleCmd, sendToCmdQueue, sendToCmdQueue, sendToCmdQueuecreateConnection, generateSessionQueueName, getHobbitSessionIdaddContainerObserver, createContainer, getFactoryForIncomingCmdQueues, getFactoryForIncomingDataQueues, getFactoryForOutgoingCmdQueues, getFactoryForOutgoingDataQueues, stopContainerprivate 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 AutoCloseableclose in interface Closeableclose in class AbstractCommandReceivingComponentIOExceptionCopyright © 2017. All rights reserved.