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..e5643c00 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 @@ -22,68 +22,71 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; /** - * Add this annotation to an {@link Configuration @Configuration} class to have the Spring - * Web Services configuration defined in {@link WsConfigurationSupport} imported. For - * instance: + * Adding this annotation to an {@code @Configuration} class imports the Spring Web + * Services configuration from {@link WsConfigurationSupport}, for example: * *
* @Configuration
* @EnableWs
- * @ComponentScan(basePackageClasses = { MyConfiguration.class })
- * public class MyWsConfiguration {
+ * @ComponentScan(basePackageClasses = MyConfiguration.class)
+ * public class MyConfiguration {
*
* }
* - * Customize the imported configuration by implementing the {@link WsConfigurer} interface - * or more likely by extending the {@link WsConfigurerAdapter} base class and overriding - * individual methods: + * To customize the imported configuration, implement the {@link WsConfigurer} interface + * or more likely extend the {@link WsConfigurerAdapter} base class and override + * individual methods, for example: * *
* @Configuration
* @EnableWs
- * @ComponentScan(basePackageClasses = { MyConfiguration.class })
+ * @ComponentScan(basePackageClasses = MyConfiguration.class)
* public class MyConfiguration extends WsConfigurerAdapter {
*
- * @Override
- * public void addInterceptors(List<EndpointInterceptor> interceptors) {
- * interceptors.add(new MyInterceptor());
- * }
+ * @Override
+ * public void addInterceptors(List<EndpointInterceptor> interceptors) {
+ * interceptors.add(new MyInterceptor());
+ * }
*
- * @Override
- * public void addArgumentResolvers(List<MethodArgumentResolver> argumentResolvers) {
- * argumentResolvers.add(new MyArgumentResolver());
- * }
+ * @Override
+ * public void addArgumentResolvers(List<MethodArgumentResolver> argumentResolvers) {
+ * argumentResolvers.add(new MyArgumentResolver());
+ * }
*
- * // More overridden methods ...
* }
* - * If the customization options of {@link WsConfigurer} do not expose something you need - * to configure, consider removing the {@code @EnableWs} annotation and extending directly - * from {@link WsConfigurationSupport} overriding selected {@code @Bean} methods: + * Note: only one {@code @Configuration} class may have the + * {@code @EnableWs} annotation to import the Spring Web Services configuration. There can + * however be multiple {@code @Configuration} classes implementing {@code WsConfigurer} in + * order to customize the provided configuration. + *
+ * If {@link WsConfigurer} does not expose some more advanced setting that needs to be + * configured, consider removing the {@code @EnableWs} annotation and extending directly + * from {@link WsConfigurationSupport} or {@link DelegatingWsConfiguration}, for example: * *
* @Configuration
* @ComponentScan(basePackageClasses = { MyConfiguration.class })
* public class MyConfiguration extends WsConfigurationSupport {
*
- * @Override
- * public void addInterceptors(List<EndpointInterceptor> interceptors) {
- * interceptors.add(new MyInterceptor());
- * }
+ * @Override
+ * public void addInterceptors(List<EndpointInterceptor> interceptors) {
+ * interceptors.add(new MyInterceptor());
+ * }
*
- * @Bean
- * @Override
- * public DefaultMethodEndpointAdapter defaultMethodEndpointAdapter() {
- * // Create or delegate to "super" to create and
- * // customize properties of DefaultMethodEndpointAdapter
- * }
+ * @Bean
+ * @Override
+ * public PayloadRootAnnotationMethodEndpointMapping payloadRootAnnotationMethodEndpointMapping() {
+ * // Create or delegate to "super" to create and
+ * // customize properties of PayloadRootAnnotationMethodEndpointMapping
+ * }
* }
*
* @author Arjen Poutsma
+ * @author Stephane Nicoll
* @since 2.2
* @see WsConfigurer
* @see WsConfigurerAdapter
diff --git a/spring-ws-docs/src/docs/asciidoc/server.adoc b/spring-ws-docs/src/docs/asciidoc/server.adoc
index ba274688..125e3677 100644
--- a/spring-ws-docs/src/docs/asciidoc/server.adoc
+++ b/spring-ws-docs/src/docs/asciidoc/server.adoc
@@ -633,14 +633,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` and override individual methods:
====
[source,java]
----
@Configuration
@EnableWs
-public class MyConfiguration extends WsConfigurerAdapter {
+public class EchoConfig extends WsConfigurerAdapter {
@Override
public void addInterceptors(List