You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2008/06/02 10:59:23 UTC
svn commit: r662367 -
/incubator/tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java
Author: antelder
Date: Mon Jun 2 01:59:23 2008
New Revision: 662367
URL: http://svn.apache.org/viewvc?rev=662367&view=rev
Log:
TUSCANY-2291: report error when mixing local and remote callbacks
Modified:
incubator/tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java
Modified: incubator/tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java?rev=662367&r1=662366&r2=662367&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java (original)
+++ incubator/tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java Mon Jun 2 01:59:23 2008
@@ -102,9 +102,16 @@
org.osoa.sca.annotations.Callback callback = clazz.getAnnotation(org.osoa.sca.annotations.Callback.class);
if (callback != null && !Void.class.equals(callback.value())) {
callbackClass = callback.value();
+ if (remotable && !callbackClass.isAnnotationPresent(Remotable.class)) {
+ throw new InvalidCallbackException("Callback must be remotable on a remotable interface");
+ }
+ if (!remotable && callbackClass.isAnnotationPresent(Remotable.class)) {
+ throw new InvalidCallbackException("Callback must not be remotable on a local interface");
+ }
} else if (callback != null && Void.class.equals(callback.value())) {
throw new InvalidCallbackException("No callback interface specified on annotation");
}
+
javaInterface.setCallbackClass(callbackClass);
String ns = JavaXMLMapper.getNamespace(clazz);