All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.install.tasks.ProductTask
java.lang.Object
|
+----com.sun.wizards.core.Task
|
+----com.sun.install.tasks.ProductTask
- public class ProductTask
- extends Task
- implements Serializable
ProductTask will drive a product tree to install or uninstall itself.
-
INSTALL
- A flag indicating this class is performing an install.
-
UNINSTALL
- A flag indicating this class is performing an uninstall.
-
ProductTask()
- This constructor is used by the builder.
-
addRuntimeResources(Vector)
- Add the runtime class requirements to the specified vector.
-
cancel()
- Cancel the install.
-
createLogFile(WizardState, String, boolean, String, String)
-
Create a log file from the specified params
-
estimatedCompletionTime(boolean)
- An estimation of how long it will take to complete
this task, in milliseconds.
-
getLogName(boolean, String, String)
- Get the install/uninstall log name.
-
getProduct()
- Gets the current product tree set in this task.
-
initialize(Sequence)
- Initializes this task, as well as the product tree.
-
isCancelled()
- Tests whether this product task has been cancelled.
-
perform()
- Install the product.
-
reverse()
- Uninstall the product.
-
setProduct(Product)
- For the current builders that use this method instead of setting the
product into the WizardState, this method will set the product.
-
updateProgress(int)
-
UNINSTALL
public static final boolean UNINSTALL
- A flag indicating this class is performing an uninstall. Defaults to
false.
INSTALL
public static final boolean INSTALL
- A flag indicating this class is performing an install. Defaults to
true.
ProductTask
public ProductTask()
- This constructor is used by the builder.
initialize
public void initialize(Sequence sequence)
- Initializes this task, as well as the product tree.
- Parameters:
- sequence - The sequence this task belongs to
- Overrides:
- initialize in class Task
setProduct
public void setProduct(Product product)
- For the current builders that use this method instead of setting the
product into the WizardState, this method will set the product.
- Parameters:
- product - The product tree reference to set into the wizard state.
getProduct
public Product getProduct()
- Gets the current product tree set in this task.
- Returns:
- The current product tree.
perform
public void perform()
- Install the product.
- Overrides:
- perform in class Task
reverse
public void reverse()
- Uninstall the product.
- Overrides:
- reverse in class Task
cancel
public void cancel()
- Cancel the install.
- Overrides:
- cancel in class Task
isCancelled
public boolean isCancelled()
- Tests whether this product task has been cancelled.
- Returns:
-
true if this product task has been cancelled. false otherwise.
- Overrides:
- isCancelled in class Task
createLogFile
protected String createLogFile(WizardState ws,
String logKey,
boolean logType,
String dftName,
String prefix)
- Create a log file from the specified params
- Parameters:
- ws - The WizardState this task belongs to
- logKey - The key used to reference the log pathname in the wizard state.
- logType -
true if this is an install log, false for uninstall.
- dftName - default log name, used if
name is not provided.
- prefix - An arbitrary prefix to prefix the logName with.
estimatedCompletionTime
public int estimatedCompletionTime(boolean direction)
- An estimation of how long it will take to complete
this task, in milliseconds.
- Parameters:
- direction - Used to determine how long this task will take in the
specified direction. If the flag is true (indicating forward), this
method should return the amount of time this task will take when
executing the task in a forward direction.
- Returns:
- The estimated time to complete in milliseconds.
- Overrides:
- estimatedCompletionTime in class Task
updateProgress
public void updateProgress(int progress)
getLogName
public static String getLogName(boolean type,
String prodname,
String prefix)
- Get the install/uninstall log name.
- Parameters:
- type - Either the static constants INSTALL or UNINSTALL to indicate the type of log.
- prodname - The name of the product, prefixed onto the resulting name.
- prefix - An arbitrary string to prefix onto the logname.
- Returns:
- The resulting log name. The form is:
prodname_[install|uninstall].[prefix]MMddhhmm
(' 's in prodname are converted to underscores)
('/'s in prodname are converted to dashes)
('\'s in prodname are converted to dashes)
addRuntimeResources
public void addRuntimeResources(Vector resourceVector)
- Add the runtime class requirements to the specified vector.
- Parameters:
- resourceVector - The vector containing all the required resources
for this wizard.
- Overrides:
- addRuntimeResources in class Task
All Packages Class Hierarchy This Package Previous Next Index