com.tensegrity.gui.launch
Class LaunchTask

java.lang.Object
  extended bycom.tensegrity.gui.launch.LaunchTask
Direct Known Subclasses:
AbstractLaunchTask

public abstract class LaunchTask
extends java.lang.Object

A LaunchTask is a named, runnable object that can return one of seven predefined execution states. This class assumes that its run() method will be called only once during its life but makes no further assumptions about the implementation details in derived classes.

You may think of a LaunchTask as command object stereotype. Derived classes implement a particular initialization logic that is modular in scope. The following classdiagram shows just a few concrete implementations of this abstract class:

Class Diagram LaunchTask

Version:
$Id: LaunchTask.java,v 1.11 2005/07/18 09:07:31 BurkhardWick Exp $
Author:
S. Rutz

Field Summary
protected  java.lang.String lasterror
          field that stores the recent error message
static int LAUNCHTASKSTATUS_FATAL
          Result status of launch task: Task failed, show message and cancel launch.
static int LAUNCHTASKSTATUS_FATAL_RETRY
          Result status of launch task: Task failed, show message box close/retry; * cancel launch when close is choosen * retry launch task when retry is choosen after returning this, the launch task should return information about the error in the getError()
static int LAUNCHTASKSTATUS_SERIOUS
          Result status of launch task: Task failed but the task is not necessarily needed for the application, user decides whether to cancel launch of application or to proceed by showing a yes/no message box and choose.
static int LAUNCHTASKSTATUS_SERIOUS_RETRY
          Result status of launch task: Task failed but the task is not necessarily needed for the application, user decides whether to cancel launch of application or to proceed or to start the launch task again by showing a yes/no/retry message box and choose.
static int LAUNCHTASKSTATUS_SHUTDOWN
          Result status of launch task: Task failed, cancel launch silently
static int LAUNCHTASKSTATUS_SUCCESS
          Result status of launch task: Task successful, continue launch
static int LAUNCHTASKSTATUS_WARNING
          Result status of launch task: Task failed (partially), continue launch with warning output (no message box)
 
Constructor Summary
LaunchTask()
          Constructs a new LaunchTask.
 
Method Summary
 java.lang.String getError()
          Returns the last error or warning string.
abstract  java.lang.String getName()
          Returns the name of this launch task.
 java.lang.String getStatusDetails()
          Returns details about the currently performed action, that can be shown in the application launcher.
 java.lang.String getStatusPrefix()
          Returns the prefix that is shown before the name of the launch task in the status text of the application launcher.
abstract  int run()
          The run method of this launch task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAUNCHTASKSTATUS_SUCCESS

public static final int LAUNCHTASKSTATUS_SUCCESS
Result status of launch task: Task successful, continue launch

See Also:
Constant Field Values

LAUNCHTASKSTATUS_FATAL

public static final int LAUNCHTASKSTATUS_FATAL
Result status of launch task: Task failed, show message and cancel launch. after returning this, the launch task should return information about the error in the getError()

See Also:
Constant Field Values

LAUNCHTASKSTATUS_WARNING

public static final int LAUNCHTASKSTATUS_WARNING
Result status of launch task: Task failed (partially), continue launch with warning output (no message box)

See Also:
Constant Field Values

LAUNCHTASKSTATUS_SHUTDOWN

public static final int LAUNCHTASKSTATUS_SHUTDOWN
Result status of launch task: Task failed, cancel launch silently

See Also:
Constant Field Values

LAUNCHTASKSTATUS_SERIOUS

public static final int LAUNCHTASKSTATUS_SERIOUS
Result status of launch task: Task failed but the task is not necessarily needed for the application, user decides whether to cancel launch of application or to proceed by showing a yes/no message box and choose. The launch task should return information about the error in the getError()

See Also:
Constant Field Values

LAUNCHTASKSTATUS_FATAL_RETRY

public static final int LAUNCHTASKSTATUS_FATAL_RETRY
Result status of launch task: Task failed, show message box close/retry; * cancel launch when close is choosen * retry launch task when retry is choosen after returning this, the launch task should return information about the error in the getError()

See Also:
Constant Field Values

LAUNCHTASKSTATUS_SERIOUS_RETRY

public static final int LAUNCHTASKSTATUS_SERIOUS_RETRY
Result status of launch task: Task failed but the task is not necessarily needed for the application, user decides whether to cancel launch of application or to proceed or to start the launch task again by showing a yes/no/retry message box and choose. The launch task should return information about the error in the getError()

See Also:
Constant Field Values

lasterror

protected java.lang.String lasterror
field that stores the recent error message

Constructor Detail

LaunchTask

public LaunchTask()
Constructs a new LaunchTask.

Method Detail

getName

public abstract java.lang.String getName()
Returns the name of this launch task.

Returns:
the name of this launch task.

Find more information in the class documentation


getStatusDetails

public java.lang.String getStatusDetails()
Returns details about the currently performed action, that can be shown in the application launcher. It might be necessary to trigger an update in the launcher whenever this value changes depending on the implementation.

Returns:
A string containing details about the currently performed action or null, if no details are available

getStatusPrefix

public java.lang.String getStatusPrefix()
Returns the prefix that is shown before the name of the launch task in the status text of the application launcher. Per default this is "Initializing: "

Returns:
the prefix that is shown before the name of the launch task in the status text of the application launcher.

run

public abstract int run()
                 throws java.lang.Exception
The run method of this launch task. The returned status indicates what the invoker is supposed to do after the task executed.

Returns:
one of the LAUNCHTASKSTATUS_* constants defined in this interface.
Throws:
java.lang.Exception

Find more information in the class documentation


getError

public java.lang.String getError()
Returns the last error or warning string. It is allowed to return null if no error occured. The invoker must be able to deal with a null string.

Returns:
the latest warning or error message or null if everything went alright.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.