javax.jbi.component
Interface InstallationContext


public interface InstallationContext

This context contains information necessary for a JBI component to perform its installation/uninstallation processing. This is provided to the init() method of the component Bootstrap interface.

Author:
JSR208 Expert Group

Method Summary
 java.util.List getClassPathElements()
          Get a list of elements that comprise the class path for this component.
 java.lang.String getComponentClassName()
          Get the name of the class that implements the Component interface for this component.
 java.lang.String getComponentName()
          Get the unique name assigned to this component.
 ComponentContext getContext()
          Get the JBI context for this component.
 org.w3c.dom.DocumentFragment getInstallationDescriptorExtension()
          Return a DOM document fragment representing the installation descriptor (jbi.xml) extension data for the component, if any.
 java.lang.String getInstallRoot()
          Get the installation root directory full path name for this component.
 boolean isInstall()
          Returns true if this context was created in order to install a component into the JBI environment.
 void setClassPathElements(java.util.List classPathElements)
          Set the list of elements that comprise the class path for this component.
 

Method Detail

getComponentClassName

public java.lang.String getComponentClassName()
Get the name of the class that implements the Component interface for this component. This must be the component class name given in the component's installation descriptor.

Returns:
the Component implementation class name, which must be non-null and non-empty.

getClassPathElements

public java.util.List getClassPathElements()
Get a list of elements that comprise the class path for this component. Each element represents either a directory (containing class files) or a library file. All elements are reachable from the install root. These elements represent class path items that the component's execution-time component class loader uses, in search order. All path elements must use the file separator character appropriate to the system (i.e., File.separator).

Returns:
a list of String objects, each of which contains a class path elements. The list must contain at least one class path element.

getComponentName

public java.lang.String getComponentName()
Get the unique name assigned to this component. This name must be assigned from the component's installation descriptor identification section.

Returns:
the unique component name, which must be non-null and non-empty.

getContext

public ComponentContext getContext()
Get the JBI context for this component. The following methods are valid to use on the context: All other methods on the returned context must throw a IllegalStateException exception if invoked.

Returns:
the JBI context for this component, which must be non-null.

getInstallRoot

public java.lang.String getInstallRoot()
Get the installation root directory full path name for this component. This path name must be formatted for the platform the JBI environment is running on.

Returns:
the installation root directory name, which must be non-null and non-empty.

getInstallationDescriptorExtension

public org.w3c.dom.DocumentFragment getInstallationDescriptorExtension()
Return a DOM document fragment representing the installation descriptor (jbi.xml) extension data for the component, if any.

The Installation Descriptor Extension data are located at the end of the <component> element of the installation descriptor.

Returns:
a DOM document fragment containing the installation descriptor (jbi.xml) extension data, or null if none is present in the descriptor.

isInstall

public boolean isInstall()
Returns true if this context was created in order to install a component into the JBI environment. Returns false if this context was created to uninstall a previously installed component.

This method is provided to allow Bootstrap implementations to tailor their behaviour according to use case. For example, the Bootstrap.init(InstallationContext) method implementation may create different types of extension MBeans, depending on the use case specified by this method.

Returns:
true if this context was created in order to install a component into the JBI environment; otherwise the context was created to uninstall an existing component.

setClassPathElements

public void setClassPathElements(java.util.List classPathElements)
Set the list of elements that comprise the class path for this component. Each element represents either a directory (containing class files) or a library file. Elements are reached from the install root. These elements represent class path items that the component's execution-time component class loader uses, in search order. All file paths are relative to the install root of the component.

This method allows the component's bootstrap to alter the execution-time class path specified by the component's installation descriptor. The component configuration determined during installation can affect the class path needed by the component at execution-time. All path elements must use the file separator character appropriate to the system (i.e., File.separator.

Parameters:
classPathElements - a list of String objects, each of which contains a class path elements; the list must be non-null and contain at least one class path element.
Throws:
java.lang.IllegalArgumentException - if the class path elements is null, empty, or if an individual element is ill-formed.

Built 06/07/2005 11:16 AM on acer (SunOS 5.9)

Copyright (c) 2004-2005 Sun Microsystems Inc., All Rights Reserved.