Advanced Class LoadingAdded by IBM on July 25, 2013 | Version 1 (Original)
|The Forms Services Platform custom class loader isolates its bundles from the JAR files made available to the application during startup. You can add non-default packages.
By default, the class loader and equinox.properties come pre-configured to allow access to some packages outside of the Forms Services Platform when they are available on the boot class loader. The predefined list of packages includes the following:
When necessary, you can configure the system to allow access to non-default Forms Services Platform packages. Refer to the following section on what would be the best way to allow bundles access to the Forms Services Platform.
Class loading scenarios
Parent topic: Developing applications
- If the package you need within a bundle is one of the default packages that comes with Forms Services Platform, then you can add the import to the manifest file. To do this, add the Import-Package entry to the manifest file and provide a comma-separated list of packages that your bundle will use. For example:
Import-Package: com.PureEdge.xfdl, com.ibm.form.filenet.model,
This provides the classes with your bundle access to these packages, but not to other classes within other bundles.
Additionally, the following JARs are shipped by the Forms Services Platform as bundles and are also available to use by adding an Import-Package entry to the manifest file:
- org.apache.commons.collections 3.2
- org.apache.commons.codec 1.3
- org.apache.commons.beanutils 1.7
- org.apache.commons.lang 2.2
- org.apache.commons.jxpath 1.2
- org.jdom 1.0
- org.eclipse.osgi 3.2.1
- org.eclipse.osgi.services 3.1.100
- If you are using a JAR that is not provided by default by the Forms Services Platform, and only your bundle requires this JAR, then you can embed the JAR into your bundle.
Note: In this scenario, you cannot instantiate a class within this JAR and pass it to code outside of your bundle because the bundles will be using different class loaders.
- Normally embedding a JAR inside of a bundle is adequate. It is possible to change the configuration to allow all bundles access to specific packages that are available on the boot class loader.
If a bundle does not exist that exports your required package, and you cannot embed the JAR within your own bundle (and the package is not included in the previous list), then you must update the class loader and equinox.properties.
Under this scenario, you can create an object in your own bundle and pass it outside of the bundle because it uses the same class loader.
Allowing bundles access to packages on the boot class loader using Ant
Forms Services Platform includes three files that you can use to build a JAR that allows packages to access the boot class loader.