From fb22ec3f14a2a075ce9297cb741755a23c03b5b9 Mon Sep 17 00:00:00 2001 From: nash Date: Tue, 1 Jun 2010 21:50:07 +0000 Subject: Tag for travelsample-1.0-RC3 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@950266 13f79535-47bb-0310-9956-ffa450edef68 --- sca-java-1.x/tags/travelsample-1.0-RC3/antdefs.xml | 795 +++++++++++++++++++ .../tags/travelsample-1.0-RC3/binaries/build.xml | 139 ++++ .../travelsample-1.0-RC3/binaries/bundle/pom.xml | 641 +++++++++++++++ .../travelsample-1.0-RC3/binaries/jaxws/pom.xml | 70 ++ .../tags/travelsample-1.0-RC3/binaries/ode/pom.xml | 71 ++ .../travelsample-1.0-RC3/binaries/openejb/pom.xml | 68 ++ .../tags/travelsample-1.0-RC3/binaries/pom.xml | 38 + .../binaries/src/main/assembly/bin-jaxws.xml | 35 + .../binaries/src/main/assembly/bin-ode.xml | 35 + .../binaries/src/main/assembly/bin-openejb.xml | 35 + .../src/main/assembly/bin-selfcontained.xml | 36 + .../binaries/src/main/assembly/bin.xml | 36 + .../binaries/src/main/components/bin-default.xml | 28 + .../binaries/src/main/components/bin-jaxws.xml | 46 ++ .../binaries/src/main/components/bin-modules.xml | 135 ++++ .../binaries/src/main/components/bin-ode.xml | 31 + .../binaries/src/main/components/bin-openejb.xml | 46 ++ .../src/main/components/bin-selfcontained.xml | 42 + .../binaries/src/main/resources/build-clients.xml | 54 ++ .../main/resources/build-defs-selfcontained.xml | 34 + .../binaries/src/main/resources/build-defs.xml | 62 ++ .../src/main/resources/build-launchers.xml | 337 ++++++++ .../binaries/src/main/resources/build-services.xml | 64 ++ sca-java-1.x/tags/travelsample-1.0-RC3/build.xml | 50 ++ .../tags/travelsample-1.0-RC3/clients/build.xml | 47 ++ .../clients/currency-converter-corba/build.xml | 42 + .../clients/currency-converter-corba/pom.xml | 76 ++ .../scatours/CurrencyConverterCORBAClient.java | 41 + .../src/main/resources/currency-converter.idl | 29 + .../clients/currency-converter-jms/build.xml | 38 + .../clients/currency-converter-jms/pom.xml | 97 +++ .../java/scatours/CurrencyConverterJMSClient.java | 103 +++ .../clients/currency-converter-rmi/build.xml | 36 + .../clients/currency-converter-rmi/pom.xml | 50 ++ .../currencyconverter/CurrencyConverter.java | 30 + .../java/scatours/CurrencyConverterRMIClient.java | 36 + .../clients/currency-converter-ws-jaxws/build.xml | 45 ++ .../clients/currency-converter-ws-jaxws/pom.xml | 92 +++ .../java/scatours/CurrencyConverterWSClient.java | 33 + .../src/main/resources/wsdl/CurrencyConverter.wsdl | 115 +++ .../tags/travelsample-1.0-RC3/clients/pom.xml | 39 + .../contributions/blog-feed/build.xml | 22 + .../contributions/blog-feed/pom.xml | 68 ++ .../java/com/tuscanyscatours/blog/BlogPost.java | 68 ++ .../blog/feed/impl/AtomBlogFeedImpl.java | 124 +++ .../blog/feed/impl/BaseBlogFeedImpl.java | 88 +++ .../blog/feed/impl/GenericBlogFeedImpl.java | 70 ++ .../blog/feed/impl/RSSBlogFeedImpl.java | 94 +++ .../main/resources/META-INF/sca-contribution.xml | 21 + .../src/main/resources/blog-feed.composite | 58 ++ .../travelsample-1.0-RC3/contributions/build.xml | 102 +++ .../contributions/buildingblocks-client/build.xml | 22 + .../contributions/buildingblocks-client/pom.xml | 125 +++ .../src/main/java/scatours/Bookings.java | 26 + .../src/main/java/scatours/Checkout.java | 28 + .../main/java/scatours/impl/ApplClientImpl.java | 52 ++ .../main/java/scatours/impl/ToursClientImpl.java | 47 ++ .../main/resources/META-INF/sca-contribution.xml | 26 + .../src/main/resources/tours-appl-client.composite | 40 + .../src/main/resources/tours-impl-client.composite | 32 + .../resources/tours-impl-include-client.composite | 32 + .../java/scatours/BuildingBlocksApplTestCase.java | 77 ++ .../BuildingBlocksImplIncludeTestCase.java | 59 ++ .../java/scatours/BuildingBlocksImplTestCase.java | 58 ++ .../src/test/resources/jndi.properties | 39 + .../contributions/buildingblocks/build.xml | 22 + .../contributions/buildingblocks/pom.xml | 91 +++ .../src/main/java/com/budgettours/Tours.java | 26 + .../com/budgettours/impl/TourProviderImpl.java | 28 + .../src/main/java/com/goodvaluetrips/Trips.java | 26 + .../main/java/com/tuscanyscatours/Bookings.java | 26 + .../main/java/com/tuscanyscatours/Checkout.java | 28 + .../src/main/java/com/tuscanyscatours/Updates.java | 26 + .../com/tuscanyscatours/impl/ShoppingCartImpl.java | 49 ++ .../com/tuscanyscatours/impl/TripBookingImpl.java | 39 + .../main/java/scatours/impl/TripProviderImpl.java | 28 + .../main/resources/META-INF/sca-contribution.xml | 27 + .../src/main/resources/tours-appl.composite | 54 ++ .../main/resources/tours-impl-include.composite | 33 + .../src/main/resources/tours-impl.composite | 34 + .../src/main/resources/tours.composite | 43 + .../BuildingBlocksImplIncludeTestCase.java | 66 ++ .../java/scatours/BuildingBlocksImplTestCase.java | 65 ++ .../contributions/calendar/build.xml | 22 + .../contributions/calendar/pom.xml | 64 ++ .../com/tuscanyscatours/calendar/Calendar.java | 25 + .../calendar/impl/CalendarImpl.java | 47 ++ .../main/resources/META-INF/sca-contribution.xml | 23 + .../java/scatours/calendar/CalendarTestCase.java | 57 ++ .../test/resources/META-INF/sca-contribution.xml | 23 + .../calendar/src/test/resources/calendar.composite | 28 + .../contributions/car/build.xml | 25 + .../travelsample-1.0-RC3/contributions/car/pom.xml | 57 ++ .../java/com/tuscanyscatours/car/impl/CarImpl.java | 91 +++ .../java/com/tuscanyscatours/car/impl/CarInfo.java | 118 +++ .../main/resources/META-INF/sca-contribution.xml | 23 + .../contributions/common/build.xml | 22 + .../contributions/common/pom.xml | 50 ++ .../main/java/com/tuscanyscatours/common/Book.java | 27 + .../java/com/tuscanyscatours/common/Search.java | 36 + .../com/tuscanyscatours/common/SearchCallback.java | 28 + .../java/com/tuscanyscatours/common/TripItem.java | 242 ++++++ .../java/com/tuscanyscatours/common/TripLeg.java | 85 ++ .../main/resources/META-INF/sca-contribution.xml | 22 + .../creditcard-payment-jaxb-policy/build.xml | 30 + .../creditcard-payment-jaxb-policy/pom.xml | 149 ++++ .../creditcard/impl/CreditCardPaymentImpl.java | 46 ++ .../src/main/resources/CreditCardPayment.wsdl | 134 ++++ .../main/resources/META-INF/sca-contribution.xml | 23 + .../src/main/resources/creditcard.composite | 33 + .../src/main/resources/definitions.xml | 34 + .../creditcard/CreditCardPaymentTestCase.java | 100 +++ .../creditcard-payment-jaxb/build.xml | 30 + .../contributions/creditcard-payment-jaxb/pom.xml | 149 ++++ .../creditcard/impl/CreditCardPaymentImpl.java | 46 ++ .../src/main/resources/CreditCardPayment.wsdl | 134 ++++ .../main/resources/META-INF/sca-contribution.xml | 23 + .../src/main/resources/creditcard.composite | 33 + .../creditcard/CreditCardPaymentTestCase.java | 100 +++ .../contributions/creditcard-payment-sdo/build.xml | 31 + .../contributions/creditcard-payment-sdo/pom.xml | 149 ++++ .../payment/creditcard/CreditCardPayment.java | 52 ++ .../creditcard/impl/CreditCardPaymentImpl.java | 46 ++ .../src/main/resources/CreditCardPayment.wsdl | 117 +++ .../main/resources/META-INF/sca-contribution.xml | 23 + .../src/main/resources/creditcard.composite | 33 + .../creditcard/CreditCardPaymentTestCase.java | 80 ++ .../creditcard-payment-webapp/build.xml | 154 ++++ .../creditcard-payment-webapp/pom.xml | 72 ++ .../src/main/resources/CreditCardPayment.wsdl | 134 ++++ .../src/main/webapp/META-INF/sca-contribution.xml | 23 + .../webapp/META-INF/sca-deployables/web.composite | 43 + .../src/main/webapp/WEB-INF/web.xml | 42 + .../src/main/webapp/creditcard.jsp | 71 ++ .../contributions/currency-corba/build.xml | 22 + .../contributions/currency-corba/pom.xml | 51 ++ .../main/resources/META-INF/sca-contribution.xml | 23 + .../resources/currency-converter-corba.composite | 32 + .../contributions/currency-jms/build.xml | 22 + .../contributions/currency-jms/pom.xml | 71 ++ .../main/resources/META-INF/sca-contribution.xml | 23 + .../resources/currency-converter-jms.composite | 37 + .../contributions/currency-jsp/build.xml | 97 +++ .../contributions/currency-jsp/pom.xml | 58 ++ .../webapp/META-INF/sca-deployables/web.composite | 34 + .../currency-jsp/src/main/webapp/WEB-INF/web.xml | 42 + .../src/main/webapp/currency-converter.jsp | 49 ++ .../contributions/currency-rmi/build.xml | 22 + .../contributions/currency-rmi/pom.xml | 51 ++ .../main/resources/META-INF/sca-contribution.xml | 23 + .../resources/currency-converter-rmi.composite | 32 + .../contributions/currency-servlet/build.xml | 100 +++ .../contributions/currency-servlet/pom.xml | 72 ++ .../servlet/CurrencyConverterServlet.java | 73 ++ .../webapp/META-INF/sca-deployables/web.composite | 34 + .../src/main/webapp/WEB-INF/web.xml | 52 ++ .../contributions/currency-ws/build.xml | 22 + .../contributions/currency-ws/pom.xml | 51 ++ .../main/resources/META-INF/sca-contribution.xml | 23 + .../main/resources/currency-converter-ws.composite | 31 + .../contributions/currency/build.xml | 22 + .../contributions/currency/pom.xml | 57 ++ .../currencyconverter/CurrencyConverter.java | 33 + .../impl/CurrencyConverterImpl.java | 53 ++ .../main/resources/META-INF/sca-contribution.xml | 23 + .../main/resources/currency-converter.composite | 28 + .../contributions/databinding-client/build.xml | 25 + .../contributions/databinding-client/pom.xml | 48 ++ .../src/main/java/scatours/client/TestClient.java | 40 + .../main/resources/META-INF/sca-contribution.xml | 24 + .../src/main/resources/client.composite | 28 + .../contributions/emailgateway/build.xml | 30 + .../contributions/emailgateway/pom.xml | 154 ++++ .../emailgateway/impl/EmailGatewayImpl.java | 38 + .../src/main/resources/EmailGateway.wsdl | 89 +++ .../main/resources/META-INF/sca-contribution.xml | 25 + .../src/main/resources/emailgateway.composite | 32 + .../emailgateway/EmailGatewayTestCase.java | 76 ++ .../client/impl/EmailGatewayClientImpl.java | 41 + .../test/resources/META-INF/sca-contribution.xml | 25 + .../src/test/resources/emailgateway-test.composite | 32 + .../contributions/feed-logger/build.xml | 22 + .../contributions/feed-logger/pom.xml | 68 ++ .../com/tuscanyscatours/feedlogger/FeedLogger.java | 30 + .../feedlogger/impl/FeedLoggerImpl.java | 99 +++ .../main/resources/META-INF/sca-contribution.xml | 21 + .../src/main/resources/feed-logger.composite | 40 + .../contributions/flight/build.xml | 25 + .../contributions/flight/pom.xml | 57 ++ .../tuscanyscatours/flight/impl/FlightImpl.java | 121 +++ .../tuscanyscatours/flight/impl/FlightInfo.java | 140 ++++ .../main/resources/META-INF/sca-contribution.xml | 23 + .../contributions/fullapp-bespoketrip/build.xml | 22 + .../contributions/fullapp-bespoketrip/pom.xml | 34 + .../main/resources/META-INF/sca-contribution.xml | 28 + .../main/resources/fullapp-bespoketrip.composite | 63 ++ .../contributions/fullapp-coordination/build.xml | 22 + .../contributions/fullapp-coordination/pom.xml | 34 + .../main/resources/META-INF/sca-contribution.xml | 30 + .../main/resources/fullapp-coordination.composite | 72 ++ .../contributions/fullapp-currency/build.xml | 22 + .../contributions/fullapp-currency/pom.xml | 34 + .../main/resources/META-INF/sca-contribution.xml | 25 + .../src/main/resources/fullapp-currency.composite | 28 + .../contributions/fullapp-packagedtrip/build.xml | 22 + .../contributions/fullapp-packagedtrip/pom.xml | 34 + .../main/resources/META-INF/sca-contribution.xml | 25 + .../main/resources/fullapp-packagedtrip.composite | 37 + .../contributions/fullapp-shoppingcart/build.xml | 22 + .../contributions/fullapp-shoppingcart/pom.xml | 34 + .../main/resources/META-INF/sca-contribution.xml | 26 + .../main/resources/fullapp-shoppingcart.composite | 36 + .../contributions/fullapp-ui/build.xml | 22 + .../contributions/fullapp-ui/pom.xml | 34 + .../main/resources/META-INF/sca-contribution.xml | 28 + .../src/main/resources/fullapp-ui.composite | 58 ++ .../fullapp-ui/src/main/resources/scatours.html | 399 ++++++++++ .../fullapp-ui/src/main/resources/scatours.odg | Bin 0 -> 11880 bytes .../fullapp-ui/src/main/resources/scatours.png | Bin 0 -> 16554 bytes .../fullapp-ui/src/main/resources/style.css | 135 ++++ .../contributions/help-pages/build.xml | 22 + .../contributions/help-pages/pom.xml | 50 ++ .../main/resources/META-INF/sca-contribution.xml | 22 + .../src/main/resources/help-pages.composite | 32 + .../main/resources/help_pages/BookingAHoliday.html | 34 + .../main/resources/help_pages/BookingAHotel.html | 34 + .../main/resources/help_pages/MakingPayments.html | 34 + .../src/main/resources/help_pages/index.html | 59 ++ .../contributions/hotel/build.xml | 25 + .../contributions/hotel/pom.xml | 49 ++ .../java/com/tuscanyscatours/hotel/HotelInfo.java | 118 +++ .../com/tuscanyscatours/hotel/HotelManagement.java | 24 + .../com/tuscanyscatours/hotel/impl/HotelImpl.java | 105 +++ .../main/resources/META-INF/sca-contribution.xml | 24 + .../contributions/interaction-client/build.xml | 28 + .../contributions/interaction-client/pom.xml | 77 ++ .../impl/InteractionConversationClientImpl.java | 73 ++ .../client/impl/InteractionLocalClientImpl.java | 53 ++ .../impl/InteractionOneWayCallbackClientImpl.java | 78 ++ .../client/impl/InteractionRemoteClientImpl.java | 64 ++ .../impl/InteractionRequestResponseClientImpl.java | 39 + .../main/resources/META-INF/sca-contribution.xml | 30 + .../src/main/resources/client.composite | 77 ++ .../interaction-service-remote/build.xml | 22 + .../interaction-service-remote/pom.xml | 34 + .../main/resources/META-INF/sca-contribution.xml | 26 + .../src/main/resources/service.composite | 48 ++ .../contributions/introducing-client/build.xml | 25 + .../contributions/introducing-client/pom.xml | 49 ++ .../java/scatours/client/impl/TestClientImpl.java | 47 ++ .../main/resources/META-INF/sca-contribution.xml | 24 + .../src/main/resources/client.composite | 29 + .../contributions/introducing-tours/build.xml | 22 + .../contributions/introducing-tours/pom.xml | 42 + .../src/main/java/com/goodvaluetrips/Trips.java | 26 + .../main/java/com/tuscanyscatours/Bookings.java | 26 + .../main/java/com/tuscanyscatours/Checkout.java | 28 + .../src/main/java/com/tuscanyscatours/Updates.java | 26 + .../com/tuscanyscatours/impl/ShoppingCartImpl.java | 49 ++ .../com/tuscanyscatours/impl/TripBookingImpl.java | 39 + .../main/resources/META-INF/sca-contribution.xml | 24 + .../src/main/resources/tours.composite | 46 ++ .../contributions/introducing-trips/build.xml | 22 + .../contributions/introducing-trips/pom.xml | 42 + .../src/main/java/com/goodvaluetrips/Trips.java | 26 + .../com/goodvaluetrips/impl/TripProviderImpl.java | 28 + .../main/resources/META-INF/sca-contribution.xml | 24 + .../src/main/resources/trips.composite | 30 + .../contributions/notification-corba/build.xml | 22 + .../contributions/notification-corba/pom.xml | 43 + .../main/resources/META-INF/sca-contribution.xml | 24 + .../main/resources/notification-corba.composite | 36 + .../contributions/notification-ejb/build.xml | 22 + .../contributions/notification-ejb/pom.xml | 43 + .../main/resources/META-INF/sca-contribution.xml | 24 + .../src/main/resources/notification-ejb.composite | 35 + .../contributions/notification-jms/build.xml | 22 + .../contributions/notification-jms/pom.xml | 43 + .../main/resources/META-INF/sca-contribution.xml | 24 + .../src/main/resources/notification-jms.composite | 41 + .../contributions/notification-rmi/build.xml | 22 + .../contributions/notification-rmi/pom.xml | 43 + .../main/resources/META-INF/sca-contribution.xml | 24 + .../src/main/resources/notification-rmi.composite | 36 + .../contributions/notification-ws/build.xml | 22 + .../contributions/notification-ws/pom.xml | 43 + .../main/resources/META-INF/sca-contribution.xml | 24 + .../src/main/resources/notification-ws.composite | 35 + .../contributions/notification/build.xml | 22 + .../contributions/notification/pom.xml | 49 ++ .../tuscanyscatours/notification/Notification.java | 26 + .../notification/impl/NotificationImpl.java | 58 ++ .../com/tuscanyscatours/smsgateway/SMSGateway.java | 30 + .../main/resources/META-INF/sca-contribution.xml | 24 + .../contributions/payment-bpel-process/build.xml | 23 + .../contributions/payment-bpel-process/pom.xml | 46 ++ .../src/main/resources/CreditCardPayment.wsdl | 117 +++ .../src/main/resources/EmailGateway.wsdl | 89 +++ .../main/resources/META-INF/sca-contribution.xml | 22 + .../src/main/resources/Payment.wsdl | 83 ++ .../src/main/resources/payment.bpel | 161 ++++ .../contributions/payment-bpel/build.xml | 49 ++ .../contributions/payment-bpel/log4j.properties | 36 + .../contributions/payment-bpel/pom.xml | 214 +++++ .../src/main/resources/CreditCardPayment.wsdl | 117 +++ .../src/main/resources/EmailGateway.wsdl | 89 +++ .../main/resources/META-INF/sca-contribution.xml | 24 + .../payment-bpel/src/main/resources/Payment.wsdl | 83 ++ .../src/main/resources/payment.composite | 40 + .../java/scatours/payment/PaymentTestCase.java | 87 +++ .../payment/client/impl/PaymentClientImpl.java | 37 + .../test/resources/META-INF/sca-contribution.xml | 24 + .../src/test/resources/payment-client.composite | 33 + .../contributions/payment-groovy/build.xml | 35 + .../contributions/payment-groovy/pom.xml | 161 ++++ .../src/main/resources/EmailGateway.wsdl | 89 +++ .../main/resources/META-INF/sca-contribution.xml | 24 + .../payment-groovy/src/main/resources/Payment.wsdl | 83 ++ .../src/main/resources/payment.composite | 38 + .../src/main/resources/payment/PaymentImpl.groovy | 31 + .../java/scatours/payment/PaymentTestCase.java | 77 ++ .../payment/client/impl/PaymentClientImpl.java | 37 + .../test/resources/META-INF/sca-contribution.xml | 24 + .../src/test/resources/payment-client.composite | 32 + .../contributions/payment-java-callback/build.xml | 30 + .../contributions/payment-java-callback/pom.xml | 153 ++++ .../com/tuscanyscatours/customer/Customer.java | 70 ++ .../customer/CustomerNotFoundException.java | 57 ++ .../tuscanyscatours/customer/CustomerRegistry.java | 39 + .../customer/impl/CustomerRegistryImpl.java | 114 +++ .../tuscanyscatours/emailgateway/EmailGateway.java | 30 + .../emailgateway/impl/EmailGatewayImpl.java | 37 + .../payment/creditcard/AddressType.java | 191 +++++ .../payment/creditcard/Authorize.java | 101 +++ .../payment/creditcard/AuthorizeFault.java | 81 ++ .../creditcard/AuthorizeFault_Exception.java | 71 ++ .../payment/creditcard/AuthorizeResponse.java | 81 ++ .../payment/creditcard/CardCompany.java | 31 + .../payment/creditcard/CreditCardConfirm.java | 27 + .../payment/creditcard/CreditCardDetailsType.java | 219 ++++++ .../payment/creditcard/CreditCardPayment.java | 31 + .../creditcard/CreditCardPaymentConfirm.java | 31 + .../payment/creditcard/CreditCardSecurity.java | 27 + .../payment/creditcard/CreditCardTypeType.java | 74 ++ .../payment/creditcard/PayerType.java | 107 +++ .../payment/creditcard/impl/CardCompanyImpl.java | 60 ++ .../impl/CreditCardPaymentCallbackImpl.java | 78 ++ .../impl/CreditCardPaymentConfirmImpl.java | 48 ++ .../payment/impl/CreditCardSecurityImpl.java | 38 + .../payment/impl/PaymentCallbackIDImpl.java | 90 +++ .../payment/impl/PaymentCallbackImpl.java | 78 ++ .../payment/impl/PaymentCallbackRedirectImpl.java | 83 ++ .../payment/impl/PaymentConfirmImpl.java | 77 ++ .../src/main/resources/CreditCardPayment.wsdl | 132 ++++ .../main/resources/META-INF/sca-contribution.xml | 23 + .../src/main/resources/Payment.wsdl | 83 ++ .../src/main/resources/definitions.xml | 34 + .../src/main/resources/payment.composite | 118 +++ .../java/scatours/payment/PaymentTestCase.java | 111 +++ .../contributions/payment-java-policy/build.xml | 35 + .../contributions/payment-java-policy/pom.xml | 195 +++++ .../com/tuscanyscatours/customer/Customer.java | 70 ++ .../customer/CustomerNotFoundException.java | 57 ++ .../tuscanyscatours/customer/CustomerRegistry.java | 39 + .../customer/impl/CustomerRegistryImpl.java | 115 +++ .../tuscanyscatours/emailgateway/EmailGateway.java | 30 + .../emailgateway/impl/EmailGatewayImpl.java | 37 + .../tuscanyscatours/payment/impl/PaymentImpl.java | 74 ++ .../src/main/resources/CreditCardPayment.wsdl | 132 ++++ .../main/resources/META-INF/sca-contribution.xml | 24 + .../src/main/resources/Payment.wsdl | 83 ++ .../src/main/resources/definitions.xml | 48 ++ .../src/main/resources/payment.composite | 48 ++ .../java/scatours/payment/PaymentTestCase.java | 89 +++ .../payment-java-reference-pass/build.xml | 30 + .../payment-java-reference-pass/pom.xml | 153 ++++ .../com/tuscanyscatours/customer/Customer.java | 70 ++ .../customer/CustomerNotFoundException.java | 57 ++ .../tuscanyscatours/customer/CustomerRegistry.java | 39 + .../customer/impl/CustomerRegistryImpl.java | 114 +++ .../tuscanyscatours/emailgateway/EmailGateway.java | 30 + .../emailgateway/impl/EmailGatewayImpl.java | 37 + .../payment/creditcard/AddressType.java | 191 +++++ .../payment/creditcard/Authorize.java | 101 +++ .../payment/creditcard/AuthorizeFault.java | 81 ++ .../creditcard/AuthorizeFault_Exception.java | 71 ++ .../payment/creditcard/AuthorizeResponse.java | 81 ++ .../payment/creditcard/CreditCardDetailsType.java | 219 ++++++ .../payment/creditcard/CreditCardPayment.java | 36 + .../payment/creditcard/CreditCardTypeType.java | 74 ++ .../payment/creditcard/PayerType.java | 107 +++ .../creditcard/impl/CreditCardPaymentImpl.java | 47 ++ .../tuscanyscatours/payment/impl/PaymentImpl.java | 76 ++ .../src/main/resources/CreditCardPayment.wsdl | 132 ++++ .../main/resources/META-INF/sca-contribution.xml | 23 + .../src/main/resources/Payment.wsdl | 83 ++ .../src/main/resources/definitions.xml | 34 + .../src/main/resources/payment.composite | 49 ++ .../java/scatours/payment/PaymentTestCase.java | 79 ++ .../contributions/payment-java/build.xml | 35 + .../contributions/payment-java/pom.xml | 171 ++++ .../com/tuscanyscatours/customer/Customer.java | 70 ++ .../customer/CustomerNotFoundException.java | 57 ++ .../tuscanyscatours/customer/CustomerRegistry.java | 39 + .../customer/impl/CustomerRegistryImpl.java | 115 +++ .../tuscanyscatours/emailgateway/EmailGateway.java | 30 + .../emailgateway/impl/EmailGatewayImpl.java | 37 + .../tuscanyscatours/payment/impl/PaymentImpl.java | 69 ++ .../src/main/resources/CreditCardPayment.wsdl | 132 ++++ .../main/resources/META-INF/sca-contribution.xml | 24 + .../payment-java/src/main/resources/Payment.wsdl | 83 ++ .../src/main/resources/definitions.xml | 34 + .../src/main/resources/payment.composite | 46 ++ .../java/scatours/payment/PaymentTestCase.java | 79 ++ .../contributions/payment-python/build.xml | 35 + .../contributions/payment-python/pom.xml | 161 ++++ .../src/main/resources/EmailGateway.wsdl | 89 +++ .../main/resources/META-INF/sca-contribution.xml | 24 + .../payment-python/src/main/resources/Payment.wsdl | 83 ++ .../src/main/resources/payment.composite | 38 + .../src/main/resources/payment/PaymentImpl.py | 26 + .../java/scatours/payment/PaymentTestCase.java | 77 ++ .../payment/client/impl/PaymentClientImpl.java | 37 + .../test/resources/META-INF/sca-contribution.xml | 24 + .../src/test/resources/payment-client.composite | 32 + .../contributions/payment-spring-policy/build.xml | 40 + .../contributions/payment-spring-policy/pom.xml | 206 +++++ .../com/tuscanyscatours/customer/Customer.java | 70 ++ .../customer/CustomerNotFoundException.java | 57 ++ .../tuscanyscatours/customer/CustomerRegistry.java | 39 + .../customer/impl/CustomerRegistryImpl.java | 113 +++ .../emailgateway/impl/EmailGatewayImpl.java | 32 + .../tuscanyscatours/payment/impl/PaymentImpl.java | 77 ++ .../src/main/resources/CreditCardPayment.wsdl | 118 +++ .../src/main/resources/EmailGateway.wsdl | 89 +++ .../main/resources/META-INF/sca-contribution.xml | 24 + .../src/main/resources/Payment-context.xml | 33 + .../src/main/resources/Payment.wsdl | 83 ++ .../src/main/resources/definitions.xml | 35 + .../src/main/resources/payment.composite | 45 ++ .../java/scatours/payment/PaymentTestCase.java | 74 ++ .../payment/client/impl/PaymentClientImpl.java | 37 + .../test/resources/META-INF/sca-contribution.xml | 24 + .../src/test/resources/payment-client.composite | 31 + .../contributions/payment-spring-scatag/build.xml | 40 + .../contributions/payment-spring-scatag/pom.xml | 206 +++++ .../emailgateway/impl/EmailGatewayImpl.java | 32 + .../tuscanyscatours/payment/impl/PaymentImpl.java | 76 ++ .../src/main/resources/CreditCardPayment.wsdl | 118 +++ .../src/main/resources/EmailGateway.wsdl | 89 +++ .../main/resources/META-INF/sca-contribution.xml | 24 + .../src/main/resources/Payment-context.xml | 44 ++ .../src/main/resources/Payment.wsdl | 83 ++ .../src/main/resources/payment.composite | 35 + .../java/scatours/payment/PaymentTestCase.java | 75 ++ .../payment/client/impl/PaymentClientImpl.java | 37 + .../test/resources/META-INF/sca-contribution.xml | 24 + .../src/test/resources/payment-client.composite | 31 + .../contributions/payment-spring/build.xml | 40 + .../contributions/payment-spring/pom.xml | 206 +++++ .../com/tuscanyscatours/customer/Customer.java | 70 ++ .../customer/CustomerNotFoundException.java | 57 ++ .../tuscanyscatours/customer/CustomerRegistry.java | 39 + .../customer/impl/CustomerRegistryImpl.java | 115 +++ .../emailgateway/impl/EmailGatewayImpl.java | 32 + .../tuscanyscatours/payment/impl/PaymentImpl.java | 77 ++ .../src/main/resources/CreditCardPayment.wsdl | 118 +++ .../src/main/resources/EmailGateway.wsdl | 89 +++ .../main/resources/META-INF/sca-contribution.xml | 24 + .../src/main/resources/Payment-context.xml | 39 + .../payment-spring/src/main/resources/Payment.wsdl | 83 ++ .../src/main/resources/payment.composite | 35 + .../java/scatours/payment/PaymentTestCase.java | 74 ++ .../payment/client/impl/PaymentClientImpl.java | 37 + .../test/resources/META-INF/sca-contribution.xml | 24 + .../src/test/resources/payment-client.composite | 31 + .../contributions/policy-client/build.xml | 33 + .../contributions/policy-client/pom.xml | 107 +++ .../src/main/java/scatours/client/TestClient.java | 60 ++ .../main/resources/META-INF/sca-contribution.xml | 25 + .../policy-client/src/main/resources/Payment.wsdl | 83 ++ .../src/main/resources/client.composite | 29 + .../travelsample-1.0-RC3/contributions/pom.xml | 94 +++ .../contributions/scatours/build.xml | 28 + .../contributions/scatours/pom.xml | 78 ++ .../java/com/tuscanyscatours/SCAToursBooking.java | 31 + .../java/com/tuscanyscatours/SCAToursCart.java | 35 + .../java/com/tuscanyscatours/SCAToursSearch.java | 32 + .../com/tuscanyscatours/impl/SCAToursImpl.java | 84 ++ .../main/resources/META-INF/sca-contribution.xml | 27 + .../contributions/shoppingcart/build.xml | 33 + .../contributions/shoppingcart/pom.xml | 125 +++ .../tuscanyscatours/shoppingcart/CartCheckout.java | 26 + .../shoppingcart/CartInitialize.java | 30 + .../tuscanyscatours/shoppingcart/CartStore.java | 41 + .../tuscanyscatours/shoppingcart/CartUpdates.java | 30 + .../shoppingcart/impl/CartStoreImpl.java | 70 ++ .../shoppingcart/impl/ShoppingCartImpl.java | 104 +++ .../main/resources/META-INF/sca-contribution.xml | 25 + .../shoppingcart/src/main/resources/Payment.wsdl | 83 ++ .../contributions/travelcatalog/build.xml | 26 + .../contributions/travelcatalog/pom.xml | 64 ++ .../travelcatalog/TravelCatalogSearch.java | 32 + .../travelcatalog/impl/TravelCatalogImpl.java | 127 +++ .../main/resources/META-INF/sca-contribution.xml | 25 + .../contributions/trip-policy/build.xml | 26 + .../contributions/trip-policy/pom.xml | 78 ++ .../com/tuscanyscatours/trip/impl/TripImpl.java | 94 +++ .../com/tuscanyscatours/trip/impl/TripInfo.java | 140 ++++ .../main/resources/META-INF/sca-contribution.xml | 25 + .../trip-policy/src/main/resources/definitions.xml | 32 + .../trip-policy/src/main/resources/trip.composite | 31 + .../src/test/java/scatours/trip/TripTestCase.java | 68 ++ .../contributions/trip/build.xml | 26 + .../contributions/trip/pom.xml | 78 ++ .../com/tuscanyscatours/trip/impl/TripImpl.java | 94 +++ .../com/tuscanyscatours/trip/impl/TripInfo.java | 140 ++++ .../main/resources/META-INF/sca-contribution.xml | 23 + .../src/test/java/scatours/trip/TripTestCase.java | 68 ++ .../trip/src/test/resources/definitions.xml | 32 + .../trip/src/test/resources/trip.composite | 31 + .../contributions/tripbooking/build.xml | 26 + .../contributions/tripbooking/pom.xml | 63 ++ .../tuscanyscatours/tripbooking/TripBooking.java | 32 + .../tripbooking/impl/TripBookingImpl.java | 91 +++ .../main/resources/META-INF/sca-contribution.xml | 26 + .../contributions/usingsca/build.xml | 22 + .../contributions/usingsca/pom.xml | 124 +++ .../java/com/tuscanyscahotels/HotelOffers.java | 26 + .../com/tuscanyscahotels/impl/HotelOffersImpl.java | 35 + .../src/main/java/com/tuscanyscatours/Address.java | 172 ++++ .../java/com/tuscanyscatours/AirportCodes.java | 28 + .../java/com/tuscanyscatours/BillingAddress.java | 174 +++++ .../main/java/com/tuscanyscatours/Bookings.java | 26 + .../src/main/java/com/tuscanyscatours/Cars.java | 27 + .../com/tuscanyscatours/CurrencyConverter.java | 27 + .../java/com/tuscanyscatours/CustomerInfo.java | 27 + .../src/main/java/com/tuscanyscatours/Flights.java | 27 + .../src/main/java/com/tuscanyscatours/Hotels.java | 27 + .../usingsca/impl/CarPartnerImpl.java | 36 + .../usingsca/impl/CarVendorImpl.java | 34 + .../usingsca/impl/CurrencyConverterImpl.java | 45 ++ .../usingsca/impl/CustomerImpl.java | 47 ++ .../usingsca/impl/FlightPartnerImpl.java | 31 + .../usingsca/impl/HotelPartnerImpl.java | 31 + .../usingsca/impl/TripBookingImpl.java | 73 ++ .../client/impl/AirportCodesClientImpl.java | 36 + .../scatours/client/impl/BookingsClientImpl.java | 36 + .../client/impl/BookingsZeroClientImpl.java | 36 + .../client/impl/CarBookingsClientImpl.java | 38 + .../scatours/client/impl/ConverterClientImpl.java | 43 + .../client/impl/HotelOffersClientImpl.java | 36 + .../scatours/client/impl/Orders1ClientImpl.java | 36 + .../scatours/client/impl/Orders2ClientImpl.java | 38 + .../usingsca/src/main/resources/address.xsd | 41 + .../src/main/resources/airportcodes.composite | 26 + .../src/main/resources/bookings1.composite | 42 + .../src/main/resources/bookings2.composite | 42 + .../src/main/resources/bookings3.composite | 39 + .../src/main/resources/bookings4.composite | 42 + .../src/main/resources/carbookings1.composite | 36 + .../src/main/resources/carbookings2.composite | 37 + .../src/main/resources/carbookings3.composite | 36 + .../src/main/resources/converter.composite | 35 + .../src/main/resources/hotelsdomain.composite | 38 + .../usingsca/src/main/resources/orders1.composite | 37 + .../usingsca/src/main/resources/orders2.composite | 46 ++ .../usingsca/src/main/resources/orders2.xsd | 24 + .../test-clients/airportcodes-client.composite | 33 + .../test-clients/bookings1-client.composite | 33 + .../test-clients/bookings2-client.composite | 33 + .../test-clients/bookings3-client.composite | 33 + .../test-clients/bookings4-client.composite | 35 + .../test-clients/carbookings1-client.composite | 33 + .../test-clients/carbookings2-client.composite | 33 + .../test-clients/carbookings3-client.composite | 33 + .../test-clients/converter-client.composite | 34 + .../test-clients/hotelsdomain-client.composite | 34 + .../test-clients/orders1-client.composite | 33 + .../test-clients/orders2-client.composite | 33 + .../test-clients/toursdomain-client.composite | 33 + .../src/main/resources/toursdomain.composite | 39 + .../test/java/scatours/AirportCodesTestCase.java | 56 ++ .../src/test/java/scatours/BindingsTestCase.java | 56 ++ .../test/java/scatours/CarAutowireTestCase.java | 56 ++ .../src/test/java/scatours/CarPartnerTestCase.java | 56 ++ .../test/java/scatours/CarWireElementTestCase.java | 56 ++ .../scatours/ComplexPropertyElementTestCase.java | 56 ++ .../java/scatours/ComplexPropertyTypeTestCase.java | 56 ++ .../java/scatours/CurrencyConverterTestCase.java | 56 ++ .../test/java/scatours/MultiDomainTestCase.java | 65 ++ .../test/java/scatours/TripAutowireTestCase.java | 56 ++ .../test/java/scatours/TripBookingTestCase.java | 56 ++ .../java/scatours/TripWireElementTestCase.java | 56 ++ .../usingsca/src/test/resources/jndi.properties | 38 + .../tags/travelsample-1.0-RC3/distribution/pom.xml | 88 +++ .../distribution/src/main/assembly/src.xml | 96 +++ .../distribution/src/main/release/BUILDING | 139 ++++ .../distribution/src/main/release/CHANGES | 4 + .../distribution/src/main/release/LICENSE | 725 +++++++++++++++++ .../distribution/src/main/release/NOTICE | 5 + .../distribution/src/main/release/README | 869 +++++++++++++++++++++ .../distribution/src/main/release/RELEASE_NOTES | 65 ++ .../travelsample-1.0-RC3/domainconfig/build.xml | 45 ++ .../domainconfig/fullapp/build.xml | 39 + .../domainconfig/fullapp/pom.xml | 79 ++ .../fullapp/src/main/resources/cloud.composite | 35 + .../resources/cloud/fullapp-bespoketrip.composite | 36 + .../resources/cloud/fullapp-coordination.composite | 36 + .../resources/cloud/fullapp-creditcard.composite | 36 + .../resources/cloud/fullapp-currency.composite | 36 + .../resources/cloud/fullapp-packagedtrip.composite | 35 + .../main/resources/cloud/fullapp-payment.composite | 36 + .../resources/cloud/fullapp-shoppingcart.composite | 36 + .../src/main/resources/cloud/fullapp-ui.composite | 33 + .../fullapp/src/main/resources/domain.composite | 37 + .../src/main/resources/workspace-binaries.xml | 42 + .../fullapp/src/main/resources/workspace.xml | 42 + .../domainconfig/introducing/build.xml | 39 + .../domainconfig/introducing/pom.xml | 79 ++ .../introducing/src/main/resources/cloud.composite | 26 + .../src/main/resources/cloud/ClientNode.composite | 32 + .../src/main/resources/cloud/ToursNode.composite | 32 + .../src/main/resources/cloud/TripsNode.composite | 32 + .../src/main/resources/domain.composite | 26 + .../src/main/resources/workspace-binaries.xml | 30 + .../introducing/src/main/resources/workspace.xml | 30 + .../tags/travelsample-1.0-RC3/domainconfig/pom.xml | 37 + .../launchers/blog-feed/build.xml | 36 + .../launchers/blog-feed/pom.xml | 104 +++ .../src/main/java/scatours/BlogFeedLauncher.java | 50 ++ .../tags/travelsample-1.0-RC3/launchers/build.xml | 79 ++ .../launchers/buildingblocks/build.xml | 36 + .../launchers/buildingblocks/pom.xml | 131 ++++ .../main/java/scatours/BuildingBlocksLauncher.java | 84 ++ .../src/main/resources/jndi.properties | 39 + .../test/java/scatours/BuildingBlocksTestCase.java | 42 + .../launchers/currency-converter-corba/build.xml | 43 + .../launchers/currency-converter-corba/pom.xml | 97 +++ .../scatours/CurrencyConverterCORBALauncher.java | 52 ++ .../currencyconverter/CurrencyConverter.java | 33 + .../launchers/currency-converter-jms/build.xml | 43 + .../launchers/currency-converter-jms/pom.xml | 109 +++ .../scatours/CurrencyConverterJMSLauncher.java | 53 ++ .../launchers/currency-converter-rmi/build.xml | 43 + .../launchers/currency-converter-rmi/pom.xml | 104 +++ .../currencyconverter/CurrencyConverter.java | 33 + .../scatours/CurrencyConverterRMILauncher.java | 56 ++ .../launchers/currency-converter-ws/build.xml | 43 + .../launchers/currency-converter-ws/pom.xml | 97 +++ .../java/scatours/CurrencyConverterWSLauncher.java | 53 ++ .../currencyconverter/CurrencyConverter.java | 33 + .../launchers/currency-converter/build.xml | 36 + .../launchers/currency-converter/pom.xml | 83 ++ .../java/scatours/CurrencyConverterLauncher.java | 48 ++ .../currencyconverter/CurrencyConverter.java | 33 + .../launchers/databinding/build.xml | 36 + .../launchers/databinding/pom.xml | 168 ++++ .../main/java/scatours/DatabindingLauncher.java | 45 ++ .../launchers/feed-logger/build.xml | 36 + .../launchers/feed-logger/pom.xml | 104 +++ .../src/main/java/scatours/FeedLoggerLauncher.java | 44 ++ .../main/java/scatours/feedlogger/FeedLogger.java | 30 + .../launchers/fullapp-domain/build.xml | 38 + .../launchers/fullapp-domain/pom.xml | 86 ++ .../main/java/scatours/FullAppDomainLauncher.java | 53 ++ .../launchers/fullapp-nodes/build.xml | 37 + .../launchers/fullapp-nodes/pom.xml | 172 ++++ .../main/java/scatours/FullAppNodesLauncher.java | 78 ++ .../launchers/fullapp/build.xml | 36 + .../travelsample-1.0-RC3/launchers/fullapp/pom.xml | 182 +++++ .../src/main/java/scatours/FullAppLauncher.java | 66 ++ .../launchers/help-pages/build.xml | 36 + .../launchers/help-pages/pom.xml | 97 +++ .../src/main/java/scatours/HelpPagesLauncher.java | 44 ++ .../launchers/interaction/build.xml | 36 + .../launchers/interaction/pom.xml | 104 +++ .../main/java/scatours/InteractionLauncher.java | 70 ++ .../test/java/scatours/InteractionTestCase.java | 42 + .../launchers/introducing-client/build.xml | 44 ++ .../launchers/introducing-client/pom.xml | 90 +++ .../java/scatours/IntroducingClientLauncher.java | 38 + .../launchers/introducing-domain/build.xml | 38 + .../launchers/introducing-domain/pom.xml | 86 ++ .../java/scatours/IntroducingDomainLauncher.java | 53 ++ .../launchers/introducing-tours/build.xml | 34 + .../launchers/introducing-tours/pom.xml | 86 ++ .../java/scatours/IntroducingToursLauncher.java | 51 ++ .../launchers/introducing-trips/build.xml | 34 + .../launchers/introducing-trips/pom.xml | 86 ++ .../java/scatours/IntroducingTripsLauncher.java | 51 ++ .../launchers/introducing/build.xml | 36 + .../launchers/introducing/pom.xml | 90 +++ .../main/java/scatours/IntroducingLauncher.java | 44 ++ .../test/java/scatours/IntroducingTestCase.java | 62 ++ .../launchers/jumpstart/build.xml | 31 + .../launchers/jumpstart/pom.xml | 79 ++ .../src/main/java/scatours/JumpstartLauncher.java | 43 + .../jumpstart/src/main/java/scatours/Trips.java | 26 + .../src/test/java/scatours/JumpstartTestCase.java | 56 ++ .../launchers/notification-corba/build.xml | 42 + .../launchers/notification-corba/pom.xml | 97 +++ .../java/scatours/NotificationCORBALauncher.java | 54 ++ .../java/scatours/notification/Notification.java | 26 + .../launchers/notification-ejb/build.xml | 43 + .../launchers/notification-ejb/pom.xml | 125 +++ .../java/scatours/NotificationEJBLauncher.java | 59 ++ .../java/scatours/notification/Notification.java | 26 + .../launchers/notification-jms/build.xml | 42 + .../launchers/notification-jms/pom.xml | 103 +++ .../java/scatours/NotificationJMSLauncher.java | 56 ++ .../java/scatours/notification/Notification.java | 26 + .../launchers/notification-rmi/build.xml | 42 + .../launchers/notification-rmi/pom.xml | 97 +++ .../com/tuscanyscatours/smsgateway/SMSGateway.java | 30 + .../java/scatours/NotificationRMILauncher.java | 54 ++ .../java/scatours/notification/Notification.java | 26 + .../launchers/notification-ws/build.xml | 42 + .../launchers/notification-ws/pom.xml | 97 +++ .../main/java/scatours/NotificationWSLauncher.java | 54 ++ .../java/scatours/notification/Notification.java | 26 + .../launchers/payment-bpel/build.xml | 50 ++ .../launchers/payment-bpel/pom.xml | 184 +++++ .../java/scatours/payment/PaymentLauncher.java | 53 ++ .../payment-bpel/src/main/resources/Payment.wsdl | 83 ++ .../launchers/payment-groovy/build.xml | 50 ++ .../launchers/payment-groovy/pom.xml | 185 +++++ .../java/scatours/payment/PaymentLauncher.java | 46 ++ .../src/main/resources/EmailGateway.wsdl | 89 +++ .../payment-groovy/src/main/resources/Payment.wsdl | 83 ++ .../launchers/payment-java-callback/build.xml | 44 ++ .../launchers/payment-java-callback/pom.xml | 159 ++++ .../java/scatours/payment/PaymentLauncher.java | 73 ++ .../src/main/resources/Payment.wsdl | 83 ++ .../launchers/payment-java-policy/build.xml | 44 ++ .../launchers/payment-java-policy/pom.xml | 159 ++++ .../java/scatours/payment/PaymentLauncher.java | 47 ++ .../src/main/resources/Payment.wsdl | 83 ++ .../payment-java-reference-pass/build.xml | 44 ++ .../launchers/payment-java-reference-pass/pom.xml | 159 ++++ .../java/scatours/payment/PaymentLauncher.java | 46 ++ .../src/main/resources/Payment.wsdl | 83 ++ .../launchers/payment-java/build.xml | 44 ++ .../launchers/payment-java/pom.xml | 159 ++++ .../java/scatours/payment/PaymentLauncher.java | 47 ++ .../payment-java/src/main/resources/Payment.wsdl | 83 ++ .../launchers/payment-python/build.xml | 50 ++ .../launchers/payment-python/pom.xml | 185 +++++ .../java/scatours/payment/PaymentLauncher.java | 46 ++ .../src/main/resources/EmailGateway.wsdl | 89 +++ .../payment-python/src/main/resources/Payment.wsdl | 83 ++ .../launchers/payment-spring-scatag/build.xml | 44 ++ .../launchers/payment-spring-scatag/pom.xml | 173 ++++ .../java/scatours/payment/PaymentLauncher.java | 47 ++ .../src/main/resources/Payment.wsdl | 83 ++ .../launchers/payment-spring/build.xml | 44 ++ .../launchers/payment-spring/pom.xml | 173 ++++ .../java/scatours/payment/PaymentLauncher.java | 47 ++ .../payment-spring/src/main/resources/Payment.wsdl | 83 ++ .../launchers/policy/build.xml | 36 + .../travelsample-1.0-RC3/launchers/policy/pom.xml | 111 +++ .../src/main/java/scatours/PolicyLauncher.java | 51 ++ .../tags/travelsample-1.0-RC3/launchers/pom.xml | 71 ++ .../launchers/usingsca/build.xml | 36 + .../launchers/usingsca/pom.xml | 138 ++++ .../src/main/java/scatours/UsingSCALauncher.java | 208 +++++ .../usingsca/src/main/resources/jndi.properties | 38 + .../src/test/java/scatours/UsingSCATestCase.java | 42 + sca-java-1.x/tags/travelsample-1.0-RC3/pom.xml | 110 +++ .../tags/travelsample-1.0-RC3/services/build.xml | 48 ++ .../tags/travelsample-1.0-RC3/services/pom.xml | 40 + .../services/smsgateway-corba/build.xml | 37 + .../services/smsgateway-corba/pom.xml | 76 ++ .../SMSGatewayCORBAServiceBootstrap.java | 105 +++ .../scatours/smsgateway/SMSGatewayServant.java | 30 + .../src/main/resources/sms-gateway.idl | 26 + .../services/smsgateway-ejb/build.xml | 35 + .../services/smsgateway-ejb/pom.xml | 58 ++ .../com/tuscanyscatours/smsgateway/SMSGateway.java | 30 + .../smsgateway/SMSGatewayEJBServiceBootstrap.java | 45 ++ .../tuscanyscatours/smsgateway/SMSGatewayImpl.java | 33 + .../src/main/resources/META-INF/ejb-jar.xml | 20 + .../services/smsgateway-jaxws/build.xml | 34 + .../services/smsgateway-jaxws/pom.xml | 63 ++ .../smsgateway/SMSGatewayService.java | 32 + .../smsgateway/SMSGatewayServiceBootstrap.java | 31 + .../smsgateway/SMSGatewayServiceImpl.java | 33 + .../services/smsgateway-jms/build.xml | 35 + .../services/smsgateway-jms/pom.xml | 97 +++ .../main/java/scatours/smsgateway/SMSGateway.java | 30 + .../java/scatours/smsgateway/SMSGatewayImpl.java | 126 +++ .../smsgateway/SMSGatewayJMSServiceBootstrap.java | 47 ++ .../services/smsgateway-rmi/build.xml | 31 + .../services/smsgateway-rmi/pom.xml | 50 ++ .../com/tuscanyscatours/smsgateway/SMSGateway.java | 30 + .../tuscanyscatours/smsgateway/SMSGatewayImpl.java | 39 + .../smsgateway/SMSGatewayRMIServiceBootstrap.java | 40 + .../tags/travelsample-1.0-RC3/testdomain/build.xml | 42 + .../tags/travelsample-1.0-RC3/testdomain/pom.xml | 58 ++ .../tags/travelsample-1.0-RC3/travel-scenario.odg | Bin 0 -> 17300 bytes .../tags/travelsample-1.0-RC3/util/build.xml | 44 ++ .../util/jaxws-runtime/pom.xml | 147 ++++ .../util/launcher-common/build.xml | 22 + .../util/launcher-common/pom.xml | 58 ++ .../main/java/scatours/launcher/LauncherUtil.java | 86 ++ .../util/openejb-runtime/pom.xml | 178 +++++ .../tags/travelsample-1.0-RC3/util/pom.xml | 38 + 807 files changed, 49395 insertions(+) create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/antdefs.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/bundle/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/jaxws/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/ode/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/openejb/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/assembly/bin-jaxws.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/assembly/bin-ode.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/assembly/bin-openejb.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/assembly/bin-selfcontained.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/assembly/bin.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-default.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-jaxws.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-modules.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-ode.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-openejb.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-selfcontained.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/resources/build-clients.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/resources/build-defs-selfcontained.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/resources/build-defs.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/resources/build-launchers.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/resources/build-services.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/clients/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-corba/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-corba/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-corba/src/main/java/scatours/CurrencyConverterCORBAClient.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-corba/src/main/resources/currency-converter.idl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-jms/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-jms/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-jms/src/main/java/scatours/CurrencyConverterJMSClient.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-rmi/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-rmi/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-rmi/src/main/java/com/tuscanyscatours/currencyconverter/CurrencyConverter.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-rmi/src/main/java/scatours/CurrencyConverterRMIClient.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-ws-jaxws/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-ws-jaxws/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-ws-jaxws/src/main/java/scatours/CurrencyConverterWSClient.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-ws-jaxws/src/main/resources/wsdl/CurrencyConverter.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/clients/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/java/com/tuscanyscatours/blog/BlogPost.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/java/com/tuscanyscatours/blog/feed/impl/AtomBlogFeedImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/java/com/tuscanyscatours/blog/feed/impl/BaseBlogFeedImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/java/com/tuscanyscatours/blog/feed/impl/GenericBlogFeedImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/java/com/tuscanyscatours/blog/feed/impl/RSSBlogFeedImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/resources/blog-feed.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/java/scatours/Bookings.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/java/scatours/Checkout.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/java/scatours/impl/ApplClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/java/scatours/impl/ToursClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/resources/tours-appl-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/resources/tours-impl-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/resources/tours-impl-include-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/test/java/scatours/BuildingBlocksApplTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/test/java/scatours/BuildingBlocksImplIncludeTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/test/java/scatours/BuildingBlocksImplTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/test/resources/jndi.properties create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/budgettours/Tours.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/budgettours/impl/TourProviderImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/goodvaluetrips/Trips.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/tuscanyscatours/Bookings.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/tuscanyscatours/Checkout.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/tuscanyscatours/Updates.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/tuscanyscatours/impl/ShoppingCartImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/tuscanyscatours/impl/TripBookingImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/scatours/impl/TripProviderImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/resources/tours-appl.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/resources/tours-impl-include.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/resources/tours-impl.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/resources/tours.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/test/java/scatours/BuildingBlocksImplIncludeTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/test/java/scatours/BuildingBlocksImplTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/main/java/com/tuscanyscatours/calendar/Calendar.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/main/java/com/tuscanyscatours/calendar/impl/CalendarImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/test/java/scatours/calendar/CalendarTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/test/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/test/resources/calendar.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/car/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/car/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/car/src/main/java/com/tuscanyscatours/car/impl/CarImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/car/src/main/java/com/tuscanyscatours/car/impl/CarInfo.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/car/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/java/com/tuscanyscatours/common/Book.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/java/com/tuscanyscatours/common/Search.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/java/com/tuscanyscatours/common/SearchCallback.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/java/com/tuscanyscatours/common/TripItem.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/java/com/tuscanyscatours/common/TripLeg.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/main/resources/CreditCardPayment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/main/resources/creditcard.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/main/resources/definitions.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/src/main/resources/CreditCardPayment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/src/main/resources/creditcard.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/main/resources/CreditCardPayment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/main/resources/creditcard.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/src/main/resources/CreditCardPayment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/src/main/webapp/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/src/main/webapp/META-INF/sca-deployables/web.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/src/main/webapp/WEB-INF/web.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/src/main/webapp/creditcard.jsp create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-corba/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-corba/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-corba/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-corba/src/main/resources/currency-converter-corba.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jms/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jms/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jms/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jms/src/main/resources/currency-converter-jms.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jsp/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jsp/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jsp/src/main/webapp/META-INF/sca-deployables/web.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jsp/src/main/webapp/WEB-INF/web.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jsp/src/main/webapp/currency-converter.jsp create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-rmi/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-rmi/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-rmi/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-rmi/src/main/resources/currency-converter-rmi.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-servlet/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-servlet/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-servlet/src/main/java/com/tuscanyscatours/currencyconverter/servlet/CurrencyConverterServlet.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-servlet/src/main/webapp/META-INF/sca-deployables/web.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-servlet/src/main/webapp/WEB-INF/web.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-ws/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-ws/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-ws/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-ws/src/main/resources/currency-converter-ws.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/src/main/java/com/tuscanyscatours/currencyconverter/CurrencyConverter.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/src/main/java/com/tuscanyscatours/currencyconverter/impl/CurrencyConverterImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/src/main/resources/currency-converter.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/databinding-client/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/databinding-client/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/databinding-client/src/main/java/scatours/client/TestClient.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/databinding-client/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/databinding-client/src/main/resources/client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/main/resources/EmailGateway.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/main/resources/emailgateway.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/test/java/scatours/emailgateway/EmailGatewayTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/test/java/scatours/emailgateway/client/impl/EmailGatewayClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/test/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/test/resources/emailgateway-test.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/src/main/java/com/tuscanyscatours/feedlogger/FeedLogger.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/src/main/java/com/tuscanyscatours/feedlogger/impl/FeedLoggerImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/src/main/resources/feed-logger.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/flight/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/flight/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/flight/src/main/java/com/tuscanyscatours/flight/impl/FlightImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/flight/src/main/java/com/tuscanyscatours/flight/impl/FlightInfo.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/flight/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-bespoketrip/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-bespoketrip/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-bespoketrip/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-bespoketrip/src/main/resources/fullapp-bespoketrip.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-coordination/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-coordination/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-coordination/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-coordination/src/main/resources/fullapp-coordination.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-currency/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-currency/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-currency/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-currency/src/main/resources/fullapp-currency.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-packagedtrip/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-packagedtrip/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-packagedtrip/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-packagedtrip/src/main/resources/fullapp-packagedtrip.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-shoppingcart/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-shoppingcart/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-shoppingcart/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-shoppingcart/src/main/resources/fullapp-shoppingcart.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/fullapp-ui.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/scatours.html create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/scatours.odg create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/scatours.png create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/style.css create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/help-pages.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/help_pages/BookingAHoliday.html create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/help_pages/BookingAHotel.html create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/help_pages/MakingPayments.html create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/help_pages/index.html create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/src/main/java/com/tuscanyscatours/hotel/HotelInfo.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/src/main/java/com/tuscanyscatours/hotel/HotelManagement.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/src/main/java/com/tuscanyscatours/hotel/impl/HotelImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionConversationClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionLocalClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionOneWayCallbackClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionRemoteClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionRequestResponseClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/resources/client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-service-remote/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-service-remote/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-service-remote/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-service-remote/src/main/resources/service.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-client/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-client/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-client/src/main/java/scatours/client/impl/TestClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-client/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-client/src/main/resources/client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/goodvaluetrips/Trips.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/tuscanyscatours/Bookings.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/tuscanyscatours/Checkout.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/tuscanyscatours/Updates.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/ShoppingCartImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/TripBookingImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/resources/tours.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/src/main/java/com/goodvaluetrips/Trips.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/src/main/java/com/goodvaluetrips/impl/TripProviderImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/src/main/resources/trips.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-corba/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-corba/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-corba/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-corba/src/main/resources/notification-corba.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ejb/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ejb/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ejb/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ejb/src/main/resources/notification-ejb.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-jms/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-jms/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-jms/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-jms/src/main/resources/notification-jms.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-rmi/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-rmi/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-rmi/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-rmi/src/main/resources/notification-rmi.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ws/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ws/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ws/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ws/src/main/resources/notification-ws.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/src/main/java/com/tuscanyscatours/notification/Notification.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/src/main/java/com/tuscanyscatours/notification/impl/NotificationImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/src/main/resources/CreditCardPayment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/src/main/resources/EmailGateway.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/src/main/resources/payment.bpel create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/log4j.properties create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/main/resources/CreditCardPayment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/main/resources/EmailGateway.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/main/resources/payment.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/test/java/scatours/payment/PaymentTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/test/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/test/resources/payment-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/EmailGateway.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/payment.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/payment/PaymentImpl.groovy create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/java/scatours/payment/PaymentTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/resources/payment-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/customer/Customer.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/AddressType.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/Authorize.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeFault.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeFault_Exception.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeResponse.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CardCompany.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardConfirm.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardDetailsType.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPaymentConfirm.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardSecurity.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardTypeType.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/PayerType.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CardCompanyImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentCallbackImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentConfirmImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/CreditCardSecurityImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackIDImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackRedirectImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentConfirmImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/resources/CreditCardPayment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/resources/definitions.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/resources/payment.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/test/java/scatours/payment/PaymentTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/customer/Customer.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/resources/CreditCardPayment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/resources/definitions.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/resources/payment.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/test/java/scatours/payment/PaymentTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/customer/Customer.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/AddressType.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/Authorize.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeFault.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeFault_Exception.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeResponse.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardDetailsType.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardTypeType.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/PayerType.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/resources/CreditCardPayment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/resources/definitions.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/resources/payment.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/test/java/scatours/payment/PaymentTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/customer/Customer.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/resources/CreditCardPayment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/resources/definitions.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/resources/payment.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/test/java/scatours/payment/PaymentTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/main/resources/EmailGateway.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/main/resources/payment.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/main/resources/payment/PaymentImpl.py create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/test/java/scatours/payment/PaymentTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/test/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/test/resources/payment-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/customer/Customer.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/CreditCardPayment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/EmailGateway.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/Payment-context.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/definitions.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/payment.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/test/java/scatours/payment/PaymentTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/test/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/test/resources/payment-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/CreditCardPayment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/EmailGateway.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/Payment-context.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/payment.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/test/java/scatours/payment/PaymentTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/test/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/test/resources/payment-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/customer/Customer.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/CreditCardPayment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/EmailGateway.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/Payment-context.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/payment.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/test/java/scatours/payment/PaymentTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/test/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/test/resources/payment-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/src/main/java/scatours/client/TestClient.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/src/main/resources/client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/src/main/java/com/tuscanyscatours/SCAToursBooking.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/src/main/java/com/tuscanyscatours/SCAToursCart.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/src/main/java/com/tuscanyscatours/SCAToursSearch.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/src/main/java/com/tuscanyscatours/impl/SCAToursImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/CartCheckout.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/CartInitialize.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/CartStore.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/CartUpdates.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/impl/CartStoreImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/impl/ShoppingCartImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/travelcatalog/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/travelcatalog/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/travelcatalog/src/main/java/com/tuscanyscatours/travelcatalog/TravelCatalogSearch.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/travelcatalog/src/main/java/com/tuscanyscatours/travelcatalog/impl/TravelCatalogImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/travelcatalog/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripInfo.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/main/resources/definitions.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/main/resources/trip.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/test/java/scatours/trip/TripTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/main/java/com/tuscanyscatours/trip/impl/TripImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/main/java/com/tuscanyscatours/trip/impl/TripInfo.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/test/java/scatours/trip/TripTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/test/resources/definitions.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/test/resources/trip.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/tripbooking/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/tripbooking/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/tripbooking/src/main/java/com/tuscanyscatours/tripbooking/TripBooking.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/tripbooking/src/main/java/com/tuscanyscatours/tripbooking/impl/TripBookingImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/tripbooking/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscahotels/HotelOffers.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscahotels/impl/HotelOffersImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/Address.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/AirportCodes.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/BillingAddress.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/Bookings.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/Cars.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/CurrencyConverter.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/CustomerInfo.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/Flights.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/Hotels.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CarPartnerImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CarVendorImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CurrencyConverterImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CustomerImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/FlightPartnerImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/HotelPartnerImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/TripBookingImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/AirportCodesClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/BookingsClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/BookingsZeroClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/CarBookingsClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/ConverterClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/HotelOffersClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/Orders1ClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/Orders2ClientImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/address.xsd create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/airportcodes.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/bookings1.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/bookings2.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/bookings3.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/bookings4.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/carbookings1.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/carbookings2.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/carbookings3.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/converter.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/hotelsdomain.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/orders1.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/orders2.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/orders2.xsd create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/airportcodes-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/bookings1-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/bookings2-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/bookings3-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/bookings4-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/carbookings1-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/carbookings2-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/carbookings3-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/converter-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/hotelsdomain-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/orders1-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/orders2-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/toursdomain-client.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/toursdomain.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/AirportCodesTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/BindingsTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/CarAutowireTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/CarPartnerTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/CarWireElementTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/ComplexPropertyElementTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/ComplexPropertyTypeTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/CurrencyConverterTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/MultiDomainTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/TripAutowireTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/TripBookingTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/TripWireElementTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/resources/jndi.properties create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/distribution/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/assembly/src.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/BUILDING create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/CHANGES create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/LICENSE create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/NOTICE create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/README create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/RELEASE_NOTES create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-bespoketrip.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-coordination.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-creditcard.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-currency.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-packagedtrip.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-payment.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-shoppingcart.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-ui.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/domain.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/workspace-binaries.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/workspace.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/cloud.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/cloud/ClientNode.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/cloud/ToursNode.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/cloud/TripsNode.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/domain.composite create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/workspace-binaries.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/workspace.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/blog-feed/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/blog-feed/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/blog-feed/src/main/java/scatours/BlogFeedLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/buildingblocks/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/buildingblocks/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/buildingblocks/src/main/java/scatours/BuildingBlocksLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/buildingblocks/src/main/resources/jndi.properties create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/buildingblocks/src/test/java/scatours/BuildingBlocksTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-corba/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-corba/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-corba/src/main/java/scatours/CurrencyConverterCORBALauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-corba/src/main/java/scatours/currencyconverter/CurrencyConverter.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-jms/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-jms/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-jms/src/main/java/scatours/CurrencyConverterJMSLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-rmi/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-rmi/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-rmi/src/main/java/com/tuscanyscatours/currencyconverter/CurrencyConverter.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-rmi/src/main/java/scatours/CurrencyConverterRMILauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-ws/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-ws/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-ws/src/main/java/scatours/CurrencyConverterWSLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-ws/src/main/java/scatours/currencyconverter/CurrencyConverter.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter/src/main/java/scatours/CurrencyConverterLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter/src/main/java/scatours/currencyconverter/CurrencyConverter.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/databinding/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/databinding/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/databinding/src/main/java/scatours/DatabindingLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/feed-logger/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/feed-logger/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/feed-logger/src/main/java/scatours/FeedLoggerLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/feed-logger/src/main/java/scatours/feedlogger/FeedLogger.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-domain/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-domain/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-domain/src/main/java/scatours/FullAppDomainLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-nodes/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-nodes/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-nodes/src/main/java/scatours/FullAppNodesLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp/src/main/java/scatours/FullAppLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/help-pages/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/help-pages/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/help-pages/src/main/java/scatours/HelpPagesLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/interaction/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/interaction/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/interaction/src/main/java/scatours/InteractionLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/interaction/src/test/java/scatours/InteractionTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-client/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-client/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-client/src/main/java/scatours/IntroducingClientLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-domain/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-domain/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-domain/src/main/java/scatours/IntroducingDomainLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-tours/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-tours/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-tours/src/main/java/scatours/IntroducingToursLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-trips/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-trips/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-trips/src/main/java/scatours/IntroducingTripsLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing/src/main/java/scatours/IntroducingLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing/src/test/java/scatours/IntroducingTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/jumpstart/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/jumpstart/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/jumpstart/src/main/java/scatours/JumpstartLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/jumpstart/src/main/java/scatours/Trips.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/jumpstart/src/test/java/scatours/JumpstartTestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-corba/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-corba/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-corba/src/main/java/scatours/NotificationCORBALauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-corba/src/main/java/scatours/notification/Notification.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ejb/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ejb/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ejb/src/main/java/scatours/NotificationEJBLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ejb/src/main/java/scatours/notification/Notification.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-jms/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-jms/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-jms/src/main/java/scatours/NotificationJMSLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-jms/src/main/java/scatours/notification/Notification.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-rmi/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-rmi/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-rmi/src/main/java/scatours/NotificationRMILauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-rmi/src/main/java/scatours/notification/Notification.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ws/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ws/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ws/src/main/java/scatours/NotificationWSLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ws/src/main/java/scatours/notification/Notification.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-bpel/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-bpel/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-bpel/src/main/java/scatours/payment/PaymentLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-bpel/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-groovy/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-groovy/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-groovy/src/main/java/scatours/payment/PaymentLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-groovy/src/main/resources/EmailGateway.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-groovy/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-callback/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-callback/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-callback/src/main/java/scatours/payment/PaymentLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-callback/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-policy/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-policy/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-policy/src/main/java/scatours/payment/PaymentLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-policy/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-reference-pass/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-reference-pass/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-reference-pass/src/main/java/scatours/payment/PaymentLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-reference-pass/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java/src/main/java/scatours/payment/PaymentLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-python/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-python/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-python/src/main/java/scatours/payment/PaymentLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-python/src/main/resources/EmailGateway.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-python/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring-scatag/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring-scatag/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring-scatag/src/main/java/scatours/payment/PaymentLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring-scatag/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring/src/main/java/scatours/payment/PaymentLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring/src/main/resources/Payment.wsdl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/policy/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/policy/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/policy/src/main/java/scatours/PolicyLauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/usingsca/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/usingsca/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/usingsca/src/main/java/scatours/UsingSCALauncher.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/usingsca/src/main/resources/jndi.properties create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/launchers/usingsca/src/test/java/scatours/UsingSCATestCase.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-corba/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-corba/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-corba/src/main/java/scatours/smsgateway/SMSGatewayCORBAServiceBootstrap.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-corba/src/main/java/scatours/smsgateway/SMSGatewayServant.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-corba/src/main/resources/sms-gateway.idl create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayEJBServiceBootstrap.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/src/main/resources/META-INF/ejb-jar.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jaxws/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jaxws/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayService.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayServiceBootstrap.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayServiceImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jms/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jms/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jms/src/main/java/scatours/smsgateway/SMSGateway.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jms/src/main/java/scatours/smsgateway/SMSGatewayImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jms/src/main/java/scatours/smsgateway/SMSGatewayJMSServiceBootstrap.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-rmi/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-rmi/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayImpl.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayRMIServiceBootstrap.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/testdomain/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/testdomain/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/travel-scenario.odg create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/util/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/util/jaxws-runtime/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/util/launcher-common/build.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/util/launcher-common/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/util/launcher-common/src/main/java/scatours/launcher/LauncherUtil.java create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/util/openejb-runtime/pom.xml create mode 100644 sca-java-1.x/tags/travelsample-1.0-RC3/util/pom.xml (limited to 'sca-java-1.x/tags') diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/antdefs.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/antdefs.xml new file mode 100644 index 0000000000..1a3c960ba6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/antdefs.xml @@ -0,0 +1,795 @@ + + + + + + + + Error: Please set the TUSCANY_HOME environment variable. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Error: Could not find wsimport executable or jaxws-tools.jar. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Error: Couldn't find JUnit jar file. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Error: Unable to copy implementation.web jars for this Tuscany version. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Error: Unable to download tuscany-implementation-web and tuscany-implementation-web-runtime jars. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Error: Couldn't find OpenEJB dependencies. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Error: Couldn't find JAX-WS dependencies. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/build.xml new file mode 100644 index 0000000000..12c7c76db8 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/build.xml @@ -0,0 +1,139 @@ + + + + + + Error: Please set the TUSCANY_HOME environment variable. + + + + + + + + + + + The ant build for "binaries" only produces output when building from the distribution. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/bundle/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/bundle/pom.xml new file mode 100644 index 0000000000..00fff08f32 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/bundle/pom.xml @@ -0,0 +1,641 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours-binaries + 1.0 + ../pom.xml + + scatours-binaries-bundle + Apache Tuscany SCA Tours Binaries Bundle + pom + + + + org.apache.tuscany.sca + scatours-client-currency-converter-corba + ${pom.version} + + + org.apache.tuscany.sca + scatours-client-currency-converter-jms + ${pom.version} + + + org.apache.tuscany.sca + scatours-client-currency-converter-rmi + ${pom.version} + + + org.apache.tuscany.sca + scatours-client-currency-converter-ws-jaxws + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-blog-feed + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-buildingblocks + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-buildingblocks-client + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-calendar + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-car + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-common + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-creditcard-payment-jaxb + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-creditcard-payment-jaxb-policy + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-creditcard-payment-sdo + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-creditcard-payment-webapp + war + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-currency + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-currency-corba + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-currency-jms + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-currency-jsp + war + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-currency-rmi + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-currency-servlet + war + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-currency-ws + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-databinding-client + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-emailgateway + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-feed-logger + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-flight + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-fullapp-bespoketrip + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-fullapp-currency + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-fullapp-coordination + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-fullapp-packagedtrip + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-fullapp-shoppingcart + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-fullapp-ui + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-help-pages + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-hotel + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-interaction-client + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-interaction-service-remote + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-introducing-client + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-introducing-tours + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-introducing-trips + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-notification + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-notification-corba + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-notification-ejb + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-notification-jms + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-notification-rmi + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-notification-ws + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-payment-bpel + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-payment-bpel-process + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-payment-groovy + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-payment-python + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-payment-java + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-payment-java-callback + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-payment-java-policy + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-payment-java-reference-pass + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-payment-spring + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-payment-spring-policy + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-payment-spring-scatag + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-policy-client + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-scatours + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-shoppingcart + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-travelcatalog + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-trip + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-trip-policy + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-tripbooking + ${pom.version} + + + org.apache.tuscany.sca + scatours-contribution-usingsca + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-blog-feed + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-buildingblocks + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-currency-converter + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-currency-converter-corba + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-currency-converter-jms + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-currency-converter-rmi + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-currency-converter-ws + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-databinding + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-feed-logger + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-fullapp + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-fullapp-domain + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-fullapp-nodes + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-help-pages + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-interaction + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-introducing + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-introducing-client + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-introducing-domain + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-introducing-tours + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-introducing-trips + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-notification-corba + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-notification-ejb + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-notification-jms + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-notification-rmi + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-notification-ws + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-payment-bpel + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-payment-groovy + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-payment-python + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-payment-java + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-payment-java-callback + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-payment-java-policy + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-payment-java-reference-pass + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-payment-spring + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-payment-spring-scatag + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-policy + ${pom.version} + + + org.apache.tuscany.sca + scatours-launcher-usingsca + ${pom.version} + + + org.apache.tuscany.sca + scatours-service-smsgateway-corba + ${pom.version} + + + org.apache.tuscany.sca + scatours-service-smsgateway-ejb + ${pom.version} + + + org.apache.tuscany.sca + scatours-service-smsgateway-jaxws + ${pom.version} + + + org.apache.tuscany.sca + scatours-service-smsgateway-jms + ${pom.version} + + + org.apache.tuscany.sca + scatours-service-smsgateway-rmi + ${pom.version} + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + + + org.apache.tuscany.sca + scatours-domainconfig-fullapp + ${pom.version} + + + org.apache.tuscany.sca + scatours-domainconfig-introducing + ${pom.version} + + + org.apache.geronimo.specs + geronimo-jms_1.1_spec + 1.1 + + + + + + + default + + true + + + bin.xml + + + + + + selfcontained + + bin-selfcontained.xml + + + + + + + + maven-antrun-plugin + + + install + + + + + + + run + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + distribution-package + package + + single + + + + ../src/main/assembly/${config-file} + + gnu + .. + ../target + . + true + true + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/jaxws/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/jaxws/pom.xml new file mode 100644 index 0000000000..aa5533711c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/jaxws/pom.xml @@ -0,0 +1,70 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours-binaries + 1.0 + ../pom.xml + + scatours-binaries-jaxws + Apache Tuscany SCA Tours Binaries JAX-WS Dependencies for JDK 5 + pom + + + + + + org.apache.tuscany.sca + scatours-util-jaxws-runtime + ${pom.version} + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + distribution-package + package + + single + + + + ../src/main/assembly/bin-jaxws.xml + + gnu + .. + ../target + . + true + true + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/ode/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/ode/pom.xml new file mode 100644 index 0000000000..c77e90d4e8 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/ode/pom.xml @@ -0,0 +1,71 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours-binaries + 1.0 + ../pom.xml + + scatours-binaries-ode + Apache Tuscany SCA Tours Binaries ODE Database + pom + + + + + + org.apache.ode + ode-dao-jpa-ojpa-derby + zip + 1.1.1 + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + distribution-package + package + + single + + + + ../src/main/assembly/bin-ode.xml + + gnu + .. + ../target + . + true + true + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/openejb/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/openejb/pom.xml new file mode 100644 index 0000000000..eb0b9d83e6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/openejb/pom.xml @@ -0,0 +1,68 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours-binaries + 1.0 + ../pom.xml + + scatours-binaries-openejb + Apache Tuscany SCA Tours Binaries OpenEJB Dependencies + pom + + + + org.apache.tuscany.sca + scatours-util-openejb-runtime + ${pom.version} + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + distribution-package + package + + single + + + + ../src/main/assembly/bin-openejb.xml + + gnu + .. + ../target + . + true + true + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/pom.xml new file mode 100644 index 0000000000..a55d4c8eb5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/pom.xml @@ -0,0 +1,38 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../pom.xml + + scatours-binaries + Apache Tuscany SCA Tours Binaries + pom + + + bundle + jaxws + ode + openejb + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/assembly/bin-jaxws.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/assembly/bin-jaxws.xml new file mode 100644 index 0000000000..96ef5cbd30 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/assembly/bin-jaxws.xml @@ -0,0 +1,35 @@ + + + + + + false + + dir + + + + + ../src/main/components/bin-jaxws.xml + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/assembly/bin-ode.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/assembly/bin-ode.xml new file mode 100644 index 0000000000..5e15619a25 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/assembly/bin-ode.xml @@ -0,0 +1,35 @@ + + + + + + false + + dir + + + + + ../src/main/components/bin-ode.xml + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/assembly/bin-openejb.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/assembly/bin-openejb.xml new file mode 100644 index 0000000000..f546400951 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/assembly/bin-openejb.xml @@ -0,0 +1,35 @@ + + + + + + false + + dir + + + + + ../src/main/components/bin-openejb.xml + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/assembly/bin-selfcontained.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/assembly/bin-selfcontained.xml new file mode 100644 index 0000000000..b482fd4b39 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/assembly/bin-selfcontained.xml @@ -0,0 +1,36 @@ + + + + + + false + + dir + + + + + ../src/main/components/bin-modules.xml + ../src/main/components/bin-selfcontained.xml + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/assembly/bin.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/assembly/bin.xml new file mode 100644 index 0000000000..4dc8bcbebf --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/assembly/bin.xml @@ -0,0 +1,36 @@ + + + + + + false + + dir + + + + + ../src/main/components/bin-modules.xml + ../src/main/components/bin-default.xml + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-default.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-default.xml new file mode 100644 index 0000000000..ed61a17af3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-default.xml @@ -0,0 +1,28 @@ + + + + + + ../src/main/resources/build-defs.xml + util + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-jaxws.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-jaxws.xml new file mode 100644 index 0000000000..f139569c23 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-jaxws.xml @@ -0,0 +1,46 @@ + + + + + + + false + util + ${artifact.artifactId}.${artifact.extension} + false + + org.apache.tuscany.sca:scatours-util-jaxws-runtime + + runtime + + + + + false + jaxws + false + + org.apache.tuscany.sca:scatours-util-jaxws-runtime + + runtime + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-modules.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-modules.xml new file mode 100644 index 0000000000..57eee09c6d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-modules.xml @@ -0,0 +1,135 @@ + + + + + + ../src/main/resources/build-clients.xml + clients + build.xml + + + ../src/main/resources/build-launchers.xml + launchers + build.xml + + + ../src/main/resources/build-services.xml + services + build.xml + + + + + + false + util + ${artifact.artifactId}.${artifact.extension} + false + + org.apache.tuscany.sca:scatours-util-* + + runtime + + + + false + contributions + ${artifact.artifactId}.${artifact.extension} + false + + org.apache.tuscany.sca:scatours-contribution-* + + + org.apache.tuscany.sca:scatours-contribution-creditcard-payment-webapp + org.apache.tuscany.sca:scatours-contribution-currency-jsp + org.apache.tuscany.sca:scatours-contribution-currency-servlet + org.apache.tuscany.sca:scatours-contribution-payment-bpel-process + + runtime + + + + false + contributions/scatours-contribution-payment-bpel-process + true + + org.apache.tuscany.sca:scatours-contribution-payment-bpel-process + + runtime + + + + false + launchers + ${artifact.artifactId}.${artifact.extension} + false + + org.apache.tuscany.sca:scatours-launcher-* + + runtime + + + + false + services + ${artifact.artifactId}.${artifact.extension} + false + + org.apache.tuscany.sca:scatours-service-* + + runtime + + + + false + clients + ${artifact.artifactId}.${artifact.extension} + false + + org.apache.tuscany.sca:scatours-client-* + + runtime + + + + false + webapps + ${artifact.artifactId}.${artifact.extension} + false + + org.apache.tuscany.sca:scatours-contribution-creditcard-payment-webapp + org.apache.tuscany.sca:scatours-contribution-currency-jsp + org.apache.tuscany.sca:scatours-contribution-currency-servlet + + runtime + + + + false + domainconfig + true + + org.apache.tuscany.sca:scatours-domainconfig-* + + runtime + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-ode.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-ode.xml new file mode 100644 index 0000000000..a853a6bdce --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-ode.xml @@ -0,0 +1,31 @@ + + + + + + + false + ode + true + runtime + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-openejb.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-openejb.xml new file mode 100644 index 0000000000..596ee0b55a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-openejb.xml @@ -0,0 +1,46 @@ + + + + + + + false + util + ${artifact.artifactId}.${artifact.extension} + false + + org.apache.tuscany.sca:scatours-util-openejb-runtime + + runtime + + + + + false + openejb + false + + org.apache.tuscany.sca:scatours-util-openejb-runtime + + runtime + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-selfcontained.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-selfcontained.xml new file mode 100644 index 0000000000..90db09cfbe --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/components/bin-selfcontained.xml @@ -0,0 +1,42 @@ + + + + + + ../src/main/resources/build-defs-selfcontained.xml + util + build-defs.xml + + + + + + + false + lib + false + + org.apache.tuscany.sca:scatours* + + runtime + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/resources/build-clients.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/resources/build-clients.xml new file mode 100644 index 0000000000..a118203c8c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/resources/build-clients.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/resources/build-defs-selfcontained.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/resources/build-defs-selfcontained.xml new file mode 100644 index 0000000000..d5b1951040 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/resources/build-defs-selfcontained.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/resources/build-defs.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/resources/build-defs.xml new file mode 100644 index 0000000000..1be4bb9b45 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/resources/build-defs.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/resources/build-launchers.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/resources/build-launchers.xml new file mode 100644 index 0000000000..4a1ffade39 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/resources/build-launchers.xml @@ -0,0 +1,337 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/resources/build-services.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/resources/build-services.xml new file mode 100644 index 0000000000..b42d081946 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/binaries/src/main/resources/build-services.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/build.xml new file mode 100644 index 0000000000..e5ef780eef --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/build.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/clients/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/build.xml new file mode 100644 index 0000000000..78e305c3cd --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/build.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-corba/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-corba/build.xml new file mode 100644 index 0000000000..eebbe90d4d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-corba/build.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-corba/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-corba/pom.xml new file mode 100644 index 0000000000..ad7dbc58d5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-corba/pom.xml @@ -0,0 +1,76 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-client-currency-converter-corba + Apache Tuscany SCA Tours Currency Converter CORBA Client + + + ${artifactId} + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ${scatours.selfContained} + ../lib/ + scatours.CurrencyConverterCORBAClient + + + + + + org.codehaus.mojo + idlj-maven-plugin + 1.1 + + + + generate + + + + + idlj + + + + currency-converter.idl + + true + false + + + ${basedir}/src/main/resources + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-corba/src/main/java/scatours/CurrencyConverterCORBAClient.java b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-corba/src/main/java/scatours/CurrencyConverterCORBAClient.java new file mode 100644 index 0000000000..7d799e459b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-corba/src/main/java/scatours/CurrencyConverterCORBAClient.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 scatours; + +import org.omg.CORBA.ORB; +import org.omg.CORBA.Object; + +import com.tuscanyscatours.currencyconverter.CurrencyConverter; +import com.tuscanyscatours.currencyconverter.CurrencyConverterHelper; + +public class CurrencyConverterCORBAClient { + + public static void main(String[] args) throws Exception { + + String[] orbArgs = {"-ORBInitialPort", "5080"}; + ORB orb = ORB.init(orbArgs, null); + + String ior = "corbaname::localhost:5080#CurrencyConverterCORBAService"; + Object obj = orb.string_to_object(ior); + CurrencyConverter converter = CurrencyConverterHelper.narrow(obj); + + System.out.println("USD -> GBP = " + converter.getExchangeRate("USD", "GBP")); + System.out.println("100 USD = " + converter.convert("USD", "GBP", 100.0) + "GBP"); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-corba/src/main/resources/currency-converter.idl b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-corba/src/main/resources/currency-converter.idl new file mode 100644 index 0000000000..1ff24291f5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-corba/src/main/resources/currency-converter.idl @@ -0,0 +1,29 @@ +/* + * 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. + */ + +module com { + module tuscanyscatours { + module currencyconverter { + interface CurrencyConverter { + double getExchangeRate(in string fromCurrencyCode, in string toCurrencyCode); + double convert(in string fromCurrencyCode, in string toCurrencyCode, in double amount); + }; + }; + }; +}; diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-jms/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-jms/build.xml new file mode 100644 index 0000000000..1e3e20e4e6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-jms/build.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-jms/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-jms/pom.xml new file mode 100644 index 0000000000..7f6ac7856e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-jms/pom.xml @@ -0,0 +1,97 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-client-currency-converter-jms + Apache Tuscany SCA Tours Currency Converter JMS Client + + + + org.apache.activemq + activemq-all + 5.2.0 + + + org.apache.activemq + activemq-web-demo + + + + + + org.apache.ws.commons.axiom + axiom-api + 1.2.7 + + + xerces + xercesImpl + + + stax + stax-api + + + xml-apis + xml-apis + + + + + + org.apache.ws.commons.axiom + axiom-impl + 1.2.7 + runtime + + + stax + stax-api + + + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ${scatours.selfContained} + ../lib/ + scatours.CurrencyConverterJMSClient + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-jms/src/main/java/scatours/CurrencyConverterJMSClient.java b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-jms/src/main/java/scatours/CurrencyConverterJMSClient.java new file mode 100644 index 0000000000..0bea38e07f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-jms/src/main/java/scatours/CurrencyConverterJMSClient.java @@ -0,0 +1,103 @@ +/* + * 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.io.ByteArrayInputStream; + +import javax.jms.Connection; +import javax.jms.Destination; +import javax.jms.JMSException; +import javax.jms.MessageConsumer; +import javax.jms.MessageProducer; +import javax.jms.Session; +import javax.jms.TextMessage; +import javax.xml.stream.XMLStreamException; + +import org.apache.activemq.ActiveMQConnectionFactory; +import org.apache.axiom.om.OMAbstractFactory; +import org.apache.axiom.om.OMElement; +import org.apache.axiom.om.OMFactory; +import org.apache.axiom.om.OMText; +import org.apache.axiom.om.impl.builder.StAXOMBuilder; + +public class CurrencyConverterJMSClient { + + private static Connection activeMQConnection; + private static Session activeMQSession; + private static Destination requestDestination; + private static MessageProducer activeMQProducer; + private static Destination responseDestination; + private static MessageConsumer consumer; + private static OMFactory omFactory; + + public static void main(String[] args) throws JMSException, XMLStreamException { + startActiveMQSession(); + + OMElement request = omFactory.createOMElement("convert", "http://goodvaluetrips.com/", "ns2"); + request.addChild(createArg(0, "USD")); + request.addChild(createArg(1, "GBP")); + request.addChild(createArg(2, "100.0")); + + TextMessage message = activeMQSession.createTextMessage("convert"); + message.setStringProperty("scaOperationName", "convert"); + message.setJMSReplyTo(responseDestination); + message.setText(request.toString()); + activeMQProducer.send(message); + + TextMessage response = (TextMessage)consumer.receive(); + StAXOMBuilder builder = new StAXOMBuilder(new ByteArrayInputStream(response.getText().getBytes())); + OMText returnElement = (OMText)builder.getDocumentElement().getFirstOMChild(); + String returnValue = returnElement.getText(); + System.out.println("100 USD = " + returnValue + "GBP"); + + stopActiveMQSession(); + } + + private static void startActiveMQSession() throws JMSException { + ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61619"); + + activeMQConnection = connectionFactory.createConnection(); + activeMQConnection.start(); + + activeMQSession = activeMQConnection.createSession(false, Session.AUTO_ACKNOWLEDGE); + + requestDestination = activeMQSession.createQueue("RequestQueue"); + activeMQProducer = activeMQSession.createProducer(requestDestination); + + responseDestination = activeMQSession.createQueue("ResponseQueue"); + consumer = activeMQSession.createConsumer(responseDestination); + + omFactory = OMAbstractFactory.getOMFactory(); + } + + private static void stopActiveMQSession() throws JMSException { + consumer.close(); + activeMQProducer.close(); + activeMQSession.close(); + activeMQConnection.close(); + } + + private static OMElement createArg(int argNumber, String value) { + OMFactory omFactory = OMAbstractFactory.getOMFactory(); + OMElement arg = omFactory.createOMElement("arg" + argNumber, null); + OMText senderOM = omFactory.createOMText(value); + arg.addChild(senderOM); + return arg; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-rmi/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-rmi/build.xml new file mode 100644 index 0000000000..33a2db7951 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-rmi/build.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-rmi/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-rmi/pom.xml new file mode 100644 index 0000000000..b29c0f1845 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-rmi/pom.xml @@ -0,0 +1,50 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-client-currency-converter-rmi + Apache Tuscany SCA Tours Currency Converter RMI Client + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ${scatours.selfContained} + ../lib/ + scatours.CurrencyConverterRMIClient + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-rmi/src/main/java/com/tuscanyscatours/currencyconverter/CurrencyConverter.java b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-rmi/src/main/java/com/tuscanyscatours/currencyconverter/CurrencyConverter.java new file mode 100644 index 0000000000..e12a95c964 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-rmi/src/main/java/com/tuscanyscatours/currencyconverter/CurrencyConverter.java @@ -0,0 +1,30 @@ +/* + * 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 com.tuscanyscatours.currencyconverter; + +/** + * The CurrencyConverter service interface + */ +public interface CurrencyConverter { + + double getExchangeRate(String fromCurrencyCode, String toCurrencyCode); + + double convert(String fromCurrencyCode, String toCurrencyCode, double amount); + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-rmi/src/main/java/scatours/CurrencyConverterRMIClient.java b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-rmi/src/main/java/scatours/CurrencyConverterRMIClient.java new file mode 100644 index 0000000000..32e4fccfce --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-rmi/src/main/java/scatours/CurrencyConverterRMIClient.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 scatours; + +import java.rmi.registry.LocateRegistry; +import java.rmi.registry.Registry; + +import com.tuscanyscatours.currencyconverter.CurrencyConverter; + +public class CurrencyConverterRMIClient { + + public static void main(String[] args) throws Exception { + Registry registry = LocateRegistry.getRegistry("localhost", 8099); + String name = "CurrencyConverterRMI"; + CurrencyConverter converter = (CurrencyConverter)registry.lookup(name); + + System.out.println("USD -> GBP = " + converter.getExchangeRate("USD", "GBP")); + System.out.println("100 USD = " + converter.convert("USD", "GBP", 100.0) + "GBP"); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-ws-jaxws/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-ws-jaxws/build.xml new file mode 100644 index 0000000000..a1181373c9 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-ws-jaxws/build.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-ws-jaxws/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-ws-jaxws/pom.xml new file mode 100644 index 0000000000..aab62fabe7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-ws-jaxws/pom.xml @@ -0,0 +1,92 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-client-currency-converter-ws-jaxws + Apache Tuscany SCA Tours Currency Converter Web Service JAX-WS Client + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + + + java.net2 + java.net Maven 2.x Repository + http://download.java.net/maven/2 + + false + + + + + + ${artifactId} + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-jaxws-runtime.jar + scatours.CurrencyConverterWSClient + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + + wsimport + + + ${basedir}/src/main/resources/wsdl + scatours.currencyconverter.client + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-ws-jaxws/src/main/java/scatours/CurrencyConverterWSClient.java b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-ws-jaxws/src/main/java/scatours/CurrencyConverterWSClient.java new file mode 100644 index 0000000000..dbaa7c2124 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-ws-jaxws/src/main/java/scatours/CurrencyConverterWSClient.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 scatours; + +import scatours.currencyconverter.client.CurrencyConverter; +import scatours.currencyconverter.client.CurrencyConverterService; + +public class CurrencyConverterWSClient { + + public static void main(String[] args) throws Exception { + CurrencyConverterService service = new CurrencyConverterService(); + CurrencyConverter converter = service.getPort(CurrencyConverter.class); + + System.out.println("USD -> GBP = " + converter.getExchangeRate("USD", "GBP")); + System.out.println("100 USD = " + converter.convert("USD", "GBP", 100.0) + "GBP"); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-ws-jaxws/src/main/resources/wsdl/CurrencyConverter.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-ws-jaxws/src/main/resources/wsdl/CurrencyConverter.wsdl new file mode 100644 index 0000000000..055431bbf2 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/currency-converter-ws-jaxws/src/main/resources/wsdl/CurrencyConverter.wsdl @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/clients/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/pom.xml new file mode 100644 index 0000000000..84e8c77665 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/clients/pom.xml @@ -0,0 +1,39 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../pom.xml + + scatours-clients + pom + Apache Tuscany SCA Tours non-SCA Clients + + + currency-converter-corba + currency-converter-jms + currency-converter-rmi + currency-converter-ws-jaxws + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/build.xml new file mode 100644 index 0000000000..2f0f6b12a5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/pom.xml new file mode 100644 index 0000000000..8a214d1057 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/pom.xml @@ -0,0 +1,68 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-blog-feed + Apache Tuscany SCA Tours Blog Feed Contribution + + + + org.apache.tuscany.sca + tuscany-data-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-binding-atom-abdera + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-binding-rss-rome + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/java/com/tuscanyscatours/blog/BlogPost.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/java/com/tuscanyscatours/blog/BlogPost.java new file mode 100644 index 0000000000..f93fe59b9d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/java/com/tuscanyscatours/blog/BlogPost.java @@ -0,0 +1,68 @@ +/* + * 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 com.tuscanyscatours.blog; + +import java.util.Date; + +/** + * Bean for blog posts. + */ +public class BlogPost { + + private final String author; + private final String title; + private final String content; + private final Date updated; + private final String link; + private final String related; + + public BlogPost(String author, String title, String content, Date updated, String link, String related) { + this.author = author; + this.title = title; + this.content = content; + this.updated = updated; + this.link = link; + this.related = related; + } + + public String getAuthor() { + return author; + } + + public String getTitle() { + return title; + } + + public String getContent() { + return content; + } + + public Date getUpdated() { + return updated; + } + + public String getLink() { + return link; + } + + public String getRelated() { + return related; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/java/com/tuscanyscatours/blog/feed/impl/AtomBlogFeedImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/java/com/tuscanyscatours/blog/feed/impl/AtomBlogFeedImpl.java new file mode 100644 index 0000000000..b7a392f927 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/java/com/tuscanyscatours/blog/feed/impl/AtomBlogFeedImpl.java @@ -0,0 +1,124 @@ +/* + * 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 com.tuscanyscatours.blog.feed.impl; + +import java.util.List; + +import org.apache.abdera.Abdera; +import org.apache.abdera.factory.Factory; +import org.apache.abdera.model.Entry; +import org.apache.abdera.model.Feed; +import org.apache.tuscany.sca.binding.atom.collection.NotFoundException; + +import com.tuscanyscatours.blog.BlogPost; + +/** + * An Atom feed that implements the org.apache.tuscany.sca.binding.atom.collection.Collection + * interface and uses the Atom APIs to construct the Atom feed. + */ +public class AtomBlogFeedImpl extends BaseBlogFeedImpl implements + org.apache.tuscany.sca.binding.atom.collection.Collection { + + /** + * Gets an Atom feed containing all the blog posts. + * + * @return An Atom feed containing all the blog posts. + */ + public Feed getFeed() { + // Create SCA Tours blog Atom feed + final Factory factory = Abdera.getNewFactory(); + final Feed feed = factory.newFeed(); + feed.setTitle(FEED_TITLE); + feed.setSubtitle(FEED_DESCRIPTION); + feed.addAuthor(FEED_AUTHOR); + + // Get all blog posts and convert to Atom entries + final List blogEntries = getAllBlogPosts(); + for (BlogPost blogEntry : blogEntries) { + final Entry entry = factory.newEntry(); + entry.setId(nextBlogID()); + entry.addAuthor(blogEntry.getAuthor()); + entry.setTitle(blogEntry.getTitle()); + entry.setContentAsHtml(blogEntry.getContent()); + entry.setUpdated(blogEntry.getUpdated()); + entry.addLink(blogEntry.getLink()); + feed.addEntry(entry); + } + + return feed; + } + + /** + * Query the feed. + * + * @param query The query + * @return Always returns null as method not implemented + */ + public Feed query(String query) { + // Not implemented + return null; + } + + /** + * Posts a new entry to the blog. + * + * @param entry The new entry + * @return Always returns null as method not implemented + */ + public Entry post(Entry entry) { + // Not implemented + return null; + } + + /** + * Gets the specified entry from the blog. + * + * @param id ID of the entry to get + * @return Not used + * @throws NotFoundException Always thrown as method not implemented + */ + public Entry get(String id) throws NotFoundException { + // Not implemented + throw new NotFoundException("You are not allowed to update entries"); + } + + /** + * Updates the specified entry on the blog. + * + * @param id ID of the entry to update + * @param entry The new entry + * @throws NotFoundException Always thrown as method not implemented + */ + public void put(String id, Entry entry) throws NotFoundException { + // Not implemented + throw new NotFoundException("You are not allowed to update entries"); + } + + /** + * Deletes the specified entry from the blog. + * + * @param id ID of the entry to delete + * @throws NotFoundException Always thrown as method not implemented + */ + public void delete(String id) throws NotFoundException { + // Not implemented + throw new NotFoundException("You are not allowed to delete entries"); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/java/com/tuscanyscatours/blog/feed/impl/BaseBlogFeedImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/java/com/tuscanyscatours/blog/feed/impl/BaseBlogFeedImpl.java new file mode 100644 index 0000000000..f132d340ea --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/java/com/tuscanyscatours/blog/feed/impl/BaseBlogFeedImpl.java @@ -0,0 +1,88 @@ +/* + * 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 com.tuscanyscatours.blog.feed.impl; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; + +import com.tuscanyscatours.blog.BlogPost; + +/** + * Base class for all blog feeds that provides the common methods + * that are shared by all the blog feed implementations. + */ +public abstract class BaseBlogFeedImpl { + + /** + * Title of the blog.feed. + */ + protected static final String FEED_TITLE = "Tuscany SCA Tours Blog Feed"; + + /** + * Description of the blog feed. + */ + protected static final String FEED_DESCRIPTION = "Feed contianing the latest blog posts from Tuscany SCA Tours"; + + /** + * Author of the blog feed. + */ + protected static final String FEED_AUTHOR = "SCA Tours CEO"; + + /** + * Used to generate unique IDs for the blog entries. + */ + protected static final AtomicInteger ID_GEN = new AtomicInteger(); + + /** + * Generates the next blog entry ID. + * + * @return Next blog entry ID + */ + protected String nextBlogID() { + return Integer.toString(ID_GEN.incrementAndGet()); + } + + /** + * Retrieves a list of all blog posts. + * + * @return A list of all blog posts. + */ + public List getAllBlogPosts() { + // Note: To keep things simple, we will just hard code a sample post. + // A proper implementation would load all blog posts from some resource + // such as files or a database. + List blogEntries = new ArrayList(); + + // Create a sample entry + final BlogPost samplePost = + new BlogPost( + FEED_AUTHOR, + "Apache Tuscany in Action book features SCA Tours", + "We are famous as SCA Tours has been featured in the Apache Tuscany in Action book published by Manning", + new Date(), "http://www.manning.com/laws/", null); + + // Add sample post to the list of posts + blogEntries.add(samplePost); + + return blogEntries; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/java/com/tuscanyscatours/blog/feed/impl/GenericBlogFeedImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/java/com/tuscanyscatours/blog/feed/impl/GenericBlogFeedImpl.java new file mode 100644 index 0000000000..c427b658a4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/java/com/tuscanyscatours/blog/feed/impl/GenericBlogFeedImpl.java @@ -0,0 +1,70 @@ +/* + * 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 com.tuscanyscatours.blog.feed.impl; + +import java.util.List; + +import org.apache.tuscany.sca.data.collection.Entry; +import org.apache.tuscany.sca.data.collection.Item; + +import com.tuscanyscatours.blog.BlogPost; + +/** + * Implementation of the blog feed that uses the Tuscany Data API so + * that it is independent of any Feed APIs such as Atom and RSS. + */ +public class GenericBlogFeedImpl extends BaseBlogFeedImpl { + + /** + * Implementation of the getAll() method from the Tuscany API + * that will return all of the blog posts as generic Tuscany + * feed items. + * + * @return All blog entries + */ + public Entry[] getAll() { + final List posts = getAllBlogPosts(); + + final Entry[] entries = new Entry[posts.size()]; + int i = 0; + for (BlogPost post : posts) { + entries[i++] = convertBlogPostToFeedItem(post); + } + + return entries; + } + + /** + * Converts a blog post to a Tuscany API feed item. + * + * @param post The blog post to convert + * @return The blog post as a Tuscany API feed item + */ + private Entry convertBlogPostToFeedItem(BlogPost post) { + // Convert Blog entry into an Item + final Item item = + new Item(post.getTitle(), post.getContent(), post.getLink(), post.getRelated(), post.getUpdated()); + + // Add item to entry + final Entry entry = new Entry(nextBlogID(), item); + + return entry; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/java/com/tuscanyscatours/blog/feed/impl/RSSBlogFeedImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/java/com/tuscanyscatours/blog/feed/impl/RSSBlogFeedImpl.java new file mode 100644 index 0000000000..efccffef67 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/java/com/tuscanyscatours/blog/feed/impl/RSSBlogFeedImpl.java @@ -0,0 +1,94 @@ +/* + * 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 com.tuscanyscatours.blog.feed.impl; + +import java.util.List; + +import org.apache.tuscany.sca.binding.rss.collection.NotFoundException; + +import com.sun.syndication.feed.synd.SyndContent; +import com.sun.syndication.feed.synd.SyndContentImpl; +import com.sun.syndication.feed.synd.SyndEntry; +import com.sun.syndication.feed.synd.SyndEntryImpl; +import com.sun.syndication.feed.synd.SyndFeed; +import com.sun.syndication.feed.synd.SyndFeedImpl; +import com.tuscanyscatours.blog.BlogPost; + +/** + * An RSS feed that implements the org.apache.tuscany.sca.binding.rss.collection.Collection + * interface and uses the RSS APIs to construct the RSS feed. + */ +public class RSSBlogFeedImpl extends BaseBlogFeedImpl implements + org.apache.tuscany.sca.binding.rss.collection.Collection { + + /** + * Gets an RSS feed containing all the blog posts. + * + * @return An RSS feed containing all the blog posts. + */ + public SyndFeed getFeed() { + // Create SCA Tours blog RSS feed + SyndFeed feed = new SyndFeedImpl(); + feed.setTitle(FEED_TITLE); + feed.setDescription(FEED_DESCRIPTION); + feed.setAuthor(FEED_AUTHOR); + + // Get all blog posts and convert to RSS entries + final List blogEntries = getAllBlogPosts(); + for (BlogPost blogEntry : blogEntries) { + SyndEntry entry = new SyndEntryImpl(); + entry.setUri(nextBlogID()); + entry.setAuthor(blogEntry.getAuthor()); + entry.setTitle(blogEntry.getTitle()); + + SyndContent content = new SyndContentImpl(); + content.setType("text"); + content.setValue(blogEntry.getContent()); + + entry.setPublishedDate(blogEntry.getUpdated()); + entry.setLink(blogEntry.getLink()); + + feed.getEntries().add(entry); + } + + return feed; + } + + /** + * Query the feed. + * + * @param query The query + * @return Always returns null as method not implemented + */ + public SyndFeed query(String query) { + // Not implemented + return null; + } + + public SyndEntry get(String id) throws NotFoundException { + // Not implemented + return null; + } + + public List getAll() throws NotFoundException { + // Not implemented + return null; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..b4152d6e3f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,21 @@ + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/resources/blog-feed.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/resources/blog-feed.composite new file mode 100644 index 0000000000..751fd33cd2 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/blog-feed/src/main/resources/blog-feed.composite @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/build.xml new file mode 100644 index 0000000000..b2fcc9d3b5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/build.xml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/build.xml new file mode 100644 index 0000000000..9ea7438516 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/pom.xml new file mode 100644 index 0000000000..0764dffed3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/pom.xml @@ -0,0 +1,125 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-buildingblocks-client + Apache Tuscany SCA Tours Building Blocks Client Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + scatours-contribution-buildingblocks + ${pom.version} + provided + + + + org.apache.tuscany.sca + scatours-contribution-introducing-trips + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jms-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-implementation-node-runtime + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-host-jms-asf + ${tuscany.version} + test + + + + org.apache.activemq + activemq-all + 5.2.0 + + + org.apache.activemq + activemq-web-demo + + + test + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/java/scatours/Bookings.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/java/scatours/Bookings.java new file mode 100644 index 0000000000..e5e994b73c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/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/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/java/scatours/Checkout.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/java/scatours/Checkout.java new file mode 100644 index 0000000000..519b7779fa --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/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/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/java/scatours/impl/ApplClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/java/scatours/impl/ApplClientImpl.java new file mode 100644 index 0000000000..278673c67d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/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/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/java/scatours/impl/ToursClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/java/scatours/impl/ToursClientImpl.java new file mode 100644 index 0000000000..16934872b9 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/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/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/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/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,26 @@ + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/resources/tours-appl-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/resources/tours-appl-client.composite new file mode 100644 index 0000000000..b9f9d59f43 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/resources/tours-appl-client.composite @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/resources/tours-impl-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/resources/tours-impl-client.composite new file mode 100644 index 0000000000..f8f0b3d4d1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/resources/tours-impl-client.composite @@ -0,0 +1,32 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/resources/tours-impl-include-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/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/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/main/resources/tours-impl-include-client.composite @@ -0,0 +1,32 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/test/java/scatours/BuildingBlocksApplTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/test/java/scatours/BuildingBlocksApplTestCase.java new file mode 100644 index 0000000000..2cf08ec420 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/test/java/scatours/BuildingBlocksApplTestCase.java @@ -0,0 +1,77 @@ +/* + * 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.apache.activemq.broker.BrokerService; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the Building Blocks Composite Application scenario + */ +public class BuildingBlocksApplTestCase { + + private BrokerService jmsBroker; + private SCANode node1, node2; + + @Before + public void startServer() throws Exception { + jmsBroker = new BrokerService(); + jmsBroker.setPersistent(false); + jmsBroker.setUseJmx(false); + jmsBroker.addConnector("tcp://localhost:61619"); + + node1 = SCANodeFactory.newInstance().createSCANode("tours-appl.composite", + new SCAContribution("introducing-trips", "../introducing-trips/target/classes"), + new SCAContribution("buildingblocks", "../buildingblocks/target/classes")); + + node2 = SCANodeFactory.newInstance().createSCANode("tours-appl-client.composite", + new SCAContribution("buildingblocks-client", "./target/classes")); + + jmsBroker.start(); + node1.start(); + node2.start(); + } + + @Test + public void testAppl() { + Runnable client = ((SCAClient)node2).getService(Runnable.class, "ApplClient/Runnable"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node2 != null) { + node2.stop(); + } + if (node1 != null) { + node1.stop(); + } + if (jmsBroker != null) { + jmsBroker.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/test/java/scatours/BuildingBlocksImplIncludeTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/test/java/scatours/BuildingBlocksImplIncludeTestCase.java new file mode 100644 index 0000000000..ad48db5616 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/test/java/scatours/BuildingBlocksImplIncludeTestCase.java @@ -0,0 +1,59 @@ +/* + * 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.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the Building Blocks Composite Implementation Include scenario + */ +public class BuildingBlocksImplIncludeTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("tours-impl-include-client.composite", + new SCAContribution("introducing-trips", "../introducing-trips/target/classes"), + new SCAContribution("buildingblocks", "../buildingblocks/target/classes"), + new SCAContribution("buildingblocks-client", "./target/classes")); + + node.start(); + } + + @Test + public void testImplInclude() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "ToursClient/Runnable"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/test/java/scatours/BuildingBlocksImplTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/test/java/scatours/BuildingBlocksImplTestCase.java new file mode 100644 index 0000000000..c4cffa3e02 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/test/java/scatours/BuildingBlocksImplTestCase.java @@ -0,0 +1,58 @@ +/* + * 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.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the Building Blocks Composite Implementation scenario + */ +public class BuildingBlocksImplTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("tours-impl-client.composite", + new SCAContribution("buildingblocks", "../buildingblocks/target/classes"), + new SCAContribution("buildingblocks-client", "./target/classes")); + + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "ToursClient/Runnable"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/test/resources/jndi.properties b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/test/resources/jndi.properties new file mode 100644 index 0000000000..88270fd1e0 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks-client/src/test/resources/jndi.properties @@ -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. +## --------------------------------------------------------------------------- + +# START SNIPPET: jndi + +java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory + +# use the following property to configure the default connector +java.naming.provider.url = vm://localhost?broker.persistent=false + +# use the following property to specify the JNDI name the connection factory +# should appear as. +#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry +connectionFactoryNames = ConnectionFactory + +# register some queues in JNDI using the form +# queue.[jndiName] = [physicalName] +queue.BookTrip = BookTripRequestQueue +queue.Checkout = CheckoutRequestQueue + +# register some topics in JNDI using the form +# topic.[jndiName] = [physicalName] +#topic.MyTopic = example.MyTopic + +# END SNIPPET: jndi diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/build.xml new file mode 100644 index 0000000000..1e23144229 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/pom.xml new file mode 100644 index 0000000000..c19d0cca0a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/pom.xml @@ -0,0 +1,91 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-buildingblocks + Apache Tuscany SCA Tours Building Blocks Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jms-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + scatours-contribution-introducing-trips + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-implementation-node-runtime + ${tuscany.version} + test + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/budgettours/Tours.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/budgettours/Tours.java new file mode 100644 index 0000000000..38ddc1f099 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/budgettours/Tours.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 com.budgettours; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Tours { + String checkAvailability(String trip, int people); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/budgettours/impl/TourProviderImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/budgettours/impl/TourProviderImpl.java new file mode 100644 index 0000000000..8e48625f0c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/budgettours/impl/TourProviderImpl.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 com.budgettours.impl; + +import com.budgettours.Tours; + +public class TourProviderImpl implements Tours { + public String checkAvailability(String trip, int people) { + // call non-SCA code to reserve trip and return booking code + return "5Q87X"; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/goodvaluetrips/Trips.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/goodvaluetrips/Trips.java new file mode 100644 index 0000000000..365a210368 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/goodvaluetrips/Trips.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 com.goodvaluetrips; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Trips { + String checkAvailability(String trip, int people); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/tuscanyscatours/Bookings.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/tuscanyscatours/Bookings.java new file mode 100644 index 0000000000..9d54d46bb6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/tuscanyscatours/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 com.tuscanyscatours; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Bookings { + String newBooking(String trip, int people); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/tuscanyscatours/Checkout.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/tuscanyscatours/Checkout.java new file mode 100644 index 0000000000..29c84d2bc0 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/tuscanyscatours/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 com.tuscanyscatours; + +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/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/tuscanyscatours/Updates.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/tuscanyscatours/Updates.java new file mode 100644 index 0000000000..e33b0399cb --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/tuscanyscatours/Updates.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 com.tuscanyscatours; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Updates { + void addTrip(String resCode); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/tuscanyscatours/impl/ShoppingCartImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/tuscanyscatours/impl/ShoppingCartImpl.java new file mode 100644 index 0000000000..629ea7b5ec --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/tuscanyscatours/impl/ShoppingCartImpl.java @@ -0,0 +1,49 @@ +/* + * 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 com.tuscanyscatours.impl; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import com.tuscanyscatours.Checkout; +import com.tuscanyscatours.Updates; + +public class ShoppingCartImpl implements Checkout, Updates { + private static List bookedTrips = new ArrayList(); + + protected String currency = "USD"; + + public void makePayment(BigDecimal amount, String cardInfo) { + System.out.print("Charged " + currency + " " + amount + + " to card " + + cardInfo + + " for " + + (bookedTrips.size() > 1 ? "trips" : "trip")); + for (String trip : bookedTrips) { + System.out.print(" " + trip); + } + System.out.println(); + bookedTrips.clear(); + } + + public void addTrip(String resCode) { + bookedTrips.add(resCode); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/tuscanyscatours/impl/TripBookingImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/tuscanyscatours/impl/TripBookingImpl.java new file mode 100644 index 0000000000..f2884f87c5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/com/tuscanyscatours/impl/TripBookingImpl.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 com.tuscanyscatours.impl; + +import org.osoa.sca.annotations.Reference; + +import com.goodvaluetrips.Trips; +import com.tuscanyscatours.Bookings; +import com.tuscanyscatours.Updates; + +public class TripBookingImpl implements Bookings { + @Reference + protected Trips mytrips; + + @Reference + protected Updates cart; + + public String newBooking(String trip, int people) { + String resCode = mytrips.checkAvailability(trip, people); + cart.addTrip(resCode); + return "GV" + resCode; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/scatours/impl/TripProviderImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/scatours/impl/TripProviderImpl.java new file mode 100644 index 0000000000..a95f01c519 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/java/scatours/impl/TripProviderImpl.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.impl; + +import com.goodvaluetrips.Trips; + +public class TripProviderImpl implements Trips { + public String checkAvailability(String trip, int people) { + // scaffolded test code to return an arbitrary booking code + return "7S09Z"; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..028c41e415 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,27 @@ + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/resources/tours-appl.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/resources/tours-appl.composite new file mode 100644 index 0000000000..8733c79c5d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/resources/tours-appl.composite @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/resources/tours-impl-include.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/resources/tours-impl-include.composite new file mode 100644 index 0000000000..4080523309 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/resources/tours-impl-include.composite @@ -0,0 +1,33 @@ + + + + + + + + GBP + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/resources/tours-impl.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/resources/tours-impl.composite new file mode 100644 index 0000000000..1d82858f22 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/resources/tours-impl.composite @@ -0,0 +1,34 @@ + + + + + + + + GBP + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/resources/tours.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/resources/tours.composite new file mode 100644 index 0000000000..b66d2344cd --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/main/resources/tours.composite @@ -0,0 +1,43 @@ + + + + + + + + USD + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/test/java/scatours/BuildingBlocksImplIncludeTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/test/java/scatours/BuildingBlocksImplIncludeTestCase.java new file mode 100644 index 0000000000..ccdd2a73bd --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/test/java/scatours/BuildingBlocksImplIncludeTestCase.java @@ -0,0 +1,66 @@ +/* + * 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 com.tuscanyscatours.Bookings; +import com.tuscanyscatours.Checkout; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the Building Blocks Composite Implementation Include scenario + */ +public class BuildingBlocksImplIncludeTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("tours-impl-include.composite", + new SCAContribution("introducing-trips", "../introducing-trips/target/classes"), + new SCAContribution("buildingblocks", "./target/classes")); + node.start(); + } + + @Test + public void testImplInclude() { + Bookings bookings = ((SCAClient)node).getService(Bookings.class, "MyTours/BookTrip"); + String bookingCode = bookings.newBooking("FS1APR4", 1); + System.out.println("Booking code is " + bookingCode); + + Checkout checkout = ((SCAClient)node).getService(Checkout.class, "MyTours/Checkout"); + checkout.makePayment(new BigDecimal("1995.00"), "1234567801234567 11/10"); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/test/java/scatours/BuildingBlocksImplTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/test/java/scatours/BuildingBlocksImplTestCase.java new file mode 100644 index 0000000000..35271bc5aa --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/buildingblocks/src/test/java/scatours/BuildingBlocksImplTestCase.java @@ -0,0 +1,65 @@ +/* + * 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 com.tuscanyscatours.Bookings; +import com.tuscanyscatours.Checkout; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the Building Blocks Composite Implementation scenario + */ +public class BuildingBlocksImplTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("tours-impl.composite", + new SCAContribution("buildingblocks", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Bookings bookings = ((SCAClient)node).getService(Bookings.class, "MyTours/BookTrip"); + String bookingCode = bookings.newBooking("FS1APR4", 1); + System.out.println("Booking code is " + bookingCode); + + Checkout checkout = ((SCAClient)node).getService(Checkout.class, "MyTours/Checkout"); + checkout.makePayment(new BigDecimal("1995.00"), "1234567843218765 10/10"); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/build.xml new file mode 100644 index 0000000000..ae6a47dafb --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/pom.xml new file mode 100644 index 0000000000..61a0fc42e7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/pom.xml @@ -0,0 +1,64 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-calendar + Apache Tuscany SCA Tours Calendar Contribution + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-implementation-node-runtime + ${tuscany.version} + test + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/main/java/com/tuscanyscatours/calendar/Calendar.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/main/java/com/tuscanyscatours/calendar/Calendar.java new file mode 100644 index 0000000000..daa5127511 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/main/java/com/tuscanyscatours/calendar/Calendar.java @@ -0,0 +1,25 @@ +/* + * 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 com.tuscanyscatours.calendar; + +public interface Calendar { + + String getEndDate(String startDate, int duration); + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/main/java/com/tuscanyscatours/calendar/impl/CalendarImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/main/java/com/tuscanyscatours/calendar/impl/CalendarImpl.java new file mode 100644 index 0000000000..4e6e7b161b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/main/java/com/tuscanyscatours/calendar/impl/CalendarImpl.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 com.tuscanyscatours.calendar.impl; + +import java.text.DateFormat; +import java.util.Date; + +import com.tuscanyscatours.calendar.Calendar; + +/** + * An implementation of the Calendar service + */ +public class CalendarImpl implements Calendar { + + public String getEndDate(String startDate, int duration) { + String returnDate = "Invalid Date"; + + try { + Date date = DateFormat.getInstance().parse(startDate); + java.util.Calendar calendar = java.util.Calendar.getInstance(); + calendar.setTime(date); + calendar.add(java.util.Calendar.DATE, duration); + returnDate = DateFormat.getInstance().format(calendar.getTime()); + } catch (Exception ex) { + // do nothing + System.out.println(ex.toString()); + } + + return returnDate; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..86f28d7423 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/test/java/scatours/calendar/CalendarTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/test/java/scatours/calendar/CalendarTestCase.java new file mode 100644 index 0000000000..8e0f003c4b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/test/java/scatours/calendar/CalendarTestCase.java @@ -0,0 +1,57 @@ +/* + * 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.calendar; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import com.tuscanyscatours.calendar.Calendar; + +/** + * This shows how to test the Calculator service component. + */ +public class CalendarTestCase { + + private SCANode node; + + @Before + public void startNode() throws Exception { + node = + SCANodeFactory.newInstance().createSCANode("calendar.composite", + new SCAContribution("calendar", "./target/classes"), + new SCAContribution("calendar-test", "./target/test-classes")); + node.start(); + } + + @Test + public void testCalendar() throws Exception { + Calendar calendar = ((SCAClient)node).getService(Calendar.class, "Calendar"); + System.out.println(calendar.getEndDate("07/10/96 04:05", 3)); + } + + @After + public void stopNode() throws Exception { + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/test/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/test/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..e57bf783fc --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/test/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/test/resources/calendar.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/test/resources/calendar.composite new file mode 100644 index 0000000000..076eed15b2 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/calendar/src/test/resources/calendar.composite @@ -0,0 +1,28 @@ + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/car/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/car/build.xml new file mode 100644 index 0000000000..46392d4b24 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/car/build.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/car/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/car/pom.xml new file mode 100644 index 0000000000..be0c72db43 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/car/pom.xml @@ -0,0 +1,57 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-car + Apache Tuscany SCA Tours Car Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + scatours-contribution-common + ${pom.version} + provided + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/car/src/main/java/com/tuscanyscatours/car/impl/CarImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/car/src/main/java/com/tuscanyscatours/car/impl/CarImpl.java new file mode 100644 index 0000000000..f75c772d48 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/car/src/main/java/com/tuscanyscatours/car/impl/CarImpl.java @@ -0,0 +1,91 @@ +/* + * 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 com.tuscanyscatours.car.impl; + +import java.util.ArrayList; +import java.util.List; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.common.Book; +import com.tuscanyscatours.common.Search; +import com.tuscanyscatours.common.SearchCallback; +import com.tuscanyscatours.common.TripItem; +import com.tuscanyscatours.common.TripLeg; + +/** + * An implementation of the Car service + */ +@Scope("STATELESS") +@Service(interfaces = {Search.class, Book.class}) +public class CarImpl implements Search, Book { + + private List cars = new ArrayList(); + + @Callback + protected SearchCallback searchCallback; + + @Init + public void init() { + cars.add(new CarInfo("Premier Cars", "BMW 5 Series", "FLR", "06/12/09", "5", 100.00, "EUR", + "http://localhost:8085/tbd")); + cars.add(new CarInfo("Premier Cars", "Ford Focus", "FLR", "06/12/09", "4", 60.00, "EUR", + "http://localhost:8085/tbd")); + } + + public TripItem[] searchSynch(TripLeg tripLeg) { + List items = new ArrayList(); + + // find available hotels + for (CarInfo car : cars) { + if (car.getLocation().equals(tripLeg.getToLocation())) { + TripItem item = + new TripItem("", "", TripItem.CAR, car.getName(), car.getDescription(), car.getLocation(), tripLeg + .getFromDate(), tripLeg.getToDate(), car.getPricePerDay(), car.getCurrency(), car.getLink()); + items.add(item); + } + } + + return items.toArray(new TripItem[items.size()]); + } + + public void searchAsynch(TripLeg tripLeg) { + System.out.println("Starting car search"); + + try { + Thread.sleep(4000); + } catch (Exception ex) { + // do nothing + } + + // return available hotels + searchCallback.searchResults(searchSynch(tripLeg)); + } + + public int getPercentComplete() { + return 100; + } + + public String book(TripItem tripItem) { + return "car1"; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/car/src/main/java/com/tuscanyscatours/car/impl/CarInfo.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/car/src/main/java/com/tuscanyscatours/car/impl/CarInfo.java new file mode 100644 index 0000000000..c373079ac1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/car/src/main/java/com/tuscanyscatours/car/impl/CarInfo.java @@ -0,0 +1,118 @@ +/* + * 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 com.tuscanyscatours.car.impl; + +public class CarInfo { + + private String name; + private String description; + private String location; + private String date; + private String seats; + private double pricePerDay; + private String currency; + private String link; + + public CarInfo() { + } + + public CarInfo(String name, + String description, + String location, + String date, + String seats, + double pricePerDay, + String currency, + String link) { + + this.name = name; + this.description = description; + this.location = location; + this.date = date; + this.seats = seats; + this.pricePerDay = pricePerDay; + this.currency = currency; + this.link = link; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public String getSeats() { + return seats; + } + + public void setSeats(String seats) { + this.seats = seats; + } + + public double getPricePerDay() { + return pricePerDay; + } + + public void setPricePerDay(double pricePerDay) { + this.pricePerDay = pricePerDay; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/car/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/car/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..eb9ffba20d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/car/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/build.xml new file mode 100644 index 0000000000..85cec507ff --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/pom.xml new file mode 100644 index 0000000000..c9b56d8544 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/pom.xml @@ -0,0 +1,50 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-common + Apache Tuscany SCA Tours Common Artefacts Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/java/com/tuscanyscatours/common/Book.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/java/com/tuscanyscatours/common/Book.java new file mode 100644 index 0000000000..47b6f50bec --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/java/com/tuscanyscatours/common/Book.java @@ -0,0 +1,27 @@ +/* + * 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 com.tuscanyscatours.common; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Book { + String book(TripItem tripItem); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/java/com/tuscanyscatours/common/Search.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/java/com/tuscanyscatours/common/Search.java new file mode 100644 index 0000000000..1611c11792 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/java/com/tuscanyscatours/common/Search.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 com.tuscanyscatours.common; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.OneWay; +import org.osoa.sca.annotations.Remotable; + +@Remotable +@Callback(SearchCallback.class) +public interface Search { + TripItem[] searchSynch(TripLeg tripLeg); + + @OneWay + void searchAsynch(TripLeg tripLeg); + + int getPercentComplete(); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/java/com/tuscanyscatours/common/SearchCallback.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/java/com/tuscanyscatours/common/SearchCallback.java new file mode 100644 index 0000000000..ad13d0d352 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/java/com/tuscanyscatours/common/SearchCallback.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 com.tuscanyscatours.common; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface SearchCallback { + void searchResults(TripItem[] items); + void setPercentComplete(String searchComponent, int percentComplete); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/java/com/tuscanyscatours/common/TripItem.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/java/com/tuscanyscatours/common/TripItem.java new file mode 100644 index 0000000000..2f2a6299f9 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/java/com/tuscanyscatours/common/TripItem.java @@ -0,0 +1,242 @@ +/* + * 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 com.tuscanyscatours.common; + +public class TripItem { + + public static String FLIGHT = "Flight"; + public static String HOTEL = "Hotel"; + public static String CAR = "Car"; + public static String TRIP = "Trip"; + + private String id; + private String tripId; + private String type; + private String name; + private String description; + private String location; + private String fromDate; + private String toDate; + private double price; + private String currency; + private String link; + private TripItem[] tripItems; // used for a trip made up of trip items + private String customerDetails; + private String agentDetails; + private String bookingCode; + + public TripItem() { + } + + public TripItem(TripItem item) { + this.id = item.getId(); + this.tripId = item.getTripId(); + this.type = item.getType(); + this.name = item.getName(); + this.description = item.getDescription(); + this.location = item.getLocation(); + this.fromDate = item.getFromDate(); + this.toDate = item.getToDate(); + this.price = item.getPrice(); + this.currency = item.getCurrency(); + this.link = item.getLink(); + } + + public TripItem(String id, + String tripId, + String type, + String name, + String description, + String location, + String fromDate, + String toDate, + double price, + String currency, + String link) { + this.id = id; + this.tripId = tripId; + this.type = type; + this.name = name; + this.description = description; + this.location = location; + this.fromDate = fromDate; + this.toDate = toDate; + this.price = price; + this.currency = currency; + this.link = link; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTripId() { + return tripId; + } + + public void setTripId(String tripId) { + this.tripId = tripId; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public String getFromDate() { + return fromDate; + } + + public void setFromDate(String fromDate) { + this.fromDate = fromDate; + } + + public String getToDate() { + return toDate; + } + + public void setToDate(String toDate) { + this.toDate = toDate; + } + + public double getPrice() { + return price; + } + + public void setPrice(double price) { + this.price = price; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } + + public TripItem[] getTripItems() { + return tripItems; + } + + public void setTripItems(TripItem[] tripItems) { + this.tripItems = tripItems; + } + + public String getCustomerDetails() { + return customerDetails; + } + + public void setCustomerDetails(String customerDetails) { + this.customerDetails = customerDetails; + } + + public String getAgentDetails() { + return agentDetails; + } + + public void setAgentDetails(String agentDetails) { + this.agentDetails = agentDetails; + } + + public String getBookingCode() { + return bookingCode; + } + + public void setBookingCode(String bookingCode) { + this.bookingCode = bookingCode; + } + + @Override + public String toString() { + String tripString = + "Trip: id " + this.tripId + + " type " + + this.type + + " name " + + this.name + + " description " + + this.description + + " location " + + this.location + + " fromDate " + + this.fromDate + + " toDate " + + this.toDate + + " price " + + this.price + + " currency " + + this.currency + + " link " + + this.link; + return tripString; + } + + @Override + public boolean equals(Object obj) { + + if (obj instanceof TripItem) { + if (((TripItem)obj).getId().equals(getId())) { + return true; + } + } + + return super.equals(obj); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/java/com/tuscanyscatours/common/TripLeg.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/java/com/tuscanyscatours/common/TripLeg.java new file mode 100644 index 0000000000..663634b1e9 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/java/com/tuscanyscatours/common/TripLeg.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 com.tuscanyscatours.common; + +public class TripLeg { + + private String id; + private String fromLocation; + private String toLocation; + private String fromDate; + private String toDate; + private String noOfPeople; + + public TripLeg() { + } + + public TripLeg(String id, String fromLocation, String toLocation, String fromDate, String toDate, String noOfPeople) { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getFromLocation() { + return fromLocation; + } + + public void setFromLocation(String fromLocation) { + this.fromLocation = fromLocation; + } + + public String getToLocation() { + return toLocation; + } + + public void setToLocation(String toLocation) { + this.toLocation = toLocation; + } + + public String getFromDate() { + return fromDate; + } + + public void setFromDate(String fromDate) { + this.fromDate = fromDate; + } + + public String getToDate() { + return toDate; + } + + public void setToDate(String toDate) { + this.toDate = toDate; + } + + public String getNoOfPeople() { + return noOfPeople; + } + + public void setNoOfPeople(String noOfPeople) { + this.noOfPeople = noOfPeople; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..d7ada5afe7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/common/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/build.xml new file mode 100644 index 0000000000..93d1c4ad47 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/build.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/pom.xml new file mode 100644 index 0000000000..b0f6388da9 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/pom.xml @@ -0,0 +1,149 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-creditcard-payment-jaxb-policy + Apache Tuscany SCA Tours Credit Card Payment Contribution JAXB Policy + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-interface-java-jaxws + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + test + + + + junit + junit + 4.5 + test + + + + + + + java.net2 + java.net Maven 2.x Repository + http://download.java.net/maven/2 + + false + + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + wsimport + generate-sources + + wsimport + + + com.tuscanyscatours.payment.creditcard + ${basedir}/src/main/resources + + + CreditCardPayment.wsdl + + ${project.build.directory}/jaxws-source + + false + true + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java new file mode 100644 index 0000000000..293f08453f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java @@ -0,0 +1,46 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard.impl; + +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; +import com.tuscanyscatours.payment.creditcard.CreditCardPayment; + +/** + * + */ +@Service(CreditCardPayment.class) +public class CreditCardPaymentImpl implements CreditCardPayment { + + public String authorize(CreditCardDetailsType creditCard, float amount) { + if (creditCard != null) { + System.out.println("Checking card: name = " + creditCard.getCardOwner().getName() + + " number = " + + creditCard.getCreditCardNumber() + + " for amount " + + amount); + } else { + System.out.println("Checking card is null"); + } + + return "OK"; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/main/resources/CreditCardPayment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/main/resources/CreditCardPayment.wsdl new file mode 100644 index 0000000000..f313043bf8 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/main/resources/CreditCardPayment.wsdl @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..21ade03070 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/main/resources/creditcard.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/main/resources/creditcard.composite new file mode 100644 index 0000000000..4a91a96255 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/main/resources/creditcard.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/main/resources/definitions.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/main/resources/definitions.xml new file mode 100644 index 0000000000..a6b35f8e19 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/main/resources/definitions.xml @@ -0,0 +1,34 @@ + + + + + + + myname + mypassword + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java new file mode 100644 index 0000000000..a33b2b3046 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb-policy/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java @@ -0,0 +1,100 @@ +/* + * 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.payment.creditcard; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +import com.tuscanyscatours.payment.creditcard.AuthorizeFault_Exception; +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; +import com.tuscanyscatours.payment.creditcard.CreditCardPayment; +import com.tuscanyscatours.payment.creditcard.CreditCardTypeType; +import com.tuscanyscatours.payment.creditcard.ObjectFactory; +import com.tuscanyscatours.payment.creditcard.PayerType; + +/** + * + */ +public class CreditCardPaymentTestCase { + private static SCANode node; + + /** + * @throws java.lang.Exception + */ + @BeforeClass + public static void setUpBeforeClass() throws Exception { + try { + node = + SCANodeFactory.newInstance().createSCANode("creditcard.composite", new SCAContribution("creditcard", "./target/classes")); + + node.start(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + @Test + public void testCreditCardPayment() { + SCAClient client = (SCAClient)node; + CreditCardPayment cc = client.getService(CreditCardPayment.class, "CreditCardPayment"); + + ObjectFactory objectFactory = new ObjectFactory(); + CreditCardDetailsType ccDetails = objectFactory.createCreditCardDetailsType(); + ccDetails.setCreditCardType(CreditCardTypeType.fromValue("Visa")); + PayerType ccOwner = objectFactory.createPayerType(); + ccOwner.setName("Fred"); + ccDetails.setCardOwner(ccOwner); + + try { + System.out.println(cc.authorize(ccDetails, 100.00f)); + } catch (AuthorizeFault_Exception e) { + System.err.println("Fault: " + e.getFaultInfo().getErrorCode()); + } + } + + @Test + @Ignore + public void testWaitForInput() { + System.out.println("Press a key to end"); + try { + System.in.read(); + } catch (Exception ex) { + } + System.out.println("Shutting down"); + } + + /** + * @throws java.lang.Exception + */ + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (node != null) { + node.stop(); + node = null; + } + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/build.xml new file mode 100644 index 0000000000..9e0ac7fff9 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/build.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/pom.xml new file mode 100644 index 0000000000..103403e461 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/pom.xml @@ -0,0 +1,149 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-creditcard-payment-jaxb + Apache Tuscany SCA Tours Credit Card Payment Contribution JAXB + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-interface-java-jaxws + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + test + + + + junit + junit + 4.5 + test + + + + + + + java.net2 + java.net Maven 2.x Repository + http://download.java.net/maven/2 + + false + + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + wsimport + generate-sources + + wsimport + + + com.tuscanyscatours.payment.creditcard + ${basedir}/src/main/resources + + + CreditCardPayment.wsdl + + ${project.build.directory}/jaxws-source + + false + true + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java new file mode 100644 index 0000000000..ed817a58bb --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java @@ -0,0 +1,46 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard.impl; + +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; +import com.tuscanyscatours.payment.creditcard.CreditCardPayment; + +/** + * + */ +@Service(CreditCardPayment.class) +public class CreditCardPaymentImpl implements CreditCardPayment { + + public String authorize(CreditCardDetailsType creditCard, float amount) { + if (creditCard != null) { + System.out.println("Checking card: name = " + creditCard.getCardOwner().getName() + + " number = " + + creditCard.getCreditCardNumber() + + " for amount " + + amount); + } else { + System.out.println("Checking card is null"); + } + + return "OK"; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/src/main/resources/CreditCardPayment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/src/main/resources/CreditCardPayment.wsdl new file mode 100644 index 0000000000..6dcc619c48 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/src/main/resources/CreditCardPayment.wsdl @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..8c49211dc3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/src/main/resources/creditcard.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/src/main/resources/creditcard.composite new file mode 100644 index 0000000000..db6907cf7e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/src/main/resources/creditcard.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java new file mode 100644 index 0000000000..65c7beb367 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-jaxb/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java @@ -0,0 +1,100 @@ +/* + * 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.payment.creditcard; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +import com.tuscanyscatours.payment.creditcard.AuthorizeFault_Exception; +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; +import com.tuscanyscatours.payment.creditcard.CreditCardPayment; +import com.tuscanyscatours.payment.creditcard.CreditCardTypeType; +import com.tuscanyscatours.payment.creditcard.ObjectFactory; +import com.tuscanyscatours.payment.creditcard.PayerType; + +/** + * + */ +public class CreditCardPaymentTestCase { + private static SCANode node; + + /** + * @throws java.lang.Exception + */ + @BeforeClass + public static void setUpBeforeClass() throws Exception { + try { + node = + SCANodeFactory.newInstance().createSCANode(null, new SCAContribution("creditcard", "./target/classes")); + + node.start(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + @Test + public void testCreditCardPayment() { + SCAClient client = (SCAClient)node; + CreditCardPayment cc = client.getService(CreditCardPayment.class, "CreditCardPayment"); + + ObjectFactory objectFactory = new ObjectFactory(); + CreditCardDetailsType ccDetails = objectFactory.createCreditCardDetailsType(); + ccDetails.setCreditCardType(CreditCardTypeType.fromValue("Visa")); + PayerType ccOwner = objectFactory.createPayerType(); + ccOwner.setName("Fred"); + ccDetails.setCardOwner(ccOwner); + + try { + System.out.println(cc.authorize(ccDetails, 100.00f)); + } catch (AuthorizeFault_Exception e) { + System.err.println("Fault: " + e.getFaultInfo().getErrorCode()); + } + } + + @Test + @Ignore + public void testWaitForInput() { + System.out.println("Press a key to end"); + try { + System.in.read(); + } catch (Exception ex) { + } + System.out.println("Shutting down"); + } + + /** + * @throws java.lang.Exception + */ + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (node != null) { + node.stop(); + node = null; + } + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/build.xml new file mode 100644 index 0000000000..2f9f3d9625 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/build.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/pom.xml new file mode 100644 index 0000000000..61d35ebbfb --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/pom.xml @@ -0,0 +1,149 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-creditcard-payment-sdo + Apache Tuscany SCA Tours Credit Card Payment Contribution SDO + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-databinding-sdo + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + test + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/sdo-source + + + + + + + org.apache.tuscany.sdo + tuscany-sdo-plugin + 1.1.1 + + + generate-sdo + generate-sources + + + ${basedir}/src/main/resources/CreditCardPayment.wsdl + + com.tuscanyscatours.payment.creditcard + CreditCardPayment + true + true + true + + + generate + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java new file mode 100644 index 0000000000..4c0a421e42 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.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 com.tuscanyscatours.payment.creditcard; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.xml.ws.RequestWrapper; +import javax.xml.ws.ResponseWrapper; + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.3-b02- + * Generated source version: 2.1 + * + */ +@WebService(name = "CreditCardPayment", targetNamespace = "http://tuscanyscatours.com/CreditCardPayment/") +public interface CreditCardPayment { + + /** + * + * @param amount + * @param creditCard + * @return + * returns java.lang.String + */ + @WebMethod(action = "http://tuscanyscatours.com/CreditCardPayment/authorize") + @WebResult(name = "Status", targetNamespace = "") + @RequestWrapper(localName = "authorize", targetNamespace = "http://tuscanyscatours.com/CreditCardPayment/", className = "com.tuscanyscatours.payment.creditcard.AuthorizeType") + @ResponseWrapper(localName = "authorizeResponse", targetNamespace = "http://tuscanyscatours.com/CreditCardPayment/", className = "com.tuscanyscatours.payment.creditcard.AuthorizeResponseType") + public String authorize(@WebParam(name = "CreditCard", targetNamespace = "") CreditCardDetailsType creditCard, + @WebParam(name = "Amount", targetNamespace = "") float amount); + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java new file mode 100644 index 0000000000..ed817a58bb --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java @@ -0,0 +1,46 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard.impl; + +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; +import com.tuscanyscatours.payment.creditcard.CreditCardPayment; + +/** + * + */ +@Service(CreditCardPayment.class) +public class CreditCardPaymentImpl implements CreditCardPayment { + + public String authorize(CreditCardDetailsType creditCard, float amount) { + if (creditCard != null) { + System.out.println("Checking card: name = " + creditCard.getCardOwner().getName() + + " number = " + + creditCard.getCreditCardNumber() + + " for amount " + + amount); + } else { + System.out.println("Checking card is null"); + } + + return "OK"; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/main/resources/CreditCardPayment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/main/resources/CreditCardPayment.wsdl new file mode 100644 index 0000000000..d7e274aeee --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/main/resources/CreditCardPayment.wsdl @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..ab31664247 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/main/resources/creditcard.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/main/resources/creditcard.composite new file mode 100644 index 0000000000..f5cd7c2506 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/main/resources/creditcard.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java new file mode 100644 index 0000000000..b7d76a061f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-sdo/src/test/java/scatours/payment/creditcard/CreditCardPaymentTestCase.java @@ -0,0 +1,80 @@ +/* + * 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.payment.creditcard; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; +import com.tuscanyscatours.payment.creditcard.CreditCardPayment; +import com.tuscanyscatours.payment.creditcard.CreditCardPaymentFactory; +import com.tuscanyscatours.payment.creditcard.PayerType; + +/** + * + */ +public class CreditCardPaymentTestCase { + private static SCANode node; + + /** + * @throws java.lang.Exception + */ + @BeforeClass + public static void setUpBeforeClass() throws Exception { + SCANodeFactory factory = SCANodeFactory.newInstance(); + node = factory.createSCANode(null, new SCAContribution("creditcard-sdo", "./target/classes")); + node.start(); + } + + @Test + public void testCreditCardPayment() { + SCAClient client = (SCAClient)node; + CreditCardPayment cc = client.getService(CreditCardPayment.class, "CreditCardPayment"); + + CreditCardPaymentFactory factory = CreditCardPaymentFactory.INSTANCE; + CreditCardDetailsType ccDetails = factory.createCreditCardDetailsType(); + ccDetails.setCreditCardType("Visa"); + ccDetails.setCreditCardNumber("1111-2222-3333-4444"); + ccDetails.setExpMonth(9); + ccDetails.setExpYear(2010); + PayerType ccOwner = factory.createPayerType(); + ccOwner.setName("Fred"); + ccDetails.setCardOwner(ccOwner); + + System.out.println(cc.authorize(ccDetails, 100.00f)); + } + + /** + * @throws java.lang.Exception + */ + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (node != null) { + node.stop(); + node = null; + } + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/build.xml new file mode 100644 index 0000000000..45441d3098 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/build.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/pom.xml new file mode 100644 index 0000000000..2fcafb6dcb --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/pom.xml @@ -0,0 +1,72 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-creditcard-payment-webapp + war + Apache Tuscany SCA Tours CreditCard Payment WebApp Contribution + + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + compile + + + + org.apache.tuscany.sca + tuscany-implementation-web-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-webapp + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + scatours-contribution-creditcard-payment-jaxb + ${pom.version} + runtime + + + javax.servlet + servlet-api + + + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/src/main/resources/CreditCardPayment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/src/main/resources/CreditCardPayment.wsdl new file mode 100644 index 0000000000..6dcc619c48 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/src/main/resources/CreditCardPayment.wsdl @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/src/main/webapp/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/src/main/webapp/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..898321c510 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/src/main/webapp/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/src/main/webapp/META-INF/sca-deployables/web.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/src/main/webapp/META-INF/sca-deployables/web.composite new file mode 100644 index 0000000000..ac9128a6d5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/src/main/webapp/META-INF/sca-deployables/web.composite @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/src/main/webapp/WEB-INF/web.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..a6188e25ba --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,42 @@ + + + + + + SCA Tours Credit Card Payment WebApp + + + tuscany + org.apache.tuscany.sca.host.webapp.TuscanyServletFilter + + + + tuscany + /* + + + + creditcard.jsp + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/src/main/webapp/creditcard.jsp b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/src/main/webapp/creditcard.jsp new file mode 100644 index 0000000000..98b7f41e7b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/creditcard-payment-webapp/src/main/webapp/creditcard.jsp @@ -0,0 +1,71 @@ + + +<%@ page contentType="text/html;charset=UTF-8" language="java"%> +<%@ taglib uri="http://www.osoa.org/sca/sca_jsp.tld" prefix="sca"%> + + + + +<%@page import="com.tuscanyscatours.payment.creditcard.CreditCardPaymentService"%> +<%@page import="com.tuscanyscatours.payment.creditcard.ObjectFactory"%> +<%@page import="com.tuscanyscatours.payment.creditcard.CreditCardDetailsType"%> +<%@page import="com.tuscanyscatours.payment.creditcard.CreditCardTypeType"%> +<%@page import="com.tuscanyscatours.payment.creditcard.PayerType"%> + + +

SCATours Credit Card Payment Web Application

+ +

+

Card Type:
+Card Number:
+Card Holder:
+Amount (EUR):
+

+

+ +<% + String c = request.getParameter("charge"); + if (c != null) { + ObjectFactory objectFactory = new ObjectFactory(); + CreditCardDetailsType ccDetails = objectFactory.createCreditCardDetailsType(); + ccDetails.setCreditCardType(CreditCardTypeType.fromValue(request.getParameter("type"))); + ccDetails.setCreditCardNumber(request.getParameter("cardNumber")); + ccDetails.setCVV2("123"); + ccDetails.setExpMonth(12); + ccDetails.setExpYear(2011); + PayerType ccOwner = objectFactory.createPayerType(); + ccOwner.setName(request.getParameter("cardHolder")); + ccDetails.setCardOwner(ccOwner); + float amount = Float.parseFloat(request.getParameter("amount")); +%> +<%=service.authorize(ccDetails, amount)%> +<% + } +%> + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-corba/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-corba/build.xml new file mode 100644 index 0000000000..fa2ac47a64 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-corba/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-corba/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-corba/pom.xml new file mode 100644 index 0000000000..824bde6a5c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-corba/pom.xml @@ -0,0 +1,51 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-currency-corba + Apache Tuscany SCA Tours Currency Converter Contribution With CORBA Binding + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-corba/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-corba/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..f22dd9b55d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-corba/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-corba/src/main/resources/currency-converter-corba.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-corba/src/main/resources/currency-converter-corba.composite new file mode 100644 index 0000000000..3fde6ea309 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-corba/src/main/resources/currency-converter-corba.composite @@ -0,0 +1,32 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jms/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jms/build.xml new file mode 100644 index 0000000000..1b5cef445b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jms/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jms/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jms/pom.xml new file mode 100644 index 0000000000..1ea492e1d4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jms/pom.xml @@ -0,0 +1,71 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-currency-jms + Apache Tuscany SCA Tours Currency Converter Contribution With JMS Binding + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jms-runtime + ${tuscany.version} + runtime + + + + junit + junit + 4.5 + test + + + + org.apache.activemq + activemq-all + 5.2.0 + test + + + org.apache.activemq + activemq-web-demo + + + + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jms/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jms/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..89ba1a3578 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jms/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jms/src/main/resources/currency-converter-jms.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jms/src/main/resources/currency-converter-jms.composite new file mode 100644 index 0000000000..ac34d6f562 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jms/src/main/resources/currency-converter-jms.composite @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jsp/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jsp/build.xml new file mode 100644 index 0000000000..d1b0d955ac --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jsp/build.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jsp/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jsp/pom.xml new file mode 100644 index 0000000000..0d27322061 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jsp/pom.xml @@ -0,0 +1,58 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-currency-jsp + war + Apache Tuscany SCA Tours Currency Converter JSP Contribution + + + + org.apache.tuscany.sca + tuscany-implementation-web-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-webapp + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + scatours-contribution-currency + ${pom.version} + runtime + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jsp/src/main/webapp/META-INF/sca-deployables/web.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jsp/src/main/webapp/META-INF/sca-deployables/web.composite new file mode 100644 index 0000000000..50667b1ac0 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jsp/src/main/webapp/META-INF/sca-deployables/web.composite @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jsp/src/main/webapp/WEB-INF/web.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jsp/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..3b2c79ca76 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jsp/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,42 @@ + + + + + + SCA Tours Currency Converter JSP + + + tuscany + org.apache.tuscany.sca.host.webapp.TuscanyServletFilter + + + + tuscany + /* + + + + currency-converter.jsp + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jsp/src/main/webapp/currency-converter.jsp b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jsp/src/main/webapp/currency-converter.jsp new file mode 100644 index 0000000000..daf8c5cff1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-jsp/src/main/webapp/currency-converter.jsp @@ -0,0 +1,49 @@ + +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@ taglib uri="http://www.osoa.org/sca/sca_jsp.tld" prefix="sca" %> + + + + + +

SCA Tours Currency Converter JSP

+Welcome to the SCA Tours Currency Converter: +

+ +

+Enter value in US Dollars + +

+ +

+ +

+ +<% + String dollarsStr = request.getParameter( "dollars" ); + if ( dollarsStr != null) { + double dollars = Double.parseDouble(dollarsStr); + double converted = currencyConverter.convert("USD", "GBP", dollars); + out.println(dollars + " US Dollars = " + converted + " GB Pounds"); + } +%> + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-rmi/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-rmi/build.xml new file mode 100644 index 0000000000..a969f0c819 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-rmi/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-rmi/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-rmi/pom.xml new file mode 100644 index 0000000000..dd02d85bd7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-rmi/pom.xml @@ -0,0 +1,51 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-currency-rmi + Apache Tuscany SCA Tours Currency Converter Contribution With RMI Binding + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-rmi/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-rmi/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..cf7325d247 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-rmi/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-rmi/src/main/resources/currency-converter-rmi.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-rmi/src/main/resources/currency-converter-rmi.composite new file mode 100644 index 0000000000..52df3a183f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-rmi/src/main/resources/currency-converter-rmi.composite @@ -0,0 +1,32 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-servlet/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-servlet/build.xml new file mode 100644 index 0000000000..23edaad6a6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-servlet/build.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-servlet/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-servlet/pom.xml new file mode 100644 index 0000000000..2f444b31d7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-servlet/pom.xml @@ -0,0 +1,72 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-currency-servlet + war + Apache Tuscany SCA Tours Currency Converter Servlet Contribution + + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + compile + + + + org.apache.tuscany.sca + tuscany-implementation-web-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-webapp + ${tuscany.version} + runtime + + + + javax.servlet + servlet-api + 2.3 + provided + + + + org.apache.tuscany.sca + scatours-contribution-currency + ${pom.version} + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-servlet/src/main/java/com/tuscanyscatours/currencyconverter/servlet/CurrencyConverterServlet.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-servlet/src/main/java/com/tuscanyscatours/currencyconverter/servlet/CurrencyConverterServlet.java new file mode 100644 index 0000000000..3584ebbb93 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-servlet/src/main/java/com/tuscanyscatours/currencyconverter/servlet/CurrencyConverterServlet.java @@ -0,0 +1,73 @@ +/* + * 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 com.tuscanyscatours.currencyconverter.servlet; + +import java.io.IOException; +import java.io.Writer; + +import javax.servlet.ServletConfig; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.osoa.sca.ComponentContext; +import org.osoa.sca.annotations.Reference; + +import com.tuscanyscatours.currencyconverter.CurrencyConverter; + +public class CurrencyConverterServlet extends HttpServlet { + + @Reference + protected CurrencyConverter currencyConverter; + + @Override + public void init(ServletConfig config) { + if (currencyConverter == null) { + // The Currency Converter reference will only be injected from the @Reference + // annotation in containers supporting SCA "deep" integration. In other + // environments in can be looked up from the ComponentContext. + ComponentContext context = + (ComponentContext)config.getServletContext().getAttribute("org.osoa.sca.ComponentContext"); + currencyConverter = context.getService(CurrencyConverter.class, "currencyConverter"); + } + } + + @Override + protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException { + Writer out = response.getWriter(); + out.write("

SCA Tours Currency Converter Servlet

"); + out.write("Welcome to the SCA Tours Currency Converter Servlet

"); + out.write("

"); + out.write("Enter value in US Dollars"); + out.write("

"); + out.write(""); + out.write("

"); + + String dollarsStr = request.getParameter("dollars"); + if (dollarsStr != null) { + double dollars = Double.parseDouble(dollarsStr); + double converted = currencyConverter.convert("USD", "GBP", dollars); + out.write(dollars + " US Dollars = " + converted + " GB Pounds"); + } + + out.write(""); + out.flush(); + out.close(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-servlet/src/main/webapp/META-INF/sca-deployables/web.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-servlet/src/main/webapp/META-INF/sca-deployables/web.composite new file mode 100644 index 0000000000..c9ef16ee1b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-servlet/src/main/webapp/META-INF/sca-deployables/web.composite @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-servlet/src/main/webapp/WEB-INF/web.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-servlet/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..2204c67870 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-servlet/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,52 @@ + + + + + + SCA Tours Currency Converter Servlet + + + tuscany + org.apache.tuscany.sca.host.webapp.TuscanyServletFilter + + + + tuscany + /* + + + + CurrencyConverterServlet + com.tuscanyscatours.currencyconverter.servlet.CurrencyConverterServlet + + + + CurrencyConverterServlet + /CurrencyConverterServlet + + + + CurrencyConverterServlet + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-ws/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-ws/build.xml new file mode 100644 index 0000000000..bf87bbfba6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-ws/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-ws/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-ws/pom.xml new file mode 100644 index 0000000000..5eadf838f4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-ws/pom.xml @@ -0,0 +1,51 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-currency-ws + Apache Tuscany SCA Tours Currency Converter Contribution With Web Service Binding + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-ws/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-ws/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..cf7325d247 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-ws/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-ws/src/main/resources/currency-converter-ws.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-ws/src/main/resources/currency-converter-ws.composite new file mode 100644 index 0000000000..b048a826f1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency-ws/src/main/resources/currency-converter-ws.composite @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/build.xml new file mode 100644 index 0000000000..0f5811e299 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/pom.xml new file mode 100644 index 0000000000..6ceb0bd8b1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/pom.xml @@ -0,0 +1,57 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-currency + Apache Tuscany SCA Tours Currency Converter Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/src/main/java/com/tuscanyscatours/currencyconverter/CurrencyConverter.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/src/main/java/com/tuscanyscatours/currencyconverter/CurrencyConverter.java new file mode 100644 index 0000000000..b1f783bfba --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/src/main/java/com/tuscanyscatours/currencyconverter/CurrencyConverter.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 com.tuscanyscatours.currencyconverter; + +import org.osoa.sca.annotations.Remotable; + +/** + * The CurrencyConverter service interface + */ +@Remotable +public interface CurrencyConverter { + + double getExchangeRate(String fromCurrencyCode, String toCurrencyCode); + + double convert(String fromCurrencyCode, String toCurrencyCode, double amount); + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/src/main/java/com/tuscanyscatours/currencyconverter/impl/CurrencyConverterImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/src/main/java/com/tuscanyscatours/currencyconverter/impl/CurrencyConverterImpl.java new file mode 100644 index 0000000000..6ad9a957c7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/src/main/java/com/tuscanyscatours/currencyconverter/impl/CurrencyConverterImpl.java @@ -0,0 +1,53 @@ +/* + * 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 com.tuscanyscatours.currencyconverter.impl; + +import java.util.HashMap; +import java.util.Map; + +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.currencyconverter.CurrencyConverter; + +/** + * An implementation of the CurrencyConverter service + */ +@Service(interfaces = {CurrencyConverter.class}) +public class CurrencyConverterImpl implements CurrencyConverter { + + // currency index + private Map currencyIndex = new HashMap(); + + // exchange rates + private final double rates[][] = { {1.00, 0.50, 0.66}, {2.00, 1.00, 1.33}, {1.50, 0.75, 1.00}}; + + public CurrencyConverterImpl() { + currencyIndex.put("USD", new Integer(0)); + currencyIndex.put("GBP", new Integer(1)); + currencyIndex.put("EUR", new Integer(2)); + } + + public double getExchangeRate(String fromCurrencyCode, String toCurrencyCode) { + return rates[currencyIndex.get(fromCurrencyCode).intValue()][currencyIndex.get(toCurrencyCode).intValue()]; + } + + public double convert(String fromCurrencyCode, String toCurrencyCode, double amount) { + return amount * getExchangeRate(fromCurrencyCode, toCurrencyCode); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..b11328f405 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/src/main/resources/currency-converter.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/src/main/resources/currency-converter.composite new file mode 100644 index 0000000000..41d0d325d4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/currency/src/main/resources/currency-converter.composite @@ -0,0 +1,28 @@ + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/databinding-client/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/databinding-client/build.xml new file mode 100644 index 0000000000..94f9290854 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/databinding-client/build.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/databinding-client/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/databinding-client/pom.xml new file mode 100644 index 0000000000..91e283d742 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/databinding-client/pom.xml @@ -0,0 +1,48 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-databinding-client + Apache Tuscany SCA Tours Databinding Client Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + scatours-contribution-payment-java + ${pom.version} + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/databinding-client/src/main/java/scatours/client/TestClient.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/databinding-client/src/main/java/scatours/client/TestClient.java new file mode 100644 index 0000000000..f598a6f056 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/databinding-client/src/main/java/scatours/client/TestClient.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 scatours.client; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.payment.Payment; + +@Service(Runnable.class) +public class TestClient { + @Reference + protected Payment payment; + + public TestClient() { + } + + public void run() { + System.out.println("Call Payment component"); + System.out.println(payment.makePaymentMember("c-0", 100.00f)); + System.out.println(payment.makePaymentMember("c-1", 100.00f)); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/databinding-client/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/databinding-client/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..87e8535676 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/databinding-client/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/databinding-client/src/main/resources/client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/databinding-client/src/main/resources/client.composite new file mode 100644 index 0000000000..e19697290c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/databinding-client/src/main/resources/client.composite @@ -0,0 +1,28 @@ + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/build.xml new file mode 100644 index 0000000000..ec234bcb4a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/build.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/pom.xml new file mode 100644 index 0000000000..d98af789d4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/pom.xml @@ -0,0 +1,154 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-emailgateway + Apache Tuscany SCA Tours Email Gateway Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + test + + + + junit + junit + 4.5 + test + + + + + + + java.net2 + java.net Maven 2.x Repository + http://download.java.net/maven/2 + + false + + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + wsimport + generate-sources + + wsimport + + + com.tuscanyscatours.emailgateway + ${basedir}/src/main/resources + + + EmailGateway.wsdl + + ${project.build.directory}/jaxws-source + + false + true + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java new file mode 100644 index 0000000000..0ff12b4efa --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java @@ -0,0 +1,38 @@ +/* + * 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 com.tuscanyscatours.emailgateway.impl; + +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.emailgateway.EmailGateway; +import com.tuscanyscatours.emailgateway.EmailType; + +/** + * + */ +@Service(EmailGateway.class) +public class EmailGatewayImpl implements EmailGateway { + + public String sendEmail(EmailType email) { + System.out.println("Sending mail to " + email.getTo()); + return "SENT"; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/main/resources/EmailGateway.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/main/resources/EmailGateway.wsdl new file mode 100644 index 0000000000..bb9cd27027 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/main/resources/EmailGateway.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..7d8aa000cc --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/main/resources/emailgateway.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/main/resources/emailgateway.composite new file mode 100644 index 0000000000..a401b2a96e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/main/resources/emailgateway.composite @@ -0,0 +1,32 @@ + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/test/java/scatours/emailgateway/EmailGatewayTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/test/java/scatours/emailgateway/EmailGatewayTestCase.java new file mode 100644 index 0000000000..8b0ecba024 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/test/java/scatours/emailgateway/EmailGatewayTestCase.java @@ -0,0 +1,76 @@ +/* + * 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.emailgateway; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.tuscanyscatours.emailgateway.EmailGateway; +import com.tuscanyscatours.emailgateway.EmailType; +import com.tuscanyscatours.emailgateway.ObjectFactory; + +/** + * + */ +public class EmailGatewayTestCase { + private static SCANode node; + + /** + * @throws java.lang.Exception + */ + @BeforeClass + public static void setUpBeforeClass() throws Exception { + SCANodeFactory factory = SCANodeFactory.newInstance(); + node = + factory.createSCANode(null, + new SCAContribution("emailgateway", "./target/classes"), + new SCAContribution("emailgateway-test", "./target/test-classes")); + node.start(); + } + + @Test + public void testEmailGateway() { + SCAClient client = (SCAClient)node; + EmailGateway cc = client.getService(EmailGateway.class, "EmailGatewayClient"); + ObjectFactory objectFactory = new ObjectFactory(); + EmailType email = objectFactory.createEmailType(); + email.setTo("Fred"); + email.setTitle("An email"); + email.setBody("A message"); + System.out.println(cc.sendEmail(email)); + } + + /** + * @throws java.lang.Exception + */ + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (node != null) { + node.stop(); + node = null; + } + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/test/java/scatours/emailgateway/client/impl/EmailGatewayClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/test/java/scatours/emailgateway/client/impl/EmailGatewayClientImpl.java new file mode 100644 index 0000000000..10d4984665 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/test/java/scatours/emailgateway/client/impl/EmailGatewayClientImpl.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 scatours.emailgateway.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.emailgateway.EmailGateway; +import com.tuscanyscatours.emailgateway.EmailType; + +/** + * + */ +@Service(EmailGateway.class) +public class EmailGatewayClientImpl implements EmailGateway { + @Reference + protected EmailGateway emailGateway; + + public String sendEmail(EmailType email) { + // Delegate the external web service + return emailGateway.sendEmail(email); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/test/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/test/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..cc141d7703 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/test/resources/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/test/resources/emailgateway-test.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/test/resources/emailgateway-test.composite new file mode 100644 index 0000000000..8305356bda --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/emailgateway/src/test/resources/emailgateway-test.composite @@ -0,0 +1,32 @@ + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/build.xml new file mode 100644 index 0000000000..c23a99e6ca --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/pom.xml new file mode 100644 index 0000000000..2c9422ef70 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/pom.xml @@ -0,0 +1,68 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-feed-logger + Apache Tuscany SCA Tours Feed Logger Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-binding-atom-abdera + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-binding-rss-rome + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/src/main/java/com/tuscanyscatours/feedlogger/FeedLogger.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/src/main/java/com/tuscanyscatours/feedlogger/FeedLogger.java new file mode 100644 index 0000000000..0f5d18d53b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/src/main/java/com/tuscanyscatours/feedlogger/FeedLogger.java @@ -0,0 +1,30 @@ +/* + * 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 com.tuscanyscatours.feedlogger; + +public interface FeedLogger { + + /** + * Captures the configured feeds and logs the feed entries. + * + * @param maxEntriesPerFeed The maximum number of entries to log per feed + */ + public void logFeeds(int maxEntriesPerFeed); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/src/main/java/com/tuscanyscatours/feedlogger/impl/FeedLoggerImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/src/main/java/com/tuscanyscatours/feedlogger/impl/FeedLoggerImpl.java new file mode 100644 index 0000000000..a949d63383 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/src/main/java/com/tuscanyscatours/feedlogger/impl/FeedLoggerImpl.java @@ -0,0 +1,99 @@ +/* + * 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 com.tuscanyscatours.feedlogger.impl; + +import java.util.List; + +import org.apache.abdera.model.Entry; +import org.apache.abdera.model.Feed; +import org.osoa.sca.annotations.Reference; + +import com.sun.syndication.feed.synd.SyndEntry; +import com.sun.syndication.feed.synd.SyndFeed; +import com.tuscanyscatours.feedlogger.FeedLogger; + +public class FeedLoggerImpl implements FeedLogger { + + /** + * Reference to the SCA Tours Blog Atom feed. + */ + @Reference + public org.apache.tuscany.sca.binding.atom.collection.Collection scaToursBlogAtom; + + /** + * Reference to the SCA Tours Blog RSS feed. + */ + @Reference + public org.apache.tuscany.sca.binding.rss.collection.Collection scaToursBlogRSS; + + /** + * Reference to the BBC News RSS feed. + */ + @Reference + public org.apache.tuscany.sca.binding.rss.collection.Collection bbcNews; + + /** + * {@inheritDoc} + */ + public void logFeeds(int maxEntriesPerFeed) { + System.out.println("Logging SCA Tours Blog Atom feed:"); + logAtomFeed(scaToursBlogAtom, maxEntriesPerFeed); + + System.out.println("Logging SCA Tours Blog RSS feed:"); + logRSSFeed(scaToursBlogRSS, maxEntriesPerFeed); + + System.out.println("Logging BBC News feed:"); + logRSSFeed(bbcNews, maxEntriesPerFeed); + } + + /** + * Logs up to maxEntries entries from the specified feed. + * + * @param maxEntries The maximum number of entries to log per feed + */ + private void logAtomFeed(org.apache.tuscany.sca.binding.atom.collection.Collection atomFeed, int maxEntries) { + final Feed feed = atomFeed.getFeed(); + System.out.println("Feed: " + feed.getTitle()); + final List entries = feed.getEntries(); + + for (int i = 0; i < entries.size() && i < maxEntries; i++) { + Entry entry = entries.get(i); + System.out.println("Entry: " + entry.getTitle()); + } + System.out.println(); + } + + /** + * Logs up to maxEntries entries from the specified feed. + * + * @param maxEntries The maximum number of entries to log + */ + private void logRSSFeed(org.apache.tuscany.sca.binding.rss.collection.Collection rssFeed, int maxEntries) { + SyndFeed feed = rssFeed.getFeed(); + System.out.println("Feed: " + feed.getTitle()); + + List entries = feed.getEntries(); + for (int i = 0; i < entries.size() && i < maxEntries; i++) { + SyndEntry entry = entries.get(i); + System.out.println("Entry: " + entry.getTitle()); + } + System.out.println(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..556807a0f0 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,21 @@ + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/src/main/resources/feed-logger.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/src/main/resources/feed-logger.composite new file mode 100644 index 0000000000..17c24adefb --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/feed-logger/src/main/resources/feed-logger.composite @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/flight/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/flight/build.xml new file mode 100644 index 0000000000..0a151c1a20 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/flight/build.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/flight/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/flight/pom.xml new file mode 100644 index 0000000000..6e2fea39b1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/flight/pom.xml @@ -0,0 +1,57 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-flight + Apache Tuscany SCA Tours Flight Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + scatours-contribution-common + ${pom.version} + provided + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/flight/src/main/java/com/tuscanyscatours/flight/impl/FlightImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/flight/src/main/java/com/tuscanyscatours/flight/impl/FlightImpl.java new file mode 100644 index 0000000000..36407de5b3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/flight/src/main/java/com/tuscanyscatours/flight/impl/FlightImpl.java @@ -0,0 +1,121 @@ +/* + * 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 com.tuscanyscatours.flight.impl; + +import java.util.ArrayList; +import java.util.List; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.ComponentName; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.common.Book; +import com.tuscanyscatours.common.Search; +import com.tuscanyscatours.common.SearchCallback; +import com.tuscanyscatours.common.TripItem; +import com.tuscanyscatours.common.TripLeg; + +/** + * An implementation of the Flight service + */ +@Scope("CONVERSATION") +@Service(interfaces = {Search.class, Book.class}) +public class FlightImpl implements Search, Book { + + private List flights = new ArrayList(); + + @Callback + protected SearchCallback searchCallback; + + @ComponentName + protected String componentName; + + private int percentComplete = 0; + + @Init + public void init() { + flights.add(new FlightInfo("EA26", "Europe Airlines Airbus A300", "LGW", "FLR", "06/12/09", "06/12/09", "350", + 250, "EUR", "http://localhost:8085/tbd")); + flights.add(new FlightInfo("EA27", "Europe Airlines Airbus A300", "FLR", "LGW", "13/12/09", "13/12/09", "350", + 250, "EUR", "http://localhost:8085/tbd")); + + } + + public TripItem[] searchSynch(TripLeg tripLeg) { + List items = new ArrayList(); + + // find outbound leg + for (FlightInfo flight : flights) { + if ((flight.getFromLocation().equals(tripLeg.getFromLocation())) && (flight.getToLocation().equals(tripLeg + .getToLocation())) + && (flight.getFromDate().equals(tripLeg.getFromDate()))) { + TripItem item = + new TripItem("", "", TripItem.FLIGHT, flight.getName(), flight.getDescription(), flight + .getFromLocation() + " - " + + flight.getToLocation(), flight.getFromDate(), flight.getToDate(), flight.getPricePerSeat(), + flight.getCurrency(), flight.getLink()); + items.add(item); + } + } + + // find return leg + for (FlightInfo flight : flights) { + if ((flight.getFromLocation().equals(tripLeg.getToLocation())) && (flight.getToLocation().equals(tripLeg + .getFromLocation())) + && (flight.getFromDate().equals(tripLeg.getToDate()))) { + TripItem item = + new TripItem("", "", TripItem.FLIGHT, flight.getName(), flight.getDescription(), flight + .getFromLocation() + " - " + + flight.getToLocation(), flight.getFromDate(), tripLeg.getToDate(), flight.getPricePerSeat(), + flight.getCurrency(), flight.getLink()); + items.add(item); + } + } + + return items.toArray(new TripItem[items.size()]); + } + + public void searchAsynch(TripLeg tripLeg) { + System.out.println("Starting flight search"); + + // pretend that this processing takes some time to complete + while (percentComplete < 100) { + try { + Thread.sleep(50); + } catch (Exception ex) { + // do nothing + } + percentComplete = percentComplete + 10; + searchCallback.setPercentComplete(componentName, percentComplete); + } + + // return available flights + searchCallback.searchResults(searchSynch(tripLeg)); + } + + public int getPercentComplete() { + return 100; + } + + public String book(TripItem tripItem) { + return "flight1"; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/flight/src/main/java/com/tuscanyscatours/flight/impl/FlightInfo.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/flight/src/main/java/com/tuscanyscatours/flight/impl/FlightInfo.java new file mode 100644 index 0000000000..5f7de69229 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/flight/src/main/java/com/tuscanyscatours/flight/impl/FlightInfo.java @@ -0,0 +1,140 @@ +/* + * 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 com.tuscanyscatours.flight.impl; + +public class FlightInfo { + + private String name; + private String description; + private String fromLocation; + private String toLocation; + private String fromDate; + private String toDate; + private String seats; + private double pricePerSeat; + private String currency; + private String link; + + public FlightInfo() { + } + + public FlightInfo(String name, + String description, + String fromLocation, + String toLocation, + String fromDate, + String toDate, + String seats, + double pricePerSeat, + String currency, + String link) { + + this.name = name; + this.description = description; + this.fromLocation = fromLocation; + this.toLocation = toLocation; + this.fromDate = fromDate; + this.toDate = toDate; + this.seats = seats; + this.pricePerSeat = pricePerSeat; + this.currency = currency; + this.link = link; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getFromLocation() { + return fromLocation; + } + + public void setFromLocation(String fromLocation) { + this.fromLocation = fromLocation; + } + + public String getToLocation() { + return toLocation; + } + + public void setToLocation(String toLocation) { + this.toLocation = toLocation; + } + + public String getFromDate() { + return fromDate; + } + + public void setFromDate(String fromDate) { + this.fromDate = fromDate; + } + + public String getToDate() { + return toDate; + } + + public void setToDate(String toDate) { + this.toDate = toDate; + } + + public String getSeats() { + return seats; + } + + public void setSeats(String seats) { + this.seats = seats; + } + + public double getPricePerSeat() { + return pricePerSeat; + } + + public void setPricePerSeat(double pricePerSeat) { + this.pricePerSeat = pricePerSeat; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/flight/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/flight/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..1e539bf13b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/flight/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-bespoketrip/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-bespoketrip/build.xml new file mode 100644 index 0000000000..8428af49f5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-bespoketrip/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-bespoketrip/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-bespoketrip/pom.xml new file mode 100644 index 0000000000..38a94c12f4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-bespoketrip/pom.xml @@ -0,0 +1,34 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-fullapp-bespoketrip + Apache Tuscany SCA Tours Full Application Bespoke Contribution + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-bespoketrip/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-bespoketrip/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..9ae204d8f7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-bespoketrip/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,28 @@ + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-bespoketrip/src/main/resources/fullapp-bespoketrip.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-bespoketrip/src/main/resources/fullapp-bespoketrip.composite new file mode 100644 index 0000000000..76c91b7887 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-bespoketrip/src/main/resources/fullapp-bespoketrip.composite @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-coordination/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-coordination/build.xml new file mode 100644 index 0000000000..0da4e5aebd --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-coordination/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-coordination/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-coordination/pom.xml new file mode 100644 index 0000000000..e4dadacaed --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-coordination/pom.xml @@ -0,0 +1,34 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-fullapp-coordination + Apache Tuscany SCA Tours Full Application Coordination Contribution + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-coordination/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-coordination/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..a6eb8bcce2 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-coordination/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-coordination/src/main/resources/fullapp-coordination.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-coordination/src/main/resources/fullapp-coordination.composite new file mode 100644 index 0000000000..2d6564ffa3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-coordination/src/main/resources/fullapp-coordination.composite @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GBP + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-currency/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-currency/build.xml new file mode 100644 index 0000000000..aa6127daf0 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-currency/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-currency/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-currency/pom.xml new file mode 100644 index 0000000000..a1bf4b4ce8 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-currency/pom.xml @@ -0,0 +1,34 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-fullapp-currency + Apache Tuscany SCA Tours Full Application Currency Contribution + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-currency/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-currency/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..dc66ed8db6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-currency/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-currency/src/main/resources/fullapp-currency.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-currency/src/main/resources/fullapp-currency.composite new file mode 100644 index 0000000000..654ff60c41 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-currency/src/main/resources/fullapp-currency.composite @@ -0,0 +1,28 @@ + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-packagedtrip/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-packagedtrip/build.xml new file mode 100644 index 0000000000..491f9cafd1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-packagedtrip/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-packagedtrip/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-packagedtrip/pom.xml new file mode 100644 index 0000000000..fe5a2fc96f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-packagedtrip/pom.xml @@ -0,0 +1,34 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-fullapp-packagedtrip + Apache Tuscany SCA Tours Full Application Packaged Trip Contribution + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-packagedtrip/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-packagedtrip/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..3059c49911 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-packagedtrip/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-packagedtrip/src/main/resources/fullapp-packagedtrip.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-packagedtrip/src/main/resources/fullapp-packagedtrip.composite new file mode 100644 index 0000000000..0f8dd33060 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-packagedtrip/src/main/resources/fullapp-packagedtrip.composite @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-shoppingcart/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-shoppingcart/build.xml new file mode 100644 index 0000000000..eccff2291f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-shoppingcart/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-shoppingcart/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-shoppingcart/pom.xml new file mode 100644 index 0000000000..6867d487dc --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-shoppingcart/pom.xml @@ -0,0 +1,34 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-fullapp-shoppingcart + Apache Tuscany SCA Tours Full Application Shopping Cart Contribution + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-shoppingcart/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-shoppingcart/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..384887f792 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-shoppingcart/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,26 @@ + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-shoppingcart/src/main/resources/fullapp-shoppingcart.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-shoppingcart/src/main/resources/fullapp-shoppingcart.composite new file mode 100644 index 0000000000..ed4fce84d6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-shoppingcart/src/main/resources/fullapp-shoppingcart.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/build.xml new file mode 100644 index 0000000000..51aef70837 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/pom.xml new file mode 100644 index 0000000000..edf5ae7c48 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/pom.xml @@ -0,0 +1,34 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-fullapp-ui + Apache Tuscany SCA Tours Full Application User Interface Contribution + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..104a78cd92 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,28 @@ + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/fullapp-ui.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/fullapp-ui.composite new file mode 100644 index 0000000000..bcfa894ca6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/fullapp-ui.composite @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/scatours.html b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/scatours.html new file mode 100644 index 0000000000..52479c1cde --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/scatours.html @@ -0,0 +1,399 @@ + + + +SCA Tours + + + + + + + + + + + +

+
+

Search for trips, hotels, flights and cars

+
+ + + + + + + + + + + + + + + + + +
From Location:To Location:
Start Date:End Date:
Number of people: + +
+
+ +
+
+
+
+
+
+
+
+

Shopping Cart

+
+
+ Total Price:
+
+ +
+
+ + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/scatours.odg b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/scatours.odg new file mode 100644 index 0000000000..8466377374 Binary files /dev/null and b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/scatours.odg differ diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/scatours.png b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/scatours.png new file mode 100644 index 0000000000..563bf4ea91 Binary files /dev/null and b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/scatours.png differ diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/style.css b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/style.css new file mode 100644 index 0000000000..6e17c2747b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/fullapp-ui/src/main/resources/style.css @@ -0,0 +1,135 @@ +/* + * 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. + */ + + + +/*******************************************/ + +p,table,li,h1,h2,h3 +{ +font-family: verdana, arial, 'sans serif'; +} + +p, h1, h2, h3, table, li, hr +{ +margin-left: 10pt; +} + +table +{ +border-color: black; +border-collapse: separate; +border-spacing: 0px 1px; + +margin-right: 10pt; +margin-left: 10pt; +width: 800px; +} + +.sourceDetailsTable +{ +width: 600px; +} + +tr, td +{ +margin-left: 0pt; +margin-right: 0pt; +padding-left: 10pt; +font-size: 90%; +} + +p,li,th +{ +font-size: 90%; +margin-left: 10pt; +} + +pre +{ +margin-left: 10pt; +} + +body +{ +#ffffff; +} + +h1,h2,h3,hr +{ +color: firebrick; +} + +a:link {COLOR: firebrick;} +a:visited {COLOR: firebrick;} +a:active {COLOR: navy;} + +.link +{ +COLOR: firebrick; +text-decoration: underline; +} + +.clickable +{ +cursor: pointer +} + +.unread_title +{ +font-weight: bold; +} + +.read_title +{ +font-weight: normal; +} + +.summary +{ +color: DimGrey; +} + +.hidden +{ +display: none; +} + +.source_name +{ +width: 600px; +} + +.alert_text +{ +width: 600px; +} + +.alert_data +{ +margin-left: 10px; +width: 800px; +height: 800px; +} + +.source_0 +{ +background-color: LightGreen; +} + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/build.xml new file mode 100644 index 0000000000..7f77b9270d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/pom.xml new file mode 100644 index 0000000000..cc4a64a56f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/pom.xml @@ -0,0 +1,50 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-help-pages + Apache Tuscany SCA Tours Help Pages Contribution + + + + org.apache.tuscany.sca + tuscany-implementation-resource-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-http-runtime + ${tuscany.version} + runtime + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..038f9260b4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/help-pages.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/help-pages.composite new file mode 100644 index 0000000000..1ef8c0a6b1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/help-pages.composite @@ -0,0 +1,32 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/help_pages/BookingAHoliday.html b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/help_pages/BookingAHoliday.html new file mode 100644 index 0000000000..194ecd1183 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/help_pages/BookingAHoliday.html @@ -0,0 +1,34 @@ + + + + + +Tuscany SCA Tours Help - Booking a holiday + + + +

Tuscany SCA Tours Help Pages - Booking a holiday

+ +

This page contains instructions on how to book a holiday with SCA Tours

+ +

More help text would go here.....

+ + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/help_pages/BookingAHotel.html b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/help_pages/BookingAHotel.html new file mode 100644 index 0000000000..bde4d25226 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/help_pages/BookingAHotel.html @@ -0,0 +1,34 @@ + + + + + +Tuscany SCA Tours Help - Booking a hotel + + + +

Tuscany SCA Tours Help Pages - Booking a hotel

+ +

This page contains instructions on how to book a hotel with SCA Tours

+ +

More help text would go here.....

+ + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/help_pages/MakingPayments.html b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/help_pages/MakingPayments.html new file mode 100644 index 0000000000..a1b24f4d23 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/help_pages/MakingPayments.html @@ -0,0 +1,34 @@ + + + + + +Tuscany SCA Tours Help - Making Payments + + + +

Tuscany SCA Tours Help Pages - Making Payments

+ +

This page contains instructions on how to make payments to SCA Tours

+ +

More help text would go here.....

+ + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/help_pages/index.html b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/help_pages/index.html new file mode 100644 index 0000000000..4972752ea1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/help-pages/src/main/resources/help_pages/index.html @@ -0,0 +1,59 @@ + + + + + +Tuscany SCA Tours Help + + + +

Tuscany SCA Tours Help Pages

+ +

Welcome to the Tuscany SCA Tours help pages.

+

How can we help you?

+ +

Making a booking

+ + +

Making payments

+ + +

Preparing to travel

+
    +
  • Passports and Visas
  • +
  • Pre-travel health checks
  • +
  • Things to pack checklist
  • +
+ +

Contact customer support

+
    +
  • By Email
  • +
  • By Phone
  • +
  • By Post
  • +
+ + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/build.xml new file mode 100644 index 0000000000..f624c43a01 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/build.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/pom.xml new file mode 100644 index 0000000000..fa05bc968a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/pom.xml @@ -0,0 +1,49 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-hotel + Apache Tuscany SCA Tours Hotel Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + scatours-contribution-common + ${pom.version} + provided + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/src/main/java/com/tuscanyscatours/hotel/HotelInfo.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/src/main/java/com/tuscanyscatours/hotel/HotelInfo.java new file mode 100644 index 0000000000..e2912c50fc --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/src/main/java/com/tuscanyscatours/hotel/HotelInfo.java @@ -0,0 +1,118 @@ +/* + * 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 com.tuscanyscatours.hotel; + +public class HotelInfo { + + private String name; + private String description; + private String location; + private String date; + private String beds; + private double pricePerBed; + private String currency; + private String link; + + public HotelInfo() { + } + + public HotelInfo(String name, + String description, + String location, + String date, + String beds, + double pricePerBed, + String currency, + String link) { + + this.name = name; + this.description = description; + this.location = location; + this.date = date; + this.beds = beds; + this.pricePerBed = pricePerBed; + this.currency = currency; + this.link = link; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public String getBeds() { + return beds; + } + + public void setBeds(String beds) { + this.beds = beds; + } + + public double getPricePerBed() { + return pricePerBed; + } + + public void setPricePerBed(double pricePerBed) { + this.pricePerBed = pricePerBed; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/src/main/java/com/tuscanyscatours/hotel/HotelManagement.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/src/main/java/com/tuscanyscatours/hotel/HotelManagement.java new file mode 100644 index 0000000000..476da9a544 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/src/main/java/com/tuscanyscatours/hotel/HotelManagement.java @@ -0,0 +1,24 @@ +/* + * 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 com.tuscanyscatours.hotel; + +public interface HotelManagement { + void addHotelInfo(HotelInfo hotelInfo); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/src/main/java/com/tuscanyscatours/hotel/impl/HotelImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/src/main/java/com/tuscanyscatours/hotel/impl/HotelImpl.java new file mode 100644 index 0000000000..fe8953ea0e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/src/main/java/com/tuscanyscatours/hotel/impl/HotelImpl.java @@ -0,0 +1,105 @@ +/* + * 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 com.tuscanyscatours.hotel.impl; + +import java.util.ArrayList; +import java.util.List; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.common.Book; +import com.tuscanyscatours.common.Search; +import com.tuscanyscatours.common.SearchCallback; +import com.tuscanyscatours.common.TripItem; +import com.tuscanyscatours.common.TripLeg; +import com.tuscanyscatours.hotel.HotelInfo; +import com.tuscanyscatours.hotel.HotelManagement; + +/** + * An implementation of the Hotel service + */ +@Scope("STATELESS") +@Service(interfaces = {Search.class, Book.class, HotelManagement.class}) +public class HotelImpl implements Search, Book, HotelManagement { + + private List hotels = new ArrayList(); + + @Callback + protected SearchCallback searchCallback; + + @Init + public void init() { + hotels.add(new HotelInfo("Deep Bay Hotel", "Wonderful sea views and a relaxed atmosphere", "FLR", "06/12/09", + "200", 100, "EUR", "http://localhost:8085/tbd")); + hotels.add(new HotelInfo("Long Bay Hotel", "Friendly staff and an ocean breeze", "FLR", "06/12/09", "200", 100, + "EUR", "http://localhost:8085/tbd")); + hotels.add(new HotelInfo("City Hotel", "Smart rooms and early breakfasts", "FLR", "06/12/09", "200", 100, + "EUR", "http://localhost:8085/tbd")); + hotels.add(new HotelInfo("County Hotel", "The smell of the open country", "FLR", "06/12/09", "200", 100, "EUR", + "http://localhost:8085/tbd")); + } + + public TripItem[] searchSynch(TripLeg tripLeg) { + List items = new ArrayList(); + + // find available hotels + for (HotelInfo hotel : hotels) { + if (hotel.getLocation().equals(tripLeg.getToLocation())) { + TripItem item = + new TripItem("", "", TripItem.HOTEL, hotel.getName(), hotel.getDescription(), hotel.getLocation(), + tripLeg.getFromDate(), tripLeg.getToDate(), hotel.getPricePerBed(), hotel + .getCurrency(), hotel.getLink()); + items.add(item); + } + } + + return items.toArray(new TripItem[items.size()]); + } + + public void searchAsynch(TripLeg tripLeg) { + System.out.println("Starting hotel search"); + + // pretend that this processing takes some time to complete + try { + Thread.sleep(3000); + } catch (Exception ex) { + // do nothing + } + + // return available hotels + TripItem[] items = searchSynch(tripLeg); + searchCallback.searchResults(items); + } + + public int getPercentComplete() { + return 100; + } + + public String book(TripItem tripItem) { + return "hotel1"; + } + + public void addHotelInfo(HotelInfo hotelInfo) { + hotels.add(hotelInfo); + System.out.println("Added hotel info - " + hotelInfo.getName()); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..40382221a5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/hotel/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/build.xml new file mode 100644 index 0000000000..0d03b5401d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/build.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/pom.xml new file mode 100644 index 0000000000..72b335074a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/pom.xml @@ -0,0 +1,77 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-interaction-client + Apache Tuscany SCA Tours Interaction Client Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + scatours-contribution-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + scatours-contribution-calendar + ${pom.version} + provided + + + + org.apache.tuscany.sca + scatours-contribution-hotel + ${pom.version} + provided + + + + org.apache.tuscany.sca + scatours-contribution-currency + ${pom.version} + provided + + + + org.apache.tuscany.sca + scatours-contribution-shoppingcart + ${pom.version} + provided + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionConversationClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionConversationClientImpl.java new file mode 100644 index 0000000000..290e6e6aee --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionConversationClientImpl.java @@ -0,0 +1,73 @@ +/* + * 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.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.common.TripItem; +import com.tuscanyscatours.shoppingcart.CartStore; + +@Scope("COMPOSITE") +@Service(Runnable.class) +public class InteractionConversationClientImpl implements Runnable { + + @Reference + protected CartStore cartStoreConversation; + + public void run() { + System.out.println("\nCalling cart store using the conversational interaction pattern"); + + // add some trip items to the cart store + TripItem tripItem = getTestTripItem(); + cartStoreConversation.addTrip(tripItem); + + tripItem.setDescription("2nd trip item"); + cartStoreConversation.addTrip(tripItem); + + tripItem.setDescription("3rd trip item"); + cartStoreConversation.addTrip(tripItem); + + System.out.println("Trip items now in cart"); + TripItem[] tripItems = cartStoreConversation.getTrips(); + for (TripItem item : tripItems) { + System.out.println("Item - " + item.getDescription()); + } + + System.out.println("Reset the cart"); + cartStoreConversation.reset(); + + System.out.println("Trip items now in cart"); + tripItems = cartStoreConversation.getTrips(); + for (TripItem item : tripItems) { + System.out.println("Item - " + item.getDescription()); + } + } + + private TripItem getTestTripItem() { + TripItem tripItem = new TripItem(); + tripItem.setLocation("FLR"); + tripItem.setFromDate("06/12/09 00:00"); + tripItem.setToDate("13/12/09 00:00"); + tripItem.setDescription("1st trip item"); + return tripItem; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionLocalClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionLocalClientImpl.java new file mode 100644 index 0000000000..ca3cb2874a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionLocalClientImpl.java @@ -0,0 +1,53 @@ +/* + * 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.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.calendar.Calendar; +import com.tuscanyscatours.common.TripLeg; + +@Service(Runnable.class) +public class InteractionLocalClientImpl implements Runnable { + + @Reference + protected Calendar calendarLocal; + + public void run() { + System.out.println("\nCalling calendar component over a local binding"); + TripLeg tripLeg = getTestTripLeg(); + String toDate = calendarLocal.getEndDate(tripLeg.getFromDate(), 10); + tripLeg.setToDate(toDate); + System.out.println("Calculated trip end date - " + toDate); + ; + } + + private TripLeg getTestTripLeg() { + TripLeg tripLeg = new TripLeg(); + tripLeg.setFromLocation("LGW"); + tripLeg.setToLocation("FLR"); + tripLeg.setFromDate("06/12/09 00:00"); + tripLeg.setToDate("13/12/09 00:00"); + tripLeg.setNoOfPeople("1"); + tripLeg.setId("TRIP27"); + return tripLeg; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionOneWayCallbackClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionOneWayCallbackClientImpl.java new file mode 100644 index 0000000000..9689ce8e0c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionOneWayCallbackClientImpl.java @@ -0,0 +1,78 @@ +/* + * 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.client.impl; + +import java.util.concurrent.CountDownLatch; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.common.Search; +import com.tuscanyscatours.common.SearchCallback; +import com.tuscanyscatours.common.TripItem; +import com.tuscanyscatours.common.TripLeg; + +@Scope("COMPOSITE") +@Service(Runnable.class) +public class InteractionOneWayCallbackClientImpl implements Runnable, SearchCallback { + + @Reference + protected Search hotelSearchOneWayCallback; + + CountDownLatch resultsReceivedCountdown; + + public void run() { + System.out.println("\nCalling hotel component using both one way and callback interation patterns"); + resultsReceivedCountdown = new CountDownLatch(1); + TripLeg tripLeg = getTestTripLeg(); + hotelSearchOneWayCallback.searchAsynch(tripLeg); + + // start other searched here while the hotel search progresses + + // wait for responses to come back + try { + resultsReceivedCountdown.await(); + } catch (InterruptedException ex) { + } + } + + public void searchResults(TripItem[] items) { + for (TripItem tripItem : items) { + System.out.println("Found hotel - " + tripItem.getName()); + } + resultsReceivedCountdown.countDown(); + } + + public void setPercentComplete(String searchComponent, int percentComplete) { + // Not used in this sample + } + + private TripLeg getTestTripLeg() { + TripLeg tripLeg = new TripLeg(); + tripLeg.setFromLocation("LGW"); + tripLeg.setToLocation("FLR"); + tripLeg.setFromDate("06/12/09 00:00"); + tripLeg.setToDate("13/12/09 00:00"); + tripLeg.setNoOfPeople("1"); + tripLeg.setId("TRIP27"); + return tripLeg; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionRemoteClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionRemoteClientImpl.java new file mode 100644 index 0000000000..1fd9d9cbe8 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionRemoteClientImpl.java @@ -0,0 +1,64 @@ +/* + * 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.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.common.Search; +import com.tuscanyscatours.common.SearchCallback; +import com.tuscanyscatours.common.TripItem; +import com.tuscanyscatours.common.TripLeg; + +@Service(Runnable.class) +public class InteractionRemoteClientImpl implements Runnable, SearchCallback { + + @Reference + protected Search hotelSearchRemote; + + public void run() { + System.out.println("\nCalling hotel component over a remote binding"); + TripLeg tripLeg = getTestTripLeg(); + TripItem[] tripItems = hotelSearchRemote.searchSynch(tripLeg); + for (TripItem tripItem : tripItems) { + System.out.println("Found hotel - " + tripItem.getName()); + } + } + + public void searchResults(TripItem[] items) { + // we are calling the hotel component synchronously here + // so the callback interface is not used + } + + public void setPercentComplete(String searchComponent, int percentComplete) { + // Not used in this sample + } + + private TripLeg getTestTripLeg() { + TripLeg tripLeg = new TripLeg(); + tripLeg.setFromLocation("LGW"); + tripLeg.setToLocation("FLR"); + tripLeg.setFromDate("06/12/09 00:00"); + tripLeg.setToDate("13/12/09 00:00"); + tripLeg.setNoOfPeople("1"); + tripLeg.setId("TRIP27"); + return tripLeg; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionRequestResponseClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionRequestResponseClientImpl.java new file mode 100644 index 0000000000..d1438434ae --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionRequestResponseClientImpl.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 scatours.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.currencyconverter.CurrencyConverter; + +@Service(Runnable.class) +public class InteractionRequestResponseClientImpl implements Runnable { + + @Reference + protected CurrencyConverter currencyConverterRequestResponse; + + public void run() { + System.out.println("\nCalling currency converter component using request response interation pattern"); + double exchangeRate = currencyConverterRequestResponse.getExchangeRate("GBP", "USD"); + System.out.println("GBP to USD exchange rate is " + exchangeRate); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..283a1588df --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/resources/client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/resources/client.composite new file mode 100644 index 0000000000..1c8552974b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-client/src/main/resources/client.composite @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-service-remote/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-service-remote/build.xml new file mode 100644 index 0000000000..10451b6248 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-service-remote/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-service-remote/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-service-remote/pom.xml new file mode 100644 index 0000000000..ebe4f813d5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-service-remote/pom.xml @@ -0,0 +1,34 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-interaction-service-remote + Apache Tuscany SCA Tours Interaction Service Remote Contribution + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-service-remote/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-service-remote/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..c26d63563b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-service-remote/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,26 @@ + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-service-remote/src/main/resources/service.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-service-remote/src/main/resources/service.composite new file mode 100644 index 0000000000..0f368da1ed --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/interaction-service-remote/src/main/resources/service.composite @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-client/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-client/build.xml new file mode 100644 index 0000000000..6a85f2066e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-client/build.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-client/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-client/pom.xml new file mode 100644 index 0000000000..0f65f7f5e2 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-client/pom.xml @@ -0,0 +1,49 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-introducing-client + Apache Tuscany SCA Tours Introducing Client Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + scatours-contribution-introducing-tours + ${pom.version} + provided + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-client/src/main/java/scatours/client/impl/TestClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-client/src/main/java/scatours/client/impl/TestClientImpl.java new file mode 100644 index 0000000000..f81a2c7304 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-client/src/main/java/scatours/client/impl/TestClientImpl.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.client.impl; + +import java.math.BigDecimal; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.Bookings; +import com.tuscanyscatours.Checkout; + +@Service(Runnable.class) +public class TestClientImpl { + @Reference + protected Bookings bookings; + + @Reference + protected Checkout checkout; + + public TestClientImpl() { + } + + 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/tags/travelsample-1.0-RC3/contributions/introducing-client/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-client/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..9ce11f16ef --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-client/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-client/src/main/resources/client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-client/src/main/resources/client.composite new file mode 100644 index 0000000000..3a404eb10d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-client/src/main/resources/client.composite @@ -0,0 +1,29 @@ + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/build.xml new file mode 100644 index 0000000000..f269f6577b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/pom.xml new file mode 100644 index 0000000000..e3647bee6a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/pom.xml @@ -0,0 +1,42 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-introducing-tours + Apache Tuscany SCA Tours Introducing Tours Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/goodvaluetrips/Trips.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/goodvaluetrips/Trips.java new file mode 100644 index 0000000000..365a210368 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/goodvaluetrips/Trips.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 com.goodvaluetrips; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Trips { + String checkAvailability(String trip, int people); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/tuscanyscatours/Bookings.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/tuscanyscatours/Bookings.java new file mode 100644 index 0000000000..9d54d46bb6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/tuscanyscatours/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 com.tuscanyscatours; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Bookings { + String newBooking(String trip, int people); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/tuscanyscatours/Checkout.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/tuscanyscatours/Checkout.java new file mode 100644 index 0000000000..29c84d2bc0 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/tuscanyscatours/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 com.tuscanyscatours; + +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/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/tuscanyscatours/Updates.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/tuscanyscatours/Updates.java new file mode 100644 index 0000000000..e33b0399cb --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/tuscanyscatours/Updates.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 com.tuscanyscatours; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Updates { + void addTrip(String resCode); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/ShoppingCartImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/ShoppingCartImpl.java new file mode 100644 index 0000000000..629ea7b5ec --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/ShoppingCartImpl.java @@ -0,0 +1,49 @@ +/* + * 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 com.tuscanyscatours.impl; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import com.tuscanyscatours.Checkout; +import com.tuscanyscatours.Updates; + +public class ShoppingCartImpl implements Checkout, Updates { + private static List bookedTrips = new ArrayList(); + + protected String currency = "USD"; + + public void makePayment(BigDecimal amount, String cardInfo) { + System.out.print("Charged " + currency + " " + amount + + " to card " + + cardInfo + + " for " + + (bookedTrips.size() > 1 ? "trips" : "trip")); + for (String trip : bookedTrips) { + System.out.print(" " + trip); + } + System.out.println(); + bookedTrips.clear(); + } + + public void addTrip(String resCode) { + bookedTrips.add(resCode); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/TripBookingImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/TripBookingImpl.java new file mode 100644 index 0000000000..f2884f87c5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/TripBookingImpl.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 com.tuscanyscatours.impl; + +import org.osoa.sca.annotations.Reference; + +import com.goodvaluetrips.Trips; +import com.tuscanyscatours.Bookings; +import com.tuscanyscatours.Updates; + +public class TripBookingImpl implements Bookings { + @Reference + protected Trips mytrips; + + @Reference + protected Updates cart; + + public String newBooking(String trip, int people) { + String resCode = mytrips.checkAvailability(trip, people); + cart.addTrip(resCode); + return "GV" + resCode; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..5f76588dad --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/resources/tours.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/resources/tours.composite new file mode 100644 index 0000000000..6d47793aa4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-tours/src/main/resources/tours.composite @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/build.xml new file mode 100644 index 0000000000..9d65c703b7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/pom.xml new file mode 100644 index 0000000000..b1d29e8bcb --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/pom.xml @@ -0,0 +1,42 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-introducing-trips + Apache Tuscany SCA Tours Introducing Trips Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/src/main/java/com/goodvaluetrips/Trips.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/src/main/java/com/goodvaluetrips/Trips.java new file mode 100644 index 0000000000..365a210368 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/src/main/java/com/goodvaluetrips/Trips.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 com.goodvaluetrips; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Trips { + String checkAvailability(String trip, int people); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/src/main/java/com/goodvaluetrips/impl/TripProviderImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/src/main/java/com/goodvaluetrips/impl/TripProviderImpl.java new file mode 100644 index 0000000000..06f93f2637 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/src/main/java/com/goodvaluetrips/impl/TripProviderImpl.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 com.goodvaluetrips.impl; + +import com.goodvaluetrips.Trips; + +public class TripProviderImpl implements Trips { + public String checkAvailability(String trip, int people) { + // call non-SCA code to reserve trip and return booking code + return "6R98Y"; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..85e064b1a2 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/src/main/resources/trips.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/src/main/resources/trips.composite new file mode 100644 index 0000000000..8d1db35b1f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/introducing-trips/src/main/resources/trips.composite @@ -0,0 +1,30 @@ + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-corba/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-corba/build.xml new file mode 100644 index 0000000000..1baf6ab153 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-corba/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-corba/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-corba/pom.xml new file mode 100644 index 0000000000..1d543221a4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-corba/pom.xml @@ -0,0 +1,43 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-notification-corba + Apache Tuscany SCA Tours Notification Contribution Which Uses SMSGateway CORBA Service + + + + org.apache.tuscany.sca + tuscany-binding-corba-runtime + ${tuscany.version} + runtime + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-corba/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-corba/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..373d1494f6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-corba/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-corba/src/main/resources/notification-corba.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-corba/src/main/resources/notification-corba.composite new file mode 100644 index 0000000000..8baca02509 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-corba/src/main/resources/notification-corba.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ejb/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ejb/build.xml new file mode 100644 index 0000000000..3b7e660a5d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ejb/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ejb/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ejb/pom.xml new file mode 100644 index 0000000000..36d43ef326 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ejb/pom.xml @@ -0,0 +1,43 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-notification-ejb + Apache Tuscany SCA Tours Notification Contribution Which Uses SMSGateway EJB Service + + + + org.apache.tuscany.sca + tuscany-binding-ejb-runtime + ${tuscany.version} + runtime + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ejb/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ejb/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..373d1494f6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ejb/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ejb/src/main/resources/notification-ejb.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ejb/src/main/resources/notification-ejb.composite new file mode 100644 index 0000000000..11b632fd79 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ejb/src/main/resources/notification-ejb.composite @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-jms/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-jms/build.xml new file mode 100644 index 0000000000..0b1b80c44f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-jms/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-jms/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-jms/pom.xml new file mode 100644 index 0000000000..f90cbd9cc5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-jms/pom.xml @@ -0,0 +1,43 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-notification-jms + Apache Tuscany SCA Tours Notification Contribution Which Uses SMSGateway JMS Service + + + + org.apache.tuscany.sca + tuscany-binding-jms-runtime + ${tuscany.version} + runtime + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-jms/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-jms/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..373d1494f6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-jms/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-jms/src/main/resources/notification-jms.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-jms/src/main/resources/notification-jms.composite new file mode 100644 index 0000000000..dfd96ae918 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-jms/src/main/resources/notification-jms.composite @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-rmi/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-rmi/build.xml new file mode 100644 index 0000000000..de8d5bbb06 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-rmi/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-rmi/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-rmi/pom.xml new file mode 100644 index 0000000000..44ecdbc9cd --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-rmi/pom.xml @@ -0,0 +1,43 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-notification-rmi + Apache Tuscany SCA Tours Notification Contribution Which Uses SMSGateway RMI Service + + + + org.apache.tuscany.sca + tuscany-binding-rmi-runtime + ${tuscany.version} + runtime + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-rmi/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-rmi/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..373d1494f6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-rmi/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-rmi/src/main/resources/notification-rmi.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-rmi/src/main/resources/notification-rmi.composite new file mode 100644 index 0000000000..e80c381b55 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-rmi/src/main/resources/notification-rmi.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ws/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ws/build.xml new file mode 100644 index 0000000000..bac935bc5a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ws/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ws/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ws/pom.xml new file mode 100644 index 0000000000..a3b00f1500 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ws/pom.xml @@ -0,0 +1,43 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-notification-ws + Apache Tuscany SCA Tours Notification Contribution Which Uses SMSGateway Web Service + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ws/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ws/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..373d1494f6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ws/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ws/src/main/resources/notification-ws.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ws/src/main/resources/notification-ws.composite new file mode 100644 index 0000000000..e2051ad612 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification-ws/src/main/resources/notification-ws.composite @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/build.xml new file mode 100644 index 0000000000..ff7e56c8b7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/pom.xml new file mode 100644 index 0000000000..cc6c38c267 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/pom.xml @@ -0,0 +1,49 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-notification + Apache Tuscany SCA Tours Notification Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/src/main/java/com/tuscanyscatours/notification/Notification.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/src/main/java/com/tuscanyscatours/notification/Notification.java new file mode 100644 index 0000000000..7ae26b93e4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/src/main/java/com/tuscanyscatours/notification/Notification.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 com.tuscanyscatours.notification; + +public interface Notification { + + boolean notify(String accountID, String subject, String message); + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/src/main/java/com/tuscanyscatours/notification/impl/NotificationImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/src/main/java/com/tuscanyscatours/notification/impl/NotificationImpl.java new file mode 100644 index 0000000000..58d590242d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/src/main/java/com/tuscanyscatours/notification/impl/NotificationImpl.java @@ -0,0 +1,58 @@ +/* + * 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 com.tuscanyscatours.notification.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.notification.Notification; +import com.tuscanyscatours.smsgateway.SMSGateway; + +@Service(Notification.class) +public class NotificationImpl implements Notification { + + /** + * Use "Fake" phone number that has been reserved by Ofcom. + * See: http://www.ofcom.org.uk/telecoms/ioi/numbers/num_drama?a=87101 + */ + private static final String SCA_TOURS_SMS = "+44(0)2079460723"; + + @Reference + protected SMSGateway smsGateway; + + public boolean notify(String accountID, String subject, String message) { + + boolean result = true; + + String sms = getSMSAddress(accountID); + if (sms != null) { + System.out.println("Sending SMS to " + sms + " for accountID " + accountID); + result &= smsGateway.sendSMS(SCA_TOURS_SMS, sms, subject + ". " + message); + } + + return result; + } + + private String getSMSAddress(String accountID) { + // Use "Fake" phone number that has been reserved by Ofcom. + // See: http://www.ofcom.org.uk/telecoms/ioi/numbers/num_drama?a=87101 + return "+44(0)7700900812"; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java new file mode 100644 index 0000000000..fdf5872565 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java @@ -0,0 +1,30 @@ +/* + * 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 com.tuscanyscatours.smsgateway; + +import org.osoa.sca.annotations.Remotable; + +/** + * A gateway to send SMS messages. + */ +@Remotable +public interface SMSGateway { + boolean sendSMS(String fromNumber, String toNumber, String text); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..518c7e363b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/notification/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/build.xml new file mode 100644 index 0000000000..5e2921995c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/build.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/pom.xml new file mode 100644 index 0000000000..ab331b303b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/pom.xml @@ -0,0 +1,46 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-payment-bpel-process + Apache Tuscany SCA Tours Payment BPEL Process Contribution + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + **/*.cbp + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/src/main/resources/CreditCardPayment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/src/main/resources/CreditCardPayment.wsdl new file mode 100644 index 0000000000..22ef6de317 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/src/main/resources/CreditCardPayment.wsdl @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/src/main/resources/EmailGateway.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/src/main/resources/EmailGateway.wsdl new file mode 100644 index 0000000000..a097d9b7e4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/src/main/resources/EmailGateway.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..f32584eee1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..e2c4062f2e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/src/main/resources/payment.bpel b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/src/main/resources/payment.bpel new file mode 100644 index 0000000000..e304d3a349 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel-process/src/main/resources/payment.bpel @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Visa + 12345678 + 2 + 2010 + + Empty +
+ 1 The Road + Winchester + Hampshire + AB1 2CD + 12345678 +
+
+
+ 0.0 +
+
+
+ $authorizeRequestMessage.parameters +
+ + $makePaymentMemberRequestMessage.parameters/CustomerId/text() + $authorizeRequestMessage.parameters/CreditCard/CardOwner/Name + + + $makePaymentMemberRequestMessage.parameters/Amount/text() + $authorizeRequestMessage.parameters/Amount + +
+ + + + + + + + + + + Default + Payment Confirmation + Your payment has been confirmed + + + + + $sendEmailRequestMessage.parameters + + + $makePaymentMemberRequestMessage.parameters/CustomerId/text() + $sendEmailRequestMessage.parameters/Email/To + + + + + + + + + + + + OK + + + $makePaymentMemberResponseMessage.parameters + + + + + + +
+
diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/build.xml new file mode 100644 index 0000000000..a725645c77 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/build.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/log4j.properties b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/log4j.properties new file mode 100644 index 0000000000..7ed0bcaf77 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/log4j.properties @@ -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. +# + +# Set root logger level to WARN and its only appender to CONSOLE +log4j.rootLogger=OFF, CONSOLE + +# log4j properties to work with commandline tools. +log4j.category.org.mortbay=OFF +log4j.category.org.hibernate.type=OFF +log4j.category.org.objectweb=OFF +log4j.category.org.apache.ode.axis2=OFF +log4j.category.org.apache.ode.bpel.engine=DEBUG +log4j.category.org.apache.ode.daohib.bpel.CorrelatorDaoImpl=OFF +log4j.category.org.apache.ode.bpel.epr=OFF +log4j.category.org.apache.tuscany.sca.implementation.bpel=DEBUG +log4j.category.org.apache.tuscany.sca.implementation.bpel.ode=DEBUG +log4j.category.org.apache.tuscany.sca.implementation.bpel.provider=DEBUG + +# Console appender +log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender +log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout +log4j.appender.CONSOLE.layout.ConversionPattern=[%p] - %C{1}.%M(%L) | %m%n diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/pom.xml new file mode 100644 index 0000000000..6d1089c5da --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/pom.xml @@ -0,0 +1,214 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-payment-bpel + Apache Tuscany SCA Tours Payment BPEL Contribution + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-bpel-ode + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + test + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + wsimport + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/payment.stale + false + true + + + + payment.creditcard + process-sources + + wsimport + + + com.tuscanyscatours.payment.creditcard + ${basedir}/src/main/resources + + CreditCardPayment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/creditcard.stale + false + true + + + + emailgateway + process-sources + + wsimport + + + com.tuscanyscatours.emailgateway + ${basedir}/src/main/resources + + EmailGateway.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/emailgateway.stale + false + true + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + 2.3.1 + + false + false + true + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + test-compile + + unpack + + + + + org.apache.ode + ode-dao-jpa-ojpa-derby + 1.1.1 + zip + true + ${project.build.directory}/test-classes/ + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/main/resources/CreditCardPayment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/main/resources/CreditCardPayment.wsdl new file mode 100644 index 0000000000..22ef6de317 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/main/resources/CreditCardPayment.wsdl @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/main/resources/EmailGateway.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/main/resources/EmailGateway.wsdl new file mode 100644 index 0000000000..a097d9b7e4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/main/resources/EmailGateway.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..e95a8bf0a3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..e2c4062f2e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/main/resources/payment.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/main/resources/payment.composite new file mode 100644 index 0000000000..5c337799a7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/main/resources/payment.composite @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/test/java/scatours/payment/PaymentTestCase.java new file mode 100644 index 0000000000..6db4934edf --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/test/java/scatours/payment/PaymentTestCase.java @@ -0,0 +1,87 @@ +/* + * 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.payment; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.tuscanyscatours.payment.Payment; + +/** + * + */ +public class PaymentTestCase { + private static SCANode paymentNode; + private static SCANode creditCardNode; + private static SCANode emailGatewayNode; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + creditCardNode = + SCANodeFactory.newInstance() + .createSCANode("creditcard.composite", + new SCAContribution("creditcard", "../creditcard-payment-jaxb/target/classes")); + + creditCardNode.start(); + + emailGatewayNode = + SCANodeFactory.newInstance().createSCANode("emailgateway.composite", + new SCAContribution("emailgateway", + "../emailgateway/target/classes"), + new SCAContribution("emailgateway-test", + "../emailgateway/target/test-classes")); + + emailGatewayNode.start(); + + paymentNode = + SCANodeFactory.newInstance() + .createSCANode(null, + new SCAContribution("payment-bpel-process", + "../payment-bpel-process/target/classes"), + new SCAContribution("payment-bpel", "./target/classes"), + new SCAContribution("payment-bpel-test", "./target/test-classes")); + + paymentNode.start(); + } + + @Test + public void testPayment() { + SCAClient client = (SCAClient)paymentNode; + Payment payment = client.getService(Payment.class, "PaymentClient"); + String result = payment.makePaymentMember("Fred", 100.00f); + System.out.println("Result = " + result); + if (!"OK".equals(result)) { + throw new RuntimeException(result); + } + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + paymentNode.stop(); + creditCardNode.stop(); + emailGatewayNode.stop(); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java new file mode 100644 index 0000000000..a38ba51ac5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java @@ -0,0 +1,37 @@ +/* + * 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.payment.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.payment.Payment; + +@Service(Payment.class) +public class PaymentClientImpl implements Payment { + @Reference + protected Payment payment; + + public String makePaymentMember(String customerId, float amount) { + // Delegate the external web service + return payment.makePaymentMember(customerId, amount); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/test/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/test/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..fcfc2d7c61 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/test/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/test/resources/payment-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/test/resources/payment-client.composite new file mode 100644 index 0000000000..a5110aacff --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-bpel/src/test/resources/payment-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/build.xml new file mode 100644 index 0000000000..bc16f99976 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/build.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/pom.xml new file mode 100644 index 0000000000..8294c5d66e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/pom.xml @@ -0,0 +1,161 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-payment-groovy + Apache Tuscany SCA Tours Payment Groovy Contribution + + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-implementation-script + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + test + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + payment + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/payment.stale + false + true + + + + emailgateway + process-sources + + wsimport + + + com.tuscanyscatours.emailgateway + ${basedir}/src/main/resources + + EmailGateway.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/emailgateway.stale + false + true + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/EmailGateway.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/EmailGateway.wsdl new file mode 100644 index 0000000000..a097d9b7e4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/EmailGateway.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..36e2990be1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..2519d7642e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/payment.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/payment.composite new file mode 100644 index 0000000000..071c6786d1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/payment.composite @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + 0.02 + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/payment/PaymentImpl.groovy b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/payment/PaymentImpl.groovy new file mode 100644 index 0000000000..854fbd2f4a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/main/resources/payment/PaymentImpl.groovy @@ -0,0 +1,31 @@ +/* + * 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. + */ + +def makePaymentMember(customerId, amount) { + + def finalAmount = amount + transactionFee; + + com.tuscanyscatours.emailgateway.EmailType email = new com.tuscanyscatours.emailgateway.EmailType(); + email.setTo(customerId); + email.setTitle("Payment " + finalAmount + " Received"); + + emailGateway.sendEmail(email); + + return "Success"; +} \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/java/scatours/payment/PaymentTestCase.java new file mode 100644 index 0000000000..c96fddb6b3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/java/scatours/payment/PaymentTestCase.java @@ -0,0 +1,77 @@ +/* + * 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.payment; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.tuscanyscatours.payment.Payment; + +/** + * + */ +public class PaymentTestCase { + + private static SCANode paymentNode; + private static SCANode emailGatewayNode; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + emailGatewayNode = + SCANodeFactory.newInstance().createSCANode("emailgateway.composite", + new SCAContribution("emailgateway", + "../emailgateway/target/classes"), + new SCAContribution("emailgateway-test", + "../emailgateway/target/test-classes")); + + emailGatewayNode.start(); + + paymentNode = + SCANodeFactory.newInstance().createSCANode(null, + new SCAContribution("payment-groovy", "./target/classes"), + new SCAContribution("payment-groovy-test", + "./target/test-classes")); + + paymentNode.start(); + } + + @Test + public void testPayment() { + SCAClient client = (SCAClient)paymentNode; + Payment payment = client.getService(Payment.class, "PaymentClient"); + String result = payment.makePaymentMember("Fred", 100.00f); + System.out.println("Result = " + result); + if (!"Success".equals(result)) { + throw new RuntimeException(result); + } + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + paymentNode.stop(); + emailGatewayNode.stop(); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java new file mode 100644 index 0000000000..a38ba51ac5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java @@ -0,0 +1,37 @@ +/* + * 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.payment.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.payment.Payment; + +@Service(Payment.class) +public class PaymentClientImpl implements Payment { + @Reference + protected Payment payment; + + public String makePaymentMember(String customerId, float amount) { + // Delegate the external web service + return payment.makePaymentMember(customerId, amount); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..9b3e309d11 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/resources/payment-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/resources/payment-client.composite new file mode 100644 index 0000000000..353c1cea04 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-groovy/src/test/resources/payment-client.composite @@ -0,0 +1,32 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/build.xml new file mode 100644 index 0000000000..c20d49800e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/build.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/pom.xml new file mode 100644 index 0000000000..aad39e76ac --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/pom.xml @@ -0,0 +1,153 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-payment-java-callback + Apache Tuscany SCA Tours Payment Java Callback Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + test + + + + junit + junit + 4.5 + test + + + + + + + java.net2 + java.net Maven 2.x Repository + http://download.java.net/maven/2 + + false + + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + payment + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/payment.stale + false + true + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/customer/Customer.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/customer/Customer.java new file mode 100644 index 0000000000..3b72f81b33 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/customer/Customer.java @@ -0,0 +1,70 @@ +/* + * 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 com.tuscanyscatours.customer; + +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; + +/** + * Customer data + */ +public class Customer { + private String id; + private String email; + private String name; + + private CreditCardDetailsType creditCard; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreditCardDetailsType getCreditCard() { + return creditCard; + } + + public void setCreditCard(CreditCardDetailsType creditCard) { + this.creditCard = creditCard; + } + + public String toString() { + return "id: " + id + " name: " + name + " e-mail: " + email; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java new file mode 100644 index 0000000000..b08f76e0fa --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java @@ -0,0 +1,57 @@ +/* + * 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 com.tuscanyscatours.customer; + +public class CustomerNotFoundException extends Exception { + private static final long serialVersionUID = -129752837478357452L; + + /** + * + */ + public CustomerNotFoundException() { + + } + + /** + * @param message + */ + public CustomerNotFoundException(String message) { + super(message); + + } + + /** + * @param cause + */ + public CustomerNotFoundException(Throwable cause) { + super(cause); + + } + + /** + * @param message + * @param cause + */ + public CustomerNotFoundException(String message, Throwable cause) { + super(message, cause); + + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.java new file mode 100644 index 0000000000..706167d567 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.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 com.tuscanyscatours.customer; + +import java.util.Collection; + +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; + +/** + * Customer registry interface + */ +public interface CustomerRegistry { + Customer createCustomer(String name, String email, CreditCardDetailsType creditCard); + + boolean updateCustomer(Customer customer); + + Customer getCustomer(String id) throws CustomerNotFoundException; + + Collection getAllCustomers(); + + boolean deleteCustomer(String id); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java new file mode 100644 index 0000000000..bdf99dec72 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java @@ -0,0 +1,114 @@ +/* + * 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 com.tuscanyscatours.customer.impl; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.EagerInit; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Requires; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.customer.Customer; +import com.tuscanyscatours.customer.CustomerNotFoundException; +import com.tuscanyscatours.customer.CustomerRegistry; +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; +import com.tuscanyscatours.payment.creditcard.CreditCardTypeType; +import com.tuscanyscatours.payment.creditcard.PayerType; + +/** + * An in-memory customer registry implementation + */ +@Service(CustomerRegistry.class) +@Scope("COMPOSITE") +@EagerInit +@Requires("{http://www.osoa.org/xmlns/sca/1.0}managedTransaction.global") +public class CustomerRegistryImpl implements CustomerRegistry { + private volatile static int idGenerator = 0; + private Map customers = new HashMap(); + + @Init + public void init() { + // Load the customers + + CreditCardDetailsType cc = new CreditCardDetailsType(); + PayerType john = new PayerType(); + john.setName("John Smith"); + cc.setCardOwner(john); + cc.setCreditCardNumber("1111-2222-3333-4444"); + cc.setCreditCardType(CreditCardTypeType.VISA); + cc.setCVV2("1234"); + cc.setExpMonth(1); + cc.setExpYear(2012); + createCustomer("John Smith", "john@xyz.com", cc); + } + + @Destroy + public void destroy() { + // Save the customers + } + + public Customer createCustomer(String name, String email, CreditCardDetailsType creditCard) { + Customer customer = new Customer(); + customer.setId("c-" + idGenerator++); + customer.setName(name); + customer.setEmail(email); + customer.setCreditCard(creditCard); + customers.put(customer.getId(), customer); + return customer; + } + + public boolean deleteCustomer(String id) { + return customers.remove(id) != null; + } + + public Collection getAllCustomers() { + return customers.values(); + } + + public Customer getCustomer(String id) throws CustomerNotFoundException { + Customer customer = customers.get(id); + + if (customer == null) { + throw new CustomerNotFoundException("Customer " + id + " not found"); + } + + return customer; + } + + public boolean updateCustomer(Customer customer) { + Customer current = null; + try { + current = getCustomer(customer.getId()); + } catch (Exception ex) { + return false; + } + + current.setEmail(customer.getEmail()); + current.setName(customer.getName()); + current.setCreditCard(customer.getCreditCard()); + return true; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java new file mode 100644 index 0000000000..0fbf63d6bc --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java @@ -0,0 +1,30 @@ +/* + * 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 com.tuscanyscatours.emailgateway; + +import org.osoa.sca.annotations.Remotable; + +/** + * A gateway to send e-mail + */ +@Remotable +public interface EmailGateway { + public boolean sendEmail(String sender, String recipient, String subject, String body); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java new file mode 100644 index 0000000000..d9798e436a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java @@ -0,0 +1,37 @@ +/* + * 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 com.tuscanyscatours.emailgateway.impl; + +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.emailgateway.EmailGateway; + +@Service(EmailGateway.class) +public class EmailGatewayImpl implements EmailGateway { + + public boolean sendEmail(String sender, String recipient, String subject, String body) { + System.out.println("From: " + sender); + System.out.println("To: " + recipient); + System.out.println("Subject: " + subject); + System.out.println(body); + return true; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/AddressType.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/AddressType.java new file mode 100644 index 0000000000..ca3724a4f5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/AddressType.java @@ -0,0 +1,191 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for AddressType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="AddressType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Street" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="City" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="State" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="ZipCode" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="HomePhone" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "AddressType", propOrder = { + "street", + "city", + "state", + "zipCode", + "homePhone" +}) +public class AddressType { + + @XmlElement(name = "Street", required = true) + protected String street; + @XmlElement(name = "City", required = true) + protected String city; + @XmlElement(name = "State", required = true) + protected String state; + @XmlElement(name = "ZipCode", required = true) + protected String zipCode; + @XmlElement(name = "HomePhone", required = true) + protected String homePhone; + + /** + * Gets the value of the street property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStreet() { + return street; + } + + /** + * Sets the value of the street property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStreet(String value) { + this.street = value; + } + + /** + * Gets the value of the city property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCity() { + return city; + } + + /** + * Sets the value of the city property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCity(String value) { + this.city = value; + } + + /** + * Gets the value of the state property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getState() { + return state; + } + + /** + * Sets the value of the state property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setState(String value) { + this.state = value; + } + + /** + * Gets the value of the zipCode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getZipCode() { + return zipCode; + } + + /** + * Sets the value of the zipCode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setZipCode(String value) { + this.zipCode = value; + } + + /** + * Gets the value of the homePhone property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getHomePhone() { + return homePhone; + } + + /** + * Sets the value of the homePhone property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setHomePhone(String value) { + this.homePhone = value; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/Authorize.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/Authorize.java new file mode 100644 index 0000000000..7c0b38198e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/Authorize.java @@ -0,0 +1,101 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="CreditCard" type="{http://www.tuscanyscatours.com/CreditCardPayment/}CreditCardDetailsType"/>
+ *         <element name="Amount" type="{http://www.w3.org/2001/XMLSchema}float"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "creditCard", + "amount" +}) +@XmlRootElement(name = "authorize") +public class Authorize { + + @XmlElement(name = "CreditCard", required = true) + protected CreditCardDetailsType creditCard; + @XmlElement(name = "Amount") + protected float amount; + + /** + * Gets the value of the creditCard property. + * + * @return + * possible object is + * {@link CreditCardDetailsType } + * + */ + public CreditCardDetailsType getCreditCard() { + return creditCard; + } + + /** + * Sets the value of the creditCard property. + * + * @param value + * allowed object is + * {@link CreditCardDetailsType } + * + */ + public void setCreditCard(CreditCardDetailsType value) { + this.creditCard = value; + } + + /** + * Gets the value of the amount property. + * + */ + public float getAmount() { + return amount; + } + + /** + * Sets the value of the amount property. + * + */ + public void setAmount(float value) { + this.amount = value; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeFault.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeFault.java new file mode 100644 index 0000000000..84278aa508 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeFault.java @@ -0,0 +1,81 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="errorCode" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "errorCode" +}) +@XmlRootElement(name = "authorizeFault") +public class AuthorizeFault { + + @XmlElement(required = true) + protected String errorCode; + + /** + * Gets the value of the errorCode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getErrorCode() { + return errorCode; + } + + /** + * Sets the value of the errorCode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setErrorCode(String value) { + this.errorCode = value; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeFault_Exception.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeFault_Exception.java new file mode 100644 index 0000000000..ec0f8768da --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeFault_Exception.java @@ -0,0 +1,71 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import javax.xml.ws.WebFault; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebFault(name = "authorizeFault", targetNamespace = "http://www.tuscanyscatours.com/CreditCardPayment/") +public class AuthorizeFault_Exception + extends Exception +{ + + /** + * Java type that goes as soapenv:Fault detail element. + * + */ + private AuthorizeFault faultInfo; + + /** + * + * @param message + * @param faultInfo + */ + public AuthorizeFault_Exception(String message, AuthorizeFault faultInfo) { + super(message); + this.faultInfo = faultInfo; + } + + /** + * + * @param message + * @param faultInfo + * @param cause + */ + public AuthorizeFault_Exception(String message, AuthorizeFault faultInfo, Throwable cause) { + super(message, cause); + this.faultInfo = faultInfo; + } + + /** + * + * @return + * returns fault bean: com.tuscanyscatours.payment.creditcard.AuthorizeFault + */ + public AuthorizeFault getFaultInfo() { + return faultInfo; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeResponse.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeResponse.java new file mode 100644 index 0000000000..05f3479804 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeResponse.java @@ -0,0 +1,81 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Status" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "status" +}) +@XmlRootElement(name = "authorizeResponse") +public class AuthorizeResponse { + + @XmlElement(name = "Status", required = true) + protected String status; + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatus(String value) { + this.status = value; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CardCompany.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CardCompany.java new file mode 100644 index 0000000000..dbffbe2c19 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CardCompany.java @@ -0,0 +1,31 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import org.osoa.sca.CallableReference; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface CardCompany { + + public String makePayment(CreditCardDetailsType ccDetails, + float amount, + CallableReference callbackRef); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardConfirm.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardConfirm.java new file mode 100644 index 0000000000..ff3b2d74b4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardConfirm.java @@ -0,0 +1,27 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface CreditCardConfirm { + void confirmPayment(String paymentRef); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardDetailsType.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardDetailsType.java new file mode 100644 index 0000000000..8bac29f6bd --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardDetailsType.java @@ -0,0 +1,219 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for CreditCardDetailsType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CreditCardDetailsType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="CreditCardType" type="{http://www.tuscanyscatours.com/CreditCardPayment/}CreditCardTypeType" minOccurs="0"/>
+ *         <element name="CreditCardNumber" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="ExpMonth" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="ExpYear" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="CardOwner" type="{http://www.tuscanyscatours.com/CreditCardPayment/}PayerType" minOccurs="0"/>
+ *         <element name="CVV2" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CreditCardDetailsType", propOrder = { + "creditCardType", + "creditCardNumber", + "expMonth", + "expYear", + "cardOwner", + "cvv2" +}) +public class CreditCardDetailsType { + + @XmlElement(name = "CreditCardType") + protected CreditCardTypeType creditCardType; + @XmlElement(name = "CreditCardNumber") + protected String creditCardNumber; + @XmlElement(name = "ExpMonth") + protected Integer expMonth; + @XmlElement(name = "ExpYear") + protected Integer expYear; + @XmlElement(name = "CardOwner") + protected PayerType cardOwner; + @XmlElement(name = "CVV2") + protected String cvv2; + + /** + * Gets the value of the creditCardType property. + * + * @return + * possible object is + * {@link CreditCardTypeType } + * + */ + public CreditCardTypeType getCreditCardType() { + return creditCardType; + } + + /** + * Sets the value of the creditCardType property. + * + * @param value + * allowed object is + * {@link CreditCardTypeType } + * + */ + public void setCreditCardType(CreditCardTypeType value) { + this.creditCardType = value; + } + + /** + * Gets the value of the creditCardNumber property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCreditCardNumber() { + return creditCardNumber; + } + + /** + * Sets the value of the creditCardNumber property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCreditCardNumber(String value) { + this.creditCardNumber = value; + } + + /** + * Gets the value of the expMonth property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getExpMonth() { + return expMonth; + } + + /** + * Sets the value of the expMonth property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setExpMonth(Integer value) { + this.expMonth = value; + } + + /** + * Gets the value of the expYear property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getExpYear() { + return expYear; + } + + /** + * Sets the value of the expYear property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setExpYear(Integer value) { + this.expYear = value; + } + + /** + * Gets the value of the cardOwner property. + * + * @return + * possible object is + * {@link PayerType } + * + */ + public PayerType getCardOwner() { + return cardOwner; + } + + /** + * Sets the value of the cardOwner property. + * + * @param value + * allowed object is + * {@link PayerType } + * + */ + public void setCardOwner(PayerType value) { + this.cardOwner = value; + } + + /** + * Gets the value of the cvv2 property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCVV2() { + return cvv2; + } + + /** + * Sets the value of the cvv2 property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCVV2(String value) { + this.cvv2 = value; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java new file mode 100644 index 0000000000..da3d32fc0b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java @@ -0,0 +1,31 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Remotable; + +@Remotable +@Callback(CreditCardSecurity.class) +public interface CreditCardPayment { + + public String authorize(CreditCardDetailsType ccDetails, float amount) + throws AuthorizeFault_Exception; +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPaymentConfirm.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPaymentConfirm.java new file mode 100644 index 0000000000..0c775f3621 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPaymentConfirm.java @@ -0,0 +1,31 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Remotable; + +@Remotable +@Callback(CreditCardConfirm.class) +public interface CreditCardPaymentConfirm { + + public String authorize(CreditCardDetailsType ccDetails, float amount) + throws AuthorizeFault_Exception; +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardSecurity.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardSecurity.java new file mode 100644 index 0000000000..ae367c9f1e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardSecurity.java @@ -0,0 +1,27 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface CreditCardSecurity { + String checkSecurity(String securityPrompt); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardTypeType.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardTypeType.java new file mode 100644 index 0000000000..0467078279 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardTypeType.java @@ -0,0 +1,74 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for CreditCardTypeType. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="CreditCardTypeType">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}token">
+ *     <enumeration value="Visa"/>
+ *     <enumeration value="MasterCard"/>
+ *     <enumeration value="Discover"/>
+ *     <enumeration value="Amex"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "CreditCardTypeType") +@XmlEnum +public enum CreditCardTypeType { + + @XmlEnumValue("Visa") + VISA("Visa"), + @XmlEnumValue("MasterCard") + MASTER_CARD("MasterCard"), + @XmlEnumValue("Discover") + DISCOVER("Discover"), + @XmlEnumValue("Amex") + AMEX("Amex"); + private final String value; + + CreditCardTypeType(String v) { + value = v; + } + + public String value() { + return value; + } + + public static CreditCardTypeType fromValue(String v) { + for (CreditCardTypeType c: CreditCardTypeType.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/PayerType.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/PayerType.java new file mode 100644 index 0000000000..f36fe35bdf --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/PayerType.java @@ -0,0 +1,107 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for PayerType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="PayerType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="Address" type="{http://www.tuscanyscatours.com/CreditCardPayment/}AddressType"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "PayerType", propOrder = { + "name", + "address" +}) +public class PayerType { + + @XmlElement(name = "Name", required = true) + protected String name; + @XmlElement(name = "Address", required = true) + protected AddressType address; + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the address property. + * + * @return + * possible object is + * {@link AddressType } + * + */ + public AddressType getAddress() { + return address; + } + + /** + * Sets the value of the address property. + * + * @param value + * allowed object is + * {@link AddressType } + * + */ + public void setAddress(AddressType value) { + this.address = value; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CardCompanyImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CardCompanyImpl.java new file mode 100644 index 0000000000..55759e7b20 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CardCompanyImpl.java @@ -0,0 +1,60 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard.impl; + +import org.osoa.sca.CallableReference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.payment.creditcard.CardCompany; +import com.tuscanyscatours.payment.creditcard.CreditCardConfirm; +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; + + +@Service(CardCompany.class) +public class CardCompanyImpl implements CardCompany { + + public String makePayment(CreditCardDetailsType ccDetails, + float amount, + CallableReference callbackRef){ + // payment processing happens asynchronously + Thread app = new Thread(new AsycnhPaymentProcessing(callbackRef)); + app.start(); + return "OK"; + } + + class AsycnhPaymentProcessing implements Runnable { + CallableReference callbackRef; + + AsycnhPaymentProcessing(CallableReference callbackRef){ + this.callbackRef = callbackRef; + } + public void run() { + String paymentRef = "123456"; + + try { + Thread.sleep(1000); + } catch (Exception ex) { + // do nothing + } + + callbackRef.getService().confirmPayment(paymentRef); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentCallbackImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentCallbackImpl.java new file mode 100644 index 0000000000..bd578bc810 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentCallbackImpl.java @@ -0,0 +1,78 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard.impl; + +import org.osoa.sca.RequestContext; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; +import com.tuscanyscatours.payment.creditcard.CreditCardPayment; +import com.tuscanyscatours.payment.creditcard.CreditCardSecurity; + +@Service(CreditCardPayment.class) +public class CreditCardPaymentCallbackImpl implements CreditCardPayment { + + @Callback + protected CreditCardSecurity ccSecurity; + + @Context + protected RequestContext rqContext; + + + public String authorize(CreditCardDetailsType card, float amount) { + if (amount > 1000) { + for (int i = 0; i < 3; i++) { + String pwd = null; + if (amount < 10000) { + // using injected callback proxy + pwd = ccSecurity.checkSecurity("Enter password"); + } else { + // using request context to get callback proxy + CreditCardSecurity ccSecurity = rqContext.getCallback(); + pwd = ccSecurity.checkSecurity("Enter password"); + } + + if (verifyPassword(card, pwd)) { + break; + } + if (i == 2) { + return "BadPassword"; + } + } + } + makePayment(card, amount); + return "OK"; + } + + private boolean verifyPassword(CreditCardDetailsType card, String pw) { + if (pw.equals("abcxyz")){ + return true; + } else { + return false; + } + } + + private void makePayment(CreditCardDetailsType card, float amount) { + // payment processing + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentConfirmImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentConfirmImpl.java new file mode 100644 index 0000000000..02f1f46f82 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentConfirmImpl.java @@ -0,0 +1,48 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard.impl; + +import org.osoa.sca.CallableReference; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.payment.creditcard.CardCompany; +import com.tuscanyscatours.payment.creditcard.CreditCardConfirm; +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; +import com.tuscanyscatours.payment.creditcard.CreditCardPaymentConfirm; + +@Service(CreditCardPaymentConfirm.class) +public class CreditCardPaymentConfirmImpl implements CreditCardPaymentConfirm { + + @Callback + protected CallableReference callbackRef; + + @Reference + protected CardCompany cardCompany; + + public String authorize(CreditCardDetailsType card, + float amount) { + cardCompany.makePayment(card, amount, callbackRef); + return "InProgress"; + } + + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/CreditCardSecurityImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/CreditCardSecurityImpl.java new file mode 100644 index 0000000000..94ffead262 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/CreditCardSecurityImpl.java @@ -0,0 +1,38 @@ +/* + * 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 com.tuscanyscatours.payment.impl; + +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.payment.creditcard.CreditCardSecurity; + +/** + * The payment implementation + */ +@Service(CreditCardSecurity.class) +public class CreditCardSecurityImpl implements CreditCardSecurity { + + public String checkSecurity(String securityPrompt) { + System.out.println("Extra securiy - " + securityPrompt); + System.out.println("password = abcxyz"); + return "abcxyz"; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackIDImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackIDImpl.java new file mode 100644 index 0000000000..887d54c4e7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackIDImpl.java @@ -0,0 +1,90 @@ +/* + * 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 com.tuscanyscatours.payment.impl; + +import org.osoa.sca.RequestContext; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Property; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.customer.Customer; +import com.tuscanyscatours.customer.CustomerNotFoundException; +import com.tuscanyscatours.customer.CustomerRegistry; +import com.tuscanyscatours.emailgateway.EmailGateway; +import com.tuscanyscatours.payment.Payment; +import com.tuscanyscatours.payment.creditcard.AuthorizeFault_Exception; +import com.tuscanyscatours.payment.creditcard.CreditCardPayment; +import com.tuscanyscatours.payment.creditcard.CreditCardSecurity; + +/** + * The payment implementation + */ +@Service(Payment.class) +public class PaymentCallbackIDImpl implements Payment, + CreditCardSecurity { + + @Reference + protected CustomerRegistry customerRegistry; + + @Reference(name="creditCardPayment") + protected ServiceReference cpRef; +; + + @Reference + protected EmailGateway emailGateway; + + @Property + protected float transactionFee = 0.01f; + + @Context + protected RequestContext rqContext; + + public String makePaymentMember(String customerId, float amount) { + try { + Customer customer = customerRegistry.getCustomer(customerId); + String auditID = "987654321"; + cpRef.setCallbackID(auditID); + String status = cpRef.getService().authorize(customer.getCreditCard(), amount + transactionFee); + emailGateway.sendEmail("order@tuscanyscatours.com", + customer.getEmail(), + "Status for your payment", + customer + " >>> Status = " + status); + return status; + } catch (CustomerNotFoundException ex) { + return "Payment failed due to " + ex.getMessage(); + } catch (AuthorizeFault_Exception e) { + return e.getFaultInfo().getErrorCode(); + } catch (Throwable t) { + return "Payment failed due to system error " + t.getMessage(); + } + } + + public String checkSecurity(String securityPrompt) { + System.out.println("Extra securiy - " + securityPrompt); + System.out.println("password = abcxyz"); + Object cbID = rqContext.getServiceReference().getCallbackID(); + System.out.println("callback ID = " + cbID); + + return "abcxyz"; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackImpl.java new file mode 100644 index 0000000000..63b61d685d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackImpl.java @@ -0,0 +1,78 @@ +/* + * 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 com.tuscanyscatours.payment.impl; + +import org.osoa.sca.annotations.Property; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.customer.Customer; +import com.tuscanyscatours.customer.CustomerNotFoundException; +import com.tuscanyscatours.customer.CustomerRegistry; +import com.tuscanyscatours.emailgateway.EmailGateway; +import com.tuscanyscatours.payment.Payment; +import com.tuscanyscatours.payment.creditcard.AuthorizeFault_Exception; +import com.tuscanyscatours.payment.creditcard.CreditCardPayment; +import com.tuscanyscatours.payment.creditcard.CreditCardSecurity; + +/** + * The payment implementation + */ +@Service(Payment.class) +public class PaymentCallbackImpl implements Payment, + CreditCardSecurity { + + @Reference + protected CustomerRegistry customerRegistry; + + @Reference + protected CreditCardPayment creditCardPayment; + + @Reference + protected EmailGateway emailGateway; + + @Property + protected float transactionFee = 0.01f; + + public String makePaymentMember(String customerId, float amount) { + try { + Customer customer = customerRegistry.getCustomer(customerId); + String status = creditCardPayment.authorize(customer.getCreditCard(), amount + transactionFee); + emailGateway.sendEmail("order@tuscanyscatours.com", + customer.getEmail(), + "Status for your payment", + customer + " >>> Status = " + status); + return status; + } catch (CustomerNotFoundException ex) { + return "Payment failed due to " + ex.getMessage(); + } catch (AuthorizeFault_Exception e) { + return e.getFaultInfo().getErrorCode(); + } catch (Throwable t) { + return "Payment failed due to system error " + t.getMessage(); + } + } + + public String checkSecurity(String securityPrompt) { + System.out.println("Extra securiy - " + securityPrompt); + System.out.println("password = abcxyz"); + return "abcxyz"; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackRedirectImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackRedirectImpl.java new file mode 100644 index 0000000000..bf554dbad5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackRedirectImpl.java @@ -0,0 +1,83 @@ +/* + * 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 com.tuscanyscatours.payment.impl; + +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Property; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.customer.Customer; +import com.tuscanyscatours.customer.CustomerNotFoundException; +import com.tuscanyscatours.customer.CustomerRegistry; +import com.tuscanyscatours.emailgateway.EmailGateway; +import com.tuscanyscatours.payment.Payment; +import com.tuscanyscatours.payment.creditcard.AuthorizeFault_Exception; +import com.tuscanyscatours.payment.creditcard.CreditCardPayment; +import com.tuscanyscatours.payment.creditcard.CreditCardSecurity; + +/** + * The payment implementation + */ +@Service(Payment.class) +public class PaymentCallbackRedirectImpl implements Payment, + CreditCardSecurity { + + @Reference + protected CustomerRegistry customerRegistry; + + @Reference(name="creditCardPayment") + protected ServiceReference cpRef; + + @Reference(name="creditCardSecurity") + protected ServiceReference csRef; + + @Reference + protected EmailGateway emailGateway; + + @Property + protected float transactionFee = 0.01f; + + public String makePaymentMember(String customerId, float amount) { + try { + Customer customer = customerRegistry.getCustomer(customerId); + cpRef.setCallback(csRef); + String status = cpRef.getService().authorize(customer.getCreditCard(), amount + transactionFee); + emailGateway.sendEmail("order@tuscanyscatours.com", + customer.getEmail(), + "Status for your payment", + customer + " >>> Status = " + status); + return status; + } catch (CustomerNotFoundException ex) { + return "Payment failed due to " + ex.getMessage(); + } catch (AuthorizeFault_Exception e) { + return e.getFaultInfo().getErrorCode(); + } catch (Throwable t) { + return "Payment failed due to system error " + t.getMessage(); + } + } + + public String checkSecurity(String securityPrompt) { + System.out.println("Extra securiy - " + securityPrompt); + System.out.println("password = abcxyz"); + return "abcxyz"; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentConfirmImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentConfirmImpl.java new file mode 100644 index 0000000000..1a9c35c65d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentConfirmImpl.java @@ -0,0 +1,77 @@ +/* + * 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 com.tuscanyscatours.payment.impl; + +import org.osoa.sca.annotations.Property; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.customer.Customer; +import com.tuscanyscatours.customer.CustomerNotFoundException; +import com.tuscanyscatours.customer.CustomerRegistry; +import com.tuscanyscatours.emailgateway.EmailGateway; +import com.tuscanyscatours.payment.Payment; +import com.tuscanyscatours.payment.creditcard.AuthorizeFault_Exception; +import com.tuscanyscatours.payment.creditcard.CreditCardConfirm; +import com.tuscanyscatours.payment.creditcard.CreditCardPayment; +import com.tuscanyscatours.payment.creditcard.CreditCardPaymentConfirm; + +/** + * The payment implementation + */ +@Service(Payment.class) +public class PaymentConfirmImpl implements Payment, + CreditCardConfirm { + + @Reference + protected CustomerRegistry customerRegistry; + + @Reference + protected CreditCardPaymentConfirm creditCardPayment; + + @Reference + protected EmailGateway emailGateway; + + @Property + protected float transactionFee = 0.01f; + + public String makePaymentMember(String customerId, float amount) { + try { + Customer customer = customerRegistry.getCustomer(customerId); + String status = creditCardPayment.authorize(customer.getCreditCard(), amount + transactionFee); + emailGateway.sendEmail("order@tuscanyscatours.com", + customer.getEmail(), + "Status for your payment", + customer + " >>> Status = " + status); + return status; + } catch (CustomerNotFoundException ex) { + return "Payment failed due to " + ex.getMessage(); + } catch (AuthorizeFault_Exception e) { + return e.getFaultInfo().getErrorCode(); + } catch (Throwable t) { + return "Payment failed due to system error " + t.getMessage(); + } + } + + public void confirmPayment(String paymentRef) { + System.out.println("Pament ref is - " + paymentRef); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/resources/CreditCardPayment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/resources/CreditCardPayment.wsdl new file mode 100644 index 0000000000..08be3dc2e2 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/resources/CreditCardPayment.wsdl @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..5f8c0bbb18 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..2519d7642e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/resources/definitions.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/resources/definitions.xml new file mode 100644 index 0000000000..b304bbfc2b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/resources/definitions.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/resources/payment.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/resources/payment.composite new file mode 100644 index 0000000000..6707b8a6cc --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/main/resources/payment.composite @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + 0.02 + + + + + + + + + + + + 0.02 + + + + + + + + + + + + + 0.02 + + + + + + + + + + + + + + + + + + + + + + + 0.02 + + + + + + + + + + + + + + + 0.02 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/test/java/scatours/payment/PaymentTestCase.java new file mode 100644 index 0000000000..330dc15385 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-callback/src/test/java/scatours/payment/PaymentTestCase.java @@ -0,0 +1,111 @@ +/* + * 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.payment; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentTestCase { + private static SCANode node; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + node = + SCANodeFactory.newInstance() + .createSCANode(null, + new SCAContribution("payment", "./target/classes")); + node.start(); + } + + @Test + public void testPayment() { + SCAClient client = (SCAClient)node; + Payment payment1 = client.getService(Payment.class, "Payment1"); + Payment payment2 = client.getService(Payment.class, "Payment2"); + Payment paymentConfirm = client.getService(Payment.class, "PaymentConfirm"); + Payment paymentCallbackID = client.getService(Payment.class, "PaymentCallbackID"); + Payment paymentCallbackRedirect = client.getService(Payment.class, "PaymentCallbackRedirect"); + + System.out.println("==================================================="); + System.out.println("\n\nPayment1 under limit - Status = \n\n" + payment1.makePaymentMember("c-0", 100.00f)); + System.out.println("==================================================="); + System.out.println("\n\nPayment2 under limit - Status = \n\n" + payment2.makePaymentMember("c-0", 100.00f)); + System.out.println("==================================================="); + System.out.println("\n\nPayment1 over limit - Status = \n\n" + payment1.makePaymentMember("c-0", 1500.00f)); + System.out.println("==================================================="); + System.out.println("\n\nPayment2 over limit - Status = \n\n" + payment2.makePaymentMember("c-0", 1500.00f)); + System.out.println("==================================================="); + System.out.println("\n\nPayment2 using request context - Status = \n\n" + payment2.makePaymentMember("c-0", 20000.00f)); + System.out.println("==================================================="); + System.out.println("\n\nPaymentConfirm - Status = \n\n" + paymentConfirm.makePaymentMember("c-0", 20000.00f)); + System.out.println("==================================================="); + + // wait for longer that the asynch payment processing waits. + try { + Thread.sleep(2000); + } catch (Exception ex) { + // do nothing + } + + System.out.println("==================================================="); + String result = paymentCallbackID.makePaymentMember("c-0", 20000.00f); + System.out.println("\n\nPaymentCallbackID - Status = \n\n" + result); + if (!"OK".equals(result)) { + throw new RuntimeException(result); + } + System.out.println("==================================================="); + result = paymentCallbackRedirect.makePaymentMember("c-0", 20000.00f); + System.out.println("\n\nPaymentCallbackRedirect - Status = \n\n" + result); + if (!"OK".equals(result)) { + throw new RuntimeException(result); + } + System.out.println("==================================================="); + + + } + + @Test + @Ignore + public void testWaitForInput() { + System.out.println("Press a key to end"); + try { + System.in.read(); + } catch (Exception ex) { + } + System.out.println("Shutting down"); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (node != null) { + node.stop(); + node = null; + } + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/build.xml new file mode 100644 index 0000000000..4c943a7370 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/build.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/pom.xml new file mode 100644 index 0000000000..672e129012 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/pom.xml @@ -0,0 +1,195 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-payment-java-policy + Apache Tuscany SCA Tours Payment Java Policy Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-policy-security + ${tuscany.version} + runtime + + + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + test + + + + junit + junit + 4.5 + test + + + + + + + java.net2 + java.net Maven 2.x Repository + http://download.java.net/maven/2 + + false + + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + payment + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/payment.stale + false + true + + + + payment.creditcard + process-sources + + wsimport + + + com.tuscanyscatours.payment.creditcard + ${basedir}/src/main/resources + + CreditCardPayment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/creditcard.stale + false + true + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/customer/Customer.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/customer/Customer.java new file mode 100644 index 0000000000..3b72f81b33 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/customer/Customer.java @@ -0,0 +1,70 @@ +/* + * 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 com.tuscanyscatours.customer; + +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; + +/** + * Customer data + */ +public class Customer { + private String id; + private String email; + private String name; + + private CreditCardDetailsType creditCard; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreditCardDetailsType getCreditCard() { + return creditCard; + } + + public void setCreditCard(CreditCardDetailsType creditCard) { + this.creditCard = creditCard; + } + + public String toString() { + return "id: " + id + " name: " + name + " e-mail: " + email; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java new file mode 100644 index 0000000000..b08f76e0fa --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java @@ -0,0 +1,57 @@ +/* + * 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 com.tuscanyscatours.customer; + +public class CustomerNotFoundException extends Exception { + private static final long serialVersionUID = -129752837478357452L; + + /** + * + */ + public CustomerNotFoundException() { + + } + + /** + * @param message + */ + public CustomerNotFoundException(String message) { + super(message); + + } + + /** + * @param cause + */ + public CustomerNotFoundException(Throwable cause) { + super(cause); + + } + + /** + * @param message + * @param cause + */ + public CustomerNotFoundException(String message, Throwable cause) { + super(message, cause); + + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.java new file mode 100644 index 0000000000..706167d567 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.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 com.tuscanyscatours.customer; + +import java.util.Collection; + +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; + +/** + * Customer registry interface + */ +public interface CustomerRegistry { + Customer createCustomer(String name, String email, CreditCardDetailsType creditCard); + + boolean updateCustomer(Customer customer); + + Customer getCustomer(String id) throws CustomerNotFoundException; + + Collection getAllCustomers(); + + boolean deleteCustomer(String id); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java new file mode 100644 index 0000000000..26926c7764 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java @@ -0,0 +1,115 @@ +/* + * 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 com.tuscanyscatours.customer.impl; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.EagerInit; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Requires; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.customer.Customer; +import com.tuscanyscatours.customer.CustomerNotFoundException; +import com.tuscanyscatours.customer.CustomerRegistry; +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; +import com.tuscanyscatours.payment.creditcard.CreditCardTypeType; +import com.tuscanyscatours.payment.creditcard.ObjectFactory; +import com.tuscanyscatours.payment.creditcard.PayerType; + +/** + * An in-memory customer registry implementation + */ +@Service(CustomerRegistry.class) +@Scope("COMPOSITE") +@EagerInit +@Requires("{http://www.osoa.org/xmlns/sca/1.0}managedTransaction.global") +public class CustomerRegistryImpl implements CustomerRegistry { + private volatile static int idGenerator = 0; + private Map customers = new HashMap(); + + @Init + public void init() { + // Load the customers + ObjectFactory factory = new ObjectFactory(); + CreditCardDetailsType cc = factory.createCreditCardDetailsType(); + PayerType john = factory.createPayerType(); + john.setName("John Smith"); + cc.setCardOwner(john); + cc.setCreditCardNumber("1111-2222-3333-4444"); + cc.setCreditCardType(CreditCardTypeType.VISA); + cc.setCVV2("1234"); + cc.setExpMonth(1); + cc.setExpYear(2012); + createCustomer("John Smith", "john@xyz.com", cc); + } + + @Destroy + public void destroy() { + // Save the customers + } + + public Customer createCustomer(String name, String email, CreditCardDetailsType creditCard) { + Customer customer = new Customer(); + customer.setId("c-" + idGenerator++); + customer.setName(name); + customer.setEmail(email); + customer.setCreditCard(creditCard); + customers.put(customer.getId(), customer); + return customer; + } + + public boolean deleteCustomer(String id) { + return customers.remove(id) != null; + } + + public Collection getAllCustomers() { + return customers.values(); + } + + public Customer getCustomer(String id) throws CustomerNotFoundException { + Customer customer = customers.get(id); + + if (customer == null) { + throw new CustomerNotFoundException("Customer " + id + " not found"); + } + + return customer; + } + + public boolean updateCustomer(Customer customer) { + Customer current = null; + try { + current = getCustomer(customer.getId()); + } catch (Exception ex) { + return false; + } + + current.setEmail(customer.getEmail()); + current.setName(customer.getName()); + current.setCreditCard(customer.getCreditCard()); + return true; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java new file mode 100644 index 0000000000..0fbf63d6bc --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java @@ -0,0 +1,30 @@ +/* + * 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 com.tuscanyscatours.emailgateway; + +import org.osoa.sca.annotations.Remotable; + +/** + * A gateway to send e-mail + */ +@Remotable +public interface EmailGateway { + public boolean sendEmail(String sender, String recipient, String subject, String body); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java new file mode 100644 index 0000000000..d9798e436a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java @@ -0,0 +1,37 @@ +/* + * 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 com.tuscanyscatours.emailgateway.impl; + +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.emailgateway.EmailGateway; + +@Service(EmailGateway.class) +public class EmailGatewayImpl implements EmailGateway { + + public boolean sendEmail(String sender, String recipient, String subject, String body) { + System.out.println("From: " + sender); + System.out.println("To: " + recipient); + System.out.println("Subject: " + subject); + System.out.println(body); + return true; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java new file mode 100644 index 0000000000..b3eb95b44b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java @@ -0,0 +1,74 @@ +/* + * 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 com.tuscanyscatours.payment.impl; + +import org.osoa.sca.annotations.Property; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Requires; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.customer.Customer; +import com.tuscanyscatours.customer.CustomerNotFoundException; +import com.tuscanyscatours.customer.CustomerRegistry; +import com.tuscanyscatours.emailgateway.EmailGateway; +import com.tuscanyscatours.payment.Payment; +import com.tuscanyscatours.payment.creditcard.AuthorizeFault_Exception; +import com.tuscanyscatours.payment.creditcard.CreditCardPayment; + +/** + * The payment implementation + */ +@Service(Payment.class) +//@RolesAllowed({"Admin", "Billing"}) +//@RunAs("Billing") +public class PaymentImpl implements Payment { + + @Reference + protected CustomerRegistry customerRegistry; + + @Reference + //@Authentication - not supported + @Requires("{http://www.osoa.org/xmlns/sca/1.0}authentication") + protected CreditCardPayment creditCardPayment; + + @Reference + protected EmailGateway emailGateway; + + @Property + protected float transactionFee = 0.01f; + + public String makePaymentMember(String customerId, float amount) { + try { + Customer customer = customerRegistry.getCustomer(customerId); + String status = creditCardPayment.authorize(customer.getCreditCard(), amount + transactionFee); + emailGateway.sendEmail("order@tuscanyscatours.com", + customer.getEmail(), + "Status for your payment", + customer + " >>> Status = " + status); + return status; + } catch (CustomerNotFoundException ex) { + return "Payment failed due to " + ex.getMessage(); + } catch (AuthorizeFault_Exception e) { + return e.getFaultInfo().getErrorCode(); + } catch (Throwable t) { + return "Payment failed due to system error " + t.getMessage(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/resources/CreditCardPayment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/resources/CreditCardPayment.wsdl new file mode 100644 index 0000000000..9a87f1d2ae --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/resources/CreditCardPayment.wsdl @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..0fd7cb9910 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..2519d7642e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/resources/definitions.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/resources/definitions.xml new file mode 100644 index 0000000000..edaa250b10 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/resources/definitions.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + myname + mypassword + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/resources/payment.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/resources/payment.composite new file mode 100644 index 0000000000..710583ae5d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/main/resources/payment.composite @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + 0.02 + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/test/java/scatours/payment/PaymentTestCase.java new file mode 100644 index 0000000000..5539d6b1fe --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-policy/src/test/java/scatours/payment/PaymentTestCase.java @@ -0,0 +1,89 @@ +/* + * 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.payment; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentTestCase { + private static SCANode node1; + private static SCANode node2; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + node1 = + SCANodeFactory.newInstance() + .createSCANode("payment.composite", + new SCAContribution("payment", "./target/classes")); + node2 = + SCANodeFactory.newInstance() + .createSCANode("creditcard.composite", + new SCAContribution("creditcard", + "../../contributions/creditcard-payment-jaxb/target/classes")); + node1.start(); + node2.start(); + } + + @Test + public void testPayment() { + SCAClient client = (SCAClient)node1; + Payment payment = client.getService(Payment.class, "Payment"); + + String result = payment.makePaymentMember("c-0", 100.00f); + System.out.println("\n\nSuccessful Payment - Status = \n\n" + result); + if (!"OK".equals(result)) { + throw new RuntimeException(result); + } + System.out.println("\n\nFailed Payment - Status = \n\n" + payment.makePaymentMember("c-1", 100.00f)); + } + + @Test + @Ignore + public void testWaitForInput() { + System.out.println("Press a key to end"); + try { + System.in.read(); + } catch (Exception ex) { + } + System.out.println("Shutting down"); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (node1 != null) { + node1.stop(); + node1 = null; + } + + if (node2 != null) { + node2.stop(); + node2 = null; + } + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/build.xml new file mode 100644 index 0000000000..2873b6790a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/build.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/pom.xml new file mode 100644 index 0000000000..0c70dbc27c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/pom.xml @@ -0,0 +1,153 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-payment-java-reference-pass + Apache Tuscany SCA Tours Payment Java Reference Pass Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + test + + + + junit + junit + 4.5 + test + + + + + + + java.net2 + java.net Maven 2.x Repository + http://download.java.net/maven/2 + + false + + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + payment + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/payment.stale + false + true + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/customer/Customer.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/customer/Customer.java new file mode 100644 index 0000000000..3b72f81b33 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/customer/Customer.java @@ -0,0 +1,70 @@ +/* + * 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 com.tuscanyscatours.customer; + +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; + +/** + * Customer data + */ +public class Customer { + private String id; + private String email; + private String name; + + private CreditCardDetailsType creditCard; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreditCardDetailsType getCreditCard() { + return creditCard; + } + + public void setCreditCard(CreditCardDetailsType creditCard) { + this.creditCard = creditCard; + } + + public String toString() { + return "id: " + id + " name: " + name + " e-mail: " + email; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java new file mode 100644 index 0000000000..b08f76e0fa --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java @@ -0,0 +1,57 @@ +/* + * 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 com.tuscanyscatours.customer; + +public class CustomerNotFoundException extends Exception { + private static final long serialVersionUID = -129752837478357452L; + + /** + * + */ + public CustomerNotFoundException() { + + } + + /** + * @param message + */ + public CustomerNotFoundException(String message) { + super(message); + + } + + /** + * @param cause + */ + public CustomerNotFoundException(Throwable cause) { + super(cause); + + } + + /** + * @param message + * @param cause + */ + public CustomerNotFoundException(String message, Throwable cause) { + super(message, cause); + + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.java new file mode 100644 index 0000000000..706167d567 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.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 com.tuscanyscatours.customer; + +import java.util.Collection; + +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; + +/** + * Customer registry interface + */ +public interface CustomerRegistry { + Customer createCustomer(String name, String email, CreditCardDetailsType creditCard); + + boolean updateCustomer(Customer customer); + + Customer getCustomer(String id) throws CustomerNotFoundException; + + Collection getAllCustomers(); + + boolean deleteCustomer(String id); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java new file mode 100644 index 0000000000..bdf99dec72 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java @@ -0,0 +1,114 @@ +/* + * 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 com.tuscanyscatours.customer.impl; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.EagerInit; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Requires; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.customer.Customer; +import com.tuscanyscatours.customer.CustomerNotFoundException; +import com.tuscanyscatours.customer.CustomerRegistry; +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; +import com.tuscanyscatours.payment.creditcard.CreditCardTypeType; +import com.tuscanyscatours.payment.creditcard.PayerType; + +/** + * An in-memory customer registry implementation + */ +@Service(CustomerRegistry.class) +@Scope("COMPOSITE") +@EagerInit +@Requires("{http://www.osoa.org/xmlns/sca/1.0}managedTransaction.global") +public class CustomerRegistryImpl implements CustomerRegistry { + private volatile static int idGenerator = 0; + private Map customers = new HashMap(); + + @Init + public void init() { + // Load the customers + + CreditCardDetailsType cc = new CreditCardDetailsType(); + PayerType john = new PayerType(); + john.setName("John Smith"); + cc.setCardOwner(john); + cc.setCreditCardNumber("1111-2222-3333-4444"); + cc.setCreditCardType(CreditCardTypeType.VISA); + cc.setCVV2("1234"); + cc.setExpMonth(1); + cc.setExpYear(2012); + createCustomer("John Smith", "john@xyz.com", cc); + } + + @Destroy + public void destroy() { + // Save the customers + } + + public Customer createCustomer(String name, String email, CreditCardDetailsType creditCard) { + Customer customer = new Customer(); + customer.setId("c-" + idGenerator++); + customer.setName(name); + customer.setEmail(email); + customer.setCreditCard(creditCard); + customers.put(customer.getId(), customer); + return customer; + } + + public boolean deleteCustomer(String id) { + return customers.remove(id) != null; + } + + public Collection getAllCustomers() { + return customers.values(); + } + + public Customer getCustomer(String id) throws CustomerNotFoundException { + Customer customer = customers.get(id); + + if (customer == null) { + throw new CustomerNotFoundException("Customer " + id + " not found"); + } + + return customer; + } + + public boolean updateCustomer(Customer customer) { + Customer current = null; + try { + current = getCustomer(customer.getId()); + } catch (Exception ex) { + return false; + } + + current.setEmail(customer.getEmail()); + current.setName(customer.getName()); + current.setCreditCard(customer.getCreditCard()); + return true; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java new file mode 100644 index 0000000000..0fbf63d6bc --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java @@ -0,0 +1,30 @@ +/* + * 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 com.tuscanyscatours.emailgateway; + +import org.osoa.sca.annotations.Remotable; + +/** + * A gateway to send e-mail + */ +@Remotable +public interface EmailGateway { + public boolean sendEmail(String sender, String recipient, String subject, String body); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java new file mode 100644 index 0000000000..d9798e436a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java @@ -0,0 +1,37 @@ +/* + * 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 com.tuscanyscatours.emailgateway.impl; + +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.emailgateway.EmailGateway; + +@Service(EmailGateway.class) +public class EmailGatewayImpl implements EmailGateway { + + public boolean sendEmail(String sender, String recipient, String subject, String body) { + System.out.println("From: " + sender); + System.out.println("To: " + recipient); + System.out.println("Subject: " + subject); + System.out.println(body); + return true; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/AddressType.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/AddressType.java new file mode 100644 index 0000000000..ca3724a4f5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/AddressType.java @@ -0,0 +1,191 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for AddressType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="AddressType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Street" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="City" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="State" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="ZipCode" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="HomePhone" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "AddressType", propOrder = { + "street", + "city", + "state", + "zipCode", + "homePhone" +}) +public class AddressType { + + @XmlElement(name = "Street", required = true) + protected String street; + @XmlElement(name = "City", required = true) + protected String city; + @XmlElement(name = "State", required = true) + protected String state; + @XmlElement(name = "ZipCode", required = true) + protected String zipCode; + @XmlElement(name = "HomePhone", required = true) + protected String homePhone; + + /** + * Gets the value of the street property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStreet() { + return street; + } + + /** + * Sets the value of the street property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStreet(String value) { + this.street = value; + } + + /** + * Gets the value of the city property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCity() { + return city; + } + + /** + * Sets the value of the city property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCity(String value) { + this.city = value; + } + + /** + * Gets the value of the state property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getState() { + return state; + } + + /** + * Sets the value of the state property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setState(String value) { + this.state = value; + } + + /** + * Gets the value of the zipCode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getZipCode() { + return zipCode; + } + + /** + * Sets the value of the zipCode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setZipCode(String value) { + this.zipCode = value; + } + + /** + * Gets the value of the homePhone property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getHomePhone() { + return homePhone; + } + + /** + * Sets the value of the homePhone property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setHomePhone(String value) { + this.homePhone = value; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/Authorize.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/Authorize.java new file mode 100644 index 0000000000..7c0b38198e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/Authorize.java @@ -0,0 +1,101 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="CreditCard" type="{http://www.tuscanyscatours.com/CreditCardPayment/}CreditCardDetailsType"/>
+ *         <element name="Amount" type="{http://www.w3.org/2001/XMLSchema}float"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "creditCard", + "amount" +}) +@XmlRootElement(name = "authorize") +public class Authorize { + + @XmlElement(name = "CreditCard", required = true) + protected CreditCardDetailsType creditCard; + @XmlElement(name = "Amount") + protected float amount; + + /** + * Gets the value of the creditCard property. + * + * @return + * possible object is + * {@link CreditCardDetailsType } + * + */ + public CreditCardDetailsType getCreditCard() { + return creditCard; + } + + /** + * Sets the value of the creditCard property. + * + * @param value + * allowed object is + * {@link CreditCardDetailsType } + * + */ + public void setCreditCard(CreditCardDetailsType value) { + this.creditCard = value; + } + + /** + * Gets the value of the amount property. + * + */ + public float getAmount() { + return amount; + } + + /** + * Sets the value of the amount property. + * + */ + public void setAmount(float value) { + this.amount = value; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeFault.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeFault.java new file mode 100644 index 0000000000..84278aa508 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeFault.java @@ -0,0 +1,81 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="errorCode" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "errorCode" +}) +@XmlRootElement(name = "authorizeFault") +public class AuthorizeFault { + + @XmlElement(required = true) + protected String errorCode; + + /** + * Gets the value of the errorCode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getErrorCode() { + return errorCode; + } + + /** + * Sets the value of the errorCode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setErrorCode(String value) { + this.errorCode = value; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeFault_Exception.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeFault_Exception.java new file mode 100644 index 0000000000..ec0f8768da --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeFault_Exception.java @@ -0,0 +1,71 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import javax.xml.ws.WebFault; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebFault(name = "authorizeFault", targetNamespace = "http://www.tuscanyscatours.com/CreditCardPayment/") +public class AuthorizeFault_Exception + extends Exception +{ + + /** + * Java type that goes as soapenv:Fault detail element. + * + */ + private AuthorizeFault faultInfo; + + /** + * + * @param message + * @param faultInfo + */ + public AuthorizeFault_Exception(String message, AuthorizeFault faultInfo) { + super(message); + this.faultInfo = faultInfo; + } + + /** + * + * @param message + * @param faultInfo + * @param cause + */ + public AuthorizeFault_Exception(String message, AuthorizeFault faultInfo, Throwable cause) { + super(message, cause); + this.faultInfo = faultInfo; + } + + /** + * + * @return + * returns fault bean: com.tuscanyscatours.payment.creditcard.AuthorizeFault + */ + public AuthorizeFault getFaultInfo() { + return faultInfo; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeResponse.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeResponse.java new file mode 100644 index 0000000000..05f3479804 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/AuthorizeResponse.java @@ -0,0 +1,81 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Status" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "status" +}) +@XmlRootElement(name = "authorizeResponse") +public class AuthorizeResponse { + + @XmlElement(name = "Status", required = true) + protected String status; + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatus(String value) { + this.status = value; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardDetailsType.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardDetailsType.java new file mode 100644 index 0000000000..8bac29f6bd --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardDetailsType.java @@ -0,0 +1,219 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for CreditCardDetailsType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CreditCardDetailsType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="CreditCardType" type="{http://www.tuscanyscatours.com/CreditCardPayment/}CreditCardTypeType" minOccurs="0"/>
+ *         <element name="CreditCardNumber" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="ExpMonth" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="ExpYear" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="CardOwner" type="{http://www.tuscanyscatours.com/CreditCardPayment/}PayerType" minOccurs="0"/>
+ *         <element name="CVV2" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CreditCardDetailsType", propOrder = { + "creditCardType", + "creditCardNumber", + "expMonth", + "expYear", + "cardOwner", + "cvv2" +}) +public class CreditCardDetailsType { + + @XmlElement(name = "CreditCardType") + protected CreditCardTypeType creditCardType; + @XmlElement(name = "CreditCardNumber") + protected String creditCardNumber; + @XmlElement(name = "ExpMonth") + protected Integer expMonth; + @XmlElement(name = "ExpYear") + protected Integer expYear; + @XmlElement(name = "CardOwner") + protected PayerType cardOwner; + @XmlElement(name = "CVV2") + protected String cvv2; + + /** + * Gets the value of the creditCardType property. + * + * @return + * possible object is + * {@link CreditCardTypeType } + * + */ + public CreditCardTypeType getCreditCardType() { + return creditCardType; + } + + /** + * Sets the value of the creditCardType property. + * + * @param value + * allowed object is + * {@link CreditCardTypeType } + * + */ + public void setCreditCardType(CreditCardTypeType value) { + this.creditCardType = value; + } + + /** + * Gets the value of the creditCardNumber property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCreditCardNumber() { + return creditCardNumber; + } + + /** + * Sets the value of the creditCardNumber property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCreditCardNumber(String value) { + this.creditCardNumber = value; + } + + /** + * Gets the value of the expMonth property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getExpMonth() { + return expMonth; + } + + /** + * Sets the value of the expMonth property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setExpMonth(Integer value) { + this.expMonth = value; + } + + /** + * Gets the value of the expYear property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getExpYear() { + return expYear; + } + + /** + * Sets the value of the expYear property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setExpYear(Integer value) { + this.expYear = value; + } + + /** + * Gets the value of the cardOwner property. + * + * @return + * possible object is + * {@link PayerType } + * + */ + public PayerType getCardOwner() { + return cardOwner; + } + + /** + * Sets the value of the cardOwner property. + * + * @param value + * allowed object is + * {@link PayerType } + * + */ + public void setCardOwner(PayerType value) { + this.cardOwner = value; + } + + /** + * Gets the value of the cvv2 property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCVV2() { + return cvv2; + } + + /** + * Sets the value of the cvv2 property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCVV2(String value) { + this.cvv2 = value; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.java new file mode 100644 index 0000000000..8150b3ccfd --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardPayment.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 com.tuscanyscatours.payment.creditcard; + +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Remotable; + +import com.tuscanyscatours.emailgateway.EmailGateway; + +@Remotable +public interface CreditCardPayment { + + public String authorize(CreditCardDetailsType ccDetails, + float amount, + ServiceReference emailGateway, + String emailAddress) + throws AuthorizeFault_Exception; + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardTypeType.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardTypeType.java new file mode 100644 index 0000000000..0467078279 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/CreditCardTypeType.java @@ -0,0 +1,74 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for CreditCardTypeType. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="CreditCardTypeType">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}token">
+ *     <enumeration value="Visa"/>
+ *     <enumeration value="MasterCard"/>
+ *     <enumeration value="Discover"/>
+ *     <enumeration value="Amex"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "CreditCardTypeType") +@XmlEnum +public enum CreditCardTypeType { + + @XmlEnumValue("Visa") + VISA("Visa"), + @XmlEnumValue("MasterCard") + MASTER_CARD("MasterCard"), + @XmlEnumValue("Discover") + DISCOVER("Discover"), + @XmlEnumValue("Amex") + AMEX("Amex"); + private final String value; + + CreditCardTypeType(String v) { + value = v; + } + + public String value() { + return value; + } + + public static CreditCardTypeType fromValue(String v) { + for (CreditCardTypeType c: CreditCardTypeType.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/PayerType.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/PayerType.java new file mode 100644 index 0000000000..f36fe35bdf --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/PayerType.java @@ -0,0 +1,107 @@ +/* + * 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 com.tuscanyscatours.payment.creditcard; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for PayerType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="PayerType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="Address" type="{http://www.tuscanyscatours.com/CreditCardPayment/}AddressType"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "PayerType", propOrder = { + "name", + "address" +}) +public class PayerType { + + @XmlElement(name = "Name", required = true) + protected String name; + @XmlElement(name = "Address", required = true) + protected AddressType address; + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the address property. + * + * @return + * possible object is + * {@link AddressType } + * + */ + public AddressType getAddress() { + return address; + } + + /** + * Sets the value of the address property. + * + * @param value + * allowed object is + * {@link AddressType } + * + */ + public void setAddress(AddressType value) { + this.address = value; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.java new file mode 100644 index 0000000000..46b51f40c8 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentImpl.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 com.tuscanyscatours.payment.creditcard.impl; + +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.emailgateway.EmailGateway; +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; +import com.tuscanyscatours.payment.creditcard.CreditCardPayment; + +@Service(CreditCardPayment.class) +public class CreditCardPaymentImpl implements CreditCardPayment { + + public String authorize(CreditCardDetailsType card, + float amount, + ServiceReference emailGateway, + String emailAddress) { + + // payment processing + + emailGateway.getService().sendEmail("order@tuscanyscatours.com", + emailAddress, + "Status for your payment", + "Authorized"); + + return "OK"; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java new file mode 100644 index 0000000000..089ea4a183 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java @@ -0,0 +1,76 @@ +/* + * 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 com.tuscanyscatours.payment.impl; + +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Property; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.customer.Customer; +import com.tuscanyscatours.customer.CustomerNotFoundException; +import com.tuscanyscatours.customer.CustomerRegistry; +import com.tuscanyscatours.emailgateway.EmailGateway; +import com.tuscanyscatours.payment.Payment; +import com.tuscanyscatours.payment.creditcard.AuthorizeFault_Exception; +import com.tuscanyscatours.payment.creditcard.CreditCardPayment; + +/** + * The payment implementation + */ +@Service(Payment.class) +public class PaymentImpl implements Payment { + + @Reference + protected CustomerRegistry customerRegistry; + + @Reference + protected CreditCardPayment creditCardPayment; + + @Reference + protected ServiceReference emailGateway; + + @Property + protected float transactionFee = 0.01f; + + public String makePaymentMember(String customerId, float amount) { + try { + Customer customer = customerRegistry.getCustomer(customerId); + String status = creditCardPayment.authorize(customer.getCreditCard(), + amount + transactionFee, + emailGateway, + customer.getEmail()); + return status; + } catch (CustomerNotFoundException ex) { + return "Payment failed due to " + ex.getMessage(); + } catch (AuthorizeFault_Exception e) { + return e.getFaultInfo().getErrorCode(); + } catch (Throwable t) { + return "Payment failed due to system error " + t.getMessage(); + } + } + + public String checkSecurity(String securityPrompt) { + System.out.println("Extra securiy - " + securityPrompt); + System.out.println("password = abcxyz"); + return "abcxyz"; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/resources/CreditCardPayment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/resources/CreditCardPayment.wsdl new file mode 100644 index 0000000000..08be3dc2e2 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/resources/CreditCardPayment.wsdl @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..5f8c0bbb18 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..2519d7642e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/resources/definitions.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/resources/definitions.xml new file mode 100644 index 0000000000..b304bbfc2b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/resources/definitions.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/resources/payment.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/resources/payment.composite new file mode 100644 index 0000000000..92f316804d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/main/resources/payment.composite @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + 0.02 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/test/java/scatours/payment/PaymentTestCase.java new file mode 100644 index 0000000000..52a1469da7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java-reference-pass/src/test/java/scatours/payment/PaymentTestCase.java @@ -0,0 +1,79 @@ +/* + * 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.payment; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentTestCase { + private static SCANode node; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + node = + SCANodeFactory.newInstance() + .createSCANode(null, + new SCAContribution("payment", "./target/classes")); + node.start(); + } + + @Test + public void testPayment() { + SCAClient client = (SCAClient)node; + Payment payment = client.getService(Payment.class, "Payment"); + + System.out.println("==================================================="); + String result = payment.makePaymentMember("c-0", 100.00f); + System.out.println("\n\nPayment - Status = \n\n" + result); + if (!"OK".equals(result)) { + throw new RuntimeException(result); + } + System.out.println("==================================================="); + + } + + @Test + @Ignore + public void testWaitForInput() { + System.out.println("Press a key to end"); + try { + System.in.read(); + } catch (Exception ex) { + } + System.out.println("Shutting down"); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (node != null) { + node.stop(); + node = null; + } + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/build.xml new file mode 100644 index 0000000000..4ddd9fbba0 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/build.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/pom.xml new file mode 100644 index 0000000000..556cdc9d8c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/pom.xml @@ -0,0 +1,171 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-payment-java + Apache Tuscany SCA Tours Payment Java Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + test + + + + junit + junit + 4.5 + test + + + + + + + java.net2 + java.net Maven 2.x Repository + http://download.java.net/maven/2 + + false + + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + payment + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/payment.stale + false + true + + + + payment.creditcard + process-sources + + wsimport + + + com.tuscanyscatours.payment.creditcard + ${basedir}/src/main/resources + + CreditCardPayment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/creditcard.stale + false + true + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/customer/Customer.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/customer/Customer.java new file mode 100644 index 0000000000..c97ba8fb9f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/customer/Customer.java @@ -0,0 +1,70 @@ +/* + * 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 com.tuscanyscatours.customer; + +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; + +/** + * Customer data + */ +public class Customer { + private String id; + private String email; + private String name; + + private CreditCardDetailsType creditCard; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreditCardDetailsType getCreditCard() { + return creditCard; + } + + public void setCreditCard(CreditCardDetailsType creditCard) { + this.creditCard = creditCard; + } + + public String toString() { + return "id: " + id + " name: " + name + " e-mail: " + email; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java new file mode 100644 index 0000000000..7f028c301e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java @@ -0,0 +1,57 @@ +/* + * 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 com.tuscanyscatours.customer; + +public class CustomerNotFoundException extends Exception { + private static final long serialVersionUID = -129752837478357452L; + + /** + * + */ + public CustomerNotFoundException() { + + } + + /** + * @param message + */ + public CustomerNotFoundException(String message) { + super(message); + + } + + /** + * @param cause + */ + public CustomerNotFoundException(Throwable cause) { + super(cause); + + } + + /** + * @param message + * @param cause + */ + public CustomerNotFoundException(String message, Throwable cause) { + super(message, cause); + + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.java new file mode 100644 index 0000000000..38a2759660 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.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 com.tuscanyscatours.customer; + +import java.util.Collection; + +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; + +/** + * Customer registry interface + */ +public interface CustomerRegistry { + Customer createCustomer(String name, String email, CreditCardDetailsType creditCard); + + boolean updateCustomer(Customer customer); + + Customer getCustomer(String id) throws CustomerNotFoundException; + + Collection getAllCustomers(); + + boolean deleteCustomer(String id); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java new file mode 100644 index 0000000000..bc76f411f3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java @@ -0,0 +1,115 @@ +/* + * 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 com.tuscanyscatours.customer.impl; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.EagerInit; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Requires; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.customer.Customer; +import com.tuscanyscatours.customer.CustomerNotFoundException; +import com.tuscanyscatours.customer.CustomerRegistry; +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; +import com.tuscanyscatours.payment.creditcard.CreditCardTypeType; +import com.tuscanyscatours.payment.creditcard.ObjectFactory; +import com.tuscanyscatours.payment.creditcard.PayerType; + +/** + * An in-memory customer registry implementation + */ +@Service(CustomerRegistry.class) +@Scope("COMPOSITE") +@EagerInit +@Requires("{http://www.osoa.org/xmlns/sca/1.0}managedTransaction.global") +public class CustomerRegistryImpl implements CustomerRegistry { + private volatile static int idGenerator = 0; + private Map customers = new HashMap(); + + @Init + public void init() { + // Load the customers + ObjectFactory factory = new ObjectFactory(); + CreditCardDetailsType cc = factory.createCreditCardDetailsType(); + PayerType john = factory.createPayerType(); + john.setName("John Smith"); + cc.setCardOwner(john); + cc.setCreditCardNumber("1111-2222-3333-4444"); + cc.setCreditCardType(CreditCardTypeType.VISA); + cc.setCVV2("1234"); + cc.setExpMonth(1); + cc.setExpYear(2012); + createCustomer("John Smith", "john@xyz.com", cc); + } + + @Destroy + public void destroy() { + // Save the customers + } + + public Customer createCustomer(String name, String email, CreditCardDetailsType creditCard) { + Customer customer = new Customer(); + customer.setId("c-" + idGenerator++); + customer.setName(name); + customer.setEmail(email); + customer.setCreditCard(creditCard); + customers.put(customer.getId(), customer); + return customer; + } + + public boolean deleteCustomer(String id) { + return customers.remove(id) != null; + } + + public Collection getAllCustomers() { + return customers.values(); + } + + public Customer getCustomer(String id) throws CustomerNotFoundException { + Customer customer = customers.get(id); + + if (customer == null) { + throw new CustomerNotFoundException("Customer " + id + " not found"); + } + + return customer; + } + + public boolean updateCustomer(Customer customer) { + Customer current = null; + try { + current = getCustomer(customer.getId()); + } catch (Exception ex) { + return false; + } + + current.setEmail(customer.getEmail()); + current.setName(customer.getName()); + current.setCreditCard(customer.getCreditCard()); + return true; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java new file mode 100644 index 0000000000..8c6ca806d2 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java @@ -0,0 +1,30 @@ +/* + * 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 com.tuscanyscatours.emailgateway; + +import org.osoa.sca.annotations.Remotable; + +/** + * A gateway to send e-mail + */ +@Remotable +public interface EmailGateway { + public boolean sendEmail(String sender, String recipient, String subject, String body); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java new file mode 100644 index 0000000000..a6a162d5c3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java @@ -0,0 +1,37 @@ +/* + * 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 com.tuscanyscatours.emailgateway.impl; + +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.emailgateway.EmailGateway; + +@Service(EmailGateway.class) +public class EmailGatewayImpl implements EmailGateway { + + public boolean sendEmail(String sender, String recipient, String subject, String body) { + System.out.println("From: " + sender); + System.out.println("To: " + recipient); + System.out.println("Subject: " + subject); + System.out.println(body); + return true; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java new file mode 100644 index 0000000000..988605f7cd --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java @@ -0,0 +1,69 @@ +/* + * 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 com.tuscanyscatours.payment.impl; + +import org.osoa.sca.annotations.Property; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.customer.Customer; +import com.tuscanyscatours.customer.CustomerNotFoundException; +import com.tuscanyscatours.customer.CustomerRegistry; +import com.tuscanyscatours.emailgateway.EmailGateway; +import com.tuscanyscatours.payment.Payment; +import com.tuscanyscatours.payment.creditcard.AuthorizeFault_Exception; +import com.tuscanyscatours.payment.creditcard.CreditCardPayment; + +/** + * The payment implementation + */ +@Service(Payment.class) +public class PaymentImpl implements Payment { + + @Reference + protected CustomerRegistry customerRegistry; + + @Reference + protected CreditCardPayment creditCardPayment; + + @Reference + protected EmailGateway emailGateway; + + @Property + protected float transactionFee = 0.01f; + + public String makePaymentMember(String customerId, float amount) { + try { + Customer customer = customerRegistry.getCustomer(customerId); + String status = creditCardPayment.authorize(customer.getCreditCard(), amount + transactionFee); + emailGateway.sendEmail("order@tuscanyscatours.com", + customer.getEmail(), + "Status for your payment", + customer + " >>> Status = " + status); + return status; + } catch (CustomerNotFoundException ex) { + return "Payment failed due to " + ex.getMessage(); + } catch (AuthorizeFault_Exception e) { + return e.getFaultInfo().getErrorCode(); + } catch (Throwable t) { + return "Payment failed due to system error " + t.getMessage(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/resources/CreditCardPayment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/resources/CreditCardPayment.wsdl new file mode 100644 index 0000000000..d17497d1f6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/resources/CreditCardPayment.wsdl @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..f8ff7b4623 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..3885764899 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/resources/definitions.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/resources/definitions.xml new file mode 100644 index 0000000000..dc47395e9b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/resources/definitions.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/resources/payment.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/resources/payment.composite new file mode 100644 index 0000000000..b4dcd328b1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/main/resources/payment.composite @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + 0.02 + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/test/java/scatours/payment/PaymentTestCase.java new file mode 100644 index 0000000000..ee4e3a5e96 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-java/src/test/java/scatours/payment/PaymentTestCase.java @@ -0,0 +1,79 @@ +/* + * 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.payment; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentTestCase { + private static SCANode node; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + node = + SCANodeFactory.newInstance() + .createSCANode(null, + new SCAContribution("payment", "./target/classes"), + new SCAContribution("creditcard", + "../../contributions/creditcard-payment-jaxb/target/classes")); + node.start(); + } + + @Test + public void testPayment() { + SCAClient client = (SCAClient)node; + Payment payment = client.getService(Payment.class, "Payment"); + + String result = payment.makePaymentMember("c-0", 100.00f); + System.out.println("\n\nSuccessful Payment - Status = \n\n" + result); + if (!"OK".equals(result)) { + throw new RuntimeException(result); + } + System.out.println("\n\nFailed Payment - Status = \n\n" + payment.makePaymentMember("c-1", 100.00f)); + } + + @Test + @Ignore + public void testWaitForInput() { + System.out.println("Press a key to end"); + try { + System.in.read(); + } catch (Exception ex) { + } + System.out.println("Shutting down"); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + if (node != null) { + node.stop(); + node = null; + } + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/build.xml new file mode 100644 index 0000000000..d3dd869069 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/build.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/pom.xml new file mode 100644 index 0000000000..8ddf9b13bb --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/pom.xml @@ -0,0 +1,161 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-payment-python + Apache Tuscany SCA Tours Payment Python Contribution + + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-implementation-script + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + test + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + payment + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/payment.stale + false + true + + + + emailgateway + process-sources + + wsimport + + + com.tuscanyscatours.emailgateway + ${basedir}/src/main/resources + + EmailGateway.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/emailgateway.stale + false + true + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/main/resources/EmailGateway.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/main/resources/EmailGateway.wsdl new file mode 100644 index 0000000000..a097d9b7e4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/main/resources/EmailGateway.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..36e2990be1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..2519d7642e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/main/resources/payment.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/main/resources/payment.composite new file mode 100644 index 0000000000..a0de3e9d67 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/main/resources/payment.composite @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + 0.02 + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/main/resources/payment/PaymentImpl.py b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/main/resources/payment/PaymentImpl.py new file mode 100644 index 0000000000..095c549789 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/main/resources/payment/PaymentImpl.py @@ -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. + +from com.tuscanyscatours.emailgateway import EmailType + +def makePaymentMember(customerId, amount): + finalAmount = amount + transactionFee; + print "Total amount = ", finalAmount + email = EmailType() + email.setTo(customerId) + emailGateway.sendEmail(email) + return "Success" diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/test/java/scatours/payment/PaymentTestCase.java new file mode 100644 index 0000000000..0b61db2bf8 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/test/java/scatours/payment/PaymentTestCase.java @@ -0,0 +1,77 @@ +/* + * 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.payment; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.tuscanyscatours.payment.Payment; + +/** + * + */ +public class PaymentTestCase { + + private static SCANode paymentNode; + private static SCANode emailGatewayNode; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + emailGatewayNode = + SCANodeFactory.newInstance().createSCANode("emailgateway.composite", + new SCAContribution("emailgateway", + "../emailgateway/target/classes"), + new SCAContribution("emailgateway-test", + "../emailgateway/target/test-classes")); + + emailGatewayNode.start(); + + paymentNode = + SCANodeFactory.newInstance().createSCANode(null, + new SCAContribution("payment-python", "./target/classes"), + new SCAContribution("payment-python-test", + "./target/test-classes")); + + paymentNode.start(); + } + + @Test + public void testPayment() { + SCAClient client = (SCAClient)paymentNode; + Payment payment = client.getService(Payment.class, "PaymentClient"); + String result = payment.makePaymentMember("Fred", 100.00f); + System.out.println("Result = " + result); + if (!"Success".equals(result)) { + throw new RuntimeException(result); + } + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + paymentNode.stop(); + emailGatewayNode.stop(); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java new file mode 100644 index 0000000000..4f64b20c4e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java @@ -0,0 +1,37 @@ +/* + * 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.payment.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.payment.Payment; + +@Service(Payment.class) +public class PaymentClientImpl implements Payment { + @Reference + protected Payment payment; + + public String makePaymentMember(String customerId, float amount) { + // Delegate the external web service + return payment.makePaymentMember(customerId, amount); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/test/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/test/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..9b3e309d11 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/test/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/test/resources/payment-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/test/resources/payment-client.composite new file mode 100644 index 0000000000..353c1cea04 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-python/src/test/resources/payment-client.composite @@ -0,0 +1,32 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/build.xml new file mode 100644 index 0000000000..db0e41b22f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/build.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/pom.xml new file mode 100644 index 0000000000..1ab605e145 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/pom.xml @@ -0,0 +1,206 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-payment-spring-policy + Apache Tuscany SCA Tours Payment Spring Policy Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + + org.apache.tuscany.sca + tuscany-implementation-spring + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-spring-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + test + + + + junit + junit + 4.5 + test + + + + + + + java.net2 + java.net Maven 2.x Repository + http://download.java.net/maven/2 + + false + + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + payment + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/payment.stale + false + true + + + + payment.creditcard + process-sources + + wsimport + + + com.tuscanyscatours.payment.creditcard + ${basedir}/src/main/resources + + CreditCardPayment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/creditcard.stale + false + true + + + + scatours.emailgateway + process-sources + + wsimport + + + com.tuscanyscatours.emailgateway + ${basedir}/src/main/resources + + EmailGateway.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/emailgateway.stale + false + true + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/customer/Customer.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/customer/Customer.java new file mode 100644 index 0000000000..3b72f81b33 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/customer/Customer.java @@ -0,0 +1,70 @@ +/* + * 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 com.tuscanyscatours.customer; + +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; + +/** + * Customer data + */ +public class Customer { + private String id; + private String email; + private String name; + + private CreditCardDetailsType creditCard; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreditCardDetailsType getCreditCard() { + return creditCard; + } + + public void setCreditCard(CreditCardDetailsType creditCard) { + this.creditCard = creditCard; + } + + public String toString() { + return "id: " + id + " name: " + name + " e-mail: " + email; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java new file mode 100644 index 0000000000..b08f76e0fa --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java @@ -0,0 +1,57 @@ +/* + * 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 com.tuscanyscatours.customer; + +public class CustomerNotFoundException extends Exception { + private static final long serialVersionUID = -129752837478357452L; + + /** + * + */ + public CustomerNotFoundException() { + + } + + /** + * @param message + */ + public CustomerNotFoundException(String message) { + super(message); + + } + + /** + * @param cause + */ + public CustomerNotFoundException(Throwable cause) { + super(cause); + + } + + /** + * @param message + * @param cause + */ + public CustomerNotFoundException(String message, Throwable cause) { + super(message, cause); + + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.java new file mode 100644 index 0000000000..706167d567 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.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 com.tuscanyscatours.customer; + +import java.util.Collection; + +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; + +/** + * Customer registry interface + */ +public interface CustomerRegistry { + Customer createCustomer(String name, String email, CreditCardDetailsType creditCard); + + boolean updateCustomer(Customer customer); + + Customer getCustomer(String id) throws CustomerNotFoundException; + + Collection getAllCustomers(); + + boolean deleteCustomer(String id); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java new file mode 100644 index 0000000000..4381029543 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java @@ -0,0 +1,113 @@ +/* + * 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 com.tuscanyscatours.customer.impl; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.EagerInit; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.customer.Customer; +import com.tuscanyscatours.customer.CustomerNotFoundException; +import com.tuscanyscatours.customer.CustomerRegistry; +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; +import com.tuscanyscatours.payment.creditcard.CreditCardTypeType; +import com.tuscanyscatours.payment.creditcard.ObjectFactory; +import com.tuscanyscatours.payment.creditcard.PayerType; + +/** + * An in-memory customer registry implementation + */ +@Service(CustomerRegistry.class) +@Scope("COMPOSITE") +@EagerInit +public class CustomerRegistryImpl implements CustomerRegistry { + private volatile static int idGenerator = 0; + private Map customers = new HashMap(); + + @Init + public void init() { + // Load the customers + ObjectFactory factory = new ObjectFactory(); + CreditCardDetailsType cc = factory.createCreditCardDetailsType(); + PayerType john = factory.createPayerType(); + john.setName("John Smith"); + cc.setCardOwner(john); + cc.setCreditCardNumber("1111-2222-3333-4444"); + cc.setCreditCardType(CreditCardTypeType.VISA); + cc.setCVV2("1234"); + cc.setExpMonth(1); + cc.setExpYear(2012); + createCustomer("John Smith", "john@xyz.com", cc); + } + + @Destroy + public void destroy() { + // Save the customers + } + + public Customer createCustomer(String name, String email, CreditCardDetailsType creditCard) { + Customer customer = new Customer(); + customer.setId("c-" + idGenerator++); + customer.setName(name); + customer.setEmail(email); + customer.setCreditCard(creditCard); + customers.put(customer.getId(), customer); + return customer; + } + + public boolean deleteCustomer(String id) { + return customers.remove(id) != null; + } + + public Collection getAllCustomers() { + return customers.values(); + } + + public Customer getCustomer(String id) throws CustomerNotFoundException { + Customer customer = customers.get(id); + + if (customer == null) { + throw new CustomerNotFoundException("Customer " + id + " not found"); + } + + return customer; + } + + public boolean updateCustomer(Customer customer) { + Customer current = null; + try { + current = getCustomer(customer.getId()); + } catch (Exception ex) { + return false; + } + + current.setEmail(customer.getEmail()); + current.setName(customer.getName()); + current.setCreditCard(customer.getCreditCard()); + return true; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java new file mode 100644 index 0000000000..5eb825cb85 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.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 com.tuscanyscatours.emailgateway.impl; + +import com.tuscanyscatours.emailgateway.EmailGateway; +import com.tuscanyscatours.emailgateway.EmailType; + +public class EmailGatewayImpl implements EmailGateway { + + public String sendEmail(EmailType email) { + System.out.println("Sending mail to " + email.getTo()); + return "SENT"; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java new file mode 100644 index 0000000000..a35f761dc7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java @@ -0,0 +1,77 @@ +/* + * 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 com.tuscanyscatours.payment.impl; + +import com.tuscanyscatours.customer.Customer; +import com.tuscanyscatours.customer.CustomerNotFoundException; +import com.tuscanyscatours.customer.CustomerRegistry; +import com.tuscanyscatours.emailgateway.EmailGateway; +import com.tuscanyscatours.emailgateway.EmailType; +import com.tuscanyscatours.payment.Payment; +import com.tuscanyscatours.payment.creditcard.CreditCardPayment; + +public class PaymentImpl implements Payment { + + private CreditCardPayment creditCardPayment; + private CustomerRegistry customerRegistry; + private EmailGateway emailGateway; + private float transactionFee; + + public void setCreditCardPayment(CreditCardPayment creditCardPayment) { + this.creditCardPayment = creditCardPayment; + } + + public void setCustomerRegistry(CustomerRegistry customerRegistry) { + this.customerRegistry = customerRegistry; + } + + public void setEmailGateway(EmailGateway emailGateway) { + this.emailGateway = emailGateway; + } + + public void setTransactionFee(Float transactionFee) { + this.transactionFee = transactionFee; + } + + public String makePaymentMember(String customerId, float amount) { + try { + Customer customer = customerRegistry.getCustomer(customerId); + + amount += transactionFee; + + String status = creditCardPayment.authorize(customer.getCreditCard(), amount); + + com.tuscanyscatours.emailgateway.ObjectFactory emailFactory = + new com.tuscanyscatours.emailgateway.ObjectFactory(); + EmailType email = emailFactory.createEmailType(); + email.setTitle("Payment Received"); + email.setTo(customerId); + + emailGateway.sendEmail(email); + + return status; + } catch (CustomerNotFoundException ex) { + return "Payment failed due to " + ex.getMessage(); + } catch (Throwable t) { + return "Payment failed due to system error " + t.getMessage(); + } + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/CreditCardPayment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/CreditCardPayment.wsdl new file mode 100644 index 0000000000..8224cd126f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/CreditCardPayment.wsdl @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/EmailGateway.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/EmailGateway.wsdl new file mode 100644 index 0000000000..9e9a6ea685 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/EmailGateway.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..696bf293f3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/Payment-context.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/Payment-context.xml new file mode 100644 index 0000000000..bcb965924b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/Payment-context.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..e2c4062f2e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/definitions.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/definitions.xml new file mode 100644 index 0000000000..0e421d3b83 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/definitions.xml @@ -0,0 +1,35 @@ + + + + + + + + myname + mypassword + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/payment.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/payment.composite new file mode 100644 index 0000000000..3f5bcfe48d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/main/resources/payment.composite @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + 1.23 + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/test/java/scatours/payment/PaymentTestCase.java new file mode 100644 index 0000000000..9e59b05d80 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/test/java/scatours/payment/PaymentTestCase.java @@ -0,0 +1,74 @@ +/* + * 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.payment; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.tuscanyscatours.payment.Payment; + +/** + * + */ +public class PaymentTestCase { + private static SCANode paymentNode; + private static SCANode creditCardNode; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + creditCardNode = + SCANodeFactory.newInstance() + .createSCANode("creditcard.composite", + new SCAContribution("creditcard", "../creditcard-payment-jaxb-policy/target/classes")); + + creditCardNode.start(); + + paymentNode = + SCANodeFactory.newInstance() + .createSCANode(null, + new SCAContribution("payment-spring-policy", "./target/classes"), + new SCAContribution("payment-spring-policy-test", "./target/test-classes")); + + paymentNode.start(); + } + + @Test + public void testPayment() { + SCAClient client = (SCAClient)paymentNode; + Payment payment = client.getService(Payment.class, "PaymentClient"); + String result = payment.makePaymentMember("c-0", 100.00f); + System.out.println("Result = " + result); + if (!"OK".equals(result)) { + throw new RuntimeException(result); + } + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + paymentNode.stop(); + creditCardNode.stop(); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java new file mode 100644 index 0000000000..4f64b20c4e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java @@ -0,0 +1,37 @@ +/* + * 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.payment.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.payment.Payment; + +@Service(Payment.class) +public class PaymentClientImpl implements Payment { + @Reference + protected Payment payment; + + public String makePaymentMember(String customerId, float amount) { + // Delegate the external web service + return payment.makePaymentMember(customerId, amount); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/test/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/test/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..c97b6862f4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/test/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/test/resources/payment-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/test/resources/payment-client.composite new file mode 100644 index 0000000000..642cebfd1c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-policy/src/test/resources/payment-client.composite @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/build.xml new file mode 100644 index 0000000000..6ad2ea55ad --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/build.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/pom.xml new file mode 100644 index 0000000000..3ed7cd5bab --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/pom.xml @@ -0,0 +1,206 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-payment-spring-scatag + Apache Tuscany SCA Tours Payment Spring SCA Tag Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + + org.apache.tuscany.sca + tuscany-implementation-spring + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-spring-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + test + + + + junit + junit + 4.5 + test + + + + + + + java.net2 + java.net Maven 2.x Repository + http://download.java.net/maven/2 + + false + + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + payment + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/payment.stale + false + true + + + + payment.creditcard + process-sources + + wsimport + + + com.tuscanyscatours.payment.creditcard + ${basedir}/src/main/resources + + CreditCardPayment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/creditcard.stale + false + true + + + + scatours.emailgateway + process-sources + + wsimport + + + com.tuscanyscatours.emailgateway + ${basedir}/src/main/resources + + EmailGateway.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/emailgateway.stale + false + true + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java new file mode 100644 index 0000000000..5eb825cb85 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.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 com.tuscanyscatours.emailgateway.impl; + +import com.tuscanyscatours.emailgateway.EmailGateway; +import com.tuscanyscatours.emailgateway.EmailType; + +public class EmailGatewayImpl implements EmailGateway { + + public String sendEmail(EmailType email) { + System.out.println("Sending mail to " + email.getTo()); + return "SENT"; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java new file mode 100644 index 0000000000..42d995aa88 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java @@ -0,0 +1,76 @@ +/* + * 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 com.tuscanyscatours.payment.impl; + +import com.tuscanyscatours.emailgateway.EmailGateway; +import com.tuscanyscatours.emailgateway.EmailType; +import com.tuscanyscatours.payment.Payment; +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; +import com.tuscanyscatours.payment.creditcard.CreditCardPayment; +import com.tuscanyscatours.payment.creditcard.CreditCardTypeType; +import com.tuscanyscatours.payment.creditcard.ObjectFactory; +import com.tuscanyscatours.payment.creditcard.PayerType; + +//@Service(Payment.class) +public class PaymentImpl implements Payment { + + protected CreditCardPayment creditCardPayment; + protected EmailGateway emailGateway; + protected float transactionFee = 0; + + //@Reference + public void setCreditCardPayment(CreditCardPayment creditCardPayment) { + this.creditCardPayment = creditCardPayment; + } + + public void setEmailGateway(EmailGateway emailGateway) { + this.emailGateway = emailGateway; + } + + //@Property + public void setTransactionFee(Float transactionFee) { + this.transactionFee = transactionFee; + } + + public String makePaymentMember(String customerId, float amount) { + + ObjectFactory objectFactory = new ObjectFactory(); + CreditCardDetailsType ccDetails = objectFactory.createCreditCardDetailsType(); + ccDetails.setCreditCardType(CreditCardTypeType.fromValue("Visa")); + PayerType ccOwner = objectFactory.createPayerType(); + ccOwner.setName(customerId); + ccDetails.setCardOwner(ccOwner); + + amount += transactionFee; + + String status = creditCardPayment.authorize(ccDetails, amount); + + com.tuscanyscatours.emailgateway.ObjectFactory emailFactory = + new com.tuscanyscatours.emailgateway.ObjectFactory(); + EmailType email = emailFactory.createEmailType(); + email.setTitle("Payment Received"); + email.setTo(customerId); + + emailGateway.sendEmail(email); + + return status; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/CreditCardPayment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/CreditCardPayment.wsdl new file mode 100644 index 0000000000..8224cd126f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/CreditCardPayment.wsdl @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/EmailGateway.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/EmailGateway.wsdl new file mode 100644 index 0000000000..44867f794c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/EmailGateway.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..b480cc4aa1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/Payment-context.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/Payment-context.xml new file mode 100644 index 0000000000..83776cde1b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/Payment-context.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..e2c4062f2e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/payment.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/payment.composite new file mode 100644 index 0000000000..639f1e5662 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/main/resources/payment.composite @@ -0,0 +1,35 @@ + + + + + + + + + + + + + 1.23 + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/test/java/scatours/payment/PaymentTestCase.java new file mode 100644 index 0000000000..23ca9643c2 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/test/java/scatours/payment/PaymentTestCase.java @@ -0,0 +1,75 @@ +/* + * 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.payment; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.tuscanyscatours.payment.Payment; + +/** + * + */ +public class PaymentTestCase { + private static SCANode paymentNode; + private static SCANode creditCardNode; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + creditCardNode = + SCANodeFactory.newInstance() + .createSCANode("creditcard.composite", + new SCAContribution("creditcard", "../creditcard-payment-jaxb/target/classes")); + + creditCardNode.start(); + + paymentNode = + SCANodeFactory.newInstance().createSCANode(null, + new SCAContribution("payment-spring-annotation", + "./target/classes"), + new SCAContribution("payment-spring-annotation-test", + "./target/test-classes")); + + paymentNode.start(); + } + + @Test + public void testPayment() { + SCAClient client = (SCAClient)paymentNode; + Payment payment = client.getService(Payment.class, "PaymentClient"); + String result = payment.makePaymentMember("Fred", 100.00f); + System.out.println("Result = " + result); + if (!"OK".equals(result)) { + throw new RuntimeException(result); + } + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + paymentNode.stop(); + creditCardNode.stop(); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java new file mode 100644 index 0000000000..4f64b20c4e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java @@ -0,0 +1,37 @@ +/* + * 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.payment.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.payment.Payment; + +@Service(Payment.class) +public class PaymentClientImpl implements Payment { + @Reference + protected Payment payment; + + public String makePaymentMember(String customerId, float amount) { + // Delegate the external web service + return payment.makePaymentMember(customerId, amount); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/test/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/test/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..b5639eb1f9 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/test/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/test/resources/payment-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/test/resources/payment-client.composite new file mode 100644 index 0000000000..642cebfd1c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring-scatag/src/test/resources/payment-client.composite @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/build.xml new file mode 100644 index 0000000000..93c9dfc660 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/build.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/pom.xml new file mode 100644 index 0000000000..10df566a6b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/pom.xml @@ -0,0 +1,206 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-payment-spring + Apache Tuscany SCA Tours Payment Spring Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + + org.apache.tuscany.sca + tuscany-implementation-spring + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-spring-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + test + + + + junit + junit + 4.5 + test + + + + + + + java.net2 + java.net Maven 2.x Repository + http://download.java.net/maven/2 + + false + + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + payment + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/payment.stale + false + true + + + + payment.creditcard + process-sources + + wsimport + + + com.tuscanyscatours.payment.creditcard + ${basedir}/src/main/resources + + CreditCardPayment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/creditcard.stale + false + true + + + + scatours.emailgateway + process-sources + + wsimport + + + com.tuscanyscatours.emailgateway + ${basedir}/src/main/resources + + EmailGateway.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/emailgateway.stale + false + true + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/customer/Customer.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/customer/Customer.java new file mode 100644 index 0000000000..3b72f81b33 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/customer/Customer.java @@ -0,0 +1,70 @@ +/* + * 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 com.tuscanyscatours.customer; + +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; + +/** + * Customer data + */ +public class Customer { + private String id; + private String email; + private String name; + + private CreditCardDetailsType creditCard; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreditCardDetailsType getCreditCard() { + return creditCard; + } + + public void setCreditCard(CreditCardDetailsType creditCard) { + this.creditCard = creditCard; + } + + public String toString() { + return "id: " + id + " name: " + name + " e-mail: " + email; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java new file mode 100644 index 0000000000..b08f76e0fa --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/customer/CustomerNotFoundException.java @@ -0,0 +1,57 @@ +/* + * 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 com.tuscanyscatours.customer; + +public class CustomerNotFoundException extends Exception { + private static final long serialVersionUID = -129752837478357452L; + + /** + * + */ + public CustomerNotFoundException() { + + } + + /** + * @param message + */ + public CustomerNotFoundException(String message) { + super(message); + + } + + /** + * @param cause + */ + public CustomerNotFoundException(Throwable cause) { + super(cause); + + } + + /** + * @param message + * @param cause + */ + public CustomerNotFoundException(String message, Throwable cause) { + super(message, cause); + + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.java new file mode 100644 index 0000000000..706167d567 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/customer/CustomerRegistry.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 com.tuscanyscatours.customer; + +import java.util.Collection; + +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; + +/** + * Customer registry interface + */ +public interface CustomerRegistry { + Customer createCustomer(String name, String email, CreditCardDetailsType creditCard); + + boolean updateCustomer(Customer customer); + + Customer getCustomer(String id) throws CustomerNotFoundException; + + Collection getAllCustomers(); + + boolean deleteCustomer(String id); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java new file mode 100644 index 0000000000..26926c7764 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/customer/impl/CustomerRegistryImpl.java @@ -0,0 +1,115 @@ +/* + * 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 com.tuscanyscatours.customer.impl; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.EagerInit; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Requires; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.customer.Customer; +import com.tuscanyscatours.customer.CustomerNotFoundException; +import com.tuscanyscatours.customer.CustomerRegistry; +import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType; +import com.tuscanyscatours.payment.creditcard.CreditCardTypeType; +import com.tuscanyscatours.payment.creditcard.ObjectFactory; +import com.tuscanyscatours.payment.creditcard.PayerType; + +/** + * An in-memory customer registry implementation + */ +@Service(CustomerRegistry.class) +@Scope("COMPOSITE") +@EagerInit +@Requires("{http://www.osoa.org/xmlns/sca/1.0}managedTransaction.global") +public class CustomerRegistryImpl implements CustomerRegistry { + private volatile static int idGenerator = 0; + private Map customers = new HashMap(); + + @Init + public void init() { + // Load the customers + ObjectFactory factory = new ObjectFactory(); + CreditCardDetailsType cc = factory.createCreditCardDetailsType(); + PayerType john = factory.createPayerType(); + john.setName("John Smith"); + cc.setCardOwner(john); + cc.setCreditCardNumber("1111-2222-3333-4444"); + cc.setCreditCardType(CreditCardTypeType.VISA); + cc.setCVV2("1234"); + cc.setExpMonth(1); + cc.setExpYear(2012); + createCustomer("John Smith", "john@xyz.com", cc); + } + + @Destroy + public void destroy() { + // Save the customers + } + + public Customer createCustomer(String name, String email, CreditCardDetailsType creditCard) { + Customer customer = new Customer(); + customer.setId("c-" + idGenerator++); + customer.setName(name); + customer.setEmail(email); + customer.setCreditCard(creditCard); + customers.put(customer.getId(), customer); + return customer; + } + + public boolean deleteCustomer(String id) { + return customers.remove(id) != null; + } + + public Collection getAllCustomers() { + return customers.values(); + } + + public Customer getCustomer(String id) throws CustomerNotFoundException { + Customer customer = customers.get(id); + + if (customer == null) { + throw new CustomerNotFoundException("Customer " + id + " not found"); + } + + return customer; + } + + public boolean updateCustomer(Customer customer) { + Customer current = null; + try { + current = getCustomer(customer.getId()); + } catch (Exception ex) { + return false; + } + + current.setEmail(customer.getEmail()); + current.setName(customer.getName()); + current.setCreditCard(customer.getCreditCard()); + return true; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.java new file mode 100644 index 0000000000..5eb825cb85 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/emailgateway/impl/EmailGatewayImpl.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 com.tuscanyscatours.emailgateway.impl; + +import com.tuscanyscatours.emailgateway.EmailGateway; +import com.tuscanyscatours.emailgateway.EmailType; + +public class EmailGatewayImpl implements EmailGateway { + + public String sendEmail(EmailType email) { + System.out.println("Sending mail to " + email.getTo()); + return "SENT"; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java new file mode 100644 index 0000000000..a35f761dc7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/java/com/tuscanyscatours/payment/impl/PaymentImpl.java @@ -0,0 +1,77 @@ +/* + * 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 com.tuscanyscatours.payment.impl; + +import com.tuscanyscatours.customer.Customer; +import com.tuscanyscatours.customer.CustomerNotFoundException; +import com.tuscanyscatours.customer.CustomerRegistry; +import com.tuscanyscatours.emailgateway.EmailGateway; +import com.tuscanyscatours.emailgateway.EmailType; +import com.tuscanyscatours.payment.Payment; +import com.tuscanyscatours.payment.creditcard.CreditCardPayment; + +public class PaymentImpl implements Payment { + + private CreditCardPayment creditCardPayment; + private CustomerRegistry customerRegistry; + private EmailGateway emailGateway; + private float transactionFee; + + public void setCreditCardPayment(CreditCardPayment creditCardPayment) { + this.creditCardPayment = creditCardPayment; + } + + public void setCustomerRegistry(CustomerRegistry customerRegistry) { + this.customerRegistry = customerRegistry; + } + + public void setEmailGateway(EmailGateway emailGateway) { + this.emailGateway = emailGateway; + } + + public void setTransactionFee(Float transactionFee) { + this.transactionFee = transactionFee; + } + + public String makePaymentMember(String customerId, float amount) { + try { + Customer customer = customerRegistry.getCustomer(customerId); + + amount += transactionFee; + + String status = creditCardPayment.authorize(customer.getCreditCard(), amount); + + com.tuscanyscatours.emailgateway.ObjectFactory emailFactory = + new com.tuscanyscatours.emailgateway.ObjectFactory(); + EmailType email = emailFactory.createEmailType(); + email.setTitle("Payment Received"); + email.setTo(customerId); + + emailGateway.sendEmail(email); + + return status; + } catch (CustomerNotFoundException ex) { + return "Payment failed due to " + ex.getMessage(); + } catch (Throwable t) { + return "Payment failed due to system error " + t.getMessage(); + } + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/CreditCardPayment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/CreditCardPayment.wsdl new file mode 100644 index 0000000000..8224cd126f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/CreditCardPayment.wsdl @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/EmailGateway.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/EmailGateway.wsdl new file mode 100644 index 0000000000..44867f794c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/EmailGateway.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..b480cc4aa1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/Payment-context.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/Payment-context.xml new file mode 100644 index 0000000000..f27280bf2f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/Payment-context.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..e2c4062f2e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/payment.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/payment.composite new file mode 100644 index 0000000000..1e5bae2a2b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/main/resources/payment.composite @@ -0,0 +1,35 @@ + + + + + + + + + + + + + 1.23 + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/test/java/scatours/payment/PaymentTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/test/java/scatours/payment/PaymentTestCase.java new file mode 100644 index 0000000000..e1634c95f9 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/test/java/scatours/payment/PaymentTestCase.java @@ -0,0 +1,74 @@ +/* + * 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.payment; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.tuscanyscatours.payment.Payment; + +/** + * + */ +public class PaymentTestCase { + private static SCANode paymentNode; + private static SCANode creditCardNode; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + creditCardNode = + SCANodeFactory.newInstance() + .createSCANode("creditcard.composite", + new SCAContribution("creditcard", "../creditcard-payment-jaxb/target/classes")); + + creditCardNode.start(); + + paymentNode = + SCANodeFactory.newInstance().createSCANode(null, + new SCAContribution("payment-spring", "./target/classes"), + new SCAContribution("payment-spring-test", + "./target/test-classes")); + + paymentNode.start(); + } + + @Test + public void testPayment() { + SCAClient client = (SCAClient)paymentNode; + Payment payment = client.getService(Payment.class, "PaymentClient"); + String result = payment.makePaymentMember("c-0", 100.00f); + System.out.println("Result = " + result); + if (!"OK".equals(result)) { + throw new RuntimeException(result); + } + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + paymentNode.stop(); + creditCardNode.stop(); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java new file mode 100644 index 0000000000..4f64b20c4e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/test/java/scatours/payment/client/impl/PaymentClientImpl.java @@ -0,0 +1,37 @@ +/* + * 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.payment.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.payment.Payment; + +@Service(Payment.class) +public class PaymentClientImpl implements Payment { + @Reference + protected Payment payment; + + public String makePaymentMember(String customerId, float amount) { + // Delegate the external web service + return payment.makePaymentMember(customerId, amount); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/test/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/test/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..b5639eb1f9 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/test/resources/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/test/resources/payment-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/test/resources/payment-client.composite new file mode 100644 index 0000000000..642cebfd1c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/payment-spring/src/test/resources/payment-client.composite @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/build.xml new file mode 100644 index 0000000000..2a85f58a3f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/build.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/pom.xml new file mode 100644 index 0000000000..8cb418405e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/pom.xml @@ -0,0 +1,107 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-policy-client + Apache Tuscany SCA Tours Policy Client Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + scatours-contribution-common + ${pom.version} + provided + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + payment + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + false + true + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/src/main/java/scatours/client/TestClient.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/src/main/java/scatours/client/TestClient.java new file mode 100644 index 0000000000..6f1243b103 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/src/main/java/scatours/client/TestClient.java @@ -0,0 +1,60 @@ +/* + * 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.client; + + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.payment.Payment; + +import com.tuscanyscatours.common.Book; +import com.tuscanyscatours.common.TripItem; + +/** + * A client for calling payment and trip components directly. The components in this + * case are expected to have policy configuration associated with the in the + * composite files that define them + * + */ +@Service(Runnable.class) +public class TestClient { + @Reference + protected Payment payment; + + @Reference + protected Book tripBooking; + + public TestClient() { + } + + public void run() { + System.out.println("==============================================="); + System.out.println("Test the loggin policy by calling the trip component"); + TripItem tripItem = + new TripItem("1234", "5678", TripItem.TRIP, "FS1DEC06", "Florence and Siena pre-packaged tour", "FLR", + "06/12/09", "13/12/09", 450, "EUR", "http://localhost:8085/tbd"); + System.out.println("Result = " + tripBooking.book(tripItem)); + System.out.println("==============================================="); + System.out.println("Test the basic authentication policy by calling the payment component"); + System.out.println("TestClient - Successful Payment - Status = " + payment.makePaymentMember("c-0", 100.00f)); + System.out.println("==============================================="); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..4300ce0dc0 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..2519d7642e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/src/main/resources/client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/src/main/resources/client.composite new file mode 100644 index 0000000000..5b632b4be2 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/policy-client/src/main/resources/client.composite @@ -0,0 +1,29 @@ + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/pom.xml new file mode 100644 index 0000000000..31845ec773 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/pom.xml @@ -0,0 +1,94 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../pom.xml + + scatours-contributions + pom + Apache Tuscany SCA Tours Contributions + + + blog-feed + buildingblocks + buildingblocks-client + calendar + car + common + creditcard-payment-jaxb + creditcard-payment-jaxb-policy + creditcard-payment-sdo + creditcard-payment-webapp + currency + currency-corba + currency-jms + currency-jsp + currency-rmi + currency-servlet + currency-ws + databinding-client + emailgateway + feed-logger + flight + fullapp-ui + fullapp-coordination + fullapp-currency + fullapp-packagedtrip + fullapp-bespoketrip + fullapp-shoppingcart + help-pages + hotel + interaction-client + interaction-service-remote + introducing-client + introducing-tours + introducing-trips + notification + notification-ws + notification-corba + notification-ejb + notification-jms + notification-rmi + shoppingcart + travelcatalog + tripbooking + trip + scatours + payment-java + payment-java-callback + payment-java-policy + payment-java-reference-pass + payment-spring + payment-spring-policy + payment-spring-scatag + payment-bpel-process + payment-bpel + payment-groovy + payment-python + policy-client + trip-policy + usingsca + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/build.xml new file mode 100644 index 0000000000..bdb8f8ecc4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/build.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/pom.xml new file mode 100644 index 0000000000..bbebd81957 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/pom.xml @@ -0,0 +1,78 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-scatours + Apache Tuscany SCA Tours SCATours Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + scatours-contribution-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + scatours-contribution-travelcatalog + ${pom.version} + provided + + + + org.apache.tuscany.sca + scatours-contribution-tripbooking + ${pom.version} + provided + + + + org.apache.tuscany.sca + scatours-contribution-shoppingcart + ${pom.version} + provided + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/src/main/java/com/tuscanyscatours/SCAToursBooking.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/src/main/java/com/tuscanyscatours/SCAToursBooking.java new file mode 100644 index 0000000000..a1e0d6c91f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/src/main/java/com/tuscanyscatours/SCAToursBooking.java @@ -0,0 +1,31 @@ +/* + * 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 com.tuscanyscatours; + +import org.osoa.sca.annotations.Remotable; + +import com.tuscanyscatours.common.TripItem; + +/** + * The SCA Tours trip booking service interface + */ +@Remotable +public interface SCAToursBooking { + String bookTrip(String cartId, TripItem tripId); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/src/main/java/com/tuscanyscatours/SCAToursCart.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/src/main/java/com/tuscanyscatours/SCAToursCart.java new file mode 100644 index 0000000000..f9554342e9 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/src/main/java/com/tuscanyscatours/SCAToursCart.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 com.tuscanyscatours; + +import org.osoa.sca.annotations.Remotable; + +import com.tuscanyscatours.common.TripItem; + +/** + * The ShoppingCart service interface + */ +@Remotable +public interface SCAToursCart { + String newCart(); + + TripItem[] getTrips(String cartId); + + void checkout(String cartId); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/src/main/java/com/tuscanyscatours/SCAToursSearch.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/src/main/java/com/tuscanyscatours/SCAToursSearch.java new file mode 100644 index 0000000000..6ce03fbb86 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/src/main/java/com/tuscanyscatours/SCAToursSearch.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 com.tuscanyscatours; + +import org.osoa.sca.annotations.Remotable; + +import com.tuscanyscatours.common.TripItem; +import com.tuscanyscatours.common.TripLeg; + +/** + * The Search service interface + */ +@Remotable +public interface SCAToursSearch { + TripItem[] search(TripLeg tripLeg); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/src/main/java/com/tuscanyscatours/impl/SCAToursImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/src/main/java/com/tuscanyscatours/impl/SCAToursImpl.java new file mode 100644 index 0000000000..7a7f6b460d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/src/main/java/com/tuscanyscatours/impl/SCAToursImpl.java @@ -0,0 +1,84 @@ +/* + * 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 com.tuscanyscatours.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.SCAToursBooking; +import com.tuscanyscatours.SCAToursCart; +import com.tuscanyscatours.SCAToursSearch; +import com.tuscanyscatours.common.TripItem; +import com.tuscanyscatours.common.TripLeg; +import com.tuscanyscatours.shoppingcart.CartCheckout; +import com.tuscanyscatours.shoppingcart.CartInitialize; +import com.tuscanyscatours.travelcatalog.TravelCatalogSearch; +import com.tuscanyscatours.tripbooking.TripBooking; + +/** + * An implementation of the SCA tours component. it's just a pass through and allows + * the outward facing bindings to be changed without changing the individual contributions + */ +@Scope("COMPOSITE") +@Service(interfaces = {SCAToursSearch.class, SCAToursBooking.class, SCAToursCart.class}) +public class SCAToursImpl implements SCAToursSearch, SCAToursBooking, SCAToursCart { + + @Reference + protected TravelCatalogSearch travelCatalogSearch; + + @Reference + protected TripBooking tripBooking; + + @Reference + protected CartInitialize cartInitialize; + + @Reference + protected CartCheckout cartCheckout; + + // SCAToursSearch methods + + public TripItem[] search(TripLeg tripLeg) { + return travelCatalogSearch.search(tripLeg); + } + + // SCAToursBooking methods + + public String bookTrip(String cartId, TripItem trip) { + TripItem bookedTrip = tripBooking.bookTrip(cartId, trip); + return bookedTrip.getBookingCode(); + } + + // SCAToursCart methods + + public String newCart() { + String cartId = cartInitialize.newCart(); + return cartId; + } + + public TripItem[] getTrips(String cartId) { + return cartInitialize.getTrips(cartId); + } + + public void checkout(String cartId) { + // need to get the user id from the context here but + // just make one up for the time being + cartCheckout.checkout(cartId, "c-0"); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..2728a88840 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/scatours/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,27 @@ + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/build.xml new file mode 100644 index 0000000000..1976d2b5ed --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/build.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/pom.xml new file mode 100644 index 0000000000..bd521f70d6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/pom.xml @@ -0,0 +1,125 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-shoppingcart + Apache Tuscany SCA Tours Shopping Cart Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + scatours-contribution-common + ${pom.version} + provided + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + junit + junit + 4.5 + test + + + + + + + java.net2 + java.net Maven 2.x Repository + http://download.java.net/maven/2 + + false + + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + payment + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + false + true + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/CartCheckout.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/CartCheckout.java new file mode 100644 index 0000000000..929f9895c6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/CartCheckout.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 com.tuscanyscatours.shoppingcart; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface CartCheckout { + void checkout(String cartId, String name); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/CartInitialize.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/CartInitialize.java new file mode 100644 index 0000000000..24affc4b23 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/CartInitialize.java @@ -0,0 +1,30 @@ +/* + * 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 com.tuscanyscatours.shoppingcart; + +import org.osoa.sca.annotations.Remotable; + +import com.tuscanyscatours.common.TripItem; + +@Remotable +public interface CartInitialize { + String newCart(); + + TripItem[] getTrips(String cartId); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/CartStore.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/CartStore.java new file mode 100644 index 0000000000..c7d03d765b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/CartStore.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 com.tuscanyscatours.shoppingcart; + +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.EndsConversation; +import org.osoa.sca.annotations.Remotable; + +import com.tuscanyscatours.common.TripItem; + +/** + * The CartStore service interface + */ +@Remotable +@Conversational +public interface CartStore { + void addTrip(TripItem trip); + + void removeTrip(TripItem trip); + + TripItem[] getTrips(); + + @EndsConversation + void reset(); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/CartUpdates.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/CartUpdates.java new file mode 100644 index 0000000000..f9a1272695 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/CartUpdates.java @@ -0,0 +1,30 @@ +/* + * 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 com.tuscanyscatours.shoppingcart; + +import org.osoa.sca.annotations.Remotable; + +import com.tuscanyscatours.common.TripItem; + +@Remotable +public interface CartUpdates { + void addTrip(String cartId, TripItem trip); + + void removeTrip(String cartId, TripItem trip); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/impl/CartStoreImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/impl/CartStoreImpl.java new file mode 100644 index 0000000000..460b962526 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/impl/CartStoreImpl.java @@ -0,0 +1,70 @@ +/* + * 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 com.tuscanyscatours.shoppingcart.impl; + +import java.util.ArrayList; +import java.util.List; + +import org.osoa.sca.annotations.ConversationID; +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.common.TripItem; +import com.tuscanyscatours.shoppingcart.CartStore; + +/** + * An implementation of the CartStore service + */ +@Scope("CONVERSATION") +@Service(interfaces = {CartStore.class}) +public class CartStoreImpl implements CartStore { + + @ConversationID + protected String cartId; + + private List trips = new ArrayList(); + + @Init + public void initCart() { + System.out.println("CartStore init for id: " + cartId); + } + + @Destroy + public void destroyCart() { + System.out.println("CartStore destroy for id: " + cartId); + } + + public void addTrip(TripItem trip) { + trips.add(trip); + } + + public void removeTrip(TripItem trip) { + trips.remove(trip); + } + + public TripItem[] getTrips() { + return trips.toArray(new TripItem[trips.size()]); + } + + public void reset() { + trips.clear(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/impl/ShoppingCartImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/impl/ShoppingCartImpl.java new file mode 100644 index 0000000000..41c58e5266 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/java/com/tuscanyscatours/shoppingcart/impl/ShoppingCartImpl.java @@ -0,0 +1,104 @@ +/* + * 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 com.tuscanyscatours.shoppingcart.impl; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import org.osoa.sca.ComponentContext; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.common.TripItem; +import com.tuscanyscatours.payment.Payment; +import com.tuscanyscatours.shoppingcart.CartCheckout; +import com.tuscanyscatours.shoppingcart.CartInitialize; +import com.tuscanyscatours.shoppingcart.CartStore; +import com.tuscanyscatours.shoppingcart.CartUpdates; + +/** + * An implementation of the ShoppingCart service + */ +@Service(interfaces = {CartInitialize.class, CartUpdates.class, CartCheckout.class}) +public class ShoppingCartImpl implements CartInitialize, CartUpdates, CartCheckout { + + @Reference + protected Payment payment; + + @Reference + protected CartStore cartStore; + + @Context + protected ComponentContext componentContext; + + private static Map cartStores = new HashMap(); + + public String newCart() { + String cartId = UUID.randomUUID().toString(); + ServiceReference cartStore = componentContext.getServiceReference(CartStore.class, "cartStore"); + cartStore.setConversationID(cartId); + cartStores.put(cartId, cartStore.getService()); + + return cartId; + } + + public void addTrip(String cartId, TripItem trip) { + cartStores.get(cartId).addTrip(trip); + } + + public void removeTrip(String cartId, TripItem trip) { + cartStores.get(cartId).addTrip(trip); + } + + public TripItem[] getTrips(String cartId) { + return cartStores.get(cartId).getTrips(); + } + + public void checkout(String cartId, String customerName) { + // get users credentials. Hard coded for now but should + // come from the security context + String customerId = customerName; + + // get the total for all the trips + float amount = (float)0.0; + + TripItem[] trips = getTrips(cartId); + + for (TripItem trip : trips) { + if (trip.getType().equals(TripItem.TRIP)) { + amount += trip.getPrice(); + } else { + for (TripItem tripItem : trip.getTripItems()) { + amount += tripItem.getPrice(); + } + } + } + + // Take the payment from the customer + payment.makePaymentMember(customerId, amount); + + // reset the cart store + cartStores.get(cartId).reset(); + cartStores.remove(cartId); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..176c031c4c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..3885764899 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/shoppingcart/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/travelcatalog/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/travelcatalog/build.xml new file mode 100644 index 0000000000..45373a4910 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/travelcatalog/build.xml @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/travelcatalog/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/travelcatalog/pom.xml new file mode 100644 index 0000000000..1df6a3e8cd --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/travelcatalog/pom.xml @@ -0,0 +1,64 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-travelcatalog + Apache Tuscany SCA Tours Travel Catalog Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + scatours-contribution-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + scatours-contribution-currency + ${pom.version} + provided + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/travelcatalog/src/main/java/com/tuscanyscatours/travelcatalog/TravelCatalogSearch.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/travelcatalog/src/main/java/com/tuscanyscatours/travelcatalog/TravelCatalogSearch.java new file mode 100644 index 0000000000..e558439f82 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/travelcatalog/src/main/java/com/tuscanyscatours/travelcatalog/TravelCatalogSearch.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 com.tuscanyscatours.travelcatalog; + +import org.osoa.sca.annotations.Remotable; + +import com.tuscanyscatours.common.TripItem; +import com.tuscanyscatours.common.TripLeg; + +/** + * The TravelCatalogSearch service interface + */ +@Remotable +public interface TravelCatalogSearch { + TripItem[] search(TripLeg tripLeg); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/travelcatalog/src/main/java/com/tuscanyscatours/travelcatalog/impl/TravelCatalogImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/travelcatalog/src/main/java/com/tuscanyscatours/travelcatalog/impl/TravelCatalogImpl.java new file mode 100644 index 0000000000..90351720bb --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/travelcatalog/src/main/java/com/tuscanyscatours/travelcatalog/impl/TravelCatalogImpl.java @@ -0,0 +1,127 @@ +/* + * 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 com.tuscanyscatours.travelcatalog.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.CountDownLatch; + +import org.osoa.sca.ComponentContext; +import org.osoa.sca.RequestContext; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Property; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.common.Search; +import com.tuscanyscatours.common.SearchCallback; +import com.tuscanyscatours.common.TripItem; +import com.tuscanyscatours.common.TripLeg; +import com.tuscanyscatours.currencyconverter.CurrencyConverter; +import com.tuscanyscatours.travelcatalog.TravelCatalogSearch; + +/** + * An implementation of the travel catalog service + */ +@Scope("COMPOSITE") +@Service(interfaces = {TravelCatalogSearch.class}) +public class TravelCatalogImpl implements TravelCatalogSearch, SearchCallback { + + @Reference + protected Search hotelSearch; + + @Reference + protected Search flightSearch; + + @Reference + protected Search carSearch; + + @Reference + protected Search tripSearch; + + @Property + public String quoteCurrencyCode = "USD"; + + @Reference + protected CurrencyConverter currencyConverter; + + @Context + protected ComponentContext componentContext; + + private List searchResults = new ArrayList(); + + CountDownLatch resultsReceivedCountdown; + + // TravelSearch methods + + public TripItem[] search(TripLeg tripLeg) { + + resultsReceivedCountdown = new CountDownLatch(4); + searchResults.clear(); + + ServiceReference dynamicHotelSearch = componentContext.getServiceReference(Search.class, "hotelSearch"); + + dynamicHotelSearch.setCallbackID("HotelSearchCallbackID-" + tripLeg.getId()); + dynamicHotelSearch.getService().searchAsynch(tripLeg); + + flightSearch.searchAsynch(tripLeg); + carSearch.searchAsynch(tripLeg); + tripSearch.searchAsynch(tripLeg); + + System.out.println("going into wait"); + + try { + resultsReceivedCountdown.await(); + } catch (InterruptedException ex) { + } + + for (TripItem tripItem : searchResults) { + tripItem.setId(UUID.randomUUID().toString()); + tripItem.setTripId(tripLeg.getId()); + tripItem + .setPrice(currencyConverter.convert(tripItem.getCurrency(), quoteCurrencyCode, tripItem.getPrice())); + tripItem.setCurrency(quoteCurrencyCode); + } + + return searchResults.toArray(new TripItem[searchResults.size()]); + } + + // SearchCallback methods + + public synchronized void searchResults(TripItem[] items) { + RequestContext requestContext = componentContext.getRequestContext(); + Object callbackID = requestContext.getServiceReference().getCallbackID(); + System.out.println("Asynch response - " + callbackID); + + if (items != null) { + for (int i = 0; i < items.length; i++) { + searchResults.add(items[i]); + } + } + + resultsReceivedCountdown.countDown(); + } + + public void setPercentComplete(String searchComponent, int percentComplete) { + // Not used at the moment + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/travelcatalog/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/travelcatalog/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..b18ae45a09 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/travelcatalog/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/build.xml new file mode 100644 index 0000000000..a6c7e4e058 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/build.xml @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/pom.xml new file mode 100644 index 0000000000..4d673c1e50 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/pom.xml @@ -0,0 +1,78 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-trip-policy + Apache Tuscany SCA Tours Prepackaged Trip Policy Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + scatours-contribution-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-policy-logging + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + test + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripImpl.java new file mode 100644 index 0000000000..2b7047ac07 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripImpl.java @@ -0,0 +1,94 @@ +/* + * 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 com.tuscanyscatours.trip.impl; + +import java.util.ArrayList; +import java.util.List; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.common.Book; +import com.tuscanyscatours.common.Search; +import com.tuscanyscatours.common.SearchCallback; +import com.tuscanyscatours.common.TripItem; +import com.tuscanyscatours.common.TripLeg; + +/** + * An implementation of the Trip service + */ +@Scope("STATELESS") +@Service(interfaces = {Search.class, Book.class}) +public class TripImpl implements Search, Book { + + private List trips = new ArrayList(); + + @Callback + protected SearchCallback searchCallback; + + @Init + public void init() { + trips.add(new TripInfo("FS1DEC06", "Florence and Siena pre-packaged tour", "LGW", "FLR", "06/12/09", + "13/12/09", "27", 450, "EUR", "http://localhost:8085/tbd")); + trips.add(new TripInfo("FS1DEC13", "Florence and Siena pre-packaged tour 2", "LGW", "FLR", "13/12/09", + "20/12/09", "27", 550, "EUR", "http://localhost:8085/tbd")); + } + + public TripItem[] searchSynch(TripLeg tripLeg) { + List items = new ArrayList(); + + // find the pre-package trip + for (TripInfo trip : trips) { + if ((trip.getFromLocation().equals(tripLeg.getFromLocation())) && (trip.getToLocation().equals(tripLeg + .getToLocation())) + && (trip.getFromDate().equals(tripLeg.getFromDate()))) { + TripItem item = + new TripItem("", "", TripItem.TRIP, trip.getName(), trip.getDescription(), + trip.getFromLocation() + " - " + trip.getToLocation(), trip.getFromDate(), trip + .getToDate(), trip.getPricePerPerson(), trip.getCurrency(), trip.getLink()); + items.add(item); + } + } + + return items.toArray(new TripItem[items.size()]); + } + + public void searchAsynch(TripLeg tripLeg) { + System.out.println("Starting trip search"); + + try { + Thread.sleep(2000); + } catch (Exception ex) { + // do nothing + } + + // return available hotels + searchCallback.searchResults(searchSynch(tripLeg)); + } + + public int getPercentComplete() { + return 100; + } + + public String book(TripItem tripItem) { + return "trip1"; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripInfo.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripInfo.java new file mode 100644 index 0000000000..5edbc92ccd --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/main/java/com/tuscanyscatours/trip/impl/TripInfo.java @@ -0,0 +1,140 @@ +/* + * 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 com.tuscanyscatours.trip.impl; + +public class TripInfo { + + private String name; + private String description; + private String fromLocation; + private String toLocation; + private String fromDate; + private String toDate; + private String spaces; + private double pricePerPerson; + private String currency; + private String link; + + public TripInfo() { + } + + public TripInfo(String name, + String description, + String fromLocation, + String toLocation, + String fromDate, + String toDate, + String spaces, + double pricePerPerson, + String currency, + String link) { + + this.name = name; + this.description = description; + this.fromLocation = fromLocation; + this.toLocation = toLocation; + this.fromDate = fromDate; + this.toDate = toDate; + this.spaces = spaces; + this.pricePerPerson = pricePerPerson; + this.currency = currency; + this.link = link; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getFromLocation() { + return fromLocation; + } + + public void setFromLocation(String fromLocation) { + this.fromLocation = fromLocation; + } + + public String getToLocation() { + return toLocation; + } + + public void setToLocation(String toLocation) { + this.toLocation = toLocation; + } + + public String getFromDate() { + return fromDate; + } + + public void setFromDate(String fromDate) { + this.fromDate = fromDate; + } + + public String getToDate() { + return toDate; + } + + public void setToDate(String toDate) { + this.toDate = toDate; + } + + public String getSpaces() { + return spaces; + } + + public void setSpaces(String spaces) { + this.spaces = spaces; + } + + public double getPricePerPerson() { + return pricePerPerson; + } + + public void setPricePerPerson(double pricePerPerson) { + this.pricePerPerson = pricePerPerson; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..21555e4514 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/main/resources/definitions.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/main/resources/definitions.xml new file mode 100644 index 0000000000..8d7ff59b0c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/main/resources/definitions.xml @@ -0,0 +1,32 @@ + + + + + + + + FINER + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/main/resources/trip.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/main/resources/trip.composite new file mode 100644 index 0000000000..06c449633c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/main/resources/trip.composite @@ -0,0 +1,31 @@ + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/test/java/scatours/trip/TripTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/test/java/scatours/trip/TripTestCase.java new file mode 100644 index 0000000000..fd2cc073ec --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip-policy/src/test/java/scatours/trip/TripTestCase.java @@ -0,0 +1,68 @@ +/* + * 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.trip; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.tuscanyscatours.common.Book; +import com.tuscanyscatours.common.TripItem; + +/** + * + */ +public class TripTestCase { + private static SCANode tripNode; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + try { + tripNode = + SCANodeFactory.newInstance().createSCANode("trip.composite", + new SCAContribution("trip", "./target/classes"), + new SCAContribution("trip-test", "./target/test-classes")); + + tripNode.start(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + @Test + public void testPayment() { + SCAClient client = (SCAClient)tripNode; + Book booking = client.getService(Book.class, "Trip/Book"); + TripItem tripItem = + new TripItem("1234", "5678", TripItem.TRIP, "FS1DEC06", "Florence and Siena pre-packaged tour", "FLR", + "06/12/09", "13/12/09", 450, "EUR", "http://localhost:8085/tbd"); + System.out.println("Result = " + booking.book(tripItem) + "\n"); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + tripNode.stop(); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/build.xml new file mode 100644 index 0000000000..6e48af3cf8 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/build.xml @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/pom.xml new file mode 100644 index 0000000000..4dfd487290 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/pom.xml @@ -0,0 +1,78 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-trip + Apache Tuscany SCA Tours Prepackaged Trip Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + scatours-contribution-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-policy-logging + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + test + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/main/java/com/tuscanyscatours/trip/impl/TripImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/main/java/com/tuscanyscatours/trip/impl/TripImpl.java new file mode 100644 index 0000000000..ec90524518 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/main/java/com/tuscanyscatours/trip/impl/TripImpl.java @@ -0,0 +1,94 @@ +/* + * 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 com.tuscanyscatours.trip.impl; + +import java.util.ArrayList; +import java.util.List; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.common.Book; +import com.tuscanyscatours.common.Search; +import com.tuscanyscatours.common.SearchCallback; +import com.tuscanyscatours.common.TripItem; +import com.tuscanyscatours.common.TripLeg; + +/** + * An implementation of the Trip service + */ +@Scope("STATELESS") +@Service(interfaces = {Search.class, Book.class}) +public class TripImpl implements Search, Book { + + private List trips = new ArrayList(); + + @Callback + protected SearchCallback searchCallback; + + @Init + public void init() { + trips.add(new TripInfo("FS1DEC06", "Florence and Siena pre-packaged tour", "LGW", "FLR", "06/12/09", + "13/12/09", "27", 450, "EUR", "http://localhost:8085/tbd")); + trips.add(new TripInfo("FS1DEC13", "Florence and Siena pre-packaged tour 2", "LGW", "FLR", "13/12/09", + "20/12/09", "27", 550, "EUR", "http://localhost:8085/tbd")); + } + + public TripItem[] searchSynch(TripLeg tripLeg) { + List items = new ArrayList(); + + // find the pre-package trip + for (TripInfo trip : trips) { + if ((trip.getFromLocation().equals(tripLeg.getFromLocation())) && (trip.getToLocation().equals(tripLeg + .getToLocation())) + && (trip.getFromDate().equals(tripLeg.getFromDate()))) { + TripItem item = + new TripItem("", "", TripItem.TRIP, trip.getName(), trip.getDescription(), + trip.getFromLocation() + " - " + trip.getToLocation(), trip.getFromDate(), trip + .getToDate(), trip.getPricePerPerson(), trip.getCurrency(), trip.getLink()); + items.add(item); + } + } + + return items.toArray(new TripItem[items.size()]); + } + + public void searchAsynch(TripLeg tripLeg) { + System.out.println("Starting trip search"); + + try { + Thread.sleep(2000); + } catch (Exception ex) { + // do nothing + } + + // return available hotels + searchCallback.searchResults(searchSynch(tripLeg)); + } + + public int getPercentComplete() { + return 100; + } + + public String book(TripItem tripItem) { + return "trip1"; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/main/java/com/tuscanyscatours/trip/impl/TripInfo.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/main/java/com/tuscanyscatours/trip/impl/TripInfo.java new file mode 100644 index 0000000000..d8809e1325 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/main/java/com/tuscanyscatours/trip/impl/TripInfo.java @@ -0,0 +1,140 @@ +/* + * 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 com.tuscanyscatours.trip.impl; + +public class TripInfo { + + private String name; + private String description; + private String fromLocation; + private String toLocation; + private String fromDate; + private String toDate; + private String spaces; + private double pricePerPerson; + private String currency; + private String link; + + public TripInfo() { + } + + public TripInfo(String name, + String description, + String fromLocation, + String toLocation, + String fromDate, + String toDate, + String spaces, + double pricePerPerson, + String currency, + String link) { + + this.name = name; + this.description = description; + this.fromLocation = fromLocation; + this.toLocation = toLocation; + this.fromDate = fromDate; + this.toDate = toDate; + this.spaces = spaces; + this.pricePerPerson = pricePerPerson; + this.currency = currency; + this.link = link; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getFromLocation() { + return fromLocation; + } + + public void setFromLocation(String fromLocation) { + this.fromLocation = fromLocation; + } + + public String getToLocation() { + return toLocation; + } + + public void setToLocation(String toLocation) { + this.toLocation = toLocation; + } + + public String getFromDate() { + return fromDate; + } + + public void setFromDate(String fromDate) { + this.fromDate = fromDate; + } + + public String getToDate() { + return toDate; + } + + public void setToDate(String toDate) { + this.toDate = toDate; + } + + public String getSpaces() { + return spaces; + } + + public void setSpaces(String spaces) { + this.spaces = spaces; + } + + public double getPricePerPerson() { + return pricePerPerson; + } + + public void setPricePerPerson(double pricePerPerson) { + this.pricePerPerson = pricePerPerson; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..7f2efe2de7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/test/java/scatours/trip/TripTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/test/java/scatours/trip/TripTestCase.java new file mode 100644 index 0000000000..fd2cc073ec --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/test/java/scatours/trip/TripTestCase.java @@ -0,0 +1,68 @@ +/* + * 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.trip; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.tuscanyscatours.common.Book; +import com.tuscanyscatours.common.TripItem; + +/** + * + */ +public class TripTestCase { + private static SCANode tripNode; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + try { + tripNode = + SCANodeFactory.newInstance().createSCANode("trip.composite", + new SCAContribution("trip", "./target/classes"), + new SCAContribution("trip-test", "./target/test-classes")); + + tripNode.start(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + @Test + public void testPayment() { + SCAClient client = (SCAClient)tripNode; + Book booking = client.getService(Book.class, "Trip/Book"); + TripItem tripItem = + new TripItem("1234", "5678", TripItem.TRIP, "FS1DEC06", "Florence and Siena pre-packaged tour", "FLR", + "06/12/09", "13/12/09", 450, "EUR", "http://localhost:8085/tbd"); + System.out.println("Result = " + booking.book(tripItem) + "\n"); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + tripNode.stop(); + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/test/resources/definitions.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/test/resources/definitions.xml new file mode 100644 index 0000000000..8d7ff59b0c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/test/resources/definitions.xml @@ -0,0 +1,32 @@ + + + + + + + + FINER + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/test/resources/trip.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/test/resources/trip.composite new file mode 100644 index 0000000000..06c449633c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/trip/src/test/resources/trip.composite @@ -0,0 +1,31 @@ + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/tripbooking/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/tripbooking/build.xml new file mode 100644 index 0000000000..e8e7eb7f10 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/tripbooking/build.xml @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/tripbooking/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/tripbooking/pom.xml new file mode 100644 index 0000000000..562f552dc3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/tripbooking/pom.xml @@ -0,0 +1,63 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-tripbooking + Apache Tuscany SCA Tours Trip Booking Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + org.apache.tuscany.sca + scatours-contribution-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + scatours-contribution-currency + ${pom.version} + provided + + + + org.apache.tuscany.sca + scatours-contribution-shoppingcart + ${pom.version} + provided + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/tripbooking/src/main/java/com/tuscanyscatours/tripbooking/TripBooking.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/tripbooking/src/main/java/com/tuscanyscatours/tripbooking/TripBooking.java new file mode 100644 index 0000000000..0693d40465 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/tripbooking/src/main/java/com/tuscanyscatours/tripbooking/TripBooking.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 com.tuscanyscatours.tripbooking; + +import org.osoa.sca.annotations.Remotable; + +import com.tuscanyscatours.common.TripItem; + +/** + * The TripBooking service interface + */ +@Remotable +public interface TripBooking { + + TripItem bookTrip(String cartId, TripItem trip); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/tripbooking/src/main/java/com/tuscanyscatours/tripbooking/impl/TripBookingImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/tripbooking/src/main/java/com/tuscanyscatours/tripbooking/impl/TripBookingImpl.java new file mode 100644 index 0000000000..5d1e1f2db5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/tripbooking/src/main/java/com/tuscanyscatours/tripbooking/impl/TripBookingImpl.java @@ -0,0 +1,91 @@ +/* + * 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 com.tuscanyscatours.tripbooking.impl; + +import org.osoa.sca.ComponentContext; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.common.Book; +import com.tuscanyscatours.common.TripItem; +import com.tuscanyscatours.shoppingcart.CartUpdates; +import com.tuscanyscatours.tripbooking.TripBooking; + +/** + * An implementation of the TripBooking service + */ +@Service(interfaces = {TripBooking.class}) +public class TripBookingImpl implements TripBooking { + + @Reference + protected Book hotelBook; + + @Reference + protected Book flightBook; + + @Reference + protected Book carBook; + + @Reference + protected Book tripBook; + + @Reference + protected CartUpdates cartUpdates; + + @Context + protected ComponentContext componentContext; + + public TripItem bookTrip(String cartId, TripItem trip) { + + String bookingCode = ""; + + // book any nested items + TripItem[] nestedItems = trip.getTripItems(); + if (nestedItems != null) { + for (int i = 0; i < nestedItems.length; i++) { + TripItem tripItem = nestedItems[i]; + if (tripItem.getType().equals(TripItem.CAR)) { + tripItem.setBookingCode(carBook.book(tripItem)); + } else if (tripItem.getType().equals(TripItem.FLIGHT)) { + tripItem.setBookingCode(flightBook.book(tripItem)); + } else if (tripItem.getType().equals(TripItem.HOTEL)) { + tripItem.setBookingCode(hotelBook.book(tripItem)); + } else { + tripItem.setBookingCode(tripItem.getType() + " is invalid"); + } + } + } + + // book the top level item if it's a packaged trip + if (trip.getType().equals(TripItem.TRIP)) { + bookingCode = tripBook.book(trip); + trip.setBookingCode(bookingCode); + } + + // add trip to the shopping cart + ServiceReference cart = componentContext.getServiceReference(CartUpdates.class, "cartUpdates"); + cart.setConversationID(cartId); + cart.getService().addTrip(cartId, trip); + + return trip; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/tripbooking/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/tripbooking/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..906f892d1f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/tripbooking/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/build.xml new file mode 100644 index 0000000000..9f5fa9ed69 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/pom.xml new file mode 100644 index 0000000000..b1f3c92203 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/pom.xml @@ -0,0 +1,124 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-contribution-usingsca + Apache Tuscany SCA Tours Using SCA Components Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + ${tuscany.version} + + + + javax.xml.bind + jaxb-api + 2.1 + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jms-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ejb-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + test + + + + org.apache.tuscany.sca + tuscany-host-jms-asf + ${tuscany.version} + test + + + + org.apache.activemq + activemq-all + 5.2.0 + + + org.apache.activemq + activemq-web-demo + + + test + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + test + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscahotels/HotelOffers.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscahotels/HotelOffers.java new file mode 100644 index 0000000000..8abc5af687 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscahotels/HotelOffers.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 com.tuscanyscahotels; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface HotelOffers { + String bookTodaysSpecial(); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscahotels/impl/HotelOffersImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscahotels/impl/HotelOffersImpl.java new file mode 100644 index 0000000000..fccef2beed --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscahotels/impl/HotelOffersImpl.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 com.tuscanyscahotels.impl; + +import java.util.Date; +import org.osoa.sca.annotations.Reference; + +import com.tuscanyscahotels.HotelOffers; +import com.tuscanyscatours.Hotels; + +public class HotelOffersImpl implements HotelOffers { + + @Reference + protected Hotels hotels; + + public String bookTodaysSpecial() { + return hotels.bookHotel("LBH", new Date(), 3, "STD"); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/Address.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/Address.java new file mode 100644 index 0000000000..614da1e2ad --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/Address.java @@ -0,0 +1,172 @@ +/* + * 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. + */ + +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2010.03.27 at 05:55:25 AM GMT +// + + +package com.tuscanyscatours; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for Address complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="Address">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="street" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="city" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="state" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="zip" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Address", propOrder = { + "street", + "city", + "state", + "zip" +}) +public class Address { + + @XmlElement(required = true) + protected String street; + @XmlElement(required = true) + protected String city; + @XmlElement(required = true) + protected String state; + @XmlElement(required = true) + protected String zip; + + /** + * Gets the value of the street property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStreet() { + return street; + } + + /** + * Sets the value of the street property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStreet(String value) { + this.street = value; + } + + /** + * Gets the value of the city property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCity() { + return city; + } + + /** + * Sets the value of the city property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCity(String value) { + this.city = value; + } + + /** + * Gets the value of the state property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getState() { + return state; + } + + /** + * Sets the value of the state property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setState(String value) { + this.state = value; + } + + /** + * Gets the value of the zip property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getZip() { + return zip; + } + + /** + * Sets the value of the zip property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setZip(String value) { + this.zip = value; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/AirportCodes.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/AirportCodes.java new file mode 100644 index 0000000000..577f22250a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/AirportCodes.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 com.tuscanyscatours; + +public class AirportCodes { + public String getAirport(String code) { + if ("AAA".equals(code)) return "Anaa"; + else if ("AAB".equals(code)) return "Arrabury"; + // other airport codes and cities would follow here + else return null; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/BillingAddress.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/BillingAddress.java new file mode 100644 index 0000000000..4687cf1116 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/BillingAddress.java @@ -0,0 +1,174 @@ +/* + * 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. + */ + +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2010.03.27 at 05:55:25 AM GMT +// + + +package com.tuscanyscatours; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="street" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="city" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="state" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="zip" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "street", + "city", + "state", + "zip" +}) +@XmlRootElement(name = "billingAddress") +public class BillingAddress { + + @XmlElement(required = true) + protected String street; + @XmlElement(required = true) + protected String city; + @XmlElement(required = true) + protected String state; + @XmlElement(required = true) + protected String zip; + + /** + * Gets the value of the street property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStreet() { + return street; + } + + /** + * Sets the value of the street property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStreet(String value) { + this.street = value; + } + + /** + * Gets the value of the city property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCity() { + return city; + } + + /** + * Sets the value of the city property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCity(String value) { + this.city = value; + } + + /** + * Gets the value of the state property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getState() { + return state; + } + + /** + * Sets the value of the state property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setState(String value) { + this.state = value; + } + + /** + * Gets the value of the zip property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getZip() { + return zip; + } + + /** + * Sets the value of the zip property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setZip(String value) { + this.zip = value; + } + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/Bookings.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/Bookings.java new file mode 100644 index 0000000000..9d54d46bb6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/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 com.tuscanyscatours; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Bookings { + String newBooking(String trip, int people); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/Cars.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/Cars.java new file mode 100644 index 0000000000..f58fa33c8d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/Cars.java @@ -0,0 +1,27 @@ +/* + * 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 com.tuscanyscatours; + +import java.util.Date; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Cars { + String bookCar(Date pickup, int days, String carClass); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/CurrencyConverter.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/CurrencyConverter.java new file mode 100644 index 0000000000..9c201813e1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/CurrencyConverter.java @@ -0,0 +1,27 @@ +/* + * 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 com.tuscanyscatours; + +import java.math.BigDecimal; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface CurrencyConverter { + BigDecimal convert(BigDecimal amount); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/CustomerInfo.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/CustomerInfo.java new file mode 100644 index 0000000000..958ca6cf8c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/CustomerInfo.java @@ -0,0 +1,27 @@ +/* + * 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 com.tuscanyscatours; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface CustomerInfo { + String getBillingAddress(); + String getDeliveryAddress(); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/Flights.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/Flights.java new file mode 100644 index 0000000000..873b0afc0c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/Flights.java @@ -0,0 +1,27 @@ +/* + * 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 com.tuscanyscatours; + +import java.util.Date; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Flights { + String bookFlight(String flightNumber, Date date, int seats, String flightClass); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/Hotels.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/Hotels.java new file mode 100644 index 0000000000..85944ad1b6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/Hotels.java @@ -0,0 +1,27 @@ +/* + * 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 com.tuscanyscatours; + +import java.util.Date; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Hotels { + String bookHotel(String hotelCode, Date date, int days, String roomType); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CarPartnerImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CarPartnerImpl.java new file mode 100644 index 0000000000..cb354e0ccc --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CarPartnerImpl.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 com.tuscanyscatours.usingsca.impl; + +import java.util.Date; +import org.osoa.sca.annotations.Reference; +import com.tuscanyscatours.Cars; + +public class CarPartnerImpl implements Cars { + + @Reference + protected Cars[] cars; + + @Reference(required=false) + protected Cars[] luxuryCars; + + public String bookCar(Date pickup, int days, String carClass) { + return cars[0].bookCar(pickup, days, carClass); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CarVendorImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CarVendorImpl.java new file mode 100644 index 0000000000..13c8de7f30 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CarVendorImpl.java @@ -0,0 +1,34 @@ +/* + * 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 com.tuscanyscatours.usingsca.impl; + +import java.util.Date; +import com.tuscanyscatours.Cars; + +public class CarVendorImpl implements Cars { + + protected int minAge; // implicitly defines an SCA property + + public String bookCar(Date pickup, int days, String carClass) { + System.out.println("Booking confirmed for pickup date " + pickup + + " duration " + days + " days in a " + carClass + + " class car"); + return "CV234"; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CurrencyConverterImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CurrencyConverterImpl.java new file mode 100644 index 0000000000..a7687c61f7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CurrencyConverterImpl.java @@ -0,0 +1,45 @@ +/* + * 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 com.tuscanyscatours.usingsca.impl; + +import java.math.BigDecimal; +import org.osoa.sca.annotations.Property; +import com.tuscanyscatours.CurrencyConverter; + +public class CurrencyConverterImpl implements CurrencyConverter { + + @Property + protected String fromCurrency; + + @Property + protected String toCurrency; + + public BigDecimal convert(BigDecimal amount) { + return amount.multiply(getRate(toCurrency)) + .divide(getRate(fromCurrency), 2, 0); + } + + private BigDecimal getRate(String currency) { + int rate = 0; + for (int i = 0; i < currency.length(); i++) { + rate += currency.codePointAt(i); + } + return new BigDecimal(rate).divide(new BigDecimal(100)); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CustomerImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CustomerImpl.java new file mode 100644 index 0000000000..361d5b35c7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/CustomerImpl.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 com.tuscanyscatours.usingsca.impl; + +import org.osoa.sca.annotations.Property; +import com.tuscanyscatours.Address; +import com.tuscanyscatours.BillingAddress; +import com.tuscanyscatours.CustomerInfo; + +public class CustomerImpl implements CustomerInfo { + + @Property + protected BillingAddress billingAddress; + + @Property + protected Address deliveryAddress; + + public String getBillingAddress() { + return billingAddress.getStreet() + ", " + + billingAddress.getCity() + ", " + + billingAddress.getState() + " " + + billingAddress.getZip(); + } + + public String getDeliveryAddress() { + return deliveryAddress.getStreet() + ", " + + deliveryAddress.getCity() + ", " + + deliveryAddress.getState() + " " + + deliveryAddress.getZip(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/FlightPartnerImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/FlightPartnerImpl.java new file mode 100644 index 0000000000..e076a725d1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/FlightPartnerImpl.java @@ -0,0 +1,31 @@ +/* + * 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 com.tuscanyscatours.usingsca.impl; + +import java.util.Date; +import com.tuscanyscatours.Flights; + +public class FlightPartnerImpl implements Flights { + + public String bookFlight(String flightNumber, Date date, int seats, String flightClass) { + System.out.println("Booking confirmed for flight " + flightNumber + " on date " + + date + " with " + seats + " seats in " + flightClass + " class"); + return "FP345"; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/HotelPartnerImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/HotelPartnerImpl.java new file mode 100644 index 0000000000..86c98517e7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/HotelPartnerImpl.java @@ -0,0 +1,31 @@ +/* + * 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 com.tuscanyscatours.usingsca.impl; + +import java.util.Date; +import com.tuscanyscatours.Hotels; + +public class HotelPartnerImpl implements Hotels { + + public String bookHotel(String hotelCode, Date date, int days, String roomType) { + System.out.println("Booking confirmed for hotel " + hotelCode + " arriving on " + + date + " for " + days + " days in a " + roomType + " room"); + return "HP456"; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/TripBookingImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/TripBookingImpl.java new file mode 100644 index 0000000000..04c06a8fe6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/com/tuscanyscatours/usingsca/impl/TripBookingImpl.java @@ -0,0 +1,73 @@ +/* + * 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 com.tuscanyscatours.usingsca.impl; + +import java.text.DateFormat; +import java.util.Date; +import org.osoa.sca.annotations.Reference; + +import com.tuscanyscatours.Bookings; +import com.tuscanyscatours.Cars; +import com.tuscanyscatours.Flights; +import com.tuscanyscatours.Hotels; + +public class TripBookingImpl implements Bookings { + + public TripBookingImpl(@Reference(name="cars") Cars cars) { + this.cars = cars; + } + + protected Cars cars; + + @Reference + protected Flights flights; + + private Hotels hotels; + + @Reference + public void setHotels(Hotels hotels) { + this.hotels = hotels; + } + + public String newBooking(String trip, int people) { + /* In a real implementation this method would look up the trip code + in the travel catalog to get details of the car, flight and hotel + bookings needed. Instead these details are hard-wired here for + test purposes. */ + Date startDate = new Date(); //TEMP - need to fix + /* + try { + startDate = DateFormat.getInstance().parse("7 Jul, 2012"); + } catch (Exception e) { + e.printStackTrace(); + } + */ + + if (people > 0) { + cars.bookCar(startDate, 7, "B"); + flights.bookFlight("AA123", startDate, people, "Y"); + hotels.bookHotel("DBH", startDate, 7, "SUP"); + + return "HW3546"; + + } else { + return "NONE"; + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/AirportCodesClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/AirportCodesClientImpl.java new file mode 100644 index 0000000000..4857b25fb6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/AirportCodesClientImpl.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 scatours.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.AirportCodes; + +@Service(Runnable.class) +public class AirportCodesClientImpl { + + @Reference + protected AirportCodes airportcodes; + + public void run() { + String airport = airportcodes.getAirport("AAB"); + System.out.println("AAB is the airport code for " + airport); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/BookingsClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/BookingsClientImpl.java new file mode 100644 index 0000000000..aa842c80f7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/BookingsClientImpl.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 scatours.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.Bookings; + +@Service(Runnable.class) +public class BookingsClientImpl { + + @Reference + protected Bookings bookings; + + public void run() { + String bookingCode = bookings.newBooking("VR3MAY9", 2); + System.out.println("Booking code is " + bookingCode); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/BookingsZeroClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/BookingsZeroClientImpl.java new file mode 100644 index 0000000000..1fd519d5e9 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/BookingsZeroClientImpl.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 scatours.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.Bookings; + +@Service(Runnable.class) +public class BookingsZeroClientImpl { + + @Reference + protected Bookings bookings; + + public void run() { + String bookingCode = bookings.newBooking("DUMMY", 0); + System.out.println("Booking code is " + bookingCode); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/CarBookingsClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/CarBookingsClientImpl.java new file mode 100644 index 0000000000..0c78a77825 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/CarBookingsClientImpl.java @@ -0,0 +1,38 @@ +/* + * 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.client.impl; + +import java.util.Date; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.Cars; + +@Service(Runnable.class) +public class CarBookingsClientImpl { + + @Reference + protected Cars cars; + + public void run() { + String bookingCode = cars.bookCar(new Date(), 3, "K"); // need to FIX + System.out.println("Booking code is " + bookingCode); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/ConverterClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/ConverterClientImpl.java new file mode 100644 index 0000000000..5eab8f8a16 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/ConverterClientImpl.java @@ -0,0 +1,43 @@ +/* + * 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.client.impl; + +import java.math.BigDecimal; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.CurrencyConverter; + +@Service(Runnable.class) +public class ConverterClientImpl { + + @Reference + protected CurrencyConverter eur2jpy; + + @Reference + protected CurrencyConverter usd2gbp; + + public void run() { + BigDecimal jpy = eur2jpy.convert(new BigDecimal("1000.00")); + System.out.println("Converted EUR 1000.00 to JPY " + jpy); + BigDecimal gbp = usd2gbp.convert(new BigDecimal("1000.00")); + System.out.println("Converted USD 1000.00 to GBP " + gbp); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/HotelOffersClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/HotelOffersClientImpl.java new file mode 100644 index 0000000000..e581273113 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/HotelOffersClientImpl.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 scatours.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscahotels.HotelOffers; + +@Service(Runnable.class) +public class HotelOffersClientImpl { + + @Reference + protected HotelOffers offers; + + public void run() { + String bookingCode = offers.bookTodaysSpecial(); + System.out.println("Hotel offers booking code is " + bookingCode); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/Orders1ClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/Orders1ClientImpl.java new file mode 100644 index 0000000000..af21ad3683 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/Orders1ClientImpl.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 scatours.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.CustomerInfo; + +@Service(Runnable.class) +public class Orders1ClientImpl { + + @Reference + protected CustomerInfo customer; + + public void run() { + String address = customer.getBillingAddress(); + System.out.println("Customer billing address: " + address); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/Orders2ClientImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/Orders2ClientImpl.java new file mode 100644 index 0000000000..41727ac621 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/java/scatours/client/impl/Orders2ClientImpl.java @@ -0,0 +1,38 @@ +/* + * 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.client.impl; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.tuscanyscatours.CustomerInfo; + +@Service(Runnable.class) +public class Orders2ClientImpl { + + @Reference + protected CustomerInfo customer; + + public void run() { + String address = customer.getBillingAddress(); + System.out.println("Customer billing address: " + address); + address = customer.getDeliveryAddress(); + System.out.println("Customer delivery address: " + address); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/address.xsd b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/address.xsd new file mode 100644 index 0000000000..116110f1f3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/address.xsd @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/airportcodes.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/airportcodes.composite new file mode 100644 index 0000000000..e68fc732b1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/airportcodes.composite @@ -0,0 +1,26 @@ + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/bookings1.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/bookings1.composite new file mode 100644 index 0000000000..72347e9987 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/bookings1.composite @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/bookings2.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/bookings2.composite new file mode 100644 index 0000000000..ef1e214b30 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/bookings2.composite @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/bookings3.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/bookings3.composite new file mode 100644 index 0000000000..6b961242fd --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/bookings3.composite @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/bookings4.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/bookings4.composite new file mode 100644 index 0000000000..321c891ff8 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/bookings4.composite @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/carbookings1.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/carbookings1.composite new file mode 100644 index 0000000000..f112f25cbc --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/carbookings1.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/carbookings2.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/carbookings2.composite new file mode 100644 index 0000000000..b41b569544 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/carbookings2.composite @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/carbookings3.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/carbookings3.composite new file mode 100644 index 0000000000..1bcfb101e4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/carbookings3.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/converter.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/converter.composite new file mode 100644 index 0000000000..2afe9cd6e2 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/converter.composite @@ -0,0 +1,35 @@ + + + + + + EUR + JPY + + + + USD + GBP + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/hotelsdomain.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/hotelsdomain.composite new file mode 100644 index 0000000000..758c3e31d2 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/hotelsdomain.composite @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/orders1.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/orders1.composite new file mode 100644 index 0000000000..b0ff245132 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/orders1.composite @@ -0,0 +1,37 @@ + + + + + + + + + 123 Main Street + New York + NY + 01234 + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/orders2.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/orders2.composite new file mode 100644 index 0000000000..79d4be7b61 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/orders2.composite @@ -0,0 +1,46 @@ + + + + + + + + + 123 Main Street + New York + NY + 01234 + + + + + 456 Market Street + San Francisco + CA + 98765 + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/orders2.xsd b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/orders2.xsd new file mode 100644 index 0000000000..db6ee8766e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/orders2.xsd @@ -0,0 +1,24 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/airportcodes-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/airportcodes-client.composite new file mode 100644 index 0000000000..faf2aced82 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/airportcodes-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/bookings1-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/bookings1-client.composite new file mode 100644 index 0000000000..c1c4ecfe12 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/bookings1-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/bookings2-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/bookings2-client.composite new file mode 100644 index 0000000000..e84c7fec06 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/bookings2-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/bookings3-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/bookings3-client.composite new file mode 100644 index 0000000000..21248976a6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/bookings3-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/bookings4-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/bookings4-client.composite new file mode 100644 index 0000000000..bc3af6ae4a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/bookings4-client.composite @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/carbookings1-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/carbookings1-client.composite new file mode 100644 index 0000000000..363f498997 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/carbookings1-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/carbookings2-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/carbookings2-client.composite new file mode 100644 index 0000000000..f80eaf4eca --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/carbookings2-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/carbookings3-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/carbookings3-client.composite new file mode 100644 index 0000000000..e3cf379de3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/carbookings3-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/converter-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/converter-client.composite new file mode 100644 index 0000000000..c488a454b4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/converter-client.composite @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/hotelsdomain-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/hotelsdomain-client.composite new file mode 100644 index 0000000000..597a5f0a4f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/hotelsdomain-client.composite @@ -0,0 +1,34 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/orders1-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/orders1-client.composite new file mode 100644 index 0000000000..9015e14cb8 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/orders1-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/orders2-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/orders2-client.composite new file mode 100644 index 0000000000..f9ae67332b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/orders2-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/toursdomain-client.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/toursdomain-client.composite new file mode 100644 index 0000000000..b84dbe8f72 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/test-clients/toursdomain-client.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/toursdomain.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/toursdomain.composite new file mode 100644 index 0000000000..a0ee26fb89 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/main/resources/toursdomain.composite @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/AirportCodesTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/AirportCodesTestCase.java new file mode 100644 index 0000000000..53d9029e7f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/AirportCodesTestCase.java @@ -0,0 +1,56 @@ +/* + * 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.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the AirportCodes component implementation class + */ +public class AirportCodesTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/airportcodes-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "AirportCodesClient"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/BindingsTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/BindingsTestCase.java new file mode 100644 index 0000000000..2daa59245e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/BindingsTestCase.java @@ -0,0 +1,56 @@ +/* + * 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.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests services and references with configured bindings + */ +public class BindingsTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/bookings4-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "Bookings4Client"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/CarAutowireTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/CarAutowireTestCase.java new file mode 100644 index 0000000000..bf20e7cae1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/CarAutowireTestCase.java @@ -0,0 +1,56 @@ +/* + * 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.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests autowiring of references with different multiplicities + */ +public class CarAutowireTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/carbookings3-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "CarBookings3Client"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/CarPartnerTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/CarPartnerTestCase.java new file mode 100644 index 0000000000..18e43e7a8b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/CarPartnerTestCase.java @@ -0,0 +1,56 @@ +/* + * 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.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests wiring of references with different multiplicities + */ +public class CarPartnerTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/carbookings1-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "CarBookings1Client"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/CarWireElementTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/CarWireElementTestCase.java new file mode 100644 index 0000000000..997460e0ea --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/CarWireElementTestCase.java @@ -0,0 +1,56 @@ +/* + * 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.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests wire elements for references with different multiplicities + */ +public class CarWireElementTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/carbookings2-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "CarBookings2Client"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/ComplexPropertyElementTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/ComplexPropertyElementTestCase.java new file mode 100644 index 0000000000..177b4b2355 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/ComplexPropertyElementTestCase.java @@ -0,0 +1,56 @@ +/* + * 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.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests complex properties defined as XML Schema global elements + */ +public class ComplexPropertyElementTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/orders1-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "Orders1Client"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/ComplexPropertyTypeTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/ComplexPropertyTypeTestCase.java new file mode 100644 index 0000000000..168d8f3273 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/ComplexPropertyTypeTestCase.java @@ -0,0 +1,56 @@ +/* + * 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.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests complex properties defined as XML Schema types + */ +public class ComplexPropertyTypeTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/orders2-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "Orders2Client"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/CurrencyConverterTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/CurrencyConverterTestCase.java new file mode 100644 index 0000000000..dec2ae9976 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/CurrencyConverterTestCase.java @@ -0,0 +1,56 @@ +/* + * 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.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the CurrencyConverterImpl component implementation class + */ +public class CurrencyConverterTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/converter-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "ConverterClient"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/MultiDomainTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/MultiDomainTestCase.java new file mode 100644 index 0000000000..a7028f6d8c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/MultiDomainTestCase.java @@ -0,0 +1,65 @@ +/* + * 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.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the multiple domains with bindings scenario + */ +public class MultiDomainTestCase { + + private SCANode hotelsNode; + private SCANode toursNode; + + @Before + public void startServer() throws Exception { + hotelsNode = SCANodeFactory.newInstance().createSCANode("test-clients/hotelsdomain-client.composite", + new SCAContribution("using", "./target/classes")); + hotelsNode.start(); + toursNode = SCANodeFactory.newInstance().createSCANode("test-clients/toursdomain-client.composite", + new SCAContribution("using", "./target/classes")); + toursNode.start(); + } + + @Test + public void testImpl() { + Runnable hotelsClient = ((SCAClient)hotelsNode).getService(Runnable.class, "HotelsDomainClient"); + hotelsClient.run(); + Runnable toursClient = ((SCAClient)toursNode).getService(Runnable.class, "ToursDomainClient"); + toursClient.run(); + } + + @After + public void stopServer() throws Exception { + if (toursNode != null) { + toursNode.stop(); + } + if (hotelsNode != null) { + hotelsNode.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/TripAutowireTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/TripAutowireTestCase.java new file mode 100644 index 0000000000..a6f1df98ef --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/TripAutowireTestCase.java @@ -0,0 +1,56 @@ +/* + * 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.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the use of autowire in the Trip Booking implementation scenario + */ +public class TripAutowireTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/bookings3-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "Bookings3Client"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/TripBookingTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/TripBookingTestCase.java new file mode 100644 index 0000000000..d08d176464 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/TripBookingTestCase.java @@ -0,0 +1,56 @@ +/* + * 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.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the Trip Booking implementation scenario + */ +public class TripBookingTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/bookings1-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "Bookings1Client"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/TripWireElementTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/TripWireElementTestCase.java new file mode 100644 index 0000000000..36811a98d8 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/java/scatours/TripWireElementTestCase.java @@ -0,0 +1,56 @@ +/* + * 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.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the use of wire elements in the Trip Booking implementation scenario + */ +public class TripWireElementTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = SCANodeFactory.newInstance().createSCANode("test-clients/bookings2-client.composite", + new SCAContribution("using", "./target/classes")); + node.start(); + } + + @Test + public void testImpl() { + Runnable client = ((SCAClient)node).getService(Runnable.class, "Bookings2Client"); + client.run(); + } + + @After + public void stopServer() throws Exception { + if (node != null) { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/resources/jndi.properties b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/resources/jndi.properties new file mode 100644 index 0000000000..80236a8e6c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/contributions/usingsca/src/test/resources/jndi.properties @@ -0,0 +1,38 @@ +## --------------------------------------------------------------------------- +## 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. +## --------------------------------------------------------------------------- + +# START SNIPPET: jndi + +java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory + +# use the following property to configure the default connector +java.naming.provider.url = vm://localhost?broker.persistent=false + +# use the following property to specify the JNDI name the connection factory +# should appear as. +#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry +connectionFactoryNames = ConnectionFactory + +# register some queues in JNDI using the form +# queue.[jndiName] = [physicalName] +queue.Bookings = BookingsRequestQueue + +# register some topics in JNDI using the form +# topic.[jndiName] = [physicalName] +#topic.MyTopic = example.MyTopic + +# END SNIPPET: jndi diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/pom.xml new file mode 100644 index 0000000000..f0ecd2de94 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/pom.xml @@ -0,0 +1,88 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../pom.xml + + scatours-distribution + Apache Tuscany SCA Tours Distribution + pom + + + + com.sun.xml.ws + jaxws-tools + 2.1.7 + runtime + + + + com.sun.xml.ws + jaxws-rt + + + + com.sun.xml.bind + jaxb-xjc + + + + + + junit + junit + 4.5 + runtime + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + distribution-package + package + + single + + + + src/main/assembly/src.xml + + gnu + . + target + apache-tuscany-scatours-${version} + true + true + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/assembly/src.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/assembly/src.xml new file mode 100644 index 0000000000..36e67f6d77 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/assembly/src.xml @@ -0,0 +1,96 @@ + + + + + + true + tuscany-scatours-${version} + + + tar.gz + zip + + + + + .. + travelsample + + **/.* + **/.*/** + **/*.log + **/target + **/target/**/* + **/maven-eclipse.xml + + + + + + src/main/release + + + BUILDING + CHANGES + LICENSE + NOTICE + README + RELEASE_NOTES + + + + + + ../binaries/target + lib + + openejb/**/* + jaxws/**/* + + + + + + + + false + lib/jaxws + false + + com.sun.xml.ws:jaxws-tools + + runtime + + + + + false + lib/junit + false + + junit:junit + + runtime + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/BUILDING b/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/BUILDING new file mode 100644 index 0000000000..e5eabe3b88 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/BUILDING @@ -0,0 +1,139 @@ +Building the Apache Tuscany SCA Travel Sample 1.0 June 2010 release distribution +================================================================================ + +Initial Setup +------------- + +1) Install Java SE JDK 5 or JDK 6, which can be downloaded from + http://java.sun.com/javase/downloads/index.jsp. For JDK 5 use update 22 + and for JDK 6 use update 7 (or later). + +2) Make sure that your JAVA_HOME environment variable is set to the newly installed + JDK location, and that your PATH includes %JAVA_HOME%\bin (windows) or + $JAVA_HOME/bin (unix). + +3) Install Apache Maven 2.0.7 or later, which can be downloaded from + http://maven.apache.org/download.html. Make sure that your M2_HOME + environment variable is set to the installation base directory, and that + your PATH includes %M2_HOME%\bin (windows) or $M2_HOME/bin (unix). + +4) Install Apache Ant 1.7.1 or later, which can be downloaded from + http://ant.apache.org/bindownload.cgi. Make sure that your ANT_HOME + environment variable is set to the installation base directory, and that + your PATH includes %ANT_HOME%\bin (windows) or $ANT_HOME/bin (unix). + +5) Download the Apache Tuscany SCA Java 1.6 (or later) binary distribution + from http://tuscany.apache.org/sca-java-1x-releases.html and unpack it + into a local directory. Set your TUSCANY_HOME environment variable to + the base directory containing the unpacked binary distribution. + +6) Download the Apache Tuscany SCA Java Travel Sample 1.0 (or later) distribution + from http://tuscany.apache.org/sca-java-travel-sample-1x-releases.html and + unpack it into a local directory. + + +Building using Ant +------------------ + +1) Change to the "travelsample" directory of the Apache Tuscany SCA Travel Sample + distribution which you unpacked in step 6) above. + +2) Run the command "ant". This will compile the complete travel sample and + run all of the travel sample unit tests. + + +Building using Maven +-------------------- + +1) Change to the "travelsample" directory of the Apache Tuscany SCA Travel Sample + distribution which you unpacked in step 6) above. + +2) Run the command "mvn". You will need a live internet connection so that + Maven can download any required files to your local repository. This will + compile the complete travel sample and run all of the travel sample unit tests. + + Depending on the load of remote Maven 2.0 repositories, you may have + to run "mvn" several times until the required dependencies are + all located in your local maven repository. It usually takes some time for + maven to download required dependencies in the first build. Once all the + dependencies have been downloaded you may use the -o option to run maven + in offline mode, for example, 'mvn clean install -o'. + + When building with Maven, an executable binary package for the travel + sample is created in the travelsample/binaries/target directory. By default + this binary package is an add-on delta to the Tuscany SCA Java 1.6 binary + distribution. If you want to produce a fully self-contained binary package + in the travelsample/binaries/target directory (with no external dependencies), + you can use the command "mvn -Pselfcontained" instead of "mvn" when + building from the "travelsample" directory. + + +Building the Distribution +------------------------- + +1) Change to the travelsample/distribution directory. + +2) Run the command "mvn". This will build the distribution package + with .zip and .tar.gz formats in the distribution/target directory. + + +Running the Travel Sample +------------------------- + +Full details of how to run the travel sample can be found in the README +file in the "travelsample" directory of the unpacked distribution. + + +Changing the Tuscany SCA Java version used for the build +-------------------------------------------------------- + +If you are using Maven to build the travel sample, the maven build files +are set up to use the 1.6 version of Tuscany SCA Java. You can build +the travel sample using some other version of Tuscany SCA Java (for example, +a development snapshot) by changing the property in the +travelsample/pom.xml file. + +If you are using Ant to build the travel sample, you can change the +version of Tuscany SCA Java used by the build by changing the setting of +the TUSCANY_HOME environment variable before running the build. + + +Building a development snaphost of the travel sample code +--------------------------------------------------------- + +You can build the latest development snapshot of the travel sample by +following these steps: + +1) Install Apache Subversion 1.4.0 or later, which can be downloaded from +http://subversion.apache.org/packages.html. Make sure that your PATH +includes the "bin" subdirectory of the installation base directory. + +2) Check out the travel sample code from svn using the following command: +svn co http://svn.apache.org/repos/asf/tuscany/sca-java-1.x/trunk/tutorials/travelsample + +3) Change to the travelsample directory of your local travel sample checkout +and run the command "mvn". This will use Maven to compile the complete +travel sample and run all of the travel sample unit tests. + +4) If you want to build the travel sample using Ant instead of Maven, +you need to peform the following additional steps: + + 4a) Download the JUnit 4.5 (or later) binary distribution from + http://github.com/KentBeck/junit/downloads and unpack it into a local + directory. Set your the JUNIT_JAR environment variable to the full path + to the junit-x.y.z.jar in the unpacked binary distribution taking care + to replace x.y.z with the JUnit version number. + + 4b) Download the Apache OpenEJB 3.1.2 (or later) binary distribution + from http://openejb.apache.org/download.html and unpack it into a local + directory. Set your OPENEJB_HOME environment variable to the base directory + containing the unpacked binary distribution. + + 4c) If you are using JDK 5, download the JAX-WS reference implementation + version 2.1.7 from https://jax-ws.dev.java.net/2.1.7/ and unpack it into + a local directory. Set your JAXWS_HOME environment variable to the base + directory containing the unpacked download. + + 4d) Change to the travelsample directory of your local travel sample + checkout and run the command "ant". This will use Ant to compile the + complete travel sample and run all of the travel sample unit tests. diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/CHANGES b/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/CHANGES new file mode 100644 index 0000000000..e58c518bf8 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/CHANGES @@ -0,0 +1,4 @@ +Changes in Apache Tuscany SCA Travel Sample 1.0 June 2010 +========================================================= + +First release of the travel sample. diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/LICENSE b/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/LICENSE new file mode 100644 index 0000000000..90394d2117 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/LICENSE @@ -0,0 +1,725 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed 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. + +=============================================================================== + +APACHE TUSCANY SCA TRAVEL SAMPLE REDISTRIBUTED FILES: + +The Apache Tuscany SCA Travel Sample distribution includes a number of +redistributed files with separate copyright notices and license terms. +Your use of these redistributed files is subject to the terms and conditions +of the following licenses. + +=============================================================================== + +The following files come under Apache Software License 2.0: + commons-cli-1.1.jar + commons-dbcp-all-1.3-r699049.jar + ejb31-api-experimental-3.1.2.jar + geronimo-transaction-2.1.jar + javaee-api-5.0-2.jar + openejb-api-3.1.2.jar + openejb-client-3.1.2.jar + openejb-core-3.1.2.jar + openejb-ejbd-3.1.2.jar + openejb-javaagent-3.1.2.jar + openejb-jee-3.1.2.jar + openejb-loader-3.1.2.jar + openejb-server-3.1.2.jar + xbean-asm-shaded-3.6.jar + xbean-finder-shaded-3.6.jar + xbean-reflect-3.6.jar + +=============================================================================== + +The files: + http-20070405.jar, + jaxws-rt-2.1.7.jar, + jaxws-tools-2.1.7.jar, + saaj-api-1.3.jar, + saaj-impl-1.3.3.jar, + stax-ex-1.2.jar, + streambuffer-0.9.jar +are redistributed in executable form, with source code available at + https://jax-ws-sources.dev.java.net/source/browse/jax-ws-sources/ +and are licensed under the following terms: + +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 + + + 1. Definitions. + + 1.1. "Contributor" means each individual or entity that + creates or contributes to the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the + Original Software, prior Modifications used by a + Contributor (if any), and the Modifications made by that + particular Contributor. + + 1.3. "Covered Software" means (a) the Original Software, or + (b) Modifications, or (c) the combination of files + containing Original Software with files containing + Modifications, in each case including portions thereof. + + 1.4. "Executable" means the Covered Software in any form + other than Source Code. + + 1.5. "Initial Developer" means the individual or entity + that first makes Original Software available under this + License. + + 1.6. "Larger Work" means a work which combines Covered + Software or portions thereof with code not governed by the + terms of this License. + + 1.7. "License" means this document. + + 1.8. "Licensable" means having the right to grant, to the + maximum extent possible, whether at the time of the initial + grant or subsequently acquired, any and all of the rights + conveyed herein. + + 1.9. "Modifications" means the Source Code and Executable + form of any of the following: + + A. Any file that results from an addition to, + deletion from or modification of the contents of a + file containing Original Software or previous + Modifications; + + B. Any new file that contains any part of the + Original Software or previous Modification; or + + C. Any new file that is contributed or otherwise made + available under the terms of this License. + + 1.10. "Original Software" means the Source Code and + Executable form of computer software code that is + originally released under this License. + + 1.11. "Patent Claims" means any patent claim(s), now owned + or hereafter acquired, including without limitation, + method, process, and apparatus claims, in any patent + Licensable by grantor. + + 1.12. "Source Code" means (a) the common form of computer + software code in which modifications are made and (b) + associated documentation included in or with such code. + + 1.13. "You" (or "Your") means an individual or a legal + entity exercising rights under, and complying with all of + the terms of, this License. For legal entities, "You" + includes any entity which controls, is controlled by, or is + under common control with You. For purposes of this + definition, "control" means (a) the power, direct or + indirect, to cause the direction or management of such + entity, whether by contract or otherwise, or (b) ownership + of more than fifty percent (50%) of the outstanding shares + or beneficial ownership of such entity. + + 2. License Grants. + + 2.1. The Initial Developer Grant. + + Conditioned upon Your compliance with Section 3.1 below and + subject to third party intellectual property claims, the + Initial Developer hereby grants You a world-wide, + royalty-free, non-exclusive license: + + (a) under intellectual property rights (other than + patent or trademark) Licensable by Initial Developer, + to use, reproduce, modify, display, perform, + sublicense and distribute the Original Software (or + portions thereof), with or without Modifications, + and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, + using or selling of Original Software, to make, have + made, use, practice, sell, and offer for sale, and/or + otherwise dispose of the Original Software (or + portions thereof). + + (c) The licenses granted in Sections 2.1(a) and (b) + are effective on the date Initial Developer first + distributes or otherwise makes the Original Software + available to a third party under the terms of this + License. + + (d) Notwithstanding Section 2.1(b) above, no patent + license is granted: (1) for code that You delete from + the Original Software, or (2) for infringements + caused by: (i) the modification of the Original + Software, or (ii) the combination of the Original + Software with other software or devices. + + 2.2. Contributor Grant. + + Conditioned upon Your compliance with Section 3.1 below and + subject to third party intellectual property claims, each + Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + (a) under intellectual property rights (other than + patent or trademark) Licensable by Contributor to + use, reproduce, modify, display, perform, sublicense + and distribute the Modifications created by such + Contributor (or portions thereof), either on an + unmodified basis, with other Modifications, as + Covered Software and/or as part of a Larger Work; and + + + (b) under Patent Claims infringed by the making, + using, or selling of Modifications made by that + Contributor either alone and/or in combination with + its Contributor Version (or portions of such + combination), to make, use, sell, offer for sale, + have made, and/or otherwise dispose of: (1) + Modifications made by that Contributor (or portions + thereof); and (2) the combination of Modifications + made by that Contributor with its Contributor Version + (or portions of such combination). + + (c) The licenses granted in Sections 2.2(a) and + 2.2(b) are effective on the date Contributor first + distributes or otherwise makes the Modifications + available to a third party. + + (d) Notwithstanding Section 2.2(b) above, no patent + license is granted: (1) for any code that Contributor + has deleted from the Contributor Version; (2) for + infringements caused by: (i) third party + modifications of Contributor Version, or (ii) the + combination of Modifications made by that Contributor + with other software (except as part of the + Contributor Version) or other devices; or (3) under + Patent Claims infringed by Covered Software in the + absence of Modifications made by that Contributor. + + 3. Distribution Obligations. + + 3.1. Availability of Source Code. + + Any Covered Software that You distribute or otherwise make + available in Executable form must also be made available in + Source Code form and that Source Code form must be + distributed only under the terms of this License. You must + include a copy of this License with every copy of the + Source Code form of the Covered Software You distribute or + otherwise make available. You must inform recipients of any + such Covered Software in Executable form as to how they can + obtain such Covered Software in Source Code form in a + reasonable manner on or through a medium customarily used + for software exchange. + + 3.2. Modifications. + + The Modifications that You create or to which You + contribute are governed by the terms of this License. You + represent that You believe Your Modifications are Your + original creation(s) and/or You have sufficient rights to + grant the rights conveyed by this License. + + 3.3. Required Notices. + + You must include a notice in each of Your Modifications + that identifies You as the Contributor of the Modification. + You may not remove or alter any copyright, patent or + trademark notices contained within the Covered Software, or + any notices of licensing or any descriptive text giving + attribution to any Contributor or the Initial Developer. + + 3.4. Application of Additional Terms. + + You may not offer or impose any terms on any Covered + Software in Source Code form that alters or restricts the + applicable version of this License or the recipients' + rights hereunder. You may choose to offer, and to charge a + fee for, warranty, support, indemnity or liability + obligations to one or more recipients of Covered Software. + However, you may do so only on Your own behalf, and not on + behalf of the Initial Developer or any Contributor. You + must make it absolutely clear that any such warranty, + support, indemnity or liability obligation is offered by + You alone, and You hereby agree to indemnify the Initial + Developer and every Contributor for any liability incurred + by the Initial Developer or such Contributor as a result of + warranty, support, indemnity or liability terms You offer. + + + 3.5. Distribution of Executable Versions. + + You may distribute the Executable form of the Covered + Software under the terms of this License or under the terms + of a license of Your choice, which may contain terms + different from this License, provided that You are in + compliance with the terms of this License and that the + license for the Executable form does not attempt to limit + or alter the recipient's rights in the Source Code form + from the rights set forth in this License. If You + distribute the Covered Software in Executable form under a + different license, You must make it absolutely clear that + any terms which differ from this License are offered by You + alone, not by the Initial Developer or Contributor. You + hereby agree to indemnify the Initial Developer and every + Contributor for any liability incurred by the Initial + Developer or such Contributor as a result of any such terms + You offer. + + 3.6. Larger Works. + + You may create a Larger Work by combining Covered Software + with other code not governed by the terms of this License + and distribute the Larger Work as a single product. In such + a case, You must make sure the requirements of this License + are fulfilled for the Covered Software. + + 4. Versions of the License. + + 4.1. New Versions. + + Sun Microsystems, Inc. is the initial license steward and + may publish revised and/or new versions of this License + from time to time. Each version will be given a + distinguishing version number. Except as provided in + Section 4.3, no one other than the license steward has the + right to modify this License. + + 4.2. Effect of New Versions. + + You may always continue to use, distribute or otherwise + make the Covered Software available under the terms of the + version of the License under which You originally received + the Covered Software. If the Initial Developer includes a + notice in the Original Software prohibiting it from being + distributed or otherwise made available under any + subsequent version of the License, You must distribute and + make the Covered Software available under the terms of the + version of the License under which You originally received + the Covered Software. Otherwise, You may also choose to + use, distribute or otherwise make the Covered Software + available under the terms of any subsequent version of the + License published by the license steward. + + 4.3. Modified Versions. + + When You are an Initial Developer and You want to create a + new license for Your Original Software, You may create and + use a modified version of this License if You: (a) rename + the license and remove any references to the name of the + license steward (except to note that the license differs + from this License); and (b) otherwise make it clear that + the license contains terms which differ from this License. + + + 5. DISCLAIMER OF WARRANTY. + + COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" + BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, + INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED + SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR + PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND + PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY + COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE + INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF + ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF + WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF + ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS + DISCLAIMER. + + 6. TERMINATION. + + 6.1. This License and the rights granted hereunder will + terminate automatically if You fail to comply with terms + herein and fail to cure such breach within 30 days of + becoming aware of the breach. Provisions which, by their + nature, must remain in effect beyond the termination of + this License shall survive. + + 6.2. If You assert a patent infringement claim (excluding + declaratory judgment actions) against Initial Developer or + a Contributor (the Initial Developer or Contributor against + whom You assert such claim is referred to as "Participant") + alleging that the Participant Software (meaning the + Contributor Version where the Participant is a Contributor + or the Original Software where the Participant is the + Initial Developer) directly or indirectly infringes any + patent, then any and all rights granted directly or + indirectly to You by such Participant, the Initial + Developer (if the Initial Developer is not the Participant) + and all Contributors under Sections 2.1 and/or 2.2 of this + License shall, upon 60 days notice from Participant + terminate prospectively and automatically at the expiration + of such 60 day notice period, unless if within such 60 day + period You withdraw Your claim with respect to the + Participant Software against such Participant either + unilaterally or pursuant to a written agreement with + Participant. + + 6.3. In the event of termination under Sections 6.1 or 6.2 + above, all end user licenses that have been validly granted + by You or any distributor hereunder prior to termination + (excluding licenses granted to You by any distributor) + shall survive termination. + + 7. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT + (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE + INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF + COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE + LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR + CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT + LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK + STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER + COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN + INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF + LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL + INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT + APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO + NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR + CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT + APPLY TO YOU. + + 8. U.S. GOVERNMENT END USERS. + + The Covered Software is a "commercial item," as that term is + defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial + computer software" (as that term is defined at 48 C.F.R. + 252.227-7014(a)(1)) and "commercial computer software + documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. + 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 + through 227.7202-4 (June 1995), all U.S. Government End Users + acquire Covered Software with only those rights set forth herein. + This U.S. Government Rights clause is in lieu of, and supersedes, + any other FAR, DFAR, or other clause or provision that addresses + Government rights in computer software under this License. + + 9. MISCELLANEOUS. + + This License represents the complete agreement concerning subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the + extent necessary to make it enforceable. This License shall be + governed by the law of the jurisdiction specified in a notice + contained within the Original Software (except to the extent + applicable law, if any, provides otherwise), excluding such + jurisdiction's conflict-of-law provisions. Any litigation + relating to this License shall be subject to the jurisdiction of + the courts located in the jurisdiction and venue specified in a + notice contained within the Original Software, with the losing + party responsible for costs, including, without limitation, court + costs and reasonable attorneys' fees and expenses. The + application of the United Nations Convention on Contracts for the + International Sale of Goods is expressly excluded. Any law or + regulation which provides that the language of a contract shall + be construed against the drafter shall not apply to this License. + You agree that You alone are responsible for compliance with the + United States export administration regulations (and the export + control laws and regulation of any other countries) when You use, + distribute or otherwise make available any Covered Software. + + 10. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is + responsible for claims and damages arising, directly or + indirectly, out of its utilization of rights under this License + and You agree to work with Initial Developer and Contributors to + distribute such responsibility on an equitable basis. Nothing + herein is intended or shall be deemed to constitute any admission + of liability. + +=============================================================================== + +The file: + junit-4.5.jar +is redistributed in object code form, with source code available at + http://sourceforge.net/projects/junit/files/ +and is licensed under the following terms: + +Common Public License - v 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + + a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and + b) in the case of each subsequent Contributor: + + i) changes to the Program, and + + ii) additions to the Program; + + where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. + +"Program" means the Contributions distributed in accordance with this Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. + +2. GRANT OF RIGHTS + + a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. + + b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. + + c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. + + d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: + + a) it complies with the terms and conditions of this Agreement; and + + b) its license agreement: + + i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; + + ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; + + iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and + + iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. + +When the Program is made available in source code form: + + a) it must be made available under this Agreement; and + + b) a copy of this Agreement must be included with each copy of the Program. + +Contributors may not remove or alter any copyright notices contained within the Program. + +Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/NOTICE b/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/NOTICE new file mode 100644 index 0000000000..5346498b7c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/NOTICE @@ -0,0 +1,5 @@ +Apache Tuscany +Copyright (c) 2005 - 2010 The Apache Software Foundation + +This product includes/uses software developed at +The Apache Software Foundation (http://www.apache.org/). diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/README b/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/README new file mode 100644 index 0000000000..5a0408ad7c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/README @@ -0,0 +1,869 @@ +README for the Apache Tuscany SCA Travel Sample 1.0 June 2010 +============================================================= + +Structure of the travel sample +------------------------------ + +The travel sample consists of the following directory tree: + +lib dependencies for the travel sample (see notes below) + jaxws jars from the JAX-WS reference implementation + junit the Junit jar + openejb jars from the OpenEJB binary distribution +travelsample top-level directory for the travel sample + binaries builds a binaries-only package for the travel sample + clients non-SCA clients for the travel sample + contributions SCA contributions for the travel sample + distribution builds the travel sample distribution + domainconfig configuration files for the domain manager + launchers launcher programs for the travel sample + services non-SCA services used by the travel sample + testdomain scratch directory for trying out the domain manager + util utility code used by other parts of the travel sample + +Note 1: The travel sample depends on the Apache Tuscany SCA Java 1.x binary +distribution, which is downloaded separately from the travel sample. +To avoid needless duplication, the "lib" directory of the travel sample only +contains dependencies that aren't provided in the Apache Tuscany SCA Java 1.x +binary distribution. The 1.0 release of the travel sample has been tested +with Apache Tuscany SCA Java 1.6. + +Note 2: The 1.0 release of the travel sample is not compatible with +Apache Tuscany SCA Java 2.x. + +Note 3: Before attempting to build or run the travel sample, you will need +to download the Apache Tuscany SCA Java 1.6 (or later 1.x release) binary +distribution and set your TUSCANY_HOME environment variable to a local +directory containing the unpacked binary distribution. + + +Overview of the travel sample +----------------------------- + +The travel sample consists of a number of related scenarios. For each +scenario, this section lists the following: + Description: A description of the scenario. + Contributions: SCA contributions used in the scenario. Each contribution + is a subdirectory of the travelsample/contributions directory. + Launchers: Launchers used in the scenario. Each launcher is a subdirectory + of the travelsample/launchers directory. + Services: Non-SCA services used in the scenario, if any. Each non-SCA + service is a subdirectory of the travelsample/services directory. + Clients: Non-SCA clients used in the scenario, if any. Each non-SCA + client is a subdirectory of the travelsample/clients directory. + Webapp: Web application (.war) file used to run the scenario, for those + scenarios that use contributions packaged as web applications and + deployed in a Web application server such as Tomcat. + +Details of how to build and run these scenarios can be found in later +sections of this file. + +1) Jumpstart - First simple example of using Tuscany + +Description: The jumpstart launcher shows the code needed to load an + SCA contribution and invoke a method. The introducing-trips contribution + shows how to package an SCA component in a contribution. +Contributions: introducing-trips +Launchers: jumpstart + +2) Introducing - Simplified introduction to the travel application + +Description: This scenario introduces a simplified form of the travel + booking application that will be developed and extended by other + scenarios in the travel sample. This scenario gives a clearer picture + than jumpstart of how SCA applications are constructed because it + shows multiple SCA components connected together with references wired + to services. +Contributions: introducing-client, introducing-tours, introducing-trips +Launchers: introducing + +3) Introducing (distributed) - Distributed services with a domain manager + +Description: We're using the same SCA components, services, and implementations + as in the previous scenario but with a big difference--they're distributed + across multiple execution nodes and they make remote calls to each other + using configuration information provided by the Tuscany domain manager. + For simplicity these nodes are represented as different processes running on + a single computer, though the domain manager configuration could easily be + modified to run the nodes on different computers communicating across a network. +Contributions: introducing-client, introducing-tours, introducing-trips +Launchers: introducing-client, introducing-domain, introducing-tours, + introducing-trips + +4) Using SCA - Defining and using SCA Components + +Description: The examples in this scenario show how to define SCA components + and how to use SCA components in a business application. This "guided tour" + consists of code samples illustrating the major features of SCA components + including implementations, services, interfaces, references, wires, properties, + bindings and domains. +Contributions: usingsca +Launchers: usingsca + +5) Building blocks - Using SCA composites as application building blocks + +Description: We're looking at how to create composite applications using + SCA composites as building blocks. The ToursImpl composite shows how to + use a composite as a component implementation (black box reuse) and the + ToursImplInclude composite demonstrates including one composite in another + (white box reuse). The ToursAppl composite combines both of these kinds + of reuse and shows how easy it is to build a full composite application + using building blocks. +Contributions: buildingblocks, buildingblocks-client, introducing-trips +Launchers: buildingblocks + +6) Interaction - Different SCA interaction styles + +Description: Each SCA interaction pattern is demonstrated using a component + from the travel booking application. We’re going to see the Hotel, Calendar, + CurrencyConverter and ShoppingCart components used here. These components + don't work in isolation so for each interaction pattern we've written a + simple client component. For example, the InteractionLocalClient component + demonstrates local interactions by sending a local message to the Calendar + component. The launcher starts two nodes (node1 and node2) which are used + to run samples for all of the interaction patterns. The first node "node1" + loads the contributions common, currency, calendar, shoppingcart, and + interaction-client, and runs the client.composite from the interaction-client + contribution. The local interaction patterns are demonstrated by clients + calling the currency, calendar, and shoppingcart components locally within + node1. The second node node2 loads the contributions common, hotel, and + interaction-service-remote, and runs the service.composite from the + interaction-service-remote contribution. This node provides the hotel + component that's used by client components in node1 for sending remote + messages to demonstrate the remote interaction pattern. +Contributions: calendar, common, currency, flight, hotel, interaction-client, + interaction-service-remote, shoppingcart +Launchers: interaction + +7) Full application - The full interactive travel application + +Description: This is the fully functional travel application with a user + interface for booking a trip (either pre-packaged or customized), adding the + trip to a shopping cart, and checking out the purchase using a credit card. +Contributions: car, common, creditcard-payment-jaxb-policy, currency, flight, + fullapp-bespoketrip, fullapp-coordination, fullapp-currency, fullapp-packagedtrip, + fullapp-shoppingcart, fullapp-ui, hotel, payment-spring-policy, scatours, + shoppingcart, travelcatalog, trip, tripbooking +Launchers: fullapp + +8) Full application (distributed) - Distributed services with a domain manager + +Description: This version of the full travel application uses multiple execution + nodes and the domain manager. The execution nodes all run within the same + process, which isn't very realistic but shows the flexibility of the Tuscany + runtime model which allows nodes to be allocated to processes and computers in + any combination. There's one small difference in the contributions used by this + distributed version: payment-java-policy is used instead of payment-spring-policy + because of an incompatibility between the domain manager and implementation.spring + (see issue TUSCANY-3476). + +Contributions: car, common, creditcard-payment-jaxb-policy, currency, flight, + fullapp-bespoketrip, fullapp-coordination, fullapp-currency, fullapp-packagedtrip, + fullapp-shoppingcart, fullapp-ui, hotel, payment-java-policy, scatours, + shoppingcart, travelcatalog, trip, tripbooking +Launchers: fullapp-domain, fullapp-nodes + +9) Callback + +Description: SCA callbacks are illustrated using a variation of the Payment + service which makes callbacks to the client to perform additional security + checks for large payments. +Contributions: payment-java-callback +Launchers: payment-java-callback + +10) Reference passing + +Description: We use another variation on the Payment service to show how + SCA service references can be passed as parameters when invoking a service. + The Payment service creates a service reference for the EmailGateway service + and passes this service reference to the CreditCardPayment service. When the + CreditCardPayment service has finished doing the credit card authorization, + it invokes the EmailGateway service using the service reference that was + passed in. +Contributions: payment-java-reference-pass +Launchers: payment-java-reference-pass + +11) Help pages + +Description: This scenario shows how an SCA application can expose HTML web pages + by using an SCA component with the implementation.resource implementation type. +Contributions: help-pages +Launchers: help-pages + +12) Blog feed + +Description: An SCA component implementation of a blog is exposed as a + feed via the Atom protocol using binding.atom and via the RSS protocol + using binding.rss. For each protocol there are example implementations + using two different approaches: the getAll() method and the Collection API. +Contributions: blog-feed +Launchers: blog-feed + +13) Feed logger + +Description: An SCA component implementation is connected to an Atom feed + using binding.atom and an RSS feed using binding.rss. The SCA component + receives and logs entries from both feeds. +Contributions: feed-logger +Launchers: feed-logger + +14) Data binding + +Description: A Payment component that uses JAXB as its data representation + invokes a CreditCardPayment component that uses SDO to represent its data. + The Tuscany data binding framework converts automatically between these + different data representations. +Contributions: creditcard-payment-sdo, databinding-client, payment-java +Launchers: databinding + +15) Policy + +Description: The implementation of the Trip component has the tuscany:logging + implementation policy applied to it which means that all invocations of all + its services go through the JDKLoggingPolicyInterceptor class. In addition + the CreditCardPayment service has the "authentication" interaction policy + intent which requires invocations of this service from the Payment component + to use a policy set that satisifies this intent by providing authentication + of the invoking client. +Contributions: creditcard-payment-jaxb-policy, payment-java-policy, + policy-client, trip-policy +Launchers: policy + +16) SCA credit card payment service packaged as a web application + +Description: The CreditCardPayment service is packaged in a web application + (.war file) including all its Tuscany runtime dependencies and suitable + for deployment to a Web application server such as Apache Tomcat. The + service is configured with a endpoint which is exposed by + Apache Tomcat and will display its WSDL in response to a ?wsdl request. + The web application also includes a JSP which provides a user interface + for invoking the CreditCardPayment service. +Contributions: creditcard-payment-jaxb, creditcard-payment-webapp +Webapp: creditcard-payment-webapp + +17) Payment service with different implementation types + +Description: In SCA the technology used to implement a service is encapsulated + by the service and doesn't affect other components that invoke the service. + In this scenario we show how the Payment service can be implemented using a + range of different technologies while providing the same interface and the + same semantics. + +17a) implementation.bpel + +Description: The Payment service is implemented using a BPEL process. +Contributions: creditcard-payment-jaxb, emailgateway, payment-bpel, payment-bpel-process +Launchers: payment-bpel + +17b) implementation.script written in Groovy + +Description: The Payment service is implemented using a Groovy script. +Contributions: emailgateway, payment-groovy +Launchers: payment-groovy + +17c) implementation.java + +Description: The Payment service is implemented using a Java class. +Contributions: creditcard-payment-jaxb, payment-java +Launchers: payment-java + +17d) implementation.java with policy + +Description: The Payment service is implemented using a Java class, and + the reference from the Payment service to the CreditCardPayment service + is defined as requiring the "authentication" security policy. +Contributions: creditcard-payment-jaxb-policy, payment-java-policy +Launchers: payment-java-policy + +17e) implementation.script written in Python + +Description: The Payment service is implemented using a Python script. +Contributions: emailgateway, payment-python +Launchers: payment-python + +17f) implementation.spring + +Description: The Payment service is implemented using a Spring application + context which doesn't use any SCA-specific features. +Contributions: creditcard-payment-jaxb, payment-spring +Launchers: payment-spring + +17g) implementation.spring with SCA tags + +Description: The Payment service is implemented using a Spring application + context which uses SCA-specific XML elements (tags) to define SCA references + and properties. +Contributions: creditcard-payment-jaxb, payment-spring-scatag +Launchers: payment-spring-scatag + +18) SCA currency converter service interoperating with SCA or non-SCA client + +Description: In SCA a service can be configured with a variety of bindings + to expose it using a range of different communication protocols. This + scenario contains a number of examples showing the CurrencyConverter service + exposed using different bindings and invoked by SCA or non-SCA clients + using various protocols. + +18a) SCA client + +Description: The CurrencyConverter service uses the default SCA binding and + is invoked by an SCA client running in the same process. +Contributions: currency +Launchers: currency-converter + +18b) CORBA client + +Description: The CurrencyConverter service is exposed as a CORBA service + using binding.corba and is invoked by a Java CORBA client running in a + different process. +Contributions: currency, currency-corba +Launchers: currency-converter-corba +Clients: currency-converter-corba + +18c) JMS client + +Description: The CurrencyConverter service is exposed as a JMS service + using binding.jms and is invoked by an ActiveMQ JMS client running in + a different process. +Contributions: currency, currency-jms +Launchers: currency-converter-jms +Clients: currency-converter-jms + +18d) RMI client + +Description: The CurrencyConverter service is exposed as an RMI service + using binding.rmi and is invoked by a Java RMI client running in a + different process. +Contributions: currency, currency-rmi +Launchers: currency-converter-rmi +Clients: currency-converter-rmi + +18e) JAX-WS client + +Description: The CurrencyConverter service is exposed as a web service + using binding.ws and is invoked over SOAP/HTTP by a JAX-WS client + running in a different process. +Contributions: currency, currency-ws +Launchers: currency-converter-ws +Clients: currency-converter-ws-jaxws + +18f) Web application JSP client + +Description: The CurrencyConverter service is deployed as a web + application using the default SCA binding and is invoked from the + same process by a JSP client that's deployed as part of the same + web application. +Contributions: currency, currency-jsp +Webapp: scatours-contribution-currency-jsp.war + +18g) Web application servlet client + +Description: The CurrencyConverter service is deployed as a web + application using the default SCA binding and is invoked from the + same process using a servlet in the same web application which + generates HTML to display a client page. +Contributions: currency, currency-servlet +Webapp: scatours-contribution-currency-servlet.war + +19) SCA notification service interoperating with non-SCA SMS gateway service + +Description: SCA references can invoke non-SCA services using a range + of different communication protocols which are selected by choosing + a suitable binding to configure the reference. This scenario contains + a number of examples showing an SCA Notification service using an + SCA reference configured with different bindings to invoke a non-SCA + SMSGateway service over various different protocols. + +19a) SMS gateway CORBA service + +Description: The SCA reference uses binding.corba to invoke an SMSGateway + Java CORBA service running in a different process. +Contributions: notification, notification-corba +Services: smsgateway-corba +Launchers: notification-corba + +19b) SMS gateway EJB service + +Description: The SCA reference uses binding.ejb to invoke an SMSGateway + EJB session bean running on OpenEJB in a different process. +Contributions: notification, notification-ejb +Services: smsgateway-ejb +Launchers: notification-ejb + +19c) SMS gateway JMS service + +Description: The SCA reference uses binding.jms to invoke an SMSGateway + JMS service running on ActiveMQ in a different process. +Contributions: notification, notification-jms +Services: smsgateway-jms +Launchers: notification-jms + +19d) SMS gateway RMI service + +Description: The SCA reference uses binding.rmi to invoke an SMSGateway + RMI service running in a different process. +Contributions: notification, notification-rmi +Services: smsgateway-rmi +Launchers: notification-rmi + +19e) SMS gateway JAX-WS service + +Description: The SCA reference uses binding.ws to invoke an SMSGateway + JAX-WS web service running in a different process. +Contributions: notification, notification-ws +Services: smsgateway-jaxws +Launchers: notification-ws + + +Building the travel sample +-------------------------- + +Please see the BUILDING file in the travel sample distribution for full +details of how to build the travel sample using Maven or Ant. + + +Running travel sample scenarios from launcher source directories +---------------------------------------------------------------- + +After building the travel sample using either Maven or Ant, you can run +all the scenarios that have launchers by using ant scripts in the +subdirectories of the travelsample/launchers directory. For scenarios +that are packaged as web applications and don't have launchers, the next +section describes how you can run these. + +You can run the launcher ant scripts as follows: + 1. Open a command prompt. + 2. Change directory to travelsample/launchers/ where + is the launcher directory for the scenario that you + want to run. + 3. Enter the command shown in Table 1 below. This command is usually + "ant run". This runs an ant script that sets the necessary + classpath and invokes the launcher class. + 4. Some scenarios require the above steps to be repeated multiple times + with different commands. These cases are indicated by entries in + Table 1 with more than one command listed. For these scenarios, all + the listed commands should be entered in separate command prompts + from the same current directory and in the same order as shown. + 5. Some scenarios have a browser-based user interface which is displayed + by entering the URLs shown in Table 1 in a browser after running the + launcher or launchers for the scenario. The recommended browser is + Firefox as some scenarios don't work with Internet Explorer. + +Table 1. Running scenarios packaged as launchers and contributions +--------------------------------------------------------------------------------------------------------------- +| Scenario Launcher directory Commands URLs | +--------------------------------------------------------------------------------------------------------------- +| 1) Jumpstart | jumpstart | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 2) Introducing | introducing | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 3) Introducing | introducing-client | ant run-domain | | +| (distributed) | | ant run-trips | | +| | | ant run-tours | | +| | | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 4) Using SCA | usingsca | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 5) Building blocks | buildingblocks | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 6) Interaction | interaction | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 7) Full application | fullapp | ant run | http://localhost:8080/scatours | +--------------------------------------------------------------------------------------------------------------- +| 8) Full application | fullapp-nodes | ant run-domain | | +| (distributed) | | ant run | http://localhost:8080/scatours | +--------------------------------------------------------------------------------------------------------------- +| 9) Callback | payment-java-callback | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 10) Reference | payment-java-reference-pass | ant run | | +| passing | | | | +--------------------------------------------------------------------------------------------------------------- +| 11) Help pages | help-pages | ant run | http://localhost:8085/help/index.html | +--------------------------------------------------------------------------------------------------------------- +| 12) Blog feed | blog-feed | ant run | http://localhost:8090/BlogAtom | +| | | | http://localhost:8090/BlogRSS | +| | | | http://localhost:8090/BlogAtomAPIs | +| | | | http://localhost:8090/BlogRSSAPIs | +--------------------------------------------------------------------------------------------------------------- +| 13) Feed logger | feed-logger | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 14) Data binding | databinding | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 15) Policy | policy | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 17) Payment service implementation types | +| | +| Impl type Launcher directory Commands URLs | +--------------------------------------------------------------------------------------------------------------- +| 17a) BPEL | payment-bpel | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 17b) Groovy | payment-groovy | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 17c) Java | payment-java | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 17d) Java + policy | payment-java-policy | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 17e) Python | payment-python | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 17f) Spring | payment-spring | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 17g) Spring SCA tags | payment-spring-scatag | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 18) Currency converter service binding types | +| | +| Binding type Launcher directory Commands URLs | +--------------------------------------------------------------------------------------------------------------- +| 18a) SCA | currency-converter | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 18b) CORBA | currency-converter-corba | ant run | | +| | | ant run-client | | +--------------------------------------------------------------------------------------------------------------- +| 18c) JMS | currency-converter-jms | ant run | | +| | | ant run-client | | +--------------------------------------------------------------------------------------------------------------- +| 18d) RMI | currency-converter-rmi | ant run | | +| | | ant run-client | | +--------------------------------------------------------------------------------------------------------------- +| 18e) WS | currency-converter-ws | ant run | | +| | | ant run-client | | +--------------------------------------------------------------------------------------------------------------- +| 19) Notification reference binding types | +| | +| Binding type Launcher directory Commands URLs | +--------------------------------------------------------------------------------------------------------------- +| 19a) CORBA | notification-corba | ant run-smsgateway | | +| | | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 19b) EJB | notification-ejb | ant run-smsgateway | | +| | | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 19c) JMS | notification-jms | ant run-smsgateway | | +| | | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 19d) RMI | notification-rmi | ant run-smsgateway | | +| | | ant run | | +--------------------------------------------------------------------------------------------------------------- +| 19e) WS | notification-ws | ant run-smsgateway | | +| | | ant run | | +--------------------------------------------------------------------------------------------------------------- + + +Running travel sample scenarios in a Web application server +----------------------------------------------------------- + +Some scenarios are packaged as web applications (.war files) and don't +have launchers. After building the travel sample using either Maven or Ant, +you can use a Web application server to run these scenarios. + +You can run these web applications as follows: + 1. Deploy the web application (.war) file to a Web application server + such as Tomcat. The .war file can be found in the directory + travelsample/contributions//target where + is the contribution directory listed in Table 2 below. The name of + the .war file is scatours-contribution-.war. + 2. Display the browser-based user interface for the scenario by entering + its URLs in a browser. The URLs for each scenario are shown in Table 2. + The host and port in these URLs may need to be changed depending on the + configuration of the Web application server in which the web application + is deployed. These scenarios work in both Firefox and Internet Explorer. + +Table 2. Running scenarios packaged as web applications +------------------------------------------------------------------------------------------------------------------------------------------------- +| Scenario | Contribution directory | URLs | +------------------------------------------------------------------------------------------------------------------------------------------------- +| 16) Credit card | creditcard-payment-webapp | http://localhost:8080/scatours-contribution-creditcard-payment-webapp | +| webapp service | | http://localhost:8080/scatours-contribution-creditcard-payment-webapp/CreditCardPayment?wsdl | +------------------------------------------------------------------------------------------------------------------------------------------------- +| 18f) Currency | currency-jsp | http://localhost:8080/scatours-contribution-currency-jsp | +| converter JSP | | | +------------------------------------------------------------------------------------------------------------------------------------------------- +| 18g) Currency | currency-servlet | http://localhost:8080/scatours-contribution-currency-servlet | +| converter | | | +| servlet | | | +------------------------------------------------------------------------------------------------------------------------------------------------- + + +Running the domain manager +-------------------------- + +The travelsample/testdomain directory is provided for the purpose +of running the domain manager and creating your own configuration. +You can do this as follows: + +1. Open a command prompt and make travelsample/testdomain your + current directory. + +2. Enter "ant run" to start the domain manager. + +3. In a browser, start the domain manager GUI by entering the URL + "http://localhost:9990/ui/home". The recommended browser is Firefox + because the domain manager GUI doesn't work with Internet Explorer. + +4. In the browser window, create or update your domain manager + configuration using the domain manager GUI. + +5. To exit the domain manager, enter "q" in the command prompt window. + The domain configuration is saved automatically and will be + restored the next time you start the domain manager. + +6. If you want to remove your saved configuration and start again from + a clean slate, enter either "ant clean" or "mvn clean" from the + command prompt window. + + +Running travel sample scenarios from the "binaries" directory +------------------------------------------------------------- + +If the travel sample was built from the distribution using Ant or Maven, +a binary package for the travel sample will be created in the binaries/target +directory and its subdirectories. This binary package contains all the built +jar and war files and runtime dependencies for these files. By looking at the +contents of the binaries/target directory tree you can see how to package a +Tuscany application in binary form for distribution to users of the application. + +The following subdirectories of binaries/target contain jar and war files +for the travel sample: + clients - non-SCA clients using various communication technologies + contributions - SCA contributions for the travel sample + launchers - executable launchers for the travel sample + services - non-SCA services using various communication technologies + util - jar files needed by other jars in the travel sample + webapps - war files for the travel sample + +The following subdirectories of binaries/target contain runtime dependencies +for the above files: + domainconfig - domain configuration files + jaxws - JAX-WS runtime jars neeed when running the travel sample on JDK 5 + lib - Tuscany runtime jars and their dependencies needed by the travel sample + (only present if the travel sample was built using "mvn -Pselfcontained") + ode - JPA Derby database needed by the ODE runtime + openejb - OpenEJB 3.1.2 runtime jars needed by the travel sample + +To use the binary package to run the travel sample scenarios packaged with +launchers, you can do the following: + 1. Open a command prompt. + 2. Change directory to travelsample/binaries/target/ where + is the directory for the scenario shown in Table 3 below. + 3. Enter the command for the scenario shown in Table 3. This runs an + ant script that sets the necessary classpath and invokes the launcher class. + 4. Some scenarios require the above steps to be repeated multiple times + with different commands. These cases are indicated by entries in + Table 3 with more than one directory and command listed. For these + scenarios, all the listed commands should be entered in separate command + prompts from the listed current directories in the same order as shown. + 5. Some scenarios have a browser-based user interface which is started + by entering the URL shown in Table 3 in a browser after running the + launcher or launchers for the scenario. The recommended browser is + Firefox as some scenarios don't work with Internet Explorer. + +Table 3. Running scenarios with launchers from the binaries/target directory +------------------------------------------------------------------------------------------------------------------- +| Scenario Directory Commands URLs | +------------------------------------------------------------------------------------------------------------------- +| 1) Jumpstart | not available when running from binaries/target | +------------------------------------------------------------------------------------------------------------------- +| 2) Introducing | launchers | ant run-introducing | | +------------------------------------------------------------------------------------------------------------------- +| 3) Introducing | launchers | ant run-introducing-domain | | +| (distributed) | launchers | ant run-introducing-trips | | +| | launchers | ant run-introducing-tours | | +| | launchers | ant run-introducing-client | | +------------------------------------------------------------------------------------------------------------------- +| 4) Using SCA | launchers | ant run-usingsca | | +------------------------------------------------------------------------------------------------------------------- +| 5) Building blocks | launchers | ant run-buildingblocks | | +------------------------------------------------------------------------------------------------------------------- +| 6) Interaction | launchers | ant run-interaction | | +------------------------------------------------------------------------------------------------------------------- +| 7) Full application | launchers | ant run-fullapp | http://localhost:8080/scatours | +------------------------------------------------------------------------------------------------------------------- +| 8) Full application | launchers | ant run-fullapp-domain | | +| (distributed) | launchers | ant run-fullapp-nodes | http://localhost:8080/scatours | +------------------------------------------------------------------------------------------------------------------- +| 9) Callback | launchers | ant run-payment-java-callback | | +------------------------------------------------------------------------------------------------------------------- +| 10) Reference | launchers | ant run-payment-java-reference-pass | | +| passing | | | | +------------------------------------------------------------------------------------------------------------------- +| 11) Help pages | launchers | ant run-help-pages | http://localhost:8085/help/index.html | +------------------------------------------------------------------------------------------------------------------- +| 12) Blog feed | launchers | ant run-blog-feed | http://localhost:8090/BlogAtom | +| | | | http://localhost:8090/BlogRSS | +| | | | http://localhost:8090/BlogAtomAPIs | +| | | | http://localhost:8090/BlogRSSAPIs | +------------------------------------------------------------------------------------------------------------------- +| 13) Feed logger | launchers | ant run-feed-logger | | +------------------------------------------------------------------------------------------------------------------- +| 14) Data binding | launchers | ant run-databinding | | +------------------------------------------------------------------------------------------------------------------- +| 15) Policy | launchers | ant run-policy | | +------------------------------------------------------------------------------------------------------------------- +| 17) Payment service implementation types | +| | +| Impl type Directory Commands URLs | +------------------------------------------------------------------------------------------------------------------- +| 17a) BPEL | launchers | ant run-payment-bpel | | +------------------------------------------------------------------------------------------------------------------- +| 17b) Groovy | launchers | ant run-payment-groovy | | +------------------------------------------------------------------------------------------------------------------- +| 17c) Java | launchers | ant run-payment-java | | +------------------------------------------------------------------------------------------------------------------- +| 17d) Java + policy | launchers | ant run-payment-java-policy | | +------------------------------------------------------------------------------------------------------------------- +| 17e) Python | launchers | ant run-payment-python | | +------------------------------------------------------------------------------------------------------------------- +| 17f) Spring | launchers | ant run-payment-spring | | +------------------------------------------------------------------------------------------------------------------- +| 17g) Spring SCA tags | launchers | ant run-payment-spring-scatag | | +------------------------------------------------------------------------------------------------------------------- +| 18) Currency converter service binding types | +| | +| Binding type Directories Commands URLs | +------------------------------------------------------------------------------------------------------------------- +| 18a) SCA | launchers | ant run-currency-converter | | +------------------------------------------------------------------------------------------------------------------- +| 18b) CORBA | launchers | ant run-currency-converter-corba | | +| | clients | ant run-currency-converter-corba | | +------------------------------------------------------------------------------------------------------------------- +| 18c) JMS | launchers | ant run-currency-converter-jms | | +| | clients | ant run-currency-converter-jms | | +------------------------------------------------------------------------------------------------------------------- +| 18d) RMI | launchers | ant run-currency-converter-rmi | | +| | clients | ant run-currency-converter-rmi | | +------------------------------------------------------------------------------------------------------------------- +| 18e) WS | launchers | ant run-currency-converter-ws | | +| | clients | ant run-currency-converter-ws-jaxws | | +------------------------------------------------------------------------------------------------------------------- +| 19) Notification reference binding types | +| | +| Binding type Directories Commands URLs | +------------------------------------------------------------------------------------------------------------------- +| 19a) CORBA | services | ant run-smsgateway-corba | | +| | launchers | ant run-notification-corba | | +------------------------------------------------------------------------------------------------------------------- +| 19b) EJB | services | ant run-smsgateway-ejb | | +| | launchers | ant run-notification-ejb | | +------------------------------------------------------------------------------------------------------------------- +| 19c) JMS | services | ant run-smsgateway-jms | | +| | launchers | ant run-notification-jms | | +------------------------------------------------------------------------------------------------------------------- +| 19d) RMI | services | ant run-smsgateway-rmi | | +| | launchers | ant run-notification-rmi | | +------------------------------------------------------------------------------------------------------------------- +| 19e) WS | services | ant run-smsgateway-jaxws | | +| | launchers | ant run-notification-ws | | +------------------------------------------------------------------------------------------------------------------- + +Some scenarios are packaged as web applications and don't have launchers. +You can run these using .war files from the binaries/target/webapps +directory as follows: + 1. Deploy the web application (.war) file to a Web application server + such as Tomcat. The .war file can be found in the directory + travelsample/binaries/target/webapps and has the name listed in + Table 4 below. + 2. Display the browser-based user interface for the scenario by entering + its URLs in a browser. The URLs for each scenario are shown in Table 4. + The host and port in these URLs may need to be changed depending on the + configuration of the Web application server in which the web application + is deployed. These scenarios work in both Firefox and Internet Explorer. + +Table 4. Running scenarios packaged as web applications +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| Scenario | Web application file | URLs | +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| 16) Credit card | scatours-contribution-creditcard-payment-webapp.war | http://localhost:8080/scatours-contribution-creditcard-payment-webapp | +| webapp service | | http://localhost:8080/scatours-contribution-creditcard-payment-webapp/CreditCardPayment?wsdl | +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| 18f) Currency | scatours-contribution-currency-jsp.war | http://localhost:8080/scatours-contribution-currency-jsp | +| converter JSP | | | +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| 18g) Currency | scatours-contribution-currency-servlet.war | http://localhost:8080/scatours-contribution-currency-servlet | +| converter | | | +| servlet | | | +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + +Building and running the self-contained travel sample +----------------------------------------------------- + +The travel sample can be built using the "mvn -Pselfcontained" command. This +puts all of its runtime dependencies under the binaries/target directory and +doesn't use any files from the Tuscany SCA Java binary distribution. + +If the travel sample has been built in this way, you can run it as described +in the previous section using the same ant scripts. Alternatively you can +use the "java -jar" command to run the travel sample executable jars directly +using the manifest dependencies in the jar files. For example, the commands + ant run-currency-converter-ws + ant run-currency-converter-ws-jaxws + ant run-smsgateway-corba +could be replaced by the commands + java -jar scatours-launcher-currency-converter-ws.jar + java -jar scatours-client-currency-converter-ws-jaxws.jar + java -jar scatours-service-smsgateway-corba.jar + + +Cross-reference of contributions to scenarios +--------------------------------------------- + +The following table shows which contributions are used in which scenarios. + +contributions/blog-feed 12 +contributions/buildingblocks 5 +contributions/buildingblocks-client 5 +contributions/calendar 6 +contributions/car 7, 8 +contributions/common 6, 7, 8, 15 +contributions/creditcard-payment-jaxb 17a, 17c, 17f, 17g, 16 +contributions/creditcard-payment-jaxb-policy 7, 8, 15, 17d +contributions/creditcard-payment-sdo 14 +contributions/creditcard-payment-webapp 16 +contributions/currency 6, 7, 8, 18a, 18b, 18c, 18d, 18e, 18f, 18g +contributions/currency-corba 18b +contributions/currency-jms 18c +contributions/currency-jsp 18f +contributions/currency-rmi 18d +contributions/currency-servlet 18g +contributions/currency-ws 18e +contributions/databinding-client 14 +contributions/emailgateway 17a, 17b, 17e +contributions/feed-logger 13 +contributions/flight 6, 7, 8 +contributions/fullapp-bespoketrip 7, 8 +contributions/fullapp-coordination 7, 8 +contributions/fullapp-currency 7, 8 +contributions/fullapp-packagedtrip 7, 8 +contributions/fullapp-shoppingcart 7, 8 +contributions/fullapp-ui 7, 8 +contributions/help-pages 11 +contributions/hotel 7, 8 +contributions/interaction-client 6 +contributions/interaction-service-remote 6 +contributions/introducing-client 2, 3 +contributions/introducing-tours 2, 3 +contributions/introducing-trips 1, 2, 3, 5 +contributions/notification 19a, 19b, 19c, 19d, 19e +contributions/notification-corba 19a +contributions/notification-ejb 19b +contributions/notification-jms 19c +contributions/notification-rmi 19d +contributions/notification-ws 19e +contributions/payment-bpel 17a +contributions/payment-bpel-process 17a +contributions/payment-groovy 17b +contributions/payment-java 14, 17c +contributions/payment-java-callback 9 +contributions/payment-java-policy 8, 15, 17d +contributions/payment-java-reference-pass 10 +contributions/payment-python 17e +contributions/payment-spring 17f +contributions/payment-spring-policy 7 +contributions/payment-spring-scatag 17g +contributions/policy-client 15 +contributions/scatours 7, 8 +contributions/shoppingcart 6, 7, 8 +contributions/travelcatalog 7, 8 +contributions/trip 7, 8 +contributions/tripbooking 7, 8 +contributions/trip-policy 15 +contributions/usingsca 4 diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/RELEASE_NOTES b/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/RELEASE_NOTES new file mode 100644 index 0000000000..a4b24fb067 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/distribution/src/main/release/RELEASE_NOTES @@ -0,0 +1,65 @@ +Apache Tuscany SCA Travel Sample 1.0 June 2010 Release Notes +============================================================ + +The Apache Tuscany SCA Travel Sample shows how Apache Tuscany SCA +can be used in a business application. + +Overview +-------- + +The travel sample consists of a number of scenarios which demonstrate +various aspects of SCA and Apache Tuscany in the context of a travel +booking application. Details of these scenarios can be found in the +travel sample README file. + +Unlike other Apache Tuscany SCA samples that are included in the +Apache Tuscany SCA distribution, the travel sample is released as a +separate package. This matches how user applications are developed +and makes it easier for Apache Tuscany users to use the travel sample +as a template for developing and packaging their own applications. + +The travel sample distribution contains source code and build files for +the travel sample, together with binary dependencies of the travel sample +that aren't included in the Apache Tuscany SCA Java binary distribution. +The distribution doesn't include binaries for the travel sample because +one of the major purposes of this sample is to show users how to build +and run an Apache Tuscany application from source code. See the BUILDING +and README files for details of the steps needed to do this. + +See the travel sample CHANGES file for a detailed list of new features +and bug fixes in this release. + +Support +------- + +For more information on Apache Tuscany visit the website at: + + http://tuscany.apache.org/ + +Any issues with this release can be reported to Apache Tuscany +using the mailing lists or in the JIRA issue tracker. + + Mailing list archives: + + http://mail-archives.apache.org/mod_mbox/tuscany-user + http://mail-archives.apache.org/mod_mbox/tuscany-dev/ + + JIRA: + + http://issues.apache.org/jira/browse/TUSCANY + +To join the project's mailing lists follow the instructions at: + + http://tuscany.apache.org/mailing-lists.html + +To find out more about OASIS Open CSA go to: + + http://www.oasis-opencsa.org. + +Apache Tuscany welcomes your help. Any contribution, including code, +testing, improving the documentation, or bug reporting is always +appreciated. + +Thank you for using Apache Tuscany! + +- The Tuscany Team. diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/build.xml new file mode 100644 index 0000000000..04219dd032 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/build.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/build.xml new file mode 100644 index 0000000000..adb8fafeda --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/build.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/pom.xml new file mode 100644 index 0000000000..3d04d436e5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/pom.xml @@ -0,0 +1,79 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-domainconfig-fullapp + Apache Tuscany SCA Tours Full Application Domain Configuration + + + ${artifactId} + + + src/main/resources + + workspace-binaries.xml + + + + + + maven-antrun-plugin + + + process-resources + + + + + + + + + + + + + + + + + + run + + + + + + org.apache.maven.plugins + maven-jar-plugin + + target/jar-classes + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud.composite new file mode 100644 index 0000000000..284376538a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud.composite @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-bespoketrip.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-bespoketrip.composite new file mode 100644 index 0000000000..b6d9d51cbc --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-bespoketrip.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-coordination.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-coordination.composite new file mode 100644 index 0000000000..b42457154f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-coordination.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-creditcard.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-creditcard.composite new file mode 100644 index 0000000000..5c66ff2796 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-creditcard.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-currency.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-currency.composite new file mode 100644 index 0000000000..185112122c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-currency.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-packagedtrip.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-packagedtrip.composite new file mode 100644 index 0000000000..323700b4a0 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-packagedtrip.composite @@ -0,0 +1,35 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-payment.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-payment.composite new file mode 100644 index 0000000000..b27b57fad5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-payment.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-shoppingcart.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-shoppingcart.composite new file mode 100644 index 0000000000..7bec251965 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-shoppingcart.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-ui.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-ui.composite new file mode 100644 index 0000000000..e86bef1c56 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/cloud/fullapp-ui.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/domain.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/domain.composite new file mode 100644 index 0000000000..c54cfa3416 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/domain.composite @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/workspace-binaries.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/workspace-binaries.xml new file mode 100644 index 0000000000..a7a3b01895 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/workspace-binaries.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/workspace.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/workspace.xml new file mode 100644 index 0000000000..8f1efcd1fd --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/fullapp/src/main/resources/workspace.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/build.xml new file mode 100644 index 0000000000..0aff8e6fb5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/build.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/pom.xml new file mode 100644 index 0000000000..785531f8f3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/pom.xml @@ -0,0 +1,79 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-domainconfig-introducing + Apache Tuscany SCA Tours Introducing Domain Configuration + + + ${artifactId} + + + src/main/resources + + workspace-binaries.xml + + + + + + maven-antrun-plugin + + + process-resources + + + + + + + + + + + + + + + + + + run + + + + + + org.apache.maven.plugins + maven-jar-plugin + + target/jar-classes + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/cloud.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/cloud.composite new file mode 100644 index 0000000000..5d400e1be8 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/cloud.composite @@ -0,0 +1,26 @@ + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/cloud/ClientNode.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/cloud/ClientNode.composite new file mode 100644 index 0000000000..adf8f0e9cb --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/cloud/ClientNode.composite @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/cloud/ToursNode.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/cloud/ToursNode.composite new file mode 100644 index 0000000000..6e8f7fadb6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/cloud/ToursNode.composite @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/cloud/TripsNode.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/cloud/TripsNode.composite new file mode 100644 index 0000000000..9e4b454941 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/cloud/TripsNode.composite @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/domain.composite b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/domain.composite new file mode 100644 index 0000000000..ec0f71484b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/domain.composite @@ -0,0 +1,26 @@ + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/workspace-binaries.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/workspace-binaries.xml new file mode 100644 index 0000000000..5c058ee325 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/workspace-binaries.xml @@ -0,0 +1,30 @@ + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/workspace.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/workspace.xml new file mode 100644 index 0000000000..59468135c1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/introducing/src/main/resources/workspace.xml @@ -0,0 +1,30 @@ + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/pom.xml new file mode 100644 index 0000000000..66707faf15 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/domainconfig/pom.xml @@ -0,0 +1,37 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../pom.xml + + scatours-domainconfig + pom + Apache Tuscany SCA Tours Domain Configurations + + + fullapp + introducing + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/blog-feed/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/blog-feed/build.xml new file mode 100644 index 0000000000..c5b87898ce --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/blog-feed/build.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/blog-feed/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/blog-feed/pom.xml new file mode 100644 index 0000000000..20c682d919 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/blog-feed/pom.xml @@ -0,0 +1,104 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-blog-feed + Apache Tuscany SCA Tours Blog Feed Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-tomcat + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-atom-abdera + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-rss-rome + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.BlogFeedLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/blog-feed/src/main/java/scatours/BlogFeedLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/blog-feed/src/main/java/scatours/BlogFeedLauncher.java new file mode 100644 index 0000000000..8dc6956986 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/blog-feed/src/main/java/scatours/BlogFeedLauncher.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 scatours; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +public class BlogFeedLauncher { + + public static void main(String[] args) throws Exception { + SCAContribution feedContribution = locate("blog-feed"); + + SCANode node = SCANodeFactory.newInstance().createSCANode("blog-feed.composite", feedContribution); + node.start(); + + System.out.println("Node started - Press enter to shutdown."); + System.out.println(); + System.out.println("To view the blog feed, use your Web browser to view:"); + System.out.println(" Feeds using Tuscany Data APIs"); + System.out.println(" http://localhost:8090/BlogAtom"); + System.out.println(" http://localhost:8090/BlogRSS"); + System.out.println(" Feeds using Atom APIs"); + System.out.println(" http://localhost:8090/BlogAtomAPIs"); + System.out.println(" Feeds using RSS APIs"); + System.out.println(" http://localhost:8090/BlogRSSAPIs"); + System.out.println(); + System.in.read(); + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/build.xml new file mode 100644 index 0000000000..61e01fb824 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/build.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/buildingblocks/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/buildingblocks/build.xml new file mode 100644 index 0000000000..f4fccabeea --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/buildingblocks/build.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/buildingblocks/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/buildingblocks/pom.xml new file mode 100644 index 0000000000..f29fed164f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/buildingblocks/pom.xml @@ -0,0 +1,131 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-buildingblocks + Apache Tuscany SCA Tours Building Blocks Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.activemq + activemq-all + 5.2.0 + + + org.apache.activemq + activemq-web-demo + + + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jms-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jms-asf + ${tuscany.version} + runtime + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.BuildingBlocksLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/buildingblocks/src/main/java/scatours/BuildingBlocksLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/buildingblocks/src/main/java/scatours/BuildingBlocksLauncher.java new file mode 100644 index 0000000000..741b502cf3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/buildingblocks/src/main/java/scatours/BuildingBlocksLauncher.java @@ -0,0 +1,84 @@ +/* + * 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.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import static scatours.launcher.LauncherUtil.locate; + +public class BuildingBlocksLauncher { + + public static void main(String[] args) throws Exception { + runImpl(); + runImplInclude(); + runAppl(); + } + + private static void runImpl() throws Exception { + SCANode node = + SCANodeFactory.newInstance().createSCANode("tours-impl-client.composite", + locate("buildingblocks"), + locate("buildingblocks-client")); + + node.start(); + + Runnable client = ((SCAClient)node).getService(Runnable.class, "ToursClient/Runnable"); + client.run(); + + node.stop(); + } + + private static void runImplInclude() throws Exception { + SCANode node = + SCANodeFactory.newInstance().createSCANode("tours-impl-include-client.composite", + locate("introducing-trips"), + locate("buildingblocks"), + locate("buildingblocks-client")); + + node.start(); + + Runnable client = ((SCAClient)node).getService(Runnable.class, "ToursClient/Runnable"); + client.run(); + + node.stop(); + } + + private static void runAppl() throws Exception { + SCANode node1 = + SCANodeFactory.newInstance().createSCANode("tours-appl.composite", + locate("introducing-trips"), + locate("buildingblocks")); + + SCANode node2 = + SCANodeFactory.newInstance().createSCANode("tours-appl-client.composite", + locate("buildingblocks-client")); + + node1.start(); + node2.start(); + + Runnable client = ((SCAClient)node2).getService(Runnable.class, "ApplClient/Runnable"); + client.run(); + + node2.stop(); + node1.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/buildingblocks/src/main/resources/jndi.properties b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/buildingblocks/src/main/resources/jndi.properties new file mode 100644 index 0000000000..88270fd1e0 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/buildingblocks/src/main/resources/jndi.properties @@ -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. +## --------------------------------------------------------------------------- + +# START SNIPPET: jndi + +java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory + +# use the following property to configure the default connector +java.naming.provider.url = vm://localhost?broker.persistent=false + +# use the following property to specify the JNDI name the connection factory +# should appear as. +#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry +connectionFactoryNames = ConnectionFactory + +# register some queues in JNDI using the form +# queue.[jndiName] = [physicalName] +queue.BookTrip = BookTripRequestQueue +queue.Checkout = CheckoutRequestQueue + +# register some topics in JNDI using the form +# topic.[jndiName] = [physicalName] +#topic.MyTopic = example.MyTopic + +# END SNIPPET: jndi diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/buildingblocks/src/test/java/scatours/BuildingBlocksTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/buildingblocks/src/test/java/scatours/BuildingBlocksTestCase.java new file mode 100644 index 0000000000..55943e2f45 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/buildingblocks/src/test/java/scatours/BuildingBlocksTestCase.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 scatours; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the launcher + */ +public class BuildingBlocksTestCase { + + @Before + public void startServer() throws Exception { + } + + @Test + public void testLauncher() throws Exception { + BuildingBlocksLauncher.main(null); + } + + @After + public void stopServer() throws Exception { + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-corba/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-corba/build.xml new file mode 100644 index 0000000000..0fbdccb9e1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-corba/build.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-corba/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-corba/pom.xml new file mode 100644 index 0000000000..de06234931 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-corba/pom.xml @@ -0,0 +1,97 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-currency-converter-corba + Apache Tuscany SCA Tours Currency Converter CORBA Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-corba-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-corba-jse-tns + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.CurrencyConverterCORBALauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-corba/src/main/java/scatours/CurrencyConverterCORBALauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-corba/src/main/java/scatours/CurrencyConverterCORBALauncher.java new file mode 100644 index 0000000000..0f9d0eca80 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-corba/src/main/java/scatours/CurrencyConverterCORBALauncher.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; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import scatours.currencyconverter.CurrencyConverter; + +public class CurrencyConverterCORBALauncher { + + public static void main(String[] args) throws Exception { + SCAContribution currencyCORBAContribution = locate("currency-corba"); + SCAContribution currencyContribution = locate("currency"); + + SCANode node = + SCANodeFactory.newInstance().createSCANode("currency-converter-corba.composite", + currencyContribution, + currencyCORBAContribution); + node.start(); + + System.out.println("Quick currency converter test"); + CurrencyConverter converter = ((SCAClient)node).getService(CurrencyConverter.class, "CurrencyConverter"); + System.out.println("USD -> GBP = " + converter.getExchangeRate("USD", "GBP")); + System.out.println("100 USD = " + converter.convert("USD", "GBP", 100) + "GBP"); + + System.out.println("Node started - Press enter to shutdown."); + System.in.read(); + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-corba/src/main/java/scatours/currencyconverter/CurrencyConverter.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-corba/src/main/java/scatours/currencyconverter/CurrencyConverter.java new file mode 100644 index 0000000000..fe5c98bf02 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-corba/src/main/java/scatours/currencyconverter/CurrencyConverter.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 scatours.currencyconverter; + +import org.osoa.sca.annotations.Remotable; + +/** + * The CurrencyConverter service interface + */ +@Remotable +public interface CurrencyConverter { + + double getExchangeRate(String fromCurrencyCode, String toCurrencyCode); + + double convert(String fromCurrencyCode, String toCurrencyCode, double amount); + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-jms/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-jms/build.xml new file mode 100644 index 0000000000..9c8eb69053 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-jms/build.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-jms/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-jms/pom.xml new file mode 100644 index 0000000000..ffd954405d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-jms/pom.xml @@ -0,0 +1,109 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-currency-converter-jms + Apache Tuscany SCA Tours Currency Converter JMS Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jms-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jms-asf + ${tuscany.version} + runtime + + + + org.apache.activemq + activemq-all + 5.2.0 + + + org.apache.activemq + activemq-web-demo + + + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.CurrencyConverterJMSLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-jms/src/main/java/scatours/CurrencyConverterJMSLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-jms/src/main/java/scatours/CurrencyConverterJMSLauncher.java new file mode 100644 index 0000000000..6da4e7e162 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-jms/src/main/java/scatours/CurrencyConverterJMSLauncher.java @@ -0,0 +1,53 @@ +/* + * 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 static scatours.launcher.LauncherUtil.locate; + +import org.apache.activemq.broker.BrokerService; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +public class CurrencyConverterJMSLauncher { + + public static void main(String[] args) throws Exception { + final BrokerService jmsBroker = new BrokerService(); + jmsBroker.setPersistent(false); + jmsBroker.setUseJmx(false); + jmsBroker.addConnector("tcp://localhost:61619"); + jmsBroker.start(); + + SCAContribution currencyJMSContribution = locate("currency-jms"); + SCAContribution currencyContribution = locate("currency"); + + SCANode node = + SCANodeFactory.newInstance().createSCANode("currency-converter-jms.composite", + currencyContribution, + currencyJMSContribution); + node.start(); + + System.out.println("Node started - Press enter to shutdown."); + System.in.read(); + + node.stop(); + jmsBroker.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-rmi/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-rmi/build.xml new file mode 100644 index 0000000000..509ed07280 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-rmi/build.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-rmi/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-rmi/pom.xml new file mode 100644 index 0000000000..2549ca3a9e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-rmi/pom.xml @@ -0,0 +1,104 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-currency-converter-rmi + Apache Tuscany SCA Tours Currency Converter RMI Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-rmi + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-rmi-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-rmi + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.CurrencyConverterRMILauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-rmi/src/main/java/com/tuscanyscatours/currencyconverter/CurrencyConverter.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-rmi/src/main/java/com/tuscanyscatours/currencyconverter/CurrencyConverter.java new file mode 100644 index 0000000000..b1f783bfba --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-rmi/src/main/java/com/tuscanyscatours/currencyconverter/CurrencyConverter.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 com.tuscanyscatours.currencyconverter; + +import org.osoa.sca.annotations.Remotable; + +/** + * The CurrencyConverter service interface + */ +@Remotable +public interface CurrencyConverter { + + double getExchangeRate(String fromCurrencyCode, String toCurrencyCode); + + double convert(String fromCurrencyCode, String toCurrencyCode, double amount); + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-rmi/src/main/java/scatours/CurrencyConverterRMILauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-rmi/src/main/java/scatours/CurrencyConverterRMILauncher.java new file mode 100644 index 0000000000..81d9e19c60 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-rmi/src/main/java/scatours/CurrencyConverterRMILauncher.java @@ -0,0 +1,56 @@ +/* + * 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 static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import com.tuscanyscatours.currencyconverter.CurrencyConverter; + +public class CurrencyConverterRMILauncher { + + public static void main(String[] args) throws Exception { + SCAContribution currencyRMIContribution = locate("currency-rmi"); + SCAContribution currencyContribution = locate("currency"); + + SCANode node = + SCANodeFactory.newInstance().createSCANode("currency-converter-rmi.composite", + currencyContribution, + currencyRMIContribution); + node.start(); + + System.out.println("Quick currency converter test"); + CurrencyConverter converter = ((SCAClient)node).getService(CurrencyConverter.class, "CurrencyConverter"); + System.out.println("USD -> GBP = " + converter.getExchangeRate("USD", "GBP")); + System.out.println("100 USD = " + converter.convert("USD", "GBP", 100) + "GBP"); + + System.out.println("Node started - Press enter to shutdown."); + System.in.read(); + node.stop(); + + // The following line is a workaround for TUSCANY-3277 when running + // on Tuscany SCA 1.6 (the JVM hangs when exiting). + System.exit(0); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-ws/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-ws/build.xml new file mode 100644 index 0000000000..59c8e4c579 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-ws/build.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-ws/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-ws/pom.xml new file mode 100644 index 0000000000..00078d35fe --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-ws/pom.xml @@ -0,0 +1,97 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-currency-converter-ws + Apache Tuscany SCA Tours Currency Converter Web Service Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-tomcat + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.CurrencyConverterWSLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-ws/src/main/java/scatours/CurrencyConverterWSLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-ws/src/main/java/scatours/CurrencyConverterWSLauncher.java new file mode 100644 index 0000000000..2425d3f483 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-ws/src/main/java/scatours/CurrencyConverterWSLauncher.java @@ -0,0 +1,53 @@ +/* + * 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 static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import scatours.currencyconverter.CurrencyConverter; + +public class CurrencyConverterWSLauncher { + + public static void main(String[] args) throws Exception { + SCAContribution currencyWSContribution = locate("currency-ws"); + SCAContribution currencyContribution = locate("currency"); + + SCANode node = + SCANodeFactory.newInstance().createSCANode("currency-converter-ws.composite", + currencyContribution, + currencyWSContribution); + node.start(); + + System.out.println("Quick currency converter test"); + CurrencyConverter converter = ((SCAClient)node).getService(CurrencyConverter.class, "CurrencyConverter"); + System.out.println("USD -> GBP = " + converter.getExchangeRate("USD", "GBP")); + System.out.println("100 USD = " + converter.convert("USD", "GBP", 100) + "GBP"); + + System.out.println("Node started - Press enter to shutdown."); + System.in.read(); + + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-ws/src/main/java/scatours/currencyconverter/CurrencyConverter.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-ws/src/main/java/scatours/currencyconverter/CurrencyConverter.java new file mode 100644 index 0000000000..fe5c98bf02 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter-ws/src/main/java/scatours/currencyconverter/CurrencyConverter.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 scatours.currencyconverter; + +import org.osoa.sca.annotations.Remotable; + +/** + * The CurrencyConverter service interface + */ +@Remotable +public interface CurrencyConverter { + + double getExchangeRate(String fromCurrencyCode, String toCurrencyCode); + + double convert(String fromCurrencyCode, String toCurrencyCode, double amount); + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter/build.xml new file mode 100644 index 0000000000..5c029661a6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter/build.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter/pom.xml new file mode 100644 index 0000000000..44ba83cdc0 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter/pom.xml @@ -0,0 +1,83 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-currency-converter + Apache Tuscany SCA Tours Currency Converter Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.CurrencyConverterLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter/src/main/java/scatours/CurrencyConverterLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter/src/main/java/scatours/CurrencyConverterLauncher.java new file mode 100644 index 0000000000..cacd579b3b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter/src/main/java/scatours/CurrencyConverterLauncher.java @@ -0,0 +1,48 @@ +/* + * 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 static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import scatours.currencyconverter.CurrencyConverter; + +public class CurrencyConverterLauncher { + + public static void main(String[] args) throws Exception { + SCAContribution currencyContribution = locate("currency"); + + SCANode node = SCANodeFactory.newInstance().createSCANode("currency-converter.composite", currencyContribution); + node.start(); + + System.out.println("Quick currency converter test"); + CurrencyConverter converter = ((SCAClient)node).getService(CurrencyConverter.class, "CurrencyConverter"); + System.out.println("USD -> GBP = " + converter.getExchangeRate("USD", "GBP")); + System.out.println("100 USD = " + converter.convert("USD", "GBP", 100) + "GBP"); + + System.out.println("Node started - Press enter to shutdown."); + System.in.read(); + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter/src/main/java/scatours/currencyconverter/CurrencyConverter.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter/src/main/java/scatours/currencyconverter/CurrencyConverter.java new file mode 100644 index 0000000000..fe5c98bf02 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/currency-converter/src/main/java/scatours/currencyconverter/CurrencyConverter.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 scatours.currencyconverter; + +import org.osoa.sca.annotations.Remotable; + +/** + * The CurrencyConverter service interface + */ +@Remotable +public interface CurrencyConverter { + + double getExchangeRate(String fromCurrencyCode, String toCurrencyCode); + + double convert(String fromCurrencyCode, String toCurrencyCode, double amount); + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/databinding/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/databinding/build.xml new file mode 100644 index 0000000000..259ad600ef --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/databinding/build.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/databinding/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/databinding/pom.xml new file mode 100644 index 0000000000..21216985f9 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/databinding/pom.xml @@ -0,0 +1,168 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-databinding + Apache Tuscany SCA Tours Databinding Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-widget-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-resource-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-atom-abdera + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jsonrpc-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-http-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-sca-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ejb-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-ejb + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-bpel-ode + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + org.apache.derby + derby + 10.3.1.4 + runtime + + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.DatabindingLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/databinding/src/main/java/scatours/DatabindingLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/databinding/src/main/java/scatours/DatabindingLauncher.java new file mode 100644 index 0000000000..6271c60d53 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/databinding/src/main/java/scatours/DatabindingLauncher.java @@ -0,0 +1,45 @@ +/* + * 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 static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +public class DatabindingLauncher { + public static void main(String[] args) throws Exception { + SCANode node1 = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-java"), + locate("databinding-client")); + + SCANode node2 = SCANodeFactory.newInstance().createSCANode(null, locate("creditcard-payment-sdo")); + + node1.start(); + node2.start(); + + Runnable runner = ((SCAClient)node1).getService(Runnable.class, "TestClient/Runnable"); + runner.run(); + + node1.stop(); + node2.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/feed-logger/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/feed-logger/build.xml new file mode 100644 index 0000000000..7ba4ad820e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/feed-logger/build.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/feed-logger/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/feed-logger/pom.xml new file mode 100644 index 0000000000..016f1b192a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/feed-logger/pom.xml @@ -0,0 +1,104 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-feed-logger + Apache Tuscany SCA Tours Feed Logger Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-tomcat + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-atom-abdera + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-rss-rome + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.FeedLoggerLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/feed-logger/src/main/java/scatours/FeedLoggerLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/feed-logger/src/main/java/scatours/FeedLoggerLauncher.java new file mode 100644 index 0000000000..4aea24dbfe --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/feed-logger/src/main/java/scatours/FeedLoggerLauncher.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 scatours; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import scatours.feedlogger.FeedLogger; + +public class FeedLoggerLauncher { + + public static void main(String[] args) throws Exception { + SCAContribution feedContribution = locate("feed-logger"); + + SCANode node = SCANodeFactory.newInstance().createSCANode("feed-logger.composite", feedContribution); + node.start(); + + FeedLogger logger = ((SCAClient)node).getService(FeedLogger.class, "FeedLogger"); + logger.logFeeds(5); + + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/feed-logger/src/main/java/scatours/feedlogger/FeedLogger.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/feed-logger/src/main/java/scatours/feedlogger/FeedLogger.java new file mode 100644 index 0000000000..8187e34d2c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/feed-logger/src/main/java/scatours/feedlogger/FeedLogger.java @@ -0,0 +1,30 @@ +/* + * 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.feedlogger; + +public interface FeedLogger { + + /** + * Captures the configured feeds and logs the feed entries. + * + * @param maxEntriesPerFeed The maximum number of entries to log per feed + */ + public void logFeeds(int maxEntriesPerFeed); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-domain/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-domain/build.xml new file mode 100644 index 0000000000..36de2a93e4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-domain/build.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-domain/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-domain/pom.xml new file mode 100644 index 0000000000..fae6a44e58 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-domain/pom.xml @@ -0,0 +1,86 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-fullapp-domain + Apache Tuscany SCA Tours Full Application Domain Launcher + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-domain-manager + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jsonrpc + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-xml + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ${scatours.selfContained} + ../lib/ + scatours.FullAppDomainLauncher + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-domain/src/main/java/scatours/FullAppDomainLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-domain/src/main/java/scatours/FullAppDomainLauncher.java new file mode 100644 index 0000000000..324b68ab57 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-domain/src/main/java/scatours/FullAppDomainLauncher.java @@ -0,0 +1,53 @@ +/* + * 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.io.IOException; + +import org.apache.tuscany.sca.domain.manager.launcher.DomainManagerLauncherBootstrap; +import org.apache.tuscany.sca.node.SCANode; + +/** + * This launcher is only used when running from the binaries directory. + * If the binaries directory was built using the mvn -Pselfcontained command, + * it's important to ensure that no dependencies other than those explicitly + * specified by the launcher jar manifest and its transitive dependencies + * are used. This launcher class must therefore avoid using the Tuscany + * DomainManagerLauncher class, because DomainManagerLauncher builds a + * runtime classpath from (among other things) the TUSCANY_HOME environment + * variable. + */ +public class FullAppDomainLauncher { + + public static void main(String[] args) throws Exception { + String rootDir = "../domainconfig/fullapp"; + DomainManagerLauncherBootstrap bootstrap = new DomainManagerLauncherBootstrap(rootDir); + SCANode node = bootstrap.getNode(); + node.start(); + + System.out.println("Domain manager started - Press enter to shutdown."); + try { + System.in.read(); + } catch (IOException e) { + } + + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-nodes/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-nodes/build.xml new file mode 100644 index 0000000000..b147a2087a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-nodes/build.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-nodes/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-nodes/pom.xml new file mode 100644 index 0000000000..cf63720abb --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-nodes/pom.xml @@ -0,0 +1,172 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-fullapp-nodes + Apache Tuscany SCA Tours Full Application Nodes Launcher + + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-widget-runtime-tuscany + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-atom-abdera + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jsonrpc-js + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jsonrpc-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-http-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-sca-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ejb-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-ejb + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-bpel-ode + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-spring + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-spring-runtime + ${tuscany.version} + runtime + + + + org.apache.derby + derby + 10.3.1.4 + runtime + + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ${scatours.selfContained} + ../lib/ + scatours.FullAppNodesLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-nodes/src/main/java/scatours/FullAppNodesLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-nodes/src/main/java/scatours/FullAppNodesLauncher.java new file mode 100644 index 0000000000..4d6459b749 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp-nodes/src/main/java/scatours/FullAppNodesLauncher.java @@ -0,0 +1,78 @@ +/* + * 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.io.IOException; + +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +public class FullAppNodesLauncher { + + public static void main(String[] args) throws Exception { + SCANode nodeCreditcard = + SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/creditcard"); + nodeCreditcard.start(); + + SCANode nodePayment = + SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/payment"); + nodePayment.start(); + + SCANode nodeShoppingcart = + SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/shoppingcart"); + nodeShoppingcart.start(); + + SCANode nodeCurrency = + SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/currency"); + nodeCurrency.start(); + + SCANode nodePackagedtrip = + SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/packagedtrip"); + nodePackagedtrip.start(); + + SCANode nodeBespoketrip = + SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/bespoketrip"); + nodeBespoketrip.start(); + + SCANode nodeFrontend = + SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/coordination"); + nodeFrontend.start(); + + SCANode nodeUI = SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/ui"); + nodeUI.start(); + + System.out.println("Point your browser at - http://localhost:8080/scatours/ "); + System.out.println("Nodes started - Press enter to shutdown."); + + try { + System.in.read(); + } catch (IOException e) { + } + + nodeCreditcard.stop(); + nodePayment.stop(); + nodeShoppingcart.stop(); + nodeCurrency.stop(); + nodePackagedtrip.stop(); + nodeBespoketrip.stop(); + nodeFrontend.stop(); + nodeUI.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp/build.xml new file mode 100644 index 0000000000..216401eaab --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp/build.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp/pom.xml new file mode 100644 index 0000000000..d4da88fc8f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp/pom.xml @@ -0,0 +1,182 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-fullapp + Apache Tuscany SCA Tours Full Application Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-widget-runtime-tuscany + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-atom-abdera + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jsonrpc-js + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jsonrpc-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-http-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-sca-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ejb-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-ejb + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-bpel-ode + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-spring + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-spring-runtime + ${tuscany.version} + runtime + + + + org.apache.derby + derby + 10.3.1.4 + runtime + + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.FullAppLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp/src/main/java/scatours/FullAppLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp/src/main/java/scatours/FullAppLauncher.java new file mode 100644 index 0000000000..ab1b7d031b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/fullapp/src/main/java/scatours/FullAppLauncher.java @@ -0,0 +1,66 @@ +/* + * 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 static scatours.launcher.LauncherUtil.locate; + +import java.io.IOException; + +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +public class FullAppLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = + SCANodeFactory.newInstance().createSCANode(null, + locate("common"), + locate("currency"), + locate("hotel"), + locate("flight"), + locate("car"), + locate("trip"), + locate("tripbooking"), + locate("travelcatalog"), + //locate("payment-java-policy"), + locate("payment-spring-policy"), + locate("creditcard-payment-jaxb-policy"), + locate("shoppingcart"), + locate("scatours"), + locate("fullapp-ui"), + locate("fullapp-coordination"), + locate("fullapp-currency"), + locate("fullapp-packagedtrip"), + locate("fullapp-bespoketrip"), + locate("fullapp-shoppingcart")); + + node.start(); + + System.out.println("Point your browser at - http://localhost:8080/scatours/ "); + System.out.println("Node started - Press enter to shutdown."); + + try { + System.in.read(); + } catch (IOException e) { + } + + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/help-pages/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/help-pages/build.xml new file mode 100644 index 0000000000..0bca6a5fc0 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/help-pages/build.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/help-pages/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/help-pages/pom.xml new file mode 100644 index 0000000000..9e3561e11a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/help-pages/pom.xml @@ -0,0 +1,97 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-help-pages + Apache Tuscany SCA Tours Help Pages Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-resource-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-http-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-tomcat + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.HelpPagesLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/help-pages/src/main/java/scatours/HelpPagesLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/help-pages/src/main/java/scatours/HelpPagesLauncher.java new file mode 100644 index 0000000000..a72f5c4c54 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/help-pages/src/main/java/scatours/HelpPagesLauncher.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 scatours; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +public class HelpPagesLauncher { + + public static void main(String[] args) throws Exception { + SCAContribution helpContribution = locate("help-pages"); + + SCANode node = SCANodeFactory.newInstance().createSCANode("help-pages.composite", helpContribution); + node.start(); + + System.out.println("Node started - Press enter to shutdown."); + System.out.println(); + System.out.println("To view the help pages, use your Web browser to view:"); + System.out.println(" http://localhost:8085/help/index.html"); + System.out.println(); + System.in.read(); + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/interaction/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/interaction/build.xml new file mode 100644 index 0000000000..394b41ca82 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/interaction/build.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/interaction/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/interaction/pom.xml new file mode 100644 index 0000000000..16376a6cc6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/interaction/pom.xml @@ -0,0 +1,104 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-interaction + Apache Tuscany SCA Tours Interaction Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.InteractionLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/interaction/src/main/java/scatours/InteractionLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/interaction/src/main/java/scatours/InteractionLauncher.java new file mode 100644 index 0000000000..b3e0e52f2e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/interaction/src/main/java/scatours/InteractionLauncher.java @@ -0,0 +1,70 @@ +/* + * 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 static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +public class InteractionLauncher { + + public static void main(String[] args) throws Exception { + SCANode node1 = + SCANodeFactory.newInstance().createSCANode("client.composite", + locate("common"), + locate("currency"), + locate("calendar"), + locate("shoppingcart"), + locate("interaction-client")); + + SCANode node2 = + SCANodeFactory.newInstance().createSCANode("service.composite", + locate("common"), + locate("hotel"), + locate("flight"), + locate("interaction-service-remote")); + + node2.start(); + node1.start(); + + Runnable localInteraction = ((SCAClient)node1).getService(Runnable.class, "InteractionLocalClient/Runnable"); + localInteraction.run(); + + Runnable remoteInteraction = ((SCAClient)node1).getService(Runnable.class, "InteractionRemoteClient/Runnable"); + remoteInteraction.run(); + + Runnable requestResponseInteraction = + ((SCAClient)node1).getService(Runnable.class, "InteractionRequestResponseClient/Runnable"); + requestResponseInteraction.run(); + + Runnable onewayCallbackInteraction = + ((SCAClient)node1).getService(Runnable.class, "InteractionOneWayCallbackClient/Runnable"); + onewayCallbackInteraction.run(); + + Runnable conversationalInteraction = + ((SCAClient)node1).getService(Runnable.class, "InteractionConversationClient/Runnable"); + conversationalInteraction.run(); + + node1.stop(); + node2.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/interaction/src/test/java/scatours/InteractionTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/interaction/src/test/java/scatours/InteractionTestCase.java new file mode 100644 index 0000000000..c64e5d1e5b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/interaction/src/test/java/scatours/InteractionTestCase.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 scatours; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the launcher + */ +public class InteractionTestCase { + + @Before + public void startServer() throws Exception { + } + + @Test + public void testLauncher() throws Exception { + InteractionLauncher.main(null); + } + + @After + public void stopServer() throws Exception { + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-client/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-client/build.xml new file mode 100644 index 0000000000..84b3ade200 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-client/build.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-client/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-client/pom.xml new file mode 100644 index 0000000000..be2e6878fd --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-client/pom.xml @@ -0,0 +1,90 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-introducing-client + Apache Tuscany SCA Tours Introducing Client Launcher + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-sca-axis2 + ${tuscany.version} + runtime + + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ${scatours.selfContained} + ../lib/ + scatours.IntroducingClientLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-client/src/main/java/scatours/IntroducingClientLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-client/src/main/java/scatours/IntroducingClientLauncher.java new file mode 100644 index 0000000000..f261ef6e27 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-client/src/main/java/scatours/IntroducingClientLauncher.java @@ -0,0 +1,38 @@ +/* + * 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.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +public class IntroducingClientLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = + SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/ClientNode"); + node.start(); + + Runnable client = ((SCAClient)node).getService(Runnable.class, "TestClient/Runnable"); + client.run(); + + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-domain/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-domain/build.xml new file mode 100644 index 0000000000..9d8c28b8e1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-domain/build.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-domain/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-domain/pom.xml new file mode 100644 index 0000000000..15476b6e8e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-domain/pom.xml @@ -0,0 +1,86 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-introducing-domain + Apache Tuscany SCA Tours Introducing Domain Launcher + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-domain-manager + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jsonrpc + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-xml + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ${scatours.selfContained} + ../lib/ + scatours.IntroducingDomainLauncher + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-domain/src/main/java/scatours/IntroducingDomainLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-domain/src/main/java/scatours/IntroducingDomainLauncher.java new file mode 100644 index 0000000000..1b47ef92bd --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-domain/src/main/java/scatours/IntroducingDomainLauncher.java @@ -0,0 +1,53 @@ +/* + * 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.io.IOException; + +import org.apache.tuscany.sca.domain.manager.launcher.DomainManagerLauncherBootstrap; +import org.apache.tuscany.sca.node.SCANode; + +/** + * This launcher is only used when running from the binaries directory. + * If the binaries directory was built using the mvn -Pselfcontained command, + * it's important to ensure that no dependencies other than those explicitly + * specified by the launcher jar manifest and its transitive dependencies + * are used. This launcher class must therefore avoid using the Tuscany + * DomainManagerLauncher class, because DomainManagerLauncher builds a + * runtime classpath from (among other things) the TUSCANY_HOME environment + * variable. + */ +public class IntroducingDomainLauncher { + + public static void main(String[] args) throws Exception { + String rootDir = "../domainconfig/introducing"; + DomainManagerLauncherBootstrap bootstrap = new DomainManagerLauncherBootstrap(rootDir); + SCANode node = bootstrap.getNode(); + node.start(); + + System.out.println("Domain manager started - Press enter to shutdown."); + try { + System.in.read(); + } catch (IOException e) { + } + + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-tours/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-tours/build.xml new file mode 100644 index 0000000000..1713b85e03 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-tours/build.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-tours/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-tours/pom.xml new file mode 100644 index 0000000000..1944990601 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-tours/pom.xml @@ -0,0 +1,86 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-introducing-tours + Apache Tuscany SCA Tours Introducing Tours Launcher + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-sca-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ${scatours.selfContained} + ../lib/ + scatours.IntroducingToursLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-tours/src/main/java/scatours/IntroducingToursLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-tours/src/main/java/scatours/IntroducingToursLauncher.java new file mode 100644 index 0000000000..c99bf58e07 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-tours/src/main/java/scatours/IntroducingToursLauncher.java @@ -0,0 +1,51 @@ +/* + * 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.io.IOException; + +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +/** + * This launcher is only used when running from the binaries directory. + * If the binaries directory was built using the mvn -Pselfcontained command, + * it's important to ensure that no dependencies other than those explicitly + * specified by the launcher jar manifest and its transitive dependencies + * are used. This launcher class must therefore avoid using the Tuscany + * NodeLauncher class, because NodeLauncher builds a runtime classpath from + * (among other things) the TUSCANY_HOME environment variable. + */ +public class IntroducingToursLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = + SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/ToursNode"); + node.start(); + + System.out.println("Node started - Press enter to shutdown."); + try { + System.in.read(); + } catch (IOException e) { + } + + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-trips/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-trips/build.xml new file mode 100644 index 0000000000..4059606a08 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-trips/build.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-trips/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-trips/pom.xml new file mode 100644 index 0000000000..341e85f959 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-trips/pom.xml @@ -0,0 +1,86 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-introducing-trips + Apache Tuscany SCA Tours Introducing Trips Launcher + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-sca-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ${scatours.selfContained} + ../lib/ + scatours.IntroducingTripsLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-trips/src/main/java/scatours/IntroducingTripsLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-trips/src/main/java/scatours/IntroducingTripsLauncher.java new file mode 100644 index 0000000000..10dfc242e1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing-trips/src/main/java/scatours/IntroducingTripsLauncher.java @@ -0,0 +1,51 @@ +/* + * 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.io.IOException; + +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +/** + * This launcher is only used when running from the binaries directory. + * If the binaries directory was built using the mvn -Pselfcontained command, + * it's important to ensure that no dependencies other than those explicitly + * specified by the launcher jar manifest and its transitive dependencies + * are used. This launcher class must therefore avoid using the Tuscany + * NodeLauncher class, because NodeLauncher builds a runtime classpath from + * (among other things) the TUSCANY_HOME environment variable. + */ +public class IntroducingTripsLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = + SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/TripsNode"); + node.start(); + + System.out.println("Node started - Press enter to shutdown."); + try { + System.in.read(); + } catch (IOException e) { + } + + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing/build.xml new file mode 100644 index 0000000000..0659e654dd --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing/build.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing/pom.xml new file mode 100644 index 0000000000..02877eac9a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing/pom.xml @@ -0,0 +1,90 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-introducing + Apache Tuscany SCA Tours Introducing Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.IntroducingLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing/src/main/java/scatours/IntroducingLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing/src/main/java/scatours/IntroducingLauncher.java new file mode 100644 index 0000000000..4ad19762d9 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing/src/main/java/scatours/IntroducingLauncher.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 scatours; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +public class IntroducingLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = + SCANodeFactory.newInstance().createSCANode(null, + locate("introducing-tours"), + locate("introducing-trips"), + locate("introducing-client")); + + node.start(); + + Runnable proxy = ((SCAClient)node).getService(Runnable.class, "TestClient/Runnable"); + proxy.run(); + + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing/src/test/java/scatours/IntroducingTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing/src/test/java/scatours/IntroducingTestCase.java new file mode 100644 index 0000000000..573d2e76bd --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/introducing/src/test/java/scatours/IntroducingTestCase.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 scatours; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Test case to run the test code in the introducing-client contribution + * that tests components and services in the introducing-tours contribution + * and the introducing-trips contribution. + */ +public class IntroducingTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = + SCANodeFactory.newInstance() + .createSCANode(null, + new SCAContribution("introducing-tours", + "../../contributions/introducing-tours/target/classes"), + new SCAContribution("introducing-trips", + "../../contributions/introducing-trips/target/classes"), + new SCAContribution("introducing-client", + "../../contributions/introducing-client/target/classes")); + node.start(); + } + + @Test + public void testClient() throws Exception { + Runnable proxy = ((SCAClient)node).getService(Runnable.class, "TestClient/Runnable"); + proxy.run(); + } + + @After + public void stopServer() throws Exception { + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/jumpstart/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/jumpstart/build.xml new file mode 100644 index 0000000000..b7aead4d1c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/jumpstart/build.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/jumpstart/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/jumpstart/pom.xml new file mode 100644 index 0000000000..71b615bc9d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/jumpstart/pom.xml @@ -0,0 +1,79 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-jumpstart + Apache Tuscany SCA Tours Jump Start Launcher + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ${scatours.selfContained} + ../lib/ + scatours.JumpstartLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/jumpstart/src/main/java/scatours/JumpstartLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/jumpstart/src/main/java/scatours/JumpstartLauncher.java new file mode 100644 index 0000000000..e2f0f9da4b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/jumpstart/src/main/java/scatours/JumpstartLauncher.java @@ -0,0 +1,43 @@ +/* + * 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.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +public class JumpstartLauncher { + + public static void main(String[] args) throws Exception { + SCAContribution gvtContribution = new SCAContribution("introducing-trips", + "../../contributions/introducing-trips/target/classes"); + + SCANode node = SCANodeFactory.newInstance().createSCANode("trips.composite", gvtContribution); + + node.start(); + + Trips tripProvider = ((SCAClient)node).getService(Trips.class, "TripProvider/Trips"); + + System.out.println("Trip boooking code = " + tripProvider.checkAvailability("FS1APR4", 1)); + + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/jumpstart/src/main/java/scatours/Trips.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/jumpstart/src/main/java/scatours/Trips.java new file mode 100644 index 0000000000..a7abf8e08d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/jumpstart/src/main/java/scatours/Trips.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 Trips { + String checkAvailability(String trip, int people); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/jumpstart/src/test/java/scatours/JumpstartTestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/jumpstart/src/test/java/scatours/JumpstartTestCase.java new file mode 100644 index 0000000000..4da7c54917 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/jumpstart/src/test/java/scatours/JumpstartTestCase.java @@ -0,0 +1,56 @@ +/* + * 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.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the Jump Start scenario + */ +public class JumpstartTestCase { + + private SCANode node; + + @Before + public void startServer() throws Exception { + node = + SCANodeFactory.newInstance() + .createSCANode("trips.composite", + new SCAContribution("introducing-trips", + "../../contributions/introducing-trips/target/classes")); + node.start(); + } + + @Test + public void testClient() throws Exception { + Trips tripProvider = ((SCAClient)node).getService(Trips.class, "TripProvider/Trips"); + System.out.println("Trip boooking code = " + tripProvider.checkAvailability("FS1APR4", 2)); + } + + @After + public void stopServer() throws Exception { + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-corba/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-corba/build.xml new file mode 100644 index 0000000000..4e9de66cf3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-corba/build.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-corba/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-corba/pom.xml new file mode 100644 index 0000000000..34416b8e13 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-corba/pom.xml @@ -0,0 +1,97 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-notification-corba + Apache Tuscany SCA Tours Notification CORBA Service Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-corba-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-corba-jse-tns + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.NotificationCORBALauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-corba/src/main/java/scatours/NotificationCORBALauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-corba/src/main/java/scatours/NotificationCORBALauncher.java new file mode 100644 index 0000000000..44b94b3a59 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-corba/src/main/java/scatours/NotificationCORBALauncher.java @@ -0,0 +1,54 @@ +/* + * 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 static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import scatours.notification.Notification; + +public class NotificationCORBALauncher { + + public static void main(String[] args) throws Exception { + SCAContribution notificationContribution = locate("notification"); + SCAContribution notificationCORBAContribution = locate("notification-corba"); + + SCANode node = + SCANodeFactory.newInstance().createSCANode("notification-corba.composite", + notificationContribution, + notificationCORBAContribution); + node.start(); + + System.out.println("Quick notification test"); + Notification notification = ((SCAClient)node).getService(Notification.class, "Notification"); + String accountID = "1234"; + String subject = "Holiday payment taken"; + String message = "Payment of £102.37 accepted..."; + notification.notify(accountID, subject, message); + + System.out.println("Node started - Press enter to shutdown."); + System.in.read(); + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-corba/src/main/java/scatours/notification/Notification.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-corba/src/main/java/scatours/notification/Notification.java new file mode 100644 index 0000000000..020e1e40db --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-corba/src/main/java/scatours/notification/Notification.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.notification; + +public interface Notification { + + boolean notify(String accountID, String subject, String message); + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ejb/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ejb/build.xml new file mode 100644 index 0000000000..007afec26a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ejb/build.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ejb/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ejb/pom.xml new file mode 100644 index 0000000000..671d09b246 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ejb/pom.xml @@ -0,0 +1,125 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-notification-ejb + Apache Tuscany SCA Tours Notification EJB Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ejb + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ejb-runtime + ${tuscany.version} + runtime + + + + + + + default + + true + + + + + + + + + + selfcontained + + + ../util/scatours-util-openejb-runtime.jar + + + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar ${openejb-runtime} + + + ${scatours.selfContained} + ../lib/ + scatours.NotificationEJBLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ejb/src/main/java/scatours/NotificationEJBLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ejb/src/main/java/scatours/NotificationEJBLauncher.java new file mode 100644 index 0000000000..2d843e9ff9 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ejb/src/main/java/scatours/NotificationEJBLauncher.java @@ -0,0 +1,59 @@ +/* + * 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 static scatours.launcher.LauncherUtil.locate; + +import javax.naming.Context; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import scatours.notification.Notification; + +public class NotificationEJBLauncher { + + public static void main(String[] args) throws Exception { + System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory"); + System.setProperty(Context.PROVIDER_URL, "ejbd://localhost:4201"); + + SCAContribution notificationContribution = locate("notification"); + SCAContribution notificationEJBContribution = locate("notification-ejb"); + + SCANode node = + SCANodeFactory.newInstance().createSCANode("notification-ejb.composite", + notificationContribution, + notificationEJBContribution); + node.start(); + + System.out.println("Quick notification test"); + Notification notification = ((SCAClient)node).getService(Notification.class, "Notification"); + String accountID = "1234"; + String subject = "Holiday payment taken"; + String message = "Payment of £102.37 accepted..."; + notification.notify(accountID, subject, message); + + System.out.println("Node started - Press enter to shutdown."); + System.in.read(); + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ejb/src/main/java/scatours/notification/Notification.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ejb/src/main/java/scatours/notification/Notification.java new file mode 100644 index 0000000000..020e1e40db --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ejb/src/main/java/scatours/notification/Notification.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.notification; + +public interface Notification { + + boolean notify(String accountID, String subject, String message); + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-jms/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-jms/build.xml new file mode 100644 index 0000000000..a76cb4ac88 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-jms/build.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-jms/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-jms/pom.xml new file mode 100644 index 0000000000..b83a7d24cb --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-jms/pom.xml @@ -0,0 +1,103 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-notification-jms + Apache Tuscany SCA Tours Notification JMS Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jms-asf + ${tuscany.version} + runtime + + + + org.apache.activemq + activemq-all + 5.2.0 + + + org.apache.activemq + activemq-web-demo + + + runtime + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.NotificationJMSLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-jms/src/main/java/scatours/NotificationJMSLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-jms/src/main/java/scatours/NotificationJMSLauncher.java new file mode 100644 index 0000000000..c2ffda0725 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-jms/src/main/java/scatours/NotificationJMSLauncher.java @@ -0,0 +1,56 @@ +/* + * 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 static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import scatours.notification.Notification; + +public class NotificationJMSLauncher { + + public static void main(String[] args) throws Exception { + SCAContribution notificationContribution = locate("notification"); + SCAContribution notificationJMSContribution = locate("notification-jms"); + + SCANode node = + SCANodeFactory.newInstance().createSCANode("notification-jms.composite", + notificationContribution, + notificationJMSContribution); + + try { + node.start(); + + System.out.println("Quick notification test"); + Notification notification = ((SCAClient)node).getService(Notification.class, "Notification"); + String accountID = "1234"; + String subject = "Holiday payment taken"; + String message = "Payment of £102.37 accepted..."; + notification.notify(accountID, subject, message); + System.out.println("Notification sent"); + } finally { + node.stop(); + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-jms/src/main/java/scatours/notification/Notification.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-jms/src/main/java/scatours/notification/Notification.java new file mode 100644 index 0000000000..020e1e40db --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-jms/src/main/java/scatours/notification/Notification.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.notification; + +public interface Notification { + + boolean notify(String accountID, String subject, String message); + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-rmi/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-rmi/build.xml new file mode 100644 index 0000000000..f563ced833 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-rmi/build.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-rmi/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-rmi/pom.xml new file mode 100644 index 0000000000..61ceef8d9d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-rmi/pom.xml @@ -0,0 +1,97 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-notification-rmi + Apache Tuscany SCA Tours Notification RMI Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-rmi + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-rmi-runtime + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.NotificationRMILauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java new file mode 100644 index 0000000000..4ce528fd23 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java @@ -0,0 +1,30 @@ +/* + * 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 com.tuscanyscatours.smsgateway; + +import java.rmi.Remote; +import java.rmi.RemoteException; + +/** + * A gateway to send SMS messages. + */ +public interface SMSGateway extends Remote { + boolean sendSMS(String fromNumber, String toNumber, String text) throws RemoteException; +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-rmi/src/main/java/scatours/NotificationRMILauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-rmi/src/main/java/scatours/NotificationRMILauncher.java new file mode 100644 index 0000000000..2904349a49 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-rmi/src/main/java/scatours/NotificationRMILauncher.java @@ -0,0 +1,54 @@ +/* + * 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 static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import scatours.notification.Notification; + +public class NotificationRMILauncher { + + public static void main(String[] args) throws Exception { + SCAContribution notificationContribution = locate("notification"); + SCAContribution notificationRMIContribution = locate("notification-rmi"); + + SCANode node = + SCANodeFactory.newInstance().createSCANode("notification-rmi.composite", + notificationContribution, + notificationRMIContribution); + node.start(); + + System.out.println("Quick notification test"); + Notification notification = ((SCAClient)node).getService(Notification.class, "Notification"); + String accountID = "1234"; + String subject = "Holiday payment taken"; + String message = "Payment of £102.37 accepted..."; + notification.notify(accountID, subject, message); + + System.out.println("Node started - Press enter to shutdown."); + System.in.read(); + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-rmi/src/main/java/scatours/notification/Notification.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-rmi/src/main/java/scatours/notification/Notification.java new file mode 100644 index 0000000000..020e1e40db --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-rmi/src/main/java/scatours/notification/Notification.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.notification; + +public interface Notification { + + boolean notify(String accountID, String subject, String message); + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ws/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ws/build.xml new file mode 100644 index 0000000000..800c79a9aa --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ws/build.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ws/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ws/pom.xml new file mode 100644 index 0000000000..a011b5dac5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ws/pom.xml @@ -0,0 +1,97 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-notification-ws + Apache Tuscany SCA Tours Notification Web Service Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-tomcat + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.NotificationWSLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ws/src/main/java/scatours/NotificationWSLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ws/src/main/java/scatours/NotificationWSLauncher.java new file mode 100644 index 0000000000..fbdb1500f5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ws/src/main/java/scatours/NotificationWSLauncher.java @@ -0,0 +1,54 @@ +/* + * 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 static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import scatours.notification.Notification; + +public class NotificationWSLauncher { + + public static void main(String[] args) throws Exception { + SCAContribution notificationContribution = locate("notification"); + SCAContribution notificationWSContribution = locate("notification-ws"); + + SCANode node = + SCANodeFactory.newInstance().createSCANode("notification-ws.composite", + notificationContribution, + notificationWSContribution); + node.start(); + + System.out.println("Quick notification test"); + Notification notification = ((SCAClient)node).getService(Notification.class, "Notification"); + String accountID = "1234"; + String subject = "Holiday payment taken"; + String message = "Payment of £102.37 accepted..."; + notification.notify(accountID, subject, message); + + System.out.println("Node started - Press enter to shutdown."); + System.in.read(); + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ws/src/main/java/scatours/notification/Notification.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ws/src/main/java/scatours/notification/Notification.java new file mode 100644 index 0000000000..020e1e40db --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/notification-ws/src/main/java/scatours/notification/Notification.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.notification; + +public interface Notification { + + boolean notify(String accountID, String subject, String message); + +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-bpel/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-bpel/build.xml new file mode 100644 index 0000000000..fe23152b32 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-bpel/build.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-bpel/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-bpel/pom.xml new file mode 100644 index 0000000000..f6d10ec89b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-bpel/pom.xml @@ -0,0 +1,184 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-payment-bpel + Apache Tuscany SCA Tours Payment BPEL Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-bpel-ode + ${tuscany.version} + runtime + + + + + commons-logging + commons-logging + 1.1.1 + + + javax.servlet + servlet-api + + + avalon-framework + avalon-framework + + + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + wsimport + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/payment.stale + false + true + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar ../ode/ + + + ${scatours.selfContained} + ../lib/ + scatours.payment.PaymentLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-bpel/src/main/java/scatours/payment/PaymentLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-bpel/src/main/java/scatours/payment/PaymentLauncher.java new file mode 100644 index 0000000000..45df91a5e9 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-bpel/src/main/java/scatours/payment/PaymentLauncher.java @@ -0,0 +1,53 @@ +/* + * 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.payment; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-bpel-process"), + locate("payment-bpel"), + locate("creditcard-payment-jaxb"), + locate("emailgateway")); + node.start(); + + SCAClient client = (SCAClient)node; + Payment payment = client.getService(Payment.class, "Payment/paymentPartnerLink"); + + System.out.println("Payment BPEL test"); + System.out.println("\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f)); + System.out.println("\n\nFailed Payment - Status = \n\n" + payment.makePaymentMember("c-1", 100.00f)); + + node.stop(); + + // The following line is a workaround for TUSCANY-3475 when running + // on Tuscany SCA 1.6 (the JVM waits for 60 seconds before exiting). + System.exit(0); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-bpel/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-bpel/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..f5539f57fa --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-bpel/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-groovy/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-groovy/build.xml new file mode 100644 index 0000000000..37822524d4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-groovy/build.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-groovy/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-groovy/pom.xml new file mode 100644 index 0000000000..f063d22f4e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-groovy/pom.xml @@ -0,0 +1,185 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-payment-groovy + Apache Tuscany SCA Tours Payment Groovy Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-script + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + wsimport + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/payment.stale + false + true + + + + + emailgateway + process-sources + + wsimport + + + com.tuscanyscatours.emailgateway + ${basedir}/src/main/resources + + EmailGateway.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/emailgateway.stale + false + true + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.payment.PaymentLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-groovy/src/main/java/scatours/payment/PaymentLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-groovy/src/main/java/scatours/payment/PaymentLauncher.java new file mode 100644 index 0000000000..aec88c0c6f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-groovy/src/main/java/scatours/payment/PaymentLauncher.java @@ -0,0 +1,46 @@ +/* + * 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.payment; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-groovy"), + locate("emailgateway")); + node.start(); + + SCAClient client = (SCAClient)node; + Payment payment = client.getService(Payment.class, "Payment"); + + System.out.println("Payment Groovy test"); + System.out.println("\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f)); + + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-groovy/src/main/resources/EmailGateway.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-groovy/src/main/resources/EmailGateway.wsdl new file mode 100644 index 0000000000..af296f4a1f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-groovy/src/main/resources/EmailGateway.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-groovy/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-groovy/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..f5539f57fa --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-groovy/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-callback/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-callback/build.xml new file mode 100644 index 0000000000..4731586cc5 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-callback/build.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-callback/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-callback/pom.xml new file mode 100644 index 0000000000..643838e65c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-callback/pom.xml @@ -0,0 +1,159 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-payment-java-callback + Apache Tuscany SCA Tours Payment Java Callback Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + wsimport + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/payment.stale + false + true + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.payment.PaymentLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-callback/src/main/java/scatours/payment/PaymentLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-callback/src/main/java/scatours/payment/PaymentLauncher.java new file mode 100644 index 0000000000..41f78e4109 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-callback/src/main/java/scatours/payment/PaymentLauncher.java @@ -0,0 +1,73 @@ +/* + * 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.payment; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-java-callback")); + node.start(); + + SCAClient client = (SCAClient)node; + Payment payment1 = client.getService(Payment.class, "Payment1"); + Payment payment2 = client.getService(Payment.class, "Payment2"); + Payment paymentConfirm = client.getService(Payment.class, "PaymentConfirm"); + Payment paymentCallbackID = client.getService(Payment.class, "PaymentCallbackID"); + Payment paymentCallbackRedirect = client.getService(Payment.class, "PaymentCallbackRedirect"); + + System.out.println("==================================================="); + System.out.println("\n\nPayment1 under limit - Status = \n\n" + payment1.makePaymentMember("c-0", 100.00f)); + System.out.println("==================================================="); + System.out.println("\n\nPayment2 under limit - Status = \n\n" + payment2.makePaymentMember("c-0", 100.00f)); + System.out.println("==================================================="); + System.out.println("\n\nPayment1 over limit - Status = \n\n" + payment1.makePaymentMember("c-0", 1500.00f)); + System.out.println("==================================================="); + System.out.println("\n\nPayment2 over limit - Status = \n\n" + payment2.makePaymentMember("c-0", 1500.00f)); + System.out.println("==================================================="); + System.out.println("\n\nPayment2 using request context - Status = \n\n" + payment2.makePaymentMember("c-0", 20000.00f)); + System.out.println("==================================================="); + System.out.println("\n\nPaymentConfirm - Status = \n\n" + paymentConfirm.makePaymentMember("c-0", 20000.00f)); + System.out.println("==================================================="); + + // wait for longer that the asynch payment processing waits. + try { + Thread.sleep(2000); + } catch (Exception ex) { + // do nothing + } + + System.out.println("==================================================="); + System.out.println("\n\nPaymentCallbackID - Status = \n\n" + paymentCallbackID.makePaymentMember("c-0", 20000.00f)); + System.out.println("==================================================="); + System.out.println("\n\nPaymentCallbackRedirect - Status = \n\n" + paymentCallbackRedirect.makePaymentMember("c-0", 20000.00f)); + System.out.println("==================================================="); + + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-callback/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-callback/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..f5539f57fa --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-callback/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-policy/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-policy/build.xml new file mode 100644 index 0000000000..df2896ff11 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-policy/build.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-policy/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-policy/pom.xml new file mode 100644 index 0000000000..b4d3a0fa5d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-policy/pom.xml @@ -0,0 +1,159 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-payment-java-policy + Apache Tuscany SCA Tours Payment Java Policy Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + wsimport + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/payment.stale + false + true + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.payment.PaymentLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-policy/src/main/java/scatours/payment/PaymentLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-policy/src/main/java/scatours/payment/PaymentLauncher.java new file mode 100644 index 0000000000..e5bd98ff2b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-policy/src/main/java/scatours/payment/PaymentLauncher.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.payment; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-java-policy"), + locate("creditcard-payment-jaxb-policy")); + node.start(); + + SCAClient client = (SCAClient)node; + Payment payment = client.getService(Payment.class, "Payment"); + + System.out.println("Payment Java Policy test"); + System.out.println("\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f)); + System.out.println("\n\nFailed Payment - Status = \n\n" + payment.makePaymentMember("c-1", 100.00f)); + + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-policy/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-policy/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..f5539f57fa --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-policy/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-reference-pass/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-reference-pass/build.xml new file mode 100644 index 0000000000..6263634fbb --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-reference-pass/build.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-reference-pass/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-reference-pass/pom.xml new file mode 100644 index 0000000000..61f1a0df25 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-reference-pass/pom.xml @@ -0,0 +1,159 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-payment-java-reference-pass + Apache Tuscany SCA Tours Payment Java Reference Pass Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + wsimport + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/payment.stale + false + true + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.payment.PaymentLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-reference-pass/src/main/java/scatours/payment/PaymentLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-reference-pass/src/main/java/scatours/payment/PaymentLauncher.java new file mode 100644 index 0000000000..5385eb342e --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-reference-pass/src/main/java/scatours/payment/PaymentLauncher.java @@ -0,0 +1,46 @@ +/* + * 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.payment; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-java-reference-pass")); + node.start(); + + SCAClient client = (SCAClient)node; + Payment payment = client.getService(Payment.class, "Payment"); + + System.out.println("==================================================="); + System.out.println("\n\nPayment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f)); + System.out.println("==================================================="); + + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-reference-pass/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-reference-pass/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..f5539f57fa --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java-reference-pass/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java/build.xml new file mode 100644 index 0000000000..142a922fa0 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java/build.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java/pom.xml new file mode 100644 index 0000000000..f64b7e2615 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java/pom.xml @@ -0,0 +1,159 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-payment-java + Apache Tuscany SCA Tours Payment Java Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + wsimport + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/payment.stale + false + true + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.payment.PaymentLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java/src/main/java/scatours/payment/PaymentLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java/src/main/java/scatours/payment/PaymentLauncher.java new file mode 100644 index 0000000000..8d5cc8765d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java/src/main/java/scatours/payment/PaymentLauncher.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.payment; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-java"), + locate("creditcard-payment-jaxb")); + node.start(); + + SCAClient client = (SCAClient)node; + Payment payment = client.getService(Payment.class, "Payment"); + + System.out.println("Payment Java test"); + System.out.println("\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f)); + System.out.println("\n\nFailed Payment - Status = \n\n" + payment.makePaymentMember("c-1", 100.00f)); + + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..f5539f57fa --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-java/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-python/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-python/build.xml new file mode 100644 index 0000000000..3129ae70c7 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-python/build.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-python/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-python/pom.xml new file mode 100644 index 0000000000..4eedc7d8f1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-python/pom.xml @@ -0,0 +1,185 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-payment-python + Apache Tuscany SCA Tours Payment Python Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-script + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + wsimport + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/payment.stale + false + true + + + + + emailgateway + process-sources + + wsimport + + + com.tuscanyscatours.emailgateway + ${basedir}/src/main/resources + + EmailGateway.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/emailgateway.stale + false + true + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.payment.PaymentLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-python/src/main/java/scatours/payment/PaymentLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-python/src/main/java/scatours/payment/PaymentLauncher.java new file mode 100644 index 0000000000..190d1eb42b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-python/src/main/java/scatours/payment/PaymentLauncher.java @@ -0,0 +1,46 @@ +/* + * 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.payment; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-python"), + locate("emailgateway")); + node.start(); + + SCAClient client = (SCAClient)node; + Payment payment = client.getService(Payment.class, "Payment"); + + System.out.println("Payment Python test"); + System.out.println("\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f)); + + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-python/src/main/resources/EmailGateway.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-python/src/main/resources/EmailGateway.wsdl new file mode 100644 index 0000000000..af296f4a1f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-python/src/main/resources/EmailGateway.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-python/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-python/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..f5539f57fa --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-python/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring-scatag/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring-scatag/build.xml new file mode 100644 index 0000000000..bb2b83890a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring-scatag/build.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring-scatag/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring-scatag/pom.xml new file mode 100644 index 0000000000..9ec99da750 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring-scatag/pom.xml @@ -0,0 +1,173 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-payment-spring-scatag + Apache Tuscany SCA Tours Payment Spring SCATag Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-spring + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-spring-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + wsimport + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/payment.stale + false + true + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.payment.PaymentLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring-scatag/src/main/java/scatours/payment/PaymentLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring-scatag/src/main/java/scatours/payment/PaymentLauncher.java new file mode 100644 index 0000000000..5760fe0d72 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring-scatag/src/main/java/scatours/payment/PaymentLauncher.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.payment; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-spring-scatag"), + locate("creditcard-payment-jaxb")); + node.start(); + + SCAClient client = (SCAClient)node; + Payment payment = client.getService(Payment.class, "Payment/Payment"); + + System.out.println("Payment Spring SCATag test"); + System.out.println("\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f)); + System.out.println("\n\nFailed Payment - Status = \n\n" + payment.makePaymentMember("c-1", 100.00f)); + + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring-scatag/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring-scatag/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..f5539f57fa --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring-scatag/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring/build.xml new file mode 100644 index 0000000000..0a88cf16b4 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring/build.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring/pom.xml new file mode 100644 index 0000000000..b6043f7b0b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring/pom.xml @@ -0,0 +1,173 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-payment-spring + Apache Tuscany SCA Tours Payment Spring Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + javax.xml.bind + jaxb-api + 2.1 + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-spring + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-spring-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.codehaus.mojo + build-helper-maven-plugin + 1.0 + + + add-source + generate-sources + + add-source + + + + target/jaxws-source + + + + + + + org.codehaus.mojo + jaxws-maven-plugin + 1.12 + + + wsimport + generate-sources + + wsimport + + + com.tuscanyscatours.payment + ${basedir}/src/main/resources + + Payment.wsdl + + ${project.build.directory}/jaxws-source + ${project.build.directory}/jaxws-source/stale/payment.stale + false + true + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.payment.PaymentLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring/src/main/java/scatours/payment/PaymentLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring/src/main/java/scatours/payment/PaymentLauncher.java new file mode 100644 index 0000000000..6917b9c57b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring/src/main/java/scatours/payment/PaymentLauncher.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.payment; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-spring"), + locate("creditcard-payment-jaxb")); + node.start(); + + SCAClient client = (SCAClient)node; + Payment payment = client.getService(Payment.class, "Payment/Payment"); + + System.out.println("Payment Spring test"); + System.out.println("\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f)); + System.out.println("\n\nFailed Payment - Status = \n\n" + payment.makePaymentMember("c-1", 100.00f)); + + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring/src/main/resources/Payment.wsdl new file mode 100644 index 0000000000..f5539f57fa --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/payment-spring/src/main/resources/Payment.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/policy/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/policy/build.xml new file mode 100644 index 0000000000..847e0ac3a8 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/policy/build.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/policy/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/policy/pom.xml new file mode 100644 index 0000000000..d6246f6b37 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/policy/pom.xml @@ -0,0 +1,111 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-policy + Apache Tuscany SCA Tours Policy Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-policy-security + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-policy-logging + ${tuscany.version} + runtime + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.PolicyLauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/policy/src/main/java/scatours/PolicyLauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/policy/src/main/java/scatours/PolicyLauncher.java new file mode 100644 index 0000000000..115d747ede --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/policy/src/main/java/scatours/PolicyLauncher.java @@ -0,0 +1,51 @@ +/* + * 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 static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +public class PolicyLauncher { + + public static void main(String[] args) throws Exception { + SCANode node1 = + SCANodeFactory.newInstance().createSCANode(null, + locate("common"), + locate("policy-client"), + locate("payment-java-policy"), + locate("trip-policy")); + + node1.start(); + + SCANode node2 = SCANodeFactory.newInstance().createSCANode(null, + locate("creditcard-payment-jaxb-policy")); + + node2.start(); + + Runnable client = ((SCAClient)node1).getService(Runnable.class, "TestClient/Runnable"); + client.run(); + + node1.stop(); + node2.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/pom.xml new file mode 100644 index 0000000000..58b035b908 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/pom.xml @@ -0,0 +1,71 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../pom.xml + + scatours-launchers + pom + Apache Tuscany SCA Tours Launchers + + + blog-feed + buildingblocks + currency-converter + currency-converter-corba + currency-converter-jms + currency-converter-rmi + currency-converter-ws + databinding + feed-logger + interaction + introducing + introducing-client + introducing-domain + introducing-tours + introducing-trips + jumpstart + fullapp + fullapp-domain + fullapp-nodes + help-pages + notification-ws + notification-corba + notification-ejb + notification-jms + notification-rmi + payment-java + payment-java-callback + payment-java-policy + payment-java-reference-pass + payment-spring + payment-spring-scatag + payment-bpel + payment-groovy + payment-python + policy + usingsca + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/usingsca/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/usingsca/build.xml new file mode 100644 index 0000000000..0437ba0b45 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/usingsca/build.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/usingsca/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/usingsca/pom.xml new file mode 100644 index 0000000000..b31e9df547 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/usingsca/pom.xml @@ -0,0 +1,138 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-launcher-usingsca + Apache Tuscany SCA Tours Using SCA Components Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.activemq + activemq-all + 5.2.0 + + + org.apache.activemq + activemq-web-demo + + + runtime + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jms-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jms-asf + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ejb-runtime + ${tuscany.version} + runtime + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + ${scatours.selfContained} + ../lib/ + scatours.UsingSCALauncher + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/usingsca/src/main/java/scatours/UsingSCALauncher.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/usingsca/src/main/java/scatours/UsingSCALauncher.java new file mode 100644 index 0000000000..2c0f817e84 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/usingsca/src/main/java/scatours/UsingSCALauncher.java @@ -0,0 +1,208 @@ +/* + * 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.apache.activemq.broker.BrokerService; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import static scatours.launcher.LauncherUtil.locate; + +public class UsingSCALauncher { + + public static void main(String[] args) throws Exception { + runAirportCodes(); + runBindings(); + runCarAutowire(); + runCarPartner(); + runCarWireElement(); + runComplexPropertyElement(); + runComplexPropertyType(); + runCurrencyConverter(); + runMultiDomain(); + runTripAutowire(); + runTripBooking(); + runTripWireElement(); + } + + private static void runAirportCodes() throws Exception { + SCANode node = + SCANodeFactory.newInstance().createSCANode("test-clients/airportcodes-client.composite", + locate("usingsca")); + + node.start(); + + Runnable client = ((SCAClient)node).getService(Runnable.class, "AirportCodesClient"); + client.run(); + + node.stop(); + } + + private static void runBindings() throws Exception { + SCANode node = + SCANodeFactory.newInstance().createSCANode("test-clients/bookings4-client.composite", + locate("usingsca")); + + node.start(); + + Runnable client = ((SCAClient)node).getService(Runnable.class, "Bookings4Client"); + client.run(); + + node.stop(); + } + + private static void runCarAutowire() throws Exception { + SCANode node = + SCANodeFactory.newInstance().createSCANode("test-clients/carbookings3-client.composite", + locate("usingsca")); + + node.start(); + + Runnable client = ((SCAClient)node).getService(Runnable.class, "CarBookings3Client"); + client.run(); + + node.stop(); + } + + private static void runCarPartner() throws Exception { + SCANode node = + SCANodeFactory.newInstance().createSCANode("test-clients/carbookings1-client.composite", + locate("usingsca")); + + node.start(); + + Runnable client = ((SCAClient)node).getService(Runnable.class, "CarBookings1Client"); + client.run(); + + node.stop(); + } + + private static void runCarWireElement() throws Exception { + SCANode node = + SCANodeFactory.newInstance().createSCANode("test-clients/carbookings2-client.composite", + locate("usingsca")); + + node.start(); + + Runnable client = ((SCAClient)node).getService(Runnable.class, "CarBookings2Client"); + client.run(); + + node.stop(); + } + + private static void runComplexPropertyElement() throws Exception { + SCANode node = + SCANodeFactory.newInstance().createSCANode("test-clients/orders1-client.composite", + locate("usingsca")); + + node.start(); + + Runnable client = ((SCAClient)node).getService(Runnable.class, "Orders1Client"); + client.run(); + + node.stop(); + } + + private static void runComplexPropertyType() throws Exception { + SCANode node = + SCANodeFactory.newInstance().createSCANode("test-clients/orders2-client.composite", + locate("usingsca")); + + node.start(); + + Runnable client = ((SCAClient)node).getService(Runnable.class, "Orders2Client"); + client.run(); + + node.stop(); + } + + private static void runCurrencyConverter() throws Exception { + SCANode node = + SCANodeFactory.newInstance().createSCANode("test-clients/converter-client.composite", + locate("usingsca")); + + node.start(); + + Runnable client = ((SCAClient)node).getService(Runnable.class, "ConverterClient"); + client.run(); + + node.stop(); + } + + private static void runMultiDomain() throws Exception { + SCANode hotelsNode = + SCANodeFactory.newInstance().createSCANode("test-clients/hotelsdomain-client.composite", + locate("usingsca")); + SCANode toursNode = + SCANodeFactory.newInstance().createSCANode("test-clients/toursdomain-client.composite", + locate("usingsca")); + + hotelsNode.start(); + toursNode.start(); + + Runnable hotelsClient = ((SCAClient)hotelsNode).getService(Runnable.class, "HotelsDomainClient"); + hotelsClient.run(); + Runnable toursClient = ((SCAClient)toursNode).getService(Runnable.class, "ToursDomainClient"); + toursClient.run(); + + toursNode.stop(); + hotelsNode.stop(); + } + + private static void runTripAutowire() throws Exception { + SCANode node = + SCANodeFactory.newInstance().createSCANode("test-clients/bookings3-client.composite", + locate("usingsca")); + + node.start(); + + Runnable client = ((SCAClient)node).getService(Runnable.class, "Bookings3Client"); + client.run(); + + node.stop(); + } + + private static void runTripBooking() throws Exception { + SCANode node = + SCANodeFactory.newInstance().createSCANode("test-clients/bookings1-client.composite", + locate("usingsca")); + + node.start(); + + Runnable client = ((SCAClient)node).getService(Runnable.class, "Bookings1Client"); + client.run(); + + node.stop(); + } + + private static void runTripWireElement() throws Exception { + SCANode node = + SCANodeFactory.newInstance().createSCANode("test-clients/bookings2-client.composite", + locate("usingsca")); + + node.start(); + + Runnable client = ((SCAClient)node).getService(Runnable.class, "Bookings2Client"); + client.run(); + + node.stop(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/usingsca/src/main/resources/jndi.properties b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/usingsca/src/main/resources/jndi.properties new file mode 100644 index 0000000000..80236a8e6c --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/usingsca/src/main/resources/jndi.properties @@ -0,0 +1,38 @@ +## --------------------------------------------------------------------------- +## 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. +## --------------------------------------------------------------------------- + +# START SNIPPET: jndi + +java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory + +# use the following property to configure the default connector +java.naming.provider.url = vm://localhost?broker.persistent=false + +# use the following property to specify the JNDI name the connection factory +# should appear as. +#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry +connectionFactoryNames = ConnectionFactory + +# register some queues in JNDI using the form +# queue.[jndiName] = [physicalName] +queue.Bookings = BookingsRequestQueue + +# register some topics in JNDI using the form +# topic.[jndiName] = [physicalName] +#topic.MyTopic = example.MyTopic + +# END SNIPPET: jndi diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/usingsca/src/test/java/scatours/UsingSCATestCase.java b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/usingsca/src/test/java/scatours/UsingSCATestCase.java new file mode 100644 index 0000000000..7cbbc6bc2d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/launchers/usingsca/src/test/java/scatours/UsingSCATestCase.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 scatours; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the launcher + */ +public class UsingSCATestCase { + + @Before + public void startServer() throws Exception { + } + + @Test + public void testLauncher() throws Exception { + UsingSCALauncher.main(null); + } + + @After + public void stopServer() throws Exception { + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/pom.xml new file mode 100644 index 0000000000..a4409ed955 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/pom.xml @@ -0,0 +1,110 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.6 + + scatours + pom + 1.0 + Apache Tuscany SCA Tours Travel Sample + + + + maven.central + http://repo2.maven.org/maven2 + + true + + + false + + + + java.net + java.net Maven 1.x Repository + http://download.java.net/maven/1 + legacy + + false + + + + java.net2 + java.net Maven 2.x Repository + http://download.java.net/maven/2 + + false + + + + + + + java.net2 + java.net Maven 2.x Repository + http://download.java.net/maven/2 + + false + + + + + + + + default + + true + + + false + + + + + + selfcontained + + true + + + + + + 1.6 + + + + util + contributions + domainconfig + launchers + services + clients + binaries + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/services/build.xml new file mode 100644 index 0000000000..326563e763 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/build.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/services/pom.xml new file mode 100644 index 0000000000..48e05367af --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/pom.xml @@ -0,0 +1,40 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../pom.xml + + scatours-services + pom + Apache Tuscany SCA Tours non-SCA Services + + + smsgateway-jaxws + smsgateway-corba + smsgateway-ejb + smsgateway-jms + smsgateway-rmi + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-corba/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-corba/build.xml new file mode 100644 index 0000000000..0495e2b956 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-corba/build.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-corba/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-corba/pom.xml new file mode 100644 index 0000000000..36e70fff1f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-corba/pom.xml @@ -0,0 +1,76 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-service-smsgateway-corba + Apache Tuscany SCA Tours SMS Gateway CORBA Service + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ${scatours.selfContained} + ../lib/ + scatours.smsgateway.SMSGatewayCORBAServiceBootstrap + + + + + + org.codehaus.mojo + idlj-maven-plugin + 1.1 + + + + generate + + + + + idlj + + + + sms-gateway.idl + + true + true + false + + + ${basedir}/src/main/resources + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-corba/src/main/java/scatours/smsgateway/SMSGatewayCORBAServiceBootstrap.java b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-corba/src/main/java/scatours/smsgateway/SMSGatewayCORBAServiceBootstrap.java new file mode 100644 index 0000000000..9a53303e88 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-corba/src/main/java/scatours/smsgateway/SMSGatewayCORBAServiceBootstrap.java @@ -0,0 +1,105 @@ +/* + * 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.smsgateway; + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; + +import org.omg.CORBA.ORB; +import org.omg.CORBA.Object; +import org.omg.CosNaming.NameComponent; +import org.omg.CosNaming.NamingContextExt; +import org.omg.CosNaming.NamingContextExtHelper; +import org.omg.PortableServer.POA; +import org.omg.PortableServer.POAHelper; + +public class SMSGatewayCORBAServiceBootstrap { + + public static void main(String[] args) throws Exception { + String home = System.getProperty("java.home"); + String[] tnsCommand = {"" + home + "/bin/tnameserv", "-ORBInitialPort", "5080"}; + Process tns = null; + + try { + System.out.println("Starting transient name server process (port=5080)"); + + // Start tnameserv in a separate process + tns = Runtime.getRuntime().exec(tnsCommand); + + // Wait for the tnameserv process to complete its startup, and + // display the output from the tnameserv process on the console + InputStream tnsOut = tns.getInputStream(); + BufferedReader tnsOutReader = new BufferedReader(new InputStreamReader(tnsOut)); + while (true) { + String line = tnsOutReader.readLine(); + System.out.println("tnameserv: " + line); + if ("Ready.".equals(line)) { + break; + } + } + + System.out.println("Publishing SMS Gateway Service as a CORBA service: SMSGatewayCORBAService (port=5080)"); + + String[] orbArgs = {"-ORBInitialPort", "5080"}; + ORB orb = ORB.init(orbArgs, null); + + NamingContextExt namingCtx; + try { + Object objRef = orb.resolve_initial_references("NameService"); + namingCtx = NamingContextExtHelper.narrow(objRef); + } catch (Exception ex) { + System.err.println("ERROR: Failed to resolve Name Service."); + //System.err.println("Don't forget to run it with:"); + //System.err.println(" tnameserv -ORBInitialPort 5080"); + return; + } + + Object rootPoaRef = orb.resolve_initial_references("RootPOA"); + POA rootPoa = POAHelper.narrow(rootPoaRef); + rootPoa.the_POAManager().activate(); + + SMSGatewayServant smsGateway = new SMSGatewayServant(); + Object smsGatewayRef = rootPoa.servant_to_reference(smsGateway); + + String corbaServerName = "SMSGatewayCORBAService"; + NameComponent[] name = {new NameComponent(corbaServerName, "")}; + namingCtx.rebind(name, smsGatewayRef); + + System.out.println("CORBA server running - press Enter to shutdown"); + System.in.read(); + + orb.shutdown(true); + orb.destroy(); + + } finally { + // Make sure that the tnameserv process gets destroyed and its + // listener port is released + if (tns != null) { + System.out.println("Destroying transient name server process"); + try { + tns.destroy(); + System.out.println("Transient name server process destroyed"); + } catch (Exception e) { + // ignore + } + } + } + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-corba/src/main/java/scatours/smsgateway/SMSGatewayServant.java b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-corba/src/main/java/scatours/smsgateway/SMSGatewayServant.java new file mode 100644 index 0000000000..693a909dca --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-corba/src/main/java/scatours/smsgateway/SMSGatewayServant.java @@ -0,0 +1,30 @@ +/* + * 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.smsgateway; + +public class SMSGatewayServant extends SMSGatewayPOA { + + public boolean sendSMS(String fromNumber, String toNumber, String text) { + System.out.println("Sending SMS message"); + System.out.println("From: " + fromNumber); + System.out.println("To: " + toNumber); + System.out.println("Message: " + text); + return true; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-corba/src/main/resources/sms-gateway.idl b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-corba/src/main/resources/sms-gateway.idl new file mode 100644 index 0000000000..30a87f5c7a --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-corba/src/main/resources/sms-gateway.idl @@ -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. + */ + + module scatours { + module smsgateway { + interface SMSGateway { + boolean sendSMS(in string fromNumber, in string toNumber, in string text); + }; + }; +}; diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/build.xml new file mode 100644 index 0000000000..be1d774335 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/build.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/pom.xml new file mode 100644 index 0000000000..e50176d525 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/pom.xml @@ -0,0 +1,58 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-service-smsgateway-ejb + Apache Tuscany SCA Tours SMS Gateway EJB Service + + + + org.apache.openejb + javaee-api + 5.0-2 + provided + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-openejb-runtime.jar + com.tuscanyscatours.smsgateway.SMSGatewayEJBServiceBootstrap + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java new file mode 100644 index 0000000000..b462dd1be8 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java @@ -0,0 +1,30 @@ +/* + * 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 com.tuscanyscatours.smsgateway; + +import javax.ejb.Remote; + +/** + * A gateway to send SMS messages. + */ +@Remote +public interface SMSGateway { + boolean sendSMS(String fromNumber, String toNumber, String text); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayEJBServiceBootstrap.java b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayEJBServiceBootstrap.java new file mode 100644 index 0000000000..4da784bc55 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayEJBServiceBootstrap.java @@ -0,0 +1,45 @@ +/* + * 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 com.tuscanyscatours.smsgateway; + +import java.util.Properties; + +import javax.naming.Context; +import javax.naming.InitialContext; + +public class SMSGatewayEJBServiceBootstrap { + + public static void main(String[] args) throws Exception { + System.out.println("Publishing SMS Gateway Service as an EJB service"); + + Properties properties = new Properties(); + properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory"); + properties.setProperty("openejb.embedded.remotable", "true"); + + InitialContext initialContext = new InitialContext(properties); + + // Object object = initialContext.lookup("SMSGatewayImplRemote"); + // SMSGateway smsGateway = (SMSGateway) object; + // smsGateway.sendSMS("From", "to", "Message"); + + System.out.println("EJB server running - waiting for requests"); + System.out.println("Press enter to shutdown."); + System.in.read(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayImpl.java new file mode 100644 index 0000000000..3bdf48a7ea --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayImpl.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 com.tuscanyscatours.smsgateway; + +import javax.ejb.Stateless; + +@Stateless +public class SMSGatewayImpl implements SMSGateway { + + public boolean sendSMS(String fromNumber, String toNumber, String text) { + System.out.println("Sending SMS message"); + System.out.println("From: " + fromNumber); + System.out.println("To: " + toNumber); + System.out.println("Message: " + text); + return true; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/src/main/resources/META-INF/ejb-jar.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/src/main/resources/META-INF/ejb-jar.xml new file mode 100644 index 0000000000..1dae371cdc --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-ejb/src/main/resources/META-INF/ejb-jar.xml @@ -0,0 +1,20 @@ + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jaxws/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jaxws/build.xml new file mode 100644 index 0000000000..bdbf07c42f --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jaxws/build.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jaxws/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jaxws/pom.xml new file mode 100644 index 0000000000..019e7f5527 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jaxws/pom.xml @@ -0,0 +1,63 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-service-smsgateway-jaxws + Apache Tuscany SCA Tours SMS Gateway JAX-WS Service + + + + javax.xml.ws + jaxws-api + 2.1 + + + javax.xml.soap + saaj-api + + + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-jaxws-runtime.jar + com.tuscanyscatours.smsgateway.SMSGatewayServiceBootstrap + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayService.java b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayService.java new file mode 100644 index 0000000000..696ab12daa --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayService.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 com.tuscanyscatours.smsgateway; + +import javax.jws.WebMethod; +import javax.jws.WebService; +import javax.jws.soap.SOAPBinding; +import javax.jws.soap.SOAPBinding.Style; + +@WebService +@SOAPBinding(style = Style.RPC) +public interface SMSGatewayService { + + @WebMethod + boolean sendSMS(String fromNumber, String toNumber, String text); +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayServiceBootstrap.java b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayServiceBootstrap.java new file mode 100644 index 0000000000..6631aee907 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayServiceBootstrap.java @@ -0,0 +1,31 @@ +/* + * 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 com.tuscanyscatours.smsgateway; + +import javax.xml.ws.Endpoint; + +public class SMSGatewayServiceBootstrap { + + public static void main(String[] args) { + System.out.println("Publishing SMS Gateway Service as web service: http://localhost:8081/SMSGatewayService"); + System.out.println("Press Ctrl^C to terminate..."); + + Endpoint.publish("http://localhost:8081/SMSGatewayService", new SMSGatewayServiceImpl()); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayServiceImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayServiceImpl.java new file mode 100644 index 0000000000..cd4eab052d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayServiceImpl.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 com.tuscanyscatours.smsgateway; + +import javax.jws.WebService; + +@WebService(endpointInterface = "com.tuscanyscatours.smsgateway.SMSGatewayService") +public class SMSGatewayServiceImpl implements SMSGatewayService { + + public boolean sendSMS(String fromNumber, String toNumber, String text) { + System.out.println("Sending SMS message"); + System.out.println("From: " + fromNumber); + System.out.println("To: " + toNumber); + System.out.println("Message: " + text); + return true; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jms/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jms/build.xml new file mode 100644 index 0000000000..389f6296c3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jms/build.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jms/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jms/pom.xml new file mode 100644 index 0000000000..934b57f2a9 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jms/pom.xml @@ -0,0 +1,97 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-service-smsgateway-jms + Apache Tuscany SCA Tours SMS Gateway JMS Service + + + + org.apache.activemq + activemq-all + 5.2.0 + + + org.apache.activemq + activemq-web-demo + + + + + + org.apache.ws.commons.axiom + axiom-api + 1.2.7 + + + xerces + xercesImpl + + + stax + stax-api + + + xml-apis + xml-apis + + + + + + org.apache.ws.commons.axiom + axiom-impl + 1.2.7 + runtime + + + stax + stax-api + + + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ${scatours.selfContained} + ../lib/ + scatours.smsgateway.SMSGatewayJMSServiceBootstrap + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jms/src/main/java/scatours/smsgateway/SMSGateway.java b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jms/src/main/java/scatours/smsgateway/SMSGateway.java new file mode 100644 index 0000000000..e6e866fa1d --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jms/src/main/java/scatours/smsgateway/SMSGateway.java @@ -0,0 +1,30 @@ +/* + * 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.smsgateway; + +import java.rmi.Remote; +import java.rmi.RemoteException; + +/** + * A gateway to send SMS messages. + */ +public interface SMSGateway extends Remote { + boolean sendSMS(String fromNumber, String toNumber, String text) throws RemoteException; +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jms/src/main/java/scatours/smsgateway/SMSGatewayImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jms/src/main/java/scatours/smsgateway/SMSGatewayImpl.java new file mode 100644 index 0000000000..c35aa61513 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jms/src/main/java/scatours/smsgateway/SMSGatewayImpl.java @@ -0,0 +1,126 @@ +/* + * 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.smsgateway; + +import java.io.ByteArrayInputStream; + +import javax.jms.BytesMessage; +import javax.jms.Destination; +import javax.jms.JMSException; +import javax.jms.Message; +import javax.jms.MessageConsumer; +import javax.jms.MessageProducer; +import javax.jms.Session; +import javax.jms.TextMessage; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +import org.apache.axiom.om.OMAbstractFactory; +import org.apache.axiom.om.OMElement; +import org.apache.axiom.om.OMFactory; +import org.apache.axiom.om.OMText; +import org.apache.axiom.om.impl.builder.StAXOMBuilder; + +public class SMSGatewayImpl implements SMSGateway { + + private final Session session; + private final MessageConsumer consumer; + private final MessageProducer producer; + + public SMSGatewayImpl(Session session) throws JMSException { + this.session = session; + Destination requestDest = session.createQueue("SMSRequestQueue"); + consumer = session.createConsumer(requestDest); + + Destination responseDest = session.createQueue("SMSResponseQueue"); + producer = session.createProducer(responseDest); + } + + public void start() throws JMSException, XMLStreamException { + while (true) { + Message message = consumer.receive(); + handleRequest(message); + } + } + + private void handleRequest(Message inMessage) throws XMLStreamException, JMSException { + OMElement xml = parseXMLPayload(inMessage); + + String fromNumber = getStringArg(xml, 0); + String toNumber = getStringArg(xml, 1); + String text = getStringArg(xml, 2); + + boolean result = sendSMS(fromNumber, toNumber, text); + + String responseXML = createXMLResponse(result); + + TextMessage outMessage = createResponseMessage(inMessage.getJMSMessageID(), responseXML); + producer.send(outMessage); + } + + private OMElement parseXMLPayload(Message inMessage) throws JMSException, XMLStreamException { + final byte[] msgData; + if (inMessage instanceof TextMessage) { + msgData = ((TextMessage)inMessage).getText().getBytes(); + } else if (inMessage instanceof BytesMessage) { + BytesMessage bytesMessage = (BytesMessage)inMessage; + msgData = new byte[(int)bytesMessage.getBodyLength()]; + bytesMessage.readBytes(msgData); + } else { + throw new JMSException("Unsupported JMS message type of " + inMessage.getClass().getName()); + } + ByteArrayInputStream in = new ByteArrayInputStream(msgData); + StAXOMBuilder builder = new StAXOMBuilder(in); + OMElement doc = builder.getDocumentElement(); + return doc; + } + + private String getStringArg(OMElement doc, int i) { + QName argQName = new QName("arg" + i); + OMElement arg = doc.getFirstChildWithName(argQName); + if (arg == null) { + return null; + } + return arg.getText(); + } + + public boolean sendSMS(String fromNumber, String toNumber, String text) { + System.out.println("From: " + fromNumber); + System.out.println("To: " + toNumber); + System.out.println(text); + return true; + } + + private String createXMLResponse(boolean result) { + OMFactory omFactory = OMAbstractFactory.getOMFactory(); + OMElement response = omFactory.createOMElement("sendSMS", "http://smsgateway.scatours/", "ns2"); + OMElement returnValue = omFactory.createOMElement("return", null); + OMText returnV = omFactory.createOMText(Boolean.toString(result)); + returnValue.addChild(returnV); + response.addChild(returnValue); + return response.toString(); + } + + private TextMessage createResponseMessage(String correlationID, String responseXML) throws JMSException { + TextMessage outMessage = session.createTextMessage("sendSMS"); + outMessage.setText(responseXML); + outMessage.setJMSCorrelationID(correlationID); + return outMessage; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jms/src/main/java/scatours/smsgateway/SMSGatewayJMSServiceBootstrap.java b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jms/src/main/java/scatours/smsgateway/SMSGatewayJMSServiceBootstrap.java new file mode 100644 index 0000000000..d8543266e3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-jms/src/main/java/scatours/smsgateway/SMSGatewayJMSServiceBootstrap.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.smsgateway; + +import javax.jms.Connection; +import javax.jms.Session; + +import org.apache.activemq.ActiveMQConnectionFactory; +import org.apache.activemq.broker.BrokerService; + +public class SMSGatewayJMSServiceBootstrap { + + public static void main(String[] args) throws Exception { + final BrokerService jmsBroker = new BrokerService(); + jmsBroker.setPersistent(false); + jmsBroker.setUseJmx(false); + jmsBroker.addConnector("tcp://localhost:61619"); + jmsBroker.start(); + + System.out.println("Publishing SMS Gateway Service as a JMS service: tcp://localhost:61619"); + System.out.println("Press Ctrl^C to terminate..."); + + ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61619"); + Connection connection = connectionFactory.createConnection(); + connection.start(); + Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); + + SMSGatewayImpl impl = new SMSGatewayImpl(session); + impl.start(); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-rmi/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-rmi/build.xml new file mode 100644 index 0000000000..13d4702867 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-rmi/build.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-rmi/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-rmi/pom.xml new file mode 100644 index 0000000000..d92c660df6 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-rmi/pom.xml @@ -0,0 +1,50 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-service-smsgateway-rmi + Apache Tuscany SCA Tours SMS Gateway RMI Service + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ${scatours.selfContained} + ../lib/ + com.tuscanyscatours.smsgateway.SMSGatewayRMIServiceBootstrap + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java new file mode 100644 index 0000000000..4ce528fd23 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java @@ -0,0 +1,30 @@ +/* + * 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 com.tuscanyscatours.smsgateway; + +import java.rmi.Remote; +import java.rmi.RemoteException; + +/** + * A gateway to send SMS messages. + */ +public interface SMSGateway extends Remote { + boolean sendSMS(String fromNumber, String toNumber, String text) throws RemoteException; +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayImpl.java b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayImpl.java new file mode 100644 index 0000000000..c33439af8b --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayImpl.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 com.tuscanyscatours.smsgateway; + +import java.rmi.RemoteException; +import java.rmi.server.UnicastRemoteObject; + +public class SMSGatewayImpl extends UnicastRemoteObject implements SMSGateway { + + private static final long serialVersionUID = -2739486025442222295L; + + protected SMSGatewayImpl() throws RemoteException { + super(); + } + + public boolean sendSMS(String fromNumber, String toNumber, String text) { + System.out.println("Sending SMS message"); + System.out.println("From: " + fromNumber); + System.out.println("To: " + toNumber); + System.out.println("Message: " + text); + return true; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayRMIServiceBootstrap.java b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayRMIServiceBootstrap.java new file mode 100644 index 0000000000..4a039ecec0 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/services/smsgateway-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayRMIServiceBootstrap.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 com.tuscanyscatours.smsgateway; + +import java.rmi.registry.LocateRegistry; +import java.rmi.registry.Registry; + +public class SMSGatewayRMIServiceBootstrap { + + public static void main(String[] args) throws Exception { + System.out.println("Publishing SMS Gateway Service as a RMI service"); + + String serviceName = "SMSGatewayRMI"; + SMSGatewayImpl smsGatewayImpl = new SMSGatewayImpl(); + Registry rmiRegistry = LocateRegistry.createRegistry(8099); + rmiRegistry.bind(serviceName, smsGatewayImpl); + + System.out.println("RMI server running - waiting for requests"); + System.out.println("Press enter to shutdown."); + System.in.read(); + rmiRegistry.unbind(serviceName); + System.exit(0); + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/testdomain/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/testdomain/build.xml new file mode 100644 index 0000000000..1f8d60a8e3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/testdomain/build.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/testdomain/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/testdomain/pom.xml new file mode 100644 index 0000000000..0e53a87a44 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/testdomain/pom.xml @@ -0,0 +1,58 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../pom.xml + + scatours-test-domain + Apache Tuscany SCA Tours Test Domain + + + + + maven-clean-plugin + 2.2 + + + + ./.felix + + + ./cloud + + + . + + **/cloud.composite + **/domain.composite + **/workspace.xml + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/travel-scenario.odg b/sca-java-1.x/tags/travelsample-1.0-RC3/travel-scenario.odg new file mode 100644 index 0000000000..06298e5221 Binary files /dev/null and b/sca-java-1.x/tags/travelsample-1.0-RC3/travel-scenario.odg differ diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/util/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/util/build.xml new file mode 100644 index 0000000000..3ab8df5da3 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/util/build.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/util/jaxws-runtime/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/util/jaxws-runtime/pom.xml new file mode 100644 index 0000000000..40dc9fd466 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/util/jaxws-runtime/pom.xml @@ -0,0 +1,147 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-util-jaxws-runtime + Apache Tuscany SCA Tours JAX-WS Runtime Dependencies for JDK 5 + + + + + default + + true + + + + com.sun.xml.ws + jaxws-rt + 2.1.7 + runtime + + + + com.sun.xml.bind + jaxb-impl + + + javax.activation + activation + + + javax.xml.stream + stax-api + + + javax.xml.ws + jaxws-api + + + junit + junit + + + org.codehaus.woodstox + wstx-asl + + + + com.sun.org.apache.xml.internal + resolver + + + org.jvnet + mimepull + + + + + + com.sun.net.httpserver + http + 20070405 + runtime + + + + javax.xml.soap + saaj-api + 1.3 + runtime + + + + javax.activation + activation + + + + + + + + + selfcontained + + + com.sun.xml.ws + jaxws-rt + 2.1.7 + runtime + + + + com.sun.net.httpserver + http + 20070405 + runtime + + + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + true + ../jaxws/ + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/util/launcher-common/build.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/util/launcher-common/build.xml new file mode 100644 index 0000000000..a8fe5faff0 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/util/launcher-common/build.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/util/launcher-common/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/util/launcher-common/pom.xml new file mode 100644 index 0000000000..857e53c1e1 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/util/launcher-common/pom.xml @@ -0,0 +1,58 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-util-launcher-common + Apache Tuscany SCA Tours Common Utility for Launchers + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ${scatours.selfContained} + ../lib/ + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/util/launcher-common/src/main/java/scatours/launcher/LauncherUtil.java b/sca-java-1.x/tags/travelsample-1.0-RC3/util/launcher-common/src/main/java/scatours/launcher/LauncherUtil.java new file mode 100644 index 0000000000..0cae436c82 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/util/launcher-common/src/main/java/scatours/launcher/LauncherUtil.java @@ -0,0 +1,86 @@ +/* + * 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.launcher; + +import java.io.File; + +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +/** + * This utility locates SCA contributions by name so that the launcher can work with various environments where + * contributions are stored differently. + */ +public class LauncherUtil { + + /** + * Locate an SCA contribution by name + * @param name The name of the SCA contribution archive + * @return The SCAContribution + */ + public static SCAContribution locate(String name) { + // Try to use the target/classes directory inside Eclipse/Maven + File file = new File("../../contributions/" + name + "/target/classes"); + if (!file.exists()) { + // Try to use the target/.jar that is generated by maven build + file = new File("../../contributions/" + name + "/target/scatours-contribution-" + name + ".jar"); + if (!file.exists()) { + // Try to use the contribution jar under the contributions folder of the distribution + file = new File("../contributions/scatours-contribution-" + name + ".jar"); + if (!file.exists()) { + // Try to use the contribution subfolder under the contributions folder of the distribution + file = new File("../contributions/scatours-contribution-" + name); + if (!file.exists()) { + throw new IllegalArgumentException("Contribution " + name + " cannot be located."); + } + } + } + } + return new SCAContribution(name, file.toURI().toString()); + } + + /** + * Locate an SCA contribution by replacing the ${name} in the pattern + * @param urlPattern The url pattern that contains ${name} + * @param name The name of the contribution archive + * @return The SCAContribution + */ + public static SCAContribution locate(String urlPattern, String name) { + String url = urlPattern.replace("${name}", name); + return new SCAContribution(name, url); + } + + /** + * Create an SCA node from a list of contribution names + * @param composite + * @param contributionNames + * @return + */ + public static SCANode createNode(String composite, String... contributionNames) { + SCAContribution[] contributions = new SCAContribution[contributionNames.length]; + int index = 0; + for (String name : contributionNames) { + contributions[index++] = locate(name); + } + SCANode node = SCANodeFactory.newInstance().createSCANode(composite, contributions); + return node; + } +} diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/util/openejb-runtime/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/util/openejb-runtime/pom.xml new file mode 100644 index 0000000000..457b2f7074 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/util/openejb-runtime/pom.xml @@ -0,0 +1,178 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../../pom.xml + + scatours-util-openejb-runtime + Apache Tuscany SCA Tours OpenEJB Runtime Dependencies + + + + + default + + true + + + + org.apache.openejb + openejb-ejbd + 3.1.2 + runtime + + + + org.apache.activemq + activeio-core + + + org.apache.activemq + activemq-core + + + org.apache.activemq + activemq-ra + + + backport-util-concurrent + backport-util-concurrent + + + commons-collections + commons-collections + + + commons-lang + commons-lang + + + commons-logging + commons-logging + + + commons-pool + commons-pool + + + org.apache.geronimo.components + geronimo-connector + + + org.apache.geronimo.javamail + geronimo-javamail_1.4_mail + + + org.objectweb.howl + howl + + + hsqldb + hsqldb + + + com.sun.xml.bind + jaxb-impl + + + junit + junit + + + log4j + log4j + + + org.apache.openjpa + openjpa + + + quartz + quartz + + + serp + serp + + + stax + stax-api + + + org.codehaus.swizzle + swizzle-stream + + + wsdl4j + wsdl4j + + + org.codehaus.woodstox + wstx-asl + + + org.apache.xbean + xbean-naming + + + + + + + + + selfcontained + + + org.apache.openejb + openejb-ejbd + 3.1.2 + runtime + + + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + true + ../openejb/ + + + + + + + + diff --git a/sca-java-1.x/tags/travelsample-1.0-RC3/util/pom.xml b/sca-java-1.x/tags/travelsample-1.0-RC3/util/pom.xml new file mode 100644 index 0000000000..473bd1ee42 --- /dev/null +++ b/sca-java-1.x/tags/travelsample-1.0-RC3/util/pom.xml @@ -0,0 +1,38 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0 + ../pom.xml + + scatours-util + pom + Apache Tuscany SCA Tours Utilities + + + jaxws-runtime + launcher-common + openejb-runtime + + + -- cgit v1.2.3