Skip to content

Commit d5a4c92

Browse files
committed
Deprecate WsConfigurerAdapter
Closes gh-1480
1 parent 945b330 commit d5a4c92

File tree

6 files changed

+23
-22
lines changed

6 files changed

+23
-22
lines changed

spring-ws-core/src/main/java/org/springframework/ws/config/annotation/EnableWs.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,12 @@
3838
*
3939
* }</code></pre>
4040
* <p>
41-
* Customize the imported configuration by implementing the {@link WsConfigurer} interface
42-
* or more likely by extending the {@link WsConfigurerAdapter} base class and overriding
43-
* individual methods:
44-
*
45-
* <pre><code class='java'>
41+
* Customize the imported configuration by implementing the {@link WsConfigurer}
42+
* interface: <pre><code class='java'>
4643
* &#064;Configuration
4744
* &#064;EnableWs
4845
* &#064;ComponentScan(basePackageClasses = { MyConfiguration.class })
49-
* public class MyConfiguration extends WsConfigurerAdapter {
46+
* public class MyConfiguration implements WsConfigurer {
5047
*
5148
* &#064;Override
5249
* public void addInterceptors(List&lt;EndpointInterceptor&gt; interceptors) {
@@ -86,7 +83,6 @@
8683
* @author Arjen Poutsma
8784
* @since 2.2
8885
* @see WsConfigurer
89-
* @see WsConfigurerAdapter
9086
* @see WsConfigurationSupport
9187
*/
9288
@Retention(RetentionPolicy.RUNTIME)

spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurationSupport.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
* @since 2.2
7676
* @see EnableWs
7777
* @see WsConfigurer
78-
* @see WsConfigurerAdapter
7978
*/
8079
public class WsConfigurationSupport {
8180

spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurer.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
* Services enabled via {@link EnableWs @EnableWs}.
2828
* <p>
2929
* {@code @EnableWs}-annotated configuration classes may implement this interface to be
30-
* called back and given a chance to customize the default configuration. Consider
31-
* extending {@link WsConfigurerAdapter}, which provides a stub implementation of all
32-
* interface methods.
30+
* called back and given a chance to customize the default configuration.
3331
*
3432
* @author Arjen Poutsma
3533
* @since 2.2
@@ -40,13 +38,17 @@ public interface WsConfigurer {
4038
* Add {@link EndpointInterceptor}s for pre- and post-processing of endpoint method
4139
* invocations.
4240
*/
43-
void addInterceptors(List<EndpointInterceptor> interceptors);
41+
default void addInterceptors(List<EndpointInterceptor> interceptors) {
42+
43+
}
4444

4545
/**
4646
* Add resolvers to support custom endpoint method argument types.
4747
* @param argumentResolvers initially an empty list
4848
*/
49-
void addArgumentResolvers(List<MethodArgumentResolver> argumentResolvers);
49+
default void addArgumentResolvers(List<MethodArgumentResolver> argumentResolvers) {
50+
51+
}
5052

5153
/**
5254
* Add handlers to support custom controller method return value types.
@@ -56,6 +58,8 @@ public interface WsConfigurer {
5658
* RequestMappingHandlerAdapter directly.
5759
* @param returnValueHandlers initially an empty list
5860
*/
59-
void addReturnValueHandlers(List<MethodReturnValueHandler> returnValueHandlers);
61+
default void addReturnValueHandlers(List<MethodReturnValueHandler> returnValueHandlers) {
62+
63+
}
6064

6165
}

spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurerAdapter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
*
2929
* @author Arjen Poutsma
3030
* @since 2.2
31+
* @deprecated as of 4.1.0 in favor of implementing {@link WsConfigurer} directly
3132
*/
33+
@Deprecated(since = "4.1.0", forRemoval = true)
3234
public class WsConfigurerAdapter implements WsConfigurer {
3335

3436
/**

spring-ws-core/src/test/java/org/springframework/ws/config/annotation/WsConfigurerAdapterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public void returnValueHandlers() {
100100

101101
@Configuration
102102
@EnableWs
103-
public static class TestConfig extends WsConfigurerAdapter {
103+
public static class TestConfig implements WsConfigurer {
104104

105105
@Override
106106
public void addInterceptors(List<EndpointInterceptor> interceptors) {

spring-ws-docs/src/docs/asciidoc/server.adoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -617,14 +617,14 @@ public class EchoConfig {
617617
----
618618
====
619619

620-
To customize the `@EnableWs` configuration, you can implement `WsConfigurer` or, better yet, extend the `WsConfigurerAdapter`:
620+
To customize the `@EnableWs` configuration, you can implement `WsConfigurer`:
621621

622622
====
623623
[source,java]
624624
----
625625
@Configuration
626626
@EnableWs
627-
public class MyConfiguration extends WsConfigurerAdapter {
627+
public class MyConfiguration implements WsConfigurer {
628628
629629
@Override
630630
public void addInterceptors(List<EndpointInterceptor> interceptors) {
@@ -1067,14 +1067,14 @@ Finally, we define two interceptors that apply when the message has a `http://ww
10671067
Notice how the second interceptor is actually a reference to a bean definition outside the `<interceptors>` element.
10681068
You can use bean references anywhere inside the `<interceptors>` element.
10691069

1070-
When you use `@Configuration` classes, you can extend from `WsConfigurerAdapter` to add interceptors:
1070+
When you use `@Configuration` classes, you can implement `WsConfigurer` to add interceptors:
10711071

10721072
====
10731073
[source,java]
10741074
----
10751075
@Configuration
10761076
@EnableWs
1077-
public class MyWsConfiguration extends WsConfigurerAdapter {
1077+
public class MyWsConfiguration implements WsConfigurer {
10781078
10791079
@Override
10801080
public void addInterceptors(List<EndpointInterceptor> interceptors) {
@@ -1119,7 +1119,7 @@ The following example shows how to define the `PayloadLoggingInterceptor` in an
11191119

11201120
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.
11211121

1122-
You could use the `WsConfigurerAdapter` approach, as described earlier, for the `PayloadLoggingInterceptor` as well.
1122+
You could use the `WsConfigurer` approach, as described earlier, for the `PayloadLoggingInterceptor` as well.
11231123

11241124
==== `PayloadValidatingInterceptor`
11251125

@@ -1152,7 +1152,7 @@ Note that the `PayloadValidatingInterceptor` can also accept multiple schemas by
11521152
----
11531153
====
11541154

1155-
Of course, you could use the `WsConfigurerAdapter` approach, as described earlier, for the `PayloadValidatingInterceptor` as well.
1155+
Of course, you could use the `WsConfigurer` approach, as described earlier, for the `PayloadValidatingInterceptor` as well.
11561156

11571157
==== Using `PayloadTransformingInterceptor`
11581158

@@ -1175,7 +1175,7 @@ In the preceding example, we transform requests by using `/WEB-INF/oldRequests.x
11751175
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.
11761176
Hence, the transformation applies only to these "`old style`" message.
11771177

1178-
You could use the `WsConfigurerAdapter` approach, as described earlier, for the `PayloadTransformingInterceptor` as well.
1178+
You could use the `WsConfigurer` approach, as described earlier, for the `PayloadTransformingInterceptor` as well.
11791179

11801180
[[server-endpoint-exception-resolver]]
11811181
== Handling Exceptions

0 commit comments

Comments
 (0)