Abstract
Interceptors are straightforward to implement. The bulk of their processing logic is in the
handleMessage()
method. This method receives the message data and can manipulate it as needed.
Developers may also want to add some special logic to handle fault processing cases.
Figure 4.1, “Flow Through an Interceptor” shows the process flow through an interceptor.
In normal message processing only the handleMessage()
method is called. The
handleMessage()
method is where the interceptor's message processing logic is placed.
If an error occurs in the handleMessage()
method of the interceptor, or any subsequent
interceptor in the interceptor chain, the handleFault()
method is called. The
handleFault()
method is useful for cleaning up after an interceptor in the event of an error. It can
also be used to alter the fault message.