Author: jsdelfino
Date: Thu Mar 27 10:07:00 2008
New Revision: 641897
URL: http://svn.apache.org/viewvc?rev=641897&view=rev
Log:
Fix for TUSCANY-2158. Mark EJB interfaces remotable.
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=641897&r1=641896&r2=641897&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
Thu Mar 27 10:07:00 2008
@@ -18,10 +18,12 @@
*/
package org.apache.tuscany.sca.interfacedef.java.impl;
+import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
+import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.HashMap;
@@ -70,6 +72,26 @@
javaInterface.setJavaClass(clazz);
boolean remotable = clazz.isAnnotationPresent(Remotable.class);
+
+ // Consider @javax.ejb.Remote, java.rmi.Remote and javax.ejb.EJBObject
+ // equivalent to @Remotable
+ if (!remotable) {
+ for (Annotation annotation: clazz.getAnnotations()) {
+ if
("javax.ejb.Remote".equals(annotation.annotationType().getName())) {
+ remotable = true;
+ break;
+ }
+ }
+ }
+ if (!remotable) {
+ for (Class<?> superInterface: clazz.getInterfaces()) {
+ if (Remote.class == superInterface ||
"javax.ejb.EJBObject".equals(superInterface.getName())) {
+ remotable = true;
+ break;
+ }
+ }
+ }
+
javaInterface.setRemotable(remotable);
boolean conversational =
clazz.isAnnotationPresent(Conversational.class);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]