Class InMemoryJobService
- java.lang.Object
-
- org.kie.kogito.services.jobs.impl.InMemoryJobService
-
- All Implemented Interfaces:
AutoCloseable,JobsService
- Direct Known Subclasses:
LegacyInMemoryJobService
public class InMemoryJobService extends Object implements JobsService, AutoCloseable
-
-
Field Summary
Fields Modifier and Type Field Description static StringIN_MEMORY_JOB_SERVICE_POOL_SIZE_PROPERTYprotected ConcurrentHashMap<String,ScheduledFuture<?>>scheduledJobsprotected ScheduledThreadPoolExecutorschedulerprotected static StringTRIGGERprotected UnitOfWorkManagerunitOfWorkManager
-
Constructor Summary
Constructors Modifier Constructor Description protectedInMemoryJobService(Processes processes, UnitOfWorkManager unitOfWorkManager)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected longcalculateDelay(JobDescription description)booleancancelJob(String id)booleancancelJob(String id, boolean force)voidclose()static InMemoryJobServiceget(Processes processes, UnitOfWorkManager unitOfWorkManager)RunnablegetSignalProcessInstanceCommand(ProcessInstanceJobDescription description, boolean remove, int limit)protected RunnableprocessJobByDescription(ProcessJobDescription description)protected RunnablerepeatableProcessJobByDescription(ProcessJobDescription description)StringscheduleProcessInstanceJob(ProcessInstanceJobDescription description)StringscheduleProcessJob(ProcessJobDescription description)
-
-
-
Field Detail
-
IN_MEMORY_JOB_SERVICE_POOL_SIZE_PROPERTY
public static final String IN_MEMORY_JOB_SERVICE_POOL_SIZE_PROPERTY
- See Also:
- Constant Field Values
-
TRIGGER
protected static final String TRIGGER
- See Also:
- Constant Field Values
-
scheduler
protected final ScheduledThreadPoolExecutor scheduler
-
unitOfWorkManager
protected final UnitOfWorkManager unitOfWorkManager
-
scheduledJobs
protected ConcurrentHashMap<String,ScheduledFuture<?>> scheduledJobs
-
-
Constructor Detail
-
InMemoryJobService
protected InMemoryJobService(Processes processes, UnitOfWorkManager unitOfWorkManager)
-
-
Method Detail
-
get
public static InMemoryJobService get(Processes processes, UnitOfWorkManager unitOfWorkManager)
-
scheduleProcessJob
public String scheduleProcessJob(ProcessJobDescription description)
- Specified by:
scheduleProcessJobin interfaceJobsService
-
scheduleProcessInstanceJob
public String scheduleProcessInstanceJob(ProcessInstanceJobDescription description)
- Specified by:
scheduleProcessInstanceJobin interfaceJobsService
-
getSignalProcessInstanceCommand
public Runnable getSignalProcessInstanceCommand(ProcessInstanceJobDescription description, boolean remove, int limit)
-
cancelJob
public boolean cancelJob(String id)
- Specified by:
cancelJobin interfaceJobsService
-
cancelJob
public boolean cancelJob(String id, boolean force)
-
calculateDelay
protected long calculateDelay(JobDescription description)
-
processJobByDescription
protected Runnable processJobByDescription(ProcessJobDescription description)
-
repeatableProcessJobByDescription
protected Runnable repeatableProcessJobByDescription(ProcessJobDescription description)
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-