BEA Systems, Inc.

WebLogic Server 8.1 API Reference

weblogic.management.runtime
Interface TaskRuntimeMBean

All Known Subinterfaces:
DeploymentTaskRuntimeMBean, ServerLifeCycleTaskRuntimeMBean

public interface TaskRuntimeMBean
extends weblogic.management.runtime.RuntimeMBean

Exposes monitoring information about an ongoing and potentially long-running administrative process. This should be taken to mean, at minimum, any OAM operation involving IO. Examples include starting and stopping servers, deploying and undeploying applications, or migrating services.

An MBean operation of this sort should fork a separate thread to perform the actual work and immediately return an instance of TaskRuntimeMBean to the caller. The caller can then use this to track the task's progress as desired. OA&M clients can also query for all instances of TaskRuntimeMBean to get a summary of both currently-running and recently-completed tasks.

Instance of TaskRuntimeMBean continue to exist in the MBeanServer after the completion of the work they describe. They will eventually either be explicitly deregistered by an OA&M client, or removed by a scavenger process which periodically purges TaskRuntimeMBeans that have been completed for some time.

Author:
Copyright © 2004 BEA Systems, Inc. All Rights Reserved.

Method Summary
 void cancel()
          Attempts to cancel this task.
 long getBeginTime()
          Returns the time this task was started.
 java.lang.String getDescription()
          Returns a description of this task
 long getEndTime()
          Returns 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()
          Returns 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 setSystemTask(boolean sys)
          Make this a system task
 
Methods inherited from interface weblogic.management.WebLogicMBean
getMBeanInfo, getName, getObjectName, getParent, getType, isCachingDisabled, isRegistered, setName, setParent
 
Methods inherited from interface javax.management.DynamicMBean
getAttribute, getAttributes, invoke, setAttribute, setAttributes
 
Methods inherited from interface javax.management.MBeanRegistration
postDeregister, postRegister, preRegister
 
Methods inherited from interface javax.management.NotificationBroadcaster
addNotificationListener, getNotificationInfo, removeNotificationListener
 

Method Detail

getDescription

public java.lang.String getDescription()

Returns a description of this task

Returns:
The description value

getStatus

public java.lang.String getStatus()

Returns the status of this Task.

Returns:
The status value

isRunning

public boolean isRunning()

Returns true if the Task is still running.

Returns:
The running value

getBeginTime

public long getBeginTime()

Returns the time this task was started.

Returns:
The beginTime value

getEndTime

public long getEndTime()

Returns the time this task was completed. Returns -1 if the task is currently running.

Returns:
The endTime value

getSubTasks

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.

Returns:
The subTasks value

getParentTask

public TaskRuntimeMBean getParentTask()

Returns the task of which this task is a part (see getSubTasks), or null if there is none.

Returns:
The parentTask value

cancel

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()?

Throws:
java.lang.Exception -  

getError

public java.lang.Exception getError()

Returns an exception describing the error, if any, that occurred while performing this Task.

Returns:
The error value

isSystemTask

public boolean isSystemTask()
Indicates this task was initiated by the server.

Returns:
The systemTask value

setSystemTask

public void setSystemTask(boolean sys)
Make this a system task

Parameters:
sys - The new systemTask value

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs81