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