Open Services Gateway Initiative (OSGi) is a framework for the packaging and dynamic deployment of Java software services to networked devices. The OSGi specification defines a component-based architecture splitting packages and services into components known as bundles. Each bundle is effectively a modified jar file. A bundle has a Manifest, which describes the services or packages that the bundle either requires or exports. A service is simply an interface that the bundle implements. Therefore, Interacting bundles are only loosely coupled to each other via these service definitions or by Java package declaration.
OSGi can effectively be split between the client runtime and the bundle server or repository that provides the required bundle. The runtime provides the following functionality:
WebSphere MQ Everyplace supplies an example bundle, the MQeBundle.jar, that OSGi developers can use to provide messaging functionality within a gateway or client runtime. The MQeBundle.jar is an OSGi bundle containing the core functionality for a queue manager running as client or server. The following sections describe how to install and run the bundle within the IBM Service Management Framework (SMF) OSGi implementation.
You can Install bundles onto the server can either through the web interface or using the IDE incorporated into Websphere Studio Device Developer (WSDD). In both cases, the bundle server needs to be started. This is simply done by invoking the script iveserver found in WSDDHOME/wsdd5.0/technologies/smf/server. The default is port 8080, this may conflict with applications currently residing on your server, for example, Apache. To change the port, alter the org.osgi.service.http.Port=8080 property in the smf.properties file, which resides in the runtime directory.
Once the bundle server is running, administer bundles by opening a web browser with the following URL http://hostname:port/smf, where typically, the hostname is "localhost"and the port is 8080.
Bundle installation is carried out in two stages:
Only released bundles are available to client runtimes and users configured on the server need to have the correct privileges in order to carry out either or both stages. For more information on the options available for bundle submission, see the smf documentation in WSDDHOME/wsdd5.0/technologies/smf/client/docs.
There are two ways to update the bundle server depending on whether you are developing your own bundle or installing an existing one
Once all the required bundles have been installed onto the server you can then use a runtime. You can control runtimes using either the WSDD IDE or the command prompt. If using the IDE, each runtime you use needs to be configured to use a separate port. Configure the runtime by editing the smf.bat file that starts the IDE. There is a limit of one runtime per IDE, even if you are connecting to a remote runtime.
Running the smf.bat script starts the appropriate runtime. For more information on how to tailor the runtime and the additional console commands available, see the relevant smf documentation. However, to install the required bundle simply type
smf > install <URL>
The url can be the specific file location on the machine, for example file:/fully qualified file path, or a remote location, http://remote location of file. There is also an smf specific protocol smfdb:/bundle name which uses the Safe Bundle Install method to install this bundle and all the bundles prerequisites. To get a summarized list of the all installed bundles, their locations, and state, simply type
smf ss
Next, to start and stop the bundle, type
smf > start <bundle_id> smf > stop <bundle id>
To run the runtime within WSDD, the user needs to define a new runtime using the dialog found when selecting run ->run from the main menu.
Once the runtime is configured and then started, the runtimes properties and bundle information is shown within the SMF Runtime view. To install the required bundle, select the bundle on the bundle servers list, right click the bundle, and on the popup menu select install. Once installed, the bundle should be visible within the SMF Runtime view. Right clicking one of the list of bundles enables the user to uninstall, start, or stop the relevant bundle.
When using the WebSphere MQ Everyplace bundle:
For more details on running the example application bundles provided see the Application Programming Guide.