org.apache.camel.component.cxf
Class DefaultCxfBinding

java.lang.Object
  extended by org.apache.camel.component.cxf.DefaultCxfBinding
All Implemented Interfaces:
CxfBinding, HeaderFilterStrategyAware

public class DefaultCxfBinding
extends Object
implements CxfBinding, HeaderFilterStrategyAware

The Default CXF binding implementation.

Version:
$Revision: 21909 $

Constructor Summary
DefaultCxfBinding()
           
 
Method Summary
 void copyJaxWsContext(org.apache.cxf.message.Exchange cxfExchange, Map<String,Object> context)
           Copy the javax.xml.ws* headers into cxfExchange's outMessage, if the cxfExchange has no outMessage, skip this copy
protected  void extractInvocationContextFromCamel(Exchange camelExchange, Map<String,Object> camelHeaders, Map<String,Object> cxfContext, String contextKey)
           
 void extractJaxWsContext(org.apache.cxf.message.Exchange cxfExchange, Map<String,Object> context)
           Extract the message headers which key are start from javax.xml.ws* from the CXF exchange's inMessage, and put these headers into the context
static Object getBodyFromCamel(Message out, DataFormat dataFormat)
           
protected static Object getContentFromCxf(org.apache.cxf.message.Message message, DataFormat dataFormat)
           
 HeaderFilterStrategy getHeaderFilterStrategy()
          Gets the header filter strategy used
protected static List<Element> getPayloadBodyElements(org.apache.cxf.message.Message message)
           
protected  org.apache.cxf.message.MessageContentsList getResponsePayloadList(org.apache.cxf.message.Exchange exchange, List<Element> elements)
           
 void populateCxfRequestFromExchange(org.apache.cxf.message.Exchange cxfExchange, Exchange camelExchange, Map<String,Object> requestContext)
          This method is called by CxfProducer.process(Exchange).
 void populateCxfResponseFromExchange(Exchange camelExchange, org.apache.cxf.message.Exchange cxfExchange)
          This method is called by CxfConsumer to populate a CXF response exchange from a Camel exchange.
 void populateExchangeFromCxfRequest(org.apache.cxf.message.Exchange cxfExchange, Exchange camelExchange)
          This method is called by CxfConsumer.
 void populateExchangeFromCxfResponse(Exchange camelExchange, org.apache.cxf.message.Exchange cxfExchange, Map<String,Object> responseContext)
          This method is called by CxfProducer.process(Exchange).
protected  void propagateHeadersFromCamelToCxf(Exchange camelExchange, Map<String,Object> camelHeaders, org.apache.cxf.message.Exchange cxfExchange, Map<String,Object> cxfContext)
           
protected  void propagateHeadersFromCxfToCamel(org.apache.cxf.message.Message cxfMessage, Message camelMessage, Exchange exchange)
           
 void setHeaderFilterStrategy(HeaderFilterStrategy strategy)
          Sets the header filter strategy to use
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCxfBinding

public DefaultCxfBinding()
Method Detail

populateCxfRequestFromExchange

public void populateCxfRequestFromExchange(org.apache.cxf.message.Exchange cxfExchange,
                                           Exchange camelExchange,
                                           Map<String,Object> requestContext)
This method is called by CxfProducer.process(Exchange). It populates the CXF exchange and invocation context (i.e. request/response) contexts, it but does not create and populate a CXF message as a ClientImpl's invoke method will create a new CXF Message. That method will put all properties from the CXF exchange and request context to the CXF message.

Specified by:
populateCxfRequestFromExchange in interface CxfBinding
Parameters:
cxfExchange - exchange to be populated
camelExchange - exchange that contains a request
requestContext - a map contains request contexts. This parameter must not be null. The Client.invoke() method does not allow caller to pass in a CXF Message. The request context are copied to the CXF Message by the Client.invoke() method. This is how caller can set properties on the CXF message.

populateExchangeFromCxfResponse

public void populateExchangeFromCxfResponse(Exchange camelExchange,
                                            org.apache.cxf.message.Exchange cxfExchange,
                                            Map<String,Object> responseContext)
This method is called by CxfProducer.process(Exchange). It propagates information from CXF Exchange to Camel Exchange. The CXF Exchange contains a request from a CXF server.

Specified by:
populateExchangeFromCxfResponse in interface CxfBinding
Parameters:
camelExchange - exchanged to be populated
cxfExchange - exchange that contains a response
responseContext - map contains response context from CXF

populateExchangeFromCxfRequest

public void populateExchangeFromCxfRequest(org.apache.cxf.message.Exchange cxfExchange,
                                           Exchange camelExchange)
This method is called by CxfConsumer.

Specified by:
populateExchangeFromCxfRequest in interface CxfBinding
Parameters:
cxfExchange - CXF exchange that contains a request
camelExchange - Camel exchange to be populated

populateCxfResponseFromExchange

public void populateCxfResponseFromExchange(Exchange camelExchange,
                                            org.apache.cxf.message.Exchange cxfExchange)
This method is called by CxfConsumer to populate a CXF response exchange from a Camel exchange.

Specified by:
populateCxfResponseFromExchange in interface CxfBinding
Parameters:
camelExchange - Camel exchange that contains an out message
cxfExchange - CXF exchange to be populated

getHeaderFilterStrategy

public HeaderFilterStrategy getHeaderFilterStrategy()
Description copied from interface: HeaderFilterStrategyAware
Gets the header filter strategy used

Specified by:
getHeaderFilterStrategy in interface HeaderFilterStrategyAware
Returns:
the strategy

setHeaderFilterStrategy

public void setHeaderFilterStrategy(HeaderFilterStrategy strategy)
Description copied from interface: HeaderFilterStrategyAware
Sets the header filter strategy to use

Specified by:
setHeaderFilterStrategy in interface HeaderFilterStrategyAware
Parameters:
strategy - the strategy

getResponsePayloadList

protected org.apache.cxf.message.MessageContentsList getResponsePayloadList(org.apache.cxf.message.Exchange exchange,
                                                                            List<Element> elements)

extractInvocationContextFromCamel

protected void extractInvocationContextFromCamel(Exchange camelExchange,
                                                 Map<String,Object> camelHeaders,
                                                 Map<String,Object> cxfContext,
                                                 String contextKey)
Parameters:
camelExchange -
cxfContext - Request or Response context
camelHeaders -
contextKey -

propagateHeadersFromCxfToCamel

protected void propagateHeadersFromCxfToCamel(org.apache.cxf.message.Message cxfMessage,
                                              Message camelMessage,
                                              Exchange exchange)
Parameters:
cxfMessage -
camelMessage -
exchange - provides context for filtering

propagateHeadersFromCamelToCxf

protected void propagateHeadersFromCamelToCxf(Exchange camelExchange,
                                              Map<String,Object> camelHeaders,
                                              org.apache.cxf.message.Exchange cxfExchange,
                                              Map<String,Object> cxfContext)

getContentFromCxf

protected static Object getContentFromCxf(org.apache.cxf.message.Message message,
                                          DataFormat dataFormat)

getPayloadBodyElements

protected static List<Element> getPayloadBodyElements(org.apache.cxf.message.Message message)

getBodyFromCamel

public static Object getBodyFromCamel(Message out,
                                      DataFormat dataFormat)

copyJaxWsContext

public void copyJaxWsContext(org.apache.cxf.message.Exchange cxfExchange,
                             Map<String,Object> context)
Description copied from interface: CxfBinding

Copy the javax.xml.ws* headers into cxfExchange's outMessage, if the cxfExchange has no outMessage, skip this copy

Specified by:
copyJaxWsContext in interface CxfBinding
Parameters:
cxfExchange - CXF exchange to be populated
context - The map which used to store the message headers

extractJaxWsContext

public void extractJaxWsContext(org.apache.cxf.message.Exchange cxfExchange,
                                Map<String,Object> context)
Description copied from interface: CxfBinding

Extract the message headers which key are start from javax.xml.ws* from the CXF exchange's inMessage, and put these headers into the context

Specified by:
extractJaxWsContext in interface CxfBinding
Parameters:
cxfExchange - CXF exchange to be populated
context - The map which used to store the message headers


Apache CAMEL