接口 NacosTaskExecuteEngine<T extends NacosTask>

    • 方法详细资料

      • 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

        void addProcessor​(java.lang.Object key,
                          NacosTaskProcessor taskProcessor)
        Add task processor NacosTaskProcessor for execute engine.
        参数:
        key - key of task
        taskProcessor - task processor
      • removeProcessor

        void removeProcessor​(java.lang.Object key)
        Remove task processor NacosTaskProcessor form execute engine for key.
        参数:
        key - key of task
      • getProcessor

        NacosTaskProcessor getProcessor​(java.lang.Object key)
        Try to get NacosTaskProcessor by 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

        java.util.Collection<java.lang.Object> getAllProcessorKey()
        Get all processor key.
        返回:
        collection of processors
      • setDefaultTaskProcessor

        void setDefaultTaskProcessor​(NacosTaskProcessor defaultTaskProcessor)
        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

        void addTask​(java.lang.Object key,
                     T task)
        Add task into execute pool.
        参数:
        key - key of task
        task - task
      • removeTask

        T removeTask​(java.lang.Object key)
        Remove task.
        参数:
        key - key of task
        返回:
        nacos task
      • getAllTaskKeys

        java.util.Collection<java.lang.Object> getAllTaskKeys()
        Get all task keys.
        返回:
        collection of task keys.