Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This document provides an architectural overview of the Apache CXF services framework.

Table of Contents

Table of Contents
maxLevel3
styleoutline

Architectural Goals and Constraints

...

How service calls are processed

Gliffy Diagram
size

...

600
nameMessageFlowOnClientSide

Client Side

Gliffy Diagram
size

...

600
nameMessageFlowOnServerSide

Server Side

Front-ends

Front-ends provide a programming model to interact with CXF. JAX-WS, JAX-RS, Simple and Javascript front-end APIs are provided by CXF . Each implementation is cleanly separated from the rest of CXF, just like the bindings and the core. Front-ends provide functionality through interceptors that are added to Services and Endpoints. See also Front-ends

...

An interesting feature of the PhaseInterceptorChain is that it is reentrant. This can be powerful and slightly dangerous. This feature is only used in CXF during the sending of an outgoing message, The SoapOutInterceptor is the best example:

Code Block
java
java

public void handleMessage(Message m) {
  writeSoapEnvelopeStart();
  writeSoapBodyStart();

  // invoke next interceptor, which writes the contents of the SOAP Body
  m.getInterceptorChain().doIntercept(m);
  writeSoapBodyEnd();

  writeSoapEnvelopeEnd();
}

...

The Soap binding also adds a special type of interceptor called the SoapInterceptor. The SoapInterceptor adds two methods to the Interceptor class:

Code Block
java
java

Set<URI> getRoles();
Set<QName> getUnderstoodHeaders();

...

Destinations are the basis for receiving incoming messages. A destination is created from a DestinationFactory:

Code Block
java
java

DestinationFactoryManager dfManager = bus.getExtension(DestinationFactoryManager.class);

// Find a DestinationFactory for the SOAP HTTP transport
DestinationFactory df = dfManager.getDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http");

// TODO: outline building of EndpointInfo
EndpointInfo endpointInfo = ...;
Destination destination = df.getDestination(endpointInfo);

MessageObservers can then be registered with Destinations. These listen for incoming messages:

Code Block
java
java

MessageObserver myObserver = ...;
destination.setMessageObserver(myObserver);

...