All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.install.products.InstallComponent

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

public abstract class InstallComponent
extends Object
implements Serializable
InstallComponent is a class that each member of the product tree extends. It is a generic class that provides default behavior to add/remove members to form a realtime dependency tree and to query and extract information about the current state of the product tree, such as: This class cannot be used on its own.


Variable Index

 o installDirKey
The WizardState key that contains the intended installation directory. Deprecated.
 o name
The name of this node. Deprecated.
 o parent
Our parent. Deprecated.
 o properties
Property sheet for this component. Deprecated.

Constructor Index

 o InstallComponent()
Create a new InstallComponent.
 o InstallComponent(Hashtable)
Create a new InstallComponent with the desired destinationTable.

Method Index

 o addRuntimeResources(Vector)
Add the runtime resources required by this class.
 o countInstallable()
Number of installable things this component represents.
 o countUninstallable()
Number of uninstallable things this component represents.
 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 getComponentDescription()
Gets the component's description.
 o getDependentItems()
Returns install descriptions for all items that require this install component.
 o getDestinationTable()
Get this components's destination table.
 o getInstallable()
Returns an Installable object that uniquely describes this component.
 o getInstallDirKey()
Gets the key for the install directory
 o getInstallLocation()
Gets our install location.
 o getName()
Gets the name of this InstallComponent
 o getParent()
Gets the parent of this InstallComponent
 o getProperty(String)
Retrieves a value from this component's property sheet.
 o getRegisteredComponents()
Gets the registered components of this component if it is shared (has a UUID).
 o getState()
Gets the state of this InstallComponent
 o initialize(WizardState)
Do any initialization of InstallComponents, including any dependencies and/or information retrieval.
 o install(WizardState)
Install the bits associated with this InstallComponent.
 o installCanceled()
Determines if the install was cancelled.
 o isInstalled()
Returns true if this component has been installed (according to the system install registry).
 o isNodeActive()
Determines if this node is active.
 o isRegistered()
Checks whether this component is in the system registry or not.
 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 postinstall registration.
 o print(int)
Prints out this InstallComponent and its children in a graphical, hierarchical representation.
 o readMetaFile(String, String, String, WizardState)
Utility function to read a file with each line being a "keyvalue" pair.
 o refresh(Vector, String)
Do any refreshing of this component's information.
 o setComponentDescription(ComponentDescription)
Sets this component's description.
 o setDestinationTable(Hashtable)
Sets the destination table for this component to the desired table.
 o setInstallDirKey(String)
Sets the key for the install directory
 o setName(String)
Sets the name of this InstallComponent
 o setParent(InstallComponent)
Sets the parent of this InstallComponent
 o setProperty(String, Object)
Sets a property into this install component's property sheet.
 o setState(WizardState)
Sets the state of this InstallComponent
 o toString()
Converts this object into a readable string.
 o uninstall(WizardState)
Uninstall the bits associated with this InstallComponent.
 o uninstallCanceled()
Determines if the uninstall was cancelled.
 o writeMetaFile(String, String, Hashtable, WizardState)
Utility function to write a file with each line being a "keyvalue" pair.

Variables

 o name
 protected String name
Note: name is deprecated. use get/setName()

The name of this node. Used for debugging purposes only. No relation to names that might appear to an end user

 o parent
 protected InstallComponent parent
Note: parent is deprecated. use set/getParent()

Our parent. This is null if this is the top of the product tree.

 o installDirKey
 protected String installDirKey
Note: installDirKey is deprecated. use get/setInstallDirKey()

The WizardState key that contains the intended installation directory.

 o properties
 protected Hashtable properties
Note: properties is deprecated. use get/setProperty()

Property sheet for this component. Queries can be made against the tree using rules that look at these properties, and each property can optionally have a return value. By default, all components have the following default properties and values:

Constructors

 o InstallComponent
 public InstallComponent()
Create a new InstallComponent.

 o InstallComponent
 public InstallComponent(Hashtable destinationTable)
Create a new InstallComponent with the desired destinationTable.

Parameters:
destinationTable - The table describing the location and size impact of installing this component.

Methods

 o setDestinationTable
 public void setDestinationTable(Hashtable destinationTable)
Sets the destination table for this component to the desired table.

Parameters:
destinationTable - The destination Table of this component.
 o getDestinationTable
 public Hashtable getDestinationTable()
Get this components's destination table.

Returns:
The destination table for this component.
 o getName
 public String getName()
Gets the name of this InstallComponent

Returns:
The name of this component
 o setName
 public void setName(String name)
Sets the name of this InstallComponent

Parameters:
name - The new name
 o getParent
 public InstallComponent getParent()
Gets the parent of this InstallComponent

Returns:
The parent of this component
 o setParent
 public void setParent(InstallComponent parent)
Sets the parent of this InstallComponent

Parameters:
parent - The new parent
 o getState
 public WizardState getState()
Gets the state of this InstallComponent

Returns:
The state of this InstallComponent
 o setState
 public void setState(WizardState state)
Sets the state of this InstallComponent

Parameters:
state - The new state
 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.
 o refresh
 public boolean refresh(Vector targets,
                        String sharedPoolKey)
Do any refreshing of this component's information. If you override this method in a subclass, be sure to call super.refresh() at some point.

Parameters:
targets - The target properties (of type java.lang.String) to refresh
sharedPoolKey - key pointing to pool to use during refreshing.
Returns:
true, if the refresh was successful, false otherwise.
 o getProperty
 public Object getProperty(String key)
Retrieves a value from this component's property sheet.

Parameters:
key - The key used to store the desired value
Returns:
The desired value
 o setProperty
 public void setProperty(String key,
                         Object value)
Sets a property into this install component's property sheet. Can be retrieved via getProperty();

Parameters:
key - The key used to store the desired value
value - The object to store under the specified 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:
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.
finalTable - The hashtable to add the resulting information to.
 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:
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.
finalTable - The hashtable to add the resulting information to.
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.
See Also:
Installable
 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.
 o getInstallable
 public Installable getInstallable()
Returns an Installable object that uniquely describes this component.

 o setComponentDescription
 public void setComponentDescription(ComponentDescription componentDescription)
Sets this component's description. If this description includes a UUID, the component is considered a shared component and will update the system registry.

Parameters:
componentDescription - The description of this component
 o getComponentDescription
 public ComponentDescription getComponentDescription()
Gets the component's description.

Returns:
The description of this component, or null if none exists.
 o isNodeActive
 public boolean isNodeActive()
Determines if this node is active. A node is active if it has a property of nodeIsActive and is set to Boolean(true).

Returns:
Whether the node is active or not.
 o getRegisteredComponents
 public ComponentDescription[] getRegisteredComponents()
Gets the registered components of this component if it is shared (has a UUID). This class simply returns the component description of this component.

Returns:
The descriptions of the registered components of this component.
 o isInstalled
 public boolean isInstalled()
Returns true if this component has been installed (according to the system install registry). Returns false if the component is not registered as being installed, or if the registry cannot be queried.

 o installCanceled
 public boolean installCanceled()
Determines if the install was cancelled.

Returns:
Whether or not the install was cancelled (the "install.cancelled" property of the wizard state is true
 o uninstallCanceled
 public boolean uninstallCanceled()
Determines if the uninstall was cancelled.

Returns:
Whether or not the uninstall was cancelled (the "uninstall.cancelled" property of the wizard state is true
 o getDependentItems
 public ComponentDescription[] getDependentItems()
Returns install descriptions for all items that require this install component.

 o setInstallDirKey
 public void setInstallDirKey(String installDirKey)
Sets the key for the install directory

Parameters:
installDirKey - The intended key that should be used to reference the installation directory for this Leaf.
 o getInstallDirKey
 public String getInstallDirKey()
Gets the key for the install directory

Returns:
The WizardState key for the intended installation directory for this Leaf
 o getInstallLocation
 public String getInstallLocation()
Gets our install location. If we do not have one (i.e. setInstallDirKey() was never called), we defer to our parent in the product tree. If we do have one, and it is relative (i.e. getInstallDirKey().startsWith(File.separator) returns false), then we prepend our relative install directory to our parent's install directory. If it is absolute (i.e. getInstallDirKey().startsWith(File.separator) returns true), we ignore our parent's setting and return our absolute path.

Returns:
The install location for this component
 o toString
 public String toString()
Converts this object into a readable string.

Returns:
The name of this object
Overrides:
toString in class Object
 o readMetaFile
 public static Hashtable readMetaFile(String path,
                                      String delimiter,
                                      String key,
                                      WizardState state)
Utility function to read a file with each line being a "keyvalue" pair. Sets the resulting hashtable into the wizard state.

Parameters:
path - The path to the file to read
delimiter - The string that separates each key from its value
key - The key to use when setting the resulting hashtable into the WizardState. If you do not want this table stored into the WizardState, pass null.
state - The wizard state this component belongs to
Returns:
the resulting hashtable, or null if there was an error reading the file
 o writeMetaFile
 public static boolean writeMetaFile(String path,
                                     String delimiter,
                                     Hashtable table,
                                     WizardState state)
Utility function to write a file with each line being a "keyvalue" pair.

Parameters:
state - The wizard state this component belongs to
path - The path to the file to write
delimiter - The string that separates each key from its value
table - The table to write. Each key/value pair is separated by the supplied delimiter.
Returns:
true if the file was sucessfully written, false otherwise
 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.
Returns:
true if the install was successful; false otherwise.
 o install
 public boolean install(WizardState state)
Install the bits associated with this InstallComponent.

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

 o uninstall
 public boolean uninstall(WizardState state)
Uninstall the bits associated with this InstallComponent.

Parameters:
state - The wizard state associated with this object.
 o isRegistered
 public boolean isRegistered()
Checks whether this component is in the system registry or not.

Returns:
whether this component is in the system registry or not.
 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
 o countInstallable
 public int countInstallable()
Number of installable things this component represents. Used for progress bar division.

Returns:
The InstallComponent always returns 0
 o countUninstallable
 public int countUninstallable()
Number of uninstallable things this component represents. Used for progress bar division.

Returns:
The InstallComponent always returns 0

All Packages  Class Hierarchy  This Package  Previous  Next  Index