| 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 java.util.ArrayList; |
| 20 | |
import java.util.List; |
| 21 | |
|
| 22 | |
import org.kuali.rice.core.impl.resourceloader.ContextClassLoaderProxy; |
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | 0 | public class JavaServiceDefinition extends ServiceDefinition { |
| 28 | |
|
| 29 | |
private static final long serialVersionUID = -5267226536419496719L; |
| 30 | |
|
| 31 | 0 | private List<String> serviceInterfaces = new ArrayList<String>(); |
| 32 | |
|
| 33 | |
public List<String> getServiceInterfaces() { |
| 34 | 0 | return this.serviceInterfaces; |
| 35 | |
} |
| 36 | |
public void setServiceInterfaces(List<String> serviceInterfaces) { |
| 37 | 0 | this.serviceInterfaces = serviceInterfaces; |
| 38 | 0 | } |
| 39 | |
public void setServiceInterface(String serviceName) { |
| 40 | 0 | this.serviceInterfaces.add(serviceName); |
| 41 | 0 | } |
| 42 | |
public String getServiceInterface() { |
| 43 | 0 | return this.serviceInterfaces.get(0); |
| 44 | |
} |
| 45 | |
|
| 46 | |
@Override |
| 47 | |
public void validate() { |
| 48 | 0 | super.validate(); |
| 49 | 0 | if (this.serviceInterfaces == null || this.serviceInterfaces.isEmpty()) { |
| 50 | 0 | Class[] interfaces = ContextClassLoaderProxy.getInterfacesToProxy(getService()); |
| 51 | 0 | for (Class serviceInterfaceClass : interfaces) { |
| 52 | 0 | this.serviceInterfaces.add(serviceInterfaceClass.getName()); |
| 53 | |
} |
| 54 | |
} |
| 55 | 0 | if (getBusSecurity() == null) { |
| 56 | 0 | setBusSecurity(true); |
| 57 | |
} |
| 58 | 0 | } |
| 59 | |
|
| 60 | |
@Override |
| 61 | |
public boolean isSame(ServiceDefinition serviceDefinition) { |
| 62 | 0 | boolean same = serviceDefinition instanceof JavaServiceDefinition; |
| 63 | 0 | if (! same) { |
| 64 | 0 | return same; |
| 65 | |
} |
| 66 | 0 | same = super.isSame(serviceDefinition); |
| 67 | 0 | if (! same) { |
| 68 | 0 | return same; |
| 69 | |
} |
| 70 | 0 | for (String interfaceName : this.serviceInterfaces) { |
| 71 | 0 | if (! ((JavaServiceDefinition)serviceDefinition).getServiceInterfaces().contains(interfaceName)) { |
| 72 | 0 | return false; |
| 73 | |
} |
| 74 | |
} |
| 75 | 0 | return same; |
| 76 | |
} |
| 77 | |
|
| 78 | |
|
| 79 | |
} |