You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by na...@apache.org on 2010/08/24 22:41:59 UTC
svn commit: r988716 - in
/tuscany/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
test/java/calculator/AddServiceRemote.java
Author: nash
Date: Tue Aug 24 20:41:59 2010
New Revision: 988716
URL: http://svn.apache.org/viewvc?rev=988716&view=rev
Log:
Merge revision 980456 from trunk into the 1.6.1 branch
Modified:
tuscany/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
tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ejb-runtime/src/test/java/calculator/AddServiceRemote.java
Modified: tuscany/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
URL: http://svn.apache.org/viewvc/tuscany/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?rev=988716&r1=988715&r2=988716&view=diff
==============================================================================
--- tuscany/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 (original)
+++ tuscany/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 Tue Aug 24 20:41:59 2010
@@ -22,6 +22,7 @@ import org.apache.tuscany.sca.binding.ej
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 implement
*/
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);
Modified: tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ejb-runtime/src/test/java/calculator/AddServiceRemote.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ejb-runtime/src/test/java/calculator/AddServiceRemote.java?rev=988716&r1=988715&r2=988716&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ejb-runtime/src/test/java/calculator/AddServiceRemote.java (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ejb-runtime/src/test/java/calculator/AddServiceRemote.java Tue Aug 24 20:41:59 2010
@@ -1,26 +1,32 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import javax.ejb.Remote;
-
-@Remote
-public interface AddServiceRemote {
- double add(double n1, double n2);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+import javax.ejb.Remote;
+
+import javax.jws.WebService;
+import javax.jws.WebMethod;
+
+@Remote
+@WebService
+public interface AddServiceRemote {
+ @WebMethod(operationName = "Add")
+ double add(double n1, double n2);
+}
+