summaryrefslogtreecommitdiffstats
path: root/java/sca/modules
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-08-25 17:59:25 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-08-25 17:59:25 +0000
commit06ad8f4a39431f781bbb649ec7520f4ab6fa602d (patch)
treebe7b8c1162daa2275fec9ff9efb72b0395b3aad3 /java/sca/modules
parent371ec5ed934bb17808fc7b433602f49cd546ca2a (diff)
Fix for TUSCANY-2513 (patch from Scott)
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@688805 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules')
-rw-r--r--java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java7
-rw-r--r--java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessorTestCase.java17
2 files changed, 22 insertions, 2 deletions
diff --git a/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java b/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java
index 78963f5b03..6854acdc2a 100644
--- a/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java
+++ b/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java
@@ -28,6 +28,8 @@ import java.util.ArrayList;
import java.util.Set;
import java.util.logging.Logger;
+import javax.jws.WebService;
+
import org.apache.tuscany.sca.assembly.AssemblyFactory;
import org.apache.tuscany.sca.assembly.Service;
import org.apache.tuscany.sca.implementation.java.IntrospectionException;
@@ -64,7 +66,10 @@ public class ServiceProcessor extends BaseJavaClassVisitor {
// scan interfaces for remotable
Set<Class> interfaces = getAllInterfaces(clazz);
for (Class<?> interfaze : interfaces) {
- if (interfaze.isAnnotationPresent(Remotable.class) || interfaze.isAnnotationPresent(Callback.class)) {
+ if (interfaze.isAnnotationPresent(Remotable.class)
+ || interfaze.isAnnotationPresent(WebService.class)
+ || interfaze.isAnnotationPresent(Callback.class)
+ ) {
Service service;
try {
service = createService(interfaze);
diff --git a/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessorTestCase.java b/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessorTestCase.java
index ef4747f43a..aea90aa6eb 100644
--- a/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessorTestCase.java
+++ b/java/sca/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessorTestCase.java
@@ -18,6 +18,8 @@
*/
package org.apache.tuscany.sca.implementation.java.introspect.impl;
+import javax.jws.WebService;
+
import junit.framework.TestCase;
import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
@@ -65,6 +67,12 @@ public class ServiceProcessorTestCase extends TestCase {
assertEquals(1, type.getServices().size());
}
+
+ public void testMultipleWithWebServiceAnnotation() throws Exception {
+ processor.visitClass(FooMultipleWithWebService.class, type);
+ assertEquals(2, type.getServices().size());
+ }
+
public void testRemotableNoService() throws Exception {
processor.visitClass(FooRemotableNoService.class, type);
assertEquals(1, type.getServices().size());
@@ -102,6 +110,10 @@ public class ServiceProcessorTestCase extends TestCase {
private interface Bar2 {
}
+
+ @WebService
+ private interface Bar3 {
+ }
@Remotable
private interface BazRemotable {
@@ -124,7 +136,10 @@ public class ServiceProcessorTestCase extends TestCase {
private class FooMultipleWithCalback implements Baz, Bar {
}
-
+
+ private class FooMultipleWithWebService implements BazRemotable, Bar3 {
+ }
+
private class FooRemotableNoService implements BazRemotable, Bar {
}