Skip to content
Browse files

Added notes on OSGifying the RabbitMQ Client Library JAR

  • Loading branch information...
1 parent 83a6986 commit 024e99c1f004caf9009cc2e28646522473c103e8 @njbartlett committed Jan 5, 2009
View
13 README
@@ -77,3 +77,16 @@ After building the bundles, the following sequence of commands can be used to te
osgi> ---Message Received---
Hello World
+
+
+Notes on "OSGifying" the RabbitMQ Client Library
+------------------------------------------------
+
+In order to use the RabbitMQ client library under OSGi it must be transformed into an OSGi bundle. This process (sometimes called "bundleizing" or "OSGifying") involves introspecting the bytecode contained in the library and generating the necessary dependency declarations to be placed in the MANIFEST.MF. It must also be done for the Apache Commons IO library on which RabbitMQ depends.
+
+Bnd is able to OSGify libraries but it must be provided certain information such as the name and version of the new bundle. This information is provided by two files in the `original` subdirectory: com.rabbitmq.client_1.5.0.beta.bnd and org.apache.commons.io_1.2.0.bnd. To generate the bundles we can simply run Bnd as follows:
+
+ bnd com.rabbitmq.client_1.5.0.beta.bnd
+ bnd org.apache.commons.io_1.2.0.bnd
+
+The resulting bundle JARs can still be used as ordinary JAR files in traditional non-OSGi Java environments. It would be advantageous therefore to incorporate this step into the main build for the RabbitMQ client library.
View
3 load/channel.bnd
@@ -1,2 +1,3 @@
Bundle-Activator: com.rabbitmq.client.osgi.channel.ChannelActivator
-Private-Package: com.rabbitmq.client.osgi.channel
+Private-Package: com.rabbitmq.client.osgi.channel,\
+ com.rabbitmq.client.osgi
View
19 src/com/rabbitmq/client/osgi/consumer/ChannelConsumerTracker.java
@@ -49,3 +49,22 @@ public void removedService(ServiceReference reference, Object service) {
context.ungetService(reference);
}
}
+
+class Pair<A, B> {
+ private final A fst;
+ private final B snd;
+
+ public Pair(A fst, B snd) {
+ this.fst = fst;
+ this.snd = snd;
+ }
+
+ public A getFst() {
+ return fst;
+ }
+
+ public B getSnd() {
+ return snd;
+ }
+
+}
View
20 src/com/rabbitmq/client/osgi/consumer/Pair.java
@@ -1,20 +0,0 @@
-package com.rabbitmq.client.osgi.consumer;
-
-public class Pair<A, B> {
- private final A fst;
- private final B snd;
-
- public Pair(A fst, B snd) {
- this.fst = fst;
- this.snd = snd;
- }
-
- public A getFst() {
- return fst;
- }
-
- public B getSnd() {
- return snd;
- }
-
-}

0 comments on commit 024e99c

Please sign in to comment.
Something went wrong with that request. Please try again.