If you have an existing Java project you can convert it
to an OSGi plug-in project. The OSGi bundle can run in a pooled JVM
environment and a JVM server.
About this task
This task assumes that you have an existing Java project
in your workspace, and you want to convert it to an OSGi plug-in
project.
Procedure
- In the Package Explorer view, right-click the Java project
that you want to convert to a plug-in project, and click
Configure
> Convert to Plug-in Projects.
The Convert
Existing Projects dialog is displayed.
The dialog contains a list of all the Java projects in your
workspace. The one you chose to convert is selected. You can change
your selection, or select more than one Java project to convert to
a plug-in project.
- Click
Finish.
The Java project is converted to a plug-in project. The project name does not change,
but the project now includes a manifest file and a build properties
file.
- Required: You must now edit the plug-in manifest file and add the JCICS API
dependencies.
If you do not perform these steps, you will be able to export and
install the bundle, but it will not run.
Note: In CICS
versions before CICS TS version 4.2 you had to add the Java class
library,
dfjcics.jar,
to the Java build path.
With CICS TS version 4.2, OSGi manages the build path for you. Before
you perform the following steps you must edit the current build
path
and remove any references to
dfhjcics.jar.
If you do not remove all references to
dfhjcics.jar,
a
NoSuchMethodException
error occurs
at run time.
- In the Package Explorer view, right-click the project
name and click
Plug-in Tools > Open Manifest.
The manifest file opens in the manifest editor.
- Important:
In CICS versions before
CICS TS version 4.2, the Java class library, known as JCICS, is
supplied
in the
dfjcics.jar
JAR file. In CICS TS version
4.2 the library is supplied in the
com.ibm.cics.server.jar
file.
If your project manifest contains the declaration:
Import-Package:
dfhjcics.jar;
you must remove the declaration before continuing
with the remaining steps.
- Select the
Dependencies
tab and
in the Imported Packages section, click
ADD.
The Package Selection dialog opens.
- Select the package
com.ibm.cics.server
and
click
OK.
The package is displayed
in the Imported Packages list.
- Optional: Repeat the previous
step to install the following packages, if required for your
application:
Table 1. | Package |
Description |
| com.ibm.record |
The Java API for legacy programs that use IByteBuffer from
the Java Record Framework that came with VisualAge.
Previously in
the
dfjcics.jar
file.
|
- Select File > Save to save the manifest file.
Results
You have successfully converted your existing Java project
to a plug-in project. However you must now update the manifest file
to add a CICS-MainClass declaration. For more information see the
related links.