Class ProcessingUnitRunnable
- java.lang.Object
-
- com.github.toolarium.processing.unit.runtime.runnable.impl.AbstractProcessingUnitRunnable
-
- com.github.toolarium.processing.unit.runtime.runnable.impl.ProcessingUnitRunnable
-
- All Implemented Interfaces:
IProcessingUnitRunnable,java.lang.Runnable
- Direct Known Subclasses:
TestProcessingUnitRunnable
public class ProcessingUnitRunnable extends AbstractProcessingUnitRunnable implements java.lang.Runnable
Implements aIProcessingUnitRunnable.
-
-
Constructor Summary
Constructors Constructor Description ProcessingUnitRunnable(byte[] suspendedState, IProcessingUnitRunnableListener processingUnitRunnableListener)ConstructorProcessingUnitRunnable(java.lang.String id, java.lang.String name, java.lang.Class<? extends IProcessingUnit> processingUnitClass, java.util.List<Parameter> parameterList, IProcessingUnitContext processingUnitContext, IProcessingUnitRunnableListener processingUnitRunnableListener)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ProcessingUnitProxycreateProcessingUnitProxy()Create processing unit proxyprotected com.github.toolarium.common.bandwidth.IBandwidthThrottlinggetProcessingUnitThrottling()Get the processing unit throttlingbyte[]getSuspendedState()Get suspended statevoidrun()voidsetProcessingUnitThrottling(java.lang.Long maxNumberOfProcessingUnitCallsPerSecond)Defines the max calls per second to throttle the processing unitvoidsuspendProcessing()Suspend processingprotected voidthrottlingProcessing()Throttling the processing if its defined and neededjava.lang.StringtoString()-
Methods inherited from class com.github.toolarium.processing.unit.runtime.runnable.impl.AbstractProcessingUnitRunnable
afterProcessUnit, getId, getName, getParameterList, getProcessingActionStatus, getProcessingRuntimeStatus, getProcessingUnitContext, getProcessingUnitProgress, getProcessingUnitProxy, getStatusMessageList, getTimeDifferenceFormatter, getTimeMeasurement, notifyProcessingUnitState, setProcessingActionStatus, setProcessingUnitProxy, setProcessingUnitRunnableListener
-
-
-
-
Constructor Detail
-
ProcessingUnitRunnable
public ProcessingUnitRunnable(java.lang.String id, java.lang.String name, java.lang.Class<? extends IProcessingUnit> processingUnitClass, java.util.List<Parameter> parameterList, IProcessingUnitContext processingUnitContext, IProcessingUnitRunnableListener processingUnitRunnableListener)Constructor- Parameters:
id- the unique id of this processingname- the name of this processing unit runnableprocessingUnitClass- the processing unit classparameterList- the parameter listprocessingUnitContext- the processing context.processingUnitRunnableListener- the processing unit runnable listener- Throws:
ValidationException- This will be throw in case the consistency check failures.ProcessingException- Throws this exception in case of initialization failures.
-
ProcessingUnitRunnable
public ProcessingUnitRunnable(byte[] suspendedState, IProcessingUnitRunnableListener processingUnitRunnableListener)Constructor- Parameters:
suspendedState- the suspended stateprocessingUnitRunnableListener- the processing unit runnable listener- Throws:
ValidationException- This will be throw in case the consistency check failures.ProcessingException- Throws this exception in case of initialization failures.
-
-
Method Detail
-
createProcessingUnitProxy
protected ProcessingUnitProxy createProcessingUnitProxy()
Create processing unit proxy- Overrides:
createProcessingUnitProxyin classAbstractProcessingUnitRunnable- Returns:
- the processing unit proxy
-
setProcessingUnitThrottling
public void setProcessingUnitThrottling(java.lang.Long maxNumberOfProcessingUnitCallsPerSecond)
Defines the max calls per second to throttle the processing unit- Parameters:
maxNumberOfProcessingUnitCallsPerSecond- the max number of processing units per second
-
suspendProcessing
public void suspendProcessing()
Suspend processing
-
getSuspendedState
public byte[] getSuspendedState()
Get suspended state- Returns:
- the suspended state
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable- See Also:
Runnable.run()
-
throttlingProcessing
protected void throttlingProcessing()
Throttling the processing if its defined and needed
-
getProcessingUnitThrottling
protected com.github.toolarium.common.bandwidth.IBandwidthThrottling getProcessingUnitThrottling()
Get the processing unit throttling- Returns:
- the processing unit throttling
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
-