Hi Bernd,

There are two ways in which you could do this with CXF-DOSGi.

1. With DOSGi you simply register your Java Object as an OSGi Service
with the following Service Registration property:
  service.exported.interfaces=...
As the value you provide the name or names of all the interfaces (or
classes) that you want to expose remotely. Or you can put in '*' which
means all of the interfaces/classes that you pass to
BundleContext.registerService() are exposed.
You don't need to know this value at compile time. You can set it at
runtime. So if you have an object and you want to expose it remotely,
you could in theory put in
service.exported.interfaces=myObject.getClass().getName() or something
like that. As long as the API of the object that you're trying to
remote is suitable for distribution.

2. If you aren't involved in registering the service in the OSGi
Service Registry, you can still expose it remotely. This can be done
by putting a 'service-decorations' file in a bundle which defines
matching rules for any service in the Service Registry and adds extra
properties (like the service.exported.interfaces property) to those
services for how CXF-DOSGi sees them. For more info see at the bottom
of: http://cxf.apache.org/distributed-osgi-reference.html

If you have the choice, I would definitely use option 1, as 2 is a
CXF-DOSGi-specific addition (not part of the OSGi Remote Services)
spec, and option 1 gives you more control.

Again, remember CXF-DOSGi doesn't support all types of Java
interfaces. See the following thread for some information on what is
supported: 
http://old.nabble.com/Re:-Problem-with-Distributed-OSGi-and-complex-data-types-(AWT)-td26329316.html

Hope this helps,

David

2009/11/27 Bernd Wiswedel-2 <bernd.wiswe...@gmail.com>:
>
>
> In my RCP I can expose certain functionality as web service. The service
> interface (input/ouput parameter) is unfortunately not known at compile time
> but instead computed at runtime. I ran across CXF DOSGI, which allows me to
> expose predefined java interfaces as web service (nicely demonstrated in the
> greeter demo).
>
> Can I also use that to create dynamic services? I don't want to use the
> service with other OSGi containers, only for dynamic clients.
>
> Thanks.
> --
> View this message in context: 
> http://old.nabble.com/DOSGi---Dynamic-Web-Services-%28no-service-interface-at-compile-time%29-tp26545343p26545343.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>

Reply via email to