Environment

CXF is intended to work in a wide range of containers / frameworks:

It for each of the important cases it should be as easy and natural to configure CXF for the developer.

Problem description

Currently CXF provides a lot of integration points with frameworks as well as CXF proprietary ways of configuration.

Out current approach has several drawbacks:

Idea

The general idea is to step back and keep injection out of CXF as much as possible and instead rely more on the frameworks to do this job. This should make CXF much more embedable and less complex. We still can have some glue code for the frameworks but at as few points as possible.

A good example for this is camel which defines a registry concept that is implemented differently for each framework. In spring it relies on the spring context in blueprint on the blueprint context, in OSGi on services. The camel registry is not perfect but a good step in the right direction.

In the following checpters we should look into the respective frameworks and discuss how CXF integration should work ideally.

Spring

XML

Annotation based

Blueprint

CDI

@Named("MyFeature")
public class MyFeature extends AbstractFeature {
...
}

Endpoint with inlined injections

@WebService
public class MyServiceImpl implements MyService {
  @Inject MyRessource res1; // Inject arbitrary user ressources

  @Inject @Named("MyFeature") Feature feature1; // Inject named feature
  @Inject List<Feature> features; // Inject all features known to this context
...
}

We might also support some kind of Endpoint description classes to separate endpoint definition from the actual implementation. Not sure how to wire this with CDI. Any ideas?

For the proxy I am not sure which is the best annotation based approach. One idea is to have one or more factories for producers.

public class MyServiceProducer {

  @Produce MyService createMyService() {
     return new JAXWSProxyFactory("http://myserver:8080/myService");
     
  }

  @Produce @MyMarker // CDI Qualifiers to distinguish services of the same interface type
  MyService createMyService() {
  }
}