Skip to content

Commit 932f076

Browse files
committed
Javadoc
1 parent e869d95 commit 932f076

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

core/src/main/java/org/springframework/ws/server/EndpointInterceptor.java

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
* existing or custom interceptors for certain groups of endpoints, to add common preprocessing behavior without needing
2424
* to modify each endpoint implementation.
2525
* <p/>
26-
* An <code>EndpointInterceptor</code> gets called before the appropriate {@link EndpointAdapter} triggers the
26+
* An {@code EndpointInterceptor} gets called before the appropriate {@link EndpointAdapter} triggers the
2727
* invocation of the endpoint itself. This mechanism can be used for a large field of preprocessing aspects, e.g. for
2828
* authorization checks, or message header checks. Its main purpose is to allow for factoring out repetitive endpoint
2929
* code.
3030
* <p/>
3131
* Typically an interceptor chain is defined per {@link EndpointMapping} bean, sharing its granularity. To be able to
3232
* apply a certain interceptor chain to a group of handlers, one needs to map the desired handlers via one
33-
* <code>EndpointMapping</code> bean. The interceptors themselves are defined as beans in the application context,
34-
* referenced by the mapping bean definition via its <code>interceptors</code> property (in XML: a &lt;list&gt; of
33+
* {@code EndpointMapping} bean. The interceptors themselves are defined as beans in the application context,
34+
* referenced by the mapping bean definition via its {@code interceptors} property (in XML: a &lt;list&gt; of
3535
* &lt;ref&gt;).
3636
*
3737
* @author Arjen Poutsma
@@ -52,7 +52,7 @@ public interface EndpointInterceptor {
5252
*
5353
* @param messageContext contains the incoming request message
5454
* @param endpoint chosen endpoint to invoke
55-
* @return <code>true</code> to continue processing of the request interceptor chain; <code>false</code> to indicate
55+
* @return {@code true} to continue processing of the request interceptor chain; {@code false} to indicate
5656
* blocking of the request endpoint chain, <em>without invoking the endpoint</em>
5757
* @throws Exception in case of errors
5858
* @see MessageContext#getRequest()
@@ -71,7 +71,7 @@ public interface EndpointInterceptor {
7171
*
7272
* @param messageContext contains both request and response messages
7373
* @param endpoint chosen endpoint to invoke
74-
* @return <code>true</code> to continue processing of the reponse interceptor chain; <code>false</code> to indicate
74+
* @return {@code true} to continue processing of the response interceptor chain; {@code false} to indicate
7575
* blocking of the response endpoint chain.
7676
* @throws Exception in case of errors
7777
* @see MessageContext#getRequest()
@@ -92,10 +92,25 @@ public interface EndpointInterceptor {
9292
*
9393
* @param messageContext contains both request and response messages, the response should contains a Fault
9494
* @param endpoint chosen endpoint to invoke
95-
* @return <code>true</code> to continue processing of the reponse interceptor chain; <code>false</code> to indicate
95+
* @return {@code true} to continue processing of the response interceptor chain; {@code false} to indicate
9696
* blocking of the response handler chain.
9797
*/
9898
boolean handleFault(MessageContext messageContext, Object endpoint) throws Exception;
9999

100-
void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex);
100+
/**
101+
* Callback after completion of request and response (fault) processing. Will be called on any outcome of endpoint
102+
* invocation, thus allows for proper resource cleanup.
103+
* <p/>
104+
* Note: Will only be called if this interceptor's {@link #handleRequest} method has successfully completed.
105+
* <p/>
106+
* As with the {@link #handleResponse} method, the method will be invoked on each interceptor in the chain in
107+
* reverse order, so the first interceptor will be the last to be invoked.
108+
*
109+
* @param messageContext contains both request and response messages, the response should contains a Fault
110+
* @param endpoint chosen endpoint to invoke
111+
* @param ex exception thrown on handler execution, if any
112+
* @throws Exception in case of errors
113+
* @since 2.0.2
114+
*/
115+
void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) throws Exception;
101116
}

core/src/main/java/org/springframework/ws/server/endpoint/interceptor/DelegatingSmartEndpointInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public boolean handleFault(MessageContext messageContext, Object endpoint) throw
8686
return getDelegate().handleFault(messageContext, endpoint);
8787
}
8888

89-
public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) {
89+
public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) throws Exception {
9090
getDelegate().afterCompletion(messageContext, endpoint, ex);
9191
}
9292
}

0 commit comments

Comments
 (0)