LibraryToggle FramesPrintFeedback

The InterceptorChain object has two methods, shown in Example 6.2, for adding interceptors to an interceptor chain. One allows you to add a single interceptor and the other allows you to add multiple interceptors.


Example 6.3 shows code for adding a single interceptor to a message's interceptor chain.


The code in Example 6.3 does the following:

1

Instantiates a copy of the interceptor to be added to the chain.

[Important]Important

The interceptor being added to the chain should be in either the same phase as the current interceptor or a latter phase than the current interceptor.

2

Gets the interceptor chain for the current message.

3

Adds the new interceptor to the chain.

The InterceptorChain object has one method, shown in Example 6.4, for removing an interceptor from an interceptor chain.


Example 6.5 shows code for removing an interceptor from a message's interceptor chain.


The code in Example 6.5 does the following:

1

Instantiates a copy of the interceptor to be removed from the chain.

[Important]Important

The interceptor being removed from the chain should be in either the same phase as the current interceptor or a latter phase than the current interceptor.

2

Gets the interceptor chain for the current message.

3

Removes the interceptor from the chain.

Comments powered by Disqus