com.plumtree.uiinfrastructure.application.notification
Interface IStartupTask

All Superinterfaces:
IMessage
All Known Implementing Classes:
CheckDBVersion, CheckDevKit, InitializeActivitySpaces, InitializeApplication, InitializeAppWarmUpHelper, InitializeConfigHelper, InitializeImageServerHelper, InitializeImageServerHelperPartII, InitializeObjects, InitializePaths, InitializeResourceManager, InitializeVarPacks, InitPortalObjects, LoadCustomLoads, LoadVersionHelper

public interface IStartupTask
extends IMessage

Interface for implementing a startup task. Progress trackers like the diagnostic tool can subscribe to notifications from the startup manager. Startup tasks include a series of steps, each of which returns a result: OK, WARN, ERR, FATAL. The progress manager uses these results to maintain overall warmup progress. Each task has a unique ID; each step has a sequential ID. These ID's inform notification subscribers to allow support for detailed progress diagnostic messages, which are maintained *outside* of this framework; the purpose of this framework is to manage startup and send notifications on progres, no more. The concept of setup and teardown are not directly supported; developers are expected to implement such code as the first and last step in the task.

Author:
DavidP 03-13-05

Method Summary
 ReturnValue executeStep(int sequentialStepID)
          Executes each step in the task.
 int getNumSteps()
          Ideally, the number of steps in a startup task is a fixed static value.
 int getTaskID()
          Unique identifier for task.
 java.lang.String getTaskName()
          Simple text name for task.
 ReturnValue init(java.lang.String _strApplicationName)
          Does whatever initialization is required by this task in order to determine the number of steps in the task.
 
Methods inherited from interface com.plumtree.uiinfrastructure.application.startup.messages.IMessage
getMsg, getMsgArray, getNumMsgs
 

Method Detail

getTaskName

java.lang.String getTaskName()
Simple text name for task.

Returns:
String task name

getTaskID

int getTaskID()
Unique identifier for task. Normally this is simply an ordinal value of the sequential task used in startup. See the class PTStartupTasks in application.startup to better understand.

Returns:
int task ID

getNumSteps

int getNumSteps()
Ideally, the number of steps in a startup task is a fixed static value. In some cases, however, the number of steps can only be determined at runtime. The init() function is intended to allow a task to "pre-flight" startup in order to determine the scope of its steps.

Returns:
integer number of steps in this test

init

ReturnValue init(java.lang.String _strApplicationName)
Does whatever initialization is required by this task in order to determine the number of steps in the task. If at all possible, consider other initialization as separate steps in the task, to be executed immediately after this init is called.

Returns:
ReturnValue container class instance

executeStep

ReturnValue executeStep(int sequentialStepID)
Executes each step in the task. Note that you should not conciously throw exceptions in this method; use the return value instead, denoting the severity and error message; it will be rethrown as an exception for you. This design increases the flexibility and re-use of your startup tasks.

Parameters:
sequentialStepID -
Returns:
ReturnValue with result code and string



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.