Interface DistributedProcessService
-
- All Known Implementing Classes:
DefaultDistributedProcessService
public interface DistributedProcessServiceProcess responsible for managing distributed process.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <T extends DistributedProcessModel>
Tcreate(ProcessCreationData data)Creates process based onProcessCreationDatadefault ProcessStatusgetCurrentStatus(java.lang.String processCode)Get current status of distributed process<T extends DistributedProcessModel>
TrequestToStop(java.lang.String processCode)Mark process with given code as requested to stop.<T extends DistributedProcessModel>
Tstart(java.lang.String processCode)Starts process with given code<T extends DistributedProcessModel>
Twait(java.lang.String processCode, long maxWaitTimeInSeconds)Wait for process to be finished.
-
-
-
Method Detail
-
create
<T extends DistributedProcessModel> T create(ProcessCreationData data)
Creates process based onProcessCreationData- Parameters:
data- process creation data- Returns:
- created process
-
start
<T extends DistributedProcessModel> T start(java.lang.String processCode)
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
<T extends DistributedProcessModel> T requestToStop(java.lang.String processCode)
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(java.lang.String processCode, long maxWaitTimeInSeconds) throws java.lang.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.java.lang.InterruptedException
-
getCurrentStatus
default ProcessStatus getCurrentStatus(java.lang.String processCode)
Get current status of distributed process- Parameters:
processCode- code of process- Returns:
- current status
-
-