Package org.hobbit.core.components
Class AbstractDataGenerator
java.lang.Object
org.hobbit.core.components.AbstractComponent
org.hobbit.core.components.AbstractCommandReceivingComponent
org.hobbit.core.components.AbstractPlatformConnectorComponent
org.hobbit.core.components.AbstractDataGenerator
- All Implemented Interfaces:
Closeable,AutoCloseable,CommandReceivingComponent,Component,PlatformConnector
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate intprotected DataSenderprotected DataSenderprivate SemaphoreFields inherited from class org.hobbit.core.components.AbstractCommandReceivingComponent
cmdChannel, cmdQueueFactory, cmdResponseTimeout, DEFAULT_CMD_RESPONSE_TIMEOUT, defaultContainerType, gson, reportUnhandledExceptionsFields inherited from class org.hobbit.core.components.AbstractComponent
configuration, connectionFactory, incomingDataQueueFactory, NUMBER_OF_RETRIES_TO_CONNECT_TO_RABBIT_MQ, outgoingDataQueuefactory, rabbitMQHostName, START_WAITING_TIME_BEFORE_RETRY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected abstract voidintintvoidinit()This method initializes the component.voidreceiveCommand(byte command, byte[] data) This method is called if a command is received and might be interesting for this particular component.voidrun()This method executes the component.protected voidsendDataToSystemAdapter(byte[] data) protected voidsendDataToTaskGenerator(byte[] data) Methods inherited from class org.hobbit.core.components.AbstractPlatformConnectorComponent
addContainerObserver, createContainer, getFactoryForIncomingCmdQueues, getFactoryForIncomingDataQueues, getFactoryForOutgoingCmdQueues, getFactoryForOutgoingDataQueues, stopContainerMethods inherited from class org.hobbit.core.components.AbstractCommandReceivingComponent
addCommandHeaderId, createContainer, createContainer, createContainer, createContainerAsync, createContainerAsync, extendContainerEnvVariables, getCmdResponseTimeout, handleCmd, handleCmd, isReportUnhandledExceptions, reportAndWrap, reportError, reportErrorSavely, reportExceptionSavely, reportUnhandledExceptionSavely, sendToCmdQueue, sendToCmdQueue, sendToCmdQueue, setCmdResponseTimeout, setReportUnhandledExceptionsMethods inherited from class org.hobbit.core.components.AbstractComponent
createConnection, generateSessionQueueName, getConfiguration, getHobbitSessionId, setConfigurationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hobbit.core.components.Component
setConfiguration
-
Field Details
-
startDataGenMutex
-
generatorId
private int generatorId -
numberOfGenerators
private int numberOfGenerators -
sender2TaskGen
-
sender2System
-
-
Constructor Details
-
AbstractDataGenerator
public AbstractDataGenerator()
-
-
Method Details
-
init
Description copied from interface:ComponentThis method initializes the component.- Specified by:
initin interfaceComponent- Overrides:
initin classAbstractCommandReceivingComponent- Throws:
Exception- if an error occurs during the initialization
-
run
Description copied from interface:ComponentThis method executes the component.- Throws:
Exception- if an error occurs during the execution
-
generateData
- Throws:
Exception
-
receiveCommand
public void receiveCommand(byte command, byte[] data) Description copied from interface:CommandReceivingComponentThis method is called if a command is received and might be interesting for this particular component.- Specified by:
receiveCommandin interfaceCommandReceivingComponent- Overrides:
receiveCommandin classAbstractPlatformConnectorComponent- Parameters:
command- the byte encoding the commanddata- additional data that was sent together with the command
-
sendDataToTaskGenerator
- Throws:
IOException
-
sendDataToSystemAdapter
- Throws:
IOException
-
getGeneratorId
public int getGeneratorId() -
getNumberOfGenerators
public int getNumberOfGenerators() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classAbstractCommandReceivingComponent- Throws:
IOException
-