接口 NacosTaskExecuteEngine<T extends NacosTask>
- 所有超级接口:
Closeable
Nacos task execute engine.
- 作者:
- xiweng.yy
-
方法概要
修饰符和类型方法说明voidaddProcessor(Object key, NacosTaskProcessor taskProcessor)Add task processorNacosTaskProcessorfor execute engine.voidAdd task into execute pool.Get all processor key.Get all task keys.getProcessor(Object key)Try to getNacosTaskProcessorby key, if non-exist, will return default processor.booleanisEmpty()Whether the execute engine is empty.voidremoveProcessor(Object key)Remove task processorNacosTaskProcessorform execute engine for key.removeTask(Object key)Remove task.voidsetDefaultTaskProcessor(NacosTaskProcessor defaultTaskProcessor)Set default task processor.intsize()Get Task size in execute engine.
-
方法详细资料
-
size
int size()Get Task size in execute engine.- 返回:
- size of task
-
isEmpty
boolean isEmpty()Whether the execute engine is empty.- 返回:
- true if the execute engine has no task to do, otherwise false
-
addProcessor
Add task processorNacosTaskProcessorfor execute engine.- 参数:
key- key of tasktaskProcessor- task processor
-
removeProcessor
Remove task processorNacosTaskProcessorform execute engine for key.- 参数:
key- key of task
-
getProcessor
Try to getNacosTaskProcessorby key, if non-exist, will return default processor.- 参数:
key- key of task- 返回:
- task processor for task key or default processor if task processor for task key non-exist
-
getAllProcessorKey
Collection<Object> getAllProcessorKey()Get all processor key.- 返回:
- collection of processors
-
setDefaultTaskProcessor
Set default task processor. If do not find task processor by task key, use this default processor to process task.- 参数:
defaultTaskProcessor- default task processor
-
addTask
Add task into execute pool.- 参数:
key- key of tasktask- task
-
removeTask
Remove task.- 参数:
key- key of task- 返回:
- nacos task
-
getAllTaskKeys
Collection<Object> getAllTaskKeys()Get all task keys.- 返回:
- collection of task keys.
-