summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms')
-rw-r--r--sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/CheckedException.java28
-rw-r--r--sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReference.java33
-rw-r--r--sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReferenceImpl.java62
-rw-r--r--sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldService.java35
-rw-r--r--sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldServiceImpl.java44
-rw-r--r--sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/Person.java42
6 files changed, 244 insertions, 0 deletions
diff --git a/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/CheckedException.java b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/CheckedException.java
new file mode 100644
index 0000000000..5e9a7a316e
--- /dev/null
+++ b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/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/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReference.java b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReference.java
new file mode 100644
index 0000000000..768b293380
--- /dev/null
+++ b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/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.oasisopen.sca.annotation.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/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReferenceImpl.java b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReferenceImpl.java
new file mode 100644
index 0000000000..2bac5db5ab
--- /dev/null
+++ b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReferenceImpl.java
@@ -0,0 +1,62 @@
+/*
+ * 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.oasisopen.sca.annotation.Reference;
+
+public class HelloWorldReferenceImpl implements HelloWorldReference {
+
+ @Reference
+ protected HelloWorldService helloWorldService1;
+
+ @Reference
+ protected HelloWorldService helloWorldService2;
+
+ @Reference
+ protected HelloWorldService helloWorldService3;
+
+ public String getGreetings(String name){
+ String stringValue = helloWorldService1.getGreetings(name) + " " +
+ helloWorldService2.getGreetings(name) + " " +
+ helloWorldService3.getGreetings(name);
+
+ return stringValue;
+ }
+
+ public String getPersonGreetings(Person 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/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldService.java b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldService.java
new file mode 100644
index 0000000000..fe200e3cbe
--- /dev/null
+++ b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldService.java
@@ -0,0 +1,35 @@
+/*
+ * 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.oasisopen.sca.annotation.Remotable;
+
+/**
+ * This is the business interface of the HelloWorld greetings service.
+ */
+@Remotable
+public interface HelloWorldService {
+
+ public String getGreetings(String name);
+ public String getPersonGreetings(Person person);
+
+ public String throwChecked(String msg) throws CheckedException;
+ public String throwUnChecked(String msg);
+}
+
diff --git a/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldServiceImpl.java b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldServiceImpl.java
new file mode 100644
index 0000000000..80624ee770
--- /dev/null
+++ b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldServiceImpl.java
@@ -0,0 +1,44 @@
+/*
+ * 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 HelloWorldServiceImpl implements HelloWorldService {
+
+ public String getGreetings(String name){
+ String response = "Hello " + name;
+ System.out.println("getGreetings: " + response);
+ return response;
+ }
+
+ public String getPersonGreetings(Person person){
+ String response = "Hello " + person.getFirstName() + " " + person.getLastName();
+ System.out.println("getPersonGreetings: " + response);
+ return response;
+ }
+
+ public String throwChecked(String msg) throws CheckedException {
+ throw new CheckedException("foo");
+ }
+
+ public String throwUnChecked(String msg) {
+ throw new RuntimeException("bla");
+ }
+}
+
diff --git a/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/Person.java b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/Person.java
new file mode 100644
index 0000000000..175b482c81
--- /dev/null
+++ b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/Person.java
@@ -0,0 +1,42 @@
+/*
+ * 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 Person {
+ String firstName;
+ String lastName;
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+}
+