PDF Java Toolkit Core is OSGi compliant out of the box. Other components of Datalogics PDF Java Toolkit are not provided as OSGi compliant bundles. Datalogics has tested PDF Java Toolkit Core with Eclipse Equinox and Apache Felix, other OSGi containers, like Knopflerfish and ProSyst, have not been tested.
The Open Services Gateway Initiative (OSGi) is a framework used for developing and deploying modular components for Java applications that are designed with reuse in mind.
Using the OSGi specification focuses on creating standard Java modules. OSGI helps by defining how components are installed and updated (including updating while applications are running) and requiring well-defined interfaces to communicate between bundles. For more information about the benefits of using OSGi, take a look at the Benefits of Using OSGi on the www.osgi.org website.
Using modular Java components serves to make it easier to:
The OSGi specification supports a wide variety of software platforms, including enterprise, consumer products, and mobile devices.
Developing a project designed to be compatible with OSGi standards involves building an application using the OSGi APIs and then deploying the application to a bundle . A bundle is like a plugin or a library file; the bundle is the built version of an application, made up of a collection of classes and configuration files that can run dynamically within an OSGi compatible runtime session called a container .
Bundles can run processes or services with the container, and the container manages all of the bundle’s requirements and dependencies. Each bundle can run independently, in its own class path, as a separate system module. OSGi bundles are standardized; any bundle built to meet OSGi specifications can be installed and run seamlessly on any container designed to work with OSGi.
You can run multiple versions of the same application bundle in the container environment at one time, and you can add new modules at run time. You can install or uninstall the app, or stop or restart it, without affecting the environment or the other applications running in that environment. And bundles running in the same container can be given varying levels of priority, allowing some to complete faster than others.
You can easily set up Equinox from within Eclipse.
Click Help and go to the Eclipse Marketplace.
Search for "Equinox."
Click Install, thenand .
You may need to respond to a message regarding installing software with unsigned content. Click OK, and then click Yes to restart Eclipse.
Under Project Explorer right click and selector click File and .
At the import menu under Plug-in Development click Plug-ins and Fragments.
Click. Under Import From, select and browse to where your stored your OSGI bundle file.
On the Selection Screen, you should see a window pane on the left with your OSGI bundle listed.
Click on your bundle to select it and click.
The new OSGI bundle will appear in the Project Explorer.
Click the Error Log tab. Scroll through the most recent error messages, appearing at the top of the tab. Make sure there are no errors listed for your bundle.
Download the latest version of Apache Felix.
Unzip the download file and folder structure to your preferred directory.
Copy your OSGI bundle file to the installation package for Apache Felix, under the /Bundle subdirectory. Create a new directory for your bundle, /bundle/plugins.
Open a command prompt and move to the directory structure where you installed Felix.
Start the Adobe Felix framework:
java -jar bin/felix.jar
You should see the prompt for Felix:
Enter the install command:
Followed by the path and file name. The command would look something like this:
The system will respond by assigning an ID number to the bundle:
Bundle ID: 10 g!
To list the installed bundles, type, at the command prompt:
You should see your installed bundle appear, with a number to the left.
Type start and the number of your bundle to run it. In this case, you would type:
To stop the bundle, type Stop and the number of your bundle: