From 3dd7e2c4da9c80b8182a2d04dc129a67aa7910df Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:06:58 +0000 Subject: Moving 1.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835121 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca-java-0.99/demos/alert-aggregator/README | 82 ++ .../demos/alert-aggregator/alert-aggregator.png | Bin 0 -> 36819 bytes .../demos/alert-aggregator/alert-aggregator.svg | 609 ++++++++++ .../demos/alert-aggregator/build-dojo.xml | 91 ++ .../sca-java-0.99/demos/alert-aggregator/build.xml | 230 ++++ .../sca-java-0.99/demos/alert-aggregator/pom.xml | 253 ++++ .../sca/demos/aggregator/AlertTypeNonSDOImpl.java | 339 ++++++ .../demos/aggregator/AlertsFeedServiceImpl.java | 137 +++ .../sca/demos/aggregator/AlertsService.java | 42 + .../sca/demos/aggregator/AlertsServiceImpl.java | 126 ++ .../sca/demos/aggregator/AlertsSourcesService.java | 72 ++ .../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 ++ .../alert-aggregator/src/main/resources/Alerts.xsd | 80 ++ .../src/main/resources/AlertsSources.wsdl | 124 ++ .../src/main/resources/alerts.composite | 85 ++ .../src/main/resources/sources.xml | 33 + .../src/main/webapp/AlertAggregator.html | 332 +++++ .../src/main/webapp/META-INF/sca-contribution.xml | 26 + .../src/main/webapp/WEB-INF/web.xml | 45 + .../demos/alert-aggregator/src/main/webapp/pop.png | Bin 0 -> 244 bytes .../demos/alert-aggregator/src/main/webapp/rss.png | Bin 0 -> 689 bytes .../alert-aggregator/src/main/webapp/service.smd | 1 + .../alert-aggregator/src/main/webapp/sources.smd | 1 + .../alert-aggregator/src/main/webapp/style.css | 176 +++ .../sca/demos/aggregator/AlertsTestCase.java | 95 ++ .../sca-java-0.99/demos/bigbank-account/README | 51 + .../demos/bigbank-account/bigbank.png | Bin 0 -> 100070 bytes .../demos/bigbank-account/bigbank.svg | 519 ++++++++ .../demos/bigbank-account/build-dojo.xml | 91 ++ .../sca-java-0.99/demos/bigbank-account/build.xml | 80 ++ .../sca-java-0.99/demos/bigbank-account/pom.xml | 175 +++ .../main/java/bigbank/account/AccountService.java | 34 + .../java/bigbank/account/AccountServiceImpl.java | 85 ++ .../java/bigbank/account/feed/AccountFeedImpl.java | 95 ++ .../bigbank/accountdata/AccountDataService.java | 33 + .../accountdata/AccountDataServiceImpl.java | 57 + .../java/bigbank/accountdata/CheckingAccount.java | 50 + .../java/bigbank/accountdata/SavingsAccount.java | 50 + .../java/bigbank/accountdata/StockAccount.java | 59 + .../main/java/bigbank/client/BigBankClient.java | 50 + .../src/main/java/bigbank/demo/BigBankServer.java | 51 + .../main/java/calculator/CalculatorService.java | 34 + .../main/java/stockquote/StockQuoteService.java | 33 + .../src/main/resources/AccountData.composite | 33 + .../src/main/resources/BigBank.composite | 66 + .../src/main/resources/web/AccountJSON.html | 87 ++ .../src/main/resources/web/style.css | 22 + .../src/main/resources/wsdl/AccountService.wsdl | 91 ++ .../src/test/java/test/BigBankTestCase.java | 34 + .../demos/bigbank-calculator/build.xml | 63 + .../sca-java-0.99/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 + .../demos/bigbank-stockquote/build.xml | 61 + .../sca-java-0.99/demos/bigbank-stockquote/pom.xml | 79 ++ .../src/main/java/stockquote/StockQuoteImpl.java | 38 + .../main/java/stockquote/StockQuoteService.java | 33 + .../java/stockquote/demo/StockQuoteServer.java | 42 + .../src/main/resources/StockQuote.composite | 32 + .../demos/mortgage-creditcheck/.ruleset | 172 +++ .../demos/mortgage-creditcheck/build.xml | 66 + .../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 | 34 + .../src/main/resources/META-INF/LICENSE.txt | 1277 ++++++++++++++++++++ .../src/main/resources/META-INF/NOTICE | 18 + .../src/main/resources/META-INF/README.txt | 35 + .../src/main/resources/wsdl/credit.wsdl | 81 ++ .../src/main/webapp/META-INF/tuscany/webapp.scdl | 139 +++ .../src/main/webapp/WEB-INF/default.scdl | 35 + .../src/main/webapp/WEB-INF/web.xml | 41 + .../demos/mortgage-loanapproval/README | 77 ++ .../demos/mortgage-loanapproval/build.xml | 66 + .../demos/mortgage-loanapproval/pom.xml | 89 ++ .../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/META-INF/LICENSE.txt | 1277 ++++++++++++++++++++ .../src/main/resources/META-INF/NOTICE | 18 + .../src/main/resources/Mortgage.composite | 50 + .../src/main/resources/Mortgage1.composite | 55 + .../resources/MortgageCalculator.componentType | 27 + .../src/main/resources/MortgageCalculator.js | 25 + .../src/main/resources/doc/credit_composite.jpg | Bin 0 -> 73610 bytes .../src/main/resources/doc/credit_composite.png | Bin 0 -> 51153 bytes .../src/main/resources/doc/loan_approval.jpg | Bin 0 -> 162536 bytes .../src/main/resources/doc/loan_approval.png | Bin 0 -> 58247 bytes .../src/main/resources/doc/mortgage_assembly0.jpg | Bin 0 -> 145053 bytes .../src/main/resources/doc/mortgage_assembly0.png | Bin 0 -> 93773 bytes .../src/main/resources/doc/mortgage_assembly1.jpg | Bin 0 -> 181317 bytes .../src/main/resources/doc/mortgage_assembly1.png | Bin 0 -> 113404 bytes .../src/main/resources/doc/mortgage_assembly2.jpg | Bin 0 -> 180240 bytes .../src/main/resources/doc/mortgage_assembly2.png | Bin 0 -> 106656 bytes .../src/main/resources/doc/mortgage_composite.jpg | Bin 0 -> 343699 bytes .../src/main/resources/doc/mortgage_composite.png | Bin 0 -> 288351 bytes .../src/main/resources/doc/mortgage_diagrams.doc | Bin 0 -> 2278400 bytes .../src/main/resources/doc/mortgage_package1.jpg | Bin 0 -> 181031 bytes .../src/main/resources/doc/mortgage_package1.png | Bin 0 -> 34939 bytes .../src/main/resources/doc/mortgage_package2.jpg | Bin 0 -> 110930 bytes .../src/main/resources/doc/mortgage_package2.png | Bin 0 -> 58993 bytes .../src/main/resources/doc/mortgage_scenario.jpg | Bin 0 -> 225690 bytes .../src/main/resources/doc/mortgage_scenario.png | Bin 0 -> 106791 bytes .../src/main/resources/doc/readme.html | 136 +++ .../src/main/resources/wsdl/credit.wsdl | 81 ++ .../test/java/mortgage/MortgageClientTestCase.java | 56 + sca-java-1.x/branches/sca-java-0.99/demos/pom.xml | 50 + 133 files changed, 11299 insertions(+) create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/README create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/alert-aggregator.png create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/alert-aggregator.svg create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/build-dojo.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/build.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertTypeNonSDOImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsFeedServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsService.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsSourcesService.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsSourcesServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsTypeNonSDOImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/ConfigTypeNonSDOImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/RSSCheckerService.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/RSSCheckerServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/SourceTypeNonSDOImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/resources/Alerts.wsdl create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/resources/Alerts.xsd create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/resources/AlertsSources.wsdl create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/resources/alerts.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/resources/sources.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/AlertAggregator.html create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/WEB-INF/web.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/pop.png create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/rss.png create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/service.smd create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/sources.smd create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/style.css create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/test/java/org/apache/tuscany/sca/demos/aggregator/AlertsTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/README create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/bigbank.png create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/bigbank.svg create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/build-dojo.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/build.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/account/AccountService.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/account/AccountServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/account/feed/AccountFeedImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/accountdata/AccountDataService.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/accountdata/AccountDataServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/accountdata/CheckingAccount.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/accountdata/SavingsAccount.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/accountdata/StockAccount.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/client/BigBankClient.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/demo/BigBankServer.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/calculator/CalculatorService.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/stockquote/StockQuoteService.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/resources/AccountData.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/resources/BigBank.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/resources/web/AccountJSON.html create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/resources/web/style.css create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/resources/wsdl/AccountService.wsdl create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/test/java/test/BigBankTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/build.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/AddService.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/CalculatorService.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/CalculatorServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/DivideService.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/MultiplyService.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/SubtractService.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/demo/CalculatorServer.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/resources/Calculator.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/resources/calculator/AddServiceImpl.js create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/resources/calculator/DivideServiceImpl.groovy create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/resources/calculator/MultiplyServiceImpl.py create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/resources/calculator/SubtractServiceImpl.rb create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/build.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/src/main/java/stockquote/StockQuoteImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/src/main/java/stockquote/StockQuoteService.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/src/main/java/stockquote/demo/StockQuoteServer.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/src/main/resources/StockQuote.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/.ruleset create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/build.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/java/credit/CreditCheck.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/java/credit/CreditCheckImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/java/credit/CreditCheckServer.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/resources/CreditCheck.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/resources/META-INF/LICENSE.txt create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/resources/META-INF/NOTICE create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/resources/META-INF/README.txt create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/resources/wsdl/credit.wsdl create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/webapp/META-INF/tuscany/webapp.scdl create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/webapp/WEB-INF/default.scdl create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/webapp/WEB-INF/web.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/README create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/build.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/pom.xml create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheck.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheckImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/Customer.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuote.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuoteImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApproval.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApprovalImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculator.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculatorImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageClient.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessment.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessmentImpl.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/META-INF/LICENSE.txt create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/META-INF/NOTICE create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/Mortgage.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/Mortgage1.composite create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.componentType create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.js create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/credit_composite.jpg create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/credit_composite.png create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/loan_approval.jpg create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/loan_approval.png create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly0.jpg create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly0.png create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly1.jpg create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly1.png create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly2.jpg create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly2.png create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_composite.jpg create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_composite.png create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_diagrams.doc create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_package1.jpg create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_package1.png create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_package2.jpg create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_package2.png create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_scenario.jpg create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_scenario.png create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/readme.html create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/wsdl/credit.wsdl create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/test/java/mortgage/MortgageClientTestCase.java create mode 100644 sca-java-1.x/branches/sca-java-0.99/demos/pom.xml (limited to 'sca-java-1.x/branches/sca-java-0.99/demos') diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/README b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/README new file mode 100644 index 0000000000..37a563e47c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/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 +mvn + +This will build and test the source and generate a war file + +demo-alert-aggregator.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 + +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/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/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/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/alert-aggregator.png b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/alert-aggregator.png new file mode 100644 index 0000000000..ae429cca94 Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/alert-aggregator.png differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/alert-aggregator.svg b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/alert-aggregator.svg new file mode 100644 index 0000000000..6c44e716ff --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/alert-aggregator.svg @@ -0,0 +1,609 @@ + + + + + + + + + image/svg+xml + + + + + + + + DisplayComposite - PHP + + Display + + + + + + AlerterComposite - Java + + AlertsService + + + + rest soap + + + soap + + RSS + + + AlertsSourcesService + + + + + + jsonrpc + + + + + soap + + soap + atom + jsonrpc + + + + + + + POP - Not done + + + + + + + + + HTML Web2.0 Thunderbird + + NNTP - Not done + + rss + + AlertFeedService + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/build-dojo.xml b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/build-dojo.xml new file mode 100644 index 0000000000..335a10817a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/build-dojo.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/build.xml b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/build.xml new file mode 100644 index 0000000000..bec59de802 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/build.xml @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/pom.xml b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/pom.xml new file mode 100644 index 0000000000..01b1508c9d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/pom.xml @@ -0,0 +1,253 @@ + + + + 4.0.0 + + + org.apache.tuscany.sca + tuscany-demos + 0.99-incubating-SNAPSHOT + ../pom.xml + + + org.apache.tuscany.sca + demo-alert-aggregator + war + 0.99-incubating-SNAPSHOT + Apache Tuscany Alert Aggregator Demo + http://cwiki.apache.org/TUSCANY + + + + junit + junit + 3.8.1 + test + + + httpunit + httpunit + 1.6.1 + test + + + 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-http-jetty + ${pom.version} + test + + + org.apache.tuscany.sca + tuscany-host-webapp + 0.99-incubating-SNAPSHOT + + + org.apache.tuscany.sca + tuscany-binding-jsonrpc + 0.99-incubating-SNAPSHOT + runtime + + + org.apache.tuscany.sca + tuscany-binding-feed + 0.99-incubating-SNAPSHOT + compile + + + rome + rome + 0.9 + + + + + demo-alert-aggregator + + + 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 + process-resources + + + + ${project.build.directory}/classes/Alerts.wsdl + org.apache.tuscany.sca.demos.aggregator.service + + + ${project.build.directory}/classes/AlertsSources.wsdl + org.apache.tuscany.sca.demos.aggregator.sources + + + ${project.build.directory}/classes/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 + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertTypeNonSDOImpl.java b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertTypeNonSDOImpl.java new file mode 100644 index 0000000000..808374030c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/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/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsFeedServiceImpl.java b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsFeedServiceImpl.java new file mode 100644 index 0000000000..f6479f8633 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsFeedServiceImpl.java @@ -0,0 +1,137 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.ArrayList; +import java.util.List; + +import org.apache.tuscany.sca.binding.feed.collection.Collection; +import org.apache.tuscany.sca.binding.feed.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; + +import com.sun.syndication.feed.atom.Entry; +import com.sun.syndication.feed.atom.Feed; +import com.sun.syndication.feed.synd.SyndEntry; +import com.sun.syndication.feed.synd.SyndEntryImpl; +import com.sun.syndication.feed.synd.SyndFeed; +import com.sun.syndication.feed.synd.SyndFeedImpl; + +/** + * 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 alerts(AlertsService alerts) { + this.alerts = alerts; + } + + DateFormat dateFormatter = DateFormat.getDateTimeInstance(); + + /** + * Return the alerts as a feed. Used by binding.feed + * + * @return the structure containing alerts + */ + public Feed getFeed() { + + // Create a new Feed + SyndFeed feed = new SyndFeedImpl(); + feed.setTitle("Apache Tuscant Feed Aggregator"); + feed.setDescription("A sample showing an SCA application to aggregate various types of feeds"); + feed.setAuthor("Apache Tuscany"); + feed.setLink("http://incubator.apache.org/tuscany"); + + // Aggregate entries from feed1 and feed2 + List entries = new ArrayList(); + + try { + AlertsType alerts = this.alerts.getAllNewAlerts(""); + + for( Object alertObject : alerts.getAlert() ){ + AlertType alert = ((AlertType)alertObject); + SyndEntry entry = new SyndEntryImpl(); + entry.setTitle(alert.getTitle()); + //entry.(alert.getSummary()); + entry.setLink(alert.getAddress()); + entry.setPublishedDate(dateFormatter.parse(alert.getDate())); + + entries.add(entry); + } + } catch(Exception ex) { + System.err.println("Exception " + ex.toString()); + } + + feed.setEntries(entries); + + return (Feed)feed.createWireFeed("atom_1.0"); + } + + /** + * @see org.apache.tuscany.sca.binding.feed.Collection#delete(java.lang.String) + */ + public void delete(String id) throws NotFoundException { + } + + /** + * @see org.apache.tuscany.sca.binding.feed.Collection#get(java.lang.String) + */ + public Entry get(String id) throws NotFoundException { + return null; + } + + /** + * @see org.apache.tuscany.sca.binding.feed.Collection#post(com.sun.syndication.feed.atom.Entry) + */ + public Entry post(Entry entry) { + return null; + } + + /** + * @see org.apache.tuscany.sca.binding.feed.Collection#postMedia(java.lang.String, java.lang.String, java.lang.String, java.io.InputStream) + */ + public Entry postMedia(String title, String slug, String contentType, InputStream media) { + return null; + } + + /** + * @see org.apache.tuscany.sca.binding.feed.Collection#put(java.lang.String, com.sun.syndication.feed.atom.Entry) + */ + public Entry put(String id, Entry entry) throws NotFoundException { + return null; + } + + /** + * @see org.apache.tuscany.sca.binding.feed.Collection#putMedia(java.lang.String, java.lang.String, java.io.InputStream) + */ + public Entry putMedia(String id, String contentType, InputStream media) throws NotFoundException { + return null; + } +} diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsService.java b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsService.java new file mode 100644 index 0000000000..0781965614 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsService.java @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.demos.aggregator; + +import org.apache.tuscany.sca.demos.aggregator.types.AlertsType; +import org.osoa.sca.annotations.Remotable; +import org.osoa.sca.annotations.Service; + +/** + * Retrieve and manage alerts + * + * @version $Rev$ $Date$ + */ +@Remotable +@Service +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/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsServiceImpl.java b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsServiceImpl.java new file mode 100644 index 0000000000..d33e4b8d0f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/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 alertsSources(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/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsSourcesService.java b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsSourcesService.java new file mode 100644 index 0000000000..6d534fd850 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsSourcesService.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 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; +import org.osoa.sca.annotations.Service; + +/** + * Retrieve and manage alert sources + * + * @version $Rev$ $Date$ + */ +@Remotable +@Service +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/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsSourcesServiceImpl.java b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsSourcesServiceImpl.java new file mode 100644 index 0000000000..ca2fc95b4a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/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/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsTypeNonSDOImpl.java b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/AlertsTypeNonSDOImpl.java new file mode 100644 index 0000000000..2962defb25 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/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'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link org.apache.tuscany.sca.samples.aggregator.types.impl.AlertsTypeImpl#getAlert Alert}
  • + *
+ *

+ * + * @generated + */ +public class AlertsTypeNonSDOImpl implements AlertsType +{ + private static final long serialVersionUID = -3784576466148158776L; + +/** + * The cached value of the '{@link #getAlert() Alert}' containment reference list. + * + * + * @see #getAlert() + * @generated + * @ordered + */ + + protected List alert = new ArrayList(); + + /** + * + * + * @generated + */ + public AlertsTypeNonSDOImpl() + { + super(); + } + + /** + * + * + * @generated + */ + public List getAlert() + { + return alert; + } + +} //AlertsTypeImpl diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/ConfigTypeNonSDOImpl.java b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/ConfigTypeNonSDOImpl.java new file mode 100644 index 0000000000..75544294ce --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/ConfigTypeNonSDOImpl.java @@ -0,0 +1,55 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.ConfigType; + + +public class ConfigTypeNonSDOImpl implements ConfigType +{ + private static final long serialVersionUID = 2522843951360675364L; + + protected List source = new ArrayList(); + + /** + * + * + * @generated + */ + public ConfigTypeNonSDOImpl() + { + super(); + } + + + /** + * + * + * @generated + */ + public List getSource() + { + return source; + } + + +} //ConfigTypeImpl diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/RSSCheckerService.java b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/RSSCheckerService.java new file mode 100644 index 0000000000..2a5775e9a9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/RSSCheckerService.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 org.apache.tuscany.sca.demos.aggregator; + +import org.apache.tuscany.sca.demos.aggregator.types.AlertsType; + +/** + * The interface for the rss checker service + */ +public interface RSSCheckerService { + + public AlertsType getNewAlerts(String rssaddress, String lastchecktimestamp); + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/RSSCheckerServiceImpl.java b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/RSSCheckerServiceImpl.java new file mode 100644 index 0000000000..9b73a27625 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/RSSCheckerServiceImpl.java @@ -0,0 +1,85 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.demos.aggregator; + +import java.net.URL; +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.TypesFactory; + +import com.sun.syndication.feed.synd.SyndEntry; +import com.sun.syndication.feed.synd.SyndFeed; +import com.sun.syndication.io.SyndFeedInput; +import com.sun.syndication.io.XmlReader; + +/** + * The interface for the rss checker service + */ +public class RSSCheckerServiceImpl implements RSSCheckerService { + + public AlertsType getNewAlerts(String rssaddress, String lastchecktimestamp){ + // Create the list of alerts to return + TypesFactory factory = TypesFactory.INSTANCE; + AlertsType returnAlerts = factory.createAlertsType(); + List returnAlertList = returnAlerts.getAlert(); + + try { + // Turn the date into something we can process. + DateFormat dateFormatter = DateFormat.getDateTimeInstance(); + Date timestamp = dateFormatter.parse(lastchecktimestamp); + + // get the feed data from the supplied address + SyndFeedInput input = new SyndFeedInput(); + SyndFeed feed = input.build(new XmlReader(new URL(rssaddress))); + //System.out.println(feed); + + // check all the items to see if we have seen them before + List entries = feed.getEntries(); + for(Object entry: entries){ + SyndEntry syndEntry = (SyndEntry)entry; + + if (syndEntry.getPublishedDate().after(timestamp)){ + AlertType newAlert = factory.createAlertType(); + + newAlert.setTitle(syndEntry.getTitle()); + // newAlert.setSummary(""); + newAlert.setSummary(""); + newAlert.setAddress(syndEntry.getLink()); + newAlert.setDate(dateFormatter.format(syndEntry.getPublishedDate())); + newAlert.setId(rssaddress); + newAlert.setUnread(true); + + returnAlertList.add(newAlert); + } + } + + } catch(Exception ex) { + System.err.println("Exception " + ex.toString()); + } + + return returnAlerts; + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/SourceTypeNonSDOImpl.java b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/SourceTypeNonSDOImpl.java new file mode 100644 index 0000000000..10575bf0dc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/java/org/apache/tuscany/sca/demos/aggregator/SourceTypeNonSDOImpl.java @@ -0,0 +1,536 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.SourceType; + +import commonj.sdo.Sequence; + + +public class SourceTypeNonSDOImpl implements SourceType +{ + private static final long serialVersionUID = -4986294578888767793L; + + public final static int NAME = 0; + + public final static int ADDRESS = 1; + + public final static int LAST_CHECKED = 2; + + public final static int FEED_ADDRESS = 3; + + public final static int POP_SERVER = 4; + + public final static int POP_USERNAME = 5; + + public final static int POP_PASSWORD = 6; + + public final static int ANY = -1; + + public final static int ID = 7; + + public final static int TYPE = 8; + + public final static int SDO_PROPERTY_COUNT = 9; + + public final static int EXTENDED_PROPERTY_COUNT = -1; + + + /** + * The internal feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_NAME = 0; + + /** + * The internal feature id for the 'Address' attribute. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_ADDRESS = 1; + + /** + * The internal feature id for the 'Last Checked' attribute. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_LAST_CHECKED = 2; + + /** + * The internal feature id for the 'Feed Address' attribute. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_FEED_ADDRESS = 3; + + /** + * The internal feature id for the 'Pop Server' attribute. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_POP_SERVER = 4; + + /** + * The internal feature id for the 'Pop Username' attribute. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_POP_USERNAME = 5; + + /** + * The internal feature id for the 'Pop Password' attribute. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_POP_PASSWORD = 6; + + /** + * The internal feature id for the 'Any' attribute list. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_ANY = 7; + + /** + * The internal feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_ID = 8; + + /** + * The internal feature id for the 'Type' attribute. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_TYPE = 9; + + /** + * The number of properties for this type. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_PROPERTY_COUNT = 10; + + + + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_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 #getLastChecked() Last Checked}' attribute. + * + * + * @see #getLastChecked() + * @generated + * @ordered + */ + protected static final String LAST_CHECKED_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getLastChecked() Last Checked}' attribute. + * + * + * @see #getLastChecked() + * @generated + * @ordered + */ + protected String lastChecked = LAST_CHECKED_DEFAULT_; + + /** + * The default value of the '{@link #getFeedAddress() Feed Address}' attribute. + * + * + * @see #getFeedAddress() + * @generated + * @ordered + */ + protected static final String FEED_ADDRESS_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getFeedAddress() Feed Address}' attribute. + * + * + * @see #getFeedAddress() + * @generated + * @ordered + */ + protected String feedAddress = FEED_ADDRESS_DEFAULT_; + + /** + * The default value of the '{@link #getPopServer() Pop Server}' attribute. + * + * + * @see #getPopServer() + * @generated + * @ordered + */ + protected static final String POP_SERVER_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getPopServer() Pop Server}' attribute. + * + * + * @see #getPopServer() + * @generated + * @ordered + */ + protected String popServer = POP_SERVER_DEFAULT_; + + /** + * The default value of the '{@link #getPopUsername() Pop Username}' attribute. + * + * + * @see #getPopUsername() + * @generated + * @ordered + */ + protected static final String POP_USERNAME_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getPopUsername() Pop Username}' attribute. + * + * + * @see #getPopUsername() + * @generated + * @ordered + */ + protected String popUsername = POP_USERNAME_DEFAULT_; + + /** + * The default value of the '{@link #getPopPassword() Pop Password}' attribute. + * + * + * @see #getPopPassword() + * @generated + * @ordered + */ + protected static final String POP_PASSWORD_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getPopPassword() Pop Password}' attribute. + * + * + * @see #getPopPassword() + * @generated + * @ordered + */ + protected String popPassword = POP_PASSWORD_DEFAULT_; + + /** + * The cached value of the '{@link #getAny() Any}' attribute list. + * + * + * @see #getAny() + * @generated + * @ordered + */ + + protected Sequence any = null; + + /** + * 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_; + + /** + * The default value of the '{@link #getFeedType() Feed Type}' attribute. + * + * + * @see #getFeedType() + * @generated + * @ordered + */ + protected static final String FEED_TYPE_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getFeedType() Feed Type}' attribute. + * + * + * @see #getFeedType() + * @generated + * @ordered + */ + protected String feedType = FEED_TYPE_DEFAULT_; + + + /** + * + * + * @generated + */ + public SourceTypeNonSDOImpl() + { + super(); + } + + + + /** + * + * + * @generated + */ + public String getName() + { + return name; + } + /** + * + * + * @generated + */ + public void setName(String newName) + { + name = newName; + } + + /** + * + * + * @generated + */ + public String getAddress() + { + return address; + } + /** + * + * + * @generated + */ + public void setAddress(String newAddress) + { + address = newAddress; + } + + /** + * + * + * @generated + */ + public String getLastChecked() + { + return lastChecked; + } + /** + * + * + * @generated + */ + public void setLastChecked(String newLastChecked) + { + lastChecked = newLastChecked; + } + + /** + * + * + * @generated + */ + public String getFeedAddress() + { + return feedAddress; + } + /** + * + * + * @generated + */ + public void setFeedAddress(String newFeedAddress) + { + feedAddress = newFeedAddress; + } + + /** + * + * + * @generated + */ + public String getPopServer() + { + return popServer; + } + /** + * + * + * @generated + */ + public void setPopServer(String newPopServer) + { + popServer = newPopServer; + } + + /** + * + * + * @generated + */ + public String getPopUsername() + { + return popUsername; + } + /** + * + * + * @generated + */ + public void setPopUsername(String newPopUsername) + { + popUsername = newPopUsername; + } + + /** + * + * + * @generated + */ + public String getPopPassword() + { + return popPassword; + } + /** + * + * + * @generated + */ + public void setPopPassword(String newPopPassword) + { + popPassword = newPopPassword; + } + + /** + * + * + * @generated + */ + public String getId() + { + return id; + } + /** + * + * + * @generated + */ + public void setId(String newId) + { + id = newId; + } + + /** + * + * + * @generated + */ + public String getFeedType() + { + return feedType; + } + /** + * + * + * @generated + */ + public void setFeedType(String newType) + { + feedType = newType; + } + + public Sequence getAny(){ + return null; + } + +} //SourceTypeImpl diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/resources/Alerts.wsdl b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/resources/Alerts.wsdl new file mode 100644 index 0000000000..79b025bc73 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/resources/Alerts.wsdl @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/resources/Alerts.xsd b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/resources/Alerts.xsd new file mode 100644 index 0000000000..f0ec561ad8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/resources/Alerts.xsd @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/resources/AlertsSources.wsdl b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/resources/AlertsSources.wsdl new file mode 100644 index 0000000000..987481bd14 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/resources/AlertsSources.wsdl @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/resources/alerts.composite b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/resources/alerts.composite new file mode 100644 index 0000000000..c359b275be --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/resources/alerts.composite @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/resources/sources.xml b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/resources/sources.xml new file mode 100644 index 0000000000..2168c10c9c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/resources/sources.xml @@ -0,0 +1,33 @@ + + + + + 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 + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/AlertAggregator.html b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/AlertAggregator.html new file mode 100644 index 0000000000..018f4d5521 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/AlertAggregator.html @@ -0,0 +1,332 @@ + + + + Apache Tuscany Alert Aggregator Sample + + + + + + + + + + + + + + +

Apache Tuscany Alert Aggregator Demo

+
+

Alert Sources:

+ +
Refreshing...
+

+ +

+

Refreshing...
+

Back to top

+
+

+

+ + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..0bc67c4c98 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/META-INF/sca-contribution.xml @@ -0,0 +1,26 @@ + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/WEB-INF/web.xml b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..e098d53454 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,45 @@ + + + + + + + Tuscany Alert Aggregator Demo + + + org.apache.tuscany.sca.host.webapp.TuscanyContextListener + + + + TuscanyServlet + org.apache.tuscany.sca.host.webapp.TuscanyServlet + + + + TuscanyServlet + /services/* + + + + AlertAggregator.html + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/pop.png b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/pop.png new file mode 100644 index 0000000000..1cf1df24a7 Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/pop.png differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/rss.png b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/rss.png new file mode 100644 index 0000000000..b3c949d224 Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/rss.png differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/service.smd b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/service.smd new file mode 100644 index 0000000000..bc77e39bf9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/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/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/sources.smd b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/sources.smd new file mode 100644 index 0000000000..b5f1824363 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/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/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/style.css b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/main/webapp/style.css new file mode 100644 index 0000000000..f5bbf23379 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/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/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/test/java/org/apache/tuscany/sca/demos/aggregator/AlertsTestCase.java b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/test/java/org/apache/tuscany/sca/demos/aggregator/AlertsTestCase.java new file mode 100644 index 0000000000..9aedd2e1c7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/alert-aggregator/src/test/java/org/apache/tuscany/sca/demos/aggregator/AlertsTestCase.java @@ -0,0 +1,95 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.json.JSONObject; + +import com.meterware.httpunit.PostMethodWebRequest; +import com.meterware.httpunit.WebConversation; +import com.meterware.httpunit.WebRequest; +import com.meterware.httpunit.WebResponse; + + +/** + */ +public class AlertsTestCase extends TestCase { + private SCADomain scaDomain; + /** + * Runs before each test method + */ + @Override + protected void setUp() throws Exception { + scaDomain = SCADomain.newInstance("alerts.composite"); + super.setUp(); + } + + /** + * Runs after each test method + */ + @Override + protected 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"); + } +*/ + + public void testGetAllNewAlerts() throws Exception { + JSONObject jsonRequest = new JSONObject("{\"params\":[\"sometext\"],\"method\":\"getAllNewAlerts\",\"id\":2}"); + JSONObject jsonResp = callService ("http://localhost:8080/AlertsServiceJSONRPC", + jsonRequest); + assertNotNull(jsonResp); + } + + 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/AlertsSourcesServiceJSONRPC", + jsonRequest); + assertNotNull(jsonResp); + } + + public void testGetAlertSources() throws Exception { + JSONObject jsonRequest = new JSONObject("{\"params\":[\"sometext\"],\"method\":\"getAlertSources\",\"id\":2}"); + JSONObject jsonResp = callService ("http://localhost:8080/AlertsSourcesServiceJSONRPC", + jsonRequest); + 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()); + assertEquals(200, response.getResponseCode()); + return new JSONObject(response.getText()); + } +} diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/README b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/README new file mode 100644 index 0000000000..155c950f30 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/README @@ -0,0 +1,51 @@ +BigBank +====== + +This application comprises three modules that represent the different aspects +of a fictitious banking application. To run the sample you need to run each of +the modules sample servers. This will bring up a Tuscany runtime, load the +application and make the application's services available. You will need both +ant and maven installed to run these applications. + +Bigbank-calculator +------------------ + +A calculator application, based on the calculator-script sample that uses a +variety of languages to implement a calculator, which the banking application +uses for simple value multiplication. To run the service do the following: + +cd bigbank-calculator +ant run + +Bigbank-stockquote +------------------ + +A very simple web services based stock quote application which returns random +stock quotes on request. + +cd bigbank-stockquote +ant run + +Bigbank-account +--------------- + +The front end of this demo application this module provides a web app for +retrieving account information. It makes calls out to the stockquote and +calculator applications to satisfy account requests. See the README in this +module for further instructions. + +cd bigbank-account +ant run + +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. + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/bigbank.png b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/bigbank.png new file mode 100644 index 0000000000..985cc6bd05 Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/bigbank.png differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/bigbank.svg b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/bigbank.svg new file mode 100644 index 0000000000..6698b8cc9b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/bigbank.svg @@ -0,0 +1,519 @@ + + + + + + + + + image/svg+xml + + + + + + + + CompositeBigBank WebApp + + Component AccountJava + + + + Component AccountDataJava + binding.jsonrpc + binding.ws + binding.rmi + + + + CompositeStockQuote + + CompositeCalculator + + Component CalculatorJava + + + + Component AddJavascript + binding.rmi + + + Component SubtractRuby + + Component MultiplyPython + + Component DivideGroovy + + + + Component StockQuoteJava + + binding.ws + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/build-dojo.xml b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/build-dojo.xml new file mode 100644 index 0000000000..920216a2b5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/build-dojo.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/build.xml b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/build.xml new file mode 100644 index 0000000000..e77283df6f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/build.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/pom.xml b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/pom.xml new file mode 100644 index 0000000000..2e6cf990ca --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/pom.xml @@ -0,0 +1,175 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-demos + 0.99-incubating-SNAPSHOT + ../pom.xml + + demo-bigbank-account + jar + Apache Tuscany BigBank Account Demo + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + org.apache.tuscany.sca + tuscany-host-embedded + 0.99-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-binding-feed + 0.99-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 0.99-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 0.99-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jsonrpc + 0.99-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-rmi + 0.99-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-resource + 0.99-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-http + 0.99-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-http-jetty + 0.99-incubating-SNAPSHOT + runtime + + + + junit + junit + 4.2 + test + + + + + + demo-bigbank-account + + + 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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/account/AccountService.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/account/AccountService.java new file mode 100644 index 0000000000..abe65cbbe0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/account/AccountService.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 bigbank.account; + +import org.osoa.sca.annotations.Remotable; +import org.osoa.sca.annotations.Service; + +/** + * @version $$Rev$$ $$Date$$ + */ + +@Remotable +@Service +public interface AccountService { + + public double getAccountReport(String customerID); + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/account/AccountServiceImpl.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/account/AccountServiceImpl.java new file mode 100644 index 0000000000..4f1afee204 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/account/AccountServiceImpl.java @@ -0,0 +1,85 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package 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.accountdata.AccountDataService; +import bigbank.accountdata.CheckingAccount; +import bigbank.accountdata.SavingsAccount; +import bigbank.accountdata.StockAccount; +import calculator.CalculatorService; + +/** + * @version $$Rev$$ $$Date$$ + */ + +@Service(AccountService.class) +public class AccountServiceImpl implements AccountService { + + @Reference + protected AccountDataService accountDataService; + + @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 + CheckingAccount checking = accountDataService.getCheckingAccount(customerID); + System.out.println("Checking account: " + checking); + + SavingsAccount savings = accountDataService.getSavingsAccount(customerID); + System.out.println("Savings account: " + savings); + + StockAccount stock = accountDataService.getStockAccount(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; + } +} diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/account/feed/AccountFeedImpl.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/account/feed/AccountFeedImpl.java new file mode 100644 index 0000000000..c17e9ada20 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/account/feed/AccountFeedImpl.java @@ -0,0 +1,95 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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 java.util.Collections; + +import org.apache.tuscany.sca.binding.feed.collection.Collection; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import bigbank.account.AccountService; + +import com.sun.syndication.feed.atom.Content; +import com.sun.syndication.feed.atom.Entry; +import com.sun.syndication.feed.atom.Feed; +import com.sun.syndication.feed.atom.Link; + +/** + * @version $$Rev$$ $$Date$$ + */ + +@Service(Collection.class) +public class AccountFeedImpl implements Collection { + + @Reference + protected AccountService accountService; + + @SuppressWarnings("unchecked") + public com.sun.syndication.feed.atom.Feed getFeed() { + + // Create a new Feed + Feed feed = new Feed(); + feed.setId("accounts"); + feed.setTitle("Account Report Feed"); + Content subtitle = new Content(); + subtitle.setValue("This is a sample feed"); + feed.setSubtitle(subtitle); + Link link = new Link(); + link.setHref("http://incubator.apache.org/tuscany"); + feed.getAlternateLinks().add(link); + + // Add the Account report entry + Entry entry = get("1234"); + feed.getEntries().add(entry); + + return feed; + } + + public void delete(String id) { + } + + public Entry get(String id) { + + // Get the account report for the specified customer ID + double balance = accountService.getAccountReport(id); + String value = Double.toString(balance); + + Entry entry = new Entry(); + entry.setId("account-" + id); + entry.setTitle("Account Report Entry"); + Content summary = new Content(); + summary.setType(Content.HTML); + summary.setValue("This is your account report: " + value + ""); + entry.setSummary(summary); + Content content = new Content(); + content.setValue(value); + entry.setContents(Collections.singletonList(content)); + return entry; + } + + public Entry post(Entry entry) { + return null; + } + + public Entry put(String id, Entry entry) { + return null; + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/accountdata/AccountDataService.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/accountdata/AccountDataService.java new file mode 100644 index 0000000000..02f4d0e7b6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/accountdata/AccountDataService.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 bigbank.accountdata; + +/** + * @version $$Rev$$ $$Date$$ + */ + +public interface AccountDataService { + + public CheckingAccount getCheckingAccount(String customerID); + + public SavingsAccount getSavingsAccount(String customerID); + + public StockAccount getStockAccount(String customerID); + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/accountdata/AccountDataServiceImpl.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/accountdata/AccountDataServiceImpl.java new file mode 100644 index 0000000000..2e1290aa5f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/accountdata/AccountDataServiceImpl.java @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package bigbank.accountdata; + +import org.osoa.sca.annotations.Service; + +/** + * @version $$Rev$$ $$Date$$ + */ + +@Service(AccountDataService.class) +public class AccountDataServiceImpl implements AccountDataService { + + public CheckingAccount getCheckingAccount(String customerID) { + + CheckingAccount checkingAccount = new CheckingAccount(); + checkingAccount.setAccountNumber("CHA_" + customerID); + checkingAccount.setBalance(500.0f); + + return checkingAccount; + } + + public SavingsAccount getSavingsAccount(String customerID) { + + SavingsAccount savingsAccount = new SavingsAccount(); + savingsAccount.setAccountNumber("SAA_" + customerID); + savingsAccount.setBalance(1500.0f); + + return savingsAccount; + } + + public StockAccount getStockAccount(String customerID) { + + StockAccount stockAccount = new StockAccount(); + stockAccount.setAccountNumber("STA_" + customerID); + stockAccount.setSymbol("IBM"); + stockAccount.setQuantity(100); + + return stockAccount; + } +} diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/accountdata/CheckingAccount.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/accountdata/CheckingAccount.java new file mode 100644 index 0000000000..c53d8b4576 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/accountdata/CheckingAccount.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.accountdata; + +/** + * @version $$Rev$$ $$Date: 2007-04-09 12:03:34 -0700 (Mon, 09 Apr + * 2007) $$ + */ + +public class CheckingAccount { + 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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/accountdata/SavingsAccount.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/accountdata/SavingsAccount.java new file mode 100644 index 0000000000..f4c7442f30 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/accountdata/SavingsAccount.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.accountdata; + +/** + * @version $$Rev$$ $$Date: 2007-04-09 12:03:34 -0700 (Mon, 09 Apr + * 2007) $$ + */ + +public class SavingsAccount { + 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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/accountdata/StockAccount.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/accountdata/StockAccount.java new file mode 100644 index 0000000000..c28e0b59a7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/accountdata/StockAccount.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package bigbank.accountdata; + +/** + * @version $$Rev$$ $$Date: 2007-04-09 12:03:34 -0700 (Mon, 09 Apr + * 2007) $$ + */ + +public class StockAccount { + private String accountNumber; + private String symbol; + private int quantity; + + public String getAccountNumber() { + return accountNumber; + } + + public void setAccountNumber(String n) { + this.accountNumber = n; + } + + public double 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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/client/BigBankClient.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/client/BigBankClient.java new file mode 100644 index 0000000000..a7fa5ecc22 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/demo/BigBankServer.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/demo/BigBankServer.java new file mode 100644 index 0000000000..89b6aeadc4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/bigbank/demo/BigBankServer.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.demo; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +/** + * 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..."); + + 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"); + } + +} diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/calculator/CalculatorService.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/calculator/CalculatorService.java new file mode 100644 index 0000000000..c89043276e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/stockquote/StockQuoteService.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/stockquote/StockQuoteService.java new file mode 100644 index 0000000000..1607344788 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/java/stockquote/StockQuoteService.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 stockquote; + +import org.osoa.sca.annotations.Remotable; +import org.osoa.sca.annotations.Service; + +/** + * This is the business interface of the StockQuote service. + */ +@Remotable +@Service +public interface StockQuoteService { + + public double getQuote(String symbol); +} + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/resources/AccountData.composite b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/resources/AccountData.composite new file mode 100644 index 0000000000..c254ca95a8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/resources/AccountData.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/resources/BigBank.composite b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/resources/BigBank.composite new file mode 100644 index 0000000000..d7bf32c6ea --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/resources/BigBank.composite @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + EURO + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/resources/web/AccountJSON.html b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/resources/web/AccountJSON.html new file mode 100644 index 0000000000..8bf8dff70f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/resources/web/AccountJSON.html @@ -0,0 +1,87 @@ + + + + Tuscany JSON-RPC BigBank Client + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Tuscany JSON-RPC BigBank Client
+

This example uses the Dojo Toolkit + to create a JavaScript object accountService for the service at + http://localhost:8080/AccountJSONService + using Dojo's RPC classes + and providing them with http://localhost:8080/AccountJSONService?smd + for Simple Method Description (SMD) input.

+

It then creates a Dojo button that will envoke the getAccountReport method of the accountService object.

+
RequestResponse
+
getAccountReport("Dojo1234")

+
+
None Yet.
+
+
Dojo Debug:
+
+ + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/resources/web/style.css b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/resources/web/style.css new file mode 100644 index 0000000000..1071583264 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/resources/wsdl/AccountService.wsdl b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/resources/wsdl/AccountService.wsdl new file mode 100644 index 0000000000..ac4d987a57 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/main/resources/wsdl/AccountService.wsdl @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/test/java/test/BigBankTestCase.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/test/java/test/BigBankTestCase.java new file mode 100644 index 0000000000..b9979d90e4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-account/src/test/java/test/BigBankTestCase.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 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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/build.xml b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/build.xml new file mode 100644 index 0000000000..d9a6f97a1f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/build.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/pom.xml b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/pom.xml new file mode 100644 index 0000000000..d48c57d6cd --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/pom.xml @@ -0,0 +1,78 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-demos + 0.99-incubating-SNAPSHOT + ../pom.xml + + demo-bigbank-calculator + Apache Tuscany BigBank Calculator Demo + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + org.apache.tuscany.sca + tuscany-host-embedded + 0.99-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 0.99-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-script + 0.99-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-rmi + 0.99-incubating-SNAPSHOT + runtime + + + + junit + junit + 4.2 + test + + + + + + ${artifactId} + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/AddService.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/AddService.java new file mode 100644 index 0000000000..4eeb30a9c2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/CalculatorService.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/CalculatorService.java new file mode 100644 index 0000000000..c89043276e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/CalculatorServiceImpl.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/CalculatorServiceImpl.java new file mode 100644 index 0000000000..ed7bee0f4e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/DivideService.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/DivideService.java new file mode 100644 index 0000000000..131c5a8014 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/MultiplyService.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/MultiplyService.java new file mode 100644 index 0000000000..a917896aeb --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/SubtractService.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/SubtractService.java new file mode 100644 index 0000000000..e328f024ea --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/demo/CalculatorServer.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/java/calculator/demo/CalculatorServer.java new file mode 100644 index 0000000000..b1861daafc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/resources/Calculator.composite b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/resources/Calculator.composite new file mode 100644 index 0000000000..890221245b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/resources/Calculator.composite @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/resources/calculator/AddServiceImpl.js b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/resources/calculator/AddServiceImpl.js new file mode 100644 index 0000000000..1d4d221364 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/resources/calculator/DivideServiceImpl.groovy b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/resources/calculator/DivideServiceImpl.groovy new file mode 100644 index 0000000000..c31c1e8fd6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/resources/calculator/MultiplyServiceImpl.py b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/resources/calculator/MultiplyServiceImpl.py new file mode 100644 index 0000000000..dd56af0ad8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/resources/calculator/SubtractServiceImpl.rb b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-calculator/src/main/resources/calculator/SubtractServiceImpl.rb new file mode 100644 index 0000000000..08fa310f46 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/build.xml b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/build.xml new file mode 100644 index 0000000000..e5c2e58951 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/build.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/pom.xml b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/pom.xml new file mode 100644 index 0000000000..3ffc2f2b60 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/pom.xml @@ -0,0 +1,79 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-demos + 0.99-incubating-SNAPSHOT + ../pom.xml + + demo-bigbank-stockquote + Apache Tuscany BigBank StockQuote Demo + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + org.apache.tuscany.sca + tuscany-host-embedded + 0.99-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 0.99-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 0.99-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-http-tomcat + 0.99-incubating-SNAPSHOT + runtime + + + + junit + junit + 4.2 + test + + + + + + ${artifactId} + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/src/main/java/stockquote/StockQuoteImpl.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/src/main/java/stockquote/StockQuoteImpl.java new file mode 100644 index 0000000000..2a0801f9b8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/src/main/java/stockquote/StockQuoteService.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/src/main/java/stockquote/StockQuoteService.java new file mode 100644 index 0000000000..1607344788 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/src/main/java/stockquote/StockQuoteService.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 stockquote; + +import org.osoa.sca.annotations.Remotable; +import org.osoa.sca.annotations.Service; + +/** + * This is the business interface of the StockQuote service. + */ +@Remotable +@Service +public interface StockQuoteService { + + public double getQuote(String symbol); +} + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/src/main/java/stockquote/demo/StockQuoteServer.java b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/src/main/java/stockquote/demo/StockQuoteServer.java new file mode 100644 index 0000000000..04ed762602 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/src/main/resources/StockQuote.composite b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/src/main/resources/StockQuote.composite new file mode 100644 index 0000000000..b793985c44 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/bigbank-stockquote/src/main/resources/StockQuote.composite @@ -0,0 +1,32 @@ + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/.ruleset b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/.ruleset new file mode 100644 index 0000000000..2a06794776 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/.ruleset @@ -0,0 +1,172 @@ + + + PMD Plugin preferences rule set + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/build.xml b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/build.xml new file mode 100644 index 0000000000..59f1342276 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/build.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/pom.xml b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/pom.xml new file mode 100644 index 0000000000..7e3409728d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/pom.xml @@ -0,0 +1,75 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-demos + 0.99-incubating-SNAPSHOT + ../pom.xml + + demo-mortgage-creditcheck + war + Apache Tuscany Mortgage Credit Check Demo + A sample Mortgage application made of several SCA components wired together. + + + + org.apache.tuscany.sca + tuscany-host-embedded + 0.99-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 0.99-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 0.99-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-http-tomcat + 0.99-incubating-SNAPSHOT + runtime + + + + junit + junit + 4.2 + test + + + + + + ${artifactId} + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/java/credit/CreditCheck.java b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/java/credit/CreditCheck.java new file mode 100644 index 0000000000..ec95a60227 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/java/credit/CreditCheckImpl.java b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/java/credit/CreditCheckImpl.java new file mode 100644 index 0000000000..f19e8a1250 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/java/credit/CreditCheckServer.java b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/java/credit/CreditCheckServer.java new file mode 100644 index 0000000000..870ea1941d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/resources/CreditCheck.composite b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/resources/CreditCheck.composite new file mode 100644 index 0000000000..739a455801 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/resources/CreditCheck.composite @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/resources/META-INF/LICENSE.txt b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/resources/META-INF/LICENSE.txt new file mode 100644 index 0000000000..25d78feeac --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/resources/META-INF/LICENSE.txt @@ -0,0 +1,1277 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +APACHE TUSCANY SUBCOMPONENTS: + +The Apache Tuscany distribution includes a number of subcomponents with +separate copyright notices and license terms. Your use of the source +code for the these subcomponents is subject to the terms and +conditions of the following licenses. + +=============================================================================== + +For the Eclipse Modeling Framework component and the Celtix binding: + +Eclipse Public License - v 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE +PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF +THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + +a) in the case of the initial Contributor, the initial code and +documentation distributed under this Agreement, and +b) in the case of each subsequent Contributor: + +i) changes to the Program, and + +ii) additions to the Program; + +where such changes and/or additions to the Program originate from and +are distributed by that particular Contributor. A Contribution +'originates' from a Contributor if it was added to the Program by such +Contributor itself or anyone acting on such Contributor's behalf. +Contributions do not include additions to the Program which: (i) are +separate modules of software distributed in conjunction with the +Program under their own license agreement, and (ii) are not derivative +works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor +which are necessarily infringed by the use or sale of its Contribution +alone or when combined with the Program. + +"Program" means the Contributions distributed in accordance with this +Agreement. + +"Recipient" means anyone who receives the Program under this +Agreement, including all Contributors. + +2. GRANT OF RIGHTS + +a) Subject to the terms of this Agreement, each Contributor hereby +grants Recipient a non-exclusive, worldwide, royalty-free copyright +license to reproduce, prepare derivative works of, publicly display, +publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and +object code form. + +b) Subject to the terms of this Agreement, each Contributor hereby +grants Recipient a non-exclusive, worldwide, royalty-free patent +license under Licensed Patents to make, use, sell, offer to sell, +import and otherwise transfer the Contribution of such Contributor, if +any, in source code and object code form. This patent license shall +apply to the combination of the Contribution and the Program if, at +the time the Contribution is added by the Contributor, such addition +of the Contribution causes such combination to be covered by the +Licensed Patents. The patent license shall not apply to any other +combinations which include the Contribution. No hardware per se is +licensed hereunder. + +c) Recipient understands that although each Contributor grants the +licenses to its Contributions set forth herein, no assurances are +provided by any Contributor that the Program does not infringe the +patent or other intellectual property rights of any other entity. Each +Contributor disclaims any liability to Recipient for claims brought by +any other entity based on infringement of intellectual property rights +or otherwise. As a condition to exercising the rights and licenses +granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For +example, if a third party patent license is required to allow +Recipient to distribute the Program, it is Recipient's responsibility +to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient +copyright rights in its Contribution, if any, to grant the copyright +license set forth in this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form +under its own license agreement, provided that: + +a) it complies with the terms and conditions of this Agreement; and + +b) its license agreement: + +i) effectively disclaims on behalf of all Contributors all warranties +and conditions, express and implied, including warranties or +conditions of title and non-infringement, and implied warranties or +conditions of merchantability and fitness for a particular purpose; + +ii) effectively excludes on behalf of all Contributors all liability +for damages, including direct, indirect, special, incidental and +consequential damages, such as lost profits; + +iii) states that any provisions which differ from this Agreement are +offered by that Contributor alone and not by any other party; and + +iv) states that source code for the Program is available from such +Contributor, and informs licensees how to obtain it in a reasonable +manner on or through a medium customarily used for software exchange. + +When the Program is made available in source code form: + +a) it must be made available under this Agreement; and + +b) a copy of this Agreement must be included with each copy of the +Program. + +Contributors may not remove or alter any copyright notices contained +within the Program. + +Each Contributor must identify itself as the originator of its +Contribution, if any, in a manner that reasonably allows subsequent +Recipients to identify the originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain +responsibilities with respect to end users, business partners and the +like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a +commercial product offering should do so in a manner which does not +create potential liability for other Contributors. Therefore, if a +Contributor includes the Program in a commercial product offering, +such Contributor ("Commercial Contributor") hereby agrees to defend +and indemnify every other Contributor ("Indemnified Contributor") +against any losses, damages and costs (collectively "Losses") arising +from claims, lawsuits and other legal actions brought by a third party +against the Indemnified Contributor to the extent caused by the acts +or omissions of such Commercial Contributor in connection with its +distribution of the Program in a commercial product offering. The +obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. +In order to qualify, an Indemnified Contributor must: a) promptly +notify the Commercial Contributor in writing of such claim, and b) +allow the Commercial Contributor to control, and cooperate with the +Commercial Contributor in, the defense and any related settlement +negotiations. The Indemnified Contributor may participate in any such +claim at its own expense. + +For example, a Contributor might include the Program in a commercial +product offering, Product X. That Contributor is then a Commercial +Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance +claims and warranties are such Commercial Contributor's responsibility +alone. Under this section, the Commercial Contributor would have to +defend claims against the other Contributors related to those +performance claims and warranties, and if a court requires any other +Contributor to pay any damages as a result, the Commercial Contributor +must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS +PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY +WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY +OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and +distributing the Program and assumes all risks associated with its +exercise of rights under this Agreement , including but not limited to +the risks and costs of program errors, compliance with applicable +laws, damage to or loss of data, programs or equipment, and +unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR +ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING +WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR +DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED +HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under +applicable law, it shall not affect the validity or enforceability of +the remainder of the terms of this Agreement, and without further +action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity +(including a cross-claim or counterclaim in a lawsuit) alleging that +the Program itself (excluding combinations of the Program with other +software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of +the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it +fails to comply with any of the material terms or conditions of this +Agreement and does not cure such failure in a reasonable period of +time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use +and distribution of the Program as soon as reasonably practicable. +However, Recipient's obligations under this Agreement and any licenses +granted by Recipient relating to the Program shall continue and +survive. + +Everyone is permitted to copy and distribute copies of this Agreement, +but in order to avoid inconsistency the Agreement is copyrighted and +may only be modified in the following manner. The Agreement Steward +reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement +Steward has the right to modify this Agreement. The Eclipse Foundation +is the initial Agreement Steward. The Eclipse Foundation may assign +the responsibility to serve as the Agreement Steward to a suitable +separate entity. Each new version of the Agreement will be given a +distinguishing version number. The Program (including Contributions) +may always be distributed subject to the version of the Agreement +under which it was received. In addition, after a new version of the +Agreement is published, Contributor may elect to distribute the +Program (including its Contributions) under the new version. Except as +expressly stated in Sections 2(a) and 2(b) above, Recipient receives +no rights or licenses to the intellectual property of any Contributor +under this Agreement, whether expressly, by implication, estoppel or +otherwise. All rights in the Program not expressly granted under this +Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and +the intellectual property laws of the United States of America. No +party to this Agreement will bring a legal action under this Agreement +more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation. + +=============================================================================== + +For the Rhino JavaScript container component: + +Mozilla Public License 1.1 (MPL 1.1) + +1. Definitions. + + 1.0.1. "Commercial Use" means distribution or otherwise making the +Covered Code available to a third party. + + 1.1. "Contributor" means each entity that creates or contributes to +the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the Original Code, +prior Modifications used by a Contributor, and the Modifications made by that +particular Contributor. + + 1.3. "Covered Code" means the Original Code or Modifications or the +combination of the Original Code and Modifications, in each case including +portions thereof. + + 1.4. "Electronic Distribution Mechanism" means a mechanism generally +accepted in the software development community for the electronic transfer of +data. + + 1.5. "Executable" means Covered Code in any form other than Source +Code. + + 1.6. "Initial Developer" means the individual or entity identified as +the Initial Developer in the Source Code notice required by Exhibit A. + + 1.7. "Larger Work" means a work which combines Covered Code or +portions thereof with code not governed by the terms of this License. + + 1.8. "License" means this document. + + 1.8.1. "Licensable" means having the right to grant, to the maximum +extent possible, whether at the time of the initial grant or subsequently +acquired, any and all of the rights conveyed herein. + + 1.9. "Modifications" means any addition to or deletion from the +substance or structure of either the Original Code or any previous +Modifications. When Covered Code is released as a series of files, a +Modification is: + A. Any addition to or deletion from the contents of a file +containing Original Code or previous Modifications. + + B. Any new file that contains any part of the Original Code or +previous Modifications. + + 1.10. "Original Code" means Source Code of computer software code +which is described in the Source Code notice required by Exhibit A as Original +Code, and which, at the time of its release under this License is not already +Covered Code governed by this License. + + 1.10.1. "Patent Claims" means any patent claim(s), now owned or +hereafter acquired, including without limitation, method, process, and +apparatus claims, in any patent Licensable by grantor. + + 1.11. "Source Code" means the preferred form of the Covered Code for +making modifications to it, including all modules it contains, plus any +associated interface definition files, scripts used to control compilation and +installation of an Executable, or source code differential comparisons against +either the Original Code or another well known, available Covered Code of the +Contributor's choice. The Source Code can be in a compressed or archival form, +provided the appropriate decompression or de-archiving software is widely +available for no charge. + + 1.12. "You" (or "Your") means an individual or a legal entity +exercising rights under, and complying with all of the terms of, this License +or a future version of this License issued under Section 6.1. For legal +entities, "You" includes any entity which controls, is controlled by, or is +under common control with You. For purposes of this definition, "control" +means (a) the power, direct or indirect, to cause the direction or management +of such entity, whether by contract or otherwise, or (b) ownership of more +than fifty percent (50%) of the outstanding shares or beneficial ownership of +such entity. + +2. Source Code License. + + 2.1. The Initial Developer Grant. + The Initial Developer hereby grants You a world-wide, royalty-free, +non-exclusive license, subject to third party intellectual property claims: + (a) under intellectual property rights (other than patent or +trademark) Licensable by Initial Developer to use, reproduce, modify, display, +perform, sublicense and distribute the Original Code (or portions thereof) +with or without Modifications, and/or as part of a Larger Work; and + + (b) under Patents Claims infringed by the making, using or selling +of Original Code, to make, have made, use, practice, sell, and offer for sale, +and/or otherwise dispose of the Original Code (or portions thereof). + (c) the licenses granted in this Section 2.1(a) and +(b) are effective on the date Initial Developer first distributes Original +Code under the terms of this License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is +granted: 1) for code that You delete from the Original Code; 2) separate from +the Original Code; or 3) for infringements caused by: i) the modification of +the Original Code or ii) the combination of the Original Code with other +software or devices. + + 2.2. Contributor Grant. + Subject to third party intellectual property claims, each Contributor +hereby grants You a world-wide, royalty-free, non-exclusive license + + (a) under intellectual property rights (other than patent or +trademark) Licensable by Contributor, to use, reproduce, modify, display, +perform, sublicense and distribute the Modifications created by such +Contributor (or portions thereof) either on an unmodified basis, with other +Modifications, as Covered Code and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using, or selling +of Modifications made by that Contributor either alone and/or in combination +with its Contributor Version (or portions of such combination), to make, use, +sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications +made by that Contributor (or portions thereof); and 2) the combination of +Modifications made by that Contributor with its Contributor Version (or +portions of such combination). + + (c) the licenses granted in Sections 2.2(a) and 2.2(b) are +effective on the date Contributor first makes Commercial Use of the Covered +Code. + + (d) Notwithstanding Section 2.2(b) above, no patent license is +granted: 1) for any code that Contributor has deleted from the Contributor +Version; 2) separate from the Contributor Version; 3) for infringements +caused by: i) third party modifications of Contributor Version or ii) the +combination of Modifications made by that Contributor with other software +(except as part of the Contributor Version) or other devices; or 4) under +Patent Claims infringed by Covered Code in the absence of Modifications made +by that Contributor. + + +3. Distribution Obligations. + + 3.1. Application of License. + The Modifications which You create or to which You contribute are +governed by the terms of this License, including without limitation Section +2.2. The Source Code version of Covered Code may be distributed only under the +terms of this License or a future version of this License released under +Section 6.1, and You must include a copy of this License with every copy of +the Source Code You distribute. You may not offer or impose any terms on any +Source Code version that alters or restricts the applicable version of this +License or the recipients' rights hereunder. However, You may include an +additional document offering the additional rights described in Section 3.5. + + 3.2. Availability of Source Code. + Any Modification which You create or to which You contribute must be +made available in Source Code form under the terms of this License either on +the same media as an Executable version or via an accepted Electronic +Distribution Mechanism to anyone to whom you made an Executable version +available; and if made available via Electronic Distribution Mechanism, must +remain available for at least twelve (12) months after the date it initially +became available, or at least six (6) months after a subsequent version of +that particular Modification has been made available to such recipients. You +are responsible for ensuring that the Source Code version remains available +even if the Electronic Distribution Mechanism is maintained by a third party. + + 3.3. Description of Modifications. + You must cause all Covered Code to which You contribute to contain a +file documenting the changes You made to create that Covered Code and the date +of any change. You must include a prominent statement that the Modification is +derived, directly or indirectly, from Original Code provided by the Initial +Developer and including the name of the Initial Developer in (a) the Source +Code, and (b) in any notice in an Executable version or related documentation +in which You describe the origin or ownership of the Covered Code. + + 3.4. Intellectual Property Matters + (a) Third Party Claims. + If Contributor has knowledge that a license under a third party's +intellectual property rights is required to exercise the rights granted by +such Contributor under Sections 2.1 or 2.2, Contributor must include a text +file with the Source Code distribution titled "LEGAL" which describes the +claim and the party making the claim in sufficient detail that a recipient +will know whom to contact. If Contributor obtains such knowledge after the +Modification is made available as described in Section 3.2, Contributor shall +promptly modify the LEGAL file in all copies Contributor makes available +thereafter and shall take other steps (such as notifying appropriate mailing +lists or newsgroups) reasonably calculated to inform those who received the +Covered Code that new knowledge has been obtained. + + (b) Contributor APIs. + If Contributor's Modifications include an application programming +interface and Contributor has knowledge of patent licenses which are +reasonably necessary to implement that API, Contributor must also include this +information in the LEGAL file. + + (c) Representations. + Contributor represents that, except as disclosed pursuant to +Section 3.4(a) above, Contributor believes that Contributor's Modifications +are Contributor's original creation(s) and/or Contributor has sufficient +rights to grant the rights conveyed by this License. + + + 3.5. Required Notices. + You must duplicate the notice in Exhibit A in each file of the Source +Code. If it is not possible to put such notice in a particular Source Code +file due to its structure, then You must include such notice in a location +(such as a relevant directory) where a user would be likely to look for such a +notice. If You created one or more Modification(s) You may add your name as a +Contributor to the notice described in Exhibit A. You must also duplicate +this License in any documentation for the Source Code where You describe +recipients' rights or ownership rights relating to Covered Code. You may +choose to offer, and to charge a fee for, warranty, support, indemnity or +liability obligations to one or more recipients of Covered Code. However, You +may do so only on Your own behalf, and not on behalf of the Initial Developer +or any Contributor. You must make it absolutely clear than any such warranty, +support, indemnity or liability obligation is offered by You alone, and You +hereby agree to indemnify the Initial Developer and every Contributor for any +liability incurred by the Initial Developer or such Contributor as a result of +warranty, support, indemnity or liability terms You offer. + + 3.6. Distribution of Executable Versions. + You may distribute Covered Code in Executable form only if the +requirements of Section 3.1-3.5 have been met for that Covered Code, and if +You include a notice stating that the Source Code version of the Covered Code +is available under the terms of this License, including a description of how +and where You have fulfilled the obligations of Section 3.2. The notice must +be conspicuously included in any notice in an Executable version, related +documentation or collateral in which You describe recipients' rights relating +to the Covered Code. You may distribute the Executable version of Covered Code +or ownership rights under a license of Your choice, which may contain terms +different from this License, provided that You are in compliance with the +terms of this License and that the license for the Executable version does not +attempt to limit or alter the recipient's rights in the Source Code version +from the rights set forth in this License. If You distribute the Executable +version under a different license You must make it absolutely clear that any +terms which differ from this License are offered by You alone, not by the +Initial Developer or any Contributor. You hereby agree to indemnify the +Initial Developer and every Contributor for any liability incurred by the +Initial Developer or such Contributor as a result of any such terms You offer. + + 3.7. Larger Works. + You may create a Larger Work by combining Covered Code with other code +not governed by the terms of this License and distribute the Larger Work as a +single product. In such a case, You must make sure the requirements of this +License are fulfilled for the Covered Code. + +4. Inability to Comply Due to Statute or Regulation. + + If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Code due to statute, +judicial order, or regulation then You must: (a) comply with the terms of this +License to the maximum extent possible; and (b) describe the limitations and +the code they affect. Such description must be included in the LEGAL file +described in Section 3.4 and must be included with all distributions of the +Source Code. Except to the extent prohibited by statute or regulation, such +description must be sufficiently detailed for a recipient of ordinary skill to +be able to understand it. + +5. Application of this License. + + This License applies to code to which the Initial Developer has attached +the notice in Exhibit A and to related Covered Code. + +6. Versions of the License. + + 6.1. New Versions. + Netscape Communications Corporation ("Netscape") may publish revised +and/or new versions of the License from time to time. Each version will be +given a distinguishing version number. + + 6.2. Effect of New Versions. + Once Covered Code has been published under a particular version of the +License, You may always continue to use it under the terms of that version. +You may also choose to use such Covered Code under the terms of any subsequent +version of the License published by Netscape. No one other than Netscape has +the right to modify the terms applicable to Covered Code created under this +License. + + 6.3. Derivative Works. + If You create or use a modified version of this License (which you may +only do in order to apply it to code which is not already Covered Code +governed by this License), You must (a) rename Your license so that the +phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "MPL", "NPL" or +any confusingly similar phrase do not appear in your license (except to note +that your license differs from this License) and (b) otherwise make it clear +that Your version of the license contains terms which differ from the Mozilla +Public License and Netscape Public License. (Filling in the name of the +Initial Developer, Original Code or Contributor in the notice described in +Exhibit A shall not of themselves be deemed to be modifications of this +License.) + +7. DISCLAIMER OF WARRANTY. + + COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT +LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, +FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE +QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED +CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY +OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR +CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS +LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS +DISCLAIMER. + +8. TERMINATION. + + 8.1. This License and the rights granted hereunder will terminate +automatically if You fail to comply with terms herein and fail to cure such +breach within 30 days of becoming aware of the breach. All sublicenses to the +Covered Code which are properly granted shall survive any termination of this +License. Provisions which, by their nature, must remain in effect beyond the +termination of this License shall survive. + + 8.2. If You initiate litigation by asserting a patent infringement +claim (excluding declatory judgment actions) against Initial Developer or a +Contributor (the Initial Developer or Contributor against whom You file such +action is referred to as "Participant") alleging that: + + (a) such Participant's Contributor Version directly or indirectly +infringes any patent, then any and all rights granted by such Participant to +You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice +from Participant terminate prospectively, unless if within 60 days after +receipt of notice You either: (i) agree in writing to pay Participant a +mutually agreeable reasonable royalty for Your past and future use of +Modifications made by such Participant, or (ii) withdraw Your litigation claim +with respect to the Contributor Version against such Participant. If within +60 days of notice, a reasonable royalty and payment arrangement are not +mutually agreed upon in writing by the parties or the litigation claim is not +withdrawn, the rights granted by Participant to You under Sections 2.1 and/or +2.2 automatically terminate at the expiration of the 60 day notice period +specified above. + + (b) any software, hardware, or device, other than such Participant's +Contributor Version, directly or indirectly infringes any patent, then any +rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are +revoked effective as of the date You first made, used, sold, distributed, or +had made, Modifications made by that Participant. + + 8.3. If You assert a patent infringement claim against Participant +alleging that such Participant's Contributor Version directly or indirectly +infringes any patent where such claim is resolved (such as by license or +settlement) prior to the initiation of patent infringement litigation, then +the reasonable value of the licenses granted by such Participant under +Sections 2.1 or 2.2 shall be taken into account in determining the amount or +value of any payment or license. + + 8.4. In the event of termination under Sections 8.1 or 8.2 above, all +end user license agreements (excluding distributors and resellers) which have +been validly granted by You or any distributor hereunder prior to termination +shall survive termination. + +9. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT +(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL +DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY +SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, +SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, +WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER +FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, +EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH +DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH +OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT +APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE +EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS +EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + +10. U.S. GOVERNMENT END USERS. + + The Covered Code is a "commercial item," as that term is defined in 48 +C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and +"commercial computer software documentation," as such terms are used in 48 +C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. +227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users +acquire Covered Code with only those rights set forth herein. + +11. MISCELLANEOUS. + + This License represents the complete agreement concerning subject matter +hereof. If any provision of this License is held to be unenforceable, such +provision shall be reformed only to the extent necessary to make it +enforceable. This License shall be governed by California law provisions +(except to the extent applicable law, if any, provides otherwise), excluding +its conflict-of-law provisions. With respect to disputes in which at least one +party is a citizen of, or an entity chartered or registered to do business in +the United States of America, any litigation relating to this License shall be +subject to the jurisdiction of the Federal Courts of the Northern District of +California, with venue lying in Santa Clara County, California, with the +losing party responsible for costs, including without limitation, court costs +and reasonable attorneys' fees and expenses. The application of the United +Nations Convention on Contracts for the International Sale of Goods is +expressly excluded. Any law or regulation which provides that the language of +a contract shall be construed against the drafter shall not apply to this +License. + +12. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is +responsible for claims and damages arising, directly or indirectly, out of its +utilization of rights under this License and You agree to work with Initial +Developer and Contributors to distribute such responsibility on an equitable +basis. Nothing herein is intended or shall be deemed to constitute any +admission of liability. + +13. MULTIPLE-LICENSED CODE. + + Initial Developer may designate portions of the Covered Code as +Multiple-Licensed. Multiple-Licensed means that the Initial Developer permits +you to utilize portions of the Covered Code under Your choice of the MPL or +the alternative licenses, if any, specified by the Initial Developer in the +file described in Exhibit A. + + +EXHIBIT A -Mozilla Public License. + + ``The contents of this file are subject to the Mozilla Public License +Version 1.1 (the "License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF + ANY KIND, either express or implied. See the License for the specific +language governing rights and + limitations under the License. + + The Original Code is ______________________________________. + + The Initial Developer of the Original Code is ________________________. +Portions created by + ______________________ are Copyright (C) ______ +_______________________. All Rights + Reserved. + + Contributor(s): ______________________________________. + + Alternatively, the contents of this file may be used under the terms of +the _____ license (the [___] License), in which case the provisions of +[______] License are applicable instead of those above. If you wish to allow +use of your version of this file only under the terms of the [____] License +and not to allow others to use your version of this file under the MPL, +indicate your decision by deleting the provisions above and replace them +with the notice and other provisions required by the [___] License. If you do +not delete the provisions above, a recipient may use your version of this file +under either the MPL or the [___] License." + + [NOTE: The text of this Exhibit A may differ slightly from the text of +the notices in the Source Code files of the Original Code. You should use the +text of this Exhibit A rather than the text found in the Original Code Source +Code for Your Modifications.] + + +=============================================================================== + +For the JAX-WS Reference Implementation component: + +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 + + + 1. Definitions. + + 1.1. "Contributor" means each individual or entity that + creates or contributes to the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the + Original Software, prior Modifications used by a + Contributor (if any), and the Modifications made by that + particular Contributor. + + 1.3. "Covered Software" means (a) the Original Software, or + (b) Modifications, or (c) the combination of files + containing Original Software with files containing + Modifications, in each case including portions thereof. + + 1.4. "Executable" means the Covered Software in any form + other than Source Code. + + 1.5. "Initial Developer" means the individual or entity + that first makes Original Software available under this + License. + + 1.6. "Larger Work" means a work which combines Covered + Software or portions thereof with code not governed by the + terms of this License. + + 1.7. "License" means this document. + + 1.8. "Licensable" means having the right to grant, to the + maximum extent possible, whether at the time of the initial + grant or subsequently acquired, any and all of the rights + conveyed herein. + + 1.9. "Modifications" means the Source Code and Executable + form of any of the following: + + A. Any file that results from an addition to, + deletion from or modification of the contents of a + file containing Original Software or previous + Modifications; + + B. Any new file that contains any part of the + Original Software or previous Modification; or + + C. Any new file that is contributed or otherwise made + available under the terms of this License. + + 1.10. "Original Software" means the Source Code and + Executable form of computer software code that is + originally released under this License. + + 1.11. "Patent Claims" means any patent claim(s), now owned + or hereafter acquired, including without limitation, + method, process, and apparatus claims, in any patent + Licensable by grantor. + + 1.12. "Source Code" means (a) the common form of computer + software code in which modifications are made and (b) + associated documentation included in or with such code. + + 1.13. "You" (or "Your") means an individual or a legal + entity exercising rights under, and complying with all of + the terms of, this License. For legal entities, "You" + includes any entity which controls, is controlled by, or is + under common control with You. For purposes of this + definition, "control" means (a) the power, direct or + indirect, to cause the direction or management of such + entity, whether by contract or otherwise, or (b) ownership + of more than fifty percent (50%) of the outstanding shares + or beneficial ownership of such entity. + + 2. License Grants. + + 2.1. The Initial Developer Grant. + + Conditioned upon Your compliance with Section 3.1 below and + subject to third party intellectual property claims, the + Initial Developer hereby grants You a world-wide, + royalty-free, non-exclusive license: + + (a) under intellectual property rights (other than + patent or trademark) Licensable by Initial Developer, + to use, reproduce, modify, display, perform, + sublicense and distribute the Original Software (or + portions thereof), with or without Modifications, + and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, + using or selling of Original Software, to make, have + made, use, practice, sell, and offer for sale, and/or + otherwise dispose of the Original Software (or + portions thereof). + + (c) The licenses granted in Sections 2.1(a) and (b) + are effective on the date Initial Developer first + distributes or otherwise makes the Original Software + available to a third party under the terms of this + License. + + (d) Notwithstanding Section 2.1(b) above, no patent + license is granted: (1) for code that You delete from + the Original Software, or (2) for infringements + caused by: (i) the modification of the Original + Software, or (ii) the combination of the Original + Software with other software or devices. + + 2.2. Contributor Grant. + + Conditioned upon Your compliance with Section 3.1 below and + subject to third party intellectual property claims, each + Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + (a) under intellectual property rights (other than + patent or trademark) Licensable by Contributor to + use, reproduce, modify, display, perform, sublicense + and distribute the Modifications created by such + Contributor (or portions thereof), either on an + unmodified basis, with other Modifications, as + Covered Software and/or as part of a Larger Work; and + + + (b) under Patent Claims infringed by the making, + using, or selling of Modifications made by that + Contributor either alone and/or in combination with + its Contributor Version (or portions of such + combination), to make, use, sell, offer for sale, + have made, and/or otherwise dispose of: (1) + Modifications made by that Contributor (or portions + thereof); and (2) the combination of Modifications + made by that Contributor with its Contributor Version + (or portions of such combination). + + (c) The licenses granted in Sections 2.2(a) and + 2.2(b) are effective on the date Contributor first + distributes or otherwise makes the Modifications + available to a third party. + + (d) Notwithstanding Section 2.2(b) above, no patent + license is granted: (1) for any code that Contributor + has deleted from the Contributor Version; (2) for + infringements caused by: (i) third party + modifications of Contributor Version, or (ii) the + combination of Modifications made by that Contributor + with other software (except as part of the + Contributor Version) or other devices; or (3) under + Patent Claims infringed by Covered Software in the + absence of Modifications made by that Contributor. + + 3. Distribution Obligations. + + 3.1. Availability of Source Code. + + Any Covered Software that You distribute or otherwise make + available in Executable form must also be made available in + Source Code form and that Source Code form must be + distributed only under the terms of this License. You must + include a copy of this License with every copy of the + Source Code form of the Covered Software You distribute or + otherwise make available. You must inform recipients of any + such Covered Software in Executable form as to how they can + obtain such Covered Software in Source Code form in a + reasonable manner on or through a medium customarily used + for software exchange. + + 3.2. Modifications. + + The Modifications that You create or to which You + contribute are governed by the terms of this License. You + represent that You believe Your Modifications are Your + original creation(s) and/or You have sufficient rights to + grant the rights conveyed by this License. + + 3.3. Required Notices. + + You must include a notice in each of Your Modifications + that identifies You as the Contributor of the Modification. + You may not remove or alter any copyright, patent or + trademark notices contained within the Covered Software, or + any notices of licensing or any descriptive text giving + attribution to any Contributor or the Initial Developer. + + 3.4. Application of Additional Terms. + + You may not offer or impose any terms on any Covered + Software in Source Code form that alters or restricts the + applicable version of this License or the recipients' + rights hereunder. You may choose to offer, and to charge a + fee for, warranty, support, indemnity or liability + obligations to one or more recipients of Covered Software. + However, you may do so only on Your own behalf, and not on + behalf of the Initial Developer or any Contributor. You + must make it absolutely clear that any such warranty, + support, indemnity or liability obligation is offered by + You alone, and You hereby agree to indemnify the Initial + Developer and every Contributor for any liability incurred + by the Initial Developer or such Contributor as a result of + warranty, support, indemnity or liability terms You offer. + + + 3.5. Distribution of Executable Versions. + + You may distribute the Executable form of the Covered + Software under the terms of this License or under the terms + of a license of Your choice, which may contain terms + different from this License, provided that You are in + compliance with the terms of this License and that the + license for the Executable form does not attempt to limit + or alter the recipient's rights in the Source Code form + from the rights set forth in this License. If You + distribute the Covered Software in Executable form under a + different license, You must make it absolutely clear that + any terms which differ from this License are offered by You + alone, not by the Initial Developer or Contributor. You + hereby agree to indemnify the Initial Developer and every + Contributor for any liability incurred by the Initial + Developer or such Contributor as a result of any such terms + You offer. + + 3.6. Larger Works. + + You may create a Larger Work by combining Covered Software + with other code not governed by the terms of this License + and distribute the Larger Work as a single product. In such + a case, You must make sure the requirements of this License + are fulfilled for the Covered Software. + + 4. Versions of the License. + + 4.1. New Versions. + + Sun Microsystems, Inc. is the initial license steward and + may publish revised and/or new versions of this License + from time to time. Each version will be given a + distinguishing version number. Except as provided in + Section 4.3, no one other than the license steward has the + right to modify this License. + + 4.2. Effect of New Versions. + + You may always continue to use, distribute or otherwise + make the Covered Software available under the terms of the + version of the License under which You originally received + the Covered Software. If the Initial Developer includes a + notice in the Original Software prohibiting it from being + distributed or otherwise made available under any + subsequent version of the License, You must distribute and + make the Covered Software available under the terms of the + version of the License under which You originally received + the Covered Software. Otherwise, You may also choose to + use, distribute or otherwise make the Covered Software + available under the terms of any subsequent version of the + License published by the license steward. + + 4.3. Modified Versions. + + When You are an Initial Developer and You want to create a + new license for Your Original Software, You may create and + use a modified version of this License if You: (a) rename + the license and remove any references to the name of the + license steward (except to note that the license differs + from this License); and (b) otherwise make it clear that + the license contains terms which differ from this License. + + + 5. DISCLAIMER OF WARRANTY. + + COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" + BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, + INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED + SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR + PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND + PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY + COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE + INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF + ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF + WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF + ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS + DISCLAIMER. + + 6. TERMINATION. + + 6.1. This License and the rights granted hereunder will + terminate automatically if You fail to comply with terms + herein and fail to cure such breach within 30 days of + becoming aware of the breach. Provisions which, by their + nature, must remain in effect beyond the termination of + this License shall survive. + + 6.2. If You assert a patent infringement claim (excluding + declaratory judgment actions) against Initial Developer or + a Contributor (the Initial Developer or Contributor against + whom You assert such claim is referred to as "Participant") + alleging that the Participant Software (meaning the + Contributor Version where the Participant is a Contributor + or the Original Software where the Participant is the + Initial Developer) directly or indirectly infringes any + patent, then any and all rights granted directly or + indirectly to You by such Participant, the Initial + Developer (if the Initial Developer is not the Participant) + and all Contributors under Sections 2.1 and/or 2.2 of this + License shall, upon 60 days notice from Participant + terminate prospectively and automatically at the expiration + of such 60 day notice period, unless if within such 60 day + period You withdraw Your claim with respect to the + Participant Software against such Participant either + unilaterally or pursuant to a written agreement with + Participant. + + 6.3. In the event of termination under Sections 6.1 or 6.2 + above, all end user licenses that have been validly granted + by You or any distributor hereunder prior to termination + (excluding licenses granted to You by any distributor) + shall survive termination. + + 7. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT + (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE + INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF + COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE + LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR + CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT + LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK + STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER + COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN + INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF + LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL + INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT + APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO + NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR + CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT + APPLY TO YOU. + + 8. U.S. GOVERNMENT END USERS. + + The Covered Software is a "commercial item," as that term is + defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial + computer software" (as that term is defined at 48 C.F.R. + 252.227-7014(a)(1)) and "commercial computer software + documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. + 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 + through 227.7202-4 (June 1995), all U.S. Government End Users + acquire Covered Software with only those rights set forth herein. + This U.S. Government Rights clause is in lieu of, and supersedes, + any other FAR, DFAR, or other clause or provision that addresses + Government rights in computer software under this License. + + 9. MISCELLANEOUS. + + This License represents the complete agreement concerning subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the + extent necessary to make it enforceable. This License shall be + governed by the law of the jurisdiction specified in a notice + contained within the Original Software (except to the extent + applicable law, if any, provides otherwise), excluding such + jurisdiction's conflict-of-law provisions. Any litigation + relating to this License shall be subject to the jurisdiction of + the courts located in the jurisdiction and venue specified in a + notice contained within the Original Software, with the losing + party responsible for costs, including, without limitation, court + costs and reasonable attorneys' fees and expenses. The + application of the United Nations Convention on Contracts for the + International Sale of Goods is expressly excluded. Any law or + regulation which provides that the language of a contract shall + be construed against the drafter shall not apply to this License. + You agree that You alone are responsible for compliance with the + United States export administration regulations (and the export + control laws and regulation of any other countries) when You use, + distribute or otherwise make available any Covered Software. + + 10. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is + responsible for claims and damages arising, directly or + indirectly, out of its utilization of rights under this License + and You agree to work with Initial Developer and Contributors to + distribute such responsibility on an equitable basis. Nothing + herein is intended or shall be deemed to constitute any admission + of liability. + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/resources/META-INF/NOTICE b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/resources/META-INF/NOTICE new file mode 100644 index 0000000000..11c564eb19 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/resources/META-INF/NOTICE @@ -0,0 +1,18 @@ +========================================================================= +== NOTICE file corresponding to the section 4 d of == +== the Apache License, Version 2.0, == +== in this case for the Apache Tuscany distribution. == +========================================================================= + +This product includes software developed by the Apache Software Foundation +(http://www.apache.org/). + +This product also includes software developed by: +- the Eclipse Modeling Framework project (http://www.eclipse.org/emf/) +- the Celtix project (http://celtix.objectweb.org/) +- the Mozilla Rhino project (http://www.mozilla.org/rhino/) +- the GlassFish JAX-WS project (https://jax-ws.dev.java.net/) + +Please read the LICENSE.txt file present in the root directory of this +distribution. + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/resources/META-INF/README.txt b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/resources/META-INF/README.txt new file mode 100644 index 0000000000..9b26d1690a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/resources/META-INF/README.txt @@ -0,0 +1,35 @@ +Apache Tuscany M1 build (May, 2006) +=================================== + +http://incubator.apache.org/tuscany/ + +Tuscany is an effort undergoing incubation at the Apache Software Foundation +(ASF), sponsored by the 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. + + +Support +------- + +Any problem with this release can be reported to the Tuscany mailing list +or in the JIRA issue tracker. + +Mailing list subscription: + tuscany-dev-subscribe@ws.apache.org + +Jira: + http://issues.apache.org/jira/browse/Tuscany + + +Thank you for using Tuscany! + + +The Tuscany Team. + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/resources/wsdl/credit.wsdl b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/resources/wsdl/credit.wsdl new file mode 100644 index 0000000000..4ec90f3f2b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/resources/wsdl/credit.wsdl @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/webapp/META-INF/tuscany/webapp.scdl b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/webapp/META-INF/tuscany/webapp.scdl new file mode 100644 index 0000000000..50688615a6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/webapp/META-INF/tuscany/webapp.scdl @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10 + + + + + + + + + + + + + + + + + + + + + + http://repo1.maven.org/maven2/,http://people.apache.org/repo/m2-snapshot-repository,http://people.apache.org/repo/m2-incubating-repository/,http://people.apache.org/repo/m1-snapshot-repository/ + + + + + /WEB-INF/tuscany/extensions/ + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/webapp/WEB-INF/default.scdl b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/webapp/WEB-INF/default.scdl new file mode 100644 index 0000000000..5f01cb534e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/webapp/WEB-INF/default.scdl @@ -0,0 +1,35 @@ + + + + + + + + + CreditCheckServiceComponent + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/webapp/WEB-INF/web.xml b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..22d4a55a4c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-creditcheck/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,41 @@ + + + + + + Tuscany Credit Check Web Service Sample + + + org.apache.tuscany.runtime.webapp.TuscanyContextListener + + + + TuscanyServlet + Tuscany Servlet + org.apache.tuscany.runtime.webapp.TuscanyServlet + + + + TuscanyServlet + /services/* + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/README b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/README new file mode 100644 index 0000000000..bb43a4c866 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/README @@ -0,0 +1,77 @@ +Mortgage Loan Approval Demo +=========================== + +This is the latest version for the demo application described at http://jdj.sys-con.com/read/325183.htm. + +The demo consists of two modules: + +mortgage-loanapproval: It provides the function to approve a loan application based various factors +mortgage-creditcheck: It provides the credit check as a web service + +To compile the demo, run "ant" for each of the two modules. + +To run the demo, open two commands windows. + +1) Go to demos\mortgage-creditcheck, run "ant run" to start the credit check server. + +Buildfile: build.xml + +run: + [java] Starting the CreditCheck Service... + [java] log4j:WARN No appenders could be found for logger (org.apache.axiom. +om.util.StAXUtils). + [java] log4j:WARN Please initialize the log4j system properly. + [java] Aug 24, 2007 6:11:03 PM org.apache.catalina.core.StandardEngine star +t + [java] INFO: Starting Servlet Engine: Apache Tomcat/6.0.10 + [java] Aug 24, 2007 6:11:04 PM org.apache.catalina.startup.ContextConfig de +faultWebConfig + [java] INFO: No default web.xml + [java] Aug 24, 2007 6:11:04 PM org.apache.catalina.startup.DigesterFactory +register + [java] WARNING: Could not get url for /javax/servlet/jsp/resources/jsp_2_0. +xsd + [java] Aug 24, 2007 6:11:04 PM org.apache.catalina.startup.DigesterFactory +register + [java] WARNING: Could not get url for /javax/servlet/jsp/resources/web-jspt +aglibrary_1_1.dtd + [java] Aug 24, 2007 6:11:04 PM org.apache.catalina.startup.DigesterFactory +register + [java] WARNING: Could not get url for /javax/servlet/jsp/resources/web-jspt +aglibrary_1_2.dtd + [java] Aug 24, 2007 6:11:04 PM org.apache.catalina.startup.DigesterFactory +register + [java] WARNING: Could not get url for /javax/servlet/jsp/resources/web-jspt +aglibrary_2_0.xsd + [java] Aug 24, 2007 6:11:04 PM org.apache.catalina.startup.DigesterFactory +register + [java] WARNING: Could not get url for /javax/servlet/resources/j2ee_web_ser +vices_1_1.xsd + [java] Aug 24, 2007 6:11:04 PM org.apache.coyote.http11.Http11Protocol init + + [java] INFO: Initializing Coyote HTTP/1.1 on http-8085 + [java] Aug 24, 2007 6:11:04 PM org.apache.coyote.http11.Http11Protocol star +t + [java] INFO: Starting Coyote HTTP/1.1 on http-8085 + [java] Aug 24, 2007 6:11:04 PM org.apache.tuscany.sca.http.tomcat.TomcatSer +ver addServletMapping + [java] INFO: Added Servlet mapping: http://localhost:8085/CreditCheckServic +e + [java] Press Enter to Exit... + +2) Go to demos\mortgage-creditcheck, run "ant run" to start the loan approval client. + +Buildfile: build.xml + +run: + [java] log4j:WARN No appenders could be found for logger (org.apache.axiom. +om.util.StAXUtils). + [java] log4j:WARN Please initialize the log4j system properly. + [java] Rejected: John Smith[111-22-3333] + +BUILD SUCCESSFUL +Total time: 4 seconds + +The result of the approval is random. + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/build.xml b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/build.xml new file mode 100644 index 0000000000..9a0a83bf1d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/build.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/pom.xml b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/pom.xml new file mode 100644 index 0000000000..f8c7949250 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/pom.xml @@ -0,0 +1,89 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-demos + 0.99-incubating-SNAPSHOT + ../pom.xml + + demo-mortgage-loanapproval + jar + Apache Tuscany Mortgage Loan Approval Demo + A sample Mortgage application made of several SCA components wired together. + + + 0.99-incubating-SNAPSHOT + + + + + org.apache.tuscany.sca + tuscany-host-webapp + 0.99-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-host-embedded + 0.99-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 0.99-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 0.99-incubating-SNAPSHOT + runtime + + + org.apache.tuscany.sca + tuscany-implementation-script + 0.99-incubating-SNAPSHOT + runtime + + + + + + install + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + + + + mortgage.MortgageClient + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheck.java b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheck.java new file mode 100644 index 0000000000..c5787b7819 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheckImpl.java b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheckImpl.java new file mode 100644 index 0000000000..dc803d9688 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/Customer.java b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/Customer.java new file mode 100644 index 0000000000..66a486d516 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuote.java b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuote.java new file mode 100644 index 0000000000..b5bafeb204 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuoteImpl.java b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuoteImpl.java new file mode 100644 index 0000000000..8c642667f1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApproval.java b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApproval.java new file mode 100644 index 0000000000..dcdad18496 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApprovalImpl.java b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApprovalImpl.java new file mode 100644 index 0000000000..40bfdc4a1d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculator.java b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculator.java new file mode 100644 index 0000000000..cacd8694de --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculatorImpl.java b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculatorImpl.java new file mode 100644 index 0000000000..015f1bae98 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageClient.java b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageClient.java new file mode 100644 index 0000000000..d69f0a1163 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessment.java b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessment.java new file mode 100644 index 0000000000..23c9589e85 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessmentImpl.java b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessmentImpl.java new file mode 100644 index 0000000000..c2116366ec --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/META-INF/LICENSE.txt b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/META-INF/LICENSE.txt new file mode 100644 index 0000000000..25d78feeac --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/META-INF/LICENSE.txt @@ -0,0 +1,1277 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +APACHE TUSCANY SUBCOMPONENTS: + +The Apache Tuscany distribution includes a number of subcomponents with +separate copyright notices and license terms. Your use of the source +code for the these subcomponents is subject to the terms and +conditions of the following licenses. + +=============================================================================== + +For the Eclipse Modeling Framework component and the Celtix binding: + +Eclipse Public License - v 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE +PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF +THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + +a) in the case of the initial Contributor, the initial code and +documentation distributed under this Agreement, and +b) in the case of each subsequent Contributor: + +i) changes to the Program, and + +ii) additions to the Program; + +where such changes and/or additions to the Program originate from and +are distributed by that particular Contributor. A Contribution +'originates' from a Contributor if it was added to the Program by such +Contributor itself or anyone acting on such Contributor's behalf. +Contributions do not include additions to the Program which: (i) are +separate modules of software distributed in conjunction with the +Program under their own license agreement, and (ii) are not derivative +works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor +which are necessarily infringed by the use or sale of its Contribution +alone or when combined with the Program. + +"Program" means the Contributions distributed in accordance with this +Agreement. + +"Recipient" means anyone who receives the Program under this +Agreement, including all Contributors. + +2. GRANT OF RIGHTS + +a) Subject to the terms of this Agreement, each Contributor hereby +grants Recipient a non-exclusive, worldwide, royalty-free copyright +license to reproduce, prepare derivative works of, publicly display, +publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and +object code form. + +b) Subject to the terms of this Agreement, each Contributor hereby +grants Recipient a non-exclusive, worldwide, royalty-free patent +license under Licensed Patents to make, use, sell, offer to sell, +import and otherwise transfer the Contribution of such Contributor, if +any, in source code and object code form. This patent license shall +apply to the combination of the Contribution and the Program if, at +the time the Contribution is added by the Contributor, such addition +of the Contribution causes such combination to be covered by the +Licensed Patents. The patent license shall not apply to any other +combinations which include the Contribution. No hardware per se is +licensed hereunder. + +c) Recipient understands that although each Contributor grants the +licenses to its Contributions set forth herein, no assurances are +provided by any Contributor that the Program does not infringe the +patent or other intellectual property rights of any other entity. Each +Contributor disclaims any liability to Recipient for claims brought by +any other entity based on infringement of intellectual property rights +or otherwise. As a condition to exercising the rights and licenses +granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For +example, if a third party patent license is required to allow +Recipient to distribute the Program, it is Recipient's responsibility +to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient +copyright rights in its Contribution, if any, to grant the copyright +license set forth in this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form +under its own license agreement, provided that: + +a) it complies with the terms and conditions of this Agreement; and + +b) its license agreement: + +i) effectively disclaims on behalf of all Contributors all warranties +and conditions, express and implied, including warranties or +conditions of title and non-infringement, and implied warranties or +conditions of merchantability and fitness for a particular purpose; + +ii) effectively excludes on behalf of all Contributors all liability +for damages, including direct, indirect, special, incidental and +consequential damages, such as lost profits; + +iii) states that any provisions which differ from this Agreement are +offered by that Contributor alone and not by any other party; and + +iv) states that source code for the Program is available from such +Contributor, and informs licensees how to obtain it in a reasonable +manner on or through a medium customarily used for software exchange. + +When the Program is made available in source code form: + +a) it must be made available under this Agreement; and + +b) a copy of this Agreement must be included with each copy of the +Program. + +Contributors may not remove or alter any copyright notices contained +within the Program. + +Each Contributor must identify itself as the originator of its +Contribution, if any, in a manner that reasonably allows subsequent +Recipients to identify the originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain +responsibilities with respect to end users, business partners and the +like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a +commercial product offering should do so in a manner which does not +create potential liability for other Contributors. Therefore, if a +Contributor includes the Program in a commercial product offering, +such Contributor ("Commercial Contributor") hereby agrees to defend +and indemnify every other Contributor ("Indemnified Contributor") +against any losses, damages and costs (collectively "Losses") arising +from claims, lawsuits and other legal actions brought by a third party +against the Indemnified Contributor to the extent caused by the acts +or omissions of such Commercial Contributor in connection with its +distribution of the Program in a commercial product offering. The +obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. +In order to qualify, an Indemnified Contributor must: a) promptly +notify the Commercial Contributor in writing of such claim, and b) +allow the Commercial Contributor to control, and cooperate with the +Commercial Contributor in, the defense and any related settlement +negotiations. The Indemnified Contributor may participate in any such +claim at its own expense. + +For example, a Contributor might include the Program in a commercial +product offering, Product X. That Contributor is then a Commercial +Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance +claims and warranties are such Commercial Contributor's responsibility +alone. Under this section, the Commercial Contributor would have to +defend claims against the other Contributors related to those +performance claims and warranties, and if a court requires any other +Contributor to pay any damages as a result, the Commercial Contributor +must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS +PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY +WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY +OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and +distributing the Program and assumes all risks associated with its +exercise of rights under this Agreement , including but not limited to +the risks and costs of program errors, compliance with applicable +laws, damage to or loss of data, programs or equipment, and +unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR +ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING +WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR +DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED +HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under +applicable law, it shall not affect the validity or enforceability of +the remainder of the terms of this Agreement, and without further +action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity +(including a cross-claim or counterclaim in a lawsuit) alleging that +the Program itself (excluding combinations of the Program with other +software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of +the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it +fails to comply with any of the material terms or conditions of this +Agreement and does not cure such failure in a reasonable period of +time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use +and distribution of the Program as soon as reasonably practicable. +However, Recipient's obligations under this Agreement and any licenses +granted by Recipient relating to the Program shall continue and +survive. + +Everyone is permitted to copy and distribute copies of this Agreement, +but in order to avoid inconsistency the Agreement is copyrighted and +may only be modified in the following manner. The Agreement Steward +reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement +Steward has the right to modify this Agreement. The Eclipse Foundation +is the initial Agreement Steward. The Eclipse Foundation may assign +the responsibility to serve as the Agreement Steward to a suitable +separate entity. Each new version of the Agreement will be given a +distinguishing version number. The Program (including Contributions) +may always be distributed subject to the version of the Agreement +under which it was received. In addition, after a new version of the +Agreement is published, Contributor may elect to distribute the +Program (including its Contributions) under the new version. Except as +expressly stated in Sections 2(a) and 2(b) above, Recipient receives +no rights or licenses to the intellectual property of any Contributor +under this Agreement, whether expressly, by implication, estoppel or +otherwise. All rights in the Program not expressly granted under this +Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and +the intellectual property laws of the United States of America. No +party to this Agreement will bring a legal action under this Agreement +more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation. + +=============================================================================== + +For the Rhino JavaScript container component: + +Mozilla Public License 1.1 (MPL 1.1) + +1. Definitions. + + 1.0.1. "Commercial Use" means distribution or otherwise making the +Covered Code available to a third party. + + 1.1. "Contributor" means each entity that creates or contributes to +the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the Original Code, +prior Modifications used by a Contributor, and the Modifications made by that +particular Contributor. + + 1.3. "Covered Code" means the Original Code or Modifications or the +combination of the Original Code and Modifications, in each case including +portions thereof. + + 1.4. "Electronic Distribution Mechanism" means a mechanism generally +accepted in the software development community for the electronic transfer of +data. + + 1.5. "Executable" means Covered Code in any form other than Source +Code. + + 1.6. "Initial Developer" means the individual or entity identified as +the Initial Developer in the Source Code notice required by Exhibit A. + + 1.7. "Larger Work" means a work which combines Covered Code or +portions thereof with code not governed by the terms of this License. + + 1.8. "License" means this document. + + 1.8.1. "Licensable" means having the right to grant, to the maximum +extent possible, whether at the time of the initial grant or subsequently +acquired, any and all of the rights conveyed herein. + + 1.9. "Modifications" means any addition to or deletion from the +substance or structure of either the Original Code or any previous +Modifications. When Covered Code is released as a series of files, a +Modification is: + A. Any addition to or deletion from the contents of a file +containing Original Code or previous Modifications. + + B. Any new file that contains any part of the Original Code or +previous Modifications. + + 1.10. "Original Code" means Source Code of computer software code +which is described in the Source Code notice required by Exhibit A as Original +Code, and which, at the time of its release under this License is not already +Covered Code governed by this License. + + 1.10.1. "Patent Claims" means any patent claim(s), now owned or +hereafter acquired, including without limitation, method, process, and +apparatus claims, in any patent Licensable by grantor. + + 1.11. "Source Code" means the preferred form of the Covered Code for +making modifications to it, including all modules it contains, plus any +associated interface definition files, scripts used to control compilation and +installation of an Executable, or source code differential comparisons against +either the Original Code or another well known, available Covered Code of the +Contributor's choice. The Source Code can be in a compressed or archival form, +provided the appropriate decompression or de-archiving software is widely +available for no charge. + + 1.12. "You" (or "Your") means an individual or a legal entity +exercising rights under, and complying with all of the terms of, this License +or a future version of this License issued under Section 6.1. For legal +entities, "You" includes any entity which controls, is controlled by, or is +under common control with You. For purposes of this definition, "control" +means (a) the power, direct or indirect, to cause the direction or management +of such entity, whether by contract or otherwise, or (b) ownership of more +than fifty percent (50%) of the outstanding shares or beneficial ownership of +such entity. + +2. Source Code License. + + 2.1. The Initial Developer Grant. + The Initial Developer hereby grants You a world-wide, royalty-free, +non-exclusive license, subject to third party intellectual property claims: + (a) under intellectual property rights (other than patent or +trademark) Licensable by Initial Developer to use, reproduce, modify, display, +perform, sublicense and distribute the Original Code (or portions thereof) +with or without Modifications, and/or as part of a Larger Work; and + + (b) under Patents Claims infringed by the making, using or selling +of Original Code, to make, have made, use, practice, sell, and offer for sale, +and/or otherwise dispose of the Original Code (or portions thereof). + (c) the licenses granted in this Section 2.1(a) and +(b) are effective on the date Initial Developer first distributes Original +Code under the terms of this License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is +granted: 1) for code that You delete from the Original Code; 2) separate from +the Original Code; or 3) for infringements caused by: i) the modification of +the Original Code or ii) the combination of the Original Code with other +software or devices. + + 2.2. Contributor Grant. + Subject to third party intellectual property claims, each Contributor +hereby grants You a world-wide, royalty-free, non-exclusive license + + (a) under intellectual property rights (other than patent or +trademark) Licensable by Contributor, to use, reproduce, modify, display, +perform, sublicense and distribute the Modifications created by such +Contributor (or portions thereof) either on an unmodified basis, with other +Modifications, as Covered Code and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using, or selling +of Modifications made by that Contributor either alone and/or in combination +with its Contributor Version (or portions of such combination), to make, use, +sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications +made by that Contributor (or portions thereof); and 2) the combination of +Modifications made by that Contributor with its Contributor Version (or +portions of such combination). + + (c) the licenses granted in Sections 2.2(a) and 2.2(b) are +effective on the date Contributor first makes Commercial Use of the Covered +Code. + + (d) Notwithstanding Section 2.2(b) above, no patent license is +granted: 1) for any code that Contributor has deleted from the Contributor +Version; 2) separate from the Contributor Version; 3) for infringements +caused by: i) third party modifications of Contributor Version or ii) the +combination of Modifications made by that Contributor with other software +(except as part of the Contributor Version) or other devices; or 4) under +Patent Claims infringed by Covered Code in the absence of Modifications made +by that Contributor. + + +3. Distribution Obligations. + + 3.1. Application of License. + The Modifications which You create or to which You contribute are +governed by the terms of this License, including without limitation Section +2.2. The Source Code version of Covered Code may be distributed only under the +terms of this License or a future version of this License released under +Section 6.1, and You must include a copy of this License with every copy of +the Source Code You distribute. You may not offer or impose any terms on any +Source Code version that alters or restricts the applicable version of this +License or the recipients' rights hereunder. However, You may include an +additional document offering the additional rights described in Section 3.5. + + 3.2. Availability of Source Code. + Any Modification which You create or to which You contribute must be +made available in Source Code form under the terms of this License either on +the same media as an Executable version or via an accepted Electronic +Distribution Mechanism to anyone to whom you made an Executable version +available; and if made available via Electronic Distribution Mechanism, must +remain available for at least twelve (12) months after the date it initially +became available, or at least six (6) months after a subsequent version of +that particular Modification has been made available to such recipients. You +are responsible for ensuring that the Source Code version remains available +even if the Electronic Distribution Mechanism is maintained by a third party. + + 3.3. Description of Modifications. + You must cause all Covered Code to which You contribute to contain a +file documenting the changes You made to create that Covered Code and the date +of any change. You must include a prominent statement that the Modification is +derived, directly or indirectly, from Original Code provided by the Initial +Developer and including the name of the Initial Developer in (a) the Source +Code, and (b) in any notice in an Executable version or related documentation +in which You describe the origin or ownership of the Covered Code. + + 3.4. Intellectual Property Matters + (a) Third Party Claims. + If Contributor has knowledge that a license under a third party's +intellectual property rights is required to exercise the rights granted by +such Contributor under Sections 2.1 or 2.2, Contributor must include a text +file with the Source Code distribution titled "LEGAL" which describes the +claim and the party making the claim in sufficient detail that a recipient +will know whom to contact. If Contributor obtains such knowledge after the +Modification is made available as described in Section 3.2, Contributor shall +promptly modify the LEGAL file in all copies Contributor makes available +thereafter and shall take other steps (such as notifying appropriate mailing +lists or newsgroups) reasonably calculated to inform those who received the +Covered Code that new knowledge has been obtained. + + (b) Contributor APIs. + If Contributor's Modifications include an application programming +interface and Contributor has knowledge of patent licenses which are +reasonably necessary to implement that API, Contributor must also include this +information in the LEGAL file. + + (c) Representations. + Contributor represents that, except as disclosed pursuant to +Section 3.4(a) above, Contributor believes that Contributor's Modifications +are Contributor's original creation(s) and/or Contributor has sufficient +rights to grant the rights conveyed by this License. + + + 3.5. Required Notices. + You must duplicate the notice in Exhibit A in each file of the Source +Code. If it is not possible to put such notice in a particular Source Code +file due to its structure, then You must include such notice in a location +(such as a relevant directory) where a user would be likely to look for such a +notice. If You created one or more Modification(s) You may add your name as a +Contributor to the notice described in Exhibit A. You must also duplicate +this License in any documentation for the Source Code where You describe +recipients' rights or ownership rights relating to Covered Code. You may +choose to offer, and to charge a fee for, warranty, support, indemnity or +liability obligations to one or more recipients of Covered Code. However, You +may do so only on Your own behalf, and not on behalf of the Initial Developer +or any Contributor. You must make it absolutely clear than any such warranty, +support, indemnity or liability obligation is offered by You alone, and You +hereby agree to indemnify the Initial Developer and every Contributor for any +liability incurred by the Initial Developer or such Contributor as a result of +warranty, support, indemnity or liability terms You offer. + + 3.6. Distribution of Executable Versions. + You may distribute Covered Code in Executable form only if the +requirements of Section 3.1-3.5 have been met for that Covered Code, and if +You include a notice stating that the Source Code version of the Covered Code +is available under the terms of this License, including a description of how +and where You have fulfilled the obligations of Section 3.2. The notice must +be conspicuously included in any notice in an Executable version, related +documentation or collateral in which You describe recipients' rights relating +to the Covered Code. You may distribute the Executable version of Covered Code +or ownership rights under a license of Your choice, which may contain terms +different from this License, provided that You are in compliance with the +terms of this License and that the license for the Executable version does not +attempt to limit or alter the recipient's rights in the Source Code version +from the rights set forth in this License. If You distribute the Executable +version under a different license You must make it absolutely clear that any +terms which differ from this License are offered by You alone, not by the +Initial Developer or any Contributor. You hereby agree to indemnify the +Initial Developer and every Contributor for any liability incurred by the +Initial Developer or such Contributor as a result of any such terms You offer. + + 3.7. Larger Works. + You may create a Larger Work by combining Covered Code with other code +not governed by the terms of this License and distribute the Larger Work as a +single product. In such a case, You must make sure the requirements of this +License are fulfilled for the Covered Code. + +4. Inability to Comply Due to Statute or Regulation. + + If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Code due to statute, +judicial order, or regulation then You must: (a) comply with the terms of this +License to the maximum extent possible; and (b) describe the limitations and +the code they affect. Such description must be included in the LEGAL file +described in Section 3.4 and must be included with all distributions of the +Source Code. Except to the extent prohibited by statute or regulation, such +description must be sufficiently detailed for a recipient of ordinary skill to +be able to understand it. + +5. Application of this License. + + This License applies to code to which the Initial Developer has attached +the notice in Exhibit A and to related Covered Code. + +6. Versions of the License. + + 6.1. New Versions. + Netscape Communications Corporation ("Netscape") may publish revised +and/or new versions of the License from time to time. Each version will be +given a distinguishing version number. + + 6.2. Effect of New Versions. + Once Covered Code has been published under a particular version of the +License, You may always continue to use it under the terms of that version. +You may also choose to use such Covered Code under the terms of any subsequent +version of the License published by Netscape. No one other than Netscape has +the right to modify the terms applicable to Covered Code created under this +License. + + 6.3. Derivative Works. + If You create or use a modified version of this License (which you may +only do in order to apply it to code which is not already Covered Code +governed by this License), You must (a) rename Your license so that the +phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "MPL", "NPL" or +any confusingly similar phrase do not appear in your license (except to note +that your license differs from this License) and (b) otherwise make it clear +that Your version of the license contains terms which differ from the Mozilla +Public License and Netscape Public License. (Filling in the name of the +Initial Developer, Original Code or Contributor in the notice described in +Exhibit A shall not of themselves be deemed to be modifications of this +License.) + +7. DISCLAIMER OF WARRANTY. + + COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT +LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, +FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE +QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED +CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY +OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR +CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS +LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS +DISCLAIMER. + +8. TERMINATION. + + 8.1. This License and the rights granted hereunder will terminate +automatically if You fail to comply with terms herein and fail to cure such +breach within 30 days of becoming aware of the breach. All sublicenses to the +Covered Code which are properly granted shall survive any termination of this +License. Provisions which, by their nature, must remain in effect beyond the +termination of this License shall survive. + + 8.2. If You initiate litigation by asserting a patent infringement +claim (excluding declatory judgment actions) against Initial Developer or a +Contributor (the Initial Developer or Contributor against whom You file such +action is referred to as "Participant") alleging that: + + (a) such Participant's Contributor Version directly or indirectly +infringes any patent, then any and all rights granted by such Participant to +You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice +from Participant terminate prospectively, unless if within 60 days after +receipt of notice You either: (i) agree in writing to pay Participant a +mutually agreeable reasonable royalty for Your past and future use of +Modifications made by such Participant, or (ii) withdraw Your litigation claim +with respect to the Contributor Version against such Participant. If within +60 days of notice, a reasonable royalty and payment arrangement are not +mutually agreed upon in writing by the parties or the litigation claim is not +withdrawn, the rights granted by Participant to You under Sections 2.1 and/or +2.2 automatically terminate at the expiration of the 60 day notice period +specified above. + + (b) any software, hardware, or device, other than such Participant's +Contributor Version, directly or indirectly infringes any patent, then any +rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are +revoked effective as of the date You first made, used, sold, distributed, or +had made, Modifications made by that Participant. + + 8.3. If You assert a patent infringement claim against Participant +alleging that such Participant's Contributor Version directly or indirectly +infringes any patent where such claim is resolved (such as by license or +settlement) prior to the initiation of patent infringement litigation, then +the reasonable value of the licenses granted by such Participant under +Sections 2.1 or 2.2 shall be taken into account in determining the amount or +value of any payment or license. + + 8.4. In the event of termination under Sections 8.1 or 8.2 above, all +end user license agreements (excluding distributors and resellers) which have +been validly granted by You or any distributor hereunder prior to termination +shall survive termination. + +9. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT +(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL +DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY +SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, +SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, +WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER +FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, +EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH +DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH +OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT +APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE +EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS +EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + +10. U.S. GOVERNMENT END USERS. + + The Covered Code is a "commercial item," as that term is defined in 48 +C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and +"commercial computer software documentation," as such terms are used in 48 +C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. +227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users +acquire Covered Code with only those rights set forth herein. + +11. MISCELLANEOUS. + + This License represents the complete agreement concerning subject matter +hereof. If any provision of this License is held to be unenforceable, such +provision shall be reformed only to the extent necessary to make it +enforceable. This License shall be governed by California law provisions +(except to the extent applicable law, if any, provides otherwise), excluding +its conflict-of-law provisions. With respect to disputes in which at least one +party is a citizen of, or an entity chartered or registered to do business in +the United States of America, any litigation relating to this License shall be +subject to the jurisdiction of the Federal Courts of the Northern District of +California, with venue lying in Santa Clara County, California, with the +losing party responsible for costs, including without limitation, court costs +and reasonable attorneys' fees and expenses. The application of the United +Nations Convention on Contracts for the International Sale of Goods is +expressly excluded. Any law or regulation which provides that the language of +a contract shall be construed against the drafter shall not apply to this +License. + +12. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is +responsible for claims and damages arising, directly or indirectly, out of its +utilization of rights under this License and You agree to work with Initial +Developer and Contributors to distribute such responsibility on an equitable +basis. Nothing herein is intended or shall be deemed to constitute any +admission of liability. + +13. MULTIPLE-LICENSED CODE. + + Initial Developer may designate portions of the Covered Code as +Multiple-Licensed. Multiple-Licensed means that the Initial Developer permits +you to utilize portions of the Covered Code under Your choice of the MPL or +the alternative licenses, if any, specified by the Initial Developer in the +file described in Exhibit A. + + +EXHIBIT A -Mozilla Public License. + + ``The contents of this file are subject to the Mozilla Public License +Version 1.1 (the "License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF + ANY KIND, either express or implied. See the License for the specific +language governing rights and + limitations under the License. + + The Original Code is ______________________________________. + + The Initial Developer of the Original Code is ________________________. +Portions created by + ______________________ are Copyright (C) ______ +_______________________. All Rights + Reserved. + + Contributor(s): ______________________________________. + + Alternatively, the contents of this file may be used under the terms of +the _____ license (the [___] License), in which case the provisions of +[______] License are applicable instead of those above. If you wish to allow +use of your version of this file only under the terms of the [____] License +and not to allow others to use your version of this file under the MPL, +indicate your decision by deleting the provisions above and replace them +with the notice and other provisions required by the [___] License. If you do +not delete the provisions above, a recipient may use your version of this file +under either the MPL or the [___] License." + + [NOTE: The text of this Exhibit A may differ slightly from the text of +the notices in the Source Code files of the Original Code. You should use the +text of this Exhibit A rather than the text found in the Original Code Source +Code for Your Modifications.] + + +=============================================================================== + +For the JAX-WS Reference Implementation component: + +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 + + + 1. Definitions. + + 1.1. "Contributor" means each individual or entity that + creates or contributes to the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the + Original Software, prior Modifications used by a + Contributor (if any), and the Modifications made by that + particular Contributor. + + 1.3. "Covered Software" means (a) the Original Software, or + (b) Modifications, or (c) the combination of files + containing Original Software with files containing + Modifications, in each case including portions thereof. + + 1.4. "Executable" means the Covered Software in any form + other than Source Code. + + 1.5. "Initial Developer" means the individual or entity + that first makes Original Software available under this + License. + + 1.6. "Larger Work" means a work which combines Covered + Software or portions thereof with code not governed by the + terms of this License. + + 1.7. "License" means this document. + + 1.8. "Licensable" means having the right to grant, to the + maximum extent possible, whether at the time of the initial + grant or subsequently acquired, any and all of the rights + conveyed herein. + + 1.9. "Modifications" means the Source Code and Executable + form of any of the following: + + A. Any file that results from an addition to, + deletion from or modification of the contents of a + file containing Original Software or previous + Modifications; + + B. Any new file that contains any part of the + Original Software or previous Modification; or + + C. Any new file that is contributed or otherwise made + available under the terms of this License. + + 1.10. "Original Software" means the Source Code and + Executable form of computer software code that is + originally released under this License. + + 1.11. "Patent Claims" means any patent claim(s), now owned + or hereafter acquired, including without limitation, + method, process, and apparatus claims, in any patent + Licensable by grantor. + + 1.12. "Source Code" means (a) the common form of computer + software code in which modifications are made and (b) + associated documentation included in or with such code. + + 1.13. "You" (or "Your") means an individual or a legal + entity exercising rights under, and complying with all of + the terms of, this License. For legal entities, "You" + includes any entity which controls, is controlled by, or is + under common control with You. For purposes of this + definition, "control" means (a) the power, direct or + indirect, to cause the direction or management of such + entity, whether by contract or otherwise, or (b) ownership + of more than fifty percent (50%) of the outstanding shares + or beneficial ownership of such entity. + + 2. License Grants. + + 2.1. The Initial Developer Grant. + + Conditioned upon Your compliance with Section 3.1 below and + subject to third party intellectual property claims, the + Initial Developer hereby grants You a world-wide, + royalty-free, non-exclusive license: + + (a) under intellectual property rights (other than + patent or trademark) Licensable by Initial Developer, + to use, reproduce, modify, display, perform, + sublicense and distribute the Original Software (or + portions thereof), with or without Modifications, + and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, + using or selling of Original Software, to make, have + made, use, practice, sell, and offer for sale, and/or + otherwise dispose of the Original Software (or + portions thereof). + + (c) The licenses granted in Sections 2.1(a) and (b) + are effective on the date Initial Developer first + distributes or otherwise makes the Original Software + available to a third party under the terms of this + License. + + (d) Notwithstanding Section 2.1(b) above, no patent + license is granted: (1) for code that You delete from + the Original Software, or (2) for infringements + caused by: (i) the modification of the Original + Software, or (ii) the combination of the Original + Software with other software or devices. + + 2.2. Contributor Grant. + + Conditioned upon Your compliance with Section 3.1 below and + subject to third party intellectual property claims, each + Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + (a) under intellectual property rights (other than + patent or trademark) Licensable by Contributor to + use, reproduce, modify, display, perform, sublicense + and distribute the Modifications created by such + Contributor (or portions thereof), either on an + unmodified basis, with other Modifications, as + Covered Software and/or as part of a Larger Work; and + + + (b) under Patent Claims infringed by the making, + using, or selling of Modifications made by that + Contributor either alone and/or in combination with + its Contributor Version (or portions of such + combination), to make, use, sell, offer for sale, + have made, and/or otherwise dispose of: (1) + Modifications made by that Contributor (or portions + thereof); and (2) the combination of Modifications + made by that Contributor with its Contributor Version + (or portions of such combination). + + (c) The licenses granted in Sections 2.2(a) and + 2.2(b) are effective on the date Contributor first + distributes or otherwise makes the Modifications + available to a third party. + + (d) Notwithstanding Section 2.2(b) above, no patent + license is granted: (1) for any code that Contributor + has deleted from the Contributor Version; (2) for + infringements caused by: (i) third party + modifications of Contributor Version, or (ii) the + combination of Modifications made by that Contributor + with other software (except as part of the + Contributor Version) or other devices; or (3) under + Patent Claims infringed by Covered Software in the + absence of Modifications made by that Contributor. + + 3. Distribution Obligations. + + 3.1. Availability of Source Code. + + Any Covered Software that You distribute or otherwise make + available in Executable form must also be made available in + Source Code form and that Source Code form must be + distributed only under the terms of this License. You must + include a copy of this License with every copy of the + Source Code form of the Covered Software You distribute or + otherwise make available. You must inform recipients of any + such Covered Software in Executable form as to how they can + obtain such Covered Software in Source Code form in a + reasonable manner on or through a medium customarily used + for software exchange. + + 3.2. Modifications. + + The Modifications that You create or to which You + contribute are governed by the terms of this License. You + represent that You believe Your Modifications are Your + original creation(s) and/or You have sufficient rights to + grant the rights conveyed by this License. + + 3.3. Required Notices. + + You must include a notice in each of Your Modifications + that identifies You as the Contributor of the Modification. + You may not remove or alter any copyright, patent or + trademark notices contained within the Covered Software, or + any notices of licensing or any descriptive text giving + attribution to any Contributor or the Initial Developer. + + 3.4. Application of Additional Terms. + + You may not offer or impose any terms on any Covered + Software in Source Code form that alters or restricts the + applicable version of this License or the recipients' + rights hereunder. You may choose to offer, and to charge a + fee for, warranty, support, indemnity or liability + obligations to one or more recipients of Covered Software. + However, you may do so only on Your own behalf, and not on + behalf of the Initial Developer or any Contributor. You + must make it absolutely clear that any such warranty, + support, indemnity or liability obligation is offered by + You alone, and You hereby agree to indemnify the Initial + Developer and every Contributor for any liability incurred + by the Initial Developer or such Contributor as a result of + warranty, support, indemnity or liability terms You offer. + + + 3.5. Distribution of Executable Versions. + + You may distribute the Executable form of the Covered + Software under the terms of this License or under the terms + of a license of Your choice, which may contain terms + different from this License, provided that You are in + compliance with the terms of this License and that the + license for the Executable form does not attempt to limit + or alter the recipient's rights in the Source Code form + from the rights set forth in this License. If You + distribute the Covered Software in Executable form under a + different license, You must make it absolutely clear that + any terms which differ from this License are offered by You + alone, not by the Initial Developer or Contributor. You + hereby agree to indemnify the Initial Developer and every + Contributor for any liability incurred by the Initial + Developer or such Contributor as a result of any such terms + You offer. + + 3.6. Larger Works. + + You may create a Larger Work by combining Covered Software + with other code not governed by the terms of this License + and distribute the Larger Work as a single product. In such + a case, You must make sure the requirements of this License + are fulfilled for the Covered Software. + + 4. Versions of the License. + + 4.1. New Versions. + + Sun Microsystems, Inc. is the initial license steward and + may publish revised and/or new versions of this License + from time to time. Each version will be given a + distinguishing version number. Except as provided in + Section 4.3, no one other than the license steward has the + right to modify this License. + + 4.2. Effect of New Versions. + + You may always continue to use, distribute or otherwise + make the Covered Software available under the terms of the + version of the License under which You originally received + the Covered Software. If the Initial Developer includes a + notice in the Original Software prohibiting it from being + distributed or otherwise made available under any + subsequent version of the License, You must distribute and + make the Covered Software available under the terms of the + version of the License under which You originally received + the Covered Software. Otherwise, You may also choose to + use, distribute or otherwise make the Covered Software + available under the terms of any subsequent version of the + License published by the license steward. + + 4.3. Modified Versions. + + When You are an Initial Developer and You want to create a + new license for Your Original Software, You may create and + use a modified version of this License if You: (a) rename + the license and remove any references to the name of the + license steward (except to note that the license differs + from this License); and (b) otherwise make it clear that + the license contains terms which differ from this License. + + + 5. DISCLAIMER OF WARRANTY. + + COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" + BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, + INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED + SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR + PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND + PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY + COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE + INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF + ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF + WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF + ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS + DISCLAIMER. + + 6. TERMINATION. + + 6.1. This License and the rights granted hereunder will + terminate automatically if You fail to comply with terms + herein and fail to cure such breach within 30 days of + becoming aware of the breach. Provisions which, by their + nature, must remain in effect beyond the termination of + this License shall survive. + + 6.2. If You assert a patent infringement claim (excluding + declaratory judgment actions) against Initial Developer or + a Contributor (the Initial Developer or Contributor against + whom You assert such claim is referred to as "Participant") + alleging that the Participant Software (meaning the + Contributor Version where the Participant is a Contributor + or the Original Software where the Participant is the + Initial Developer) directly or indirectly infringes any + patent, then any and all rights granted directly or + indirectly to You by such Participant, the Initial + Developer (if the Initial Developer is not the Participant) + and all Contributors under Sections 2.1 and/or 2.2 of this + License shall, upon 60 days notice from Participant + terminate prospectively and automatically at the expiration + of such 60 day notice period, unless if within such 60 day + period You withdraw Your claim with respect to the + Participant Software against such Participant either + unilaterally or pursuant to a written agreement with + Participant. + + 6.3. In the event of termination under Sections 6.1 or 6.2 + above, all end user licenses that have been validly granted + by You or any distributor hereunder prior to termination + (excluding licenses granted to You by any distributor) + shall survive termination. + + 7. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT + (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE + INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF + COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE + LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR + CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT + LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK + STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER + COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN + INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF + LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL + INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT + APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO + NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR + CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT + APPLY TO YOU. + + 8. U.S. GOVERNMENT END USERS. + + The Covered Software is a "commercial item," as that term is + defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial + computer software" (as that term is defined at 48 C.F.R. + 252.227-7014(a)(1)) and "commercial computer software + documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. + 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 + through 227.7202-4 (June 1995), all U.S. Government End Users + acquire Covered Software with only those rights set forth herein. + This U.S. Government Rights clause is in lieu of, and supersedes, + any other FAR, DFAR, or other clause or provision that addresses + Government rights in computer software under this License. + + 9. MISCELLANEOUS. + + This License represents the complete agreement concerning subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the + extent necessary to make it enforceable. This License shall be + governed by the law of the jurisdiction specified in a notice + contained within the Original Software (except to the extent + applicable law, if any, provides otherwise), excluding such + jurisdiction's conflict-of-law provisions. Any litigation + relating to this License shall be subject to the jurisdiction of + the courts located in the jurisdiction and venue specified in a + notice contained within the Original Software, with the losing + party responsible for costs, including, without limitation, court + costs and reasonable attorneys' fees and expenses. The + application of the United Nations Convention on Contracts for the + International Sale of Goods is expressly excluded. Any law or + regulation which provides that the language of a contract shall + be construed against the drafter shall not apply to this License. + You agree that You alone are responsible for compliance with the + United States export administration regulations (and the export + control laws and regulation of any other countries) when You use, + distribute or otherwise make available any Covered Software. + + 10. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is + responsible for claims and damages arising, directly or + indirectly, out of its utilization of rights under this License + and You agree to work with Initial Developer and Contributors to + distribute such responsibility on an equitable basis. Nothing + herein is intended or shall be deemed to constitute any admission + of liability. + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/META-INF/NOTICE b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/META-INF/NOTICE new file mode 100644 index 0000000000..11c564eb19 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/META-INF/NOTICE @@ -0,0 +1,18 @@ +========================================================================= +== NOTICE file corresponding to the section 4 d of == +== the Apache License, Version 2.0, == +== in this case for the Apache Tuscany distribution. == +========================================================================= + +This product includes software developed by the Apache Software Foundation +(http://www.apache.org/). + +This product also includes software developed by: +- the Eclipse Modeling Framework project (http://www.eclipse.org/emf/) +- the Celtix project (http://celtix.objectweb.org/) +- the Mozilla Rhino project (http://www.mozilla.org/rhino/) +- the GlassFish JAX-WS project (https://jax-ws.dev.java.net/) + +Please read the LICENSE.txt file present in the root directory of this +distribution. + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/Mortgage.composite b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/Mortgage.composite new file mode 100644 index 0000000000..fd71264fa7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/Mortgage.composite @@ -0,0 +1,50 @@ + + + + + + + 600 + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/Mortgage1.composite b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/Mortgage1.composite new file mode 100644 index 0000000000..6aec49ddaa --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/Mortgage1.composite @@ -0,0 +1,55 @@ + + + + + + + 600 + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.componentType b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.componentType new file mode 100644 index 0000000000..bf7b10e0f7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.componentType @@ -0,0 +1,27 @@ + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.js b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.js new file mode 100644 index 0000000000..b25af1d039 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/credit_composite.jpg b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/credit_composite.jpg new file mode 100644 index 0000000000..e28ed63cfb Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/credit_composite.jpg differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/credit_composite.png b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/credit_composite.png new file mode 100644 index 0000000000..0bfce0078d Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/credit_composite.png differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/loan_approval.jpg b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/loan_approval.jpg new file mode 100644 index 0000000000..3f00557c7f Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/loan_approval.jpg differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/loan_approval.png b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/loan_approval.png new file mode 100644 index 0000000000..9d5f829fe5 Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/loan_approval.png differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly0.jpg b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly0.jpg new file mode 100644 index 0000000000..515b6ecde7 Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly0.jpg differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly0.png b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly0.png new file mode 100644 index 0000000000..4b815a4b82 Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly0.png differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly1.jpg b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly1.jpg new file mode 100644 index 0000000000..01a7c55a14 Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly1.jpg differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly1.png b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly1.png new file mode 100644 index 0000000000..07422c4f45 Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly1.png differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly2.jpg b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly2.jpg new file mode 100644 index 0000000000..992c048684 Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly2.jpg differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly2.png b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly2.png new file mode 100644 index 0000000000..4667956ed0 Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_assembly2.png differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_composite.jpg b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_composite.jpg new file mode 100644 index 0000000000..5021f6a317 Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_composite.jpg differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_composite.png b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_composite.png new file mode 100644 index 0000000000..1398c50ded Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_composite.png differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_diagrams.doc b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_diagrams.doc new file mode 100644 index 0000000000..00d45e1084 Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_diagrams.doc differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_package1.jpg b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_package1.jpg new file mode 100644 index 0000000000..e91c5f1bbd Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_package1.jpg differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_package1.png b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_package1.png new file mode 100644 index 0000000000..db304a4c28 Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_package1.png differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_package2.jpg b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_package2.jpg new file mode 100644 index 0000000000..e8c2865e4a Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_package2.jpg differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_package2.png b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_package2.png new file mode 100644 index 0000000000..502e538e94 Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_package2.png differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_scenario.jpg b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_scenario.jpg new file mode 100644 index 0000000000..fccf2e35c3 Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_scenario.jpg differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_scenario.png b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_scenario.png new file mode 100644 index 0000000000..b8f42ad318 Binary files /dev/null and b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/mortgage_scenario.png differ diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/readme.html b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/readme.html new file mode 100644 index 0000000000..bee954a198 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/doc/readme.html @@ -0,0 +1,136 @@ + + + + + + + + +Mortgage Sample + + + +

Mortgage Sample

+ +

Overview

+ +

The Tuscany Web services client Helloworld sample shows how to +call a remote Web service by wiring an SCA component to a reference +which uses a Web service binding.

+ +

Prerequisites

+ +

Obtain the following prerequisites and install according to their +documentation.

+ + + +

The business scenario

+The "loan approval" application accepts a mortgage request including the +customer's details and the requested loan amount. It first checks the +credit of the customer to make sure the credit score meets the minimum +requirement. The interest rate is determined based on the principal +requested, the term for the loan and the customers home state. It then +uses a mortgage calculator to calculate the ratio by dividing potential +monthly payment by the customer's income. The ratio and credit score are +passed to perform the risk assessment which makes the final decision. +

+

Packaging structure

+ + +

Building

+ +

To build the sample  issue :

+
+mvn
+
+ +

The result after executing is in the target subdirectory the sample-mortgage.jar

+ +

Setup

+ +

Set up the Tuscany standalone runtime environment using the +following command:

+
+mvn dependency:unpack 
+
+ +

After completion there should be a target\distribution subdirectory +created that has the Tuscany standalone runtime.

+ +

The Tuscany Web servivces binding requires the Axis2 and SDO +databinding extensions so copy these to the standalone launcher +extensions directory:

+
+copy target\distribution\contrib\axis2-1.0-incubator-M2.jar target\distribution\extensions
+copy target\distribution\contrib\databinding-sdo-1.0-incubator-M2.jar target\distribution\extensions
+
+ +

Running

+ +

Execute the following command: (cut +and paste to command line)

+
+java -jar target/distribution/bin/launcher.jar target/sample-mortgage.jar
+
+ +

Results

+ +

The sample when run should simply display to the standard output:
+
+Approved: John Smith[111-22-3333]

+ +We have two versions of the CreditCheck web service implementation in this sample application: +
    +
  • a web service developed with Apache axis2 1.1 release. It's packaged as an Axis2 aar. +
  • a SCA component exposed as a web service. It's packaged as a WAR. +
+ +

Deploy the Axis2 CreditCheck web service to Tomcat

+
    +
  1. Download the WAR (Web Archive) ditribution from Apache + Axis2 1.1 release download site. +
  2. Copy axis2.war to <tomcat_home>\webapps. +
  3. Start Tomcat so that axis2.war get deployed to + <tomcat_home>\webapps\axis2. +
  4. Copy creditws-axis2\build\lib\CreditCheckService.aar to + <tomcat_home>\webapps\axis2\WEB-INF\services. +
+ +

Deploy the CreditComposite to Tomcat

+
    +
  1. Copy credit.war to <tomcat_home>\webapps. +
  2. Start Tomcat so that credit.war get deployed to + <tomcat_home>\webapps\credit. The CreditCheck web serivice will + be up and running. +
+ + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/wsdl/credit.wsdl b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/wsdl/credit.wsdl new file mode 100644 index 0000000000..4ec90f3f2b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/main/resources/wsdl/credit.wsdl @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/test/java/mortgage/MortgageClientTestCase.java b/sca-java-1.x/branches/sca-java-0.99/demos/mortgage-loanapproval/src/test/java/mortgage/MortgageClientTestCase.java new file mode 100644 index 0000000000..285cc72515 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/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/sca-java-1.x/branches/sca-java-0.99/demos/pom.xml b/sca-java-1.x/branches/sca-java-0.99/demos/pom.xml new file mode 100644 index 0000000000..acc2c2fef8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.99/demos/pom.xml @@ -0,0 +1,50 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 0.99-incubating-SNAPSHOT + ../pom.xml + + tuscany-demos + pom + Apache Tuscany SCA Demos + + + + default + + true + + + alert-aggregator + bigbank-account + bigbank-calculator + bigbank-stockquote + mortgage-creditcheck + mortgage-loanapproval + + + + + + -- cgit v1.2.3