Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Annotation based

Blueprint

CDI

Code Block
languagejava
titleFeature definition

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

Endpoint with inlined injections

Code Block
languagejava
titleEndpoint

@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.

Code Block
languagejava
titleAnnotation based Proxy definitions

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() {
  }
}
Code Block
languagejava
titleXML based proxy definition
Code Block
languagejava
titleAnnotation based JAXRS Endpoint definition