Support for OSGi

OSGi provides a framework that supports the deployment of applications as bundles. Nine OSGi bundles are supplied as part of the IBM MQ classes for JMS.

OSGi provides a general purpose, secure, and managed Java framework, which supports the deployment of applications that come in the form of bundles. OSGi-compliant devices can download and install bundles, and remove them when they are no longer required. The framework manages the installation and update of bundles in a dynamic and scalable fashion.

The IBM MQ classes for JMS includes the following OSGi bundles.

    com.ibm.msg.client.osgi.jmsversion_number.jar
    The common layer of code in the IBM MQ classes for JMS. For information about the layered architecture of IBM MQ classes for JMS, see IBM MQ classes for JMS architecture.

    com.ibm.msg.client.osgi.jms.prereq_version_number.jar
    The prerequisite Java archive (JAR) files for the common layer.

    com.ibm.msg.client.osgi.commonservices.j2se_version_number.jar
    Common services for Java Platform, Standard Edition (Java SE) applications.

    com.ibm.msg.client.osgi.nls_version_number.jar
    Messages for the common layer.

    com.ibm.msg.client.osgi.wmq_version_number.jar
    The IBM MQ messaging provider in IBM MQ classes for JMS. For information about the layered architecture of IBM MQ classes for JMS, see IBM MQ classes for JMS architecture.

    com.ibm.msg.client.osgi.wmq.prereq_version_number.jar
    The prerequisite JAR files for the IBM MQ messaging provider.

    com.ibm.msg.client.osgi.wmq.nls_version_number.jar
    Messages for the IBM MQ messaging provider.

    com.ibm.mq.osgi.allclient_version_number.jar
    This JAR file allows applications to use both the IBM MQ classes for JMS and the IBM MQ classes for Java, and also includes the code to handle PCF messages.

    com.ibm.mq.osgi.allclientprereqs_version_number.jar
    This JAR file provides the prerequisites for com.ibm.mq.osgi.allclient_version_number.jar where version_number is the version number of IBM MQ that is installed.

The bundles are installed into the java/lib/OSGi subdirectory of your IBM MQ installation, or the java\lib\OSGi folder on Windows.

From IBM MQ Version 8.0, use the bundles com.ibm.mq.osgi.allclient_8.0.0.0.jar, and com.ibm.mq.osgi.allclientprereqs_8.0.0.0.jar for any new applications. Using these bundles removes the restriction of not being able to run both IBM MQ classes for JMS and the IBM MQ classes for Java within the same OSGi framework, all other restrictions still apply however. For versions of the product before IBM MQ Version 8.0, this restriction of using either IBM MQ classes for JMS or IBM MQ classes for Java applies.

The bundle com.ibm.mq.osgi.javaversion_number.jar, which is also installed into the java/lib/OSGi subdirectory of your IBM MQ installation, or the java\lib\OSGi folder on Windows, is part of the IBM MQ classes for Java. This bundle must not be loaded into an OSGi runtime environment that has the IBM MQ classes for JMS loaded.

The OSGi bundles for the IBM MQ classes for JMS have been written to the OSGi Release 4 specification. They do not work in an OSGi Release 3 environment.

You must set your system path or library path correctly so that the OSGi runtime environment can find any required DLL files or shared libraries.

If we use the OSGi bundles for the IBM MQ classes for JMS, temporary topics do not work. In addition, channel exit classes written in Java are not supported because of an inherent problem in loading classes in a multiple class loader environment such as OSGi. A user bundle can be aware of the IBM MQ classes for JMS bundles, but the IBM MQ classes for JMS bundles are not aware of any user bundle. As a result, the class loader used in an IBM MQ classes for JMS bundle cannot load a channel exit class that is in a user bundle.

For more information about OSGi, see the OSGi Alliance website.