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