diff options
Diffstat (limited to 'sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca')
-rw-r--r-- | sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingInvoker.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingInvoker.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingInvoker.java index 9247c1d3db..3b2daf5b12 100644 --- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingInvoker.java +++ b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingInvoker.java @@ -22,6 +22,7 @@ import org.apache.tuscany.sca.binding.ejb.EJBBinding; import org.apache.tuscany.sca.binding.ejb.util.EJBHandler; import org.apache.tuscany.sca.binding.ejb.util.NamingEndpoint; import org.apache.tuscany.sca.interfacedef.Operation; +import org.apache.tuscany.sca.interfacedef.java.JavaOperation; import org.apache.tuscany.sca.invocation.Invoker; import org.apache.tuscany.sca.invocation.Message; import org.apache.tuscany.sca.invocation.DataExchangeSemantics; @@ -66,13 +67,29 @@ public class EJBBindingInvoker implements Invoker, DataExchangeSemantics { */ public Object doInvoke(final Object payload) { + String methodName = null; + // construct NamingendPoint NamingEndpoint endpoint = getNamingEndpoint(); // lookup home and ejb stub EJBHandler ejbHandler = new EJBHandler(endpoint, serviceInterface); - String methodName = operation.getName(); + // + // If we really couldn't have anything but a JavaOperation maybe we should + // remove the if-block. Assuming we had some other type of operation, if + // that is possible, we might still need to map to a Java operation name, + // (for example because the WSDL operation name might be set using a JSR-181 + // annotation to something other than the Java operation name. + // + // But for now we'll keep the else-block in here. + // + if (operation instanceof JavaOperation) { + JavaOperation javaOp = (JavaOperation) operation; + methodName = javaOp.getJavaMethod().getName(); + } else { + methodName = operation.getName(); + } // invoke business method on ejb Object response = ejbHandler.invoke(methodName, (Object[])payload); |