summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java b/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java
index 0f5962c964..de32136abc 100644
--- a/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java
+++ b/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java
@@ -235,6 +235,9 @@ public class JavaInterfaceIntrospectorImpl {
}
List<DataType> faultDataTypes = new ArrayList<DataType>(faultTypes.length);
Type[] genericFaultTypes = method.getGenericExceptionTypes();
+ if( method.isAnnotationPresent(AsyncFault.class) ) {
+ genericFaultTypes = readAsyncGenericFaultTypes( method );
+ } // end if
for (int i = 0; i < faultTypes.length; i++) {
Class<?> faultType = faultTypes[i];
// Only add checked exceptions
@@ -273,6 +276,17 @@ public class JavaInterfaceIntrospectorImpl {
if ( theFaults == null ) return null;
return theFaults.value();
} // end method readAsyncFaultTypes
+
+ /**
+ * Reads the generic fault types declared in an @AsyncFault annotation on an async server method
+ * @param method - the Method
+ * @return - an array of fault/exception classes
+ */
+ private Type[] readAsyncGenericFaultTypes( Method method ) {
+ AsyncFault theFaults = method.getAnnotation(AsyncFault.class);
+ if ( theFaults == null ) return null;
+ return theFaults.value();
+ } // end method readAsyncFaultTypes
private boolean jaxwsAsyncMethod(Method method) {
if (method.getName().endsWith("Async")) {