From 3a569a2f00bf172cddfd567149774ee808a2a242 Mon Sep 17 00:00:00 2001 From: nash Date: Wed, 30 Mar 2011 19:50:51 +0000 Subject: Create branch for 1.6.2 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1087059 13f79535-47bb-0310-9956-ffa450edef68 --- .../jmsdefault/helloworld/CheckedException.java | 28 +++++++ .../jmsdefault/helloworld/HelloWorldReference.java | 36 +++++++++ .../helloworld/HelloWorldReferenceImpl.java | 85 ++++++++++++++++++++++ .../jmsdefault/helloworld/HelloWorldService.java | 39 ++++++++++ .../helloworld/HelloWorldServiceImpl.java | 52 +++++++++++++ .../jms/format/jmsdefault/helloworld/Person.java | 42 +++++++++++ 6 files changed, 282 insertions(+) create mode 100644 sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/CheckedException.java create mode 100644 sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReference.java create mode 100644 sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReferenceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldService.java create mode 100644 sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/Person.java (limited to 'sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault') diff --git a/sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/CheckedException.java b/sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/CheckedException.java new file mode 100644 index 0000000000..ee02ac5f39 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/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.jmsdefault.helloworld; + +public class CheckedException extends Exception { + private static final long serialVersionUID = 1L; + + public CheckedException(String s) { + super(s); + } +} diff --git a/sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReference.java b/sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReference.java new file mode 100644 index 0000000000..8744a57daf --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReference.java @@ -0,0 +1,36 @@ +/* + * 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.jmsdefault.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); + + public void nullInVoidOut(); + +} + diff --git a/sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReferenceImpl.java b/sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReferenceImpl.java new file mode 100644 index 0000000000..f465767056 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReferenceImpl.java @@ -0,0 +1,85 @@ +/* + * 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.jmsdefault.helloworld; + +import org.osoa.sca.annotations.Reference; + +public class HelloWorldReferenceImpl implements HelloWorldReference { + + @Reference + protected HelloWorldService helloWorldService1; + + @Reference + protected HelloWorldService helloWorldService2; + + @Reference + protected HelloWorldService helloWorldService3; + + @Reference + protected HelloWorldService helloWorldService4; + + public String getGreetings(String name){ + String stringValue = helloWorldService1.getGreetings(name) + " " + + helloWorldService2.getGreetings(name) + " " + + helloWorldService3.getGreetings(name) + " " + + helloWorldService4.getGreetings(name); + + try { + helloWorldService3.throwChecked(name); + } catch (CheckedException e) { + stringValue += " " + e.getMessage(); + } + + try { + helloWorldService3.throwUnChecked(name); + } catch (Exception e) { + stringValue += " " + e.getMessage(); + } + + try { + helloWorldService4.throwChecked(name); + } catch (CheckedException e) { + stringValue += " " + e.getMessage(); + } + + try { + helloWorldService4.throwUnChecked(name); + } catch (Exception e) { + stringValue += " " + e.getMessage(); + } + + return stringValue; + } + + public String getPersonGreetings(Person person){ + return helloWorldService1.getPersonGreetings(person) + " " + + helloWorldService2.getPersonGreetings(person) + " " + + helloWorldService3.getPersonGreetings(person) + " " + + helloWorldService4.getPersonGreetings(person); + } + + public void nullInVoidOut() { + helloWorldService1.nullInVoidOut(); + helloWorldService2.nullInVoidOut(); + helloWorldService3.nullInVoidOut(); + helloWorldService4.nullInVoidOut(); + + } +} + diff --git a/sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldService.java b/sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldService.java new file mode 100644 index 0000000000..545fcc894d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldService.java @@ -0,0 +1,39 @@ +/* + * 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.jmsdefault.helloworld; + +import org.apache.tuscany.sca.binding.jms.format.jmsdefault.helloworld.CheckedException; +import org.osoa.sca.annotations.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 void nullInVoidOut(); + + public void throwChecked(String msg) throws CheckedException; + public void throwUnChecked(String msg); +} + diff --git a/sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldServiceImpl.java new file mode 100644 index 0000000000..aca727a9db --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldServiceImpl.java @@ -0,0 +1,52 @@ +/* + * 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.jmsdefault.helloworld; + +import org.apache.tuscany.sca.binding.jms.format.jmsdefault.helloworld.CheckedException; + +public class HelloWorldServiceImpl implements HelloWorldService { + + public static int nullInVoidOutCalled = 0; + + 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 void nullInVoidOut() { + System.out.println("nullInVoidOut"); + nullInVoidOutCalled++; + } + + public void throwChecked(String msg) throws CheckedException { + throw new CheckedException("foo"); + } + + public void throwUnChecked(String msg) { + throw new RuntimeException("bla"); + } +} + diff --git a/sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/Person.java b/sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/Person.java new file mode 100644 index 0000000000..c28347bf8e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.2/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/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.jmsdefault.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; + } + +} + -- cgit v1.2.3