Class DefaultTaskImpl

    • Constructor Detail

      • DefaultTaskImpl

        protected DefaultTaskImpl​(Task parentTask,
                                  String name)
    • Method Detail

      • getName

        public String getName()
        Description copied from interface: Task
        returns the task name
        Specified by:
        getName in interface Task
        Returns:
      • getAttributeMap

        public Map<String,​Object> getAttributeMap()
        Description copied from interface: Task
        Returns attribute map which is unmodifiable. So, do not try to put or remove items directly from the returned map.
        Specified by:
        getAttributeMap in interface Task
        Returns:
      • setAttribute

        public void setAttribute​(String key,
                                 Object value)
        Description copied from interface: Task
        Set an attribute for the task. The object value should have a proper #toString method as by default, the #toString method is used for displaying the object in the diagnostics.
        Specified by:
        setAttribute in interface Task
        Parameters:
        key - attribute name
        value - attribute value
      • getAttribute

        public Object getAttribute​(String key)
        Description copied from interface: Task
        Retrieve the attribute value by the attribute name. When not found, null is returned
        Specified by:
        getAttribute in interface Task
      • removeAttribute

        public Object removeAttribute​(String key)
        Description copied from interface: Task
        Removes the attribute by the attribute name. When an Object was removed for key, this object is returned. Otherwise null is returned.
        Specified by:
        removeAttribute in interface Task
      • getParentTask

        public Task getParentTask()
        Specified by:
        getParentTask in interface Task
        Returns:
        Returns the parent task and null if this is the root task
      • startSubtask

        public Task startSubtask​(String name)
        Description copied from interface: Task
        Starts and returns a child subtask with the name.
        Specified by:
        startSubtask in interface Task
        Returns:
      • stop

        public void stop()
        Description copied from interface: Task
        Stops the task
        Specified by:
        stop in interface Task
      • getChildTasks

        public Collection<Task> getChildTasks()
        Description copied from interface: Task
        Returns the child tasks collection
        Specified by:
        getChildTasks in interface Task
        Returns:
      • isRunning

        public boolean isRunning()
        Description copied from interface: Task
        Returns true if the task was started but not stopped.
        Specified by:
        isRunning in interface Task
        Returns:
      • getDurationTimeMillis

        public long getDurationTimeMillis()
        Description copied from interface: Task
        Returns the task execution duration time in milliseconds
        Specified by:
        getDurationTimeMillis in interface Task
        Returns:
      • createSubtask

        protected Task createSubtask​(Task parentTask,
                                     String name)
        Creates a real Task instance.
        Parameters:
        parentTask - parent task
        name - task name
        Returns:
        Task instance