public abstract class TaskRuntimeMBeanImpl extends RuntimeMBeanDelegate implements TaskRuntimeMBean
Modifier and Type | Field and Description |
---|---|
protected long |
beginTime |
protected java.lang.String |
description |
protected long |
endTime |
protected java.lang.Exception |
error |
protected boolean |
running |
protected java.lang.String |
status |
protected TaskRuntimeMBean[] |
subTasks |
protected boolean |
systemTask |
descriptor, name, parent, registered, type
PROGRESS_FAILED, PROGRESS_PENDING, PROGRESS_PROCESSING, PROGRESS_SUCCESS
Constructor and Description |
---|
TaskRuntimeMBeanImpl(java.lang.String nameArg,
RuntimeMBean parentArg,
boolean registerNow)
Constructor for the RuntimeMBeanDelegate object
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Attempts to cancel this task.
|
long |
getBeginTime()
Returns the time this task was started.
|
java.lang.String |
getDescription()
A description of this task.
|
long |
getEndTime()
The time this task was completed.
|
java.lang.Exception |
getError()
Returns an exception describing the error, if any, that occurred
while performing this Task.
|
TaskRuntimeMBean |
getParentTask()
Returns the task of which this task is a part (see getSubTasks),
or null if there is none.
|
java.lang.String |
getStatus()
The status of this task.
|
TaskRuntimeMBean[] |
getSubTasks()
Returns an array of TaskRuntimes describing a set of parallel
tasks which are components of this task.
|
boolean |
isRunning()
Returns true if the Task is still running.
|
boolean |
isSystemTask()
Indicates this task was initiated by the server.
|
void |
printLog(java.io.PrintWriter out)
Prints information that was logged during the processing of the
task (e.g.
|
protected void |
setBeginTime(long beginTime) |
protected void |
setDescription(java.lang.String description) |
protected void |
setEndTime(long endTime) |
protected void |
setError(java.lang.Exception error) |
protected void |
setStatus(java.lang.String status) |
protected void |
setSubTasks(TaskRuntimeMBean[] subTasks) |
void |
setSystemTask(boolean sys)
Make this a system task
|
_createHelper, _postSet, _postSet, _postSet, _postSet, _postSet, addChild, addNotificationListener, addPropertyChangeListener, createChildCopy, getAttribute, getAttributes, getMBeanInfo, getMetaData, getName, getNotificationInfo, getObjectName, getParent, getParentAttribute, getPropertyChangeListeners, getRegistrationManager, getRestParent, getType, invoke, isCachingDisabled, isEditable, isRegistered, pluralize, postDeregister, postRegister, preDeregister, preRegister, register, removeChild, removeNotificationListener, removePropertyChangeListener, setAttribute, setAttributes, setMetaData, setName, setParent, setRestParent, setRuntimeMBeanHelper, setType, unregister
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getProgress
addPropertyChangeListener, preDeregister, removePropertyChangeListener
getMBeanInfo, getName, getObjectName, getParent, getType, isCachingDisabled, isRegistered, setName, setParent
getAttribute, getAttributes, invoke, setAttribute, setAttributes
protected java.lang.String description
protected java.lang.String status
protected long beginTime
protected long endTime
protected TaskRuntimeMBean[] subTasks
protected java.lang.Exception error
protected boolean running
protected boolean systemTask
public TaskRuntimeMBeanImpl(java.lang.String nameArg, RuntimeMBean parentArg, boolean registerNow) throws ManagementException
nameArg
- parentArg
- ManagementException
public java.lang.String getDescription()
A description of this task.
Returns a description of this task
getDescription
in interface TaskRuntimeMBean
public java.lang.String getStatus()
The status of this task.
Returns the status of this Task.
getStatus
in interface TaskRuntimeMBean
public boolean isRunning()
Returns true if the Task is still running.
isRunning
in interface TaskRuntimeMBean
public long getBeginTime()
Returns the time this task was started.
getBeginTime
in interface TaskRuntimeMBean
public long getEndTime()
The time this task was completed.
Returns the time this task was completed. Returns -1 if the task is currently running.
getEndTime
in interface TaskRuntimeMBean
public TaskRuntimeMBean[] getSubTasks()
Returns an array of TaskRuntimes describing a set of parallel tasks which are components of this task. Returns null if this task has no subtasks.
A simple example of a task with subtasks would be one which monitors a user's request to start a cluster; that task should return a set of subtasks indicating the individual server-startup processes which compose the overall cluster-startup task.
getSubTasks
in interface TaskRuntimeMBean
public TaskRuntimeMBean getParentTask()
Returns the task of which this task is a part (see getSubTasks), or null if there is none.
getParentTask
in interface TaskRuntimeMBean
TaskRuntimeMBean.getSubTasks()
public void cancel() throws java.lang.Exception
Attempts to cancel this task. An Exception is thrown to indicate failure to cancel the task. Not all tasks can be cancelled - do we also need isCancellable()?
cancel
in interface TaskRuntimeMBean
java.lang.Exception
public void printLog(java.io.PrintWriter out)
Prints information that was logged during the processing of the task (e.g. server startup log) to the given Writer.
printLog
in interface TaskRuntimeMBean
out
- public java.lang.Exception getError()
Returns an exception describing the error, if any, that occurred while performing this Task.
getError
in interface TaskRuntimeMBean
public boolean isSystemTask()
Indicates this task was initiated by the server.
isSystemTask
in interface TaskRuntimeMBean
public void setSystemTask(boolean sys)
Make this a system task
setSystemTask
in interface TaskRuntimeMBean
sys
- The new systemTask valueprotected void setDescription(java.lang.String description)
protected void setStatus(java.lang.String status)
protected void setBeginTime(long beginTime)
protected void setEndTime(long endTime)
protected void setSubTasks(TaskRuntimeMBean[] subTasks)
protected void setError(java.lang.Exception error)