Membrane Monitor is a SOAP router composed of several components. Because the components are descriped by an interface the implementations are exchangeable. How the components are interconnected is configured in a Spring configuration. During startup the router is assembled from its components. You can see the main building blocks in figure 1.
An EndpointListener is waiting for messages. After the arrival of a message a new exchange object is created and passed to a chain of interceptors. Each interceptor can read and manipilate the messages that flow through them. After the last interceptor has been invoked the message is passed to an EndpointSender that sends the message to its destination outside of the router. Depending on the transport the sender may be waiting for a response message. The response messages will flow in the reverse direction through the chain of interceptors.
An EndpointListener is the entrypoint into the router. After receiving a message the EndpointListener will create an Exchange object and pass it to the chain of interceptors.
The HTTPEndpointListener is an HTTPServer that can listen to a TCP port for new HTTP connections.
An EndpointSender is responsible for the forwarding of messages to its next destination.
A message exchange is represented by an Exchange object. An exchange object can be used for different message exchange patterns such as request/response or oneway. The request and response message can be accessed via an Exchange. The Exchange object also offers some properties describing the exchange.
An interceptor is placed in the middle of a message flow. Its handle method is executed each time a message flows through. The Interceptor interface is shown in figure 2.
Messages flowing through a MessageStoreInterceptor are passed to a MessageStore. The responsibility of the MessageStore is the saving and retrieval of messages.
Sometimes it is neccessary to store the messages flowing through the router. For example, if the router is used as an XML application level gateway, the messages should be stored of auditing purposes.