Author: vamsic007
Date: Fri Aug 22 10:32:37 2008
New Revision: 688128

URL: http://svn.apache.org/viewvc?rev=688128&view=rev
Log:
TUSCANY-2562 Callback issue when reference is set with getter & setter method
 o Problem appears when the reference computed by HeuristicPojoProcessor has a 
bidirectional interface.

Modified:
    
tuscany/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java

Modified: 
tuscany/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java?rev=688128&r1=688127&r2=688128&view=diff
==============================================================================
--- 
tuscany/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java
 (original)
+++ 
tuscany/java/sca/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java
 Fri Aug 22 10:32:37 2008
@@ -552,6 +552,8 @@
         } catch (InvalidInterfaceException e1) {
             throw new IntrospectionException(e1);
         }
+
+        // FIXME:  This part seems to have already been taken care above!!
         try {
             processCallback(paramType, reference);
         } catch (InvalidServiceType e) {
@@ -584,9 +586,13 @@
         Callback callback = interfaze.getAnnotation(Callback.class);
         if (callback != null && !Void.class.equals(callback.value())) {
             Class<?> callbackClass = callback.value();
-            JavaInterface javaInterface = javaFactory.createJavaInterface();
-            javaInterface.setJavaClass(callbackClass);
-            
contract.getInterfaceContract().setCallbackInterface(javaInterface);
+            JavaInterface javaInterface;
+            try {
+                javaInterface = javaFactory.createJavaInterface(callbackClass);
+                
contract.getInterfaceContract().setCallbackInterface(javaInterface);
+            } catch (InvalidInterfaceException e) {
+                throw new InvalidServiceType("Invalid callback interface 
"+callbackClass, interfaze);
+            }
         } else if (callback != null && Void.class.equals(callback.value())) {
             throw new InvalidServiceType("No callback interface specified on 
annotation", interfaze);
         }


Reply via email to