1 package org.springframework.ws.config.annotation;
2
3 import java.util.List;
4
5 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.context.annotation.Configuration;
7 import org.springframework.ws.server.EndpointInterceptor;
8 import org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResolver;
9 import org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler;
10
11 /**
12  * A sub-class of {@code WsConfigurationSupport} that detects and delegates
13  * to all beans of type {@link WsConfigurer} allowing them to customize the
14  * configuration provided by {@code WsConfigurationSupport}. This is the
15  * class actually imported by {@link EnableWs @EnableWs}.
16  *
17  * @author Arjen Poutsma
18  * @since 2.2
19  */

20 @Configuration
21 public class DelegatingWsConfiguration extends WsConfigurationSupport {
22
23     private final WsConfigurerComposite configurers = new WsConfigurerComposite();
24
25     @Autowired(required = false)
26     public void setConfigurers(List<WsConfigurer> configurers) {
27         if (configurers != null && !configurers.isEmpty()) {
28             this.configurers.addWsConfigurers(configurers);
29         }
30     }
31
32     @Override
33     protected void addInterceptors(List<EndpointInterceptor> interceptors) {
34         this.configurers.addInterceptors(interceptors);
35     }
36
37     @Override
38     protected void addArgumentResolvers(List<MethodArgumentResolver> argumentResolvers) {
39         this.configurers.addArgumentResolvers(argumentResolvers);
40     }
41
42     @Override
43     protected void addReturnValueHandlers(
44             List<MethodReturnValueHandler> returnValueHandlers) {
45         this.configurers.addReturnValueHandlers(returnValueHandlers);
46     }
47 }
48