Configuring the Bus
The Bus is the backbone of CXF architecture. It manages extensions and acts as an interceptor provider. The interceptors for the bus will be added to the respective inbound and outbound message and fault interceptor chains for all client and server endpoints created on the bus (in it's context).
By default, it contributes no interceptors to either of these interceptor chain types. To change this, simply define a bus element in your Spring configuration file, and add child elements as required,for example:
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cxf="http://cxf.apache.org/core" xsi:schemaLocation=" http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="logOutbound" class="org.apache.cxf.interceptor.LoggingOutInterceptor"/> <cxf:bus> <cxf:outInterceptors> <ref bean="logOutbound"/> </cxf:outInterceptors> </cxf:bus> </beans>
The configurable properties of the bus are defined in the bus configuration schema http://cxf.apache.org/schemas/core.xsd http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/resources/schemas/core.xsd?view=markup.
Be sure to include the namespace - URI pair for this schema in the schemaLocation attribute of the <beans> element.
The <bus> elements supports the following child elements:
Name |
Value |
---|---|
inInterceptors |
The interceptors contributed to inbound message interceptor chains. A list of <bean>s or <ref>s. |
inFaultInterceptors |
The interceptors contributed to inbound fault interceptor chains. A list of <bean>s or <ref>s. |
outInterceptors |
The interceptors contributed to outbound message interceptor chains. A list of <bean>s or <ref>s. |
outFaultInterceptors |
The interceptors contributed to outbound fault interceptor chains. A list of <bean>s or <ref>s. |
features |
The features applied to the bus. A list of <bean>s or <ref>s. |
Extending the Bus
TODO: Explain how to add a custom bus extension (META-INF/cxf/cxf.extension ...).