1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.ksb.api.bus.support;
17
18 import org.kuali.rice.core.api.config.property.ConfigContext;
19 import org.kuali.rice.ksb.api.bus.ServiceBus;
20 import org.kuali.rice.ksb.api.bus.ServiceDefinition;
21 import org.springframework.beans.factory.InitializingBean;
22
23 import javax.xml.namespace.QName;
24 import java.net.URL;
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49 public class CallbackServiceExporter implements InitializingBean {
50
51 private String localServiceName;
52 private String serviceNameSpaceURI;
53 private QName serviceName;
54 private String servicePath;
55 private URL endpointUrl;
56 private Boolean busSecurity;
57 private String serviceInterface;
58 private Object callbackService;
59
60 private ServiceBus serviceBus;
61
62 public CallbackServiceExporter() {
63 this.busSecurity = Boolean.TRUE;
64 }
65
66 @Override
67 public final void afterPropertiesSet() throws Exception {
68 if (getCallbackService() == null) {
69 throw new IllegalStateException("No callback service was provided to this exporter.");
70 }
71 ServiceBusExporter serviceBusExporter = createServiceBusExporter();
72 serviceBusExporter.afterPropertiesSet();
73 }
74
75
76
77
78
79
80
81
82 protected ServiceBusExporter createServiceBusExporter() {
83 ServiceBusExporter serviceBusExporter = new ServiceBusExporter();
84 serviceBusExporter.setServiceDefinition(createSoapServiceDefinition());
85 return serviceBusExporter;
86 }
87
88
89
90
91
92
93
94 protected SoapServiceDefinition createSoapServiceDefinition() {
95 SoapServiceDefinition serviceDefinition = new SoapServiceDefinition();
96
97
98 serviceDefinition.setLocalServiceName(getLocalServiceName());
99 serviceDefinition.setServiceNameSpaceURI(getServiceNameSpaceURI());
100 serviceDefinition.setServiceName(getServiceName());
101
102 serviceDefinition.setService(getCallbackService());
103 serviceDefinition.setServicePath(getServicePath());
104 serviceDefinition.setEndpointUrl(getEndpointUrl());
105 serviceDefinition.setServiceInterface(getServiceInterface());
106
107
108 serviceDefinition.setJaxWsService(true);
109 serviceDefinition.setBusSecurity(getBusSecurity());
110 serviceDefinition.setServiceVersion(ConfigContext.getCurrentContextConfig().getRiceVersion());
111
112 return serviceDefinition;
113 }
114
115 protected final String getLocalServiceName() {
116 return localServiceName;
117 }
118
119 public final void setLocalServiceName(String localServiceName) {
120 this.localServiceName = localServiceName;
121 }
122
123 public final String getServiceNameSpaceURI() {
124 return serviceNameSpaceURI;
125 }
126
127 public final void setServiceNameSpaceURI(String serviceNameSpaceURI) {
128 this.serviceNameSpaceURI = serviceNameSpaceURI;
129 }
130
131 public final QName getServiceName() {
132 return serviceName;
133 }
134
135 public final void setServiceName(QName serviceName) {
136 this.serviceName = serviceName;
137 }
138
139 public final String getServicePath() {
140 return servicePath;
141 }
142
143 public final void setServicePath(String servicePath) {
144 this.servicePath = servicePath;
145 }
146
147 public final URL getEndpointUrl() {
148 return endpointUrl;
149 }
150
151 public final void setEndpointUrl(URL endpointUrl) {
152 this.endpointUrl = endpointUrl;
153 }
154
155 public final Boolean getBusSecurity() {
156 return busSecurity;
157 }
158
159 public final void setBusSecurity(Boolean busSecurity) {
160 this.busSecurity = busSecurity;
161 }
162
163 public String getServiceInterface() {
164 return serviceInterface;
165 }
166
167 public void setServiceInterface(String serviceInterface) {
168 this.serviceInterface = serviceInterface;
169 }
170
171 public Object getCallbackService() {
172 return callbackService;
173 }
174
175 public void setCallbackService(Object callbackService) {
176 this.callbackService = callbackService;
177 }
178
179 public final ServiceBus getServiceBus() {
180 return serviceBus;
181 }
182
183 public final void setServiceBus(ServiceBus serviceBus) {
184 this.serviceBus = serviceBus;
185 }
186
187 }