summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/interface-java/src
diff options
context:
space:
mode:
authoredwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68>2010-06-29 19:22:46 +0000
committeredwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68>2010-06-29 19:22:46 +0000
commite927828390d26364b4d1076ace6c35896f6a4c94 (patch)
tree1600e2e205c24f6f75f589878f9883801c9e6336 /sca-java-2.x/trunk/modules/interface-java/src
parent1ae654ebbf996733be28ab6e20add17c44b98523 (diff)
Add in processing of declared Asynchronous Faults via @AsyncFaults annotation, in support of TUSCANY-3609
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@959077 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/interface-java/src')
-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")) {