summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main')
-rw-r--r--sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/java/scatours/Bookings.java26
-rw-r--r--sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/java/scatours/Checkout.java28
-rw-r--r--sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/java/scatours/impl/ApplClientImpl.java52
-rw-r--r--sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/java/scatours/impl/ToursClientImpl.java47
-rw-r--r--sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/resources/META-INF/sca-contribution.xml26
-rw-r--r--sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/resources/tours-appl-client.composite40
-rw-r--r--sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/resources/tours-impl-client.composite32
-rw-r--r--sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/resources/tours-impl-include-client.composite32
8 files changed, 283 insertions, 0 deletions
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/java/scatours/Bookings.java b/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/java/scatours/Bookings.java
new file mode 100644
index 0000000000..e5e994b73c
--- /dev/null
+++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/java/scatours/Bookings.java
@@ -0,0 +1,26 @@
+/*
+ * 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 scatours;
+
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface Bookings {
+ String newBooking(String trip, int people);
+}
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/java/scatours/Checkout.java b/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/java/scatours/Checkout.java
new file mode 100644
index 0000000000..519b7779fa
--- /dev/null
+++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/java/scatours/Checkout.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 scatours;
+
+import java.math.BigDecimal;
+
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface Checkout {
+ void makePayment(BigDecimal amount, String cardInfo);
+}
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/java/scatours/impl/ApplClientImpl.java b/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/java/scatours/impl/ApplClientImpl.java
new file mode 100644
index 0000000000..278673c67d
--- /dev/null
+++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/java/scatours/impl/ApplClientImpl.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 scatours.impl;
+
+import java.math.BigDecimal;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+import scatours.Bookings;
+import scatours.Checkout;
+
+@Service(Runnable.class)
+public class ApplClientImpl {
+ @Reference
+ protected Bookings bookings1, bookings2;
+
+ @Reference
+ protected Checkout checkout1, checkout2;
+
+ public ApplClientImpl() {
+ }
+
+ public void run() {
+ String bookingCode = bookings1.newBooking("FS1APR4", 1);
+ System.out.println("Booking code is " + bookingCode);
+
+ checkout1.makePayment(new BigDecimal("1995.00"), "1234567843218765 10/10");
+
+ bookingCode = bookings2.newBooking("AC3MAY9", 2);
+ System.out.println("Booking code is " + bookingCode);
+
+ checkout2.makePayment(new BigDecimal("2295.00"), "9876123456784321 11/11");
+ }
+}
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/java/scatours/impl/ToursClientImpl.java b/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/java/scatours/impl/ToursClientImpl.java
new file mode 100644
index 0000000000..16934872b9
--- /dev/null
+++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/java/scatours/impl/ToursClientImpl.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 scatours.impl;
+
+import java.math.BigDecimal;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+import scatours.Bookings;
+import scatours.Checkout;
+
+@Service(Runnable.class)
+public class ToursClientImpl {
+ @Reference
+ protected Bookings bookings;
+
+ @Reference
+ protected Checkout checkout;
+
+ public ToursClientImpl() {
+ }
+
+ public void run() {
+ String bookingCode = bookings.newBooking("FS1APR4", 1);
+ System.out.println("Booking code is " + bookingCode);
+
+ checkout.makePayment(new BigDecimal("1995.00"), "1234567843218765 10/10");
+ }
+}
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..e3f6effcee
--- /dev/null
+++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:tst="http://tuscanyscatours.com/">
+ <import namespace="http://tuscanyscatours.com/" />
+ <deployable composite="tst:ToursApplClient" />
+ <deployable composite="tst:ToursImplClient" />
+ <deployable composite="tst:ToursImplIncludeClient" />
+</contribution>
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/resources/tours-appl-client.composite b/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/resources/tours-appl-client.composite
new file mode 100644
index 0000000000..b9f9d59f43
--- /dev/null
+++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/resources/tours-appl-client.composite
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://tuscanyscatours.com/"
+ xmlns:tst="http://tuscanyscatours.com/"
+ name="ToursApplClient">
+
+ <component name="ApplClient">
+ <implementation.java class="scatours.impl.ApplClientImpl" />
+ <reference name="bookings1">
+ <binding.ws uri="http://localhost:8081/BookTrip" />
+ </reference>
+ <reference name="checkout1">
+ <binding.ws uri="http://localhost:8081/Checkout" />
+ </reference>
+ <reference name="bookings2">
+ <binding.jms uri="jms:BookTrip" />
+ </reference>
+ <reference name="checkout2">
+ <binding.jms uri="jms:Checkout" />
+ </reference>
+ </component>
+</composite>
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/resources/tours-impl-client.composite b/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/resources/tours-impl-client.composite
new file mode 100644
index 0000000000..f8f0b3d4d1
--- /dev/null
+++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/resources/tours-impl-client.composite
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://tuscanyscatours.com/"
+ xmlns:tst="http://tuscanyscatours.com/"
+ name="ToursImplClient">
+
+ <component name="ToursClient">
+ <implementation.java class="scatours.impl.ToursClientImpl" />
+ <reference name="bookings" target="MyTours/BookTrip" />
+ <reference name="checkout" target="MyTours/Checkout" />
+ </component>
+
+ <include name="tst:ToursImpl" />
+</composite>
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/resources/tours-impl-include-client.composite b/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/resources/tours-impl-include-client.composite
new file mode 100644
index 0000000000..7310d0540d
--- /dev/null
+++ b/sca-java-1.x/trunk/tutorials/travelsample/contributions/buildingblocks-client/src/main/resources/tours-impl-include-client.composite
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://tuscanyscatours.com/"
+ xmlns:tst="http://tuscanyscatours.com/"
+ name="ToursImplIncludeClient">
+
+ <component name="ToursClient">
+ <implementation.java class="scatours.impl.ToursClientImpl" />
+ <reference name="bookings" target="MyTours/BookTrip" />
+ <reference name="checkout" target="MyTours/Checkout" />
+ </component>
+
+ <include name="tst:ToursImplInclude" />
+</composite>