Modifier | Constructor and Description |
---|---|
protected |
DefaultTaskImpl(Task parentTask,
String name) |
Modifier and Type | Method and Description |
---|---|
protected Task |
createSubtask(Task parentTask,
String name)
Creates a real
Task instance. |
Object |
getAttribute(String key)
Retrieve the attribute value by the attribute name.
|
Map<String,Object> |
getAttributeMap()
Returns attribute map which is unmodifiable.
|
Enumeration<String> |
getAttributeNames()
Enumerates the attribute names
|
Collection<Task> |
getChildTasks()
Returns the child tasks collection
|
long |
getDurationTimeMillis()
Returns the task execution duration time in milliseconds
|
String |
getName()
returns the task name
|
Task |
getParentTask() |
boolean |
isRunning()
Returns true if the task was started but not stopped.
|
Object |
removeAttribute(String key)
Removes the attribute by the attribute name.
|
void |
setAttribute(String key,
Object value)
Set an attribute for the task.
|
Task |
startSubtask(String name)
Starts and returns a child subtask with the name.
|
void |
stop()
Stops the task
|
public Map<String,Object> getAttributeMap()
Task
getAttributeMap
in interface Task
public Enumeration<String> getAttributeNames()
Task
getAttributeNames
in interface Task
public void setAttribute(String key, Object value)
Task
value
should have a proper #toString method
as by default, the #toString method is used for displaying the object in the diagnostics.setAttribute
in interface Task
key
- attribute namevalue
- attribute valuepublic Object getAttribute(String key)
Task
null
is returnedgetAttribute
in interface Task
public Object removeAttribute(String key)
Task
key
, this object is returned. Otherwise null
is returned.removeAttribute
in interface Task
public Task getParentTask()
getParentTask
in interface Task
null
if this is the root taskpublic Task startSubtask(String name)
Task
startSubtask
in interface Task
public void stop()
Task
public Collection<Task> getChildTasks()
Task
getChildTasks
in interface Task
public boolean isRunning()
Task
public long getDurationTimeMillis()
Task
getDurationTimeMillis
in interface Task
Copyright © 2012–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.