public class DefaultTaskService extends Object implements TaskService
| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultTaskService.PoolingQueueSizeGauge |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_POLLING_INTERVAL |
static int |
DEFAULT_SHUTDOWN_WAIT |
static int |
DEFAULT_WORKER_MAX |
static String |
POOLING_QUEUE_SIZE_METRIC |
static String |
POOLING_TIME_METRIC |
static String |
PROCESSING_HITS_METRIC |
static String |
PROCESSING_MISSES_METRIC |
static String |
PROCESSING_TIME_METRIC |
static String |
QUEUE_SIZE_METRIC |
BEAN_ID| Constructor and Description |
|---|
DefaultTaskService() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkSystemOK() |
protected void |
checkTask(TaskModel toBeScheduled) |
protected void |
checkTaskConditions(TaskModel toBeScheduled,
TaskConditionModel cond) |
void |
destroy()
Shut down this component
|
TaskEngine |
getEngine() |
protected TaskExecutionStrategy |
getExecutionStrategy(TaskRunner<? extends TaskModel> runner) |
protected DefaultTaskService.PoolingQueueSizeGauge |
getPoolingQueueSizeGauge() |
protected TaskRunner |
getRunner(String runnerBean) |
protected TaskRunner |
getRunner(Task task) |
protected TaskDAO |
getTaskDao() |
protected Tenant |
getTenant() |
void |
init()
Starts up this component
|
protected boolean |
isAllowedToStart() |
protected boolean |
isAllowedToStart(int clusterId) |
boolean |
isRunning() |
protected void |
markTaskFailed(Task task) |
protected void |
poll() |
protected void |
process(de.hybris.platform.task.impl.DefaultTaskService.VersionPK versionPK) |
protected void |
processCondition(TaskCondition cond) |
protected void |
processInTenant(de.hybris.platform.task.impl.DefaultTaskService.VersionPK versionPK) |
protected void |
processTask(Task task,
de.hybris.platform.task.impl.DefaultTaskService.VersionPK versionPK) |
protected Set<Integer> |
readExcludedNodesFromConfig() |
protected int |
readMaxWorkersFromConfig() |
protected int |
readPollingIntervalFromConfig() |
protected int |
readShutdownWaitFromConfig() |
protected int |
readWorkersIdleFromConfig() |
void |
repoll(Integer nodeId,
String nodeGroupId) |
protected void |
scheduleRetry(Task task,
Date nextExecution,
int turn) |
protected boolean |
scheduleRetryIfAllowed(Task task,
RetryLaterException e) |
void |
scheduleTask(TaskModel task)
Schedule a task.
|
void |
setEventService(EventService eventService) |
void |
setFlexibleSearchService(FlexibleSearchService flexibleSearchService) |
void |
setMetricRegistry(MetricRegistry metricRegistry) |
void |
setModelService(ModelService modelService) |
void |
setScheduleAndTriggerStrategy(ScheduleAndTriggerStrategy scheduleAndTriggerStrategy) |
void |
setTaskDao(TaskDAO dao) |
void |
setTaskExecutionStrategies(Collection<? extends TaskExecutionStrategy> taskExecutionStrategies) |
void |
setTypeService(TypeService typeService) |
List<de.hybris.platform.task.impl.DefaultTaskService.VersionPK> |
toVersionPKsList(List<List<Long>> records) |
void |
triggerEvent(String uniqueId)
Trigger an event on task module.
|
void |
triggerEvent(String uniqueId,
Date expirationDate)
Trigger an event on task module.
|
boolean |
triggerEvent(TaskEvent event)
Trigger event on task module.
|
void |
triggerRepoll(Integer nodeId,
String nodeGroupId)
Triggers re-poll at the specified cluster node.
|
protected void |
triggerRepollAfterSchedule(Date scheduledDate,
Integer nodeId,
String nodeGroupId) |
protected void |
waitAndRunExclusiveAction(String info,
Runnable action) |
public static final int DEFAULT_WORKER_MAX
public static final int DEFAULT_POLLING_INTERVAL
public static final int DEFAULT_SHUTDOWN_WAIT
public static final String QUEUE_SIZE_METRIC
public static final String PROCESSING_TIME_METRIC
public static final String PROCESSING_HITS_METRIC
public static final String PROCESSING_MISSES_METRIC
public static final String POOLING_TIME_METRIC
public static final String POOLING_QUEUE_SIZE_METRIC
public void setModelService(ModelService modelService)
public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
public void setTypeService(TypeService typeService)
public void setEventService(EventService eventService)
public void setScheduleAndTriggerStrategy(ScheduleAndTriggerStrategy scheduleAndTriggerStrategy)
public void setMetricRegistry(MetricRegistry metricRegistry)
public TaskEngine getEngine()
getEngine in interface TaskServicepublic boolean isRunning()
public void triggerRepoll(Integer nodeId, String nodeGroupId)
nodeId - the cluster node idpublic void triggerEvent(String uniqueId)
TaskServicetriggerEvent in interface TaskServiceuniqueId - unique id of eventpublic void triggerEvent(String uniqueId, Date expirationDate)
TaskServicetriggerEvent in interface TaskServiceuniqueId - unique id of eventexpirationDate - expiration date - when reached the task condition created after event send and beforepublic boolean triggerEvent(TaskEvent event)
TaskServicetriggerEvent in interface TaskServiceevent - event to be triggeredtrue if operation succeeded or false if event has been already triggeredpublic void scheduleTask(TaskModel task)
TaskServicescheduleTask in interface TaskServicetask - task to schedule.protected void triggerRepollAfterSchedule(Date scheduledDate, Integer nodeId, String nodeGroupId)
protected void checkTask(TaskModel toBeScheduled)
protected void checkTaskConditions(TaskModel toBeScheduled, TaskConditionModel cond)
protected boolean isAllowedToStart()
protected boolean isAllowedToStart(int clusterId)
protected boolean checkSystemOK()
public void init()
protected TaskDAO getTaskDao()
public void setTaskDao(TaskDAO dao)
protected int readPollingIntervalFromConfig()
protected int readMaxWorkersFromConfig()
protected int readWorkersIdleFromConfig()
protected int readShutdownWaitFromConfig()
public void destroy()
public List<de.hybris.platform.task.impl.DefaultTaskService.VersionPK> toVersionPKsList(List<List<Long>> records)
protected void poll()
protected DefaultTaskService.PoolingQueueSizeGauge getPoolingQueueSizeGauge()
protected void processInTenant(de.hybris.platform.task.impl.DefaultTaskService.VersionPK versionPK)
protected void process(de.hybris.platform.task.impl.DefaultTaskService.VersionPK versionPK)
protected void processCondition(TaskCondition cond)
protected void processTask(Task task, de.hybris.platform.task.impl.DefaultTaskService.VersionPK versionPK)
protected boolean scheduleRetryIfAllowed(Task task, RetryLaterException e)
protected void markTaskFailed(Task task)
protected TaskRunner getRunner(Task task)
protected TaskRunner getRunner(String runnerBean) throws IllegalStateException
IllegalStateExceptionprotected Tenant getTenant()
protected TaskExecutionStrategy getExecutionStrategy(TaskRunner<? extends TaskModel> runner)
public void setTaskExecutionStrategies(Collection<? extends TaskExecutionStrategy> taskExecutionStrategies)
Copyright © 2017 SAP SE. All Rights Reserved.