Yeah I realized that I was kinda going against the designed pattern here and I looked at Dynamic-Import but it felt wrong. What I am looking at now is using the extender pattern http://blog.osgi.org/2007/02/osgi-extender-model.html but I know that is a little shady too. I am using reactive streams with dynamic sources and sinks. Ultimately I wish the publisher ran in the bundlecontext that it was loaded with and the subscriber ran in its context but when I tie the subscriber to the publisher then the subscriber is run in the same bundlecontext as the publisher. I will use extender for now and if as I learn more about OSGI I find a better way to do it then I will fix my code. Ive been learning more and cleaning up for the past 3 months so I will just keep chugging away little by little. I thank you for all your time and explaining these concepts to me.
Thanks, David On 2015-09-20 12:53, Achim Nierbeck wrote: > Hi David, > > hmm, I guess you got the concept of OSGi wrong here. > Cause you need to declare that you want to import that package in your > manifest. > In rare cases, for example when doing frameworks like Hibernate it's ok to > have a Dynamic-Import in your Manifest. > If you are unsure about a certain package to be available, it's ususally best > to declare it optional. > For example: > > Import-Package : com.foo.my.package;version:=1.0.0;resolution:=optional > > regards, Achim > > 2015-09-20 17:42 GMT+02:00 <[email protected]>: > > As a follow on question. When I try to add my MBean to the MBean server it > fails because the bundlecontext of the code running the jmx connection > doesn't know how to find my other class even though it is exported (I can see > the package and bundle in the webconsole). How do I go about telling the > current bundlecontext to load a bundle that has a class that it needs. I > can't really use import-package on the compile because the other bundle may > not be loaded yet and I don't think it should have a hardcoded dependency on > the other package. > > Thank you for any help, > > David > > On 2015-09-20 11:22, [email protected] wrote: > > Thanks Achim, > > This was exactly what I was looking for but with worse google fu. > > On 2015-09-20 04:56, Achim Nierbeck wrote: > Hi, > > might want to use the one glassfish already provides, it's an OSGi bundle > already. [1] > > regards, Achim > > [1] - > http://search.maven.org/#artifactdetails%7Corg.glassfish.main.external%7Cjmxremote_optional-repackaged%7C4.1%7Cjar > [1] > > 2015-09-19 22:54 GMT+02:00 <[email protected]>: > > I was wondering if there were bundles out there that included > jmxremote_optional and jmxremote or if I have to include the jars in my > bundle. With all the jmx work in karaf and aires I kinda thought they may > already be there but I am missing something for where. > > -- > > Apache Member > > Apache Karaf <http://karaf.apache.org/ [2]> Committer & PMC > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/ [3]> Committer & > Project Lead > blog <http://notizblog.nierbeck.de/ [4]> > Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS [5]> > > Software Architect / Project Manager / Scrum Master -- Apache Member Apache Karaf <http://karaf.apache.org/ [2]> Committer & PMC OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/ [3]> Committer & Project Lead blog <http://notizblog.nierbeck.de/ [4]> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS [5]> Software Architect / Project Manager / Scrum Master Links: ------ [1] http://search.maven.org/#artifactdetails%7Corg.glassfish.main.external%7Cjmxremote_optional-repackaged%7C4.1%7Cjar [2] http://karaf.apache.org/ [3] http://wiki.ops4j.org/display/paxweb/Pax+Web/ [4] http://notizblog.nierbeck.de/ [5] http://bit.ly/1ps9rkS
