Provides and configures core CXF components, such as Bus, Extensions, Configurer, Features, Interceptors etc. It allows you to configure and extend CXF via Guice dependency injection. This module is not intended to be used by itself, rather in the conjunction with JAX-WS Server, JAX-WS Client or JAX-RS Server modules.
A Feature in CXF is a way of adding capabilities to a Server, Client or Bus. For example, you could add the ability to log messages for each of these objects, by configuring them with a LoggingFeature. You can provide them in your application module:
class App implements Module {
public void config(Binder binder) {
CxfModule.extend(binder)
.addFeature(LoggingFeature.class)
.addFeature(new GZIPFeature());
}
}
Interceptors are the fundamental processing unit inside CXF. When a service is invoked, an InterceptorChain is created and invoked. Each interceptor gets a chance to do what they want with the message. This can include reading it, transforming it, processing headers, validating the message, etc.
class App implements Module {
public void config(Binder binder) {
CxfModule.extend(binder)
.contributeBusInterceptors()
.addInInterceptor(new LoggingInInterceptor())
.addOutInterceptor(GZIPOutInterceptor.class);
}
}
Bus interceptors will be used both in clients and server endpoints. If you want to provide client-only or server-only interceptors, check client and server modules.
CXF uses extensions mechanism to provide core internal components. You can use Guice binding to override any of them:
class App implements Module {
public void config(Binder binder) {
binder.bind(WSDLManager.class).to(CustomWSDLManager.class);
}
}
CXF provides mechanism for configuring internally created beans. Those implement org.apache.cxf.configuration.Configurable
interface and include such entities, as EndpointImpl
, ServiceImpl
, HTTPConduit
etc. You can provide your own custom configurer in a module:
class App implements Module {
public void config(Binder binder) {
CxfModule.extend(binder)
.addCustomConfigurer(HTTPConduit.class, CustomHTTPConduitConfigurer.class);
}
}