BEA Systems, Inc.


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 (c) 2001 by BEA Systems. 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 printLog(java.io.PrintWriter out)
          Prints information that was logged during the processing of the task (e.g.
 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, preDeregister, 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


getStatus

public java.lang.String getStatus()

Returns the status of this Task.


isRunning

public boolean isRunning()

Returns true if the Task is still running.


getBeginTime

public long getBeginTime()

Returns the time this task was started.


getEndTime

public long getEndTime()

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


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.


getParentTask

public TaskRuntimeMBean getParentTask()

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


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


printLog

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.


getError

public java.lang.Exception getError()

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


isSystemTask

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


setSystemTask

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


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

Copyright © 2004 BEA Systems, Inc. All Rights Reserved.
WebLogic Server 7.0 API Reference