1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.rice.ksb.api.bus.support;
18
19 import org.kuali.rice.core.api.config.ConfigurationException;
20 import org.kuali.rice.ksb.api.KsbApiConstants;
21 import org.kuali.rice.ksb.api.bus.ServiceConfiguration;
22
23
24
25
26
27 public class SoapServiceDefinition extends AbstractServiceDefinition {
28
29 private static final long serialVersionUID = 5892163789061959602L;
30
31 private String serviceInterface;
32 private boolean jaxWsService = false;
33
34 @Override
35 public String getType() {
36 return KsbApiConstants.ServiceTypes.SOAP;
37 }
38
39
40
41
42
43 public boolean isJaxWsService() {
44 return this.jaxWsService;
45 }
46
47
48
49
50
51 public void setJaxWsService(boolean jaxWsService) {
52 this.jaxWsService = jaxWsService;
53 }
54
55
56
57
58
59 public SoapServiceDefinition() {
60 setBusSecurity(true);
61 }
62
63 public String getServiceInterface() {
64 return this.serviceInterface;
65 }
66
67 public void setServiceInterface(final String serviceInterface) {
68 this.serviceInterface = serviceInterface;
69 }
70
71 @Override
72 public void validate() {
73
74 super.validate();
75
76 if (getServiceInterface() == null) {
77 if (getService().getClass().getInterfaces().length == 0) {
78 throw new ConfigurationException(
79 "Service needs to implement interface to be exported as SOAP service");
80 }
81 setServiceInterface(getService().getClass().getInterfaces()[0]
82 .getName());
83 } else {
84
85
86 try {
87 if (!Class.forName(getServiceInterface()).isInterface()) {
88 throw new ConfigurationException(
89 "Service interface class '" + getServiceInterface() + "' must be a Java interface");
90 }
91 } catch (ClassNotFoundException e) {
92 throw new ConfigurationException(
93 "Service interface class '" + getServiceInterface() + "' could not be found in the classpath");
94 }
95 }
96
97 }
98
99 @Override
100 protected ServiceConfiguration configure() {
101 return SoapServiceConfiguration.fromServiceDefinition(this);
102 }
103
104
105 }