tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r662367 - /incubator/tuscany/java/sca/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java
Date Mon, 02 Jun 2008 08:59:23 GMT
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);



Mime
View raw message