[ https://issues.apache.org/jira/browse/ZOOKEEPER-425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12780219#action_12780219 ]
Benjamin Reed commented on ZOOKEEPER-425: ----------------------------------------- david, nice work. i think we should break this patch into possibly three parts: 1) manifest update to just export the right packages 2) an activator that registers a ZooKeeper object as a service. (this would be a client object) 3) an activator that starts up a server. you seem to be ignoring 2). it might be useful to have the bundles of an osgi framework share a ZooKeeper object. maybe not though. sharing makes it nice to get a preconfigured connected ZooKeeper object from the service registry. we can't really support 3) properly right now. it is possible to shutdown a server and start it back up. the interfaces aren't very well exposed but the tests do it. a bigger problem is that we have System.exits in our code, and even if the bundle doesn't have permission to call System.exit, not exiting can cause bad things to happen. i would suggest focusing this issue on 1) and possibly 2), but leave 3) for a separate issue. > Add OSGi metadata to zookeeper.jar > ---------------------------------- > > Key: ZOOKEEPER-425 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-425 > Project: Zookeeper > Issue Type: Improvement > Components: build > Affects Versions: 3.1.1 > Reporter: David Bosschaert > Attachments: MANIFEST.MF, zk_patch3.patch > > > After adding OSGi metadata to zookeeper.jar it can be used as both an OSGi > bundle as well as an ordinary jar file. > In the CXF/DOSGi project the buildsystem does this using the > maven-bundle-plugin: > http://svn.apache.org/repos/asf/cxf/dosgi/trunk/discovery/distributed/zookeeper-wrapper/pom.xml > The MANIFEST.MF generated by maven-bundle-plugin is attached to this bug, > this works for the CXF/DOSGi project. > If your buildsystem isn't using maven, I would advise to use bnd > (http://www.aqute.biz/Code/Bnd). BND defines its own ant task in which you > should be able to use more or less the same instructions as were used in > maven: > <instructions> > <Bundle-Name>ZooKeeper bundle</Bundle-Name> > <Bundle-Description>This bundle contains the ZooKeeper > library</Bundle-Description> > <Bundle-SymbolicName>org.apache.hadoop.zookeeper</Bundle-SymbolicName> > <Bundle-Version>3.1.1</Bundle-Version> > <Import-Package>*</Import-Package> > <Export-Package>*;version=3.1.1</Export-Package> > </instructions> > Oh and one other thing. Is it really necessary to put the source code in the > Jar file too? I would put that in a separate source distribution :) > See also: > http://mail-archives.apache.org/mod_mbox/hadoop-zookeeper-user/200905.mbox/%3c4a2009b1.3030...@yahoo-inc.com%3e -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.