Interface DistributedProcessService
- All Known Implementing Classes:
DefaultDistributedProcessService
public interface DistributedProcessService
Process responsible for managing distributed process.
-
Method Summary
Modifier and TypeMethodDescription<T extends DistributedProcessModel>
Tcreate(ProcessCreationData data) Creates process based onProcessCreationDatadefault ProcessStatusgetCurrentStatus(String processCode) Get current status of distributed process<T extends DistributedProcessModel>
TrequestToStop(String processCode) Mark process with given code as requested to stop.<T extends DistributedProcessModel>
TStarts process with given code<T extends DistributedProcessModel>
TWait for process to be finished.
-
Method Details
-
create
Creates process based onProcessCreationData- Parameters:
data- process creation data- Returns:
- created process
-
start
Starts process with given code- Parameters:
processCode- code of process to be started- Returns:
- started process
- Throws:
ProcessConcurrentlyModifiedException- when process was modified (e.g. started) in other thread.
-
requestToStop
Mark process with given code as requested to stop. It doesn't stop the process.- Parameters:
processCode- code of process to be stopped- Returns:
- process
- Throws:
ProcessConcurrentlyModifiedException- when process was modified in other thread.
-
wait
<T extends DistributedProcessModel> T wait(String processCode, long maxWaitTimeInSeconds) throws InterruptedException Wait for process to be finished. Process is considered as finish if it's in stateDistributedProcessState.SUCCEEDED,DistributedProcessState.STOPPEDorDistributedProcessState.FAILED. It wait's for a given time and if it returns caller need to check whether the process is really finished.- Parameters:
processCode- code of process to be waited formaxWaitTimeInSeconds- time in seconds- Returns:
- process
- Throws:
ProcessConcurrentlyModifiedException- when process was modified in other thread.InterruptedException
-
getCurrentStatus
Get current status of distributed process- Parameters:
processCode- code of process- Returns:
- current status
-