All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.install.products.InstallNode

java.lang.Object
   |
   +----com.sun.install.products.InstallComponent
           |
           +----com.sun.install.products.InstallNode

public class InstallNode
extends InstallComponent
InstallNode implements the default behavior common to all InstallComponents that have children. This is the superclass of nodes (objects that have child components). It can represent either a Product Component (a logical component of the overall software we are installing) or a dependency (a logical gate that might prevent operations from traversing below this object during runtime).


Variable Index

 o childComponents
Holds a list with all of the children of this InstallComponent. Deprecated.

Constructor Index

 o InstallNode()
Create a new InstallNode with desired parent and no children.
 o InstallNode(Hashtable)
Create a new InstallNode with desired parent and no children, and the desired destinationTable.

Method Index

 o addComponent(InstallComponent)
Add a child to this InstallComponent.
 o addRuntimeResources(Vector)
Add the runtime resources required by this class.
 o countInstallable()
Count the number of units we will be installing.
 o countUninstallable()
Count the number of units we will be uninstalling.
 o genericQuery(Hashtable, Vector, String)
Query this tree, recursively following the supplied rules and returning the desired value(s).
 o genericQuery(Hashtable, Vector, String, String)
Query this tree, recursively following the supplied rules and returning the desired value(s).
 o getComponents()
Gets an enumeration of the subcomponents of this component.
 o getRegisteredComponents()
Gets the registered components of this component if it is shared (has a UUID).
 o initialize(WizardState)
Do any initialization of InstallComponents, including any dependencies and/or information retrieval.
 o install(WizardState)
Install this InstallNode and all of its children that are activeComponents (ones that are valid to be installed at the current runtime).
 o isInstallable()
This method is used to determine if this product subtree will be installed.
 o mergeDestinationTables(Hashtable, Hashtable)
Utility function to merge two destination tables.
 o performInstallation(WizardState)
This method is called by the ProductTask, and does the preinstall registry query and the postinstall registration.
 o performUninstallation(WizardState)
This method is called by the ProductTask, and does the uninstall registry query and the unregistration.
 o print(int)
Prints out this InstallComponent and its children in a graphical, hierarchical representation.
 o refresh(Vector, String)
Refreshes this component.
 o removeComponent()
Remove a child from this InstallComponent.
 o uninstall(WizardState)
Uninstall this InstallNode and all of its children that are activeComponents (ones that are valid to be uninstalled at the current runtime).

Variables

 o childComponents
 protected Vector childComponents
Note: childComponents is deprecated. use getComponents()

Holds a list with all of the children of this InstallComponent.

Constructors

 o InstallNode
 public InstallNode()
Create a new InstallNode with desired parent and no children.

 o InstallNode
 public InstallNode(Hashtable destinationTable)
Create a new InstallNode with desired parent and no children, and the desired destinationTable.

Parameters:
destinationTable - The final destination of this InstallNode and its children

Methods

 o performInstallation
 public boolean performInstallation(WizardState state)
This method is called by the ProductTask, and does the preinstall registry query and the postinstall registration. This method calls the install() method if the component has not yet been installed (according to the registry).

Parameters:
state - The WizardState.
Overrides:
performInstallation in class InstallComponent
 o performUninstallation
 public boolean performUninstallation(WizardState state)
This method is called by the ProductTask, and does the uninstall registry query and the unregistration. This method calls the install() method if the component has not yet been installed (according to the registry).

Overrides:
performUninstallation in class InstallComponent
 o install
 public boolean install(WizardState state)
Install this InstallNode and all of its children that are activeComponents (ones that are valid to be installed at the current runtime). Currently this will update its dependency before installing, until a better event-delegation model is implemented. If you override this method in a subclass, be sure to call super.install(state) in your method.

Parameters:
state - The WizardState that this InstallNode belongs to.
Returns:
true, if the install was successful. false otherwise.
Overrides:
install in class InstallComponent
 o countInstallable
 public int countInstallable()
Count the number of units we will be installing. Used to split up progress bars.

Returns:
The number of Leafs that are currently active, after checking dependencies.
Overrides:
countInstallable in class InstallComponent
 o countUninstallable
 public int countUninstallable()
Count the number of units we will be uninstalling. Used to split up progress bars.

Returns:
The number of Leafs that are active, after checking dependencies.
Overrides:
countUninstallable in class InstallComponent
 o isInstallable
 public boolean isInstallable()
This method is used to determine if this product subtree will be installed.

Returns:
Whether this InstallNode will participate in the install.
 o uninstall
 public boolean uninstall(WizardState state)
Uninstall this InstallNode and all of its children that are activeComponents (ones that are valid to be uninstalled at the current runtime). Currently this will update its dependency before uninstalling, until a better event-delegation model is implemented.

Parameters:
state - The WizardState
Returns:
true, if the uninstall was successful. false otherwise.
Overrides:
uninstall in class InstallComponent
 o refresh
 public boolean refresh(Vector targets,
                        String sharedPoolKey)
Refreshes this component. You specify a vector of strings as the desired properties to refresh. Each subclass should only refresh the properties that it is responsible for by looking at the targets and only refreshing ones it recognizes. Pass "all" in order to refresh all targets this leaf knows about.

Parameters:
targets - The target properties (set via setProperty()) to update.
sharedPoolKey - A key identifying the pool to use when performing the refresh. The sharedPool is used during refreshes that involve shared components. Each time a shared component is encountered during the refresh, it performs the refresh then adds itself to the pool of Installables. If the same shared resource is encountered in the refresh, it does not participate in the refresh again. This is used, for example, during disk space checking, when shared components only count their space requirements once. Passing null causes no pool to be used.
Returns:
true if the refresh was sucessful, falseotherwise.
Overrides:
refresh in class InstallComponent
 o initialize
 public boolean initialize(WizardState state)
Do any initialization of InstallComponents, including any dependencies and/or information retrieval. The default is to initialize all of our children. If you override this method in a subclass, be sure to call super.initialize() at some point.

Parameters:
state - The WizardState that this InstallComponent belongs to. Useful for getting date out of the wizard state.
Returns:
true, if the initialization was successful, false otherwise.
Overrides:
initialize in class InstallComponent
 o addRuntimeResources
 public void addRuntimeResources(Vector resourceVector)
Add the runtime resources required by this class.

Parameters:
resourceVector - The vector containing all of the required resources for this class
Overrides:
addRuntimeResources in class InstallComponent
 o mergeDestinationTables
 public static void mergeDestinationTables(Hashtable componentTable,
                                           Hashtable unitTable)
Utility function to merge two destination tables. Similar to the set operation 'intersection'. Takes the unitTable and places entries with the same key into one entry in the componentTable, and adds the corresponding values.

Parameters:
componentTable - The destinaton table which holds the combined entries.
unitTable - The source table with (possible) entries with the same key.
 o genericQuery
 public void genericQuery(Hashtable finalTable,
                          Vector rules,
                          String returnKey)
Query this tree, recursively following the supplied rules and returning the desired value(s). This method can be used to gather information for each component in the tree. You specify the rules to use when traversing the tree. If a component doesn't "follow the rule", then the operation does not proceed through that component to other components below. If the component does follow the rule, then a lookup is done in the component's property sheet and the value is added to the final table, keyed by the component's ID. If the component does not know about the rule, the query passes through to the children.

Parameters:
finalTable - The hashtable to add the resulting information to.
rules - A Vector of Strings. For each String supplied, a lookup is done on the component's property sheet using the string as a key. If a Boolean value of true is found using each key in the rules, then the component passes the rules. If no rules are supplied, then every component in the query will by default "pass" the rules.
returnKey - If the component passes the rules supplied, then another lookup is done on the property sheet using this key, and the value is added to the final table, keyed by the component's componentID.
Overrides:
genericQuery in class InstallComponent
 o genericQuery
 public void genericQuery(Hashtable finalTable,
                          Vector rules,
                          String returnKey,
                          String sharedPoolKey)
Query this tree, recursively following the supplied rules and returning the desired value(s). This method can be used to gather information for each component in the tree. You specify the rules to use when traversing the tree. If a component doesn't "follow the rule", then the operation does not proceed through that component to other components below. If the component does follow the rule, then a lookup is done in the component's property sheet and the value is added to the final table, keyed by the component's ID. If the component does not know about the rule, the query passes through to the children.

Parameters:
finalTable - The hashtable to add the resulting information to.
rules - A Vector of Strings. For each String supplied, a lookup is done on the component's property sheet using the string as a key. If a Boolean value of true is found using each key in the rules, then the component passes the rules. If no rules are supplied, then every component in the query will by default "pass" the rules.
returnKey - If the component passes the rules supplied, then another lookup is done on the property sheet using this key, and the value is added to the final table, keyed by the component's componentID.
sharedPoolKey - A key identifying the pool to use when performing the query. The sharedPool is used during queries that involve shared components. Each time a shared component is encountered during the query, it performs the query (which might result in the shared component adding something to the finalTable as well), then adds itself to the pool of Installables. If the same shared resource is encountered in the query, it does not participate in the query again. This is used, for example, during disk space checking, when shared components only count their space requirements once. Passing null causes no pool to be used.
Overrides:
genericQuery in class InstallComponent
 o addComponent
 public void addComponent(InstallComponent child)
Add a child to this InstallComponent. Many children can be added. The order is left-to-right. This affects the install sequence, in FIFO order (First InstallComponent added will be the first to install).

Parameters:
child - The child to add to this InstallComponent
 o getComponents
 public Enumeration getComponents()
Gets an enumeration of the subcomponents of this component. The order is left-to-right. This affects the install sequence, in FIFO order (First InstallComponent added will be the first to install).

Returns:
An enumeration of the children components of this component
 o removeComponent
 public InstallComponent removeComponent()
Remove a child from this InstallComponent. The last InstallComponent added will be the first to be removed.

Returns:
The child which was just removed
 o print
 public void print(int level)
Prints out this InstallComponent and its children in a graphical, hierarchical representation.

Parameters:
level - The level of indention to print this tree out. This would normally be '0' at the top of the tree and automatically increment for each level of the tree.
Overrides:
print in class InstallComponent
 o getRegisteredComponents
 public ComponentDescription[] getRegisteredComponents()
Gets the registered components of this component if it is shared (has a UUID).

Overrides:
getRegisteredComponents in class InstallComponent

All Packages  Class Hierarchy  This Package  Previous  Next  Index