[jira] Commented: (ZOOKEEPER-584) ZooKeeper service instance should be registered in the OSGi registry

2009-11-30 Thread David Bosschaert (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12783633#action_12783633
 ] 

David Bosschaert commented on ZOOKEEPER-584:


For the moment I put the bundle that runs the zookeeper server in the CXF-DOSGi 
codebase (because I'm using the functionality there).
It can configure (through the OSGi Configuration Admin Service) and run 
Zookeeper Server. 
Reconfiguration is also supported (just change the configuration information on 
the PID: org.apache.cxf.dosgi.discovery.zookeeper.server and the 
reconfiguration is applied by shutting down and starting up the zookeeper 
server in-process.

You can find it here: 
http://svn.apache.org/repos/asf/cxf/dosgi/trunk/discovery/distributed/zookeeper-server

Let me know when you think the zookeeper codebase is ready for this. It works 
for me, but I understand that the general feeling is that some changes need to 
be made to the zookeeper core before something like this can be accepted.
I'd be happy to contribute this to zookeeper if you like to have it.

 ZooKeeper service instance should be registered in the OSGi registry
 

 Key: ZOOKEEPER-584
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-584
 Project: Zookeeper
  Issue Type: New Feature
  Components: server
Reporter: Alan Cabrera

 When Zookeeper is booted in an OSGi framework by {{ManagedService}} it would 
 be quite handy to have {{ManagedService}} register a management interface for 
 that ZooKeeper instance into the OSGi service registry.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (ZOOKEEPER-584) ZooKeeper service instance should be registered in the OSGi registry

2009-11-26 Thread David Bosschaert (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12782905#action_12782905
 ] 

David Bosschaert commented on ZOOKEEPER-584:


Yeah, what you'd really want is an OSGi bundle that launches the Zookeeper 
Service from within the OSGi Framework. It should be configurable through the 
OSGi Configuration Admin Service and support changes in configuration after the 
server was launched.

An initial attempt to provide some of this functionality has already been done 
in the context of ZOOKEEPER-425. Look at the Activator.java and 
ManagedService.java of 
[zk_patch3.patch|https://issues.apache.org/jira/secure/attachment/12425484/zk_patch3.patch]
 in that bug. 

 ZooKeeper service instance should be registered in the OSGi registry
 

 Key: ZOOKEEPER-584
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-584
 Project: Zookeeper
  Issue Type: New Feature
  Components: server
Reporter: Alan Cabrera

 When Zookeeper is booted in an OSGi framework by {{ManagedService}} it would 
 be quite handy to have {{ManagedService}} register a management interface for 
 that ZooKeeper instance into the OSGi service registry.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (ZOOKEEPER-425) Add OSGi metadata to zookeeper.jar

2009-11-25 Thread David Bosschaert (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12782351#action_12782351
 ] 

David Bosschaert commented on ZOOKEEPER-425:


Hi Patrick,

You can already use this as-is in Felix or Equinox (or any other OSGi 
container). The value that the metadata in the buildxml.patch provides is that 
it exports (and imports) packages the OSGi way, which means that you can build 
a zookeeper client in its own bundle that pulls in the zookeeper classes using 
OSGi dependency management.

Here's a quick example of how to use it (using Felix 2.0.0):
{code}.../felix-framework-2.0.0java -jar bin/felix.jar

Welcome to Felix


- start 
http://www.springsource.com/repository/app/bundle/version/download?name=com.springsource.org.apache.log4jversion=1.2.15type=binary
Bundle ID: 4
- start file:///.../zookeeper/build/zookeeper-3.3.0.jar
- ps
START LEVEL 1
   ID   State Level  Name
[   0] [Active ] [0] System Bundle (2.0.0)
[   1] [Active ] [1] Apache Felix Bundle Repository (1.4.1)
[   2] [Active ] [1] Apache Felix Shell Service (1.4.0)
[   3] [Active ] [1] Apache Felix Shell TUI (1.4.0)
[   4] [Active ] [1] Apache Log4J (1.2.15)
[   5] [Active ] [1] ZooKeeper Bundle (3.3.0)

- inspect package requirement 5
org.apache.hadoop.zookeeper [5] imports packages:
-
org.osgi.framework; version=1.5.0 - org.apache.felix.framework [0]
org.osgi.util.tracker; version=1.4.0 - org.apache.felix.framework [0]
javax.management; version=1.6.0 - org.apache.felix.framework [0]
org.apache.log4j; version=1.2.15 - com.springsource.org.apache.log4j [4]

- inspect package capability 5
org.apache.hadoop.zookeeper [5] exports packages:
-
org.apache.zookeeper; version=3.3.0
org.apache.zookeeper.data; version=3.3.0
org.apache.zookeeper.version; version=3.3.0
org.apache.zookeeper.server; version=3.3.0
org.apache.zookeeper.server.quorum; version=3.3.0
{code}
As you can see the Log4J dependency is provided through a Log4J bundle. I'm 
using one straight from the SpringSource bundle repository (the SpringSource 
guys have turned many libraries into OSGi bundles), but you may also be able to 
find a Log4J bundle elsewhere.
After installing the Zookeeper Bundle (the jar is now also an OSGi bundle) you 
can see that it uses OSGi imports to satisfy its dependencies (e.g. it links to 
bundle 4 for its log4j imports) and it exports the zookeeper packages. The way 
to use them in OSGi-based clients is simply through imports (as 
[here|http://svn.apache.org/repos/asf/cxf/dosgi/trunk/discovery/distributed/cxf-discovery/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/FindInZooKeeperCustomizer.java]),
 but additionally the client bundle will have Import-Package statements for the 
zookeeper packages in its manifest.


 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
Reporter: David Bosschaert
Assignee: David Bosschaert
 Fix For: 3.3.0

 Attachments: buildxmlpatch.patch, 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-NameZooKeeper bundle/Bundle-Name
   Bundle-DescriptionThis bundle contains the ZooKeeper 
 library/Bundle-Description
   Bundle-SymbolicNameorg.apache.hadoop.zookeeper/Bundle-SymbolicName
   Bundle-Version3.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.



[jira] Updated: (ZOOKEEPER-425) Add OSGi metadata to zookeeper.jar

2009-11-23 Thread David Bosschaert (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Bosschaert updated ZOOKEEPER-425:
---

 Tags: osgi
Fix Version/s: 3.3.0
Affects Version/s: (was: 3.1.1)
   Status: Patch Available  (was: Open)

 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
Reporter: David Bosschaert
 Fix For: 3.3.0

 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-NameZooKeeper bundle/Bundle-Name
   Bundle-DescriptionThis bundle contains the ZooKeeper 
 library/Bundle-Description
   Bundle-SymbolicNameorg.apache.hadoop.zookeeper/Bundle-SymbolicName
   Bundle-Version3.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.



[jira] Updated: (ZOOKEEPER-425) Add OSGi metadata to zookeeper.jar

2009-11-23 Thread David Bosschaert (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Bosschaert updated ZOOKEEPER-425:
---

Attachment: buildxmlpatch.patch

The patch named 'buildxmlpatch.patch' contains changes to the build.xml to 
cover case 1.

It does an export-package of 
  org.apache.zookeeper.server
  org.apache.zookeeper.server.quorum
to make it possible to launch the server process from a separate bundle. 

If the general feeling is that the Zookeeper codebase isn't ready for case 3, 
I'm happy to host my Activator/ManageService elsewhere until it is ready for it.

 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
Reporter: David Bosschaert
 Fix For: 3.3.0

 Attachments: buildxmlpatch.patch, 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-NameZooKeeper bundle/Bundle-Name
   Bundle-DescriptionThis bundle contains the ZooKeeper 
 library/Bundle-Description
   Bundle-SymbolicNameorg.apache.hadoop.zookeeper/Bundle-SymbolicName
   Bundle-Version3.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.



[jira] Commented: (ZOOKEEPER-425) Add OSGi metadata to zookeeper.jar

2009-11-23 Thread David Bosschaert (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12781445#action_12781445
 ] 

David Bosschaert commented on ZOOKEEPER-425:


Yes, I agree that it would be better to put uses clauses on the Export-Package 
declaration. However, you really need a tool such as BND 
(http://www.aqute.biz/Code/Bnd) (or the maven-bundle-plugin which uses bnd) to 
generate these for you. Putting them in by hand is hard, error prone and 
difficult to maintain (IMHO). 

I already mention BND in the patch and would be happy to update it to get ant 
to use BND if people think this would be good. We can then let BND generate the 
uses clauses for us.

 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
Reporter: David Bosschaert
 Fix For: 3.3.0

 Attachments: buildxmlpatch.patch, 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-NameZooKeeper bundle/Bundle-Name
   Bundle-DescriptionThis bundle contains the ZooKeeper 
 library/Bundle-Description
   Bundle-SymbolicNameorg.apache.hadoop.zookeeper/Bundle-SymbolicName
   Bundle-Version3.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.



[jira] Updated: (ZOOKEEPER-425) Add OSGi metadata to zookeeper.jar

2009-11-19 Thread David Bosschaert (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Bosschaert updated ZOOKEEPER-425:
---

Attachment: zk_patch3.patch

The attached patch (named zk_patch3.patch) implements some of the 
functionality. Its not fully finished yet, I'm attaching it at this point to 
get some feedback.

The patch:
* Adds the OSGi Metadata to the MANIFEST.MF
* Can be used as just a library bundle if you want to write a zookeeper client 
in another OSGi bundle.
* Can be used to run the zookeeper server. To do this the server has to be 
configured. Configuration is handled through the OSGi Configuration Admin 
service. The bundle has an optional dependency on this service and registers an 
org.osgi.service.cm.ManagedService service to be configured by CM. The PID for 
this service is org.apache.zookeeper and all of the configuration variables are 
the same as in the non-OSGi zoo.cfg file (it uses the same ServerConfig class 
to handle them). 
All configuration properties have defaults provided, except for the 
'clientPort' one, which has to be provided through Config Admin. For the data 
directory the OSGi Bundle-private storage directory is used by default.
* The jar has an OSGi BundleActivator class, which will be triggered if run on 
an OSGi framework.
* BTW the zookeeper.jar stil also works as a POJ (plain old Jar ;)

note that I updated the ivy.xml file to pull in two OSGi jars that are needed 
at build time. However they don't need to be redistributed with the zookeeper 
jar as they are provided by the OSGi framework.

There are still a few open questions that I have:
* In OSGi things should really be (re)configurable at runtime. This means that 
the Configuration Admin Service may call your ManagedService.updated() callback 
with changed properties at any time. I guess the easiest (but not necessarily 
the most elegant) way to handle this is by taking down the ZooKeeperServerMain 
and relaunching it with the modified properties. ZooKeeperServerMain has a 
shutdown() method that I could use for this. Would that be the best idea?
* I'm not (yet) familiar with the cluster setup and am wondering whether the 
configuration approach that I took also works in that case.
I also intend to provide some unit tests before closing this off.

BTW I haven't gone into detail how the OSGi Configuration Admin service 
typically works. Let me know if I need to provide more info on that.

 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-NameZooKeeper bundle/Bundle-Name
   Bundle-DescriptionThis bundle contains the ZooKeeper 
 library/Bundle-Description
   Bundle-SymbolicNameorg.apache.hadoop.zookeeper/Bundle-SymbolicName
   Bundle-Version3.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.



[jira] Commented: (ZOOKEEPER-425) Add OSGi metadata to zookeeper.jar

2009-11-19 Thread David Bosschaert (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12780012#action_12780012
 ] 

David Bosschaert commented on ZOOKEEPER-425:


Hi Alan, that sounds like a useful idea to me and using a service in the OSGi 
Service Registry sounds like a really good approach but I personally think that 
this should be a separate bug/enhancement. Let's get the basics working first :)

 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-NameZooKeeper bundle/Bundle-Name
   Bundle-DescriptionThis bundle contains the ZooKeeper 
 library/Bundle-Description
   Bundle-SymbolicNameorg.apache.hadoop.zookeeper/Bundle-SymbolicName
   Bundle-Version3.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.



[jira] Commented: (ZOOKEEPER-425) Add OSGi metadata to zookeeper.jar

2009-11-19 Thread David Bosschaert (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12780278#action_12780278
 ] 

David Bosschaert commented on ZOOKEEPER-425:


Let me explain the context of my work. For the OSGi Remote Services Admin 
Service (an OSGi specification based on the Distributed OSGi RFC 119 work) we 
are working on the Reference Implementation in CXF 
(http://cxf.apache.org/distributed-osgi.html). The Reference Implementation 
supports the Discovery concepts of the Remote Service specification and for the 
implementation we make use of ZooKeeper.

In our code, we use zookeeper in two ways: 
* In zookeeper client code. This code resides in bundles that import the 
org.apache.zookeeper and org.apache.zookeeper.data
* We also need to be able to run the zookeeper server from inside an OSGi bundle

So this is really cases 1  3 above.

I think we all agree on 1, and I can certainly put that in a separate patch.

On part 2 - this is the one that Alan filed ZOOKEEPER-584 for, right? This is a 
case that I don't need at this point, and therefore I probably don't understand 
what the best way to realize it is. I understand that this can be quite useful 
and registering a 'trivial' zookeeper object in the service registry is easy, 
but I guess what Alan is really looking for is an object from which he can get 
some management information. I really see this as a separate issue and one 
possibly best solved by someone who actually has a need for this.

The code that I attached does address part 3 somewhat, although I agree that it 
could be better. However it's a start. The zookeeper server starts and can be 
configured. I can try to make the shutdown/restart on reconfiguration work as 
well. I haven't been troubled by the System.exits() yet. It works well enough 
for me at the moment, although it could be improved. Could we not do the 
improvement over time in the future, starting off with something that works a 
bit like in my patch and then making it better over time?

Patrick, on your comment re a contrib package. First of all the code is not 
specific to an osgi container and should work equally in all osgi frameworks. 
Do you mean just putting the source code in a separate location or are you also 
thinking of putting it in a separate jar file? I would suggest putting the 
Activator and ManagedService in the ordinary zookeeper.jar. Outside of an OSGi 
framework these classes are simply ignored, but when the jar is used as an OSGi 
bundle they are automatically found and used. If you put it in a separate jar 
you will have to deploy 2 bundles before you can run the zookeeper server in an 
OSGi framework, which is possible but you'd have to export 
org.apache.zookeeper.server which is currently internal to make it work. 
Besides these two classes are currently only about 5kb in total.

 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-NameZooKeeper bundle/Bundle-Name
   Bundle-DescriptionThis bundle contains the ZooKeeper 
 library/Bundle-Description
   Bundle-SymbolicNameorg.apache.hadoop.zookeeper/Bundle-SymbolicName
   Bundle-Version3.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.



[jira] Commented: (ZOOKEEPER-425) Add OSGi metadata to zookeeper.jar

2009-11-12 Thread David Bosschaert (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12777017#action_12777017
 ] 

David Bosschaert commented on ZOOKEEPER-425:


Hi Benjamin, that helps. I'll play around with that explicit subset.
What I really need is both. Provide client access to the Zookeeper API, but 
also a way to start the server. To do that we may not have to expose those 
server classes at all. One thing we could do is add an activator to the 
zookeeper jar and have it use the OSGI Configuration Admin to control the 
zookeeper server. It should be possible to do this without changing it being a 
plain jar too.
Anyway - I'll try to find some time over the next while to play with this and 
will let you know how far I get.

 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


 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-NameZooKeeper bundle/Bundle-Name
   Bundle-DescriptionThis bundle contains the ZooKeeper 
 library/Bundle-Description
   Bundle-SymbolicNameorg.apache.hadoop.zookeeper/Bundle-SymbolicName
   Bundle-Version3.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.



[jira] Commented: (ZOOKEEPER-425) Add OSGi metadata to zookeeper.jar

2009-11-11 Thread David Bosschaert (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12776548#action_12776548
 ] 

David Bosschaert commented on ZOOKEEPER-425:


Hi Benjamin. Did you actually take a look at the attached MANIFEST.MF? Are the 
import and export statements in there correct? What is in the XML above is just 
the maven-bundle-plugin/BND instructions to create the exact list by 
introspection :)
If you think it would be better to explicitly list everything when creating the 
manifest, please state what you would like to see in there.

 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


 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-NameZooKeeper bundle/Bundle-Name
   Bundle-DescriptionThis bundle contains the ZooKeeper 
 library/Bundle-Description
   Bundle-SymbolicNameorg.apache.hadoop.zookeeper/Bundle-SymbolicName
   Bundle-Version3.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.



[jira] Updated: (ZOOKEEPER-426) Windows versions of zookeeper scrips

2009-06-02 Thread David Bosschaert (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-426?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Bosschaert updated ZOOKEEPER-426:
---

Attachment: zkServer.cmd
zkEnv.cmd
zkCli.cmd

 Windows versions of zookeeper scrips
 

 Key: ZOOKEEPER-426
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-426
 Project: Zookeeper
  Issue Type: Improvement
  Components: scripts
Affects Versions: 3.1.1
Reporter: David Bosschaert
 Attachments: zkCli.cmd, zkEnv.cmd, zkServer.cmd


 Attached are a some Windows versions of the zookeeper scripts. They aren't as 
 powerful as the .sh ones but they do work for me and can be invoked with any 
 directory as the current dir.
 The biggest trick in the scripts is in the zkEnv.cmd one where it says: 
   set ZOOCFGDIR=%~dp0%..\conf
 this basically figures out the location of the zkEnv.cmd file and sets the 
 conf directory relative to that.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Created: (ZOOKEEPER-426) Windows versions of zookeeper scrips

2009-06-02 Thread David Bosschaert (JIRA)
Windows versions of zookeeper scrips


 Key: ZOOKEEPER-426
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-426
 Project: Zookeeper
  Issue Type: Improvement
  Components: scripts
Affects Versions: 3.1.1
Reporter: David Bosschaert
 Attachments: zkCli.cmd, zkEnv.cmd, zkServer.cmd

Attached are a some Windows versions of the zookeeper scripts. They aren't as 
powerful as the .sh ones but they do work for me and can be invoked with any 
directory as the current dir.
The biggest trick in the scripts is in the zkEnv.cmd one where it says: 
  set ZOOCFGDIR=%~dp0%..\conf
this basically figures out the location of the zkEnv.cmd file and sets the conf 
directory relative to that.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-426) Windows versions of zookeeper scripts

2009-06-02 Thread David Bosschaert (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-426?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Bosschaert updated ZOOKEEPER-426:
---

Summary: Windows versions of zookeeper scripts  (was: Windows versions of 
zookeeper scrips)

 Windows versions of zookeeper scripts
 -

 Key: ZOOKEEPER-426
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-426
 Project: Zookeeper
  Issue Type: Improvement
  Components: scripts
Affects Versions: 3.1.1
Reporter: David Bosschaert
 Attachments: zkCli.cmd, zkEnv.cmd, zkServer.cmd


 Attached are a some Windows versions of the zookeeper scripts. They aren't as 
 powerful as the .sh ones but they do work for me and can be invoked with any 
 directory as the current dir.
 The biggest trick in the scripts is in the zkEnv.cmd one where it says: 
   set ZOOCFGDIR=%~dp0%..\conf
 this basically figures out the location of the zkEnv.cmd file and sets the 
 conf directory relative to that.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.