In the previous days I was working on a new design for CXF DOSGi 2.
I would like to begin with a recap of the state of CXF DOSGi 1.8:
Since the creation of Aries RSA the CXF DOSGi project is not a full OSGi
remote service admin impl anymore. It only provides a
DistributionProvider for CXF that can run
in Aries RSA. The main problem is that there is just one provider that
can do REST and SOAP services. So it always has to carry all
dependencies. In the multi bundle distro these are about 100 bundles.
There are also a lot of configuration properties including older
deprecated properties. The Aegis support in the 1.8 version can not be
used with Java8 as Aegis produces an exception during init.
So the goals for CXF DOSGi 2 were to make it simpler and more light
weight and of course to fully support Java 8.
So this is the new design looks like this:
- cxf-dosgi-common : HttpServiceManager, IntentManager, ProxyFactory and
other small util classes. These are all shared for the providers
- cxf-dosgi-provider-ws: SOAP support. If @Webservice annotation is
present it does JAXWS/JAXB if not it does Simple/Aegis
- cxf-dosgi-provider-rs: REST support. Exposes the service as a default
JAX-RS service. It has not property support for setting providers or
interceptors
- cxf-dosgi-decorator: Allows to expose services using xml. I am not
sure if we still need this as Aries RSA can now expose services using
configs
- cxf-dosgi-repository: Pom that defines all dependencies to OSGi
bundles. This can be used as a OSGi repository in the upcoming bnd and
bndtools
Both providers support intents which can be used to set DataBinding,
Binding Config and Features. I think we might be missing support for
JAXRS @Provider classes but I am not sure.
Apart from this I removed all deprecated config properties and also
slimmed down the other config properties. I hope we still cover most use
cases but I need your feedback.
I created some Readme.md docs in the source code to explain the current
properties.
The multi bundle distro is still there and is not really smaller as it
still relies on the current karaf cxf and pax-web features which are
really big. The karaf features are split into ws and rs. So we do not
need to install everything at runtime.
To show how small a DOSGi deployment can be I created a small example
using bndtools and the repository above and was able to get a SOAP
service exported with a runnable jar that just is about
6 MB. So I hope we can support much smaller deployments of CXF DOSGi in
the future. Unfortunately I can not yet add this example to CXF DOSGi as
it relies on some an experimental pom based repo plugin. As soon as this
support is part of a bnd release I will add an example for this packaging.
I also hope the new CXF DOSGi can be the default way for karaf boot to
expose and consume REST services.
I would be happy about your feedback on the new design. Before we do a
2.0.0 release nothing is really fixed so please speak up to get your use
cases in.
Christian
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
http://www.talend.com