Skip to content

Commit b02a8be

Browse files
committed
SWS-951 - Introduce ClientInterceptorAdapter
This commit introduces a ClientInterceptorAdapter with a default implementation of the methods and providing a protected Log instance for subclasses. This convenience class allows for pre-/post only ClientInterceptor instances without having to add empty methods to it.
1 parent 420e795 commit b02a8be

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package org.springframework.ws.client.support.interceptor;
2+
3+
import org.apache.commons.logging.Log;
4+
import org.apache.commons.logging.LogFactory;
5+
import org.springframework.ws.client.WebServiceClientException;
6+
import org.springframework.ws.context.MessageContext;
7+
8+
/**
9+
*
10+
* Default implementation of the {@code ClientInterceptor} interface, for simplified implementation of
11+
* pre-only/post-only interceptors.
12+
*
13+
* @author Marten Deinum
14+
* @since 2.2.5
15+
*/
16+
public abstract class ClientInterceptorAdapter implements ClientInterceptor {
17+
18+
/** Logger available to subclasses */
19+
protected final Log logger = LogFactory.getLog(getClass());
20+
21+
@Override
22+
public boolean handleRequest(MessageContext messageContext) throws WebServiceClientException {
23+
return true;
24+
}
25+
26+
@Override
27+
public boolean handleResponse(MessageContext messageContext) throws WebServiceClientException {
28+
return true;
29+
}
30+
31+
@Override
32+
public boolean handleFault(MessageContext messageContext) throws WebServiceClientException {
33+
return true;
34+
}
35+
36+
/**
37+
* Does nothing by default.
38+
*/
39+
@Override
40+
public void afterCompletion(MessageContext messageContext, Exception ex) throws WebServiceClientException {
41+
42+
}
43+
}

0 commit comments

Comments
 (0)