I am considering using osgi in a typical java-swing client-server application.
I would like to break the server code into osgi services and then mark some of them as 'remotely exported' and then have a bundle which makes these services avaliable to the client. The client would also use osgi and include a bundle which connects to the server and makes the exported services available as local services.
We currently use some rmi-like code which just exposes a single interface over a socket.
I have looked into.
- r-osgi last release Jan 2009, got a null pointer exception when I tried it, doesn't automatically register services locally
- cfx appears to be soap/rest only. and we have large payloads
- ecf Not much documentation when usin开发者_运维知识库g outside eclipse. Not sure what to download or how to get started
Other points to note: - We need it to use ssl and also apply some authentication on connecting - It needs to reconnect if the server gets restarted - The code is actually scala
I could just add to our existing rmi-like code but I'd rather use an existing library
Thanks for any advice or experiences
Since OSGi 4.2 specification, there exist Remote Services Specification (chapter 13).
By now, only 3 frameworks implements this specification: ECF, Apache CFX and Paremus.
I am using ECF because is the most mature open-source implementation right now. BTW, ECF includes R-Osgi as an available transport mechanism (R-OSGi is not OSGi 4.2 compliant as standalone) and other discovery and distribution mechanisms (Zookeper, REST...). There is a good integrators guide here.
OSGi guru Neil Bartlett also recommended me (via twitter ;) the Paremus implementation. He said that is the most complete and functional one, but it cost money. Maybe you should take a look.
精彩评论