Chapter 26. Working with OSGi applications 923
Application bundles and shared bundles
Application bundles are instance-specific or
isolated, and each instance of an application
includes its own instance of the bundle. Shared bundles are
shared or not
instance-specific, and a single instance of a package or service from a shared bundle can
be used by many applications.
Web application bundles
A
web application bundle is a bundle that contains a web application and that can be
deployed in an OSGi container.
EJB bundles
An EJB bundle is a bundle that contains EJBs and that can be deployed in an OSGi
container. An EJB bundle is an OSGi bundle version of an EJB JAR file. It is a new feature
introduced in WebSphere Application Server V8.5.
For more information about OSGi bundles and bundle archives, refer to the following website:
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-nd
-dist&topic=ca_bundles
OSGi Bundle Manifest file
The metadata for an OSGi application is defined in manifest files. An OSGi bundle contains a
bundle manifest. A composite bundle archive contains a composite bundle manifest. An
enterprise bundle archive contains an application manifest. An enterprise bundle archive
asset contains a deployment manifest which is generated automatically when the enterprise
bundle archive file is imported as an asset.
In this section we focus on the OSGi bundle manifest located under META-INF/MANIFEST.MF.
For other manifest information, refer to the following website:
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-nd
-dist&topic=ca_manifest
We now check each element of the example manifest shown as Example 26-1.
Example 26-1 An example of bundle manifest file, META-INF/MANIFEST.MF
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: MyLibrary bundle
Bundle-SymbolicName: com.sample.mylibrary
Bundle-Version: 42.0.0
Bundle-Activator: com.sample.mylibrary.Activator
Import-Package: org.osgi.framework;version=”[1.0.0,2.0.0)”
Export-Package:
com.sample.mylibrary.stringops;version=23.2.1,com.sample.mylibrary.integerops;ver
sion=5.0.0
Meta-Persistence: entities/persistence.xml,
lib/thirdPartyEntities.jar!/META-INF/persistence.xml
Web-ContextPath: /contextRoot
Export-EJB:
Bundle-Blueprint: /blueprint/*.xml