diff --git a/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/EnableWs.java b/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/EnableWs.java index 9761922a..92b966a6 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/EnableWs.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/EnableWs.java @@ -38,15 +38,12 @@ import org.springframework.context.annotation.Import; * * } *
- * Customize the imported configuration by implementing the {@link WsConfigurer} interface - * or more likely by extending the {@link WsConfigurerAdapter} base class and overriding - * individual methods: - * - *
+ * Customize the imported configuration by implementing the {@link WsConfigurer}
+ * interface:
* @Configuration
* @EnableWs
* @ComponentScan(basePackageClasses = { MyConfiguration.class })
- * public class MyConfiguration extends WsConfigurerAdapter {
+ * public class MyConfiguration implements WsConfigurer {
*
* @Override
* public void addInterceptors(List<EndpointInterceptor> interceptors) {
@@ -86,7 +83,6 @@ import org.springframework.context.annotation.Import;
* @author Arjen Poutsma
* @since 2.2
* @see WsConfigurer
- * @see WsConfigurerAdapter
* @see WsConfigurationSupport
*/
@Retention(RetentionPolicy.RUNTIME)
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurationSupport.java b/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurationSupport.java
index 93c79ba9..65b048d7 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurationSupport.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurationSupport.java
@@ -75,7 +75,6 @@ import org.springframework.ws.soap.server.endpoint.mapping.SoapActionAnnotationM
* @since 2.2
* @see EnableWs
* @see WsConfigurer
- * @see WsConfigurerAdapter
*/
public class WsConfigurationSupport {
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurer.java b/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurer.java
index cfb67aba..dec311c5 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurer.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurer.java
@@ -27,9 +27,7 @@ import org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHa
* Services enabled via {@link EnableWs @EnableWs}.
*
* {@code @EnableWs}-annotated configuration classes may implement this interface to be
- * called back and given a chance to customize the default configuration. Consider
- * extending {@link WsConfigurerAdapter}, which provides a stub implementation of all
- * interface methods.
+ * called back and given a chance to customize the default configuration.
*
* @author Arjen Poutsma
* @since 2.2
@@ -40,13 +38,17 @@ public interface WsConfigurer {
* Add {@link EndpointInterceptor}s for pre- and post-processing of endpoint method
* invocations.
*/
- void addInterceptors(List interceptors);
+ default void addInterceptors(List interceptors) {
+
+ }
/**
* Add resolvers to support custom endpoint method argument types.
* @param argumentResolvers initially an empty list
*/
- void addArgumentResolvers(List argumentResolvers);
+ default void addArgumentResolvers(List argumentResolvers) {
+
+ }
/**
* Add handlers to support custom controller method return value types.
@@ -56,6 +58,8 @@ public interface WsConfigurer {
* RequestMappingHandlerAdapter directly.
* @param returnValueHandlers initially an empty list
*/
- void addReturnValueHandlers(List returnValueHandlers);
+ default void addReturnValueHandlers(List returnValueHandlers) {
+
+ }
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurerAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurerAdapter.java
index 652ea143..fc76ef91 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurerAdapter.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurerAdapter.java
@@ -28,7 +28,9 @@ import org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHa
*
* @author Arjen Poutsma
* @since 2.2
+ * @deprecated as of 4.1.0 in favor of implementing {@link WsConfigurer} directly
*/
+@Deprecated(since = "4.1.0", forRemoval = true)
public class WsConfigurerAdapter implements WsConfigurer {
/**
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/config/annotation/WsConfigurerAdapterTest.java b/spring-ws-core/src/test/java/org/springframework/ws/config/annotation/WsConfigurerAdapterTest.java
index cc5f4ebf..fb8e0816 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/config/annotation/WsConfigurerAdapterTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/config/annotation/WsConfigurerAdapterTest.java
@@ -100,7 +100,7 @@ public class WsConfigurerAdapterTest {
@Configuration
@EnableWs
- public static class TestConfig extends WsConfigurerAdapter {
+ public static class TestConfig implements WsConfigurer {
@Override
public void addInterceptors(List interceptors) {
diff --git a/spring-ws-docs/src/docs/asciidoc/server.adoc b/spring-ws-docs/src/docs/asciidoc/server.adoc
index 48a60784..40c18ec7 100644
--- a/spring-ws-docs/src/docs/asciidoc/server.adoc
+++ b/spring-ws-docs/src/docs/asciidoc/server.adoc
@@ -617,14 +617,14 @@ public class EchoConfig {
----
====
-To customize the `@EnableWs` configuration, you can implement `WsConfigurer` or, better yet, extend the `WsConfigurerAdapter`:
+To customize the `@EnableWs` configuration, you can implement `WsConfigurer`:
====
[source,java]
----
@Configuration
@EnableWs
-public class MyConfiguration extends WsConfigurerAdapter {
+public class MyConfiguration implements WsConfigurer {
@Override
public void addInterceptors(List interceptors) {
@@ -1067,14 +1067,14 @@ Finally, we define two interceptors that apply when the message has a `http://ww
Notice how the second interceptor is actually a reference to a bean definition outside the `` element.
You can use bean references anywhere inside the `` element.
-When you use `@Configuration` classes, you can extend from `WsConfigurerAdapter` to add interceptors:
+When you use `@Configuration` classes, you can implement `WsConfigurer` to add interceptors:
====
[source,java]
----
@Configuration
@EnableWs
-public class MyWsConfiguration extends WsConfigurerAdapter {
+public class MyWsConfiguration implements WsConfigurer {
@Override
public void addInterceptors(List interceptors) {
@@ -1119,7 +1119,7 @@ The following example shows how to define the `PayloadLoggingInterceptor` in an
Both of these interceptors have two properties, `logRequest` and `logResponse`, which can be set to `false` to disable logging for either request or response messages.
-You could use the `WsConfigurerAdapter` approach, as described earlier, for the `PayloadLoggingInterceptor` as well.
+You could use the `WsConfigurer` approach, as described earlier, for the `PayloadLoggingInterceptor` as well.
==== `PayloadValidatingInterceptor`
@@ -1152,7 +1152,7 @@ Note that the `PayloadValidatingInterceptor` can also accept multiple schemas by
----
====
-Of course, you could use the `WsConfigurerAdapter` approach, as described earlier, for the `PayloadValidatingInterceptor` as well.
+Of course, you could use the `WsConfigurer` approach, as described earlier, for the `PayloadValidatingInterceptor` as well.
==== Using `PayloadTransformingInterceptor`
@@ -1175,7 +1175,7 @@ In the preceding example, we transform requests by using `/WEB-INF/oldRequests.x
Note that, since endpoint interceptors are registered at the endpoint-mapping level, you can create an endpoint mapping that applies to the "`old style`" messages and add the interceptor to that mapping.
Hence, the transformation applies only to these "`old style`" message.
-You could use the `WsConfigurerAdapter` approach, as described earlier, for the `PayloadTransformingInterceptor` as well.
+You could use the `WsConfigurer` approach, as described earlier, for the `PayloadTransformingInterceptor` as well.
[[server-endpoint-exception-resolver]]
== Handling Exceptions