public class DefaultCxfBinding extends Object implements CxfBinding, HeaderFilterStrategyAware
Constructor and Description |
---|
DefaultCxfBinding() |
Modifier and Type | Method and Description |
---|---|
protected static void |
addNamespace(Element element,
Map<String,String> nsMap) |
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 Method |
findMethod(Class<?> cls,
String name,
Class<?>... params) |
static Object |
getBodyFromCamel(Message out,
DataFormat dataFormat) |
protected static Object |
getContentFromCxf(org.apache.cxf.message.Message message,
DataFormat dataFormat) |
protected String |
getContentTypeString(List<String> values) |
HeaderFilterStrategy |
getHeaderFilterStrategy()
Gets the header filter strategy used
|
protected static List<Source> |
getPayloadBodyElements(org.apache.cxf.message.Message message,
Map<String,String> nsMap) |
protected org.apache.cxf.message.MessageContentsList |
getResponsePayloadList(org.apache.cxf.message.Exchange exchange,
List<Source> 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) |
protected String |
replaceMultiPartContentType(String contentType) |
protected void |
setCharsetWithContentType(Exchange camelExchange) |
void |
setHeaderFilterStrategy(HeaderFilterStrategy strategy)
Sets the header filter strategy to use
|
public void populateCxfRequestFromExchange(org.apache.cxf.message.Exchange cxfExchange, Exchange camelExchange, Map<String,Object> requestContext)
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.populateCxfRequestFromExchange
in interface CxfBinding
cxfExchange
- exchange to be populatedcamelExchange
- exchange that contains a requestrequestContext
- 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.public void populateExchangeFromCxfResponse(Exchange camelExchange, org.apache.cxf.message.Exchange cxfExchange, Map<String,Object> responseContext)
CxfProducer.process(Exchange)
. It propagates
information from CXF Exchange to Camel Exchange. The CXF Exchange contains a
request from a CXF server.populateExchangeFromCxfResponse
in interface CxfBinding
camelExchange
- exchanged to be populatedcxfExchange
- exchange that contains a responseresponseContext
- map contains response context from CXFpublic void populateExchangeFromCxfRequest(org.apache.cxf.message.Exchange cxfExchange, Exchange camelExchange)
CxfConsumer
.populateExchangeFromCxfRequest
in interface CxfBinding
cxfExchange
- CXF exchange that contains a requestcamelExchange
- Camel exchange to be populatedpublic void populateCxfResponseFromExchange(Exchange camelExchange, org.apache.cxf.message.Exchange cxfExchange)
CxfConsumer
to populate a CXF response exchange
from a Camel exchange.populateCxfResponseFromExchange
in interface CxfBinding
camelExchange
- Camel exchange that contains an out messagecxfExchange
- CXF exchange to be populatedprotected void setCharsetWithContentType(Exchange camelExchange)
public HeaderFilterStrategy getHeaderFilterStrategy()
HeaderFilterStrategyAware
getHeaderFilterStrategy
in interface HeaderFilterStrategyAware
public void setHeaderFilterStrategy(HeaderFilterStrategy strategy)
HeaderFilterStrategyAware
setHeaderFilterStrategy
in interface HeaderFilterStrategyAware
strategy
- the strategyprotected org.apache.cxf.message.MessageContentsList getResponsePayloadList(org.apache.cxf.message.Exchange exchange, List<Source> elements)
protected void extractInvocationContextFromCamel(Exchange camelExchange, Map<String,Object> camelHeaders, Map<String,Object> cxfContext, String contextKey)
camelExchange
- cxfContext
- Request or Response contextcamelHeaders
- contextKey
- protected void propagateHeadersFromCxfToCamel(org.apache.cxf.message.Message cxfMessage, Message camelMessage, Exchange exchange)
cxfMessage
- camelMessage
- exchange
- provides context for filteringprotected void propagateHeadersFromCamelToCxf(Exchange camelExchange, Map<String,Object> camelHeaders, org.apache.cxf.message.Exchange cxfExchange, Map<String,Object> cxfContext)
protected static Object getContentFromCxf(org.apache.cxf.message.Message message, DataFormat dataFormat)
protected static List<Source> getPayloadBodyElements(org.apache.cxf.message.Message message, Map<String,String> nsMap)
public static Object getBodyFromCamel(Message out, DataFormat dataFormat)
public void copyJaxWsContext(org.apache.cxf.message.Exchange cxfExchange, Map<String,Object> context)
CxfBinding
Copy the javax.xml.ws* headers into cxfExchange's outMessage, if the cxfExchange has no outMessage, skip this copy
copyJaxWsContext
in interface CxfBinding
cxfExchange
- CXF exchange to be populatedcontext
- The map which used to store the message headerspublic void extractJaxWsContext(org.apache.cxf.message.Exchange cxfExchange, Map<String,Object> context)
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
extractJaxWsContext
in interface CxfBinding
cxfExchange
- CXF exchange to be populatedcontext
- The map which used to store the message headersCopyright © 2007–2015 The Apache Software Foundation. All rights reserved.