Apache CXF API

org.apache.cxf.ws.addressing.soap
Class MAPCodec

java.lang.Object
  extended by org.apache.cxf.phase.AbstractPhaseInterceptor<SoapMessage>
      extended by org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor
          extended by org.apache.cxf.ws.addressing.soap.MAPCodec
All Implemented Interfaces:
SoapInterceptor, Interceptor<SoapMessage>, PhaseInterceptor<SoapMessage>

public class MAPCodec
extends AbstractSoapInterceptor

SOAP interceptor responsible for {en|de}coding the Message Addressing Properties for {outgo|incom}ing messages.


Nested Class Summary
static interface MAPCodec.HeaderFactory
           
 
Field Summary
protected  Map<String,Exchange> uncorrelatedExchanges
          REVISIT: map usage that the *same* interceptor instance is used in all chains.
 
Constructor Summary
MAPCodec()
          Constructor.
 
Method Summary
<T> T
decodeAsNative(String encodedAs, Class<T> clz, Element headerElement, javax.xml.bind.Unmarshaller unmarshaller)
          Decodes a MAP from a exposed version.
protected
<T> T
decodeMAP(Class<T> clz, Element headerElement, javax.xml.bind.Unmarshaller unmarshaller)
          Decodes a MAP from a SOAP header.
protected
<T> void
encodeMAP(T value, QName qname, Class<T> clz, Element header, javax.xml.bind.Marshaller marshaller)
          Encodes an MAP as a SOAP header.
protected  MAPCodec.HeaderFactory getHeaderFactory()
           
 Map<String,Exchange> getUncorrelatedExchanges()
           
 Set<QName> getUnderstoodHeaders()
           
 void handleFault(SoapMessage message)
          Invoked when unwinding normal interceptor chain when a fault occurred.
 void handleMessage(SoapMessage message)
          Invoked for normal processing of inbound and outbound messages.
protected  void setHeaderFactory(MAPCodec.HeaderFactory factory)
           
 AddressingProperties unmarshalMAPs(SoapMessage message)
          Decode the MAPs from protocol-specific headers.
 
Methods inherited from class org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor
getFaultCodePrefix, getRoles, prepareStackTrace
 
Methods inherited from class org.apache.cxf.phase.AbstractPhaseInterceptor
addAfter, addAfter, addBefore, addBefore, getAdditionalInterceptors, getAfter, getBefore, getId, getPhase, isGET, isRequestor, setAfter, setBefore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uncorrelatedExchanges

protected final Map<String,Exchange> uncorrelatedExchanges
REVISIT: map usage that the *same* interceptor instance is used in all chains.

Constructor Detail

MAPCodec

public MAPCodec()
Constructor.

Method Detail

getUncorrelatedExchanges

public Map<String,Exchange> getUncorrelatedExchanges()

getUnderstoodHeaders

public Set<QName> getUnderstoodHeaders()
Specified by:
getUnderstoodHeaders in interface SoapInterceptor
Overrides:
getUnderstoodHeaders in class AbstractSoapInterceptor
Returns:
the set of SOAP headers understood by this handler

handleMessage

public void handleMessage(SoapMessage message)
Invoked for normal processing of inbound and outbound messages.

Parameters:
message - the messsage

handleFault

public void handleFault(SoapMessage message)
Invoked when unwinding normal interceptor chain when a fault occurred.

Specified by:
handleFault in interface Interceptor<SoapMessage>
Overrides:
handleFault in class AbstractPhaseInterceptor<SoapMessage>
Parameters:
message - the messsage message

unmarshalMAPs

public AddressingProperties unmarshalMAPs(SoapMessage message)
Decode the MAPs from protocol-specific headers.

Parameters:
message - the SOAP message
the - decoded MAPs
Throws:
SOAPFaultException - if decoded MAPs are invalid

decodeAsNative

public <T> T decodeAsNative(String encodedAs,
                            Class<T> clz,
                            Element headerElement,
                            javax.xml.bind.Unmarshaller unmarshaller)
                 throws javax.xml.bind.JAXBException
Decodes a MAP from a exposed version.

Parameters:
encodedAs - specifies the encoded version
clz - the class
headerElement - the SOAP header element
marshaller - the JAXB marshaller to use
Returns:
the decoded value
Throws:
javax.xml.bind.JAXBException

encodeMAP

protected <T> void encodeMAP(T value,
                             QName qname,
                             Class<T> clz,
                             Element header,
                             javax.xml.bind.Marshaller marshaller)
                  throws javax.xml.bind.JAXBException
Encodes an MAP as a SOAP header.

Parameters:
value - the value to encode
qname - the QName for the header
clz - the class
header - the SOAP header element
marshaller - the JAXB marshaller to use
Throws:
javax.xml.bind.JAXBException

decodeMAP

protected <T> T decodeMAP(Class<T> clz,
                          Element headerElement,
                          javax.xml.bind.Unmarshaller unmarshaller)
               throws javax.xml.bind.JAXBException
Decodes a MAP from a SOAP header.

Parameters:
clz - the class
headerElement - the SOAP header element
marshaller - the JAXB marshaller to use
Returns:
the decoded value
Throws:
javax.xml.bind.JAXBException

getHeaderFactory

protected MAPCodec.HeaderFactory getHeaderFactory()

setHeaderFactory

protected void setHeaderFactory(MAPCodec.HeaderFactory factory)

Apache CXF API

Apache CXF