@Service(value="blProcessStatusManager") public class ProcessStatusManagerImpl extends Object implements org.springframework.context.ApplicationContextAware, ProcessStatusManager, org.springframework.context.SmartLifecycle
ProcessStatusManager
Modifier and Type | Field and Description |
---|---|
protected org.springframework.context.event.ApplicationEventMulticaster |
applicationEventMulticaster |
protected org.springframework.context.ApplicationContext |
context |
protected org.broadleafcommerce.common.id.service.IdGenerationService |
idGenerationService |
protected long |
jobThreadPoolCount |
protected Map<Long,ProcessStatus> |
processes |
protected ConsumeWorker |
processGroomWorker |
protected ConsumeWorker |
processKeepAliveWorker |
protected ProcessManagementDao |
processManagementDao |
protected boolean |
processManagerEnabled |
protected long |
processManagerStatusUpdateIntervalSeconds |
protected org.quartz.Scheduler |
scheduler |
protected org.broadleafcommerce.common.util.StreamingTransactionCapableUtil |
transUtil |
Constructor and Description |
---|
ProcessStatusManagerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
dropProcess()
Remove the process from the list of currently active processes on this server.
|
void |
endProcess()
Finish a process when the async thread of execution is complete.
|
void |
endProcess(boolean immediateRemove)
Finish a process when the async thread of execution is complete.
|
int |
getPhase() |
Map<Long,ProcessStatus> |
getProcesses()
Return the list of currently active processes on this server.
|
boolean |
isAutoStartup() |
boolean |
isRunning() |
void |
pauseProcess()
Remove the process from the list of currently active processes on this server and set the state to true
for isPaused in the database.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setExecution(Long executionId,
String executionType)
Set the information that associates a specific async thread of execution with a ProcessStatus instance.
|
void |
setProgress(long count,
long total)
|
void |
start() |
void |
startProcess(String name,
String friendlyName,
String description)
Add a new arbitrary ProcessStatus to the list of currently active processes on this server.
|
void |
startProcess(String name,
String friendlyName,
String description,
Boolean isPaused)
Add a new arbitrary ProcessStatus to the list of currently active processes on this server.
|
void |
startProcess(String name,
String friendlyName,
String description,
String executionType,
Long executionId)
Add a new arbitrary ProcessStatus to the list of currently active processes on this server.
|
void |
startProcess(String name,
String friendlyName,
String description,
String executionType,
Long executionId,
Boolean isPaused)
Add a new arbitrary ProcessStatus to the list of currently active processes on this server.
|
void |
startProcess(SystemEvent event)
Add a new ProcessStatus to the list of currently active processes on this server.
|
void |
stop() |
void |
stop(Runnable callback) |
boolean |
supportsResume(Long processId)
Detects if a ProcessStatus can be resumed.
|
void |
unPauseProcess(Long processId)
Sets the isPaused state to false for the ProcessStatus.
|
protected org.broadleafcommerce.common.util.StreamingTransactionCapableUtil transUtil
@Value(value="${process.manager.enabled:true}") protected boolean processManagerEnabled
@Value(value="${process.manager.status.update.interval.seconds:5}") protected long processManagerStatusUpdateIntervalSeconds
protected org.broadleafcommerce.common.id.service.IdGenerationService idGenerationService
protected ProcessManagementDao processManagementDao
protected org.springframework.context.event.ApplicationEventMulticaster applicationEventMulticaster
protected ConsumeWorker processKeepAliveWorker
protected ConsumeWorker processGroomWorker
protected org.springframework.context.ApplicationContext context
protected long jobThreadPoolCount
protected org.quartz.Scheduler scheduler
protected Map<Long,ProcessStatus> processes
public boolean isAutoStartup()
isAutoStartup
in interface org.springframework.context.SmartLifecycle
public void stop(Runnable callback)
stop
in interface org.springframework.context.SmartLifecycle
public void start()
start
in interface org.springframework.context.Lifecycle
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
public int getPhase()
getPhase
in interface org.springframework.context.Phased
getPhase
in interface org.springframework.context.SmartLifecycle
public void stop()
stop
in interface org.springframework.context.Lifecycle
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public void startProcess(SystemEvent event)
ProcessStatusManager
DatabaseSystemEventNodeImpl
when consuming an event.startProcess
in interface ProcessStatusManager
public void startProcess(String name, String friendlyName, String description)
ProcessStatusManager
startProcess
in interface ProcessStatusManager
public void startProcess(String name, String friendlyName, String description, Boolean isPaused)
ProcessStatusManager
startProcess
in interface ProcessStatusManager
public void startProcess(String name, String friendlyName, String description, String executionType, Long executionId)
ProcessStatusManager
startProcess
in interface ProcessStatusManager
public void startProcess(String name, String friendlyName, String description, String executionType, Long executionId, Boolean isPaused)
ProcessStatusManager
startProcess
in interface ProcessStatusManager
public void endProcess()
ProcessStatusManager
endProcess
in interface ProcessStatusManager
public void endProcess(boolean immediateRemove)
ProcessStatusManager
endProcess
in interface ProcessStatusManager
public void pauseProcess()
ProcessStatusManager
ProcessStatus.getLastUpdated()
is no longer updated. Note, this does nothing to actually stop the async thread of execution. Paused processes
are not eligible for abandoned process handling until the ProcessStatusManager.unPauseProcess(Long)
method is called.pauseProcess
in interface ProcessStatusManager
public void dropProcess()
ProcessStatusManager
ProcessStatus.getLastUpdated()
is no longer updated.
Note, this does nothing to actually stop the async thread of execution. Dropped processes
are eligible for abandoned process handling after their age threshold expiration.dropProcess
in interface ProcessStatusManager
public void setProgress(long count, long total)
ProcessStatusManager
setProgress
in interface ProcessStatusManager
public void setExecution(Long executionId, String executionType)
ProcessStatusManager
setExecution
in interface ProcessStatusManager
executionId
- an identifying long id (e.g. the primary key from an entity used in the async thread of execution)executionType
- an identifying tyep value (e.g. the class name from an entity used in the async thread of execution)public void unPauseProcess(Long processId)
ProcessStatusManager
HandleAbandonedProcessEvent
listener for this ProcessStatus.getExecutionType()
will cause the
resumption of execution.unPauseProcess
in interface ProcessStatusManager
public boolean supportsResume(Long processId)
ProcessStatusManager
HandleAbandonedProcessEvent
that supports
the ProcessStatus.getExecutionType()
implement the
HandleAbandonedProcessEventListener
interface.supportsResume
in interface ProcessStatusManager
public Map<Long,ProcessStatus> getProcesses()
ProcessStatusManager
ProcessStatus.getProcessId()
.getProcesses
in interface ProcessStatusManager
Copyright © 2020. All rights reserved.