diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/implementation-java/src/main/java/org')
-rw-r--r-- | sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java b/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java index e30cbd08ef..70a7d489cd 100644 --- a/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java +++ b/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java @@ -185,14 +185,25 @@ public class ServiceProcessor extends BaseJavaClassVisitor { Service service = assemblyFactory.createService(); JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract(); service.setInterfaceContract(interfaceContract); + + JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(interfaze); if (name == null) { - service.setName(interfaze.getSimpleName()); + String serviceName = interfaze.getSimpleName(); + // If the interface has @WebService annotation then take the + // service name from the @name attribute if present + if (interfaze.isAnnotationPresent(WebService.class)){ + if (callInterface.getQName() != null){ + serviceName = callInterface.getQName().getLocalPart(); + } + } + + service.setName(serviceName); } else { service.setName(name); } - JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(interfaze); + boolean remotable = clazz.getAnnotation(Remotable.class) != null; if (remotable){ callInterface.setRemotable(true); |