summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml
diff options
context:
space:
mode:
Diffstat (limited to 'branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml')
-rw-r--r--branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/CheckedException.java28
-rw-r--r--branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReference.java33
-rw-r--r--branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReferenceImpl.java31
-rw-r--r--branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldService.java7
-rw-r--r--branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldServiceImpl.java10
5 files changed, 99 insertions, 10 deletions
diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/CheckedException.java b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/CheckedException.java
new file mode 100644
index 0000000000..c45e3899e0
--- /dev/null
+++ b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/CheckedException.java
@@ -0,0 +1,28 @@
+/*
+ * 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 org.apache.tuscany.sca.binding.jms.format.jmstextxml.helloworld;
+
+public class CheckedException extends Exception {
+ private static final long serialVersionUID = 1L;
+
+ public CheckedException(String s) {
+ super(s);
+ }
+}
diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReference.java b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReference.java
new file mode 100644
index 0000000000..e5cd9db281
--- /dev/null
+++ b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReference.java
@@ -0,0 +1,33 @@
+/*
+ * 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 org.apache.tuscany.sca.binding.jms.format.jmstextxml.helloworld;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * This is the business interface of the HelloWorld greetings service.
+ */
+@Remotable
+public interface HelloWorldReference {
+
+ public String getGreetings(String name);
+ public String getPersonGreetings(Person person);
+
+}
+
diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReferenceImpl.java b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReferenceImpl.java
index 7a4f4df2e7..c54e195178 100644
--- a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReferenceImpl.java
+++ b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReferenceImpl.java
@@ -20,8 +20,7 @@ package org.apache.tuscany.sca.binding.jms.format.jmstextxml.helloworld;
import org.osoa.sca.annotations.Reference;
-
-public class HelloWorldReferenceImpl implements HelloWorldService {
+public class HelloWorldReferenceImpl implements HelloWorldReference {
@Reference
protected HelloWorldService helloWorldService1;
@@ -33,15 +32,31 @@ public class HelloWorldReferenceImpl implements HelloWorldService {
protected HelloWorldService helloWorldService3;
public String getGreetings(String name){
- return helloWorldService1.getGreetings(name) + " " +
- helloWorldService2.getGreetings(name) + " " +
- helloWorldService3.getGreetings(name);
+ String stringValue = helloWorldService1.getGreetings(name) + " " +
+ helloWorldService2.getGreetings(name) + " " +
+ helloWorldService3.getGreetings(name);
+
+ return stringValue;
}
public String getPersonGreetings(Person person){
- return helloWorldService1.getPersonGreetings(person) + " " +
- helloWorldService2.getPersonGreetings(person) + " " +
- helloWorldService3.getPersonGreetings(person);
+ String stringValue = helloWorldService1.getPersonGreetings(person) + " " +
+ helloWorldService2.getPersonGreetings(person) + " " +
+ helloWorldService3.getPersonGreetings(person);
+
+ try {
+ helloWorldService1.throwChecked(person.getLastName());
+ } catch (CheckedException e) {
+ stringValue += " " + e.getMessage();
+ }
+
+ try {
+ helloWorldService1.throwUnChecked(person.getLastName());
+ } catch (Exception e) {
+ stringValue += " " + e.getMessage();
+ }
+
+ return stringValue;
}
}
diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldService.java b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldService.java
index bf19e9069b..a98f589b9a 100644
--- a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldService.java
+++ b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldService.java
@@ -18,6 +18,7 @@
*/
package org.apache.tuscany.sca.binding.jms.format.jmstextxml.helloworld;
+import org.apache.tuscany.sca.binding.jms.format.jmstextxml.helloworld.CheckedException;
import org.osoa.sca.annotations.Remotable;
/**
@@ -26,8 +27,10 @@ import org.osoa.sca.annotations.Remotable;
@Remotable
public interface HelloWorldService {
- public String getGreetings(String name);
-
+ public String getGreetings(String name);
public String getPersonGreetings(Person person);
+
+ public void throwChecked(String msg) throws CheckedException;
+ public void throwUnChecked(String msg);
}
diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldServiceImpl.java b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldServiceImpl.java
index e1706dbe6b..7965388013 100644
--- a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldServiceImpl.java
+++ b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldServiceImpl.java
@@ -18,6 +18,8 @@
*/
package org.apache.tuscany.sca.binding.jms.format.jmstextxml.helloworld;
+import org.apache.tuscany.sca.binding.jms.format.jmstextxml.helloworld.CheckedException;
+
public class HelloWorldServiceImpl implements HelloWorldService {
public String getGreetings(String name){
@@ -31,5 +33,13 @@ public class HelloWorldServiceImpl implements HelloWorldService {
System.out.println("getPersonGreetings: " + response);
return response;
}
+
+ public void throwChecked(String msg) throws CheckedException {
+ throw new CheckedException("foo");
+ }
+
+ public void throwUnChecked(String msg) {
+ throw new RuntimeException("bla");
+ }
}