Interface IProcessingUnit
-
- All Known Implementing Classes:
AbstractProcessingUnitImpl
public interface IProcessingUnitDefines the processing unit interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<ParameterDefinition>getParameterDefinition()Gets the parameter definition list of the processing.voidinitialize(java.util.List<Parameter> parameterList, IProcessingUnitContext processingUnitContext)Initializes the processing unit.voidonStop()This method will be called in case on a stop before.voidonSuccess()This method will be called after a success end.IProcessStatusprocessUnit(IProcessingUnitContext processingUnitContext)Process unit: This method will be called until theIProcessStatus.hasNext()returns false.voidreleaseResource()Release resources will be called to release all internal referenced resources after a processing success, error or by asuspendProcessing(see method below).voidresumeProcessing(java.util.List<Parameter> parameterList, IProcessingProgress processingProgress, IProcessingPersistence processingPersistence, IProcessingUnitContext processingUnitContext)After suspending a processing unit can be resumed.IProcessingPersistencesuspendProcessing()Suspends the processing: The processing is able to persist its state with the help of theIProcessingPersistenceobject.voidvalidateParameterList(java.util.List<Parameter> parameterList)Validate the parameter list consistency of this class with the parameters.
-
-
-
Method Detail
-
getParameterDefinition
java.util.List<ParameterDefinition> getParameterDefinition()
Gets the parameter definition list of the processing.- Returns:
- the parameter definition list or null in case of no parameters
-
validateParameterList
void validateParameterList(java.util.List<Parameter> parameterList) throws ValidationException
Validate the parameter list consistency of this class with the parameters. Typical it will be called during the initialization. It can be used to verify if the parameter of this processing are well defined.- Parameters:
parameterList- the parameter list.- Throws:
ValidationException- This will be throw in case the consistency check failures.
-
initialize
void initialize(java.util.List<Parameter> parameterList, IProcessingUnitContext processingUnitContext) throws ValidationException, ProcessingException
Initializes the processing unit. This will called as first to initialize the processing unit.- Parameters:
parameterList- the parameter list to run the processing.processingUnitContext- the processing context.- Throws:
ValidationException- This will be throw in case the consistency check failures.ProcessingException- Throws this exception in case of initialization failures.
-
processUnit
IProcessStatus processUnit(IProcessingUnitContext processingUnitContext) throws ProcessingException
Process unit: This method will be called until theIProcessStatus.hasNext()returns false. Important: this method have to process the sequential or in a small block size.- Parameters:
processingUnitContext- the processing unit context.- Returns:
- the process status
- Throws:
ProcessingException- In case of any failures occurs.
-
onSuccess
void onSuccess()
This method will be called after a success end.
-
onStop
void onStop()
This method will be called in case on a stop before.
-
releaseResource
void releaseResource() throws ProcessingExceptionRelease resources will be called to release all internal referenced resources after a processing success, error or by asuspendProcessing(see method below). It will be called afteronSuccessoronStop.- Throws:
ProcessingException- Throws this exception in case of releasing failure.
-
suspendProcessing
IProcessingPersistence suspendProcessing() throws ProcessingException
Suspends the processing: The processing is able to persist its state with the help of theIProcessingPersistenceobject. On a resume this instance of theIProcessingPersistencewill be returned (see method below).- Returns:
- the processing persistence which contains all information to resume processing later (see resumeProcessing).
- Throws:
ProcessingException- Throws this exception in case of while suspend the processing any failures occurs.
-
resumeProcessing
void resumeProcessing(java.util.List<Parameter> parameterList, IProcessingProgress processingProgress, IProcessingPersistence processingPersistence, IProcessingUnitContext processingUnitContext) throws ProcessingException
After suspending a processing unit can be resumed. The parameter list of the initialization is passed as well theIProcessingPersistencewhich was returned by the suspendProcessing method.- Parameters:
parameterList- the starting parametersprocessingProgress- the last processing progress before suspending.processingPersistence- the processing persistence to resume after suspending.processingUnitContext- the processing unit context- Throws:
ProcessingException- Throws this exception in case of while resume the processing any failures occurs.
-
-