1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.ws.soap.server.endpoint.mapping;
18
19 import org.springframework.beans.factory.InitializingBean;
20 import org.springframework.util.Assert;
21 import org.springframework.ws.context.MessageContext;
22 import org.springframework.ws.server.EndpointInvocationChain;
23 import org.springframework.ws.server.EndpointMapping;
24 import org.springframework.ws.soap.server.SoapEndpointInvocationChain;
25 import org.springframework.ws.soap.server.SoapEndpointMapping;
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44 public class DelegatingSoapEndpointMapping implements InitializingBean, SoapEndpointMapping {
45
46 private EndpointMapping delegate;
47
48 private String[] actorsOrRoles;
49
50 private boolean isUltimateReceiver = true;
51
52
53 public void setDelegate(EndpointMapping delegate) {
54 this.delegate = delegate;
55 }
56
57 public final void setActorOrRole(String actorOrRole) {
58 Assert.notNull(actorOrRole, "actorOrRole must not be null");
59 actorsOrRoles = new String[]{actorOrRole};
60 }
61
62 public final void setActorsOrRoles(String[] actorsOrRoles) {
63 Assert.notEmpty(actorsOrRoles, "actorsOrRoles must not be empty");
64 this.actorsOrRoles = actorsOrRoles;
65 }
66
67 public final void setUltimateReceiver(boolean ultimateReceiver) {
68 isUltimateReceiver = ultimateReceiver;
69 }
70
71
72
73
74
75
76
77 public EndpointInvocationChain getEndpoint(MessageContext messageContext) throws Exception {
78 EndpointInvocationChain delegateChain = delegate.getEndpoint(messageContext);
79 if (delegateChain != null) {
80 return new SoapEndpointInvocationChain(delegateChain.getEndpoint(), delegateChain.getInterceptors(),
81 actorsOrRoles, isUltimateReceiver);
82 }
83 else {
84 return null;
85 }
86 }
87
88 public void afterPropertiesSet() throws Exception {
89 Assert.notNull(delegate, "delegate is required");
90 }
91 }