From bdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a Mon Sep 17 00:00:00 2001
From: dims
Date: Tue, 17 Jun 2008 00:23:01 +0000
Subject: Move Tuscany from Incubator to top level.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68
---
.../demos/alert-aggregator-webapp/DISCLAIMER | 8 +
.../1.2-RC3a/demos/alert-aggregator-webapp/LICENSE | 205 +++++++
.../1.2-RC3a/demos/alert-aggregator-webapp/NOTICE | 6 +
.../1.2-RC3a/demos/alert-aggregator-webapp/README | 82 +++
.../alert-aggregator-webapp/alert-aggregator.png | Bin 0 -> 36819 bytes
.../alert-aggregator-webapp/alert-aggregator.svg | 627 +++++++++++++++++++++
.../demos/alert-aggregator-webapp/build-dojo.xml | 92 +++
.../demos/alert-aggregator-webapp/build.xml | 147 +++++
.../1.2-RC3a/demos/alert-aggregator-webapp/pom.xml | 351 ++++++++++++
.../sca/demos/aggregator/AlertTypeNonSDOImpl.java | 339 +++++++++++
.../demos/aggregator/AlertsFeedServiceImpl.java | 106 ++++
.../sca/demos/aggregator/AlertsService.java | 40 ++
.../sca/demos/aggregator/AlertsServiceImpl.java | 126 +++++
.../sca/demos/aggregator/AlertsSourcesService.java | 69 +++
.../demos/aggregator/AlertsSourcesServiceImpl.java | 183 ++++++
.../sca/demos/aggregator/AlertsTypeNonSDOImpl.java | 74 +++
.../sca/demos/aggregator/ConfigTypeNonSDOImpl.java | 55 ++
.../sca/demos/aggregator/RSSCheckerService.java | 30 +
.../demos/aggregator/RSSCheckerServiceImpl.java | 85 +++
.../sca/demos/aggregator/SourceTypeNonSDOImpl.java | 536 ++++++++++++++++++
.../src/main/resources/Alerts.wsdl | 88 +++
.../src/main/resources/Alerts.xsd | 80 +++
.../src/main/resources/AlertsSources.wsdl | 124 ++++
.../src/main/resources/alerts-client.composite | 49 ++
.../src/main/resources/alerts.composite | 85 +++
.../src/main/resources/sources.xml | 33 ++
.../src/main/webapp/AlertAggregator.html | 330 +++++++++++
.../src/main/webapp/META-INF/sca-contribution.xml | 26 +
.../src/main/webapp/WEB-INF/geronimo-web.xml | 32 ++
.../src/main/webapp/WEB-INF/web.xml | 41 ++
.../src/main/webapp/pop.png | Bin 0 -> 244 bytes
.../src/main/webapp/rss.png | Bin 0 -> 689 bytes
.../src/main/webapp/service.smd | 1 +
.../src/main/webapp/sources.smd | 1 +
.../src/main/webapp/style.css | 176 ++++++
.../demos/aggregator/AlertsIntegrationTest.java | 99 ++++
.../sca/1.2-RC3a/demos/bigbank-account/DISCLAIMER | 8 +
.../sca/1.2-RC3a/demos/bigbank-account/LICENSE | 205 +++++++
.../java/sca/1.2-RC3a/demos/bigbank-account/NOTICE | 6 +
.../java/sca/1.2-RC3a/demos/bigbank-account/README | 4 +
.../sca/1.2-RC3a/demos/bigbank-account/bigbank.png | Bin 0 -> 100070 bytes
.../sca/1.2-RC3a/demos/bigbank-account/bigbank.svg | 537 ++++++++++++++++++
.../1.2-RC3a/demos/bigbank-account/build-dojo.xml | 92 +++
.../sca/1.2-RC3a/demos/bigbank-account/build.xml | 85 +++
.../sca/1.2-RC3a/demos/bigbank-account/pom.xml | 72 +++
.../account/checking/CheckingAccountDetails.java | 50 ++
.../account/checking/CheckingAccountService.java | 37 ++
.../checking/CheckingAccountServiceImpl.java | 66 +++
.../account/savings/SavingsAccountDetails.java | 52 ++
.../account/savings/SavingsAccountService.java | 35 ++
.../account/savings/SavingsAccountServiceImpl.java | 66 +++
.../AccountsDataPasswordCallbackHandler.java | 54 ++
.../account/security/BigbankCheckingsAcl.java | 48 ++
...ckingsDeptAuthImplementationPolicyProvider.java | 90 +++
.../account/security/CheckingsDeptAuthPolicy.java | 46 ++
.../CheckingsDeptAuthPolicyInterceptor.java | 77 +++
.../CheckingsDeptAuthPolicyProviderFactory.java | 75 +++
.../CheckingsDeptAuthorizationPolicyHandler.java | 65 +++
.../CheckingsDeptAuthorizationPolicyProcessor.java | 72 +++
.../bigbank/account/stock/StockAccountDetails.java | 68 +++
.../bigbank/account/stock/StockAccountService.java | 36 ++
.../account/stock/StockAccountServiceImpl.java | 60 ++
.../src/main/resources/CheckingsAccount.composite | 35 ++
.../main/resources/META-INF/sca-contribution.xml | 42 ++
...ca.contribution.processor.StAXArtifactProcessor | 19 +
...rg.apache.tuscany.sca.policy.util.PolicyHandler | 20 +
...ache.tuscany.sca.provider.PolicyProviderFactory | 19 +
.../src/main/resources/SavingsAccount.composite | 34 ++
.../src/main/resources/StockAccount.composite | 34 ++
.../src/main/resources/definitions.xml | 58 ++
.../src/main/resources/web/AccountJSON.html | 92 +++
.../src/main/resources/web/style.css | 22 +
.../src/main/resources/wsdl/AccountService.wsdl | 91 +++
.../1.2-RC3a/demos/bigbank-calculator/DISCLAIMER | 8 +
.../sca/1.2-RC3a/demos/bigbank-calculator/LICENSE | 205 +++++++
.../sca/1.2-RC3a/demos/bigbank-calculator/NOTICE | 6 +
.../sca/1.2-RC3a/demos/bigbank-calculator/README | 2 +
.../1.2-RC3a/demos/bigbank-calculator/build.xml | 68 +++
.../sca/1.2-RC3a/demos/bigbank-calculator/pom.xml | 78 +++
.../src/main/java/calculator/AddService.java | 25 +
.../main/java/calculator/CalculatorService.java | 34 ++
.../java/calculator/CalculatorServiceImpl.java | 72 +++
.../src/main/java/calculator/DivideService.java | 25 +
.../src/main/java/calculator/MultiplyService.java | 25 +
.../src/main/java/calculator/SubtractService.java | 25 +
.../java/calculator/demo/CalculatorServer.java | 44 ++
.../src/main/resources/Calculator.composite | 55 ++
.../main/resources/calculator/AddServiceImpl.js | 22 +
.../resources/calculator/DivideServiceImpl.groovy | 22 +
.../resources/calculator/MultiplyServiceImpl.py | 21 +
.../resources/calculator/SubtractServiceImpl.rb | 22 +
.../1.2-RC3a/demos/bigbank-stockquote/DISCLAIMER | 8 +
.../sca/1.2-RC3a/demos/bigbank-stockquote/LICENSE | 205 +++++++
.../sca/1.2-RC3a/demos/bigbank-stockquote/NOTICE | 6 +
.../sca/1.2-RC3a/demos/bigbank-stockquote/README | 4 +
.../1.2-RC3a/demos/bigbank-stockquote/build.xml | 67 +++
.../sca/1.2-RC3a/demos/bigbank-stockquote/pom.xml | 85 +++
.../java/stockquote/PasswordCallbackHandler.java | 47 ++
.../src/main/java/stockquote/StockQuoteImpl.java | 38 ++
.../main/java/stockquote/StockQuoteService.java | 30 +
.../java/stockquote/demo/StockQuoteServer.java | 42 ++
.../src/main/resources/StockQuote.composite | 33 ++
.../src/main/resources/definitions.xml | 49 ++
.../src/main/resources/security.properties | 20 +
.../src/main/resources/stockQuote.jks | Bin 0 -> 1986 bytes
tags/java/sca/1.2-RC3a/demos/bigbank/DISCLAIMER | 8 +
tags/java/sca/1.2-RC3a/demos/bigbank/LICENSE | 205 +++++++
tags/java/sca/1.2-RC3a/demos/bigbank/NOTICE | 6 +
tags/java/sca/1.2-RC3a/demos/bigbank/README | 127 +++++
tags/java/sca/1.2-RC3a/demos/bigbank/bigbank.png | Bin 0 -> 100070 bytes
tags/java/sca/1.2-RC3a/demos/bigbank/bigbank.svg | 537 ++++++++++++++++++
.../java/sca/1.2-RC3a/demos/bigbank/build-dojo.xml | 92 +++
tags/java/sca/1.2-RC3a/demos/bigbank/build.xml | 84 +++
tags/java/sca/1.2-RC3a/demos/bigbank/pom.xml | 194 +++++++
.../main/java/bigbank/account/AccountService.java | 32 ++
.../java/bigbank/account/AccountServiceImpl.java | 99 ++++
.../java/bigbank/account/feed/AccountFeedImpl.java | 70 +++
.../main/java/bigbank/client/BigBankClient.java | 50 ++
.../src/main/java/bigbank/demo/BigBankServer.java | 130 +++++
.../security/BigbankPasswordCallbackHandler.java | 51 ++
.../main/java/calculator/CalculatorService.java | 34 ++
.../main/java/stockquote/StockQuoteService.java | 29 +
.../bigbank/src/main/resources/BigBank.composite | 85 +++
.../main/resources/META-INF/sca-contribution.xml | 36 ++
.../demos/bigbank/src/main/resources/bigbank.jks | Bin 0 -> 1986 bytes
.../bigbank/src/main/resources/definitions.xml | 64 +++
.../bigbank/src/main/resources/security.properties | 20 +
.../src/main/resources/web/AccountJSON.html | 92 +++
.../demos/bigbank/src/main/resources/web/style.css | 22 +
.../src/main/resources/wsdl/AccountService.wsdl | 91 +++
.../src/test/java/test/BigBankTestCase.java | 33 ++
.../1.2-RC3a/demos/mortgage-creditcheck/DISCLAIMER | 8 +
.../1.2-RC3a/demos/mortgage-creditcheck/LICENSE | 205 +++++++
.../sca/1.2-RC3a/demos/mortgage-creditcheck/NOTICE | 6 +
.../sca/1.2-RC3a/demos/mortgage-creditcheck/README | 6 +
.../1.2-RC3a/demos/mortgage-creditcheck/build.xml | 66 +++
.../1.2-RC3a/demos/mortgage-creditcheck/pom.xml | 75 +++
.../src/main/java/credit/CreditCheck.java | 26 +
.../src/main/java/credit/CreditCheckImpl.java | 34 ++
.../src/main/java/credit/CreditCheckServer.java | 40 ++
.../src/main/resources/CreditCheck.composite | 37 ++
.../src/main/resources/wsdl/credit.wsdl | 81 +++
.../src/main/webapp/META-INF/sca-contribution.xml | 24 +
.../src/main/webapp/WEB-INF/web.xml | 37 ++
.../demos/mortgage-loanapproval/DISCLAIMER | 8 +
.../1.2-RC3a/demos/mortgage-loanapproval/LICENSE | 205 +++++++
.../1.2-RC3a/demos/mortgage-loanapproval/NOTICE | 6 +
.../1.2-RC3a/demos/mortgage-loanapproval/README | 60 ++
.../1.2-RC3a/demos/mortgage-loanapproval/build.xml | 66 +++
.../mortgage-loanapproval/doc/credit_composite.jpg | Bin 0 -> 73610 bytes
.../mortgage-loanapproval/doc/credit_composite.png | Bin 0 -> 51153 bytes
.../mortgage-loanapproval/doc/loan_approval.jpg | Bin 0 -> 162536 bytes
.../mortgage-loanapproval/doc/loan_approval.png | Bin 0 -> 58247 bytes
.../doc/mortgage_assembly0.jpg | Bin 0 -> 145053 bytes
.../doc/mortgage_assembly0.png | Bin 0 -> 93773 bytes
.../doc/mortgage_assembly1.jpg | Bin 0 -> 181317 bytes
.../doc/mortgage_assembly1.png | Bin 0 -> 113404 bytes
.../doc/mortgage_assembly2.jpg | Bin 0 -> 180240 bytes
.../doc/mortgage_assembly2.png | Bin 0 -> 106656 bytes
.../doc/mortgage_composite.jpg | Bin 0 -> 343699 bytes
.../doc/mortgage_composite.png | Bin 0 -> 288351 bytes
.../doc/mortgage_diagrams.doc | Bin 0 -> 2278400 bytes
.../doc/mortgage_package1.jpg | Bin 0 -> 181031 bytes
.../doc/mortgage_package1.png | Bin 0 -> 34939 bytes
.../doc/mortgage_package2.jpg | Bin 0 -> 110930 bytes
.../doc/mortgage_package2.png | Bin 0 -> 58993 bytes
.../doc/mortgage_scenario.jpg | Bin 0 -> 225690 bytes
.../doc/mortgage_scenario.png | Bin 0 -> 106791 bytes
.../mortgage-loanapproval/mortgage_assembly.png | Bin 0 -> 106656 bytes
.../1.2-RC3a/demos/mortgage-loanapproval/pom.xml | 90 +++
.../src/main/java/mortgage/CreditCheck.java | 29 +
.../src/main/java/mortgage/CreditCheckImpl.java | 34 ++
.../src/main/java/mortgage/Customer.java | 76 +++
.../src/main/java/mortgage/InterestRateQuote.java | 23 +
.../main/java/mortgage/InterestRateQuoteImpl.java | 42 ++
.../src/main/java/mortgage/LoanApproval.java | 27 +
.../src/main/java/mortgage/LoanApprovalImpl.java | 84 +++
.../src/main/java/mortgage/MortgageCalculator.java | 29 +
.../main/java/mortgage/MortgageCalculatorImpl.java | 38 ++
.../src/main/java/mortgage/MortgageClient.java | 44 ++
.../src/main/java/mortgage/RiskAssessment.java | 27 +
.../src/main/java/mortgage/RiskAssessmentImpl.java | 38 ++
.../src/main/resources/Mortgage.composite | 48 ++
.../src/main/resources/Mortgage1.composite | 57 ++
.../resources/MortgageCalculator.componentType | 27 +
.../src/main/resources/MortgageCalculator.js | 25 +
.../src/main/resources/wsdl/credit.wsdl | 81 +++
.../test/java/mortgage/MortgageClientTestCase.java | 56 ++
tags/java/sca/1.2-RC3a/demos/pom.xml | 52 ++
.../java/sca/1.2-RC3a/demos/xml-bigbank/DISCLAIMER | 8 +
tags/java/sca/1.2-RC3a/demos/xml-bigbank/LICENSE | 205 +++++++
tags/java/sca/1.2-RC3a/demos/xml-bigbank/NOTICE | 6 +
tags/java/sca/1.2-RC3a/demos/xml-bigbank/README | 48 ++
tags/java/sca/1.2-RC3a/demos/xml-bigbank/build.xml | 63 +++
tags/java/sca/1.2-RC3a/demos/xml-bigbank/pom.xml | 121 ++++
.../src/main/java/bigbank/AccountData.java | 36 ++
.../src/main/java/bigbank/AccountDataImpl.java | 48 ++
.../src/main/java/bigbank/AccountService.java | 32 ++
.../src/main/java/bigbank/AccountServiceImpl.java | 80 +++
.../src/main/java/bigbank/BigBankClient.java | 35 ++
.../src/main/java/bigbank/BigBankServer.java | 40 ++
.../src/main/java/bigbank/CurrencyExchange.java | 36 ++
.../src/main/java/bigbank/ExchangeRate.java | 32 ++
.../src/main/java/bigbank/ExchangeRateImpl.java | 84 +++
.../src/main/java/bigbank/StockQuote.java | 37 ++
.../src/main/java/bigbank/StockValue.java | 38 ++
.../src/main/resources/BigBank.composite | 51 ++
.../xml-bigbank/src/main/resources/accounts.xml | 29 +
.../xml-bigbank/src/main/resources/customer.xsd | 46 ++
.../xml-bigbank/src/main/resources/quotes.xml | 74 +++
.../demos/xml-bigbank/src/main/resources/stock.xq | 52 ++
.../src/main/resources/wsdl/StockQuotes.wsdl | 23 +
.../sca/1.2-RC3a/demos/xml-bigbank/xml-bigbank.png | Bin 0 -> 30396 bytes
.../sca/1.2-RC3a/demos/xml-bigbank/xml-bigbank.svg | 447 +++++++++++++++
214 files changed, 13970 insertions(+)
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/DISCLAIMER
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/LICENSE
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/NOTICE
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/README
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/alert-aggregator.png
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/alert-aggregator.svg
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/build-dojo.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/build.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/pom.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertTypeNonSDOImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsFeedServiceImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsService.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsServiceImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsSourcesService.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsSourcesServiceImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsTypeNonSDOImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/ConfigTypeNonSDOImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/RSSCheckerService.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/RSSCheckerServiceImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/SourceTypeNonSDOImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/resources/Alerts.wsdl
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/resources/Alerts.xsd
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/resources/AlertsSources.wsdl
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/resources/alerts-client.composite
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/resources/alerts.composite
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/resources/sources.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/AlertAggregator.html
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/META-INF/sca-contribution.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/WEB-INF/geronimo-web.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/WEB-INF/web.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/pop.png
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/rss.png
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/service.smd
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/sources.smd
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/style.css
create mode 100644 tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/test/java/org/apache/tuscany/sca/demos/aggregator/AlertsIntegrationTest.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/DISCLAIMER
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/LICENSE
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/NOTICE
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/README
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/bigbank.png
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/bigbank.svg
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/build-dojo.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/build.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/pom.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/checking/CheckingAccountDetails.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/checking/CheckingAccountService.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/checking/CheckingAccountServiceImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/savings/SavingsAccountDetails.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/savings/SavingsAccountService.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/savings/SavingsAccountServiceImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/AccountsDataPasswordCallbackHandler.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/BigbankCheckingsAcl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthImplementationPolicyProvider.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthPolicy.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthPolicyInterceptor.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthPolicyProviderFactory.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthorizationPolicyHandler.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthorizationPolicyProcessor.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/stock/StockAccountDetails.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/stock/StockAccountService.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/stock/StockAccountServiceImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/CheckingsAccount.composite
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/META-INF/sca-contribution.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/SavingsAccount.composite
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/StockAccount.composite
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/definitions.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/web/AccountJSON.html
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/web/style.css
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/wsdl/AccountService.wsdl
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-calculator/DISCLAIMER
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-calculator/LICENSE
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-calculator/NOTICE
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-calculator/README
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-calculator/build.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-calculator/pom.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/AddService.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/CalculatorService.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/CalculatorServiceImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/DivideService.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/MultiplyService.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/SubtractService.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/demo/CalculatorServer.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/resources/Calculator.composite
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/resources/calculator/AddServiceImpl.js
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/resources/calculator/DivideServiceImpl.groovy
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/resources/calculator/MultiplyServiceImpl.py
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/resources/calculator/SubtractServiceImpl.rb
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/DISCLAIMER
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/LICENSE
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/NOTICE
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/README
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/build.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/pom.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/java/stockquote/PasswordCallbackHandler.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/java/stockquote/StockQuoteImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/java/stockquote/StockQuoteService.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/java/stockquote/demo/StockQuoteServer.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/resources/StockQuote.composite
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/resources/definitions.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/resources/security.properties
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/resources/stockQuote.jks
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/DISCLAIMER
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/LICENSE
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/NOTICE
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/README
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/bigbank.png
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/bigbank.svg
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/build-dojo.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/build.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/pom.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/account/AccountService.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/account/AccountServiceImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/account/feed/AccountFeedImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/client/BigBankClient.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/demo/BigBankServer.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/security/BigbankPasswordCallbackHandler.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/calculator/CalculatorService.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/stockquote/StockQuoteService.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/BigBank.composite
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/META-INF/sca-contribution.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/bigbank.jks
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/definitions.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/security.properties
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/web/AccountJSON.html
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/web/style.css
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/wsdl/AccountService.wsdl
create mode 100644 tags/java/sca/1.2-RC3a/demos/bigbank/src/test/java/test/BigBankTestCase.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/DISCLAIMER
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/LICENSE
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/NOTICE
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/README
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/build.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/pom.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/java/credit/CreditCheck.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/java/credit/CreditCheckImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/java/credit/CreditCheckServer.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/resources/CreditCheck.composite
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/resources/wsdl/credit.wsdl
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/webapp/META-INF/sca-contribution.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/webapp/WEB-INF/web.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/DISCLAIMER
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/LICENSE
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/NOTICE
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/README
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/build.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/credit_composite.jpg
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/credit_composite.png
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/loan_approval.jpg
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/loan_approval.png
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly0.jpg
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly0.png
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly1.jpg
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly1.png
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly2.jpg
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly2.png
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_composite.jpg
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_composite.png
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_diagrams.doc
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_package1.jpg
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_package1.png
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_package2.jpg
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_package2.png
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_scenario.jpg
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_scenario.png
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/mortgage_assembly.png
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/pom.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheck.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheckImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/Customer.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuote.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuoteImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApproval.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApprovalImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculator.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculatorImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageClient.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessment.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessmentImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/resources/Mortgage.composite
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/resources/Mortgage1.composite
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.componentType
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.js
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/resources/wsdl/credit.wsdl
create mode 100644 tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/test/java/mortgage/MortgageClientTestCase.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/pom.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/DISCLAIMER
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/LICENSE
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/NOTICE
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/README
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/build.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/pom.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/AccountData.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/AccountDataImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/AccountService.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/AccountServiceImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/BigBankClient.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/BigBankServer.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/CurrencyExchange.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/ExchangeRate.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/ExchangeRateImpl.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/StockQuote.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/StockValue.java
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/BigBank.composite
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/accounts.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/customer.xsd
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/quotes.xml
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/stock.xq
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/wsdl/StockQuotes.wsdl
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/xml-bigbank.png
create mode 100644 tags/java/sca/1.2-RC3a/demos/xml-bigbank/xml-bigbank.svg
(limited to 'tags/java/sca/1.2-RC3a/demos')
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/DISCLAIMER b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/DISCLAIMER
new file mode 100644
index 0000000000..d68a410903
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/DISCLAIMER
@@ -0,0 +1,8 @@
+Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/LICENSE b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/LICENSE
new file mode 100644
index 0000000000..8aa906c321
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/LICENSE
@@ -0,0 +1,205 @@
+
+ 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.
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/NOTICE b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/NOTICE
new file mode 100644
index 0000000000..fdfa0e9faa
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/NOTICE
@@ -0,0 +1,6 @@
+${pom.name}
+Copyright (c) 2005 - 2008 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/README b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/README
new file mode 100644
index 0000000000..3ec27ef65f
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/README
@@ -0,0 +1,82 @@
+Apache Tuscany Alert Aggregator Demo
+====================================
+
+The alert aggregator demo provides an application, implemented using SCA, that
+aggregates feeds together and exposes them using the following bindings.
+
+binding.ws
+binding.jsonrpc
+binding.feed
+
+The easiest way to get going is to build the demo
+
+cd alert-aggregator-webapp
+ant package
+
+This will build a war file
+
+demo-alert-aggregator-webapp.war
+
+This war can be deployed to you web application container and tested (the war
+has been tested with Tomcat 6.0.10).
+
+The Web Application
+-------------------
+
+Once deployed point your browser at
+
+http://localhost:8080/demo-alert-aggregator-webapp
+
+Taking care to ensure the host name and port number match you local
+configuration.
+
+This launches a Javascript application in the browser that uses JSONRPC
+to contact the server and retrived a list of alert sources and alerts that
+these sources are providing.
+
+There default sources that you see are stored in a file in the following
+file
+
+demo-alert-aggregator-webapp/WEB-INF/classes/sources.xml
+
+This files has the following contents
+
+
+
+ BBC News
+ http://news.bbc.co.uk/
+ 10-Jun-2007 16:34:03
+ http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml
+
+
+ Engadget
+ http://www.engadget.com
+ 10-Jun-2007 16:34:03
+ http://www.engadget.com/rss.xml
+
+
+
+You may want to adjust the "LastChecked" values to change the number of
+alerts that are displayed in the first instance
+
+Using A Feed Reader
+-------------------
+
+As this SCA application also uses the binding.feed binding you can use your
+favourite feed reader to read the aggregated alerts. To do this point your
+feed reader at
+
+http://localhost:8080/demo-alert-aggregator-webapp/services/AlertsFeedServiceRSS
+
+Again taking care to ensure that the host name and port number match you
+local configuration.
+
+Using Web Services
+------------------
+
+The SCA application also uses binding.ws to provide a SOAP/HTTP interface.
+The demo client that uses this interface is not yet available.
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/alert-aggregator.png b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/alert-aggregator.png
new file mode 100644
index 0000000000..ae429cca94
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/alert-aggregator.png differ
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/alert-aggregator.svg b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/alert-aggregator.svg
new file mode 100644
index 0000000000..807416135e
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/alert-aggregator.svg
@@ -0,0 +1,627 @@
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/build-dojo.xml b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/build-dojo.xml
new file mode 100644
index 0000000000..c31c9adee8
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/build-dojo.xml
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/build.xml b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/build.xml
new file mode 100644
index 0000000000..0faa0f7edd
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/build.xml
@@ -0,0 +1,147 @@
+
+
+]>
+
+
+ &buildDependency;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/pom.xml b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/pom.xml
new file mode 100644
index 0000000000..038df521b4
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/pom.xml
@@ -0,0 +1,351 @@
+
+
+
+ 4.0.0
+
+
+ org.apache.tuscany.sca
+ tuscany-demos
+ 1.2-incubating
+ ../pom.xml
+
+
+ org.apache.tuscany.sca
+ demo-alert-aggregator-webapp
+ war
+ 1.2-incubating
+ Apache Tuscany SCA Alert Aggregator Demo
+ http://cwiki.apache.org/TUSCANY
+
+
+
+ org.apache.tuscany.sdo
+ tuscany-sdo-api-r2.1
+ 1.0-incubating
+
+
+ org.apache.tuscany.sdo
+ tuscany-sdo-impl
+ 1.0-incubating
+
+
+ org.apache.tuscany.sca
+ tuscany-binding-ws-axis2
+ ${pom.version}
+ runtime
+
+
+ org.apache.tuscany.sca
+ tuscany-core-databinding
+ ${pom.version}
+ runtime
+
+
+ org.apache.tuscany.sca
+ tuscany-databinding-jaxb
+ ${pom.version}
+ runtime
+
+
+ org.apache.tuscany.sca
+ tuscany-databinding-sdo
+ ${pom.version}
+ compile
+
+
+ org.apache.tuscany.sca
+ tuscany-databinding-axiom
+ ${pom.version}
+ compile
+
+
+ org.apache.tuscany.sca
+ tuscany-host-embedded
+ ${pom.version}
+ compile
+
+
+ org.apache.tuscany.sca
+ tuscany-implementation-java-runtime
+ ${pom.version}
+ compile
+
+
+ org.apache.tuscany.sca
+ tuscany-interface-java-xml
+ ${pom.version}
+ compile
+
+
+ org.apache.tuscany.sca
+ tuscany-host-webapp
+ 1.2-incubating
+ runtime
+
+
+ org.apache.tuscany.sca
+ tuscany-binding-jsonrpc
+ 1.2-incubating
+ runtime
+
+
+ org.apache.tuscany.sca
+ tuscany-binding-atom-abdera
+ 1.2-incubating
+
+
+ org.apache.tuscany.sca
+ tuscany-binding-rss-rome
+ 1.2-incubating
+
+
+ org.codehaus.woodstox
+ wstx-asl
+ 3.2.1
+ runtime
+
+
+ junit
+ junit
+ 4.2
+ test
+
+
+ httpunit
+ httpunit
+ 1.6.1
+ test
+
+
+ xerces
+ xercesImpl
+
+
+
+
+
+
+
+ demo-alert-aggregator-webapp
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+ 1.0
+
+
+ add-test-source
+ generate-sources
+
+ add-test-source
+
+
+
+ target/sdo-source
+
+
+
+
+
+
+ org.apache.tuscany.sdo
+ tuscany-sdo-plugin
+ 1.0-incubating
+
+
+ generate-sdo
+ generate-sources
+
+
+
+ ${basedir}/src/main/resources/Alerts.wsdl
+ org.apache.tuscany.sca.demos.aggregator.service
+
+
+ ${basedir}/src/main/resources/AlertsSources.wsdl
+ org.apache.tuscany.sca.demos.aggregator.sources
+
+
+ ${basedir}/src/main/resources/Alerts.xsd
+ org.apache.tuscany.sca.demos.aggregator.types
+
+
+ true
+ true
+ true
+
+
+ generate
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-antrun-plugin
+ 1.1
+
+
+
+ ant
+ ant-trax
+ 1.6.5
+
+
+
+
+
+ install-dojo
+ validate
+
+ run
+
+
+
+
+
+
+
+
+
+
+ copy-dojo-files
+ generate-resources
+
+ run
+
+
+
+
+
+
+
+
+
+
+
+ clean-dojo-files
+ clean
+
+ run
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+
+
+ surefire-it
+ integration-test
+
+ test
+
+
+
+ **/*AlertsIntegrationTest.java
+
+
+
+
+
+
+
+ org.codehaus.cargo
+ cargo-maven2-plugin
+
+
+ start-container
+ pre-integration-test
+
+ start
+
+
+
+ stop-container
+ post-integration-test
+
+ stop
+
+
+
+
+
+ jetty6x
+ embedded
+
+ org.apache.commons.logging.impl.SimpleLog
+
+
+ false
+
+
+ 8080
+
+
+
+
+ ${project.build.directory}/${project.build.finalName}.${project.packaging}
+
+ http://localhost:8080/AlertsSourcesServiceJSONRPC
+
+
+ ${project.build.directory}/cargo-jetty
+
+
+
+
+
+ org.apache.tuscany.sca
+ tuscany-maven-ant-generator
+ 1.2-incubating
+
+
+
+ true
+
+
+ generate
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertTypeNonSDOImpl.java b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertTypeNonSDOImpl.java
new file mode 100644
index 0000000000..808374030c
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertTypeNonSDOImpl.java
@@ -0,0 +1,339 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.demos.aggregator;
+
+import org.apache.tuscany.sca.demos.aggregator.types.AlertType;
+
+
+public class AlertTypeNonSDOImpl implements AlertType
+{
+ private static final long serialVersionUID = 670364038865656196L;
+
+/**
+ * The default value of the '{@link #getTitle() Title}' attribute.
+ *
+ *
+ * @see #getTitle()
+ * @generated
+ * @ordered
+ */
+ protected static final String TITLE_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getTitle() Title}' attribute.
+ *
+ *
+ * @see #getTitle()
+ * @generated
+ * @ordered
+ */
+ protected String title = TITLE_DEFAULT_;
+
+ /**
+ * The default value of the '{@link #getSummary() Summary}' attribute.
+ *
+ *
+ * @see #getSummary()
+ * @generated
+ * @ordered
+ */
+ protected static final String SUMMARY_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getSummary() Summary}' attribute.
+ *
+ *
+ * @see #getSummary()
+ * @generated
+ * @ordered
+ */
+ protected String summary = SUMMARY_DEFAULT_;
+
+ /**
+ * The default value of the '{@link #getAddress() Address}' attribute.
+ *
+ *
+ * @see #getAddress()
+ * @generated
+ * @ordered
+ */
+ protected static final String ADDRESS_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getAddress() Address}' attribute.
+ *
+ *
+ * @see #getAddress()
+ * @generated
+ * @ordered
+ */
+ protected String address = ADDRESS_DEFAULT_;
+
+ /**
+ * The default value of the '{@link #getDate() Date}' attribute.
+ *
+ *
+ * @see #getDate()
+ * @generated
+ * @ordered
+ */
+ protected static final String DATE_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getDate() Date}' attribute.
+ *
+ *
+ * @see #getDate()
+ * @generated
+ * @ordered
+ */
+ protected String date = DATE_DEFAULT_;
+
+ /**
+ * The default value of the '{@link #getSourceId() Source Id}' attribute.
+ *
+ *
+ * @see #getSourceId()
+ * @generated
+ * @ordered
+ */
+ protected static final String SOURCE_ID_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getSourceId() Source Id}' attribute.
+ *
+ *
+ * @see #getSourceId()
+ * @generated
+ * @ordered
+ */
+ protected String sourceId = SOURCE_ID_DEFAULT_;
+
+ /**
+ * The default value of the '{@link #isUnread() Unread}' attribute.
+ *
+ *
+ * @see #isUnread()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean UNREAD_DEFAULT_ = false;
+
+ /**
+ * The cached value of the '{@link #isUnread() Unread}' attribute.
+ *
+ *
+ * @see #isUnread()
+ * @generated
+ * @ordered
+ */
+ protected boolean unread = UNREAD_DEFAULT_;
+
+ /**
+ * The default value of the '{@link #getId() Id}' attribute.
+ *
+ *
+ * @see #getId()
+ * @generated
+ * @ordered
+ */
+ protected static final String ID_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getId() Id}' attribute.
+ *
+ *
+ * @see #getId()
+ * @generated
+ * @ordered
+ */
+ protected String id = ID_DEFAULT_;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public AlertTypeNonSDOImpl()
+ {
+ super();
+ }
+
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public String getTitle()
+ {
+ return title;
+ }
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setTitle(String newTitle)
+ {
+ title = newTitle;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public String getSummary()
+ {
+ return summary;
+ }
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setSummary(String newSummary)
+ {
+ summary = newSummary;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public String getAddress()
+ {
+ return address;
+ }
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setAddress(String newAddress)
+ {
+ address = newAddress;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public String getDate()
+ {
+ return date;
+ }
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setDate(String newDate)
+ {
+ date = newDate;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public String getSourceId()
+ {
+ return sourceId;
+ }
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setSourceId(String newSourceId)
+ {
+ sourceId = newSourceId;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public boolean isUnread()
+ {
+ return unread;
+ }
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setUnread(boolean newUnread)
+ {
+ unread = newUnread;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public String getId()
+ {
+ return id;
+ }
+ /**
+ *
+ *
+ * @generated
+ */
+ public void setId(String newId)
+ {
+ id = newId;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (Title: ");
+ result.append(title);
+ result.append(", Summary: ");
+ result.append(summary);
+ result.append(", Address: ");
+ result.append(address);
+ result.append(", Date: ");
+ result.append(date);
+ result.append(", SourceId: ");
+ result.append(sourceId);
+ result.append(", Unread: ");
+ result.append(unread);
+ result.append(", Id: ");
+ result.append(id);
+ result.append(')');
+ return result.toString();
+ }
+
+} //AlertTypeImpl
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsFeedServiceImpl.java b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsFeedServiceImpl.java
new file mode 100644
index 0000000000..b062504311
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsFeedServiceImpl.java
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.demos.aggregator;
+
+import java.text.DateFormat;
+
+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.Collection;
+import org.apache.tuscany.sca.binding.atom.collection.NotFoundException;
+import org.apache.tuscany.sca.demos.aggregator.types.AlertType;
+import org.apache.tuscany.sca.demos.aggregator.types.AlertsType;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * Read all new alerts from the specified sources
+ *
+ * @version $Rev$ $Date$
+ */
+@Service(Collection.class)
+public class AlertsFeedServiceImpl implements Collection {
+
+ private AlertsService alerts;
+
+ @Reference
+ public void setAlerts(AlertsService alerts) {
+ this.alerts = alerts;
+ }
+
+ DateFormat dateFormatter = DateFormat.getDateTimeInstance();
+
+ /**
+ * Return the alerts as a feed.
+ *
+ * @return the structure containing alerts
+ */
+ public org.apache.abdera.model.Feed getFeed() {
+
+ // Create a new Feed
+ Factory factory = Abdera.getNewFactory();
+ Feed feed = factory.newFeed();
+ feed.setTitle("Apache Tuscany Feed Aggregator");
+ feed.setSubtitle("A sample showing an SCA application to aggregate various types of feeds");
+ feed.addAuthor("Apache Tuscany");
+ feed.addLink("http://incubator.apache.org/tuscany");
+
+ // Aggregate entries from feed1 and feed2
+ try {
+ AlertsType alerts = this.alerts.getAllNewAlerts("");
+
+ for( Object alertObject : alerts.getAlert() ){
+ AlertType alert = ((AlertType)alertObject);
+ Entry entry = factory.newEntry();
+ entry.setTitle(alert.getTitle());
+ //entry.(alert.getSummary());
+ entry.addLink(alert.getAddress());
+ entry.setPublished(dateFormatter.parse(alert.getDate()));
+
+ feed.addEntry(entry);
+ }
+ } catch(Exception ex) {
+ System.err.println("Exception " + ex.toString());
+ }
+
+ return feed;
+ }
+
+ public Feed query(String queryString) {
+ return getFeed();
+ }
+
+ public void delete(String id) throws NotFoundException {
+ }
+
+ public Entry get(String id) throws NotFoundException {
+ return null;
+ }
+
+ public Entry post(Entry entry) {
+ return null;
+ }
+
+ public void put(String id, Entry entry) throws NotFoundException {
+ }
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsService.java b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsService.java
new file mode 100644
index 0000000000..c4bf13ce7a
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsService.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.demos.aggregator;
+
+import org.apache.tuscany.sca.demos.aggregator.types.AlertsType;
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * Retrieve and manage alerts
+ *
+ * @version $Rev$ $Date$
+ */
+@Remotable
+public interface AlertsService {
+
+ /**
+ * Return a structure holding all of the new alerts that have been found
+ *
+ * @return the structure containing alerts
+ */
+ public AlertsType getAllNewAlerts(String id);
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsServiceImpl.java b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsServiceImpl.java
new file mode 100644
index 0000000000..28e27a9978
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsServiceImpl.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 org.apache.tuscany.sca.demos.aggregator;
+
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.tuscany.sca.demos.aggregator.types.AlertType;
+import org.apache.tuscany.sca.demos.aggregator.types.AlertsType;
+import org.apache.tuscany.sca.demos.aggregator.types.ConfigType;
+import org.apache.tuscany.sca.demos.aggregator.types.SourceType;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * Read all new alerts from the specified sources
+ *
+ * @version $Rev$ $Date$
+ */
+@Service(AlertsService.class)
+public class AlertsServiceImpl implements AlertsService {
+
+ private RSSCheckerService rssChecker;
+
+ private AlertsSourcesService alertsSources;
+
+ @Reference
+ public void setRssChecker(RSSCheckerService rssChecker) {
+ this.rssChecker = rssChecker;
+ }
+
+ @Reference
+ public void setAlertsSources(AlertsSourcesService alertsSources) {
+ this.alertsSources = alertsSources;
+ }
+
+ DateFormat dateFormatter = DateFormat.getDateTimeInstance();
+
+ /**
+ * Return a structure holding all of the new alerts that have been found
+ *
+ * @return the structure containing alerts
+ */
+ public AlertsType getAllNewAlerts(String id)
+ {
+ System.err.println("getAllNewAlerts(" + id + ")");
+
+ //TypesFactory factory = TypesFactory.INSTANCE;
+ //AlertsType returnAlerts = factory.createAlertsType();
+ AlertsType returnAlerts = new AlertsTypeNonSDOImpl();
+ List returnAlertList = returnAlerts.getAlert();
+
+ // get the date/time now so that we can update the
+ // alert source record so that next time we
+ // only get the latest alerts
+ Date now = new Date();
+ String nowString = dateFormatter.format(now);
+
+ try {
+ ConfigType alertSourceConfig = alertsSources.getAlertSources(id);
+
+ for (Object source : alertSourceConfig.getSource()){
+ SourceType sourceType = (SourceType)source;
+
+ AlertsType alerts = null;
+
+ if ( sourceType.getFeedType().equals("rss")){
+ alerts = rssChecker.getNewAlerts(sourceType.getFeedAddress(),
+ sourceType.getLastChecked());
+ } else {
+
+ }
+
+ // extend return list with any alerts we found
+ for( Object alert : alerts.getAlert() ){
+
+ // set the id on the alert so we know which source it
+ // came from
+ ((AlertType)alert).setSourceId(sourceType.getId());
+
+ // convert from SDO to POJO so that the
+ // JSONRPC binding will work. It can't currently
+ // handle SDOs
+ AlertType newAlert = new AlertTypeNonSDOImpl();
+
+ newAlert.setSourceId(((AlertType)alert).getSourceId());
+ newAlert.setTitle(((AlertType)alert).getTitle());
+ newAlert.setSummary(((AlertType)alert).getSummary());
+ newAlert.setAddress(((AlertType)alert).getAddress());
+ newAlert.setDate(((AlertType)alert).getDate());
+ newAlert.setId(((AlertType)alert).getId());
+ newAlert.setUnread(((AlertType)alert).isUnread());
+
+ returnAlertList.add(newAlert);
+ }
+
+ // update the time last checked for this source
+ sourceType.setLastChecked(nowString);
+ //alertsSources.updateAlertSource(sourceType);
+ }
+ } catch(Exception ex) {
+ System.err.println("Exception " + ex.toString());
+ }
+
+ return returnAlerts ;
+
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsSourcesService.java b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsSourcesService.java
new file mode 100644
index 0000000000..7b943b1b45
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsSourcesService.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 org.apache.tuscany.sca.demos.aggregator;
+
+import org.apache.tuscany.sca.demos.aggregator.types.ConfigType;
+import org.apache.tuscany.sca.demos.aggregator.types.SourceType;
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * Retrieve and manage alert sources
+ *
+ * @version $Rev$ $Date$
+ */
+@Remotable
+public interface AlertsSourcesService {
+
+ /**
+ * Return all of the configured alert sources.
+ *
+ * @return the list of alert sources
+ */
+ public ConfigType getAlertSources (String id);
+
+ /**
+ * Return a single alert source.
+ * @param id not currently used
+ * @return the alert source
+ */
+ public SourceType getAlertSource (String id);
+
+ /**
+ * Update an alert source.
+ *
+ * @param updatedSource the alert source to update
+ */
+ public void updateAlertSource (SourceType updatedSource);
+
+ /**
+ * Add an alert source.
+ *
+ * @param newSource the alert source to add
+ */
+ public String addAlertSource (SourceType newSource);
+
+ /**
+ * Remove an alert source.
+ *
+ * @param oldSource the alert source to remove
+ */
+ public void removeAlertSource (String id);
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsSourcesServiceImpl.java b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsSourcesServiceImpl.java
new file mode 100644
index 0000000000..ca2fc95b4a
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsSourcesServiceImpl.java
@@ -0,0 +1,183 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.demos.aggregator;
+
+import java.io.InputStream;
+import java.text.DateFormat;
+import java.util.Date;
+
+import org.apache.tuscany.sca.demos.aggregator.types.ConfigType;
+import org.apache.tuscany.sca.demos.aggregator.types.SourceType;
+import org.apache.tuscany.sca.demos.aggregator.types.TypesFactory;
+import org.apache.tuscany.sca.demos.aggregator.types.impl.SourceTypeImpl;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.XMLDocument;
+import commonj.sdo.impl.HelperProvider;
+
+/**
+ * Retrieve and manage alert sources
+ *
+ * @version $Rev$ $Date$
+ */
+@Service(AlertsSourcesService.class)
+@Scope("COMPOSITE")
+public class AlertsSourcesServiceImpl implements AlertsSourcesService {
+
+ ConfigType alertSources;
+
+ /**
+ * Constructor reads the configuration to provide
+ * the initial list of alert sources
+ */
+ public AlertsSourcesServiceImpl(){
+ System.err.println("AlertsSourcesServiceImpl()");
+ try {
+ // read the alerts config from an XML file
+ InputStream is = this.getClass().getClassLoader().getResourceAsStream("sources.xml");
+
+ if (is == null) {
+ throw new Exception("Can;t find sources.xml");
+ } else {
+ HelperContext helperContext = HelperProvider.getDefaultContext();
+ TypesFactory.INSTANCE.register(helperContext);
+ XMLDocument xmlDoc = helperContext.getXMLHelper().load(is);
+ alertSources = (ConfigType)xmlDoc.getRootObject();
+ }
+ } catch (Exception ex) {
+ System.err.println("Exception " + ex.toString());
+ }
+ }
+
+ /**
+ * Return all of the configured alert sources.
+ *
+ * @return the list of alert sources
+ */
+ public ConfigType getAlertSources (String id)
+ {
+ System.err.println("getAlertSources(" + id + ")");
+
+ // convert alert sources to POJOs so that
+ // the JSONRPC binding will work
+ ConfigTypeNonSDOImpl sources = new ConfigTypeNonSDOImpl();
+
+ for (Object source : alertSources.getSource()) {
+ SourceTypeNonSDOImpl newSource = new SourceTypeNonSDOImpl();
+ newSource.setAddress(((SourceTypeImpl)source).getAddress());
+ newSource.setFeedAddress(((SourceTypeImpl)source).getFeedAddress());
+ newSource.setId(((SourceTypeImpl)source).getId());
+ newSource.setLastChecked(((SourceTypeImpl)source).getLastChecked());
+ newSource.setName(((SourceTypeImpl)source).getName());
+ newSource.setFeedType(((SourceTypeImpl)source).getFeedType());
+ sources.getSource().add(newSource);
+ }
+
+ return sources;
+ }
+
+ /**
+ * Return a single alert source.
+ * @param id the alert source id number
+ * @return the alert source
+ */
+ public SourceType getAlertSource (String id)
+ {
+ System.err.println("getAlertSource(" + id + ")");
+ SourceType alertSource = null;
+
+ for (Object source : alertSources.getSource()) {
+ if ( ((SourceType)source).getId().equals(id)) {
+ alertSource = (SourceType)source;
+ }
+ }
+ return alertSource;
+ }
+
+ /**
+ * Update an alert source.
+ *
+ * @param updatedSource the alert source to update
+ */
+ public void updateAlertSource (SourceType updatedSource)
+ {
+ System.err.println("updateAlertSource()");
+
+ Object originalSource = null;
+
+ for (Object source : alertSources.getSource()) {
+ if ( ((SourceType)source).getId().equals(updatedSource.getId())) {
+ originalSource = source;
+ break;
+ }
+ }
+
+ if (originalSource != null){
+ alertSources.getSource().add(updatedSource);
+ alertSources.getSource().remove(originalSource);
+ }
+ }
+
+ /**
+ * Add an alert source.
+ *
+ * @param newSource the alert source to add
+ */
+ public String addAlertSource (SourceType newSource)
+ {
+ System.err.println("addAlertSource()");
+ // set the date to now less 2 hours so we
+ // get some alerts straight away
+ DateFormat dateFormatter = DateFormat.getDateTimeInstance();
+ Date now = new Date();
+ now.setHours(now.getHours()-2);
+ String nowString = dateFormatter.format(now);
+ newSource.setLastChecked(nowString);
+ alertSources.getSource().add(newSource);
+ return "Done";
+ }
+
+ /**
+ * Remove an alert source.
+ *
+ * @param oldSource the alert source to remove
+ */
+ public void removeAlertSource (String id)
+ {
+ System.err.println("removeAlertSource()");
+
+ Object originalSource = null;
+
+ for (Object source : alertSources.getSource()) {
+ if ( ((SourceType)source).getId().equals(id)) {
+ originalSource = source;
+ break;
+ }
+ }
+
+ if (originalSource != null) {
+ alertSources.getSource().remove(originalSource);
+ }
+
+ }
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsTypeNonSDOImpl.java b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsTypeNonSDOImpl.java
new file mode 100644
index 0000000000..2962defb25
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsTypeNonSDOImpl.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 org.apache.tuscany.sca.demos.aggregator;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tuscany.sca.demos.aggregator.types.AlertsType;
+
+/**
+ *
+ * An implementation of the model object 'Alerts Type'.
+ *
+ *
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/META-INF/sca-contribution.xml b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..0bc67c4c98
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/META-INF/sca-contribution.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/WEB-INF/geronimo-web.xml b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/WEB-INF/geronimo-web.xml
new file mode 100644
index 0000000000..56def114e3
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/WEB-INF/geronimo-web.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+ org.apache.tuscany.sca
+ demo-alert-aggregator-webapp
+ 1.2-incubating
+ war
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/WEB-INF/web.xml b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000000..a81165e1b4
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+ Apache Tuscany Alert Aggregator Demo
+
+
+ tuscany
+ org.apache.tuscany.sca.host.webapp.TuscanyServletFilter
+
+
+
+ tuscany
+ /*
+
+
+
+ AlertAggregator.html
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/pop.png b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/pop.png
new file mode 100644
index 0000000000..1cf1df24a7
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/pop.png differ
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/rss.png b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/rss.png
new file mode 100644
index 0000000000..b3c949d224
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/rss.png differ
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/service.smd b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/service.smd
new file mode 100644
index 0000000000..bc77e39bf9
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/service.smd
@@ -0,0 +1 @@
+{"SMDVersion":".1","objectName":"AlertsService","serviceType":"JSON-RPC","serviceURL":"http://localhost:8080/sample-feed-aggregator/services/AlertsServiceJSONRPC","methods":[{"name":"getAllNewAlerts","parameters":[{"name":"param0","type":"STRING"}]}]}
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/sources.smd b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/sources.smd
new file mode 100644
index 0000000000..b5f1824363
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/sources.smd
@@ -0,0 +1 @@
+{"SMDVersion":".1","objectName":"AlertsSourcesService","serviceType":"JSON-RPC","serviceURL":"http://localhost:8081/sample-feed-aggregator/services/AlertsSourcesServiceJSONRPC","methods":[{"name":"getAlertSources","parameters":[{"name":"param0","type":"STRING"}]},{"name":"getAlertSource","parameters":[{"name":"param0","type":"STRING"}]},{"name":"updateAlertSource","parameters":[{"name":"param0","type":"STRING"}]},{"name":"addAlertSource","parameters":[{"name":"param0","type":"STRING"}]},{"name":"removeAlertSource","parameters":[{"name":"param0","type":"STRING"}]}]}
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/style.css b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/style.css
new file mode 100644
index 0000000000..f5bbf23379
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/main/webapp/style.css
@@ -0,0 +1,176 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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;
+}
+
+.source_1
+{
+background-color: LightSkyBlue;
+}
+
+.source_2
+{
+background-color: Khaki;
+}
+
+.source_3
+{
+background-color: LightPink;
+}
+
+.source_4
+{
+background-color: Orange;
+}
+
+.source_5
+{
+background-color: LightCoral;
+}
+
+.source_6
+{
+background-color: Orchid;
+}
+
+.source_7
+{
+background-color: Peru;
+}
+
+.source_8
+{
+background-color: SpringGreen;
+}
+
+.source_9
+{
+background-color: LightGrey;
+}
+
diff --git a/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/test/java/org/apache/tuscany/sca/demos/aggregator/AlertsIntegrationTest.java b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/test/java/org/apache/tuscany/sca/demos/aggregator/AlertsIntegrationTest.java
new file mode 100644
index 0000000000..6e75ea0bdf
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/alert-aggregator-webapp/src/test/java/org/apache/tuscany/sca/demos/aggregator/AlertsIntegrationTest.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 org.apache.tuscany.sca.demos.aggregator;
+
+import java.io.ByteArrayInputStream;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.json.JSONObject;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import com.meterware.httpunit.PostMethodWebRequest;
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
+
+
+/**
+ */
+public class AlertsIntegrationTest {
+ //private static SCADomain scaDomain;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ //scaDomain = SCADomain.newInstance("alerts.composite");
+ }
+
+ /**
+ * Runs after each test method
+ */
+ @AfterClass
+ public static void tearDown() {
+ //scaDomain.close();
+ }
+
+/* Use this if you want to test locally without deploying to a web container
+ public void testWait() throws Exception {
+ System.out.println("Feed aggregator server started (press enter to shutdown)");
+ System.in.read();
+ System.out.println("Feed aggregator server stopped");
+ }
+*/
+
+ @Test
+ public void testGetAllNewAlerts() throws Exception {
+ JSONObject jsonRequest = new JSONObject("{\"params\":[\"sometext\"],\"method\":\"getAllNewAlerts\",\"id\":2}");
+ JSONObject jsonResp = callService ("http://localhost:8080/demo-alert-aggregator-webapp/AlertsServiceJSONRPC",
+ jsonRequest);
+ Assert.assertNotNull(jsonResp);
+ }
+
+ @Test
+ public void testAddAlertSources() throws Exception {
+ JSONObject jsonRequest = new JSONObject("{\"params\":[{\"name\":\"news\",\"id\":\"2\",\"address\":\"www.news.com\",\"feedAddress\":\"http://news.com.com/2547-1_3-0-20.xml\",\"feedType\":\"rss\",\"lastChecked\":\"lastChecked\",\"javaClass\":\"org.apache.tuscany.sca.demos.aggregator.types.impl.SourceTypeImpl\"}],\"method\":\"addAlertSource\",\"id\":2}");
+ JSONObject jsonResp = callService ("http://localhost:8080/demo-alert-aggregator-webapp/AlertsSourcesServiceJSONRPC",
+ jsonRequest);
+ Assert.assertNotNull(jsonResp);
+ }
+
+ @Test
+ public void testGetAlertSources() throws Exception {
+ JSONObject jsonRequest = new JSONObject("{\"params\":[\"sometext\"],\"method\":\"getAlertSources\",\"id\":2}");
+ JSONObject jsonResp = callService ("http://localhost:8080/demo-alert-aggregator-webapp/AlertsSourcesServiceJSONRPC",
+ jsonRequest);
+ Assert.assertEquals("BBC News", jsonResp.getJSONObject("result").getJSONObject("source").optJSONArray("list").getJSONObject(0).getString("name"));
+ }
+
+ public JSONObject callService(String url, JSONObject jsonRequest) throws Exception {
+ System.out.println("Request = " + jsonRequest.toString());
+ WebConversation wc = new WebConversation();
+ WebRequest request = new PostMethodWebRequest( url,
+ new ByteArrayInputStream(jsonRequest.toString().getBytes("UTF-8")),"application/json");
+ WebResponse response = wc.getResource(request);
+ System.out.println("Response= " + response.getText());
+ Assert.assertEquals(200, response.getResponseCode());
+ return new JSONObject(response.getText());
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/DISCLAIMER b/tags/java/sca/1.2-RC3a/demos/bigbank-account/DISCLAIMER
new file mode 100644
index 0000000000..d68a410903
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/DISCLAIMER
@@ -0,0 +1,8 @@
+Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/LICENSE b/tags/java/sca/1.2-RC3a/demos/bigbank-account/LICENSE
new file mode 100644
index 0000000000..8aa906c321
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/LICENSE
@@ -0,0 +1,205 @@
+
+ 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.
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/NOTICE b/tags/java/sca/1.2-RC3a/demos/bigbank-account/NOTICE
new file mode 100644
index 0000000000..fdfa0e9faa
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/NOTICE
@@ -0,0 +1,6 @@
+${pom.name}
+Copyright (c) 2005 - 2008 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/README b/tags/java/sca/1.2-RC3a/demos/bigbank-account/README
new file mode 100644
index 0000000000..5c0d850c5e
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/README
@@ -0,0 +1,4 @@
+bigbank-account is part of a larger demo called bigbank.
+Please see the Readme file under bigbank to understand how bigbank-account fits into the overall demo.
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/bigbank.png b/tags/java/sca/1.2-RC3a/demos/bigbank-account/bigbank.png
new file mode 100644
index 0000000000..985cc6bd05
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/bigbank-account/bigbank.png differ
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/bigbank.svg b/tags/java/sca/1.2-RC3a/demos/bigbank-account/bigbank.svg
new file mode 100644
index 0000000000..0650075d48
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/bigbank.svg
@@ -0,0 +1,537 @@
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/build-dojo.xml b/tags/java/sca/1.2-RC3a/demos/bigbank-account/build-dojo.xml
new file mode 100644
index 0000000000..0e029c6335
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/build-dojo.xml
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/build.xml b/tags/java/sca/1.2-RC3a/demos/bigbank-account/build.xml
new file mode 100644
index 0000000000..76c9840d3d
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/build.xml
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/pom.xml b/tags/java/sca/1.2-RC3a/demos/bigbank-account/pom.xml
new file mode 100644
index 0000000000..3403b8edbb
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/pom.xml
@@ -0,0 +1,72 @@
+
+
+
+ 4.0.0
+
+ org.apache.tuscany.sca
+ tuscany-demos
+ 1.2-incubating
+ ../pom.xml
+
+ demo-bigbank-account
+ jar
+ Apache Tuscany SCA BigBank Account Demo
+
+
+
+ apache.incubator
+ http://people.apache.org/repo/m2-incubating-repository
+
+
+
+
+
+ org.apache.tuscany.sca
+ tuscany-core-spi
+ 1.2-incubating
+
+
+
+
+ org.apache.ws.security
+ wss4j
+ 1.5.3
+
+
+
+
+ demo-bigbank-account
+
+
+ org.apache.maven.plugins
+ maven-antrun-plugin
+
+
+
+ ant
+ ant-trax
+ 1.6.5
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/checking/CheckingAccountDetails.java b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/checking/CheckingAccountDetails.java
new file mode 100644
index 0000000000..57c1adcba0
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/checking/CheckingAccountDetails.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 bigbank.account.checking;
+
+/**
+ * @version $$Rev$$ $$Date: 2007-04-09 12:03:34 -0700 (Mon, 09 Apr
+ * 2007) $$
+ */
+
+public class CheckingAccountDetails {
+ private String accountNumber;
+ private double balance;
+
+ public String getAccountNumber() {
+ return accountNumber;
+ }
+
+ public void setAccountNumber(String n) {
+ this.accountNumber = n;
+ }
+
+ public double getBalance() {
+ return balance;
+ }
+
+ public void setBalance(double b) {
+ this.balance = b;
+ }
+
+ @Override
+ public String toString() {
+ return accountNumber + ", balance:" + balance;
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/checking/CheckingAccountService.java b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/checking/CheckingAccountService.java
new file mode 100644
index 0000000000..bf919525c4
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/checking/CheckingAccountService.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 bigbank.account.checking;
+
+import org.osoa.sca.annotations.Remotable;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * @version $$Rev$$ $$Date$$
+ */
+@Service
+@Remotable
+public interface CheckingAccountService {
+
+ public CheckingAccountDetails getAccountDetails(String customerID);
+
+ public double deposit(String accountNo, double depositAmt);
+
+ public double withdraw(String accountNo, double withdrawalAmount);
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/checking/CheckingAccountServiceImpl.java b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/checking/CheckingAccountServiceImpl.java
new file mode 100644
index 0000000000..0ed4b1dd2e
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/checking/CheckingAccountServiceImpl.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 bigbank.account.checking;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.osoa.sca.annotations.Service;
+
+/**
+ *
+ * */
+
+@Service(CheckingAccountService.class)
+public class CheckingAccountServiceImpl implements CheckingAccountService {
+ private Map custAcctMap = new HashMap();
+ private Map checkingAccts = new HashMap();
+
+ public CheckingAccountServiceImpl() {
+ custAcctMap.put("Customer_01", "CHA_Customer_01");
+ custAcctMap.put("Customer_02", "CHA_Customer_02");
+ custAcctMap.put("Customer_03", "CHA_Customer_03");
+
+ checkingAccts.put("CHA_Customer_01", new Double(1000));
+ checkingAccts.put("CHA_Customer_02", new Double(1500));
+ checkingAccts.put("CHA_Customer_03", new Double(2000));
+ }
+
+ public double deposit(String accountNo, double depositAmt) {
+ checkingAccts.put(accountNo, new Double(checkingAccts.get(accountNo).doubleValue() + depositAmt));
+ return checkingAccts.get(accountNo).doubleValue();
+ }
+
+ public CheckingAccountDetails getAccountDetails(String customerID) {
+ CheckingAccountDetails checkingAccount = new CheckingAccountDetails();
+ checkingAccount.setAccountNumber(custAcctMap.get(customerID));
+ checkingAccount.setBalance(checkingAccts.get(checkingAccount.getAccountNumber()).doubleValue());
+
+ return checkingAccount;
+ }
+
+ public double withdraw(String accountNo, double withdrawalAmount) {
+ double balance = checkingAccts.get(accountNo).doubleValue();
+ if ( balance - withdrawalAmount > 0 ) {
+ balance = balance - withdrawalAmount;
+ checkingAccts.put(accountNo, balance);
+ }
+ return balance;
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/savings/SavingsAccountDetails.java b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/savings/SavingsAccountDetails.java
new file mode 100644
index 0000000000..cc9023da60
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/savings/SavingsAccountDetails.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 bigbank.account.savings;
+
+import java.io.Serializable;
+
+/**
+ * @version $$Rev$$ $$Date: 2007-04-09 12:03:34 -0700 (Mon, 09 Apr
+ * 2007) $$
+ */
+
+public class SavingsAccountDetails implements Serializable {
+ private String accountNumber;
+ private double balance;
+
+ public String getAccountNumber() {
+ return accountNumber;
+ }
+
+ public void setAccountNumber(String n) {
+ this.accountNumber = n;
+ }
+
+ public double getBalance() {
+ return balance;
+ }
+
+ public void setBalance(double b) {
+ this.balance = b;
+ }
+
+ @Override
+ public String toString() {
+ return accountNumber + ", balance:" + balance;
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/savings/SavingsAccountService.java b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/savings/SavingsAccountService.java
new file mode 100644
index 0000000000..5bf6e6d26b
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/savings/SavingsAccountService.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 bigbank.account.savings;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * @version $$Rev$$ $$Date$$
+ */
+@Remotable
+public interface SavingsAccountService {
+
+ public SavingsAccountDetails getAccountDetails(String customerID);
+
+ public double deposit(String accountNo, double depositAmt);
+
+ public double withdraw(String accountNo, double withdrawalAmount);
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/savings/SavingsAccountServiceImpl.java b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/savings/SavingsAccountServiceImpl.java
new file mode 100644
index 0000000000..1f4f02ea6d
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/savings/SavingsAccountServiceImpl.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 bigbank.account.savings;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.osoa.sca.annotations.Service;
+
+/**
+ *
+ * */
+
+@Service(SavingsAccountService.class)
+public class SavingsAccountServiceImpl implements SavingsAccountService {
+ private Map custAcctMap = new HashMap();
+ private Map savingsAccts = new HashMap();
+
+ public SavingsAccountServiceImpl() {
+ custAcctMap.put("Customer_01", "SVA_Customer_01");
+ custAcctMap.put("Customer_02", "SVA_Customer_02");
+ custAcctMap.put("Customer_03", "SVA_Customer_03");
+
+ savingsAccts.put("SVA_Customer_01", new Double(1000));
+ savingsAccts.put("SVA_Customer_02", new Double(1500));
+ savingsAccts.put("SVA_Customer_03", new Double(2000));
+ }
+
+ public double deposit(String accountNo, double depositAmt) {
+ savingsAccts.put(accountNo, new Double(savingsAccts.get(accountNo).doubleValue() + depositAmt));
+ return savingsAccts.get(accountNo).doubleValue();
+ }
+
+ public SavingsAccountDetails getAccountDetails(String customerID) {
+ SavingsAccountDetails savingsAccount = new SavingsAccountDetails();
+ savingsAccount.setAccountNumber(custAcctMap.get(customerID));
+ savingsAccount.setBalance(savingsAccts.get(savingsAccount.getAccountNumber()).doubleValue());
+
+ return savingsAccount;
+ }
+
+ public double withdraw(String accountNo, double withdrawalAmount) {
+ double balance = savingsAccts.get(accountNo).doubleValue();
+ if ( balance - withdrawalAmount > 0 ) {
+ balance = balance - withdrawalAmount;
+ savingsAccts.put(accountNo, balance);
+ }
+ return balance;
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/AccountsDataPasswordCallbackHandler.java b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/AccountsDataPasswordCallbackHandler.java
new file mode 100644
index 0000000000..579b4ee64b
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/AccountsDataPasswordCallbackHandler.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 bigbank.account.security;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ * Sample userid passwd generation class
+ */
+public class AccountsDataPasswordCallbackHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+ if ( pwcb.getUsage() == WSPasswordCallback.SIGNATURE ) {
+ System.out.println(" Usage is SIGNATURE ... ");
+ pwcb.setPassword("bbservice");
+ } else if ( pwcb.getUsage() == WSPasswordCallback.USERNAME_TOKEN_UNKNOWN ) {
+ System.out.println("*** Calling ACCOUNTS-DATA Passwd Handler for AUTHENTICATING userID = "
+ + pwcb.getIdentifer() + " and password = " + pwcb.getPassword() );
+ if ( pwcb.getIdentifer().equals("bbaservice") && pwcb.getPassword().equals("bbaservice")) {
+ System.out.println("AUTHENTICATION SUCCESSFUL!");
+ } else {
+ System.out.println("AUTHENTICATION FAILED!");
+ throw new UnsupportedCallbackException(pwcb, "UserId - Password Authentication Failed!");
+ }
+ }
+ }
+ }
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/BigbankCheckingsAcl.java b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/BigbankCheckingsAcl.java
new file mode 100644
index 0000000000..5c64e11d10
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/BigbankCheckingsAcl.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 bigbank.account.security;
+
+import java.security.Principal;
+import java.util.Hashtable;
+import java.util.Map;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class BigbankCheckingsAcl {
+ private static MapcheckingsAcl = new Hashtable();
+
+ static {
+ checkingsAcl.put("bbaservice", "Customer_01");
+ checkingsAcl.put("bbUser01", "Customer_01");
+ }
+
+
+ public static void authorize(Principal principal, String resource) {
+ if ( checkingsAcl.get(principal.getName()) == null ||
+ !checkingsAcl.get(principal.getName()).equals(resource) ) {
+ throw new RuntimeException("User - " + principal.getName() + " not authorized to access account " +
+ resource);
+ } else {
+ System.out.println("Successfully Authorized '" + principal.getName() + " to access accounts of " + resource);
+ }
+ }
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthImplementationPolicyProvider.java b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthImplementationPolicyProvider.java
new file mode 100644
index 0000000000..c98dcacbf3
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthImplementationPolicyProvider.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 bigbank.account.security;
+
+import org.apache.tuscany.sca.assembly.ConfiguredOperation;
+import org.apache.tuscany.sca.assembly.Implementation;
+import org.apache.tuscany.sca.assembly.OperationsConfigurator;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Interceptor;
+import org.apache.tuscany.sca.invocation.Phase;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.provider.PolicyProvider;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class CheckingsDeptAuthImplementationPolicyProvider implements PolicyProvider {
+ private RuntimeComponent component;
+ private Implementation implementation;
+
+ public CheckingsDeptAuthImplementationPolicyProvider(RuntimeComponent component, Implementation implementation) {
+ super();
+ this.component = component;
+ this.implementation = implementation;
+ }
+
+ private String getContext() {
+ return "component.implementation: " + component.getURI() + "(" + implementation.getClass().getName() + ")";
+ }
+
+ private PolicySet findPolicySet(Operation operation) {
+ for (PolicySet ps : component.getPolicySets()) {
+ for (Object p : ps.getPolicies()) {
+ if (CheckingsDeptAuthPolicy.class.isInstance(p)) {
+ return ps;
+ }
+ }
+ }
+
+ if ( component instanceof OperationsConfigurator ) {
+ for ( ConfiguredOperation confOp : ((OperationsConfigurator)component).getConfiguredOperations() ) {
+ if ( confOp.getName().equals(operation.getName())) {
+ for (PolicySet ps : confOp.getPolicySets()) {
+ for (Object p : ps.getPolicies()) {
+ if (CheckingsDeptAuthPolicy.class.isInstance(p)) {
+ return ps;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation)
+ */
+ public Interceptor createInterceptor(Operation operation) {
+ PolicySet ps = findPolicySet(operation);
+ return ps == null ? null : new CheckingsDeptAuthPolicyInterceptor(getContext(), operation, ps);
+ }
+
+ /**
+ * @see org.apache.tuscany.sca.provider.PolicyProvider#getPhase()
+ */
+ public String getPhase() {
+ return Phase.IMPLEMENTATION_POLICY;
+ }
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthPolicy.java b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthPolicy.java
new file mode 100644
index 0000000000..b6b8417045
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthPolicy.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 bigbank.account.security;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.policy.Policy;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class CheckingsDeptAuthPolicy implements Policy {
+
+ public QName getSchemaName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean isUnresolved() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthPolicyInterceptor.java b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthPolicyInterceptor.java
new file mode 100644
index 0000000000..c8b73d4ed4
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthPolicyInterceptor.java
@@ -0,0 +1,77 @@
+package bigbank.account.security;
+
+import java.security.Principal;
+import java.util.logging.ConsoleHandler;
+import java.util.logging.Handler;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Interceptor;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+import org.apache.tuscany.sca.policy.PolicySet;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Policy handler to handle PolicySet related to Logging with the QName
+ * {http://tuscany.apache.org/xmlns/sca/1.0/impl/java}LoggingPolicy
+ */
+public class CheckingsDeptAuthPolicyInterceptor implements Interceptor {
+ private Invoker next;
+
+ public CheckingsDeptAuthPolicyInterceptor(String context, Operation operation, PolicySet policySet) {
+ super();
+ init();
+ }
+
+ private final void init() {
+ }
+
+ public Message invoke(Message msg) {
+ Object msgBody = msg.getBody();
+ if (msgBody instanceof Object[]) {
+ Object args[] = (Object[])msg.getBody();
+ if ( msg.getQoSContext().get(Message.QOS_CTX_SECURITY_PRINCIPAL) != null ) {
+ BigbankCheckingsAcl.authorize((Principal)msg.getQoSContext().get(Message.QOS_CTX_SECURITY_PRINCIPAL),
+ (String)args[0]);
+ }
+ }
+
+ Message responseMsg = null;
+ try {
+ responseMsg = getNext().invoke(msg);
+ return responseMsg;
+ } catch (RuntimeException e) {
+ throw e;
+ }
+ }
+
+ public Invoker getNext() {
+ return next;
+ }
+
+ public void setNext(Invoker next) {
+ this.next = next;
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthPolicyProviderFactory.java b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthPolicyProviderFactory.java
new file mode 100644
index 0000000000..5fecef691e
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthPolicyProviderFactory.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 bigbank.account.security;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.Implementation;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.provider.PolicyProvider;
+import org.apache.tuscany.sca.provider.PolicyProviderFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class CheckingsDeptAuthPolicyProviderFactory implements PolicyProviderFactory {
+ private ExtensionPointRegistry registry;
+
+ public CheckingsDeptAuthPolicyProviderFactory(ExtensionPointRegistry registry) {
+ super();
+ this.registry = registry;
+ }
+
+ /**
+ * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createImplementationPolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.assembly.Implementation)
+ */
+ public PolicyProvider createImplementationPolicyProvider(RuntimeComponent component, Implementation implementation) {
+ return new CheckingsDeptAuthImplementationPolicyProvider(component, implementation);
+ }
+
+ /**
+ * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createReferencePolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.runtime.RuntimeComponentReference, org.apache.tuscany.sca.assembly.Binding)
+ */
+ public PolicyProvider createReferencePolicyProvider(RuntimeComponent component,
+ RuntimeComponentReference reference,
+ Binding binding) {
+ return null;
+ }
+
+ /**
+ * @see org.apache.tuscany.sca.provider.PolicyProviderFactory#createServicePolicyProvider(org.apache.tuscany.sca.runtime.RuntimeComponent, org.apache.tuscany.sca.runtime.RuntimeComponentService, org.apache.tuscany.sca.assembly.Binding)
+ */
+ public PolicyProvider createServicePolicyProvider(RuntimeComponent component,
+ RuntimeComponentService service,
+ Binding binding) {
+ return null;
+ }
+
+ /**
+ * @see org.apache.tuscany.sca.provider.ProviderFactory#getModelType()
+ */
+ public Class getModelType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthorizationPolicyHandler.java b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthorizationPolicyHandler.java
new file mode 100644
index 0000000000..419b5def58
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthorizationPolicyHandler.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 bigbank.account.security;
+
+import java.security.Principal;
+
+import org.apache.tuscany.sca.invocation.Message;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.policy.util.PolicyHandler;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class CheckingsDeptAuthorizationPolicyHandler implements PolicyHandler {
+ private PolicySet applicablePolicySet = null;
+
+ public void afterInvoke(Object... context) {
+ }
+
+ public void beforeInvoke(Object... context) {
+ for ( int count = 0 ; count < context.length ; ++count ) {
+ if ( context[count] instanceof Message ) {
+ Message msg = (Message)context[count];
+ Object args[] = (Object[])msg.getBody();
+ if ( msg.getQoSContext().get(Message.QOS_CTX_SECURITY_PRINCIPAL) != null ) {
+ BigbankCheckingsAcl.authorize((Principal)msg.getQoSContext().get(Message.QOS_CTX_SECURITY_PRINCIPAL),
+ (String)args[0]);
+ }
+ }
+ }
+ }
+
+ public void cleanUp(Object... arg0) {
+ }
+
+ public PolicySet getApplicablePolicySet() {
+ return this.applicablePolicySet;
+ }
+
+ public void setApplicablePolicySet(PolicySet policySet) {
+ this.applicablePolicySet = policySet;
+ }
+
+ public void setUp(Object... arg0) {
+
+ }
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthorizationPolicyProcessor.java b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthorizationPolicyProcessor.java
new file mode 100644
index 0000000000..da1b6e1d06
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/security/CheckingsDeptAuthorizationPolicyProcessor.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank.account.security;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.service.ContributionReadException;
+import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
+
+/**
+ * Implementation of a Policy Processor
+ *
+ */
+public class CheckingsDeptAuthorizationPolicyProcessor implements StAXArtifactProcessor {
+ private static final QName CHECKINGS_DEPT_AUTHORIZATION_POLICY_QNAME = new QName("http://bigbank/checkings", "AuthPolicy");
+ public QName getArtifactType() {
+ return CHECKINGS_DEPT_AUTHORIZATION_POLICY_QNAME;
+ }
+
+ public CheckingsDeptAuthorizationPolicyProcessor(ModelFactoryExtensionPoint modelFactories) {
+ }
+
+
+ public CheckingsDeptAuthPolicy read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
+ CheckingsDeptAuthPolicy policy = new CheckingsDeptAuthPolicy();
+ return policy;
+ }
+
+ public void write(CheckingsDeptAuthPolicy policy, XMLStreamWriter writer) throws ContributionWriteException,
+ XMLStreamException {
+ String prefix = "tuscany";
+ writer.writeStartElement(prefix,
+ CHECKINGS_DEPT_AUTHORIZATION_POLICY_QNAME.getLocalPart(),
+ CHECKINGS_DEPT_AUTHORIZATION_POLICY_QNAME.getNamespaceURI());
+ writer.writeNamespace("chk", "http://bigbank/checkings");
+
+
+ writer.writeEndElement();
+ }
+
+ public Class getModelType() {
+ return CheckingsDeptAuthPolicy.class;
+ }
+
+ public void resolve(CheckingsDeptAuthPolicy arg0, ModelResolver arg1) throws ContributionResolveException {
+
+ }
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/stock/StockAccountDetails.java b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/stock/StockAccountDetails.java
new file mode 100644
index 0000000000..1473436000
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/stock/StockAccountDetails.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 bigbank.account.stock;
+
+/**
+ * @version $$Rev$$ $$Date: 2007-04-09 12:03:34 -0700 (Mon, 09 Apr
+ * 2007) $$
+ */
+
+public class StockAccountDetails {
+ private String accountNumber;
+ private String symbol;
+ private int quantity;
+
+ public StockAccountDetails() {
+ }
+
+ public StockAccountDetails(String acNo, String symbol, int qty) {
+ this.accountNumber = acNo;
+ this.symbol = symbol;
+ this.quantity = qty;
+ }
+
+ public String getAccountNumber() {
+ return accountNumber;
+ }
+
+ public void setAccountNumber(String n) {
+ this.accountNumber = n;
+ }
+
+ public int getQuantity() {
+ return quantity;
+ }
+
+ public void setQuantity(int a) {
+ this.quantity = a;
+ }
+
+ public String getSymbol() {
+ return symbol;
+ }
+
+ public void setSymbol(String s) {
+ this.symbol = s;
+ }
+
+ @Override
+ public String toString() {
+ return accountNumber + ", symbol:" + symbol + ", quantity:" + quantity;
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/stock/StockAccountService.java b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/stock/StockAccountService.java
new file mode 100644
index 0000000000..fcbf8a4831
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/stock/StockAccountService.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 bigbank.account.stock;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ *
+ */
+@Remotable
+public interface StockAccountService {
+
+ public StockAccountDetails getAccountDetails(String customerID);
+
+ public StockAccountDetails buy(String accountNo, String symbol, int quantity);
+
+ public StockAccountDetails sell(String accountNo, String symbol, int quantity);
+
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/stock/StockAccountServiceImpl.java b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/stock/StockAccountServiceImpl.java
new file mode 100644
index 0000000000..28101a1986
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/java/bigbank/account/stock/StockAccountServiceImpl.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 bigbank.account.stock;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.osoa.sca.annotations.Service;
+
+/**
+ *
+ * */
+
+@Service(StockAccountService.class)
+public class StockAccountServiceImpl implements StockAccountService {
+ private Map custAcctMap = new HashMap();
+ private Map stockAccts = new HashMap();
+
+ public StockAccountServiceImpl() {
+ custAcctMap.put("Customer_01", "STA_Customer_01");
+ custAcctMap.put("Customer_02", "STA_Customer_02");
+ custAcctMap.put("Customer_03", "STA_Customer_03");
+
+ stockAccts.put("STA_Customer_01", new StockAccountDetails("STA_Customer_01", "IBM", 100));
+ stockAccts.put("STA_Customer_02", new StockAccountDetails("STA_Customer_02", "IBM", 200));
+ stockAccts.put("STA_Customer_03", new StockAccountDetails("STA_Customer_03", "SYM_3", 125));
+ }
+
+
+ public StockAccountDetails buy(String accountNo, String symbol, int quantity) {
+ return null;
+ }
+
+ public StockAccountDetails getAccountDetails(String customerID) {
+ return stockAccts.get(custAcctMap.get(customerID));
+ }
+
+ public StockAccountDetails sell(String accountNo, String symbol, int quantity) {
+ return null;
+ }
+
+
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/CheckingsAccount.composite b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/CheckingsAccount.composite
new file mode 100644
index 0000000000..cc76e30a75
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/CheckingsAccount.composite
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..c5532b879d
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
new file mode 100644
index 0000000000..6491a0d326
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Implementation class for the artifact processor extension
+bigbank.account.security.CheckingsDeptAuthorizationPolicyProcessor;qname=http://bigbank/checkings#AuthPolicy,model=bigbank.account.security.CheckingsDeptAuthPolicy
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler
new file mode 100644
index 0000000000..b1bce4339d
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# PolicyHandlerClasses to interpret specific PolicyModels against specific QoS infrastructures
+# handler classname;qname=;model=
+bigbank.account.security.CheckingsDeptAuthorizationPolicyHandler;intent=http://bigbankAccount#authorization,model=bigbank.account.security.CheckingsDeptAuthPolicy
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
new file mode 100644
index 0000000000..d6bfe2167e
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Implementation class for the policy extension
+bigbank.account.security.CheckingsDeptAuthPolicyProviderFactory;model=bigbank.account.security.CheckingsDeptAuthPolicy
\ No newline at end of file
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/SavingsAccount.composite b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/SavingsAccount.composite
new file mode 100644
index 0000000000..696b96d6e6
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/SavingsAccount.composite
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/StockAccount.composite b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/StockAccount.composite
new file mode 100644
index 0000000000..62c0b63003
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/StockAccount.composite
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/definitions.xml b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/definitions.xml
new file mode 100644
index 0000000000..31a8798f8b
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/definitions.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+ Authorization Intent
+
+
+
+
+
+
+
+
+ UsernameToken
+ bigbank.account.security.AccountsDataPasswordCallbackHandler
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/web/AccountJSON.html b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/web/AccountJSON.html
new file mode 100644
index 0000000000..1609bf4b43
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/web/AccountJSON.html
@@ -0,0 +1,92 @@
+
+
+
+Tuscany JSON-RPC BigBank Client
+
+
+
+
+
+
+
+
+
+
+
+
+
It then creates a Dojo button that will envoke the getAccountReport
+ method of the accountService object.
+
+
+
Request
+
Response
+
+
+
+
+
+
+
+
None Yet.
+
+
+
+
+
Dojo Debug:
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/web/style.css b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/web/style.css
new file mode 100644
index 0000000000..1071583264
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/web/style.css
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+* { font-family: arial; }
+
+table, th, td { border: 2px solid blue; border-collapse: collapse; }
+th { color: white; background-color: blue; }
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/wsdl/AccountService.wsdl b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/wsdl/AccountService.wsdl
new file mode 100644
index 0000000000..ac4d987a57
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-account/src/main/resources/wsdl/AccountService.wsdl
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/DISCLAIMER b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/DISCLAIMER
new file mode 100644
index 0000000000..d68a410903
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/DISCLAIMER
@@ -0,0 +1,8 @@
+Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/LICENSE b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/LICENSE
new file mode 100644
index 0000000000..8aa906c321
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/LICENSE
@@ -0,0 +1,205 @@
+
+ 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.
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/NOTICE b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/NOTICE
new file mode 100644
index 0000000000..fdfa0e9faa
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/NOTICE
@@ -0,0 +1,6 @@
+${pom.name}
+Copyright (c) 2005 - 2008 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/README b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/README
new file mode 100644
index 0000000000..e8ff28fc0f
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/README
@@ -0,0 +1,2 @@
+bigbank-calculator is part of a larger demo called bigbank.
+Please see the Readme file under bigbank to understand how bigbank-calculator fits into the overall demo.
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/build.xml b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/build.xml
new file mode 100644
index 0000000000..8ba09a86aa
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/build.xml
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/pom.xml b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/pom.xml
new file mode 100644
index 0000000000..6a6eaf94b4
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/pom.xml
@@ -0,0 +1,78 @@
+
+
+
+ 4.0.0
+
+ org.apache.tuscany.sca
+ tuscany-demos
+ 1.2-incubating
+ ../pom.xml
+
+ demo-bigbank-calculator
+ Apache Tuscany SCA BigBank Calculator Demo
+
+
+
+ apache.incubator
+ http://people.apache.org/repo/m2-incubating-repository
+
+
+
+
+
+ org.apache.tuscany.sca
+ tuscany-host-embedded
+ 1.2-incubating
+
+
+
+ org.apache.tuscany.sca
+ tuscany-implementation-java-runtime
+ 1.2-incubating
+ runtime
+
+
+
+ org.apache.tuscany.sca
+ tuscany-implementation-script
+ 1.2-incubating
+ runtime
+
+
+
+ org.apache.tuscany.sca
+ tuscany-binding-rmi
+ 1.2-incubating
+ runtime
+
+
+
+ junit
+ junit
+ 4.2
+ test
+
+
+
+
+
+ ${artifactId}
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/AddService.java b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/AddService.java
new file mode 100644
index 0000000000..4eeb30a9c2
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/AddService.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 calculator;
+
+public interface AddService {
+
+ double add(double n1, double n2);
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/CalculatorService.java b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/CalculatorService.java
new file mode 100644
index 0000000000..c89043276e
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/CalculatorService.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 calculator;
+
+/**
+ * The Calculator service interface.
+ */
+public interface CalculatorService {
+
+ double add(double n1, double n2);
+
+ double subtract(double n1, double n2);
+
+ double multiply(double n1, double n2);
+
+ double divide(double n1, double n2);
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/CalculatorServiceImpl.java b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/CalculatorServiceImpl.java
new file mode 100644
index 0000000000..ed7bee0f4e
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/CalculatorServiceImpl.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * An implementation of the Calculator service.
+ */
+@Service(CalculatorService.class)
+public class CalculatorServiceImpl implements CalculatorService {
+
+ private AddService addService;
+ private SubtractService subtractService;
+ private MultiplyService multiplyService;
+ private DivideService divideService;
+
+ @Reference
+ public void setAddService(AddService addService) {
+ this.addService = addService;
+ }
+
+ @Reference
+ public void setSubtractService(SubtractService subtractService) {
+ this.subtractService = subtractService;
+ }
+
+ @Reference
+ public void setDivideService(DivideService divideService) {
+ this.divideService = divideService;
+ }
+
+ @Reference
+ public void setMultiplyService(MultiplyService multiplyService) {
+ this.multiplyService = multiplyService;
+ }
+
+ public double add(double n1, double n2) {
+ return addService.add(n1, n2);
+ }
+
+ public double subtract(double n1, double n2) {
+ return subtractService.subtract(n1, n2);
+ }
+
+ public double multiply(double n1, double n2) {
+ System.err.println("Multiply");
+ return multiplyService.multiply(n1, n2);
+ }
+
+ public double divide(double n1, double n2) {
+ return divideService.divide(n1, n2);
+ }
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/DivideService.java b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/DivideService.java
new file mode 100644
index 0000000000..131c5a8014
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/DivideService.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 calculator;
+
+public interface DivideService {
+
+ double divide(double n1, double n2);
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/MultiplyService.java b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/MultiplyService.java
new file mode 100644
index 0000000000..a917896aeb
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/MultiplyService.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 calculator;
+
+public interface MultiplyService {
+
+ double multiply(double n1, double n2);
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/SubtractService.java b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/SubtractService.java
new file mode 100644
index 0000000000..e328f024ea
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/SubtractService.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 calculator;
+
+public interface SubtractService {
+
+ double subtract(double n1, double n2);
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/demo/CalculatorServer.java b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/demo/CalculatorServer.java
new file mode 100644
index 0000000000..b1861daafc
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/java/calculator/demo/CalculatorServer.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 calculator.demo;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class CalculatorServer {
+
+ public static void main(String[] args) throws Exception {
+
+ System.out.println("Starting the Sample SCA Calculator...");
+
+ SCADomain domain = SCADomain.newInstance("Calculator.composite");
+
+ System.out.println("Press Enter to Exit...");
+ System.in.read();
+
+ domain.close();
+
+ System.out.println("Bye");
+ System.exit(0);
+ }
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/resources/Calculator.composite b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/resources/Calculator.composite
new file mode 100644
index 0000000000..851813d31f
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/resources/Calculator.composite
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/resources/calculator/AddServiceImpl.js b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/resources/calculator/AddServiceImpl.js
new file mode 100644
index 0000000000..1d4d221364
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/resources/calculator/AddServiceImpl.js
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+function add(n1, n2) {
+ return n1 + n2;
+}
\ No newline at end of file
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/resources/calculator/DivideServiceImpl.groovy b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/resources/calculator/DivideServiceImpl.groovy
new file mode 100644
index 0000000000..c31c1e8fd6
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/resources/calculator/DivideServiceImpl.groovy
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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 divide(n1, n2) {
+ return n1 / n2
+}
\ No newline at end of file
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/resources/calculator/MultiplyServiceImpl.py b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/resources/calculator/MultiplyServiceImpl.py
new file mode 100644
index 0000000000..dd56af0ad8
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/resources/calculator/MultiplyServiceImpl.py
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT 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 multiply(n1, n2):
+ print "Python Calculator component: multiply(", n1, ",", n2, ")"
+ return n1 * n2
\ No newline at end of file
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/resources/calculator/SubtractServiceImpl.rb b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/resources/calculator/SubtractServiceImpl.rb
new file mode 100644
index 0000000000..08fa310f46
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-calculator/src/main/resources/calculator/SubtractServiceImpl.rb
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT 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 subtract(n1, n2)
+ print "Ruby Calculator subtract(", n1, ",", n2, ")\n"
+ return n1 - n2
+end
\ No newline at end of file
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/DISCLAIMER b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/DISCLAIMER
new file mode 100644
index 0000000000..d68a410903
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/DISCLAIMER
@@ -0,0 +1,8 @@
+Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/LICENSE b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/LICENSE
new file mode 100644
index 0000000000..8aa906c321
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/LICENSE
@@ -0,0 +1,205 @@
+
+ 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.
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/NOTICE b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/NOTICE
new file mode 100644
index 0000000000..fdfa0e9faa
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/NOTICE
@@ -0,0 +1,6 @@
+${pom.name}
+Copyright (c) 2005 - 2008 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/README b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/README
new file mode 100644
index 0000000000..2ea98d020c
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/README
@@ -0,0 +1,4 @@
+bigbank-stockquote is a part of a larger demo called bigbank.
+Please see the Readme file under bigbank to understand how bigbank-stockquote fits into the overall demo.
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/build.xml b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/build.xml
new file mode 100644
index 0000000000..145c158ac2
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/build.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/pom.xml b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/pom.xml
new file mode 100644
index 0000000000..1688da6709
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/pom.xml
@@ -0,0 +1,85 @@
+
+
+
+ 4.0.0
+
+ org.apache.tuscany.sca
+ tuscany-demos
+ 1.2-incubating
+ ../pom.xml
+
+ demo-bigbank-stockquote
+ Apache Tuscany SCA BigBank StockQuote Demo
+
+
+
+ apache.incubator
+ http://people.apache.org/repo/m2-incubating-repository
+
+
+
+
+
+ org.apache.tuscany.sca
+ tuscany-host-embedded
+ 1.2-incubating
+
+
+
+ org.apache.ws.security
+ wss4j
+ 1.5.3
+
+
+
+ org.apache.tuscany.sca
+ tuscany-implementation-java-runtime
+ 1.2-incubating
+ runtime
+
+
+
+ org.apache.tuscany.sca
+ tuscany-binding-ws-axis2
+ 1.2-incubating
+ runtime
+
+
+
+ org.apache.tuscany.sca
+ tuscany-host-tomcat
+ 1.2-incubating
+ runtime
+
+
+
+ junit
+ junit
+ 4.2
+ test
+
+
+
+
+
+ ${artifactId}
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/java/stockquote/PasswordCallbackHandler.java b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/java/stockquote/PasswordCallbackHandler.java
new file mode 100644
index 0000000000..2d7821171d
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/java/stockquote/PasswordCallbackHandler.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 stockquote;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ * Sample userid passwd generation class
+ */
+public class PasswordCallbackHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ System.out.println("*** Calling Server User/Passwd Handler...." );
+ WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+ System.out.println("*** Getting password for user ...." + pwcb.getIdentifer() + " & " + pwcb.getKey());
+ if ( pwcb.getUsage() == WSPasswordCallback.SIGNATURE ) {
+ System.out.println(" Usage is SIGNATURE ... ");
+ pwcb.setPassword("sqservice");
+ }
+ }
+ }
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/java/stockquote/StockQuoteImpl.java b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/java/stockquote/StockQuoteImpl.java
new file mode 100644
index 0000000000..2a0801f9b8
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/java/stockquote/StockQuoteImpl.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 stockquote;
+
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements the StockQuote service.
+ */
+@Service(StockQuoteService.class)
+public class StockQuoteImpl implements StockQuoteService {
+
+ public double getQuote(String symbol) {
+ double price = 104.0 + Math.random();
+ price = ((int)(price * 100)) / 100.0;
+
+ System.out.println("Getting stock quote for: " + symbol + ", value: "+ price);
+
+ return price;
+ }
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/java/stockquote/StockQuoteService.java b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/java/stockquote/StockQuoteService.java
new file mode 100644
index 0000000000..9d128657eb
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/java/stockquote/StockQuoteService.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 stockquote;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * This is the business interface of the StockQuote service.
+ */
+@Remotable
+public interface StockQuoteService {
+
+ public double getQuote(String symbol);
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/java/stockquote/demo/StockQuoteServer.java b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/java/stockquote/demo/StockQuoteServer.java
new file mode 100644
index 0000000000..04ed762602
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/java/stockquote/demo/StockQuoteServer.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 stockquote.demo;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+/**
+ * This server program shows how to bootstrap SCA from a simple J2SE program
+ * and start it which activates the StockQuote Web service endpoint.
+ */
+public class StockQuoteServer {
+
+ public static void main(String[] args) throws Exception {
+
+ System.out.println("Starting the Sample SCA StockQuote Service...");
+
+ SCADomain domain = SCADomain.newInstance("StockQuote.composite");
+
+ System.out.println("Press Enter to Exit...");
+ System.in.read();
+
+ domain.close();
+ System.out.println("Bye");
+ }
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/resources/StockQuote.composite b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/resources/StockQuote.composite
new file mode 100644
index 0000000000..aaad92c861
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/resources/StockQuote.composite
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/resources/definitions.xml b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/resources/definitions.xml
new file mode 100644
index 0000000000..7e1f51304e
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/resources/definitions.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+ Timestamp Signature
+ security.properties
+
+
+
+
+ Timestamp Signature
+ sqservice
+ security.properties
+ stockquote.PasswordCallbackHandler
+ DirectReference
+
+
+
+
+
\ No newline at end of file
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/resources/security.properties b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/resources/security.properties
new file mode 100644
index 0000000000..f33385f35a
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/resources/security.properties
@@ -0,0 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=sqkeystore
+org.apache.ws.security.crypto.merlin.file=stockQuote.jks
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/resources/stockQuote.jks b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/resources/stockQuote.jks
new file mode 100644
index 0000000000..d53d32c4ef
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/bigbank-stockquote/src/main/resources/stockQuote.jks differ
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/DISCLAIMER b/tags/java/sca/1.2-RC3a/demos/bigbank/DISCLAIMER
new file mode 100644
index 0000000000..8e5c524323
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/DISCLAIMER
@@ -0,0 +1,8 @@
+Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/LICENSE b/tags/java/sca/1.2-RC3a/demos/bigbank/LICENSE
new file mode 100644
index 0000000000..8aa906c321
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/LICENSE
@@ -0,0 +1,205 @@
+
+ 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.
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/NOTICE b/tags/java/sca/1.2-RC3a/demos/bigbank/NOTICE
new file mode 100644
index 0000000000..fdfa0e9faa
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/NOTICE
@@ -0,0 +1,6 @@
+${pom.name}
+Copyright (c) 2005 - 2008 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/README b/tags/java/sca/1.2-RC3a/demos/bigbank/README
new file mode 100644
index 0000000000..5ec796db60
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/README
@@ -0,0 +1,127 @@
+BigBank Demo
+============
+
+This application is made of 3 modules that represent the different aspects
+of a fictitious banking application. Please see bigbank.png in the bigbank-account directory for a diagram of this demo.
+
+To run the bigbank-account demo you need to first run bigbank-calculator and bigbank-stockquote composites. This will bring up Tuscany runtime and load the two applications and make them available as services. Bigbank-account is dependent on these services.
+
+This demo uses ant. This is just one way of running this demo.
+
+Start Bigbank-calculator composite
+----------------------------------
+
+Bigbank-calculator is a calculator application which handles add, subtract, multiply and divide operations. Each of these operations is implemented in a different language, including JavaScript, groovy, Ruby and Python.
+
+To run the bigbank-calculator composite and make it available as a service for this demo do the following:
+
+cd bigbank-calculator
+ant compile
+ant run
+
+.. Leave the server running
+
+Note that 'ant compile' needs to be done the first time you run this demo out of the binary distribution. No need to do 'ant compile' from there on.
+
+Start Bigbank-stockquote
+------------------------
+
+A very simple web services based stock quote application which returns random
+stock quotes on request. Please note that the stockquote service is not live and is implemented instead to allow for this application to always run without dependency on the availability of a webservice.
+
+cd bigbank-stockquote
+ant compile
+ant run
+
+.. Leave the server running
+
+Note that 'ant compile' needs to be done the first time you run this demo out of the binary distribution. No need to do 'ant compile' from there on.
+
+Start Bigbank
+-------------
+The BigBank comprises of two subsystems that are built from two distinct contributions coming from ...
+1) bigbank
+ This contains all artifacts that make up the bigbank application. This is the application that the
+ end user interacts with
+
+2) bigbank-account
+ This contains all artifacts that deal with the account management within the bigbank. The services
+ offered by the bigbank-account module are used by the bigbank. The end user never gets to directly
+ interact with bigbank account
+
+Besides the bigbank-account the bigbank composite application calls into bigbank-stockquote and
+bigbank-calculator services.
+
+Start bigbank-account in the following way:
+
+i ) Compile the bigbank-account as follows :
+
+ cd bigbank-account
+ ant compile
+
+ii) Now start the bigbank service as follows :
+
+ cd bigbank
+ ant compile
+ ant run
+
+ .. Leave the server running
+
+Note that 'ant compile' needs to be done the first time you run this demo out ofthe binary distribution.
+No need to do 'ant compile' from there on.
+
+Bigbank and the SCA Policies
+----------------------------
+The Bigbank demo uses the Tuscany PolicyFramework to enforce security in the following ways:
+
+Authentication
+--------------
+ The bigbank-account subsystem enforces authentication as a required security characteristic for
+ all interactions with its CheckingAccountService. Hence the 'bigbank' application which is a client
+ to this service authenticates itself for every interaction with the CheckingAccountService. The interaction
+ between the bigbank and the CheckingAccountService is over the ws binding.
+
+Integrity
+---------
+ All interactions of the bigbank application with the StockQuoteService are guarded with message integrity.
+ These interactions use the ws binding.
+
+Authorization
+-------------
+ Within the bigbank-account subsystem the CheckingAccountService implementation enforces authorization on
+ its operations. This is an instance of a custom policy enforcement i.e. the CheckingAccountService
+ component's implementation has defined its own customized way of authorizing access to its services.
+
+Demonstrated features
+---------------------
+This demo is to illustrate the following : -
+- composition of an application using artifacts belonging to multiple contributions (here two)
+- usage of sca policies in composite definitions with specific emphasis on enabling security
+
+
+Run the demo
+-------------
+The front end of this demo application is a web app which users Json/RPC to communicate with the backend for retrieving account information.
+
+To try the app out point you browser at:
+
+http://localhost:8080/AccountJSON.html
+
+This should display an interface with a single button that goes and retrieves
+a single set of account details exercising services across the three running
+SCA applications.
+
+If you press on getAccountReport, you'll see a response posted,
+but the detail of the data will be displayed in the console where you started bigbank. Among other
+things you will note messages that confirm the enforecement of AUTHENTICATION, AUTHORIZATION and
+SIGNING of messages exchaged.
+
+On the console where you have started the StockQuote Service you should again be able to see messages
+that confirm the signing of messages exchanged.
+
+Stop the demo
+-------------
+Go to each of the corresponding command line screens and hit 'enter'.
+This will stop each of the applications.
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/bigbank.png b/tags/java/sca/1.2-RC3a/demos/bigbank/bigbank.png
new file mode 100644
index 0000000000..985cc6bd05
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/bigbank/bigbank.png differ
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/bigbank.svg b/tags/java/sca/1.2-RC3a/demos/bigbank/bigbank.svg
new file mode 100644
index 0000000000..30aa0eab6d
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/bigbank.svg
@@ -0,0 +1,537 @@
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/build-dojo.xml b/tags/java/sca/1.2-RC3a/demos/bigbank/build-dojo.xml
new file mode 100644
index 0000000000..9d282c2dd2
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/build-dojo.xml
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/build.xml b/tags/java/sca/1.2-RC3a/demos/bigbank/build.xml
new file mode 100644
index 0000000000..046aadd228
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/build.xml
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/pom.xml b/tags/java/sca/1.2-RC3a/demos/bigbank/pom.xml
new file mode 100644
index 0000000000..67d2a20d65
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/pom.xml
@@ -0,0 +1,194 @@
+
+
+
+ 4.0.0
+
+ org.apache.tuscany.sca
+ tuscany-demos
+ 1.2-incubating
+ ../pom.xml
+
+ demo-bigbank
+ jar
+ Apache Tuscany SCA BigBank Demo
+
+
+
+ apache.incubator
+ http://people.apache.org/repo/m2-incubating-repository
+
+
+
+
+
+ org.apache.tuscany.sca
+ tuscany-host-embedded
+ 1.2-incubating
+
+
+
+ org.apache.tuscany.sca
+ tuscany-implementation-data-api
+ 1.2-incubating
+
+
+
+ org.apache.ws.security
+ wss4j
+ 1.5.3
+
+
+
+ org.apache.tuscany.sca
+ demo-bigbank-account
+ 1.2-incubating
+
+
+
+ org.apache.tuscany.sca
+ tuscany-implementation-java-runtime
+ 1.2-incubating
+ runtime
+
+
+
+ org.apache.tuscany.sca
+ tuscany-binding-atom-abdera
+ 1.2-incubating
+ runtime
+
+
+
+ org.apache.tuscany.sca
+ tuscany-binding-ws-axis2
+ 1.2-incubating
+ runtime
+
+
+
+ org.apache.tuscany.sca
+ tuscany-binding-jsonrpc
+ 1.2-incubating
+ runtime
+
+
+
+ org.apache.tuscany.sca
+ tuscany-binding-rmi
+ 1.2-incubating
+ runtime
+
+
+
+ org.apache.tuscany.sca
+ tuscany-implementation-resource
+ 1.2-incubating
+ runtime
+
+
+
+ org.apache.tuscany.sca
+ tuscany-binding-http
+ 1.2-incubating
+ runtime
+
+
+
+ org.apache.tuscany.sca
+ tuscany-host-jetty
+ 1.2-incubating
+ runtime
+
+
+
+ junit
+ junit
+ 4.2
+ test
+
+
+
+
+
+ demo-bigbank
+
+
+ org.apache.maven.plugins
+ maven-antrun-plugin
+
+
+
+ ant
+ ant-trax
+ 1.6.5
+
+
+
+
+
+ install-dojo
+ validate
+
+ run
+
+
+
+
+
+
+
+
+
+
+ copy-dojo-files
+ generate-resources
+
+ run
+
+
+
+
+
+
+
+
+
+
+
+ clean-dojo-files
+ clean
+
+ run
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/account/AccountService.java b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/account/AccountService.java
new file mode 100644
index 0000000000..2cb8027874
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/account/AccountService.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 bigbank.account;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * @version $$Rev$$ $$Date$$
+ */
+
+@Remotable
+public interface AccountService {
+
+ public double getAccountReport(String customerID);
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/account/AccountServiceImpl.java b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/account/AccountServiceImpl.java
new file mode 100644
index 0000000000..4f0e3879dc
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/account/AccountServiceImpl.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 bigbank.account;
+
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+import stockquote.StockQuoteService;
+import bigbank.account.checking.CheckingAccountDetails;
+import bigbank.account.checking.CheckingAccountService;
+import bigbank.account.savings.SavingsAccountDetails;
+import bigbank.account.savings.SavingsAccountService;
+import bigbank.account.stock.StockAccountDetails;
+import bigbank.account.stock.StockAccountService;
+import calculator.CalculatorService;
+
+/**
+ * @version $$Rev$$ $$Date$$
+ */
+
+@Service(AccountService.class)
+public class AccountServiceImpl implements AccountService {
+
+ @Reference
+ protected SavingsAccountService savingsAcService;
+
+ @Reference
+ protected CheckingAccountService checkingAcService;
+
+ @Reference
+ protected StockAccountService stockAcService;
+
+ @Reference
+ protected StockQuoteService stockQuoteService;
+
+ @Reference
+ protected CalculatorService calculatorService;
+
+ @Property
+ protected String currency;
+
+ public double getAccountReport(String customerID) {
+
+ // Get the checking, savings and stock accounts from the AccountData
+ // service component
+ CheckingAccountDetails checking = null;
+ try {
+ checking = checkingAcService.getAccountDetails(customerID);
+ System.out.println("Checking account: " + checking);
+
+ SavingsAccountDetails savings = savingsAcService.getAccountDetails(customerID);
+ System.out.println("Savings account: " + savings);
+
+ StockAccountDetails stock = stockAcService.getAccountDetails(customerID);
+ System.out.println("Stock account: " + stock);
+
+ // Get the stock price in USD
+ double price = stockQuoteService.getQuote(stock.getSymbol());
+ System.out.println("Stock price for " + stock.getSymbol() + ": " + price);
+
+ // Convert to the configured currency
+ if (currency.equals("EURO")) {
+
+ // Use our fancy calculator service to convert to the target currency
+ price = calculatorService.multiply(price, 0.70);
+
+ System.out.println("Converted to " + currency + ": " + price);
+ }
+
+ // Calculate the value of the stock account
+ double stockValue = price * stock.getQuantity();
+
+ // Calculate the total balance of all accounts and return it
+ double balance = checking.getBalance() + savings.getBalance() + stockValue;
+
+ return balance;
+ } catch ( Throwable e ) {
+ e.printStackTrace();
+ return 0;
+ }
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/account/feed/AccountFeedImpl.java b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/account/feed/AccountFeedImpl.java
new file mode 100644
index 0000000000..8e8758de97
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/account/feed/AccountFeedImpl.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 bigbank.account.feed;
+
+import org.apache.tuscany.sca.implementation.data.collection.Collection;
+import org.apache.tuscany.sca.implementation.data.collection.Entry;
+import org.apache.tuscany.sca.implementation.data.collection.NotFoundException;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+import bigbank.account.AccountService;
+
+/**
+ * @version $$Rev$$ $$Date$$
+ */
+
+@Service(Collection.class)
+public class AccountFeedImpl implements Collection {
+
+ @Reference
+ protected AccountService accountService;
+
+ public Entry[] getAll() {
+
+ // Add the Account report entry
+ String report = get("1234");
+ Entry entry = new Entry("1234", report);
+
+ return new Entry[] { entry } ;
+ }
+
+ public String get(String id) {
+
+ // Get the account report for the specified customer ID
+ double balance = accountService.getAccountReport(id);
+ String report = Double.toString(balance);
+
+ return report;
+ }
+
+ public void delete(String key) throws NotFoundException {
+ }
+
+ public String post(String key, String item) {
+ return null;
+ }
+
+ public void put(String key, String item) throws NotFoundException {
+ }
+
+ public Entry[] query(String queryString) {
+ return null;
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/client/BigBankClient.java b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/client/BigBankClient.java
new file mode 100644
index 0000000000..a7fa5ecc22
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/client/BigBankClient.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 bigbank.client;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+import bigbank.account.AccountService;
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * and locate and invoke a SCA component
+ */
+public class BigBankClient {
+
+ public static void main(String[] args) throws Exception {
+
+ SCADomain domain = SCADomain.newInstance("BigBank.composite");
+
+ AccountService accountService = domain.getService(AccountService.class, "AccountServiceComponent");
+
+ String customerID = "1234";
+
+ System.out.println("Calling account service for customer: " + customerID);
+ System.out.println();
+ double balance = accountService.getAccountReport(customerID);
+
+ System.out.println();
+ System.out.println("Balance: " + balance);
+
+ domain.close();
+ }
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/demo/BigBankServer.java b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/demo/BigBankServer.java
new file mode 100644
index 0000000000..05360e07a5
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/demo/BigBankServer.java
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package bigbank.demo;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.service.ContributionService;
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
+
+import bigbank.account.savings.SavingsAccountService;
+
+
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * and locate and invoke a SCA component
+ */
+public class BigBankServer {
+
+ public static void main(String[] args) throws Exception {
+ long timeout = -1L;
+ if (args.length > 0) {
+ timeout = Long.parseLong(args[0]);
+ }
+
+ System.out.println("Starting the Sample SCA BigBank server...");
+ ClassLoader cl = BigBankServer.class.getClassLoader();
+ EmbeddedSCADomain domain = new EmbeddedSCADomain(cl, "http://localhost");
+
+ //Start the domain
+ domain.start();
+
+ // Contribute the SCA contribution
+ ContributionService contributionService = domain.getContributionService();
+
+ URL javaContribURL = getContributionURL(SavingsAccountService.class);
+ Contribution bigbankAcContribution = contributionService.contribute("http://bigbank-account", javaContribURL, false);
+ for (Composite deployable : bigbankAcContribution.getDeployables()) {
+ domain.getDomainComposite().getIncludes().add(deployable);
+ domain.buildComposite(deployable);
+ }
+
+ URL bigbankContribUrl = getContributionURL(BigBankServer.class);
+ Contribution bigbankContribution = contributionService.contribute("http://bigbank", bigbankContribUrl, false);
+ for (Composite deployable : bigbankContribution.getDeployables()) {
+ domain.getDomainComposite().getIncludes().add(deployable);
+ domain.buildComposite(deployable);
+ }
+
+
+ //Start Components from composite
+ for (Composite deployable : bigbankAcContribution.getDeployables()) {
+ domain.getCompositeActivator().activate(deployable);
+ domain.getCompositeActivator().start(deployable);
+ }
+
+ for (Composite deployable : bigbankContribution.getDeployables()) {
+ domain.getCompositeActivator().activate(deployable);
+ domain.getCompositeActivator().start(deployable);
+ }
+
+ if (timeout < 0) {
+ System.out.println("Press Enter to Exit...");
+ System.in.read();
+ } else {
+ Thread.sleep(timeout);
+ }
+
+ contributionService.remove("http://bigbank-account");
+ contributionService.remove("http://bigbank");
+
+ // Stop Components from composite
+ for (Composite deployable : bigbankContribution.getDeployables()) {
+ domain.getCompositeActivator().stop(deployable);
+ domain.getCompositeActivator().deactivate(deployable);
+ }
+
+ domain.stop();
+
+ domain.close();
+
+
+ /*SCADomain domain = SCADomain.newInstance("BigBank.composite");
+
+ if (timeout < 0) {
+ System.out.println("Press Enter to Exit...");
+ System.in.read();
+ } else {
+ Thread.sleep(timeout);
+ }
+
+ domain.close();*/
+
+ System.out.println("Bye");
+ }
+
+ private static URL getContributionURL(Class> cls) throws MalformedURLException {
+ String flag = "/" + cls.getName().replace('.', '/') + ".class";
+ URL url = cls.getResource(flag);
+ String root = url.toExternalForm();
+ root = root.substring(0, root.length() - flag.length() + 1);
+ if (root.startsWith("jar:") && root.endsWith("!/")) {
+ root = root.substring(4, root.length() - 2);
+ }
+ url = new URL(root);
+ return url;
+ }
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/security/BigbankPasswordCallbackHandler.java b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/security/BigbankPasswordCallbackHandler.java
new file mode 100644
index 0000000000..6d3b547939
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/bigbank/security/BigbankPasswordCallbackHandler.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 bigbank.security;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ * Sample userid passwd generation class
+ */
+public class BigbankPasswordCallbackHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+ //System.out.println("*** Getting password for user ...." + pwcb.getIdentifer() + " & " + pwcb.getKey());
+ if ( pwcb.getUsage() == WSPasswordCallback.SIGNATURE ) {
+ System.out.println("*** Calling BIG-BANK Passwd Handler for SIGNING...." );
+ pwcb.setPassword("bbservice");
+ } else if ( pwcb.getUsage() == WSPasswordCallback.USERNAME_TOKEN ) {
+ if ( pwcb.getIdentifer().equals("bbaservice")) {
+ System.out.println("*** Calling BIG-BANK Passwd Handler for setting AUTHENTICATION password...." );
+ pwcb.setPassword("bbaservice");
+ }
+ }
+ }
+ }
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/calculator/CalculatorService.java b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/calculator/CalculatorService.java
new file mode 100644
index 0000000000..c89043276e
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/calculator/CalculatorService.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 calculator;
+
+/**
+ * The Calculator service interface.
+ */
+public interface CalculatorService {
+
+ double add(double n1, double n2);
+
+ double subtract(double n1, double n2);
+
+ double multiply(double n1, double n2);
+
+ double divide(double n1, double n2);
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/stockquote/StockQuoteService.java b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/stockquote/StockQuoteService.java
new file mode 100644
index 0000000000..749b8ee2f4
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/java/stockquote/StockQuoteService.java
@@ -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.
+ */
+package stockquote;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * This is the business interface of the StockQuote service.
+ */
+@Remotable
+public interface StockQuoteService {
+ public double getQuote(String symbol);
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/BigBank.composite b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/BigBank.composite
new file mode 100644
index 0000000000..e57541b423
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/BigBank.composite
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ EURO
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/META-INF/sca-contribution.xml b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..154992c843
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/bigbank.jks b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/bigbank.jks
new file mode 100644
index 0000000000..e6294d85f7
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/bigbank.jks differ
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/definitions.xml b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/definitions.xml
new file mode 100644
index 0000000000..8654151d82
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/definitions.xml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+ Timestamp Signature
+ security.properties
+
+
+
+
+ Timestamp Signature
+ bbservice
+ security.properties
+ bigbank.security.BigbankPasswordCallbackHandler
+ DirectReference
+
+
+
+
+
+
+
+
+
+ UsernameToken
+ bbaservice
+ bigbank.security.BigbankPasswordCallbackHandler
+ PasswordText
+
+
+
+
+
\ No newline at end of file
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/security.properties b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/security.properties
new file mode 100644
index 0000000000..bc17fefe57
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/security.properties
@@ -0,0 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=bbakeystore
+org.apache.ws.security.crypto.merlin.file=bigbank.jks
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/web/AccountJSON.html b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/web/AccountJSON.html
new file mode 100644
index 0000000000..9f4368443f
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/web/AccountJSON.html
@@ -0,0 +1,92 @@
+
+
+
+Tuscany JSON-RPC BigBank Client
+
+
+
+
+
+
+
+
+
+
+
+
+
It then creates a Dojo button that will envoke the getAccountReport
+ method of the accountService object.
+
+
+
Request
+
Response
+
+
+
+
+
+
+
+
None Yet.
+
+
+
+
+
Dojo Debug:
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/web/style.css b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/web/style.css
new file mode 100644
index 0000000000..1071583264
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/web/style.css
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+* { font-family: arial; }
+
+table, th, td { border: 2px solid blue; border-collapse: collapse; }
+th { color: white; background-color: blue; }
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/wsdl/AccountService.wsdl b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/wsdl/AccountService.wsdl
new file mode 100644
index 0000000000..ac4d987a57
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/src/main/resources/wsdl/AccountService.wsdl
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/bigbank/src/test/java/test/BigBankTestCase.java b/tags/java/sca/1.2-RC3a/demos/bigbank/src/test/java/test/BigBankTestCase.java
new file mode 100644
index 0000000000..3b7c5ef2ad
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/bigbank/src/test/java/test/BigBankTestCase.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 test;
+
+import junit.framework.TestCase;
+
+import bigbank.demo.BigBankServer;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class BigBankTestCase extends TestCase {
+
+ public void testServer() throws Exception {
+ BigBankServer.main(new String[] {"1000"});
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/DISCLAIMER b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/DISCLAIMER
new file mode 100644
index 0000000000..d68a410903
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/DISCLAIMER
@@ -0,0 +1,8 @@
+Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/LICENSE b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/LICENSE
new file mode 100644
index 0000000000..8aa906c321
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/LICENSE
@@ -0,0 +1,205 @@
+
+ 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.
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/NOTICE b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/NOTICE
new file mode 100644
index 0000000000..fdfa0e9faa
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/NOTICE
@@ -0,0 +1,6 @@
+${pom.name}
+Copyright (c) 2005 - 2008 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/README b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/README
new file mode 100644
index 0000000000..b785802920
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/README
@@ -0,0 +1,6 @@
+Mortgage Loan Approval Demo
+===========================
+Please refer to the README under mortgage-loanapproval for information on how to run this demo.
+
+Mortgage-creditcheck is part of a larger demo that is explained there.
+
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/build.xml b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/build.xml
new file mode 100644
index 0000000000..59f1342276
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/build.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/pom.xml b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/pom.xml
new file mode 100644
index 0000000000..9dfec30e35
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/pom.xml
@@ -0,0 +1,75 @@
+
+
+
+ 4.0.0
+
+ org.apache.tuscany.sca
+ tuscany-demos
+ 1.2-incubating
+ ../pom.xml
+
+ demo-mortgage-creditcheck
+ jar
+ Apache Tuscany SCA Mortgage Credit Check Demo
+ A sample Mortgage application made of several SCA components wired together.
+
+
+
+ org.apache.tuscany.sca
+ tuscany-host-embedded
+ 1.2-incubating
+
+
+
+ org.apache.tuscany.sca
+ tuscany-implementation-java-runtime
+ 1.2-incubating
+ runtime
+
+
+
+ org.apache.tuscany.sca
+ tuscany-binding-ws-axis2
+ 1.2-incubating
+ runtime
+
+
+
+ org.apache.tuscany.sca
+ tuscany-host-jetty
+ 1.2-incubating
+ runtime
+
+
+
+ junit
+ junit
+ 4.2
+ test
+
+
+
+
+
+ ${artifactId}
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/java/credit/CreditCheck.java b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/java/credit/CreditCheck.java
new file mode 100644
index 0000000000..ec95a60227
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/java/credit/CreditCheck.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 credit;
+
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface CreditCheck {
+ int getCreditScore(String ssn);
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/java/credit/CreditCheckImpl.java b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/java/credit/CreditCheckImpl.java
new file mode 100644
index 0000000000..f19e8a1250
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/java/credit/CreditCheckImpl.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 credit;
+
+import org.osoa.sca.annotations.Service;
+
+/**
+ * An implementation of the CreditReportService service
+ */
+@Service(CreditCheck.class)
+public class CreditCheckImpl implements CreditCheck {
+
+ public int getCreditScore(String ssn) {
+ int score = (int)(700 + (Math.random() - 0.5) * 100);
+ System.out.println("Credit score for " + ssn + ": " + score);
+ return score;
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/java/credit/CreditCheckServer.java b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/java/credit/CreditCheckServer.java
new file mode 100644
index 0000000000..870ea1941d
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/java/credit/CreditCheckServer.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 credit;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class CreditCheckServer {
+ public static void main(String[] args) throws Exception {
+
+ System.out.println("Starting the CreditCheck Service...");
+
+ SCADomain domain = SCADomain.newInstance("http://localhost", "/", "CreditCheck.composite");
+
+ System.out.println("Press Enter to Exit...");
+ System.in.read();
+
+ domain.close();
+ System.out.println("Bye");
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/resources/CreditCheck.composite b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/resources/CreditCheck.composite
new file mode 100644
index 0000000000..5c828f5a39
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/resources/CreditCheck.composite
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/resources/wsdl/credit.wsdl b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/resources/wsdl/credit.wsdl
new file mode 100644
index 0000000000..9c2acc96d3
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/resources/wsdl/credit.wsdl
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/webapp/META-INF/sca-contribution.xml b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/webapp/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..aea009292a
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/webapp/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/webapp/WEB-INF/web.xml b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000000..d7b2e32dd1
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-creditcheck/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+ Apache Tuscany Credit Check Demo
+
+
+ tuscany
+ org.apache.tuscany.sca.host.webapp.TuscanyServletFilter
+
+
+
+ tuscany
+ /*
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/DISCLAIMER b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/DISCLAIMER
new file mode 100644
index 0000000000..d68a410903
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/DISCLAIMER
@@ -0,0 +1,8 @@
+Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/LICENSE b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/LICENSE
new file mode 100644
index 0000000000..8aa906c321
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/LICENSE
@@ -0,0 +1,205 @@
+
+ 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.
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/NOTICE b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/NOTICE
new file mode 100644
index 0000000000..fdfa0e9faa
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/NOTICE
@@ -0,0 +1,6 @@
+${pom.name}
+Copyright (c) 2005 - 2008 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/README b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/README
new file mode 100644
index 0000000000..dbf3829a20
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/README
@@ -0,0 +1,60 @@
+Mortgage Loan Approval Demo
+===========================
+
+This demo was used as an example in the java developer journal article: http://jdj.sys-con.com/read/325183.htm.
+
+The demo consists of two modules:
+
+mortgage-loanapproval: provides the business logic for loan approval.
+mortgage-creditcheck: handles credit check requests. This is a java component exposed as a webservice running on the embedded Tomcat.
+
+Please check mortgage_assembly.png file that is located in this directory for a high level view of the demo.
+
+Here is what happens when you run the demo. A loan approval request for customer with id 111-222-3333
+gets initiated when mortgage-loanapproval application is run. Depending on what the 'imaginary' credit
+ status of this person is, the loan gets approved or diapproved.
+
+You would need two command windows to run mortgage loan approval composite. The order in which the
+applications are run is important. Run mortgage-creditcheck first since mortgage-loanapproval is dependent on
+it's service.
+
+In the first command window
+---------------------------
+1) go to mortgage-creditcheck directory
+2) ant compile
+3) ant run
+You should see the following displayed:
+Buildfile: build.xml
+
+run:
+ [java] Starting the CreditCheck Service...
+ [java] 14-Jan-2008 14:14:20 org.apache.tuscany.sca.http.jetty.JettyServer a
+ddServletMapping
+ [java] INFO: Added Servlet mapping: http://L3AW203:8085/CreditCheckServiceC
+omponent
+ [java] Press Enter to Exit...
+
+In the second command window
+----------------------------
+1) go to mortgage-loanapproval directory
+2) ant compile
+3) ant run
+
+If the loan is approved, you will see the following displayed in the command screen where
+mortgage-loanapproval is run:
+
+Buildfile: build.xml
+run:
+ [java] Interest rate for a 30-year loan of $200000.0 in CA: 6.5%
+ [java] Approved: John Smith[111-22-3333]
+
+If the loan is disapproved, you will see the following displayed in the command screen where
+mortgage-loanapproval is run:
+
+Buildfile: build.xml
+run:
+ [java] Credit score for 111-22-3333: 708
+ [java] Interest rate for a 30-year loan of $200000.0 in CA: 6.5%
+ [java] Debt/Income ratio 0.2528272093971861 is too high.
+ [java] Rejected: John Smith[111-22-3333]
+
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/build.xml b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/build.xml
new file mode 100644
index 0000000000..9a0a83bf1d
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/build.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/credit_composite.jpg b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/credit_composite.jpg
new file mode 100644
index 0000000000..e28ed63cfb
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/credit_composite.jpg differ
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/credit_composite.png b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/credit_composite.png
new file mode 100644
index 0000000000..0bfce0078d
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/credit_composite.png differ
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/loan_approval.jpg b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/loan_approval.jpg
new file mode 100644
index 0000000000..3f00557c7f
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/loan_approval.jpg differ
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/loan_approval.png b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/loan_approval.png
new file mode 100644
index 0000000000..9d5f829fe5
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/loan_approval.png differ
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly0.jpg b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly0.jpg
new file mode 100644
index 0000000000..515b6ecde7
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly0.jpg differ
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly0.png b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly0.png
new file mode 100644
index 0000000000..4b815a4b82
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly0.png differ
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly1.jpg b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly1.jpg
new file mode 100644
index 0000000000..01a7c55a14
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly1.jpg differ
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly1.png b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly1.png
new file mode 100644
index 0000000000..07422c4f45
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly1.png differ
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly2.jpg b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly2.jpg
new file mode 100644
index 0000000000..992c048684
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly2.jpg differ
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly2.png b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly2.png
new file mode 100644
index 0000000000..4667956ed0
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_assembly2.png differ
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_composite.jpg b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_composite.jpg
new file mode 100644
index 0000000000..5021f6a317
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_composite.jpg differ
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_composite.png b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_composite.png
new file mode 100644
index 0000000000..1398c50ded
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_composite.png differ
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_diagrams.doc b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_diagrams.doc
new file mode 100644
index 0000000000..00d45e1084
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_diagrams.doc differ
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_package1.jpg b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_package1.jpg
new file mode 100644
index 0000000000..e91c5f1bbd
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_package1.jpg differ
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_package1.png b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_package1.png
new file mode 100644
index 0000000000..db304a4c28
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_package1.png differ
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_package2.jpg b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_package2.jpg
new file mode 100644
index 0000000000..e8c2865e4a
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_package2.jpg differ
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_package2.png b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_package2.png
new file mode 100644
index 0000000000..502e538e94
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_package2.png differ
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_scenario.jpg b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_scenario.jpg
new file mode 100644
index 0000000000..fccf2e35c3
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_scenario.jpg differ
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_scenario.png b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_scenario.png
new file mode 100644
index 0000000000..b8f42ad318
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/doc/mortgage_scenario.png differ
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/mortgage_assembly.png b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/mortgage_assembly.png
new file mode 100644
index 0000000000..4667956ed0
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/mortgage_assembly.png differ
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/pom.xml b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/pom.xml
new file mode 100644
index 0000000000..29a23d3b3e
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/pom.xml
@@ -0,0 +1,90 @@
+
+
+
+ 4.0.0
+
+ org.apache.tuscany.sca
+ tuscany-demos
+ 1.2-incubating
+ ../pom.xml
+
+ demo-mortgage-loanapproval
+ jar
+ Apache Tuscany SCA Mortgage Loan Approval Demo
+ A sample Mortgage application made of several SCA components wired together.
+
+
+ 1.2-incubating
+
+
+
+
+ org.apache.tuscany.sca
+ tuscany-host-embedded
+ 1.2-incubating
+
+
+
+ org.apache.tuscany.sca
+ tuscany-implementation-java-runtime
+ 1.2-incubating
+ runtime
+
+
+
+ org.apache.tuscany.sca
+ tuscany-binding-ws-axis2
+ 1.2-incubating
+ runtime
+
+
+
+ org.apache.tuscany.sca
+ tuscany-implementation-script
+ 1.2-incubating
+ runtime
+
+
+
+ junit
+ junit
+ 4.2
+ test
+
+
+
+
+ install
+ ${artifactId}
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+ mortgage.MortgageClient
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheck.java b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheck.java
new file mode 100644
index 0000000000..c5787b7819
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheck.java
@@ -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.
+ */
+package mortgage;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * CreditCheck interface
+ */
+@Remotable
+public interface CreditCheck {
+ int getCreditScore(String ssn);
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheckImpl.java b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheckImpl.java
new file mode 100644
index 0000000000..dc803d9688
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheckImpl.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 mortgage;
+
+import org.osoa.sca.annotations.Service;
+
+/**
+ * A pojo implementation of the CreditCheck service
+ */
+@Service(CreditCheck.class)
+public class CreditCheckImpl implements CreditCheck {
+
+ public int getCreditScore(String ssn) {
+ int score = (int)(700 + (Math.random() - 0.5) * 100);
+ System.out.println("Credit score for " + ssn + ": " + score);
+ return score;
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/Customer.java b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/Customer.java
new file mode 100644
index 0000000000..66a486d516
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/Customer.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 mortgage;
+
+/**
+ * A simple Customer object
+ */
+public class Customer {
+ private String ssn;
+ private String firstName;
+ private String lastName;
+ private double monthlyIncome;
+ private String state;
+
+ public double getMonthlyIncome() {
+ return monthlyIncome;
+ }
+
+ public void setMonthlyIncome(double monthlyIncome) {
+ this.monthlyIncome = monthlyIncome;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public String getSsn() {
+ return ssn;
+ }
+
+ public void setSsn(String ssn) {
+ this.ssn = ssn;
+ }
+
+ @Override
+ public String toString() {
+ return firstName + " " + lastName + "[" + ssn + "]";
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuote.java b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuote.java
new file mode 100644
index 0000000000..b5bafeb204
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuote.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package mortgage;
+
+public interface InterestRateQuote {
+ public float getRate(String state, double loanAmount, int termInYears);
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuoteImpl.java b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuoteImpl.java
new file mode 100644
index 0000000000..8c642667f1
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuoteImpl.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 mortgage;
+
+import org.osoa.sca.annotations.Service;
+
+@Service(InterestRateQuote.class)
+public class InterestRateQuoteImpl implements InterestRateQuote {
+ public float getRate(String state, double loanAmount, int termInYears) {
+ float rate = 6.0f;
+ if (termInYears == 5) {
+ rate = 5.5f;
+ } else {
+ rate = 6.5f;
+ }
+ System.out.println("Interest rate for a " + termInYears
+ + "-year loan of $"
+ + loanAmount
+ + " in "
+ + state
+ + ": "
+ + rate
+ + "%");
+ return rate;
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApproval.java b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApproval.java
new file mode 100644
index 0000000000..dcdad18496
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApproval.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 mortgage;
+
+/**
+ * Loan Approval interface
+ */
+public interface LoanApproval {
+ public boolean approve(Customer customer, double loanAmount, int years);
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApprovalImpl.java b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApprovalImpl.java
new file mode 100644
index 0000000000..40bfdc4a1d
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApprovalImpl.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 mortgage;
+
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * An implementation of the LoanApproval service.
+ */
+@Service(LoanApproval.class)
+// Service declaration
+public class LoanApprovalImpl implements LoanApproval {
+ private CreditCheck[] creditCheck;
+ private MortgageCalculator mortgageCalculator;
+ private InterestRateQuote interestRateQuote;
+
+ // Reference declaration using a protected or public field
+ @Reference
+ public RiskAssessment riskAssessment;
+
+ private int minimumCreditScore = 650;
+
+ // Property declaration using a setter method
+ @Property(name = "minimumCreditScore")
+ public void setMinimumCreditScore(int minimumCreditScore) {
+ this.minimumCreditScore = minimumCreditScore;
+ }
+
+ // Reference declaration using a setter method
+ @Reference
+ public void setCreditCheck(CreditCheck[] creditCheck) {
+ this.creditCheck = creditCheck;
+ }
+
+ @Reference
+ public void setInterestRateQuote(InterestRateQuote interestRateQuote) {
+ this.interestRateQuote = interestRateQuote;
+ }
+
+ @Reference
+ public void setMortgageCalculator(MortgageCalculator mortgageCalculator) {
+ this.mortgageCalculator = mortgageCalculator;
+ }
+
+ public boolean approve(Customer customer, double loanAmount, int years) {
+ int score = 0;
+ for (int i = 0; i < creditCheck.length; i++) {
+ score += creditCheck[i].getCreditScore(customer.getSsn());
+ }
+ if (score != 0) {
+ score = score / creditCheck.length;
+ }
+ if (score < minimumCreditScore) {
+ System.err.println("Credit score " + score + " is below the minimum " + minimumCreditScore + ".");
+ return false;
+ }
+ float rate = interestRateQuote.getRate(customer.getState(), loanAmount, years);
+ double monthlyPayment = mortgageCalculator.getMonthlyPayment(loanAmount, years, rate);
+ double ratio = monthlyPayment / customer.getMonthlyIncome();
+ boolean approved = riskAssessment.assess(score, ratio);
+ if (!approved) {
+ System.err.println("Debt/Income ratio " + ratio + " is too high.");
+ }
+ return approved;
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculator.java b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculator.java
new file mode 100644
index 0000000000..cacd8694de
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculator.java
@@ -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.
+ */
+package mortgage;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * The Mortgage Calculator service interface.
+ */
+@Remotable
+public interface MortgageCalculator {
+ public double getMonthlyPayment(double principal, int years, float interestRate);
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculatorImpl.java b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculatorImpl.java
new file mode 100644
index 0000000000..015f1bae98
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculatorImpl.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 mortgage;
+
+import org.osoa.sca.annotations.Service;
+
+/**
+ * An implementation of the Calculator service.
+ */
+@Service(MortgageCalculator.class)
+public class MortgageCalculatorImpl implements MortgageCalculator {
+
+ public double getMonthlyPayment(double principal, int years, float interestRate) {
+ double monthlyRate = interestRate / 12.0 / 100.0;
+ double p = Math.pow(1 + monthlyRate, years * 12);
+ double q = p / (p - 1);
+ double monthlyPayment = principal * monthlyRate * q;
+ System.out.println("Monthly payment for a " + years + "-year loan of $" + principal + ": " + monthlyPayment);
+ return monthlyPayment;
+ }
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageClient.java b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageClient.java
new file mode 100644
index 0000000000..d69f0a1163
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageClient.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 mortgage;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+/**
+ * This client program to invoke the Mortgage LoanApproval service
+ */
+public class MortgageClient {
+ public static void main(String[] args) throws Exception {
+
+ SCADomain domain = SCADomain.newInstance("Mortgage1.composite");
+ LoanApproval loanApplication = domain.getService(LoanApproval.class, "LoanApprovalComponent");
+
+ // Create the customer
+ Customer customer = new Customer();
+ customer.setSsn("111-22-3333");
+ customer.setFirstName("John");
+ customer.setLastName("Smith");
+ customer.setMonthlyIncome(5000.0d);
+ customer.setState("CA");
+
+ // Invoke the service
+ boolean result = loanApplication.approve(customer, 200000d, 30);
+ System.out.println((result ? "Approved: " : "Rejected: ") + customer);
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessment.java b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessment.java
new file mode 100644
index 0000000000..23c9589e85
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessment.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 mortgage;
+
+/**
+ * Risk Assessment interface
+ */
+public interface RiskAssessment {
+ public boolean assess(int creditScore, double ratio);
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessmentImpl.java b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessmentImpl.java
new file mode 100644
index 0000000000..c2116366ec
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessmentImpl.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 mortgage;
+
+import org.osoa.sca.annotations.Service;
+
+/**
+ * A pojo implementation of RiskAssessment service
+ */
+@Service(RiskAssessment.class)
+public class RiskAssessmentImpl implements RiskAssessment {
+ public boolean assess(int creditScore, double ratio) {
+ if (creditScore >= 750) {
+ return ratio < 0.35;
+ } else if (creditScore >= 700) {
+ return ratio < 0.30;
+ } else {
+ return ratio < 0.25;
+ }
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/resources/Mortgage.composite b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/resources/Mortgage.composite
new file mode 100644
index 0000000000..d1128b9907
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/resources/Mortgage.composite
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+ 600
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/resources/Mortgage1.composite b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/resources/Mortgage1.composite
new file mode 100644
index 0000000000..4cad6c7223
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/resources/Mortgage1.composite
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+ 600
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.componentType b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.componentType
new file mode 100644
index 0000000000..bf7b10e0f7
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.componentType
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.js b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.js
new file mode 100644
index 0000000000..b25af1d039
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.js
@@ -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.
+ */
+function getMonthlyPayment(principal, years, interestRate) {
+ var monthlyRate = interestRate / 12.0 / 100.0;
+ var p = Math.pow(1 + monthlyRate, years * 12);
+ var q = p / (p - 1);
+ var monthlyPayment = principal * monthlyRate * q;
+ return monthlyPayment;
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/resources/wsdl/credit.wsdl b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/resources/wsdl/credit.wsdl
new file mode 100644
index 0000000000..9c2acc96d3
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/main/resources/wsdl/credit.wsdl
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/test/java/mortgage/MortgageClientTestCase.java b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/test/java/mortgage/MortgageClientTestCase.java
new file mode 100644
index 0000000000..285cc72515
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/mortgage-loanapproval/src/test/java/mortgage/MortgageClientTestCase.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 mortgage;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class MortgageClientTestCase extends TestCase {
+ private SCADomain domain;
+ private LoanApproval loanApproval;
+
+ @Override
+ protected void setUp() throws Exception {
+ domain = SCADomain.newInstance("Mortgage.composite");
+ loanApproval = domain.getService(LoanApproval.class, "LoanApprovalComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ if (domain != null) {
+ domain.close();
+ }
+ }
+
+ public void testApprove() throws Exception {
+ Customer customer = new Customer();
+ customer.setSsn("111-22-3333");
+ customer.setFirstName("John");
+ customer.setLastName("Smith");
+ customer.setMonthlyIncome(5000.0d);
+ customer.setState("CA");
+
+ boolean approved = loanApproval.approve(customer, 200000d, 30);
+ System.out.println((approved ? "Approved: " : "Rejected: ") + customer);
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/pom.xml b/tags/java/sca/1.2-RC3a/demos/pom.xml
new file mode 100644
index 0000000000..56c59a9f37
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/pom.xml
@@ -0,0 +1,52 @@
+
+
+
+ 4.0.0
+
+ org.apache.tuscany.sca
+ tuscany-sca
+ 1.2-incubating
+ ../pom.xml
+
+ tuscany-demos
+ pom
+ Apache Tuscany SCA Demos
+
+
+
+ default
+
+ true
+
+
+ alert-aggregator-webapp
+ bigbank
+ bigbank-account
+ bigbank-calculator
+ bigbank-stockquote
+ mortgage-creditcheck
+ mortgage-loanapproval
+ xml-bigbank
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/DISCLAIMER b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/DISCLAIMER
new file mode 100644
index 0000000000..d68a410903
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/DISCLAIMER
@@ -0,0 +1,8 @@
+Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/LICENSE b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/LICENSE
new file mode 100644
index 0000000000..6e529a25c4
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/LICENSE
@@ -0,0 +1,205 @@
+
+ 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.
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/NOTICE b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/NOTICE
new file mode 100644
index 0000000000..1325efd8bf
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/NOTICE
@@ -0,0 +1,6 @@
+${pom.name}
+Copyright (c) 2005 - 2008 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/README b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/README
new file mode 100644
index 0000000000..77586b8861
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/README
@@ -0,0 +1,48 @@
+XML BigBank Demo
+================
+
+This demo showcases the integration with XML technolgies in the service assembly.
+
+Note: To build the project with maven or other IDEs, please download the WSDL from http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx?WSDL and save the file as src/main/resources/wsdl/StockQuotes.wsdl.
+
+Note: The live stock quote web service is not always running. Sometimes empty response is returned and the stock value is 0.
+
+To run the demo, type "ant run" and it will produce the following output.
+
+Buildfile: build.xml
+
+init:
+ [get] Getting: http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx?WSDL
+ [get] To: C:\Apache\tuscany-sca-1.0.1-incubating\demos\xml-bigbank\src\main\resources\wsdl\StockQuotes.wsdl
+ [get] local file date : Tue Nov 06 15:50:37 PST 2007
+ [get] .
+ [get] last modified = Wed Dec 31 16:00:00 PST 1969 - using current time instead
+ [mkdir] Created dir: C:\Apache\tuscany-sca-1.0.1-incubating\demos\xml-bigbank\target\classes
+
+compile:
+ [javac] Compiling 11 source files to C:\Apache\tuscany-sca-1.0.1-incubating\demos\xml-bigbank\target\classes
+ [copy] Copying 6 files to C:\Apache\tuscany-sca-1.0.1-incubating\demos\xml-bigbank\target\classes
+ [jar] Building jar: C:\Apache\tuscany-sca-1.0.1-incubating\demos\xml-bigbank\target\demo-xml-bigbank.jar
+
+run:
+ [java] Nov 6, 2007 3:52:28 PM org.apache.axis2.deployment.DeploymentEngine loadFromClassPath
+ [java] INFO: Module validation failed: The system is attempting to engage a module that is not available: rampart
+ [java] Retrieving exchange rate...
+ [java] Nov 6, 2007 3:52:29 PM org.apache.tuscany.sca.binding.feed.provider.RSSBindingInvoker invoke
+ [java] INFO: >>> RSSBindingInvoker (rss_2.0) http://ansuz.sooke.bc.ca/rippy/exchange/?M=R&B=USD&F=CAD,CNY,EUR&T=F&S=O&I=S
+ [java] Exchange rate: USD 1.0=EUR 0.68705
+ [java] Loading account data...
+ [java] Getting stock quote...
+ [java] Nov 6, 2007 3:52:30 PM org.apache.commons.httpclient.HttpMethodBase readResponse
+ [java] INFO: Discarding unexpected response: HTTP/1.1 100 Continue
+ [java] Calculating total value...
+ [java] Checking Balance: xs:double: 1000
+ [java] Saving Blance: xs:double: 20000
+ [java] Stock Value: xs:integer: 0
+ [java] Total Value [1]: xs:double: 21000
+ [java] Total Value=USD 21000.0
+ [java] EUR: 14428.050000000001
+
+BUILD SUCCESSFUL
+Total time: 7 seconds
+
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/build.xml b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/build.xml
new file mode 100644
index 0000000000..0ba1b069aa
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/build.xml
@@ -0,0 +1,63 @@
+
+
+]>
+
+
+ &buildDependency;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/pom.xml b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/pom.xml
new file mode 100644
index 0000000000..2c382da5ca
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/pom.xml
@@ -0,0 +1,121 @@
+
+
+
+ 4.0.0
+
+ org.apache.tuscany.sca
+ tuscany-demos
+ 1.2-incubating
+ ../pom.xml
+
+ demo-xml-bigbank
+ jar
+ Apache Tuscany SCA XML BigBank Demo
+ Apache Tuscany SCA XML BigBank Demo
+
+
+
+ org.apache.tuscany.sca
+ tuscany-host-embedded
+ 1.2-incubating
+
+
+
+ org.apache.tuscany.sca
+ tuscany-implementation-java-runtime
+ 1.2-incubating
+ runtime
+
+
+
+ org.apache.tuscany.sca
+ tuscany-binding-ws-axis2
+ 1.2-incubating
+ runtime
+
+
+
+ org.apache.tuscany.sca
+ tuscany-binding-atom-abdera
+ 1.2-incubating
+ runtime
+
+
+
+ rome
+ rome
+ 0.9
+
+
+
+ org.apache.tuscany.sca
+ tuscany-databinding-saxon
+ 1.2-incubating
+ runtime
+
+
+
+
+ org.apache.tuscany.sca
+ tuscany-implementation-xquery
+ 1.2-incubating
+ runtime
+
+
+
+ org.apache.tuscany.sca
+ tuscany-host-jetty
+ 1.2-incubating
+ runtime
+
+
+
+ junit
+ junit
+ 4.2
+ test
+
+
+
+
+
+ ${artifactId}
+
+
+ org.apache.tuscany.sca
+ tuscany-maven-ant-generator
+ 1.2-incubating
+
+
+
+ bigbank.BigBankClient
+ true
+
+
+ generate
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/AccountData.java b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/AccountData.java
new file mode 100644
index 0000000000..c3ae8d0912
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/AccountData.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 bigbank;
+
+import java.io.IOException;
+
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface AccountData {
+ /**
+ * Get the StAX stream that represent the accounts data
+ * @return The StAX stream containign the accounts
+ * @throws IOException
+ */
+ XMLStreamReader getAccounts() throws IOException;
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/AccountDataImpl.java b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/AccountDataImpl.java
new file mode 100644
index 0000000000..1c0c612987
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/AccountDataImpl.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 bigbank;
+
+import java.io.IOException;
+import java.net.URL;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.osoa.sca.annotations.Service;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@Service(AccountData.class)
+public class AccountDataImpl implements AccountData {
+ private XMLInputFactory factory = XMLInputFactory.newInstance();
+
+ public XMLStreamReader getAccounts() throws IOException {
+ URL doc = getClass().getResource("/accounts.xml");
+ XMLStreamReader reader = null;
+ try {
+ reader = factory.createXMLStreamReader(doc.openStream());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return reader;
+ }
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/AccountService.java b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/AccountService.java
new file mode 100644
index 0000000000..4c72384e7b
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/AccountService.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 bigbank;
+
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface AccountService {
+ /**
+ * Get the total value of all accounts owned by the customer
+ * @return The total value
+ */
+ double getTotalValue();
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/AccountServiceImpl.java b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/AccountServiceImpl.java
new file mode 100644
index 0000000000..6b89ac4212
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/AccountServiceImpl.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 bigbank;
+
+import java.io.StringReader;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.osoa.sca.ServiceRuntimeException;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@Service(AccountService.class)
+public class AccountServiceImpl implements AccountService {
+ private static final String STOCK_QUOTE_REQUEST =
+ "IBM,GOOG,MSFT";
+
+ private XMLInputFactory factory = XMLInputFactory.newInstance();
+
+ @Reference
+ protected ExchangeRate exchangeRate;
+
+ @Reference
+ protected StockQuote stockQuote;
+
+ @Reference
+ protected AccountData accountData;
+
+ @Reference
+ protected StockValue stockValue;
+
+ @Property
+ protected String currency;
+
+ public double getTotalValue() {
+ try {
+ double rate = exchangeRate.getExchangeRate(currency);
+
+ System.out.println("Loading account data...");
+ XMLStreamReader accounts = accountData.getAccounts();
+
+ System.out.println("Getting stock quote...");
+ XMLStreamReader request = factory.createXMLStreamReader(new StringReader(STOCK_QUOTE_REQUEST));
+
+ XMLStreamReader quotes = stockQuote.GetStockQuotes(request);
+
+ System.out.println("Calculating total value...");
+ double value = stockValue.calculate(quotes, accounts);
+
+ System.out.println("Total Value=USD " + value);
+
+ return value * rate;
+ } catch (Exception e) {
+ throw new ServiceRuntimeException(e);
+ }
+ }
+
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/BigBankClient.java b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/BigBankClient.java
new file mode 100644
index 0000000000..5695c276b4
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/BigBankClient.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 bigbank;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+/**
+ * This client program to invoke the Mortgage LoanApproval service
+ */
+public class BigBankClient {
+
+ public static void main(String[] args) throws Exception {
+
+ SCADomain domain = SCADomain.newInstance("BigBank.composite");
+ AccountService accountService = domain.getService(AccountService.class, "AccountService");
+
+ System.out.println("EUR: " + accountService.getTotalValue());
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/BigBankServer.java b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/BigBankServer.java
new file mode 100644
index 0000000000..f5f1ca90b6
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/BigBankServer.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 bigbank;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class BigBankServer {
+ public static void main(String[] args) throws Exception {
+
+ System.out.println("Starting the BigBank Service...");
+
+ SCADomain domain = SCADomain.newInstance("http://localhost", "/", "BigBank.composite");
+
+ System.out.println("Press Enter to Exit...");
+ System.in.read();
+
+ domain.close();
+ System.out.println("Bye");
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/CurrencyExchange.java b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/CurrencyExchange.java
new file mode 100644
index 0000000000..8c133f5083
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/CurrencyExchange.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 bigbank;
+
+import org.osoa.sca.annotations.Remotable;
+
+import com.sun.syndication.feed.atom.Feed;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@Remotable
+public interface CurrencyExchange {
+ /**
+ * Get the currency exchange rates as a RSS feed
+ * @return
+ */
+ Feed getRates();
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/ExchangeRate.java b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/ExchangeRate.java
new file mode 100644
index 0000000000..358e5e19a2
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/ExchangeRate.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 bigbank;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface ExchangeRate {
+ /**
+ * Look up the exchange rate of a currency against USD
+ * @param currency The currency
+ * @return The exchange rate
+ */
+ double getExchangeRate(String currency);
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/ExchangeRateImpl.java b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/ExchangeRateImpl.java
new file mode 100644
index 0000000000..8fe76fb1ea
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/ExchangeRateImpl.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 bigbank;
+
+import java.io.ByteArrayInputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpression;
+import javax.xml.xpath.XPathFactory;
+
+import org.osoa.sca.ServiceRuntimeException;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+import com.sun.syndication.feed.atom.Entry;
+import com.sun.syndication.feed.atom.Feed;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@Service(ExchangeRate.class)
+public class ExchangeRateImpl {
+ @Reference
+ protected CurrencyExchange exchangeRate;
+
+ private final DocumentBuilder builder;
+
+ public ExchangeRateImpl() {
+ try {
+ builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ } catch (ParserConfigurationException e) {
+ throw new IllegalArgumentException(e);
+ }
+ }
+
+ /**
+ * Retrieve the live currency exchange rate from a live feed and extract the data for a given
+ * currecy using XPath
+ * @param currency The currency
+ * @return The exchange rate
+ */
+ public double getExchangeRate(String currency) {
+ try {
+ System.out.println("Retrieving exchange rate...");
+ Feed feed = exchangeRate.getRates();
+ Entry entry = (Entry)feed.getEntries().get(0);
+ String rateTable = entry.getSummary().getValue();
+
+ Document doc = builder.parse(new ByteArrayInputStream(rateTable.getBytes()));
+ Node node = doc.getDocumentElement();
+ XPath path = XPathFactory.newInstance().newXPath();
+ XPathExpression exp = path.compile("/TABLE/TR[TD[1]='" + currency.toUpperCase() + "']/TD[2]");
+ Node rateNode = (Node)exp.evaluate(node, XPathConstants.NODE);
+ double rate = Double.valueOf(rateNode.getTextContent().trim());
+ System.out.println("Exchange rate: USD 1.0=" + currency + " " + rate);
+ return rate;
+ } catch (Exception e) {
+ throw new ServiceRuntimeException(e);
+ }
+ }
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/StockQuote.java b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/StockQuote.java
new file mode 100644
index 0000000000..e58c4ff82e
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/StockQuote.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 bigbank;
+
+import javax.xml.stream.XMLStreamReader;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@Remotable
+public interface StockQuote {
+ /**
+ * Invoke the stock quote web service to get the live quotes
+ * @param input The StAX stream of the request
+ * @return The StAX stream of the response
+ */
+ public XMLStreamReader GetStockQuotes(XMLStreamReader input);
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/StockValue.java b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/StockValue.java
new file mode 100644
index 0000000000..c300103398
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/java/bigbank/StockValue.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 bigbank;
+
+import javax.xml.stream.XMLStreamReader;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@Remotable
+public interface StockValue {
+ /**
+ * Join the quotes and accounts document to calculate the value
+ * @param quotes The quotes XML document
+ * @param accounts The accounts XML document
+ * @return The value
+ */
+ double calculate(XMLStreamReader quotes, XMLStreamReader accounts);
+}
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/BigBank.composite b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/BigBank.composite
new file mode 100644
index 0000000000..eef9321de5
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/BigBank.composite
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+ EUR
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/accounts.xml b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/accounts.xml
new file mode 100644
index 0000000000..52ffd41fa7
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/accounts.xml
@@ -0,0 +1,29 @@
+
+
+
+ John
+ Smith
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/customer.xsd b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/customer.xsd
new file mode 100644
index 0000000000..b22efb74c4
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/customer.xsd
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/quotes.xml b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/quotes.xml
new file mode 100644
index 0000000000..5ab0b2687f
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/quotes.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+ INTL BUSINESS MAC
+ IBM
+ 116.40
+ 10/3/2007 4:01pm
+ -1.96
+ 117.65
+ 117.84
+ 116.28
+ 7892471
+ 158.4B
+ 81.56 - 119.60
+ Aug 8
+ 1.18
+ 1.40
+ -1.66%
+
+
+ GOOGLE
+ GOOG
+ 584.0199
+ 10/3/2007 4:00pm
+ -0.3701
+ 586.25
+ 588.99
+ 580.36
+ 3869172
+ 182.3B
+ 398.19 - 596.81
+ N/A
+ N/A
+ 0.00
+ -0.06%
+
+
+ MICROSOFT CP
+ MSFT
+ 29.4525
+ 10/3/2007 4:00pm
+ -0.2475
+ 29.57
+ 29.85
+ 29.29
+ 37324944
+ 276.1B
+ 26.60 - 31.84
+ Aug 14
+ 1.35
+ 0.40
+ -0.83%
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/stock.xq b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/stock.xq
new file mode 100644
index 0000000000..42a5b906c2
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/stock.xq
@@ -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.
+:)
+declare namespace q="http://swanandmokashi.com";
+declare namespace c="http://example.com/customer";
+declare namespace stock="scaservice:java/bigbank.StockValue";
+(: declare namespace currency="scaproperty:java/java.lang.String"; :)
+
+declare function stock:calculate($quoteDoc, $accountDoc) as xs:double {
+ let $checking :=
+ trace(
+ sum(
+ for $a in $accountDoc/c:customer/c:accounts/c:checking
+ return $a/@balance
+ ), "Checking Balance")
+
+ let $saving :=
+ trace(
+ sum(
+ for $a in $accountDoc/c:customer/c:accounts/c:saving
+ return $a/@balance
+ ), "Saving Blance")
+
+ let $value :=
+ trace(
+ sum(
+ for $quote in $quoteDoc/q:GetQuotesResponse/q:GetQuotesResult/q:Quote,
+ $account in $accountDoc/c:customer/c:accounts/c:stock
+ where string($quote/q:StockTicker) = string($account/@symbol)
+ return
+ trace(number($quote/q:StockQuote),"Stock Price") * trace(number($account/@quantity), "Quantity")
+ ), "Stock Value")
+ return trace($checking + $saving + $value, "Total Value")
+};
+
+
+
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/wsdl/StockQuotes.wsdl b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/wsdl/StockQuotes.wsdl
new file mode 100644
index 0000000000..e64f3f5091
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/src/main/resources/wsdl/StockQuotes.wsdl
@@ -0,0 +1,23 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/xml-bigbank.png b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/xml-bigbank.png
new file mode 100644
index 0000000000..0743a413a3
Binary files /dev/null and b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/xml-bigbank.png differ
diff --git a/tags/java/sca/1.2-RC3a/demos/xml-bigbank/xml-bigbank.svg b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/xml-bigbank.svg
new file mode 100644
index 0000000000..c7acc03324
--- /dev/null
+++ b/tags/java/sca/1.2-RC3a/demos/xml-bigbank/xml-bigbank.svg
@@ -0,0 +1,447 @@
+
+
+
+
--
cgit v1.2.3