com.ibm.jsdt.checkpoints
Class StartupCheckpoint

java.lang.Object
  extended by com.ibm.jsdt.checkpoints.StartupCheckpoint

public abstract class StartupCheckpoint
extends java.lang.Object

This is the abstract base class that implements the default behavior for all startup checkpoint classes. Each startup checkpoint must extend this base class and implement the execute() method. The startup checkpoint class is executed immediately before the deployment wizard user interface is displayed.

Each startup checkpoint subclass can override methods to modify attributes of the progress dialog. This dialog is displayed while the startup checkpoint class is running. The attributes that can be modified include the title, message, message details, percent complete, and whether or not the cancel button is enabled. If you want to override defaults on the progress dialog, you must override initializeProgressDialog(). The deployment wizard will invoke initializeProgressDialog() prior to invoking your execute() method to ensure the initial progress dialog is populated with the desired values.

The execute method exits with a return code that indicates how the deployment wizard should continue. Based on this return code, the deployment wizard continues to launch, displays a dialog to cancel the launch, or prompts the user to cancel or continue. The subclass can override the title and message text of these dialogs.


Field Summary
static int ABORT_DEPLOYER
          Return code that indicates the deployment wizard should not be launched.
static java.lang.String ABORT_DIALOG_MESSAGE
          The default cancel dialog message that is displayed if the startup checkpoint exits with a return code of ABORT_DEPLOYER.
static java.lang.String ABORT_DIALOG_TITLE
          The default cancel dialog title that is displayed if the startup checkpoint exits with a return code of ABORT_DEPLOYER.
static java.lang.String AUTOMATIC
          The default progress mode.
static int DEFAULT_EXECUTION_TIME
          Default execution time for a startup checkpoint class.
static int LAUNCH_DEPLOYER
          Return code that indicates the deployment wizard should be launched.
static java.lang.String MANUAL
          The progress mode that indicates that the startup checkpoint class handles progress updates while running the startup checkpoint class.
static java.lang.String PROGRESS_DIALOG_MESSAGE
          The default message on the progress dialog that displays while the startup checkpoint class runs.
static java.lang.String PROGRESS_DIALOG_TITLE
          The default title of the progress dialog that displays while the startup checkpoint class runs.
static int PROMPT_USER
          Return code that indicates the deployment wizard should prompt the user continue or cancel the launch.
static int RC_NOT_PROVIDED_YET
          FOR INTERNAL USE ONLY.
static int TIMEOUT_FACTOR
          FOR INTERNAL USE ONLY.
static java.lang.String USER_PROMPT_DIALOG_MESSAGE
          The default dialog message that is displayed if the startup checkpoint exits with a return code of PROMPT_USER.
static java.lang.String USER_PROMPT_DIALOG_TITLE
          The default dialog title that is displayed if the startup checkpoint exits with a return code of PROMPT_USER.
 
Constructor Summary
StartupCheckpoint()
           
 
Method Summary
 void enableCancelOnProgressDialog(boolean enableCancel)
          Set enableCancel to false if you do not want the cancel button to be enabled on the progress dialog while the startup checkpoint class is running.
abstract  int execute(boolean silentMode)
          Each startup checkpoint subclass must implement this method.
 java.lang.String getAbortDialogMessage()
          Returns the message displayed on the cancel dialog.
 java.lang.String getAbortDialogTitle()
          Returns the title displayed on the cancel dialog.
 int getExecutionTime()
          Returns the time in minutes that it takes the startup checkpoint class to run.
 int getPercentComplete()
          Returns the percent complete displayed on the progress dialog.
 java.lang.String getProgressDialogDetails()
          Returns the detail text displayed directly above the progress bar on the progress dialog.
 java.lang.String getProgressDialogMessage()
          Returns the message text displayed on the progress dialog while your startup checkpoint is running.
 java.lang.String getProgressDialogTitle()
          Returns the title displayed on the progress dialog that appears while the startup checkpoint is running.
 java.lang.String getProgressMode()
          Returns the mode indicating how progress updates are controlled while the startup checkpoint class runs.
 java.lang.String getPromptUserDialogMessage()
          Returns the message text displayed on the dialog that prompts the user for a response about how the deployment wizard should proceed.
 java.lang.String getUserPromptDialogTitle()
          Returns the title of the dialog that prompts the user for a response, which indicates how the deployment wizard should proceed.
 void initializeProgressDialog()
          Initializes the progress dialog with the desired values.
 boolean isCancelEnabledOnProgressDialog()
          Returns a boolean indicating whether the cancel button is enabled on the progress dialog.
 void logMessage(java.lang.String message)
          Log a message to the deployment wizard master log file.
 void setAbortDialogMessage(java.lang.String abortDialogMessage)
          Set the message of the dialog that appears when the deployment wizard should not launch the deployment wizard using the solution associated with this startup checkpoint.
 void setAbortDialogTitle(java.lang.String abortDialogTitle)
          Set the title of the dialog that appears when the deployment wizard should not launch the deployment wizard using the solution associated with this startup checkpoint.
 void setExecutionTime(int executionTime)
          Set the estimated time it takes for your startup checkpoint class to run.
 void setPercentComplete(int percentComplete)
          Set the percent complete displayed on the progress bar of the progress dialog.
 void setProgressDialogDetails(java.lang.String progressDialogDetails)
          Set the detailed text for the progress dialog that appears while your startup checkpoint is running.
 void setProgressDialogMessage(java.lang.String progressDialogMessage)
          Set the message text for the progress dialog that appears while your startup checkpoint is running.
 void setProgressDialogTitle(java.lang.String progressDialogTitle)
          Set the title for the progress dialog that appears while the startup checkpoint is running.
 void setProgressMode(java.lang.String progressMode)
          Indicate how displaying progress to the user is controlled while the startup checkpoint runs.
 void setShowProgressDialog(boolean show)
          Sets an indicator as to whether or not the progress dialog will display when the when the startup checkpoint runs.
 void setUserPromptDialogMessage(java.lang.String userPromptDialogMessage)
          Set the message of the dialog that appears when the deployment wizard prompts the user to continue and launch this solution or to cancel the launch.
 void setUserPromptDialogTitle(java.lang.String userPromptDialogTitle)
          Set the title of the dialog that appears when the deployment wizard prompts the user to continue and launch this solution or to cancel the launch.
 boolean shouldShowProgressDialog()
          Indicates whether or not the progress dialog will display when the startup checkpoint runs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAUNCH_DEPLOYER

public static final int LAUNCH_DEPLOYER
Return code that indicates the deployment wizard should be launched.

See Also:
Constant Field Values

PROMPT_USER

public static final int PROMPT_USER
Return code that indicates the deployment wizard should prompt the user continue or cancel the launch. Overwrite the default dialog message to provide the user with relevant information.

See Also:
Constant Field Values

ABORT_DEPLOYER

public static final int ABORT_DEPLOYER
Return code that indicates the deployment wizard should not be launched.

See Also:
Constant Field Values

RC_NOT_PROVIDED_YET

public static final int RC_NOT_PROVIDED_YET
FOR INTERNAL USE ONLY. The return code that indicates the startup checkpoint class has not yet completed execution.

See Also:
Constant Field Values

DEFAULT_EXECUTION_TIME

public static final int DEFAULT_EXECUTION_TIME
Default execution time for a startup checkpoint class. The default is 2 minutes.

See Also:
Constant Field Values

TIMEOUT_FACTOR

public static final int TIMEOUT_FACTOR
FOR INTERNAL USE ONLY. The multiple of the execution time that sets the maximum allowed time for the startup checkpoint class to run before a timeout is thrown. The default timeout factor is 2.

See Also:
Constant Field Values

AUTOMATIC

public static final java.lang.String AUTOMATIC
The default progress mode. Indicates that the deployment wizard handles progress updates while running the startup checkpoint class.

See Also:
Constant Field Values

MANUAL

public static final java.lang.String MANUAL
The progress mode that indicates that the startup checkpoint class handles progress updates while running the startup checkpoint class.

See Also:
Constant Field Values

ABORT_DIALOG_TITLE

public static final java.lang.String ABORT_DIALOG_TITLE
The default cancel dialog title that is displayed if the startup checkpoint exits with a return code of ABORT_DEPLOYER.


ABORT_DIALOG_MESSAGE

public static final java.lang.String ABORT_DIALOG_MESSAGE
The default cancel dialog message that is displayed if the startup checkpoint exits with a return code of ABORT_DEPLOYER.


USER_PROMPT_DIALOG_TITLE

public static final java.lang.String USER_PROMPT_DIALOG_TITLE
The default dialog title that is displayed if the startup checkpoint exits with a return code of PROMPT_USER.


USER_PROMPT_DIALOG_MESSAGE

public static final java.lang.String USER_PROMPT_DIALOG_MESSAGE
The default dialog message that is displayed if the startup checkpoint exits with a return code of PROMPT_USER.


PROGRESS_DIALOG_TITLE

public static final java.lang.String PROGRESS_DIALOG_TITLE
The default title of the progress dialog that displays while the startup checkpoint class runs.


PROGRESS_DIALOG_MESSAGE

public static final java.lang.String PROGRESS_DIALOG_MESSAGE
The default message on the progress dialog that displays while the startup checkpoint class runs.

Constructor Detail

StartupCheckpoint

public StartupCheckpoint()
Method Detail

execute

public abstract int execute(boolean silentMode)
Each startup checkpoint subclass must implement this method. It controls the flow of how your startup checkpoint class runs.

The deployment wizard invokes this class as the entry point into your startup checkpoint class. This runs immediately before the deployment wizard interface is displayed. In order to override the defaults for the progress dialog, override the initializeProgressDialog method.

Parameters:
silentMode - - Indicates whether this startup checkpoint is being run in silent mode or interactively. If silentMode is true, do not surface any graphical interfaces.
Returns:
An integer indicating how the deployment wizard should proceed. Appropriate values are listed below. Any other return code is interpreted as failure, and the deployment wizard does not launch.
  • LAUNCH_DEPLOYER - indicates success, and the deployment wizard launches
  • ABORT_DEPLOYER - indicates an error occurred. A dialog with a default error message is displayed and the deployment wizard is not launched. You can override the dialog title and text.
  • PROMPT_USER - indicates a warning occurred. A dialog with a default warning message is displayed. The user is presented with the option to continue and launch the deployment wizard or to cancel. You can override the dialog title and text.

initializeProgressDialog

public void initializeProgressDialog()
Initializes the progress dialog with the desired values. The deployment wizard invokes this method to initialize the progress dialog with its default values before invoking your execute(boolean) method. To override a value, invoke the appropriate setter from within this method. The values that you can override for the progress dialog are listed below. Do not override this method if you do not want to override any default values on the progress dialog.


getAbortDialogMessage

public java.lang.String getAbortDialogMessage()
Returns the message displayed on the cancel dialog.

Returns:
Returns the abortDialogMessage.

setAbortDialogMessage

public void setAbortDialogMessage(java.lang.String abortDialogMessage)
Set the message of the dialog that appears when the deployment wizard should not launch the deployment wizard using the solution associated with this startup checkpoint.

Parameters:
abortDialogMessage - The abortDialogMessage to set. If this value is null or the empty string, a default message is used. To avoid truncation, the text should not exceed the width of 265 English characters.

getAbortDialogTitle

public java.lang.String getAbortDialogTitle()
Returns the title displayed on the cancel dialog.

Returns:
Returns the abortDialogTitle.

setAbortDialogTitle

public void setAbortDialogTitle(java.lang.String abortDialogTitle)
Set the title of the dialog that appears when the deployment wizard should not launch the deployment wizard using the solution associated with this startup checkpoint.

Parameters:
abortDialogTitle - The abortDialogTitle to set. If this value is null or the empty string, a default title is used. To avoid truncation, the text should not exceed the width of 50 English characters.

getPercentComplete

public int getPercentComplete()
Returns the percent complete displayed on the progress dialog. This is updated every second.

Returns:
Returns the percentComplete.

setPercentComplete

public void setPercentComplete(int percentComplete)
Set the percent complete displayed on the progress bar of the progress dialog. This value is ignored if the progress mode is not set to StartupCheckpoint.MANUAL. If you wish to control progress updates, set setProgressMode(StartupCheckpoint.MANUAL).

Parameters:
percentComplete - The percentComplete to set.

getProgressDialogDetails

public java.lang.String getProgressDialogDetails()
Returns the detail text displayed directly above the progress bar on the progress dialog. This text is updated every second.

Returns:
Returns the progressDialogDetails.

setProgressDialogDetails

public void setProgressDialogDetails(java.lang.String progressDialogDetails)
Set the detailed text for the progress dialog that appears while your startup checkpoint is running. This text is displayed directly above the progress bar. It shows detailed information about the low-level steps your startup checkpoint is performing. Note: The progress details are blank by default. If set to null, the default is used.

Parameters:
progressDialogDetails - The progressDialogDetails to set. To avoid truncation, the text should not exceed the width of 80 English characters.

getProgressDialogMessage

public java.lang.String getProgressDialogMessage()
Returns the message text displayed on the progress dialog while your startup checkpoint is running.

Returns:
Returns the progressDialogMessage.

setProgressDialogMessage

public void setProgressDialogMessage(java.lang.String progressDialogMessage)
Set the message text for the progress dialog that appears while your startup checkpoint is running.

Parameters:
progressDialogMessage - The progressDialogMessage to set. If this value is null or the empty string, a default message is used. To avoid truncation, the text should not exceed the width of 200 English characters.

getProgressDialogTitle

public java.lang.String getProgressDialogTitle()
Returns the title displayed on the progress dialog that appears while the startup checkpoint is running.

Returns:
Returns the progressDialogTitle.

setProgressDialogTitle

public void setProgressDialogTitle(java.lang.String progressDialogTitle)
Set the title for the progress dialog that appears while the startup checkpoint is running.

Parameters:
progressDialogTitle - The progressDialogTitle to set. If this value is null or the empty string, a default title is used. To avoid truncation, the text should not exceed the width of 50 English characters.

getProgressMode

public java.lang.String getProgressMode()
Returns the mode indicating how progress updates are controlled while the startup checkpoint class runs.

Returns:
Returns the progressMode.

setProgressMode

public void setProgressMode(java.lang.String progressMode)
Indicate how displaying progress to the user is controlled while the startup checkpoint runs. The default progress mode is StartupCheckpoint.AUTOMATIC, which means that the deployment wizard updates the percent complete on the progress dialog while your startup checkpoint runs. The default execution time used is 2 minutes. Call setExeuctionTime(int exeuctionTime) if your program does not take approximately 2 minutes to run.

To have more control over the progress dialog, set the progress mode to StartupCheckpoint.MANUAL. If the progress mode is manual, override the executionTime, progress dialog title, message, details, and percent complete.

Parameters:
progressMode - The progressMode to set. Value must be StartupCheckpoint.AUTOMATIC or StartupCheckpoint.MANUAL. Any other values are interpreted as StartupCheckpoint.AUTOMATIC.

getPromptUserDialogMessage

public java.lang.String getPromptUserDialogMessage()
Returns the message text displayed on the dialog that prompts the user for a response about how the deployment wizard should proceed.

Returns:
Returns the promptUserDialogMessage.

setUserPromptDialogMessage

public void setUserPromptDialogMessage(java.lang.String userPromptDialogMessage)
Set the message of the dialog that appears when the deployment wizard prompts the user to continue and launch this solution or to cancel the launch. The buttons that appear on this dialog are OK and CANCEL.

Parameters:
userPromptDialogMessage - The UserPromptDialogMessage to set. If this value is null or the empty string, a default message is used. To avoid truncation, the text should not exceed the width of 265 English characters.

getUserPromptDialogTitle

public java.lang.String getUserPromptDialogTitle()
Returns the title of the dialog that prompts the user for a response, which indicates how the deployment wizard should proceed.

Returns:
Returns the userPromptDialogTitle.

setUserPromptDialogTitle

public void setUserPromptDialogTitle(java.lang.String userPromptDialogTitle)
Set the title of the dialog that appears when the deployment wizard prompts the user to continue and launch this solution or to cancel the launch. The buttons that appear on this dialog are OK and CANCEL.

Parameters:
userPromptDialogTitle - The userPromptDialogTitle to set. If this value is null or the empty string, a default title is used. To avoid truncation, the text should not exceed the width of 50 English characters.

isCancelEnabledOnProgressDialog

public boolean isCancelEnabledOnProgressDialog()
Returns a boolean indicating whether the cancel button is enabled on the progress dialog.

Returns:
Returns the enableCancel.

enableCancelOnProgressDialog

public void enableCancelOnProgressDialog(boolean enableCancel)
Set enableCancel to false if you do not want the cancel button to be enabled on the progress dialog while the startup checkpoint class is running. If enableCancel is set to true, the cancel button is displayed. If a user clicks Cancel, a confirmation dialog is displayed to warn the user that the solution will not be launched. If the user confirms the cancel, the startup checkpoint, and the subsequent launch of the solution in the deployment wizard, is canceled. If the user cancels the confirmation dialog, the startup checkpoint is not canceled, and subsequent launch of the solution in the deployment wizard is based on the return code from the execute() method.

Note: By default, enableCancel is set to true on the progress dialog.

Parameters:
enableCancel - The enableCancel to set.

getExecutionTime

public int getExecutionTime()
Returns the time in minutes that it takes the startup checkpoint class to run.

Returns:
Returns the exeuctionTime.

setExecutionTime

public void setExecutionTime(int executionTime)
Set the estimated time it takes for your startup checkpoint class to run. Consider time differences when running on computers with different speeds.

NOTE: The execution time must be specified in minutes. The default is 2 minutes.

Parameters:
exeuctionTime - The exeuctionTime to set.

logMessage

public void logMessage(java.lang.String message)
Log a message to the deployment wizard master log file.

Parameters:
message - The message text to log. This text passed in should already be resolved for the appropriate locale.

setShowProgressDialog

public void setShowProgressDialog(boolean show)
Sets an indicator as to whether or not the progress dialog will display when the when the startup checkpoint runs.

If the deployment wizard is not running, the progress dialog will not display regardless of this setting.

Parameters:
show -

shouldShowProgressDialog

public boolean shouldShowProgressDialog()
Indicates whether or not the progress dialog will display when the startup checkpoint runs.

If the deployment wizard is not running, the progress dialog will not display regardless of this setting.

Returns:
boolean