From e5b7380c874745c989d1816b8f552504f038e1bc Mon Sep 17 00:00:00 2001 From: lresende Date: Thu, 26 Sep 2013 20:33:20 +0000 Subject: 2.0 branch for possible maintenance release git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1526672 13f79535-47bb-0310-9956-ffa450edef68 --- .../jmsbytes/helloworld/CheckedException.java | 28 ++++++ .../jmsbytes/helloworld/HelloWorldReference.java | 32 ++++++ .../helloworld/HelloWorldReferenceImpl.java | 50 +++++++++ .../jmsbytes/helloworld/HelloWorldService.java | 35 +++++++ .../jmsbytes/helloworld/HelloWorldServiceImpl.java | 40 ++++++++ .../helloworld/HelloWorldServiceReference.java | 35 +++++++ .../jmsobject/helloworld/CheckedException.java | 28 ++++++ .../jmsobject/helloworld/HelloWorldReference.java | 32 ++++++ .../helloworld/HelloWorldReferenceImpl.java | 112 +++++++++++++++++++++ .../jmsobject/helloworld/HelloWorldService.java | 41 ++++++++ .../helloworld/HelloWorldServiceImpl.java | 63 ++++++++++++ .../jms/format/jmsobject/helloworld/Person.java | 47 +++++++++ 12 files changed, 543 insertions(+) create mode 100644 sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java create mode 100644 sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java create mode 100644 sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java create mode 100644 sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java create mode 100644 sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java create mode 100644 sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java create mode 100644 sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/CheckedException.java create mode 100644 sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReference.java create mode 100644 sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReferenceImpl.java create mode 100644 sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldService.java create mode 100644 sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldServiceImpl.java create mode 100644 sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/Person.java (limited to 'sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms') diff --git a/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java new file mode 100644 index 0000000000..1acbfbd5ae --- /dev/null +++ b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/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.jmsbytes.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-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java new file mode 100644 index 0000000000..2d19d4bd82 --- /dev/null +++ b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java @@ -0,0 +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 org.apache.tuscany.sca.binding.jms.format.jmsbytes.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 message); + +} + diff --git a/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java new file mode 100644 index 0000000000..3ccd54e9bd --- /dev/null +++ b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java @@ -0,0 +1,50 @@ +/* + * 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.jmsbytes.helloworld; + +import org.oasisopen.sca.annotation.Reference; + + +public class HelloWorldReferenceImpl implements HelloWorldReference { + + @Reference + protected HelloWorldServiceReference helloWorldService1; + + public String getGreetings(String name){ + byte[] bytesValue = helloWorldService1.getByteArrayGreetings(name.getBytes()); + String stringValue = new String(bytesValue); + + try { + helloWorldService1.throwChecked(name.getBytes()); + } catch (Exception e) { + // Test to see what happens if we talk to a service + // that declares a checked exception through an + // interface that doesn't + stringValue += " " + e.getCause().getMessage(); + } + + try { + helloWorldService1.throwUnChecked(name.getBytes()); + } catch (Exception e) { + stringValue += " " + e.getMessage(); + } + return stringValue; + } +} + diff --git a/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java new file mode 100644 index 0000000000..b9a1ffd5ef --- /dev/null +++ b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/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.jmsbytes.helloworld; + +import org.oasisopen.sca.annotation.Remotable; + +/** + * This is the business interface of the HelloWorld greetings service. + */ +@Remotable +public interface HelloWorldService { + + public byte[] getByteArrayGreetings(byte[] msg); + + public void throwChecked(byte[] msg) throws CheckedException; + public void throwUnChecked(byte[] msg); + +} + diff --git a/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java new file mode 100644 index 0000000000..b92959cfd3 --- /dev/null +++ b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java @@ -0,0 +1,40 @@ +/* + * 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.jmsbytes.helloworld; + + +public class HelloWorldServiceImpl implements HelloWorldService { + + public byte[] getByteArrayGreetings(byte[] msg){ + + String name = new String(msg); + name = "Hello " + name; + + return name.getBytes(); + } + + public void throwChecked(byte[] msg) throws CheckedException { + throw new CheckedException("foo"); + } + + public void throwUnChecked(byte[] msg) { + throw new RuntimeException("bla"); + } +} + diff --git a/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java new file mode 100644 index 0000000000..ff5cf617f2 --- /dev/null +++ b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.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.jmsbytes.helloworld; + +import org.oasisopen.sca.annotation.Remotable; + +/** + * This is the business interface of the HelloWorld greetings service. + */ +@Remotable +public interface HelloWorldServiceReference { + + public byte[] getByteArrayGreetings(byte[] msg); + + public void throwChecked(byte[] msg) ; + public void throwUnChecked(byte[] msg); + +} + diff --git a/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/CheckedException.java b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/CheckedException.java new file mode 100644 index 0000000000..a1c38f7295 --- /dev/null +++ b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/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.jmsobject.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-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReference.java b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReference.java new file mode 100644 index 0000000000..3b34dbae85 --- /dev/null +++ b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReference.java @@ -0,0 +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 org.apache.tuscany.sca.binding.jms.format.jmsobject.helloworld; + +import org.oasisopen.sca.annotation.Remotable; + +/** + * This is the business interface of the HelloWorld greetings service. + */ +@Remotable +public interface HelloWorldReference { + + public String getGreetingsWrapSingle(String firstName, String lastName); + public String getGreetingsDontWrapSingle(String firstName, String lastName); +} + diff --git a/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReferenceImpl.java b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReferenceImpl.java new file mode 100644 index 0000000000..d93a1e51a2 --- /dev/null +++ b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReferenceImpl.java @@ -0,0 +1,112 @@ +/* + * 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.jmsobject.helloworld; + +import org.oasisopen.sca.annotation.Reference; + + +public class HelloWorldReferenceImpl implements HelloWorldReference { + + @Reference + protected HelloWorldService helloWorldServiceWrapSingle; + + @Reference + protected HelloWorldService helloWorldServiceDontWrapSingle; + + public String getGreetingsWrapSingle(String firstName, String lastName){ + Person person = new Person(); + person.setFirstName(firstName); + person.setLastName(lastName); + + String returnString = ""; + + Person returnPerson = helloWorldServiceWrapSingle.getPersonGreetings(person); + returnString = returnPerson.getFirstName() + " " + returnPerson.getLastName(); + + Person returnNullPerson = helloWorldServiceWrapSingle.getNullReturnGreetings(person); + + if (returnNullPerson == null){ + returnString += " Hello2 null"; + } + + String returnGreeting = helloWorldServiceWrapSingle.getArrayGreeting(new String[]{firstName, lastName}); + returnString += " " + returnGreeting; + + returnGreeting = helloWorldServiceWrapSingle.getMultiArrayGreetings(new String[]{firstName, firstName},new String[]{lastName, lastName}); + returnString += " " + returnGreeting; + + returnGreeting = helloWorldServiceWrapSingle.getMultiGreetings(firstName, lastName); + returnString += " " + returnGreeting; + + returnGreeting = helloWorldServiceWrapSingle.getObjectGreeting(person); + returnString += " " + returnGreeting; + + returnGreeting = helloWorldServiceWrapSingle.getObjectArrayGreeting(new Object[]{person}); + returnString += " " + returnGreeting; + + return returnString; + } + + public String getGreetingsDontWrapSingle(String firstName, String lastName){ + Person person = new Person(); + person.setFirstName(firstName); + person.setLastName(lastName); + + String returnString = ""; + + Person returnPerson = helloWorldServiceDontWrapSingle.getPersonGreetings(person); + returnString = returnPerson.getFirstName() + " " + returnPerson.getLastName(); + + Person returnNullPerson = helloWorldServiceDontWrapSingle.getNullReturnGreetings(person); + + if (returnNullPerson == null){ + returnString += " Hello2 null"; + } + + String returnGreeting = helloWorldServiceDontWrapSingle.getArrayGreeting(new String[]{firstName, lastName}); + returnString += " " + returnGreeting; + + returnGreeting = helloWorldServiceDontWrapSingle.getMultiArrayGreetings(new String[]{firstName, firstName},new String[]{lastName, lastName}); + returnString += " " + returnGreeting; + + returnGreeting = helloWorldServiceDontWrapSingle.getMultiGreetings(firstName, lastName); + returnString += " " + returnGreeting; + + returnGreeting = helloWorldServiceDontWrapSingle.getObjectGreeting(person); + returnString += " " + returnGreeting; + + returnGreeting = helloWorldServiceDontWrapSingle.getObjectArrayGreeting(new Object[]{person}); + returnString += " " + returnGreeting; + + try { + helloWorldServiceDontWrapSingle.throwChecked(person); + } catch (CheckedException e) { + returnString += " " + e.getMessage(); + } + + try { + helloWorldServiceDontWrapSingle.throwUnChecked(person); + } catch (Exception e) { + returnString += " " + (e.getCause().getMessage().startsWith("Message = java.lang.RuntimeException: bla") ? "bla" : e.getCause().getMessage()); + } + + return returnString; + } +} + diff --git a/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldService.java b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldService.java new file mode 100644 index 0000000000..b179a86f52 --- /dev/null +++ b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldService.java @@ -0,0 +1,41 @@ +/* + * 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.jmsobject.helloworld; + +import org.oasisopen.sca.annotation.Remotable; + +/** + * This is the business interface of the HelloWorld greetings service. + */ +@Remotable +public interface HelloWorldService { + + public Person getPersonGreetings(Person person); + public Person getNullReturnGreetings(Person person); + public String getArrayGreeting(String[] names); + public String getMultiArrayGreetings(String[] firstName, String[] lastName); + public String getMultiGreetings(String firstName, String lastName); + public String getObjectGreeting(Object person); + public String getObjectArrayGreeting(Object[] pearson); + + public void throwChecked(Person person) throws CheckedException; + public void throwUnChecked(Person person); + +} + diff --git a/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldServiceImpl.java b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldServiceImpl.java new file mode 100644 index 0000000000..fa9e9eb1cb --- /dev/null +++ b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldServiceImpl.java @@ -0,0 +1,63 @@ +/* + * 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.jmsobject.helloworld; + +public class HelloWorldServiceImpl implements HelloWorldService { + + public Person getPersonGreetings(Person person){ + + person.setFirstName("Hello1 " + person.getFirstName()); + person.setLastName("Hello1 " + person.getLastName()); + + return person; + } + + public Person getNullReturnGreetings(Person person){ + return null; + } + + public String getArrayGreeting(String[] names) { + return "Hello3 " + names[0]; + } + + public String getMultiArrayGreetings(String[] firstName, String[] lastName) { + return "Hello4 " + firstName[0] + " " + lastName[0]; + } + + public String getMultiGreetings(String firstName, String lastName) { + return "Hello5 " + firstName + " " + lastName; + } + + public String getObjectGreeting(Object person) { + return "Hello6 " + ((Person)person).getFirstName() + " " + ((Person)person).getLastName(); + } + + public String getObjectArrayGreeting(Object[] person) { + return "Hello7 " + ((Person)person[0]).getFirstName() + " " + ((Person)person[0]).getLastName(); + } + + public void throwChecked(Person person) throws CheckedException { + throw new CheckedException("foo"); + } + + public void throwUnChecked(Person person) { + throw new RuntimeException("bla"); + } +} + diff --git a/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/Person.java b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/Person.java new file mode 100644 index 0000000000..29233d74a9 --- /dev/null +++ b/sca-java-2.x/branches/2.0/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/Person.java @@ -0,0 +1,47 @@ +/* + * 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.jmsobject.helloworld; + +import java.io.Serializable; + +public class Person implements Serializable { + + private static final long serialVersionUID = -6842761353978551779L; + + 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