summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-integration/samples/sca
diff options
context:
space:
mode:
Diffstat (limited to 'branches/sca-java-integration/samples/sca')
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/LICENSE.txt416
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/NOTICE.txt32
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/.pmd20
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/.ruleset190
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/LICENSE.txt416
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/NOTICE.txt32
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/pom.xml178
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/account/AccountServiceImpl.java279
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataService.java87
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceDASImpl.java400
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceImpl.java106
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountdata/CustomerIdService.java98
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountdb/AccountDBInit.java465
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerDataServiceImpl.java129
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerService.java47
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerServiceImpl.java216
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/stockquote/StockQuote.java228
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/stockquote/StockQuoteService.java31
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/stockquote/StockQuoteServiceImpl.java68
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/stockquote/StockQuoteWebservicexServiceImpl.java153
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/main/resources/DasAccountConfiguration.xml79
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/main/resources/META-INF/LICENSE.txt416
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/main/resources/META-INF/NOTICE18
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/main/resources/wsdl/AccountService.wsdl467
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/main/resources/wsdl/stockquotes.webservicex.wsdl136
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/main/webapp/WEB-INF/default.scdl80
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/main/webapp/WEB-INF/web.xml70
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/account/src/test/java/bigbank/account/client/AccountClient.java56
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/docs/Show.Image.html40
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/docs/accountfiles.pngbin0 -> 15889 bytes
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/docs/accountmodule.pngbin0 -> 33300 bytes
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/docs/modualoverview.pngbin0 -> 6074 bytes
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/docs/webclientfiles.pngbin0 -> 17123 bytes
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/docs/webclientmodule.pngbin0 -> 10748 bytes
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/pom.xml36
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/readme.html894
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/.pmd20
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/.ruleset190
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/LICENSE.txt416
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/NOTICE.txt32
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/pom.xml167
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/account/AccountServiceComponentImpl.java117
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/AccountLoginServiceImpl.java64
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/LoginService.java36
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/ProfileService.java42
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/ProfileServiceImpl.java69
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/SimpleLoginServiceImpl.java51
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountLogTag.java120
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountStatusTag.java135
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockLogTag.java81
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockStatusTag.java85
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/LoginBarrierTag.java101
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/ServiceTag.java107
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/ui/FormServlet.java161
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/ui/LoginServlet.java96
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/resources/META-INF/LICENSE.txt416
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/resources/META-INF/NOTICE18
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl466
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/CustomerProfile.jsp100
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld127
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/WEB-INF/default.scdl53
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/WEB-INF/web.xml83
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/accountLog.jsp99
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/accountTransaction.jsp50
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/login.html60
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/purchaseStock.jsp59
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/stockSale.jsp56
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/summary.jsp144
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/test/java/bigbank/webclient/client/TestAccountService.java45
-rw-r--r--branches/sca-java-integration/samples/sca/bigbank/webclient/src/test/java/bigbank/webclient/client/TestLoginService.java42
-rw-r--r--branches/sca-java-integration/samples/sca/calculator/pom.xml70
-rw-r--r--branches/sca-java-integration/samples/sca/calculator/readme.html103
-rw-r--r--branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/AddService.java25
-rw-r--r--branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/AddServiceImpl.java35
-rw-r--r--branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/CalculatorClient.java46
-rw-r--r--branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/CalculatorService.java35
-rw-r--r--branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/CalculatorServiceImpl.java72
-rw-r--r--branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/DivideService.java25
-rw-r--r--branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/DivideServiceImpl.java33
-rw-r--r--branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/MultiplyService.java25
-rw-r--r--branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/MultiplyServiceImpl.java33
-rw-r--r--branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/SubtractService.java25
-rw-r--r--branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/SubtractServiceImpl.java33
-rw-r--r--branches/sca-java-integration/samples/sca/calculator/src/main/resources/Calculator.composite52
-rw-r--r--branches/sca-java-integration/samples/sca/calculator/src/main/resources/META-INF/LICENSE.txt1277
-rw-r--r--branches/sca-java-integration/samples/sca/calculator/src/main/resources/META-INF/NOTICE18
-rw-r--r--branches/sca-java-integration/samples/sca/calculator/src/test/java/calculator/CalculatorTestCase.java53
-rw-r--r--branches/sca-java-integration/samples/sca/composite-impl/pom.xml79
-rw-r--r--branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/CompositeClient.java26
-rw-r--r--branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/Source.java24
-rw-r--r--branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/SourceCallback.java24
-rw-r--r--branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/SourceImpl.java55
-rw-r--r--branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/Target.java30
-rw-r--r--branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/TargetImpl.java41
-rw-r--r--branches/sca-java-integration/samples/sca/composite-impl/src/main/resources/InnerComposite.composite44
-rw-r--r--branches/sca-java-integration/samples/sca/composite-impl/src/main/resources/InnerComposite2.composite33
-rw-r--r--branches/sca-java-integration/samples/sca/composite-impl/src/main/resources/META-INF/LICENSE.txt1277
-rw-r--r--branches/sca-java-integration/samples/sca/composite-impl/src/main/resources/META-INF/NOTICE18
-rw-r--r--branches/sca-java-integration/samples/sca/composite-impl/src/main/resources/OuterComposite.composite37
-rw-r--r--branches/sca-java-integration/samples/sca/composite-impl/src/test/java/composite/CompositeTestCase.java52
-rw-r--r--branches/sca-java-integration/samples/sca/echo-binding/.ruleset190
-rw-r--r--branches/sca-java-integration/samples/sca/echo-binding/NOTICE.txt14
-rw-r--r--branches/sca-java-integration/samples/sca/echo-binding/pom.xml64
-rw-r--r--branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoBinding.java31
-rw-r--r--branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoBindingLoader.java59
-rw-r--r--branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoBuilder.java52
-rw-r--r--branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoInvoker.java66
-rw-r--r--branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoReference.java49
-rw-r--r--branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoService.java45
-rw-r--r--branches/sca-java-integration/samples/sca/echo-binding/src/main/resources/META-INF/sca/extension.composite36
-rw-r--r--branches/sca-java-integration/samples/sca/echo-binding/src/test/java/echo/Client.java27
-rw-r--r--branches/sca-java-integration/samples/sca/echo-binding/src/test/java/echo/ClientImpl.java40
-rw-r--r--branches/sca-java-integration/samples/sca/echo-binding/src/test/java/echo/Echo.java27
-rw-r--r--branches/sca-java-integration/samples/sca/echo-binding/src/test/java/echo/EchoBindingTestCase.java47
-rw-r--r--branches/sca-java-integration/samples/sca/echo-binding/src/test/resources/EchoBinding.composite37
-rw-r--r--branches/sca-java-integration/samples/sca/echo-databinding/.ruleset190
-rw-r--r--branches/sca-java-integration/samples/sca/echo-databinding/NOTICE.txt14
-rw-r--r--branches/sca-java-integration/samples/sca/echo-databinding/pom.xml104
-rw-r--r--branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoBinding.java32
-rw-r--r--branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoBindingLoader.java58
-rw-r--r--branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoBuilder.java52
-rw-r--r--branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoInvoker.java68
-rw-r--r--branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoReference.java55
-rw-r--r--branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoService.java44
-rw-r--r--branches/sca-java-integration/samples/sca/echo-databinding/src/main/resources/META-INF/sca/extension.composite31
-rw-r--r--branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/ComponentAImpl.java94
-rw-r--r--branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/ComponentBImpl.java59
-rw-r--r--branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/Echo.java32
-rw-r--r--branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/EchoDataBindingTestCase.java49
-rw-r--r--branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/Interface1.java32
-rw-r--r--branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/Interface2.java36
-rw-r--r--branches/sca-java-integration/samples/sca/echo-databinding/src/test/resources/EchoDataBinding.composite61
-rw-r--r--branches/sca-java-integration/samples/sca/echo-databinding/src/test/resources/wsdl/echo.wsdl45
-rw-r--r--branches/sca-java-integration/samples/sca/loanapplication/pom.xml71
-rw-r--r--branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanApplication.java35
-rw-r--r--branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanApplicationClient.java41
-rw-r--r--branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanClient.java29
-rw-r--r--branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanClientImpl.java64
-rw-r--r--branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanService.java37
-rw-r--r--branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanServiceImpl.java63
-rw-r--r--branches/sca-java-integration/samples/sca/loanapplication/src/main/resources/loanapplication.composite31
-rw-r--r--branches/sca-java-integration/samples/sca/loanapplication/src/test/java/loanapplication/LoanApplicationTestCase.java83
-rw-r--r--branches/sca-java-integration/samples/sca/pom.xml86
-rw-r--r--branches/sca-java-integration/samples/sca/simple-bigbank/pom.xml71
-rw-r--r--branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/account/AccountReport.java36
-rw-r--r--branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/account/AccountService.java27
-rw-r--r--branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/account/AccountServiceImpl.java47
-rw-r--r--branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/Account.java27
-rw-r--r--branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/AccountDataService.java29
-rw-r--r--branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/AccountDataServiceImpl.java57
-rw-r--r--branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/CheckingAccount.java36
-rw-r--r--branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/SavingsAccount.java36
-rw-r--r--branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/StockAccount.java40
-rw-r--r--branches/sca-java-integration/samples/sca/simple-bigbank/src/main/resources/BigBank.composite44
-rw-r--r--branches/sca-java-integration/samples/sca/simple-bigbank/src/main/resources/META-INF/LICENSE.txt1277
-rw-r--r--branches/sca-java-integration/samples/sca/simple-bigbank/src/main/resources/META-INF/NOTICE18
-rw-r--r--branches/sca-java-integration/samples/sca/simple-bigbank/src/test/java/bigbank/BigBankTestCase.java47
-rw-r--r--branches/sca-java-integration/samples/sca/simple-callback/pom.xml71
-rw-r--r--branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/MyClient.java27
-rw-r--r--branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/MyClientImpl.java47
-rw-r--r--branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/MyService.java32
-rw-r--r--branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/MyServiceCallback.java27
-rw-r--r--branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/MyServiceImpl.java51
-rw-r--r--branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/SimpleCallbackClient.java42
-rw-r--r--branches/sca-java-integration/samples/sca/simple-callback/src/main/resources/simplecallback.composite31
-rw-r--r--branches/sca-java-integration/samples/sca/simple-callback/src/test/java/simplecallback/SimpleCallbackTestCase.java51
-rw-r--r--branches/sca-java-integration/samples/sca/supplychain/pom.xml71
-rw-r--r--branches/sca-java-integration/samples/sca/supplychain/readme.htm89
-rwxr-xr-xbranches/sca-java-integration/samples/sca/supplychain/run.bat7
-rw-r--r--branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/Customer.java33
-rw-r--r--branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/CustomerComponentImpl.java48
-rw-r--r--branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/Retailer.java28
-rw-r--r--branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/RetailerComponentImpl.java43
-rw-r--r--branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/Shipper.java28
-rw-r--r--branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/ShipperComponentImpl.java43
-rw-r--r--branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/SupplyChainClient.java46
-rw-r--r--branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/Warehouse.java28
-rw-r--r--branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/WarehouseComponentImpl.java43
-rw-r--r--branches/sca-java-integration/samples/sca/supplychain/src/main/resources/META-INF/LICENSE.txt1277
-rw-r--r--branches/sca-java-integration/samples/sca/supplychain/src/main/resources/META-INF/NOTICE18
-rw-r--r--branches/sca-java-integration/samples/sca/supplychain/src/main/resources/META-INF/README.txt35
-rw-r--r--branches/sca-java-integration/samples/sca/supplychain/src/main/resources/supplychain.composite42
-rw-r--r--branches/sca-java-integration/samples/sca/supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java53
-rw-r--r--branches/sca-java-integration/samples/sca/webapp/LICENSE.txt202
-rw-r--r--branches/sca-java-integration/samples/sca/webapp/NOTICE.txt14
-rw-r--r--branches/sca-java-integration/samples/sca/webapp/pom.xml49
-rw-r--r--branches/sca-java-integration/samples/sca/webapp/src/main/webapp/WEB-INF/default.scdl26
-rw-r--r--branches/sca-java-integration/samples/sca/webapp/src/main/webapp/WEB-INF/web.xml26
-rw-r--r--branches/sca-java-integration/samples/sca/webapp/src/main/webapp/calc.jsp43
189 files changed, 20334 insertions, 0 deletions
diff --git a/branches/sca-java-integration/samples/sca/bigbank/LICENSE.txt b/branches/sca-java-integration/samples/sca/bigbank/LICENSE.txt
new file mode 100644
index 0000000000..517cda22ca
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/LICENSE.txt
@@ -0,0 +1,416 @@
+
+ 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.
+
+===============================================================================================================
+
+
+License for the Service Data Objects JavaDoc and Interface Definition files.
+
+Permission to copy, make derivative works of, and distribute the Service Data Objects
+JavaDoc and Interface Definition Files files in any medium without fee or royalty as part
+of a compliant implementation of the Service Data Objects Specification is hereby granted.
+The Service Data Objects Specification may be found at any of the following locations:
+
+http://dev2dev.bea.com/technologies/commonj/index.jsp
+http://www.ibm.com/developerworks/library/specification/ws-sdo/
+http://oracle.com/technology/webservices/sca
+https://www.sdn.sap.com/
+http://www.xcalia/xdn/specs/sdo
+
+THE SERVICE DATA OBJECTS SPECIFICATION AND THE JAVADOC AND INTERFACE DEFINITION FILES
+ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS
+SPECIFICATION OR THE JAVADOC AND INTERFACE DEFINITION FILES AND THE IMPLEMENTATION OF THEIR CONTENTS,
+INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+NON-INFRINGEMENT OR TITLE. THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
+INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY USE OR DISTRIBUTION OF THE
+SERVICE DATA OBJECTS SPECIFICATION OR THE JAVADOC OR INTERFACE DEFINTION FILES.
+
+The name and trademarks of the Authors may NOT be used in any manner, including advertising or
+publicity pertaining to the Service Component Architecture Specification or its contents without specific,
+written prior permission. Title to copyright in the Service Data Objects Specification and the
+JavaDoc and Interface Definition Files will at all times remain with the Authors.
+
+No other rights are granted by implication, estoppel or otherwise.
+
+=================================================================================================================
+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.
+
+===================================================================================================
+
+Common Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+ a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+ b) in the case of each subsequent Contributor:
+
+ i) changes to the Program, and
+
+ ii) additions to the Program;
+
+ where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+ a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+
+ b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+
+ c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+
+ d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+ a) it complies with the terms and conditions of this Agreement; and
+
+ b) its license agreement:
+
+ i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+
+ ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+
+ iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+
+ iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+ a) it must be made available under this Agreement; and
+
+ b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
+
+
+
+
+
diff --git a/branches/sca-java-integration/samples/sca/bigbank/NOTICE.txt b/branches/sca-java-integration/samples/sca/bigbank/NOTICE.txt
new file mode 100644
index 0000000000..e445fc9ae5
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/NOTICE.txt
@@ -0,0 +1,32 @@
+Apache Tuscany SCA for Java
+Copyright 2006 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+Apache Tuscany is an effort undergoing incubation at The Apache Software Foundation (ASF),
+sponsored by the Apache Web Services PMC. Incubation is required of all newly accepted
+projects until a further review indicates that the infrastructure, communications,
+and decision making process have stabilized in a manner consistent with other successful
+ASF projects. While incubation status is not necessarily a reflection of the completeness
+or stability of the code, it does indicate that the project has yet to be fully endorsed
+by the ASF.
+
+Unless otherwise indicated, all distribution made available by the Apache Software Foundation
+is provided to you under the terms and conditions of the Apache License Version 2.0 ("AL").
+A copy of the AL is provided with this distribution as the LICENSE.txt file present in the
+root directory, and is also available at http://www.apache.org/licenses/.
+
+The terms and conditions governing the distribution may refer to the AL or other license
+agreements, notices or terms and conditions. Some of these other license agreements may
+include (but are not limited to):
+
+ . Eclipse Public License Version 1.0 (available at http://www.eclipse.org/legal/epl-v10.html)
+ . Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)
+
+This product also includes software developed by:
+- the Eclipse Modeling Framework project (http://www.eclipse.org/emf/)
+
+It is your obligation to read and accept all such terms and conditions prior to use of the
+distribution. If term or condition is provided, please contact the Apache Software Foundation
+to determine what terms and conditions govern that particular distribution.
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/.pmd b/branches/sca-java-integration/samples/sca/bigbank/account/.pmd
new file mode 100644
index 0000000000..ffc4fe2bbb
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/.pmd
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<pmd><useProjectRuleSet>true</useProjectRuleSet><rules/></pmd>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/.ruleset b/branches/sca-java-integration/samples/sca/bigbank/account/.ruleset
new file mode 100644
index 0000000000..ba9b5ce886
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/.ruleset
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<ruleset name="pmd-eclipse">
+ <description>PMD Plugin preferences rule set</description>
+
+
+ <rule ref="rulesets/basic.xml/BooleanInstantiation"/>
+ <rule ref="rulesets/basic.xml/CollapsibleIfStatements"/>
+ <rule ref="rulesets/basic.xml/DoubleCheckedLocking"/>
+<!--<rule ref="rulesets/basic.xml/EmptyCatchBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyFinallyBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyIfStmt"/>-->
+ <rule ref="rulesets/basic.xml/EmptyStatementNotInLoop"/>
+<!--<rule ref="rulesets/basic.xml/EmptyStaticInitializer"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptySwitchStatements"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptySynchronizedBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyTryBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyWhileStmt"/>-->
+ <rule ref="rulesets/basic.xml/ForLoopShouldBeWhileLoop"/>
+ <rule ref="rulesets/basic.xml/JumbledIncrementer"/>
+<!--<rule ref="rulesets/basic.xml/OverrideBothEqualsAndHashcode"/>-->
+ <rule ref="rulesets/basic.xml/ReturnFromFinallyBlock"/>
+ <rule ref="rulesets/basic.xml/UnconditionalIfStatement"/>
+ <rule ref="rulesets/basic.xml/UnnecessaryConversionTemporary"/>
+ <rule ref="rulesets/basic.xml/UnnecessaryFinalModifier"/>
+ <rule ref="rulesets/basic.xml/UnnecessaryReturn"/>
+<!--<rule ref="rulesets/basic.xml/UselessOverridingMethod"/>-->
+
+<!--<rule ref="rulesets/braces.xml/ForLoopsMustUseBraces"/>-->
+<!--<rule ref="rulesets/braces.xml/IfElseStmtsMustUseBraces"/>-->
+<!--<rule ref="rulesets/braces.xml/IfStmtsMustUseBraces"/>-->
+<!--<rule ref="rulesets/braces.xml/WhileLoopsMustUseBraces"/>-->
+
+<!--<rule ref="rulesets/clone.xml/CloneMethodMustImplementCloneable"/>-->
+<!--<rule ref="rulesets/clone.xml/CloneThrowsCloneNotSupportedException"/>-->
+<!--<rule ref="rulesets/clone.xml/ProperCloneImplementation"/>-->
+
+<!--<rule ref="rulesets/codesize.xml/CyclomaticComplexity"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessiveClassLength"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessiveMethodLength"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessiveParameterList"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessivePublicCount"/>-->
+<!--<rule ref="rulesets/codesize.xml/TooManyFields"/>-->
+
+<rule ref="rulesets/controversial.xml/AssignmentInOperand"/>
+<!--<rule ref="rulesets/controversial.xml/AtLeastOneConstructor"/>-->
+<!--<rule ref="rulesets/controversial.xml/CallSuperInConstructor"/>-->
+<!--<rule ref="rulesets/controversial.xml/DontImportSun"/>-->
+<!--<rule ref="rulesets/controversial.xml/NullAssignment"/>-->
+<!--<rule ref="rulesets/controversial.xml/OnlyOneReturn"/>-->
+<!--<rule ref="rulesets/controversial.xml/SingularField"/>-->
+<!--<rule ref="rulesets/controversial.xml/SuspiciousOctalEscape"/>-->
+<!--<rule ref="rulesets/controversial.xml/UnnecessaryConstructor"/>-->
+<rule ref="rulesets/controversial.xml/UnnecessaryParentheses"/>
+<!--<rule ref="rulesets/controversial.xml/UnusedModifier"/>-->
+
+<!--<rule ref="rulesets/coupling.xml/CouplingBetweenObjects"/>-->
+<!--<rule ref="rulesets/coupling.xml/ExcessiveImports"/>-->
+<!--<rule ref="rulesets/coupling.xml/LooseCoupling"/>-->
+
+<!--<rule ref="rulesets/design.xml/AbstractClassWithoutAbstractMethod"/>-->
+<!--<rule ref="rulesets/design.xml/AccessorClassGeneration"/>-->
+<!--<rule ref="rulesets/design.xml/AssignmentToNonFinalStatic"/>-->
+<!--<rule ref="rulesets/design.xml/AvoidDeeplyNestedIfStmts"/>-->
+<!--<rule ref="rulesets/design.xml/AvoidInstanceofChecksInCatchClause"/>-->
+<rule ref="rulesets/design.xml/AvoidProtectedFieldInFinalClass"/>
+<!--<rule ref="rulesets/design.xml/AvoidReassigningParameters"/>-->
+<!--<rule ref="rulesets/design.xml/AvoidSynchronizedAtMethodLevel"/>-->
+<!--<rule ref="rulesets/design.xml/BadComparison"/>-->
+<!--<rule ref="rulesets/design.xml/CloseConnection"/>-->
+<!--<rule ref="rulesets/design.xml/CompareObjectsWithEquals"/>-->
+<!--<rule ref="rulesets/design.xml/ConfusingTernary"/>-->
+<rule ref="rulesets/design.xml/ConstructorCallsOverridableMethod"/>
+<!--<rule ref="rulesets/design.xml/DefaultLabelNotLastInSwitchStmt"/>-->
+<!--<rule ref="rulesets/design.xml/FinalFieldCouldBeStatic"/>-->
+<rule ref="rulesets/design.xml/IdempotentOperations"/>
+<!--<rule ref="rulesets/design.xml/ImmutableField"/>-->
+<!--<rule ref="rulesets/design.xml/InstantiationToGetClass"/>-->
+<!--<rule ref="rulesets/design.xml/MissingBreakInSwitch"/>-->
+<!--<rule ref="rulesets/design.xml/MissingStaticMethodInNonInstantiatableClass"/>-->
+<!--<rule ref="rulesets/design.xml/NonCaseLabelInSwitchStatement"/>-->
+<!--<rule ref="rulesets/design.xml/NonStaticInitializer"/>-->
+<rule ref="rulesets/design.xml/OptimizableToArrayCall"/>
+<rule ref="rulesets/design.xml/PositionLiteralsFirstInComparisons"/>
+<rule ref="rulesets/design.xml/SimplifyBooleanExpressions"/>
+<rule ref="rulesets/design.xml/SimplifyBooleanReturns"/>
+<rule ref="rulesets/design.xml/SimplifyConditional"/>
+<!--<rule ref="rulesets/design.xml/SwitchDensity"/>-->
+<!--<rule ref="rulesets/design.xml/SwitchStmtsShouldHaveDefault"/>-->
+<!--<rule ref="rulesets/design.xml/UnnecessaryLocalBeforeReturn"/>-->
+<!--<rule ref="rulesets/design.xml/UseLocaleWithCaseConversions"/>-->
+<!--<rule ref="rulesets/design.xml/UseNotifyAllInsteadOfNotify"/>-->
+<!--<rule ref="rulesets/design.xml/UseSingleton"/>-->
+
+<!--<rule ref="rulesets/finalizers.xml/EmptyFinalizer"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeOnlyCallsSuperFinalize"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeOverloaded"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeDoesNotCallSuperFinalize"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeShouldBeProtected"/>-->
+<!--<rule ref="rulesets/finalizers.xml/AvoidCallingFinalize"/>-->
+
+<!--<rule ref="rulesets/imports.xml/DuplicateImports"/>-->
+<!--<rule ref="rulesets/imports.xml/DontImportJavaLang"/>-->
+<!--<rule ref="rulesets/imports.xml/UnusedImports"/>-->
+<!--<rule ref="rulesets/imports.xml/ImportFromSamePackage"/>-->
+
+<!--<rule ref="rulesets/javabeans.xml/BeanMembersShouldSerialize"/>-->
+<!--<rule ref="rulesets/javabeans.xml/MissingSerialVersionUID"/>-->
+
+<!--<rule ref="rulesets/junit.xml/JUnitStaticSuite"/>-->
+<!--<rule ref="rulesets/junit.xml/JUnitSpelling"/>-->
+<!--<rule ref="rulesets/junit.xml/JUnitAssertionsShouldIncludeMessage"/>-->
+<!--<rule ref="rulesets/junit.xml/JUnitTestsShouldIncludeAssert"/>-->
+<!--<rule ref="rulesets/junit.xml/TestClassWithoutTestCases"/>-->
+<!--<rule ref="rulesets/junit.xml/UnnecessaryBooleanAssertion"/>-->
+<!--<rule ref="rulesets/junit.xml/UseAssertEqualsInsteadOfAssertTrue"/>-->
+<!--<rule ref="rulesets/junit.xml/UseAssertSameInsteadOfAssertTrue"/>-->
+
+ <!--<rule ref="rulesets/logging-java.xml/AvoidPrintStackTrace"/>-->
+ <!--<rule ref="rulesets/logging-java.xml/LoggerIsNotStaticFinal"/>-->
+ <!--<rule ref="rulesets/logging-java.xml/MoreThanOneLogger"/>-->
+ <!--<rule ref="rulesets/logging-java.xml/LoggerIsNotStaticFinal"/>-->
+ <!--<rule ref="rulesets/logging-java.xml/LogBlockWithoutIf"/>-->
+ <!--<rule ref="rulesets/logging-java.xml/SystemPrintln"/>-->
+ <!--<rule ref="rulesets/logging-jakarta-commons.xml/UseCorrectExceptionLogging"/>-->
+ <!--<rule ref="rulesets/logging-jakarta-commons.xml/ProperLogger"/>-->
+
+ <!--<rule ref="rulesets/naming.xml/ShortVariable"/>-->
+ <!--<rule ref="rulesets/naming.xml/LongVariable"/>-->
+ <!--<rule ref="rulesets/naming.xml/ShortMethodName"/>-->
+ <!--<rule ref="rulesets/naming.xml/VariableNamingConventions"/>-->
+ <!--<rule ref="rulesets/naming.xml/MethodNamingConventions"/>-->
+ <!--<rule ref="rulesets/naming.xml/ClassNamingConventions"/>-->
+ <!--<rule ref="rulesets/naming.xml/AbstractNaming"/>-->
+ <!--<rule ref="rulesets/naming.xml/AvoidDollarSigns"/>-->
+ <!--<rule ref="rulesets/naming.xml/MethodWithSameNameAsEnclosingClass"/>-->
+ <!--<rule ref="rulesets/naming.xml/SuspiciousHashcodeMethodName"/>-->
+ <!--<rule ref="rulesets/naming.xml/SuspiciousConstantFieldName"/>-->
+ <!--<rule ref="rulesets/naming.xml/AvoidFieldNameMatchingTypeName"/>-->
+ <!--<rule ref="rulesets/naming.xml/AvoidFieldNameMatchingMethodName"/>-->
+ <!--<rule ref="rulesets/naming.xml/AvoidNonConstructorMethodsWithClassName"/>-->
+ <!--<rule ref="rulesets/naming.xml/NoPackage"/>-->
+ <!--<rule ref="rulesets/naming.xml/PackageCase"/>-->
+
+ <!--<rule ref="rulesets/optimizations.xml/LocalVariableCouldBeFinal"/>-->
+ <!--<rule ref="rulesets/optimizations.xml/MethodArgumentCouldBeFinal"/>-->
+ <!--<rule ref="rulesets/optimizations.xml/AvoidInstantiatingObjectsInLoops"/>-->
+ <!--<rule ref="rulesets/optimizations.xml/UseArrayListInsteadOfVector"/>-->
+ <!--<rule ref="rulesets/optimizations.xml/SimplifyStartsWith"/>-->
+ <!--<rule ref="rulesets/optimizations.xml/UseStringBufferForStringAppends"/>-->
+
+ <!--<rule ref="rulesets/strictexception.xml/AvoidCatchingThrowable"/>-->
+ <!--<rule ref="rulesets/strictexception.xml/SignatureDeclareThrowsException"/>-->
+ <!--<rule ref="rulesets/strictexception.xml/ExceptionAsFlowControl"/>-->
+ <!--<rule ref="rulesets/strictexception.xml/AvoidCatchingNPE"/>-->
+ <!--<rule ref="rulesets/strictexception.xml/AvoidThrowingRawExceptionTypes"/>-->
+ <!--<rule ref="rulesets/strictexception.xml/AvoidThrowingNullPointerException"/>-->
+
+ <!--<rule ref="rulesets/strings.xml/AvoidDuplicateLiterals"/>-->
+ <!--<rule ref="rulesets/strings.xml/StringInstantiation"/>-->
+ <!--<rule ref="rulesets/strings.xml/StringToString"/>-->
+ <!--<rule ref="rulesets/strings.xml/AvoidConcatenatingNonLiteralsInStringBuffer"/>-->
+ <!--<rule ref="rulesets/strings.xml/UnnecessaryCaseChange"/>-->
+
+ <!--<rule ref="rulesets/sunsecure.xml/MethodReturnsInternalArray"/>-->
+ <!--<rule ref="rulesets/sunsecure.xml/ArrayIsStoredDirectly"/>-->
+
+ <rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"/>
+ <rule ref="rulesets/unusedcode.xml/UnusedPrivateField"/>
+ <rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod"/>
+ <!--<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter"/>-->
+
+</ruleset>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/LICENSE.txt b/branches/sca-java-integration/samples/sca/bigbank/account/LICENSE.txt
new file mode 100644
index 0000000000..517cda22ca
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/LICENSE.txt
@@ -0,0 +1,416 @@
+
+ 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.
+
+===============================================================================================================
+
+
+License for the Service Data Objects JavaDoc and Interface Definition files.
+
+Permission to copy, make derivative works of, and distribute the Service Data Objects
+JavaDoc and Interface Definition Files files in any medium without fee or royalty as part
+of a compliant implementation of the Service Data Objects Specification is hereby granted.
+The Service Data Objects Specification may be found at any of the following locations:
+
+http://dev2dev.bea.com/technologies/commonj/index.jsp
+http://www.ibm.com/developerworks/library/specification/ws-sdo/
+http://oracle.com/technology/webservices/sca
+https://www.sdn.sap.com/
+http://www.xcalia/xdn/specs/sdo
+
+THE SERVICE DATA OBJECTS SPECIFICATION AND THE JAVADOC AND INTERFACE DEFINITION FILES
+ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS
+SPECIFICATION OR THE JAVADOC AND INTERFACE DEFINITION FILES AND THE IMPLEMENTATION OF THEIR CONTENTS,
+INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+NON-INFRINGEMENT OR TITLE. THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
+INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY USE OR DISTRIBUTION OF THE
+SERVICE DATA OBJECTS SPECIFICATION OR THE JAVADOC OR INTERFACE DEFINTION FILES.
+
+The name and trademarks of the Authors may NOT be used in any manner, including advertising or
+publicity pertaining to the Service Component Architecture Specification or its contents without specific,
+written prior permission. Title to copyright in the Service Data Objects Specification and the
+JavaDoc and Interface Definition Files will at all times remain with the Authors.
+
+No other rights are granted by implication, estoppel or otherwise.
+
+=================================================================================================================
+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.
+
+===================================================================================================
+
+Common Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+ a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+ b) in the case of each subsequent Contributor:
+
+ i) changes to the Program, and
+
+ ii) additions to the Program;
+
+ where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+ a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+
+ b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+
+ c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+
+ d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+ a) it complies with the terms and conditions of this Agreement; and
+
+ b) its license agreement:
+
+ i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+
+ ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+
+ iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+
+ iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+ a) it must be made available under this Agreement; and
+
+ b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
+
+
+
+
+
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/NOTICE.txt b/branches/sca-java-integration/samples/sca/bigbank/account/NOTICE.txt
new file mode 100644
index 0000000000..e445fc9ae5
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/NOTICE.txt
@@ -0,0 +1,32 @@
+Apache Tuscany SCA for Java
+Copyright 2006 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+Apache Tuscany is an effort undergoing incubation at The Apache Software Foundation (ASF),
+sponsored by the Apache Web Services PMC. Incubation is required of all newly accepted
+projects until a further review indicates that the infrastructure, communications,
+and decision making process have stabilized in a manner consistent with other successful
+ASF projects. While incubation status is not necessarily a reflection of the completeness
+or stability of the code, it does indicate that the project has yet to be fully endorsed
+by the ASF.
+
+Unless otherwise indicated, all distribution made available by the Apache Software Foundation
+is provided to you under the terms and conditions of the Apache License Version 2.0 ("AL").
+A copy of the AL is provided with this distribution as the LICENSE.txt file present in the
+root directory, and is also available at http://www.apache.org/licenses/.
+
+The terms and conditions governing the distribution may refer to the AL or other license
+agreements, notices or terms and conditions. Some of these other license agreements may
+include (but are not limited to):
+
+ . Eclipse Public License Version 1.0 (available at http://www.eclipse.org/legal/epl-v10.html)
+ . Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)
+
+This product also includes software developed by:
+- the Eclipse Modeling Framework project (http://www.eclipse.org/emf/)
+
+It is your obligation to read and accept all such terms and conditions prior to use of the
+distribution. If term or condition is provided, please contact the Apache Software Foundation
+to determine what terms and conditions govern that particular distribution.
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/pom.xml b/branches/sca-java-integration/samples/sca/bigbank/account/pom.xml
new file mode 100644
index 0000000000..b28bd5b5da
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/pom.xml
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.samples.bigbank</groupId>
+ <artifactId>bigbank-scenario</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>sample-bigbank-account</artifactId>
+ <packaging>war</packaging>
+ <name>Tuscany BigBank Account Module</name>
+ <description>BigBank Scenario - Account Management Module</description>
+ <dependencies>
+
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-api</artifactId>
+ <version>${scaKernelVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca.runtime.webapp</groupId>
+ <artifactId>webapp-api</artifactId>
+ <version>${scaKernelVersion}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- java.xml.stream API -->
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>1.0.1</version>
+ <scope>compile</scope>
+ </dependency>
+ <!-- StAX implementation -->
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>3.2.0</version>
+ <scope>runtime</scope>
+ </dependency>
+
+
+
+ <dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-impl</artifactId>
+ <version>${sdo.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.apache.tuscany.das</groupId>
+ <artifactId>tuscany-das-rdb</artifactId>
+ <version>${dasVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.1.2.1</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-plugin</artifactId>
+ <version>${sdo.version}</version>
+ <executions>
+ <execution>
+ <configuration>
+ <!-- schemaFile>${basedir}/src/main/resources/wsdl/AccountService.wsdl</schemaFile -->
+ <schemaDir>${basedir}/src/main/resources/wsdl</schemaDir>
+ <noNotification>true</noNotification>
+ <noContainer>true</noContainer>
+ <noUnsettable>true</noUnsettable>
+ </configuration>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.tuscany.sca.extensions.axis2.plugins</groupId>
+ <artifactId>tuscany-plugin-wsdl2java</artifactId>
+ <version>${scaKernelVersion}</version>
+ <executions>
+ <execution>
+ <configuration>
+ <wsdlFiles>
+ <wsdlFile>
+ <fileName>${basedir}/src/main/resources/wsdl/stockquotes.webservicex.wsdl</fileName>
+ <ports>
+ <port>StockQuoteSoap</port>
+ </ports>
+ </wsdlFile>
+ <wsdlFile>
+ <fileName>${basedir}/src/main/resources/wsdl/AccountService.wsdl</fileName>
+ </wsdlFile>
+ </wsdlFiles>
+ </configuration>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.tuscany.sca.runtime.webapp</groupId>
+ <artifactId>tuscany-war-plugin</artifactId>
+ <version>${scaKernelVersion}</version>
+ <executions>
+ <execution>
+ <id>tuscany-war</id>
+ <goals>
+ <goal>tuscany-war</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <!-- Set to true to embed external jars for extensions in the WAR -->
+ <!-- Set to false to leave external jars for extensions to be resolved from maven repository -->
+ <loadExtensionDependencies>false</loadExtensionDependencies>
+
+ <extensions>
+ <dependency>
+ <groupId>org.apache.tuscany.sca.services.databinding</groupId>
+ <artifactId>databinding-sdo</artifactId>
+ <version>${scaKernelVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca.extensions.axis2</groupId>
+ <artifactId>tuscany-axis2</artifactId>
+ <version>${scaKernelVersion}</version>
+ </dependency>
+ </extensions>
+
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/account/AccountServiceImpl.java b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/account/AccountServiceImpl.java
new file mode 100644
index 0000000000..74baa636f5
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/account/AccountServiceImpl.java
@@ -0,0 +1,279 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.services.account;
+
+import java.rmi.RemoteException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.TimeZone;
+
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+import bigbank.account.services.accountdata.AccountDataService;
+import bigbank.account.services.stockquote.StockQuote;
+import bigbank.account.services.stockquote.StockQuoteService;
+
+import com.bigbank.account.AccountLog;
+import com.bigbank.account.AccountReport;
+import com.bigbank.account.AccountService;
+import com.bigbank.account.AccountSummary;
+import com.bigbank.account.CustomerProfileData;
+import com.bigbank.account.StockSummary;
+
+@Service(interfaces = AccountService.class)
+public class AccountServiceImpl implements AccountService {
+
+ public static final String CHECKING_ACCOUNT_PREFIX = "134-43-394";
+
+ public static final String SAVINGS_ACCOUNT_PREFIX = "134-42-623";
+
+ public static final String ACCOUNT_TYPE_SAVINGS = "savings";
+
+ public static final String ACCOUNT_TYPE_CHECKINGS = "checkings";
+
+ public static final DateFormat tsformatXSDDateTime = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSz");
+ static {
+ AccountServiceImpl.tsformatXSDDateTime.setTimeZone(TimeZone.getTimeZone("UTC"));
+ }
+
+ private float currencyConversion = 0.0f;
+
+ private String currency = "USD";
+
+ @Property
+ public void setCurrency(final String currency) {
+ this.currency = currency;
+ }
+
+ float getCurrencyConversion() {
+ if (currencyConversion == 0.0F) {
+ if ("USD".equals(currency)) {
+ currencyConversion = 1.0f;
+ } else if ("EURO".equals(currency)) {
+ currencyConversion = 0.8f;
+ } else {
+ try {
+ currencyConversion = Float.parseFloat(currency);
+ } catch (Exception e) {
+ currencyConversion = 1.0f;
+ }
+
+ }
+
+ }
+ return currencyConversion;
+
+ }
+
+ private AccountDataService accountDataService;
+
+ @Reference
+ public void setAccountDataService(AccountDataService accountDataService) {
+ this.accountDataService = accountDataService;
+ }
+
+ private StockQuoteService stockQuoteService;
+
+ @Reference
+ public void setStockQuoteService(StockQuoteService stockQuoteService) {
+ this.stockQuoteService = stockQuoteService;
+ }
+
+ public AccountServiceImpl() {
+ }
+
+ @SuppressWarnings("unchecked")
+ public AccountReport getAccountReport(int customerID) throws RemoteException {
+
+ try {
+ AccountReport accountReport = accountDataService.getAccountReport(customerID);
+ // convert to local currency.
+ List<AccountSummary> accounts = accountReport.getAccountSummaries();
+ for (AccountSummary accountSummary : accounts) {
+ accountSummary.setBalance(fromUSDollarToCurrency(accountSummary.getBalance()));
+
+ }
+ return updateStockInformation(accountReport);
+ } catch (Exception e) {
+ e.printStackTrace();
+ if (e instanceof RemoteException) {
+ throw (RemoteException) e;
+ } else {
+ throw new RemoteException(e.getClass() + " " + e.getMessage(), e);
+ }
+ }
+ }
+
+ private AccountReport updateStockInformation(AccountReport accountReport) throws RemoteException {
+ List<StockSummary> stocks = accountReport.getStockSummaries();
+ if (stocks.size() < 1) {
+ return accountReport; // nothing todo
+ }
+ HashSet<String> owned = new HashSet<String>(stocks.size());
+ for (StockSummary stock : stocks) {
+ owned.add(stock.getSymbol());
+ }
+ ArrayList<String> ownedStr = new ArrayList<String>(owned.size() * 5);
+ for (String s : owned) {
+
+ ownedStr.add(s);
+ }
+
+ Map<String, StockQuote> stockInfo = stockQuoteService.getQuotes(ownedStr.toArray(new String[owned.size()]));
+
+ for (StockSummary stock : stocks) {
+ String symbol = stock.getSymbol();
+ StockQuote stockquote = stockInfo.get(symbol);
+ if (stockquote == null) {
+ stock.setCurrentPrice(Float.NaN);
+ stock.setCompany("*not found*");
+ stock.setHighPrice(Float.NaN);
+ stock.setLowPrice(Float.NaN);
+
+ } else {
+ stock.setCurrentPrice(fromUSDollarToCurrency(convertToFloat(stockquote.getStockQuote())));
+ stock.setCompany(stockquote.getCompanyName());
+ stock.setHighPrice(fromUSDollarToCurrency(convertToFloat(stockquote.getDayHighPrice())));
+ stock.setLowPrice(fromUSDollarToCurrency(convertToFloat(stockquote.getDayLowPrice())));
+ }
+ }
+
+ return accountReport;
+ }
+
+ float convertToFloat(final String s) {
+
+ try {
+ return Float.parseFloat(s);
+ } catch (Exception e) {
+ return Float.NaN;
+ }
+
+ }
+
+ private float fromUSDollarToCurrency(float value) {
+ return value * getCurrencyConversion();
+
+ }
+
+ private float toUSDollarfromCurrency(float value) {
+
+ return value / getCurrencyConversion();
+ }
+
+ public CustomerProfileData getCustomerProfile(String logonID) throws RemoteException {
+
+ try {
+ return accountDataService.getCustomerProfile(logonID);
+ } catch (Exception e) {
+ e.printStackTrace();
+ if (e instanceof RemoteException) {
+ throw (RemoteException) e;
+ } else {
+ throw new RemoteException(e.getClass() + " " + e.getMessage(), e);
+ }
+ }
+
+ }
+
+ public float deposit(String account, float ammount) throws RemoteException {
+ try {
+ return accountDataService.deposit(account, toUSDollarfromCurrency(ammount));
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ throw e;
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RemoteException(e.getClass() + " " + e.getMessage(), e);
+ }
+ }
+
+ public StockSummary purchaseStock(int id, StockSummary stock) throws RemoteException {
+ try {
+ String symbol = stock.getSymbol();
+ Map<String, StockQuote> stockInfo = stockQuoteService.getQuotes(new String[] { symbol });
+
+ StockQuote stockQuote = stockInfo.get(symbol);
+ stock.setPurchasePrice(Float.parseFloat(stockQuote.getStockQuote()));
+ String purchaseDate = tsformatXSDDateTime.format(new Date());
+ if (purchaseDate.endsWith("UTC")) {
+ purchaseDate = purchaseDate.substring(0, purchaseDate.length() - 3) + "Z";
+ }
+ stock.setPurchaseDate(purchaseDate);
+
+ return accountDataService.purchaseStock(id, stock);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ throw e;
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RemoteException(e.getClass() + " " + e.getMessage(), e);
+ }
+ }
+
+ public StockSummary sellStock(int purchaseLotNumber, int quantity) throws RemoteException {
+ try {
+ return accountDataService.sellStock(purchaseLotNumber, quantity);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ throw e;
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RemoteException(e.getClass() + " " + e.getMessage(), e);
+ }
+ }
+
+ public float withdraw(String account, float ammount) throws RemoteException {
+ try {
+ return accountDataService.withdraw(account, toUSDollarfromCurrency(ammount));
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ throw e;
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RemoteException(e.getClass() + " " + e.getMessage(), e);
+ }
+ }
+
+ public CustomerProfileData createAccount(CustomerProfileData customerProfile, boolean createSavings, boolean createCheckings)
+ throws RemoteException {
+ try {
+ return accountDataService.createAccount(customerProfile, createSavings, createCheckings);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ throw e;
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RemoteException(e.getClass() + " " + e.getMessage(), e);
+ }
+ }
+
+ public AccountLog getAccountLog(final int customerID) throws RemoteException {
+ return accountDataService.getAccountLog(customerID);
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataService.java b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataService.java
new file mode 100644
index 0000000000..884127cd9e
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataService.java
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank.account.services.accountdata;
+
+public interface AccountDataService {
+
+ /**
+ * Auto generated method signatures
+ *
+ * @param param0*
+ * @param param1*
+ * @param param2
+ */
+ public com.bigbank.account.StockSummary purchaseStock(int param0, com.bigbank.account.StockSummary parm1) throws java.rmi.RemoteException;
+
+ /**
+ * Auto generated method signatures
+ *
+ * @param param4
+ */
+ public com.bigbank.account.CustomerProfileData getCustomerProfile(java.lang.String param4) throws java.rmi.RemoteException;
+
+ /**
+ * Auto generated method signatures
+ *
+ * @param param6*
+ * @param param7
+ */
+ public float deposit(java.lang.String param6, float param7) throws java.rmi.RemoteException;
+
+ /**
+ * Auto generated method signatures
+ *
+ * @param param9*
+ * @param param10*
+ * @param param11
+ */
+ public com.bigbank.account.CustomerProfileData createAccount(com.bigbank.account.CustomerProfileData param9, boolean param10, boolean param11)
+ throws java.rmi.RemoteException;
+
+ /**
+ * Auto generated method signatures
+ *
+ * @param param13*
+ * @param param14
+ */
+ public com.bigbank.account.StockSummary sellStock(int param13, int param14) throws java.rmi.RemoteException;
+
+ /**
+ * Auto generated method signatures
+ *
+ * @param param16*
+ * @param param17
+ */
+ public float withdraw(java.lang.String param16, float param17) throws java.rmi.RemoteException;
+
+ /**
+ * Auto generated method signatures
+ *
+ * @param param19
+ */
+ public com.bigbank.account.AccountReport getAccountReport(int param19) throws java.rmi.RemoteException;
+
+ /**
+ * Auto generated method signatures
+ *
+ * @param param0
+ */
+ public com.bigbank.account.AccountLog getAccountLog(int param0) throws java.rmi.RemoteException;
+
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceDASImpl.java b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceDASImpl.java
new file mode 100644
index 0000000000..c346a3221f
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceDASImpl.java
@@ -0,0 +1,400 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.services.accountdata;
+
+import java.io.InputStream;
+import java.rmi.RemoteException;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Collection;
+import java.util.List;
+import java.util.Properties;
+import java.util.TimeZone;
+
+import org.apache.tuscany.das.rdb.Command;
+import org.apache.tuscany.das.rdb.Converter;
+import org.apache.tuscany.das.rdb.DAS;
+import org.osoa.sca.annotations.Service;
+
+import bigbank.account.services.account.AccountServiceImpl;
+
+import com.bigbank.account.AccountFactory;
+import com.bigbank.account.AccountReport;
+import com.bigbank.account.AccountSummary;
+import com.bigbank.account.CustomerProfileData;
+import com.bigbank.account.StockSummary;
+import commonj.sdo.DataObject;
+
+@Service(CustomerIdService.class)
+public class AccountDataServiceDASImpl implements CustomerIdService { // TODO fix this!
+
+ static public String dbDirectory = null;
+
+ public static final DateFormat tsformatXSDDateTime = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSz");
+
+ public static final DateFormat sqlformatDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSz");
+
+ static {
+ tsformatXSDDateTime.setTimeZone(TimeZone.getTimeZone("UTC"));
+
+ }
+
+ public CustomerProfileData getCustomerProfile(String logonID) throws RemoteException {
+
+ try {
+ InputStream mapping = createConfigStream();
+ Connection conn = getConnection();
+ DAS das = DAS.FACTORY.createDAS(mapping, conn);
+
+ Command select = das.createCommand("SELECT firstName, lastName, loginID, password, id FROM customers where loginID = ?");
+
+ select.setParameter(1, logonID);
+
+ DataObject root = select.executeQuery();
+ conn.close();
+
+ Collection customers = root.getList("CustomerProfileData");
+ CustomerProfileData customerProfileData = (CustomerProfileData) customers.iterator().next();
+
+ return customerProfileData;
+ } catch (Exception e) {
+
+ e.printStackTrace();
+ RemoteException re = new RemoteException("Failed to get customer profile'" + logonID + "' ", e);
+ re.printStackTrace();
+ throw re;
+ }
+ }
+
+ protected static final String driver = "org.apache.derby.jdbc.EmbeddedDriver";
+
+ protected static final String protocol = "jdbc:derby:";
+
+ public CustomerProfileData createAccount(CustomerProfileData customerProfile, boolean createSavings, boolean createCheckings)
+ throws RemoteException {
+
+ try {
+ DAS das = DAS.FACTORY.createDAS(getConnection());
+ Command insert = das.createCommand("insert into customers (firstName,lastName,address,email, loginID, password ) values ('"
+ + customerProfile.getFirstName() + "', '" + customerProfile.getLastName() + "', '" + customerProfile.getAddress() + "', '"
+ + customerProfile.getEmail() + "', '" + customerProfile.getLoginID() + "', '" + customerProfile.getPassword() + "')");
+
+ insert.execute();
+ CustomerProfileData ret = getCustomerProfile(customerProfile.getLoginID());
+ String cid = ret.getId() + "";
+ if (createSavings) {
+ insert = das.createCommand("insert into accounts (id,accountNumber, accountType, balance ) values (" + cid + ", '"
+ + AccountServiceImpl.SAVINGS_ACCOUNT_PREFIX + cid + "', '" + AccountServiceImpl.ACCOUNT_TYPE_SAVINGS + "', " + 1.0F + ")");
+ insert.execute();
+
+ }
+ if (createCheckings) {
+ insert = das.createCommand("insert into accounts (id,accountNumber, accountType, balance ) values (" + cid + ", '"
+ + AccountServiceImpl.CHECKING_ACCOUNT_PREFIX + cid + "', '" + AccountServiceImpl.ACCOUNT_TYPE_CHECKINGS + "', " + 1.0F + ")");
+ insert.execute();
+
+ }
+
+ return ret;
+ } catch (Exception e) {
+ if (e instanceof RemoteException) {
+ throw (RemoteException) e;
+ }
+ throw new RemoteException("createAccount " + e.getClass().getName() + "'. " + e.getMessage(), e);
+ }
+ }
+
+ public CustomerProfileData createAccountNOTWORKING(CustomerProfileData customerProfile, boolean createSavings, boolean createCheckings)
+ throws RemoteException {
+ try {
+ DAS das = DAS.FACTORY.createDAS(createConfigStream(), getConnection());
+ Command read = das.getCommand("all customers");
+
+ // select.setDataObjectModel();
+ DataObject root = read.executeQuery();
+
+ // Create a new stockPurchase
+ DataObject customer = root.createDataObject("customerProfileData");
+
+ // THIS SEEMS TO BE THE ONLY WAY TO DO THIS .. NO WAY TO JUST ADD AN EXISTING CUSTOMER.
+ customer.set("firstName", customerProfile.getFirstName());
+ customer.set("lastName", customerProfile.getLastName());
+ customer.set("address", customerProfile.getAddress());
+ customer.set("email", customerProfile.getEmail());
+ customer.set("loginID", customerProfile.getLoginID());
+ customer.set("password", customerProfile.getPassword());
+
+ das.applyChanges(root);
+ return getCustomerProfile(customerProfile.getLoginID());
+
+ } catch (Exception e) {
+ if (e instanceof RemoteException) {
+ throw (RemoteException) e;
+ }
+ throw new RemoteException("createAccount " + e.getClass().getName() + "'. " + e.getMessage(), e);
+ }
+
+ }
+
+ public AccountReport getAccountReport(final int customerID) throws RemoteException {
+ try {
+ final AccountFactory accountFactory = AccountFactory.INSTANCE;
+ final AccountReport accountReport = accountFactory.createAccountReport();
+ InputStream mapping = createConfigStream();
+
+ Connection conn = getConnection();
+ DAS das = DAS.FACTORY.createDAS(mapping, conn);
+
+ Command select = das.createCommand("SELECT accountNumber, accountType, balance FROM accounts where id = ?");
+ select.setParameter(1, customerID);
+
+ DataObject root = select.executeQuery();
+ accountReport.getAccountSummaries().addAll(root.getList("AccountSummary"));
+
+ // Get Stocks
+
+ select = das.createCommand("SELECT Symbol, quantity, purchasePrice, purchaseDate, purchaseLotNumber FROM stocks where id = ?");
+ select.setParameter(1, customerID);
+
+ // select.addConverter("STOCKS.PURCHASEDATE", DateConverter.class.getName());
+
+ root = select.executeQuery();
+ accountReport.getStockSummaries().addAll(root.getList("StockSummary"));
+
+ conn.close();
+
+ return accountReport;
+ } catch (Exception e) {
+ if (e instanceof RemoteException) {
+ throw (RemoteException) e;
+ }
+ throw new RemoteException("getAccountReport failed. customerID ('" + customerID + "')" + e.getClass().getName() + "'. " + e.getMessage(),
+ e);
+ }
+ }
+
+ public float withdraw(String account, float ammount) throws RemoteException {
+
+ return deposit(account, -ammount);
+ }
+
+ public float deposit(String account, float ammount) throws RemoteException {
+
+ try {
+ Connection conn = getConnection();
+ DAS das = DAS.FACTORY.createDAS(createConfigStream(), conn);
+
+ Command select = das.createCommand("SELECT accountNumber, balance FROM accounts where accountNumber = ?");
+ select.setParameter(1, account);
+
+ DataObject root = select.executeQuery();
+ Collection accounts = root.getList("AccountSummary");
+ AccountSummary accountData = (AccountSummary) accounts.iterator().next();
+ float newbalance = accountData.getBalance() + ammount;
+ accountData.setBalance(newbalance);
+ // update department set companyid = ? where department.name = ?
+
+ Command update = das.getCommand("update balance");
+ update.setParameter(1, new Float(newbalance));
+ update.setParameter(2, account);
+ update.execute();
+ conn.close();
+ return newbalance;
+ } catch (Exception e) {
+ throw new RemoteException(e.getClass().getName(), e);
+ }
+
+ }
+
+ public StockSummary sellStock(int purchaseLotNumber, int quantity) throws RemoteException {
+ try {
+ DAS das = DAS.FACTORY.createDAS(createConfigStream(), getConnection());
+
+ Command read = das.getCommand("stockbylotSelect");
+ read.setParameter(1, purchaseLotNumber);// autoboxing :-)
+ DataObject root = read.executeQuery();
+ List stocks = root.getList("StockSummary");
+ if (null != stocks && !stocks.isEmpty()) {
+ StockSummary stock = (StockSummary) stocks.get(0);
+ int newQuatity = Math.max(stock.getQuantity() - quantity, 0);
+ if (newQuatity < 1) {
+
+ Command delete = das.createCommand("DELETE FROM STOCKS WHERE PURCHASELOTNUMBER = ?");
+ delete.setParameter(1, purchaseLotNumber);
+ delete.execute();
+
+ } else {
+
+ Command update = das.getCommand("stockbylot");
+
+ update.setParameter(1, newQuatity);
+ update.setParameter(2, purchaseLotNumber);
+ update.execute();
+
+ stock.setQuantity(newQuatity);
+ }
+ return stock;
+ }
+
+ return null;
+ } catch (Exception e) {
+ throw new RemoteException("sellStock", e);
+ }
+ }
+
+ public StockSummary purchaseStock(int id, StockSummary stock) throws RemoteException {
+
+ try {
+ DAS das = DAS.FACTORY.createDAS(getConnection());
+ Command insert = das.createCommand("insert into stocks (id, symbol, quantity, purchasePrice, purchaseDate) values (?,?,?,?,?)");
+ insert.setParameter(1, new Integer(id));
+ insert.setParameter(2, stock.getSymbol());
+ insert.setParameter(3, stock.getQuantity());
+ insert.setParameter(4, stock.getPurchasePrice());
+ insert.setParameter(5, DateConverter.INSTANCE.getColumnValue(stock.getPurchaseDate()));
+
+ insert.execute();
+
+ return stock;
+ } catch (Exception e) {
+ if (e instanceof RemoteException) {
+ throw (RemoteException) e;
+ }
+ throw new RemoteException("purchaseStock " + e.getClass().getName() + "'. " + e.getMessage(), e);
+ }
+ }
+
+ protected Connection getConnection() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException {
+ Connection conn;
+ Class.forName(driver).newInstance();
+ Properties props = new Properties();
+ // props.put("user", "tuscany");
+ // props.put("password", "tuscany");
+ conn = DriverManager.getConnection(protocol + dbDirectory + ";create=true", props);
+
+ conn.setAutoCommit(false);
+ return conn;
+ }
+
+ protected InputStream createConfigStream() {
+ InputStream mapping = getClass().getClassLoader().getResourceAsStream("DasAccountConfiguration.xml");
+ return mapping;
+ }
+
+ public static class DateConverter implements Converter {
+ public final static DateConverter INSTANCE = new DateConverter();
+
+ public DateConverter() { // public empty constructor
+ }
+
+ public Object getPropertyValue(Object columnData) {
+
+ try {
+
+ String ret = tsformatXSDDateTime.format(columnData);
+ if (ret.endsWith("UTC")) {
+ ret = ret.substring(0, ret.length() - 3) + "Z";
+ }
+ return ret;
+
+ } catch (Exception e) {
+
+ e.printStackTrace();
+ throw new IllegalArgumentException(e);
+ }
+
+ }
+
+ public Object getColumnValue(Object propertyData) {
+
+ if (propertyData instanceof java.util.Date) {
+ // Need to convert back to local time for DB and remove timezone notation at the end..
+ String ret = sqlformatDateTime.format(propertyData);
+ char lc = ret.charAt(ret.length() - 1);
+ while (!Character.isDigit(lc)) {
+ ret = ret.substring(0, ret.length() - 1);
+ lc = ret.charAt(ret.length() - 1);
+ }
+ return ret;
+ } else if (propertyData instanceof String) {
+
+ try {
+ String time = (String) propertyData;
+ char last = time.charAt(time.length() - 1);
+ if (last == 'z' || last == 'Z') {
+ time = time.substring(0, time.length() - 1);
+ }
+ if (!time.endsWith("UTC")) {
+ time = time + "UTC";
+ }
+ return getColumnValue(tsformatXSDDateTime.parse(time));
+ } catch (ParseException e) {
+ throw new IllegalArgumentException("'" + propertyData + "' does not parse to date.");
+ }
+ } else {
+ throw new IllegalArgumentException();
+ }
+
+ }
+
+ }
+
+ public int getCustomerIdByPurchaseLotNumber(int purchaseLotNumber) throws RemoteException {
+
+ return queryCustomerId("select id from stocks where purchaseLotNumber = " + purchaseLotNumber);
+ }
+
+ public int getCustomerIdByAccount(String account) throws RemoteException {
+
+ return queryCustomerId("select id from accounts where accountNumber = '" + account + "'");
+ }
+
+ private int queryCustomerId(String query) throws RemoteException {
+
+ try {
+ Connection conn = getConnection();
+
+ Statement s = conn.createStatement();
+
+ ResultSet rs = s.executeQuery(query);
+ int id = -1;
+ if (rs.next()) {
+ id = rs.getInt("id");
+ }
+
+ conn.commit();
+
+ rs.close();
+ s.close();
+ conn.close();
+
+ return id;
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RemoteException(e.getClass().getName(), e);
+ }
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceImpl.java b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceImpl.java
new file mode 100644
index 0000000000..5e08cf634f
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceImpl.java
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank.account.services.accountdata;
+
+import java.rmi.RemoteException;
+import java.util.List;
+
+import org.osoa.sca.annotations.Service;
+
+import com.bigbank.account.AccountFactory;
+import com.bigbank.account.AccountLog;
+import com.bigbank.account.AccountReport;
+import com.bigbank.account.AccountSummary;
+import com.bigbank.account.CustomerProfileData;
+import com.bigbank.account.StockSummary;
+
+@Service(AccountDataService.class)
+public class AccountDataServiceImpl implements AccountDataService {
+
+ public CustomerProfileData getCustomerProfile(String logonID) throws RemoteException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public AccountReport getAccountReport(int customerID) {
+ final AccountFactory accountFactory = AccountFactory.INSTANCE;
+ AccountReport accountReport = accountFactory.createAccountReport();
+ List accounts = accountReport.getAccountSummaries();
+
+ AccountSummary account = accountFactory.createAccountSummary();
+ account.setAccountType("1111");
+ account.setAccountNumber("22-22-22");
+ account.setBalance(123.45F);
+ accounts.add(account);
+
+ account = accountFactory.createAccountSummary();
+ account.setAccountType("04-11-19");
+ account.setAccountNumber("11-23");
+ account.setBalance(543.21F);
+ accounts.add(account);
+
+ List stocks = accountReport.getStockSummaries();
+ StockSummary stock = accountFactory.createStockSummary();
+ stock.setSymbol("IBM");
+ stock.setPurchaseDate("1999-11-23");
+ stock.setPurchaseLotNumber(101);
+ stock.setPurchasePrice(33.33F);
+ stock.setQuantity(10);
+ stocks.add(stock);
+
+ stock = accountFactory.createStockSummary();
+ stock.setSymbol("TUSK");
+ stock.setPurchaseDate("2005-01-05");
+ stock.setPurchaseLotNumber(102);
+ stock.setPurchasePrice(11.11F);
+ stock.setQuantity(4);
+ stocks.add(stock);
+ return accountReport;
+ }
+
+ public CustomerProfileData createAccount(CustomerProfileData customerProfile, boolean createSavings, boolean createCheckings)
+ throws RemoteException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public float deposit(String param6, float param7) throws RemoteException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ public StockSummary purchaseStock(int param0, StockSummary stock) throws RemoteException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public StockSummary sellStock(int param13, int param14) throws RemoteException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public float withdraw(String param16, float param17) throws RemoteException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ public AccountLog getAccountLog(final int customerID) throws RemoteException {
+ throw new RemoteException("This method should not be called");
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountdata/CustomerIdService.java b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountdata/CustomerIdService.java
new file mode 100644
index 0000000000..b355a09008
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountdata/CustomerIdService.java
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.services.accountdata;
+
+import java.rmi.RemoteException;
+
+/**
+ * This interface allows access to a customer's id from the data service.
+ */
+public interface CustomerIdService {
+
+ /*
+ * Return -1 if purchaseLotNumber not found
+ */
+ public int getCustomerIdByPurchaseLotNumber(int purchaseLotNumber) throws RemoteException;
+
+ /*
+ * Return -1 if account not found
+ */
+ public int getCustomerIdByAccount(String account) throws RemoteException;
+
+ // TODO (isilval) Fix this !!!
+ // Apparently, configuration can't deal with extends so I am adding the contents of AccountDataService here
+
+ /**
+ * Auto generated method signatures
+ *
+ * @param param0*
+ * @param param1*
+ * @param param2
+ */
+ public com.bigbank.account.StockSummary purchaseStock(int param0, com.bigbank.account.StockSummary parm1) throws java.rmi.RemoteException;
+
+ /**
+ * Auto generated method signatures
+ *
+ * @param param4
+ */
+ public com.bigbank.account.CustomerProfileData getCustomerProfile(java.lang.String param4) throws java.rmi.RemoteException;
+
+ /**
+ * Auto generated method signatures
+ *
+ * @param param6*
+ * @param param7
+ */
+ public float deposit(java.lang.String param6, float param7) throws java.rmi.RemoteException;
+
+ /**
+ * Auto generated method signatures
+ *
+ * @param param9*
+ * @param param10*
+ * @param param11
+ */
+ public com.bigbank.account.CustomerProfileData createAccount(com.bigbank.account.CustomerProfileData param9, boolean param10, boolean param11)
+ throws java.rmi.RemoteException;
+
+ /**
+ * Auto generated method signatures
+ *
+ * @param param13*
+ * @param param14
+ */
+ public com.bigbank.account.StockSummary sellStock(int param13, int param14) throws java.rmi.RemoteException;
+
+ /**
+ * Auto generated method signatures
+ *
+ * @param param16*
+ * @param param17
+ */
+ public float withdraw(java.lang.String param16, float param17) throws java.rmi.RemoteException;
+
+ /**
+ * Auto generated method signatures
+ *
+ * @param param19
+ */
+ public com.bigbank.account.AccountReport getAccountReport(int param19) throws java.rmi.RemoteException;
+
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountdb/AccountDBInit.java b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountdb/AccountDBInit.java
new file mode 100644
index 0000000000..1225c95f84
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountdb/AccountDBInit.java
@@ -0,0 +1,465 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.services.accountdb;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Properties;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.tuscany.das.rdb.Command;
+import org.apache.tuscany.das.rdb.Converter;
+import org.apache.tuscany.das.rdb.DAS;
+import org.apache.tuscany.das.rdb.config.ConfigFactory;
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import bigbank.account.services.account.AccountServiceImpl;
+import bigbank.account.services.accountdata.AccountDataServiceDASImpl;
+import bigbank.account.services.accountlogger.AccountLoggerServiceImpl;
+
+import com.bigbank.account.AccountFactory;
+import com.bigbank.account.AccountSummary;
+import com.bigbank.account.CustomerProfileData;
+import com.bigbank.account.StockSummary;
+import commonj.sdo.DataObject;
+import com.bigbank.account.purchaseStock;
+import com.bigbank.account.withdraw;
+
+public class AccountDBInit extends HttpServlet {
+
+ private static final long serialVersionUID = -4795999792460944805L;
+
+ protected static final String driver = "org.apache.derby.jdbc.EmbeddedDriver";
+
+ protected static final String protocol = "jdbc:derby:";
+
+ protected String dbDirectory = null;
+
+ protected String dasConfigFile = null;
+
+ boolean deleteExisting = false;
+
+ @Override
+ public void init() throws ServletException {
+ try {
+
+ registerTypes();
+ ServletConfig servletConfig = getServletConfig();
+ ServletContext servletContext = servletConfig.getServletContext();
+ dbDirectory = servletContext.getRealPath("WEB-INF/bigbankdb/accounts");
+ dasConfigFile = servletContext.getRealPath("WEB-INF/classes/DasAccountConfiguration.xml");
+ deleteExisting = false;
+
+ createDB(dbDirectory);
+
+ } catch (Exception e) {
+
+ e.printStackTrace();
+ log(e.toString(), e);
+ throw new ServletException(e);
+ }
+ }
+
+ /*
+ * (non-Java-doc)
+ *
+ * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest arg0, HttpServletResponse arg1)
+ */
+ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ response.setContentType("text/html");
+
+ PrintWriter out = response.getWriter();
+
+ out.println();
+ out.println("<center><h2>BigBank database initialization servlet !<h2></center>");
+ out.println();
+ }
+
+ public AccountDBInit() {
+ }
+
+ public AccountDBInit(String dbDirectory, String dasConfigFile, Boolean deleteExisting) {
+ this.dbDirectory = dbDirectory;
+ this.dasConfigFile = dasConfigFile;
+ this.deleteExisting = deleteExisting;
+ }
+
+ private Connection createConnection() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException {
+ return createConnection(dbDirectory);
+ }
+
+ private static Connection createConnection(final String location) throws InstantiationException, IllegalAccessException, ClassNotFoundException,
+ SQLException {
+ Connection conn;
+ Class.forName(driver).newInstance();
+ Properties props = new Properties();
+ conn = DriverManager.getConnection(protocol + location + ";create=true", props);
+
+ conn.setAutoCommit(false);
+ return conn;
+ }
+
+ public static void createDB(final String location) throws Exception {
+ Connection conn = null;
+ AccountDataServiceDASImpl.dbDirectory = location;
+ AccountLoggerServiceImpl.dbDirectory = location; // TODO get rid of this (isilval)
+ Exception processessingException = null;
+ try {
+ conn = createConnection(location);
+
+ creatTables(conn);
+
+ int id = createCustomer(conn, "Test", "User", "304 Fox Trot ln, Apex, NC", "test@das.org", "test", "password");
+ createAccount(conn, id, AccountServiceImpl.SAVINGS_ACCOUNT_PREFIX + id, AccountServiceImpl.ACCOUNT_TYPE_SAVINGS, 123.43F);
+ createAccount(conn, id, AccountServiceImpl.CHECKING_ACCOUNT_PREFIX + id, AccountServiceImpl.ACCOUNT_TYPE_CHECKINGS, 23.12F);
+ createStockPurchase(conn, id, "IBM", 33, 66.20F, "2005-11-23 13:22:02");
+ createStockPurchase(conn, id, "DELL", 13, 12.74F, "2003-01-03 11:04:03");
+ createStockPurchase(conn, id, "LU", 7, 2.74F, "2003-01-04 16:04:03");
+ createStockPurchase(conn, id, "IBM", 22, 81.43F, "2004-02-03 13:04:33");
+
+ id = createCustomer(conn, "test2", "demo2", "Pleasant Plains Rd, ViewMount, CO", "test2@das.org", "test2", "password");
+ createAccount(conn, id, AccountServiceImpl.SAVINGS_ACCOUNT_PREFIX + id, AccountServiceImpl.ACCOUNT_TYPE_SAVINGS, 924.40F);
+ createAccount(conn, id, AccountServiceImpl.CHECKING_ACCOUNT_PREFIX + id, AccountServiceImpl.ACCOUNT_TYPE_CHECKINGS, 33.26F);
+ createStockPurchase(conn, id, "FOO", 3, 6.20F, "2000-09-11 09:11:01");
+
+ conn.commit();
+
+ } catch (org.apache.derby.impl.jdbc.EmbedSQLException e) {
+ if (conn != null && !conn.isClosed()) {
+ conn.rollback();
+ }
+ if (e.getErrorCode() == 20000 && "X0Y32".equalsIgnoreCase(e.getSQLState()) && -1 != e.getMessage().indexOf("already exists")) {
+ // this is ok the database is there.
+
+ } else {
+
+ e.printStackTrace();
+ processessingException = e;
+ throw e;
+ }
+ } finally {
+ try {
+ if (null != conn && !conn.isClosed()) {
+
+ conn.close();
+ }
+ conn = null;
+ } catch (Exception e) {
+ e.printStackTrace();
+ if (null != processessingException) {
+ throw e;
+ }
+ }
+ }
+
+ }
+
+ protected static void creatTables(Connection conn) throws Exception {
+ Statement s = conn.createStatement();
+
+ s
+ .execute("create table customers(firstName varchar(80) NOT NULL, lastName varchar(80), address varchar(180),email varchar(40),loginID varchar(80) NOT NULL UNIQUE, password varchar(80), id int NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY)");
+
+ s.execute("create table accounts(id int NOT NULL, accountNumber varchar(80) NOT NULL UNIQUE, accountType varchar(80), balance real )");
+
+ s
+ .execute("create table stocks(id int NOT NULL, Symbol varchar(8) NOT NULL, quantity int NOT NULL, purchasePrice real NOT NULL, purchaseDate TIMESTAMP, purchaseLotNumber int NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY )");
+
+ s
+ .execute("create table acctLog (logSeqNo int NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY, id int NOT NULL, accountNumber varchar(80) NOT NULL, actionType varchar(32) NOT NULL, amount real )");
+
+ s
+ .execute("create table stockLog (logSeqNo int NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY, id int NOT NULL, Symbol varchar(8) NOT NULL, quantity int NOT NULL, actionType varchar(32) NOT NULL, purchaseLotNumber int NOT NULL )");
+
+ s.close();
+ }
+
+ protected static int createCustomer(Connection conn, final String firstName, final String lastName, final String address, final String email,
+ final String logonID, final String password) throws SQLException, Exception {
+ Statement s = conn.createStatement();
+
+ s.execute("insert into customers (firstName,lastName,address,email, loginID, password ) " + "values ('" + firstName + "', '" + lastName
+ + "', '" + address + "', '" + email + "', '" + logonID + "', '" + password + "')");
+
+ ResultSet rs = s.executeQuery("SELECT loginID, id FROM customers where loginID='" + logonID + "'");
+ if (!rs.next()) {
+ throw new Exception("Wrong number of rows");
+ }
+ int id = rs.getInt(2);
+ s.close();
+
+ return id;
+ }
+
+ protected static void createAccount(Connection conn, int customerID, final String accountNumber, final String accountType, final float balance)
+ throws SQLException, Exception {
+ Statement s = conn.createStatement();
+
+ s.execute("insert into accounts (id,accountNumber, accountType, balance ) " + "values (" + customerID + ", '" + accountNumber + "', '"
+ + accountType + "', " + balance + ")");
+
+ s.close();
+ }
+
+ protected InputStream createConfigStream() {
+ InputStream mapping = getClass().getClassLoader().getResourceAsStream("DasAccountConfiguration.xml");
+ return mapping;
+ }
+
+ protected static void createStockPurchase(Connection conn, int customerID, final String stockSymbol, final int quantity,
+ final float purchasePrice, String purchaseDate) throws SQLException, Exception {
+ Statement s = conn.createStatement();
+
+ s.execute("insert into stocks (id, symbol, quantity, purchasePrice, purchaseDate ) values (" + customerID + ", '" + stockSymbol + "', "
+ + quantity + ", " + purchasePrice + ", '" + purchaseDate + "')");
+
+ s.close();
+
+ }
+
+ protected static void registerTypes() {
+ SDOUtil.registerStaticTypes(AccountFactory.class);
+ // TODO remove
+ SDOUtil.registerStaticTypes(ConfigFactory.class);
+
+ }
+
+ public void testWithdrawThroughDAS(withdraw wd) throws Exception {
+
+ Connection conn = createConnection();
+ DAS das = DAS.FACTORY.createDAS(createConfigStream(), conn);
+ Command select = das.getCommand("get account");
+
+ select.setParameter(1, wd.getAccountNumber());
+
+ DataObject root = select.executeQuery();
+
+ Collection accounts = root.getList("AccountSummary");
+ AccountSummary account = (AccountSummary) accounts.iterator().next();
+ float newbalance = account.getBalance() - wd.getAmount();
+ account.setBalance(newbalance);
+ // update department set companyid = ? where department.name = ?
+
+ Command update = das.getCommand("update balance");
+ update.setParameter(1, new Float(newbalance));
+ update.setParameter(2, wd.getAccountNumber());
+
+ update.execute();
+ conn.close();
+ }
+
+ protected void testStrockPurchaseThroughDAS(purchaseStock sp) throws InstantiationException, IllegalAccessException, ClassNotFoundException,
+ SQLException {
+
+ DAS das = DAS.FACTORY.createDAS(createConfigStream(), createConnection());
+ Command read = das.getCommand("all stocks");
+
+ DataObject root = read.executeQuery();
+
+ // Create a new stockPurchase
+ DataObject stockPurchase = root.createDataObject("StockSummary");
+ stockPurchase.set("id", new Integer(sp.getId()));
+ stockPurchase.set("symbol", sp.getStock().getSymbol());
+ stockPurchase.set("quantity", new Integer(sp.getStock().getQuantity()));
+ stockPurchase.set("purchasePrice", new Float(11.00));
+ // String type = stockPurchase.getType().getProperty("purchaseDate").getType().toString();
+ stockPurchase.setDate("purchaseDate", new Date());
+
+ das.applyChanges(root);
+ }
+
+ public CustomerProfileData testgetCustomerByLoginIDThroughDASRead(final String logonID) throws Exception {
+ InputStream mapping = createConfigStream();
+ Connection conn = createConnection();
+ DAS das = DAS.FACTORY.createDAS(mapping, conn);
+ Command select = das.createCommand("SELECT firstName, lastName, loginID, password, id FROM customers where loginID = ?");
+
+ select.setParameter(1, logonID);
+
+ DataObject root = select.executeQuery();
+ conn.close();
+
+ Collection customers = root.getList("CustomerProfileData");
+ CustomerProfileData customerProfileData = (CustomerProfileData) customers.iterator().next();
+ System.out.println(customerProfileData);
+ System.out.flush();
+ return customerProfileData;
+
+ }
+
+ protected void readDBstdout(PrintStream stream) throws Exception {
+ Connection conn = null;
+ try {
+ conn = createConnection(dbDirectory);
+ Statement s = conn.createStatement();
+ ResultSet rs = s.executeQuery("SELECT firstName, lastName, loginID, password, id FROM customers ORDER BY lastName");
+ while (rs.next()) {
+ stream.print(rs.getString(1));
+ stream.print(" ");
+ stream.print(rs.getString(2));
+ stream.print(" ");
+ stream.print(rs.getString(3));
+ stream.print(" ");
+ stream.print(rs.getString(4));
+ stream.print(" ");
+ stream.print(rs.getString(5));
+ stream.println();
+ int id = rs.getInt(5);
+ Statement s1 = conn.createStatement();
+ ResultSet rs1 = s1.executeQuery("SELECT accountNumber, accountType, balance FROM accounts where id=" + id);
+ stream.println("====Customers accounts");
+ while (rs1.next()) {
+ stream.print("\t");
+ stream.print(rs1.getString(1));
+ stream.print(" ");
+ stream.print(rs1.getString(2));
+ stream.print(" ");
+ stream.print(rs1.getString(3));
+ stream.println();
+ }
+ rs1.close();
+ rs1 = s1.executeQuery("SELECT symbol, quantity, purchasePrice, purchaseDate, purchaseLotNumber FROM stocks where id=" + id);
+ stream.println("====Customers Stocks");
+ while (rs1.next()) {
+ stream.print("\t");
+ stream.print(rs1.getString(1));
+ stream.print(" ");
+ stream.print(rs1.getString(2));
+ stream.print(" ");
+ stream.print(rs1.getString(3));
+ stream.print(" ");
+ stream.print(rs1.getString(4));
+ stream.print(" ");
+ stream.print(rs1.getString(5));
+ stream.println();
+ }
+ s1.close();
+ stream.println();
+
+ }
+ s.close();
+ conn.commit();
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ if (conn != null) {
+ conn.close();
+ }
+ conn = null;
+ }
+
+ }
+
+ public static class MyDateConverter implements Converter {
+
+ private static final DateFormat tsformat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+
+ public Object getPropertyValue(Object columnData) {
+
+ try {
+ return tsformat.parse(columnData.toString());
+ } catch (ParseException e) {
+
+ e.printStackTrace();
+ throw new IllegalArgumentException(e);
+ }
+
+ }
+
+ public Object getColumnValue(Object propertyData) {
+
+ if (propertyData instanceof Date) {
+ return tsformat.format(propertyData);
+ } else {
+ throw new IllegalArgumentException();
+ }
+
+ }
+
+ }
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) throws Exception {
+ registerTypes();
+ String dbDirectory = null; // "c:/derbydbtest/foo";
+ String dasConfigFile = null;
+ Boolean deleteExisting = false;
+ for (String x : args) {
+ if ("-d".equals(x)) {
+ deleteExisting = true;
+ }
+ if (x.startsWith("-db:")) {
+ dbDirectory = x.substring("-db:".length());
+ }
+ if (x.startsWith("-config:")) {
+ dasConfigFile = x.substring("-config:".length());
+ ;
+ }
+
+ }
+ AccountDBInit accountDBInit = new AccountDBInit(dbDirectory, dasConfigFile, deleteExisting);
+
+ createDB(dbDirectory);
+
+ accountDBInit.readDBstdout(System.out);
+
+ // Test withdrawl
+ withdraw wd = AccountFactory.INSTANCE.createwithdraw();
+ wd.setAccountNumber("134-43-3942");
+ wd.setAmount(1.00F);
+ accountDBInit.testWithdrawThroughDAS(wd);
+
+ accountDBInit.readDBstdout(System.out);
+
+ // test stock purchase.
+ purchaseStock sp = AccountFactory.INSTANCE.createpurchaseStock();
+ StockSummary stock = AccountFactory.INSTANCE.createStockSummary();
+ stock.setSymbol("GOOG");
+ stock.setQuantity(10);
+ stock.setPurchasePrice(25.00F);
+ sp.setId(1);
+ sp.setStock(stock);
+
+ accountDBInit.testStrockPurchaseThroughDAS(sp);
+
+ accountDBInit.readDBstdout(System.out);
+
+ System.out.flush();
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerDataServiceImpl.java b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerDataServiceImpl.java
new file mode 100644
index 0000000000..2360344cd1
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerDataServiceImpl.java
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.services.accountlogger;
+
+import java.rmi.RemoteException;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+import bigbank.account.services.accountdata.AccountDataService;
+import bigbank.account.services.accountdata.CustomerIdService;
+
+import com.bigbank.account.AccountLog;
+import com.bigbank.account.AccountReport;
+import com.bigbank.account.CustomerProfileData;
+import com.bigbank.account.StockSummary;
+
+/**
+ * This class implements the Account Data Logger service component.
+ */
+@Service(AccountDataService.class)
+public class AccountLoggerDataServiceImpl implements AccountDataService {
+
+ private CustomerIdService accountDataService; // TODO fix this!
+
+ @Reference
+ public void setAccountDataService(CustomerIdService accountDataService) {
+ this.accountDataService = accountDataService;
+ }
+
+ private AccountLoggerService accountLoggerService;
+
+ @Reference
+ public void setAccountLoggerService(AccountLoggerService accountLoggerService) {
+ this.accountLoggerService = accountLoggerService;
+ }
+
+ public StockSummary purchaseStock(int id, StockSummary stock) throws RemoteException {
+ accountLoggerService.logPurchaseStock(id, stock);
+
+ return accountDataService.purchaseStock(id, stock);
+ }
+
+ public CustomerProfileData getCustomerProfile(String logonID) throws RemoteException {
+
+ return accountDataService.getCustomerProfile(logonID);
+ }
+
+ public float deposit(String account, float amount) throws RemoteException {
+ try {
+ if (!(accountDataService instanceof CustomerIdService)) {
+ throw new RemoteException("Can't use data service as customer id service");
+ }
+ int id = accountDataService.getCustomerIdByAccount(account);
+ // int id = accountDataService.getCustomerIdByAccount(account);
+ accountLoggerService.logDeposit(id, account, amount);
+
+ return accountDataService.deposit(account, amount);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ throw e;
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RemoteException(e.getClass() + " " + e.getMessage(), e);
+ }
+ }
+
+ public CustomerProfileData createAccount(CustomerProfileData customerProfile, boolean createSavings, boolean createChecking)
+ throws RemoteException {
+
+ return accountDataService.createAccount(customerProfile, createSavings, createChecking);
+ }
+
+ public StockSummary sellStock(int purchaseLotNumber, int quantity) throws RemoteException {
+ try {
+ int id = accountDataService.getCustomerIdByPurchaseLotNumber(purchaseLotNumber);
+ StockSummary ss = accountDataService.sellStock(purchaseLotNumber, quantity);
+ if (ss != null) {
+ if (!(accountDataService instanceof CustomerIdService)) {
+ throw new RemoteException("Can't use data service as customer id service");
+ }
+ accountLoggerService.logSellStock(id, ss, quantity);
+ }
+ return ss;
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ throw e;
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RemoteException(e.getClass() + " " + e.getMessage(), e);
+ }
+ }
+
+ public float withdraw(String account, float amount) throws RemoteException {
+ if (!(accountDataService instanceof CustomerIdService)) {
+ throw new RemoteException("Can't use data service as customer id service");
+ }
+ int id = accountDataService.getCustomerIdByAccount(account);
+ // int id = accountDataService.getCustomerIdByAccount(account);
+ accountLoggerService.logWithdrawal(id, account, amount);
+
+ return accountDataService.withdraw(account, amount);
+ }
+
+ public AccountReport getAccountReport(final int customerID) throws RemoteException {
+
+ return accountDataService.getAccountReport(customerID);
+ }
+
+ public AccountLog getAccountLog(final int customerID) throws RemoteException {
+ return accountLoggerService.getAccountLog(customerID);
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerService.java b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerService.java
new file mode 100644
index 0000000000..b9b2821d38
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerService.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank.account.services.accountlogger;
+
+import java.rmi.RemoteException;
+
+import org.osoa.sca.annotations.OneWay;
+
+import com.bigbank.account.AccountLog;
+import com.bigbank.account.StockSummary;
+
+/**
+ * This is the business interface of the Account Logger service component.
+ */
+public interface AccountLoggerService {
+
+ @OneWay
+ public void logDeposit(int id, String account, float amount) throws RemoteException;
+
+ @OneWay
+ public void logWithdrawal(int id, String account, float amount) throws RemoteException;
+
+ @OneWay
+ public void logPurchaseStock(int id, StockSummary stock) throws RemoteException;
+
+ @OneWay
+ public void logSellStock(int id, StockSummary stock, int quantity) throws RemoteException;
+
+ public AccountLog getAccountLog(int id) throws RemoteException;
+
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerServiceImpl.java b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerServiceImpl.java
new file mode 100644
index 0000000000..8919aad311
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerServiceImpl.java
@@ -0,0 +1,216 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.services.accountlogger;
+
+import java.io.InputStream;
+import java.rmi.RemoteException;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.util.Properties;
+
+import org.apache.tuscany.das.rdb.Command;
+import org.apache.tuscany.das.rdb.DAS;
+import org.osoa.sca.annotations.Service;
+
+import com.bigbank.account.AccountFactory;
+import com.bigbank.account.AccountLog;
+import com.bigbank.account.StockSummary;
+import commonj.sdo.DataObject;
+
+/**
+ * This class implements the Account Logger service component.
+ */
+@Service(AccountLoggerService.class)
+public class AccountLoggerServiceImpl implements AccountLoggerService {
+
+ public static final String ACCT_ACTION_TYPE_DEPOSIT = "deposit";
+
+ public static final String ACCT_ACTION_TYPE_WITHDRAW = "withdraw";
+
+ public static final String STOCK_ACTION_TYPE_PURCHASE = "purchase";
+
+ public static final String STOCK_ACTION_TYPE_SELL = "sell";
+
+ static public String dbDirectory = null;
+
+ protected static final String driver = "org.apache.derby.jdbc.EmbeddedDriver";
+
+ protected static final String protocol = "jdbc:derby:";
+
+ public void logDeposit(int id, String account, float amount) throws RemoteException {
+ DAS das = DAS.FACTORY.createDAS(getConnection());
+ Command insert = das.createCommand("insert into acctLog (id, accountNumber, actionType, amount) values (?,?,?,?)");
+ insert.setParameter(1, new Integer(id));
+ insert.setParameter(2, account);
+ insert.setParameter(3, ACCT_ACTION_TYPE_DEPOSIT);
+ insert.setParameter(4, new Float(amount));
+
+ insert.execute();
+ /*
+ * performLog("insert into acctLog (id, accountNumber, actionType, amount) values (" + id + ", '" + account + "', '" +
+ * ACCT_ACTION_TYPE_DEPOSIT + "', " + amount + ")");
+ */
+ }
+
+ public void logWithdrawal(int id, String account, float amount) throws RemoteException {
+ DAS das = DAS.FACTORY.createDAS(getConnection());
+ Command insert = das.createCommand("insert into acctLog (id, accountNumber, actionType, amount) values (?,?,?,?)");
+ insert.setParameter(1, new Integer(id));
+ insert.setParameter(2, account);
+ insert.setParameter(3, ACCT_ACTION_TYPE_WITHDRAW);
+ insert.setParameter(4, new Float(amount));
+
+ insert.execute();
+ /*
+ * performLog("insert into acctLog (id ,accountNumber, actionType, amount) values (" + id + ", '" + account + "', '" +
+ * ACCT_ACTION_TYPE_WITHDRAW + "', " + amount + ")");
+ */
+ }
+
+ public void logPurchaseStock(int id, StockSummary stock) throws RemoteException {
+ DAS das = DAS.FACTORY.createDAS(getConnection());
+ Command insert = das.createCommand("insert into stockLog (id, Symbol, quantity, actionType, purchaseLotNumber) values (?,?,?,?,?)");
+ insert.setParameter(1, new Integer(id));
+ insert.setParameter(2, stock.getSymbol());
+ insert.setParameter(3, new Integer(stock.getQuantity()));
+ insert.setParameter(4, STOCK_ACTION_TYPE_PURCHASE);
+ insert.setParameter(5, new Integer(stock.getPurchaseLotNumber()));
+
+ insert.execute();
+ /*
+ * performLog("insert into stockLog (id, Symbol, quantity, actionType, purchaseLotNumber) values (" + id + ", '" + stock.getSymbol() + "', " +
+ * stock.getQuantity() + ", '" + STOCK_ACTION_TYPE_PURCHASE + ", " + stock.getPurchaseLotNumber() + ")");
+ */
+ }
+
+ public void logSellStock(int id, StockSummary stock, int quantity) throws RemoteException {
+
+ String symbol = ((stock.getSymbol() != null) ? stock.getSymbol() : "null");
+ DAS das = DAS.FACTORY.createDAS(getConnection());
+ Command insert = das.createCommand("insert into stockLog (id, Symbol, quantity, actionType, purchaseLotNumber) values (?,?,?,?,?)");
+ insert.setParameter(1, new Integer(id));
+ insert.setParameter(2, symbol);
+ insert.setParameter(3, new Integer(quantity));
+ insert.setParameter(4, STOCK_ACTION_TYPE_SELL);
+ insert.setParameter(5, new Integer(stock.getPurchaseLotNumber()));
+
+ insert.execute();
+ /*
+ * performLog("insert into stockLog (id, Symbol, quantity, actionType, purchaseLotNumber) values (" + id + ", '" + stock.getSymbol() + "', " +
+ * quantity + ", '" + STOCK_ACTION_TYPE_SELL + ", " + stock.getPurchaseLotNumber() + ")");
+ */
+ }
+
+ private void performLog(String toLog) throws RemoteException {
+
+ try {
+ Connection conn = getConnection();
+
+ Statement s = conn.createStatement();
+
+ s.execute(toLog);
+
+ conn.commit();
+
+ System.out.println("SN id acctNo action amount");
+ ResultSet rs = s.executeQuery("select * from acctLog");
+ while (rs.next()) {
+ System.out.println(rs.getInt("logSeqNo") + " " + rs.getInt("id") + " " + rs.getString("accountNumber") + " "
+ + rs.getString("actionType") + " " + rs.getFloat("amount"));
+ }
+
+ conn.commit();
+
+ System.out.println("SN Symbol qty action plot#");
+ rs = s.executeQuery("select * from stockLog");
+ while (rs.next()) {
+ System.out.println(rs.getInt("logSeqNo") + " " + rs.getString("Symbol") + " " + rs.getInt("quantity") + " "
+ + rs.getString("actionType") + " " + rs.getInt("purchaseLotNumber"));
+ }
+
+ conn.commit();
+
+ s.close();
+
+ conn.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RemoteException(e.getClass().getName(), e);
+ }
+
+ System.out.println("Logged " + toLog);
+ }
+
+ protected Connection getConnection() throws RemoteException {
+ try {
+ Connection conn;
+ Class.forName(driver).newInstance();
+ Properties props = new Properties();
+ // props.put("user", "tuscany");
+ // props.put("password", "tuscany");
+ conn = DriverManager.getConnection(protocol + dbDirectory + ";create=true", props);
+
+ conn.setAutoCommit(false);
+ return conn;
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RemoteException(e.getClass().getName(), e);
+ }
+ }
+
+ public AccountLog getAccountLog(final int customerID) throws RemoteException {
+
+ try {
+ final AccountFactory accountFactory = AccountFactory.INSTANCE;
+ final AccountLog accountLog = accountFactory.createAccountLog();
+ InputStream mapping = createConfigStream();
+
+ Connection conn = getConnection();
+ DAS das = DAS.FACTORY.createDAS(mapping, conn);
+ Command select = das.createCommand("SELECT logSeqNo, accountNumber, actionType, amount FROM acctLog where id = ?");
+
+ select.setParameter(1, customerID);
+
+ DataObject root = select.executeQuery();
+ accountLog.getAccountLogEntries().addAll(root.getList("AccountLogEntry"));
+
+ select = das.createCommand("SELECT logSeqNo, Symbol, quantity, actionType, purchaseLotNumber FROM stockLog where id = ?");
+ select.setParameter(1, customerID);
+ root = select.executeQuery();
+ accountLog.getStockLogEntries().addAll(root.getList("StockLogEntry"));
+
+ conn.close();
+
+ return accountLog;
+ } catch (Exception e) {
+ if (e instanceof RemoteException) {
+ throw (RemoteException) e;
+ }
+ throw new RemoteException("getAccountLog failed. customerID ('" + customerID + "')" + e.getClass().getName() + "'. " + e.getMessage(), e);
+ }
+ }
+
+ protected InputStream createConfigStream() {
+ InputStream mapping = getClass().getClassLoader().getResourceAsStream("DasAccountConfiguration.xml");
+ return mapping;
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/stockquote/StockQuote.java b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/stockquote/StockQuote.java
new file mode 100644
index 0000000000..c7498f093d
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/stockquote/StockQuote.java
@@ -0,0 +1,228 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.services.stockquote;
+
+public class StockQuote {
+
+ private String companyName;
+
+ private String symbol;
+
+ private String stockQuote;
+
+ private String lastUpdated;
+
+ private String change;
+
+ private String openPrice;
+
+ private String dayHighPrice;
+
+ private String dayLowPrice;
+
+ private String volume;
+
+ private String marketCap;
+
+ private String yearRange;
+
+ private String exDividendDate;
+
+ private String dividendYield;
+
+ private String dividendPerShare;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected StockQuote() {
+ super();
+ }
+
+ public String getCompanyName() {
+ return companyName;
+ }
+
+ public void setCompanyName(String newCompanyName) {
+ companyName = newCompanyName;
+ }
+
+ public String getSymbol() {
+ return symbol;
+ }
+
+ public void setSymbol(String newStockTicker) {
+ symbol = newStockTicker;
+ }
+
+ public String getStockQuote() {
+ return stockQuote;
+ }
+
+ public void setStockQuote(String newStockQuote) {
+ stockQuote = newStockQuote;
+ }
+
+ public String getLastUpdated() {
+ return lastUpdated;
+ }
+
+ public void setLastUpdated(String newLastUpdated) {
+ lastUpdated = newLastUpdated;
+ }
+
+ public String getChange() {
+ return change;
+ }
+
+ public void setChange(String newChange) {
+ change = newChange;
+ }
+
+ public String getOpenPrice() {
+ return openPrice;
+ }
+
+ public void setOpenPrice(String newOpenPrice) {
+ openPrice = newOpenPrice;
+ }
+
+ public String getDayHighPrice() {
+ return dayHighPrice;
+ }
+
+ public void setDayHighPrice(String newDayHighPrice) {
+ dayHighPrice = newDayHighPrice;
+ }
+
+ public String getDayLowPrice() {
+ return dayLowPrice;
+ }
+
+ public void setDayLowPrice(String newDayLowPrice) {
+ dayLowPrice = newDayLowPrice;
+ }
+
+ public String getVolume() {
+ return volume;
+ }
+
+ public void setVolume(String newVolume) {
+ volume = newVolume;
+ }
+
+ public String getMarketCap() {
+ return marketCap;
+ }
+
+ public void setMarketCap(String newMarketCap) {
+ marketCap = newMarketCap;
+ }
+
+ public String getYearRange() {
+ return yearRange;
+ }
+
+ public void setYearRange(String newYearRange) {
+ yearRange = newYearRange;
+ }
+
+ public String getExDividendDate() {
+ return exDividendDate;
+ }
+
+ public void setExDividendDate(String newExDividendDate) {
+ exDividendDate = newExDividendDate;
+ }
+
+ public String getDividendYield() {
+ return dividendYield;
+ }
+
+ public void setDividendYield(String newDividendYield) {
+ dividendYield = newDividendYield;
+ }
+
+ public String getDividendPerShare() {
+ return dividendPerShare;
+ }
+
+ public void setDividendPerShare(String newDividendPerShare) {
+ dividendPerShare = newDividendPerShare;
+ }
+
+ @Override
+ public String toString() {
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (companyName: ");
+ result.append(companyName);
+ result.append(", symbol: ");
+ result.append(symbol);
+ result.append(", stockQuote: ");
+ result.append(stockQuote);
+ result.append(", lastUpdated: ");
+ result.append(lastUpdated);
+ result.append(", change: ");
+ result.append(change);
+ result.append(", openPrice: ");
+ result.append(openPrice);
+ result.append(", dayHighPrice: ");
+ result.append(dayHighPrice);
+ result.append(", dayLowPrice: ");
+ result.append(dayLowPrice);
+ result.append(", volume: ");
+ result.append(volume);
+ result.append(", marketCap: ");
+ result.append(marketCap);
+ result.append(", yearRange: ");
+ result.append(yearRange);
+ result.append(", exDividendDate: ");
+ result.append(exDividendDate);
+ result.append(", dividendYield: ");
+ result.append(dividendYield);
+ result.append(", dividendPerShare: ");
+ result.append(dividendPerShare);
+ result.append(')');
+ return result.toString();
+ }
+
+ @Override
+ public StockQuote clone() {
+ StockQuote ret = new StockQuote();
+ ret.companyName = companyName;
+ ret.symbol = symbol;
+ ret.stockQuote = stockQuote;
+ ret.lastUpdated = lastUpdated;
+ ret.change = change;
+ ret.openPrice = openPrice;
+ ret.dayHighPrice = dayHighPrice;
+ ret.dayLowPrice = dayLowPrice;
+ ret.volume = volume;
+ ret.marketCap = marketCap;
+ ret.yearRange = yearRange;
+ ret.exDividendDate = exDividendDate;
+ ret.dividendYield = dividendYield;
+ ret.dividendPerShare = dividendPerShare;
+ return ret;
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/stockquote/StockQuoteService.java b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/stockquote/StockQuoteService.java
new file mode 100644
index 0000000000..9d5c243f9a
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/stockquote/StockQuoteService.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank.account.services.stockquote;
+
+import java.rmi.RemoteException;
+import java.util.Map;
+
+/**
+ * This is the business interface of the HelloWorld service component.
+ */
+public interface StockQuoteService {
+
+ public Map getQuotes(String[] symbols) throws RemoteException;
+
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/stockquote/StockQuoteServiceImpl.java b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/stockquote/StockQuoteServiceImpl.java
new file mode 100644
index 0000000000..b0c31d4d81
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/stockquote/StockQuoteServiceImpl.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank.account.services.stockquote;
+
+import java.rmi.RemoteException;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Random;
+
+/* Mock StockQuoteService */
+
+public class StockQuoteServiceImpl implements StockQuoteService {
+
+ static Random rn = new Random();
+
+ static Hashtable<String, StockQuote> stocks = new Hashtable<String, StockQuote>();
+
+ public synchronized Map getQuotes(String[] symbols) throws RemoteException {
+ Map<String, StockQuote> ret = new Hashtable<String, StockQuote>();
+ for (String sym : symbols) {
+ sym = sym.toUpperCase();
+ if (!ret.containsKey(sym)) {
+ StockQuote sq = stocks.get(sym);
+ if (sq == null) {
+ sq = new StockQuote();
+ stocks.put(sym, sq);
+ sq.setSymbol(sym);
+ sq.setCompanyName(sym + " INC");
+ float val = rn.nextFloat() * 97.0F + 3.0F;
+ sq.setStockQuote(val + "");
+ sq.setDayHighPrice(val + "");
+ sq.setDayLowPrice(val + "");
+ sq.setOpenPrice(val + "");
+ } else {
+ float diff = (rn.nextFloat() * 2.0F) - 1;
+ float newval = new Float(sq.getStockQuote()) + diff; // auto boxing cool.
+ sq.setStockQuote(newval + "");
+ float dh = Math.max(newval, new Float(sq.getDayHighPrice()));
+ sq.setDayHighPrice(dh + "");
+ float dl = Math.min(newval, new Float(sq.getDayLowPrice()));
+ sq.setDayLowPrice(dl + "");
+
+ }
+ ret.put(sym, sq.clone());
+ }
+
+ }
+
+ return ret;
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/stockquote/StockQuoteWebservicexServiceImpl.java b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/stockquote/StockQuoteWebservicexServiceImpl.java
new file mode 100644
index 0000000000..053f9d7f16
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/java/bigbank/account/services/stockquote/StockQuoteWebservicexServiceImpl.java
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.services.stockquote;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.lang.reflect.Method;
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Map;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+
+import net.x.webservice.StockQuoteSoap;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements the Stock quote service component.
+ */
+@Service(StockQuoteService.class)
+@Scope("COMPOSITE")
+public class StockQuoteWebservicexServiceImpl implements StockQuoteService {
+
+ @Reference
+ public StockQuoteSoap stockQuoteService = null; // Injected by the SCA container.
+
+ /**
+ * @throws RemoteException
+ * @see bigbank.account.services.stockquote.StockQuoteService#getQuotes(String[])
+ */
+ public Map getQuotes(final String[] symbols) throws RemoteException {
+ try {
+ assert null != stockQuoteService : "stockQuoteService was not set by the SCA runtime!";
+ StringBuilder sb = new StringBuilder(5 * symbols.length);
+ for (String sym : symbols) {
+ if (sb.length() != 0) {
+ sb.append(' ');
+ }
+ sb.append(sym);
+ }
+ String stockdata = stockQuoteService.GetQuote(sb.toString());
+
+ InputStream in = new ByteArrayInputStream(stockdata.getBytes());
+ XMLInputFactory factory = XMLInputFactory.newInstance();
+ XMLStreamReader parser = factory.createXMLStreamReader(in);
+ ArrayList<StockQuote> listQuotes = new ArrayList<StockQuote>();
+ Hashtable<String, StockQuote> listQuoteHT = new Hashtable<String, StockQuote>();
+ MapStock currentStock = null;
+ StringBuilder currentText = new StringBuilder(100);
+ for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+ String lname;
+ switch (event) {
+ case XMLStreamConstants.START_ELEMENT:
+ if (parser.getLocalName() == "Stock") {
+
+ currentStock = new MapStock();
+ listQuotes.add(currentStock);
+ }
+ break;
+ case XMLStreamConstants.END_ELEMENT:
+ lname = parser.getLocalName();
+ String mname = "set" + lname;
+ try {
+ Method setter = MapStock.class.getMethod(mname, new Class[] { String.class });
+ if (setter != null) {
+ setter.invoke(currentStock, currentText.toString());
+ if (lname.equals("Symbol")) {
+ listQuoteHT.put(currentText.toString(), currentStock);
+
+ }
+ }
+ } catch (NoSuchMethodException e) {
+
+ }
+ // System.err.println(parser.getLocalName() + ":" + currentText.toString());
+ currentText.setLength(0);
+ break;
+ case XMLStreamConstants.CHARACTERS:
+ // System.out.print(parser.getText());
+ currentText.append(parser.getText());
+ break;
+ case XMLStreamConstants.CDATA:
+ // System.out.print(parser.getText());
+ currentText.append(parser.getText());
+ break;
+ } // end switch
+ } // end while
+ parser.close();
+
+ return listQuoteHT;
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RemoteException(e.getClass().getName() + e.getMessage(), e);
+ }
+ }
+
+ public static class MapStock extends StockQuote {
+
+ public void setLast(String val) {
+ super.setStockQuote(val);
+ }
+
+ public void setDate(String val) {
+ };
+
+ public void setTime(String val) {
+ };
+
+ public void setHigh(String val) {
+ super.setDayHighPrice(val);
+ }
+
+ public void setLow(String val) {
+ super.setDayLowPrice(val);
+ }
+
+ public void setOpen(String val) {
+ super.setOpenPrice(val);
+ }
+
+ public void setMktCap(String val) {
+ super.setMarketCap(val);
+ }
+
+ public void setName(String val) {
+ super.setCompanyName(val);
+ }
+
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/src/main/resources/DasAccountConfiguration.xml b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/resources/DasAccountConfiguration.xml
new file mode 100644
index 0000000000..ed1553eb40
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/resources/DasAccountConfiguration.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<Config xmlns="http:///org.apache.tuscany.das.rdb/config.xsd" dataObjectModel="http://www.bigbank.com/account">
+
+ <Table tableName="CUSTOMERS" typeName="CustomerProfileData">
+ <!-- Column name="firstName" primaryKey="true"/ -->
+ <Column columnName="FIRSTNAME"/>
+ <Column columnName="LASTNAME"/>
+ <Column columnName="ADDRESS"/>
+ <Column columnName="EMAIL"/>
+ <Column columnName="LOGINID"/>
+ <Column columnName="PASSWORD"/>
+ <Column columnName="ID"/>
+ </Table>
+
+ <Table tableName="ACCOUNTS" typeName="AccountSummary">
+ <!-- Column name="firstName" primaryKey="true"/ -->
+ <Column columnName="ACCOUNTNUMBER"/>
+ <Column columnName="BALANCE"/>
+ </Table>
+
+
+
+ <Table tableName="STOCKS" typeName="StockSummary" >
+ <Column columnName="ID" propertyName="id"/>
+ <Column columnName="Symbol" propertyName="symbol"/>
+ <Column columnName="quantity" propertyName="quantity"/>
+ <Column columnName="purchasePrice" propertyName="purchasePrice"/>
+ <Column columnName="PURCHASEDATE" propertyName="purchaseDate" converterClassName="bigbank.account.services.accountdata.AccountDataServiceDASImpl$DateConverter"/>
+ </Table>
+
+
+ <Table tableName="ACCTLOG" typeName="AccountLogEntry">
+ <Column columnName="logSeqNo"/>
+ <Column columnName="ID"/>
+ <Column columnName="ACCOUNTNUMBER"/>
+ <Column columnName="ACTIONTYPE"/>
+ <Column columnName="AMOUNT"/>
+ </Table>
+
+
+
+ <Table tableName="STOCKLOG" typeName="StockLogEntry" >
+ <Column columnName="logSeqNo"/>
+ <Column columnName="ID"/>
+ <Column columnName="Symbol"/>
+ <Column columnName="quantity"/>
+ <Column columnName="actionType"/>
+ <Column columnName="purchaseLotNumber"/>
+ </Table>
+
+
+ <Command name="get account" SQL="SELECT accountNumber, accountType, balance FROM accounts where accountNumber = ?" kind="Select" />
+ <Command name="update balance" SQL="update ACCOUNTS set BALANCE = ? where ACCOUNTNUMBER = ?" kind="Update" />
+
+ <Command name="all customers" SQL="select * from CUSTOMERS" kind="Select"/>
+
+ <Command name="all stocks" SQL="select symbol, quantity, purchaseprice, purchasedate from stocks" kind="Select"/>
+ <Command name="stockbylotSelect" SQL="select quantity from STOCKS WHERE purchaseLotNumber = ?" kind="Select" />
+ <Command name="stockbylot" SQL="update STOCKS set quantity = ? WHERE purchaseLotNumber = ?" kind="Update" />
+
+</Config>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/src/main/resources/META-INF/LICENSE.txt b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000000..bdec70a4fa
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,416 @@
+
+ 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.
+
+===============================================================================================================
+
+
+License for the Service Data Objects JavaDoc and Interface Definition files.
+
+Permission to copy, make derivative works of, and distribute the Service Data Objects
+JavaDoc and Interface Definition Files files in any medium without fee or royalty as part
+of a compliant implementation of the Service Data Objects Specification is hereby granted.
+The Service Data Objects Specification may be found at any of the following locations:
+
+http://dev2dev.bea.com/technologies/commonj/index.jsp
+http://www.ibm.com/developerworks/library/specification/ws-sdo/
+http://oracle.com/technology/webservices/sca
+https://www.sdn.sap.com/
+http://www.xcalia/xdn/specs/sdo
+
+THE SERVICE DATA OBJECTS SPECIFICATION AND THE JAVADOC AND INTERFACE DEFINITION FILES
+ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS
+SPECIFICATION OR THE JAVADOC AND INTERFACE DEFINITION FILES AND THE IMPLEMENTATION OF THEIR CONTENTS,
+INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+NON-INFRINGEMENT OR TITLE. THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
+INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY USE OR DISTRIBUTION OF THE
+SERVICE DATA OBJECTS SPECIFICATION OR THE JAVADOC OR INTERFACE DEFINTION FILES.
+
+The name and trademarks of the Authors may NOT be used in any manner, including advertising or
+publicity pertaining to the Service Component Architecture Specification or its contents without specific,
+written prior permission. Title to copyright in the Service Data Objects Specification and the
+JavaDoc and Interface Definition Files will at all times remain with the Authors.
+
+No other rights are granted by implication, estoppel or otherwise.
+
+=================================================================================================================
+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.
+
+===================================================================================================
+
+Common Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+ a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+ b) in the case of each subsequent Contributor:
+
+ i) changes to the Program, and
+
+ ii) additions to the Program;
+
+ where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+ a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+
+ b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+
+ c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+
+ d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+ a) it complies with the terms and conditions of this Agreement; and
+
+ b) its license agreement:
+
+ i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+
+ ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+
+ iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+
+ iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+ a) it must be made available under this Agreement; and
+
+ b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
+
+
+
+
+
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/src/main/resources/META-INF/NOTICE b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/resources/META-INF/NOTICE
new file mode 100644
index 0000000000..d48810c0ec
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/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/branches/sca-java-integration/samples/sca/bigbank/account/src/main/resources/wsdl/AccountService.wsdl b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/resources/wsdl/AccountService.wsdl
new file mode 100644
index 0000000000..9acb92664d
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/resources/wsdl/AccountService.wsdl
@@ -0,0 +1,467 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:account="http://www.bigbank.com/account"
+ targetNamespace="http://www.bigbank.com/account"
+ name="AccountService">
+
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://www.bigbank.com/account"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:account="http://www.bigbank.com/account"
+
+ > <!-- xmlns:sdojava="commonj.sdo/java" sdojava:package="org.apache.tuscany.samples.bigbank.account" -->
+
+
+<!-- <xsd:complexType name="DataGraphRoot">
+ <xsd:sequence>
+ <xsd:element name="customerProfileData" type="account:CustomerProfileData" maxOccurs="unbounded" minOccurs="0" />
+ <xsd:element name="StockSummaries" type="account:StockSummary" maxOccurs="unbounded" minOccurs="0" />
+ <xsd:element name="AccountSummaries" type="account:AccountSummary" maxOccurs="unbounded" minOccurs="0" />
+ <xsd:element name="StockLogEntries" type="account:StockLogEntry" maxOccurs="unbounded" minOccurs="0" />
+ <xsd:element name="AccountLogEntries" type="account:AccountLogEntry" maxOccurs="unbounded" minOccurs="0" />
+ </xsd:sequence>
+ </xsd:complexType>-->
+
+
+ <xsd:element name="getAccountReport">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="customerID"
+ type="xsd:int" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="getAccountReportResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="accountReport"
+ type="account:AccountReport" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:complexType name="AccountReport">
+ <xsd:sequence>
+ <xsd:element name="accountSummaries"
+ type="account:AccountSummary" maxOccurs="unbounded" />
+ <xsd:element name="stockSummaries"
+ type="account:StockSummary" maxOccurs="unbounded" />
+
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="AccountSummary">
+ <xsd:attribute name="accountNumber" type="xsd:string" />
+ <xsd:attribute name="accountType" type="xsd:string" />
+ <xsd:attribute name="balance" type="xsd:float" />
+ </xsd:complexType>
+
+ <xsd:complexType name="StockSummary">
+ <!-- xsd:attribute name="id" type="xsd:int" / -->
+ <xsd:attribute name="purchaseLotNumber" type="xsd:int" />
+ <!-- unique id for this purchase -->
+ <xsd:attribute name="symbol" type="xsd:string" />
+ <xsd:attribute name="quantity" type="xsd:int" />
+ <xsd:attribute name="purchaseDate" type="xsd:dateTime" />
+ <xsd:attribute name="purchasePrice" type="xsd:float" />
+ <xsd:attribute name="currentPrice" type="xsd:float" />
+ <xsd:attribute name="company" type="xsd:string" />
+ <xsd:attribute name="highPrice" type="xsd:float" />
+ <xsd:attribute name="lowPrice" type="xsd:float" />
+
+ </xsd:complexType>
+
+ <!-- Profile in data base -->
+ <xsd:element name="getCustomerProfile">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="loginID" type="xsd:string" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:complexType name="CustomerProfileData">
+ <xsd:sequence>
+ <xsd:element name="firstName" type="xsd:string" />
+ <xsd:element name="lastName" type="xsd:string" />
+ <xsd:element name="address" type="xsd:string" />
+ <xsd:element name="email" type="xsd:string" />
+ <xsd:element name="loginID" type="xsd:string" />
+ <xsd:element name="password" type="xsd:string" />
+ <xsd:element name="id" type="xsd:int" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:element name="getCustomerProfileResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="customerProfile"
+ type="account:CustomerProfileData" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="withdraw">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="accountNumber"
+ type="xsd:string" />
+ <xsd:element name="amount" type="xsd:float" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="withdrawResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="balance" type="xsd:float" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="deposit">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="accountNumber"
+ type="xsd:string" />
+ <xsd:element name="amount" type="xsd:float" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="depositResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="balance" type="xsd:float" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="purchaseStock">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="id" type="xsd:int" />
+ <xsd:element name="stock" type="account:StockSummary" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="purchaseStockResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="purchaseSummary"
+ type="account:StockSummary" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+
+
+ <xsd:element name="sellStock">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="purchaseLotNumber"
+ type="xsd:int" /><!-- unique id for this purchase -->
+ <xsd:element name="quantity" type="xsd:int" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="createAccount">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="customerProfile"
+ type="account:CustomerProfileData" />
+ <xsd:element name="createSavings"
+ type="xsd:boolean" />
+ <xsd:element name="createCheckings"
+ type="xsd:boolean" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="createAccountResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="customerProfile"
+ type="account:CustomerProfileData" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ </xsd:element>
+
+ <xsd:element name="getAccountLog">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="customerID"
+ type="xsd:int" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="getAccountLogResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="accountLog"
+ type="account:AccountLog" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:complexType name="AccountLog">
+ <xsd:sequence>
+ <xsd:element name="accountLogEntries"
+ type="account:AccountLogEntry" maxOccurs="unbounded" />
+ <xsd:element name="stockLogEntries"
+ type="account:StockLogEntry" maxOccurs="unbounded" />
+
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="AccountLogEntry">
+ <xsd:attribute name="logSeqNo" type="xsd:int" />
+ <xsd:attribute name="id" type="xsd:int" />
+ <xsd:attribute name="accountNumber" type="xsd:string" />
+ <xsd:attribute name="actionType" type="xsd:string" />
+ <xsd:attribute name="amount" type="xsd:float" />
+ </xsd:complexType>
+
+ <xsd:complexType name="StockLogEntry">
+ <xsd:attribute name="logSeqNo" type="xsd:int" />
+ <xsd:attribute name="id" type="xsd:int" />
+ <xsd:attribute name="symbol" type="xsd:string" />
+ <xsd:attribute name="quantity" type="xsd:int" />
+ <xsd:attribute name="actionType" type="xsd:string" />
+ <xsd:attribute name="purchaseLotNumber" type="xsd:int" />
+ </xsd:complexType>
+
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="getAccountReportRequest">
+ <wsdl:part element="account:getAccountReport"
+ name="getAccountReportRequest" />
+ </wsdl:message>
+ <wsdl:message name="getAccountReportResponse">
+ <wsdl:part element="account:getAccountReportResponse"
+ name="getAccountReportResponse" />
+ </wsdl:message>
+
+ <wsdl:message name="getCustomerProfileRequest">
+ <wsdl:part element="account:getCustomerProfile"
+ name="getCustomerProfile" />
+ </wsdl:message>
+ <wsdl:message name="getCustomerProfileResponse">
+ <wsdl:part element="account:getCustomerProfileResponse"
+ name="getCustomerProfileResponse" />
+ </wsdl:message>
+
+ <wsdl:message name="withdrawRequest">
+ <wsdl:part element="account:withdraw" name="withdrawRequest" />
+ </wsdl:message>
+
+ <wsdl:message name="withdrawResponse">
+ <wsdl:part element="account:withdrawResponse"
+ name="withdrawResponse" />
+ </wsdl:message>
+
+ <wsdl:message name="depositRequest">
+ <wsdl:part element="account:deposit" name="depositRequest" />
+ </wsdl:message>
+
+ <wsdl:message name="depositResponse">
+ <wsdl:part element="account:depositResponse"
+ name="depositResponse" />
+ </wsdl:message>
+
+ <wsdl:message name="purchaseStockRequest">
+ <wsdl:part element="account:purchaseStock"
+ name="purchaseStockRequest" />
+ </wsdl:message>
+
+ <wsdl:message name="purchaseStockResponse">
+ <wsdl:part element="account:purchaseStockResponse"
+ name="purchaseStockResponse" />
+ </wsdl:message>
+
+ <wsdl:message name="sellStockRequest">
+ <wsdl:part element="account:sellStock" name="sellStockRequest" />
+ </wsdl:message>
+
+ <wsdl:message name="createAccountRequest">
+ <wsdl:part element="account:createAccount" name="createAccountRequest" />
+ </wsdl:message>
+
+ <wsdl:message name="createAccountResponse">
+ <wsdl:part element="account:createAccountResponse" name="createAccountResponse" />
+ </wsdl:message>
+
+ <wsdl:message name="getAccountLogRequest">
+ <wsdl:part element="account:getAccountLog"
+ name="getAccountLogRequest" />
+ </wsdl:message>
+
+ <wsdl:message name="getAccountLogResponse">
+ <wsdl:part element="account:getAccountLogResponse"
+ name="getAccountLogResponse" />
+ </wsdl:message>
+
+ <wsdl:portType name="AccountService">
+ <wsdl:operation name="getAccountReport">
+ <wsdl:input message="account:getAccountReportRequest" />
+ <wsdl:output message="account:getAccountReportResponse" />
+ </wsdl:operation>
+
+ <wsdl:operation name="getCustomerProfile">
+ <wsdl:input message="account:getCustomerProfileRequest" />
+ <wsdl:output message="account:getCustomerProfileResponse" />
+ </wsdl:operation>
+
+ <wsdl:operation name="withdraw">
+ <wsdl:input message="account:withdrawRequest" />
+ <wsdl:output message="account:withdrawResponse" />
+ </wsdl:operation>
+
+ <wsdl:operation name="deposit">
+ <wsdl:input message="account:depositRequest" />
+ <wsdl:output message="account:depositResponse" />
+ </wsdl:operation>
+
+ <wsdl:operation name="purchaseStock">
+ <wsdl:input message="account:purchaseStockRequest" />
+ <wsdl:output message="account:purchaseStockResponse" />
+ </wsdl:operation>
+
+ <wsdl:operation name="sellStock">
+ <wsdl:input message="account:sellStockRequest" />
+ <wsdl:output message="account:purchaseStockResponse" />
+ </wsdl:operation>
+
+
+ <wsdl:operation name="createAccount">
+ <wsdl:input message="account:createAccountRequest" />
+ <wsdl:output message="account:createAccountResponse" />
+ </wsdl:operation>
+
+ <wsdl:operation name="getAccountLog">
+ <wsdl:input message="account:getAccountLogRequest" />
+ <wsdl:output message="account:getAccountLogResponse" />
+ </wsdl:operation>
+
+ </wsdl:portType>
+
+
+
+ <wsdl:binding name="AccountServiceSOAP" type="account:AccountService">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="getAccountReport">
+ <soap:operation
+ soapAction="http://www.bigbank.com/account/getAccountReport" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getCustomerProfile">
+ <soap:operation
+ soapAction="http://www.bigbank.com/account/getCustomerProfile" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="withdraw">
+ <soap:operation
+ soapAction="http://www.bigbank.com/account/withdraw" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="deposit">
+ <soap:operation
+ soapAction="http://www.bigbank.com/account/deposit" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="purchaseStock">
+ <soap:operation
+ soapAction="http://www.bigbank.com/account/purchaseStock" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="sellStock">
+ <soap:operation
+ soapAction="http://www.bigbank.com/account/sellStock" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="createAccount">
+ <soap:operation
+ soapAction="http://www.bigbank.com/account/createAccount" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="getAccountLog">
+ <soap:operation
+ soapAction="http://www.bigbank.com/account/getAccountLog" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+
+ </wsdl:binding>
+ <wsdl:service name="AccountService">
+ <wsdl:port binding="account:AccountServiceSOAP"
+ name="AccountServiceSOAP">
+ <soap:address
+ location="http://localhost:8080/sample-bigbank-account/services/AccountService" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/src/main/resources/wsdl/stockquotes.webservicex.wsdl b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/resources/wsdl/stockquotes.webservicex.wsdl
new file mode 100644
index 0000000000..16c980a30e
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/resources/wsdl/stockquotes.webservicex.wsdl
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www.webserviceX.NET/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://www.webserviceX.NET/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <wsdl:types>
+ <s:schema elementFormDefault="qualified"
+ targetNamespace="http://www.webserviceX.NET/" >
+ <!--
+ xmlns:sdojava="commonj.sdo/java"
+ sdojava:package="net.x.webservice"
+ -->
+
+
+ >
+ <s:element name="GetQuote">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="symbol" type="s:string"/>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetQuoteResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="GetQuoteResult" type="s:string"/>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="string" nillable="true" type="s:string"/>
+ </s:schema>
+ </wsdl:types>
+ <wsdl:message name="GetQuoteSoapIn">
+ <wsdl:part name="parameters" element="tns:GetQuote"/>
+ </wsdl:message>
+ <wsdl:message name="GetQuoteSoapOut">
+ <wsdl:part name="parameters" element="tns:GetQuoteResponse"/>
+ </wsdl:message>
+ <wsdl:message name="GetQuoteHttpGetIn">
+ <wsdl:part name="symbol" type="s:string"/>
+ </wsdl:message>
+ <wsdl:message name="GetQuoteHttpGetOut">
+ <wsdl:part name="Body" element="tns:string"/>
+ </wsdl:message>
+ <wsdl:message name="GetQuoteHttpPostIn">
+ <wsdl:part name="symbol" type="s:string"/>
+ </wsdl:message>
+ <wsdl:message name="GetQuoteHttpPostOut">
+ <wsdl:part name="Body" element="tns:string"/>
+ </wsdl:message>
+ <wsdl:portType name="StockQuoteSoap">
+ <wsdl:operation name="GetQuote">
+ <documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Get Stock quote for a company Symbol</documentation>
+ <wsdl:input message="tns:GetQuoteSoapIn"/>
+ <wsdl:output message="tns:GetQuoteSoapOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:portType name="StockQuoteHttpGet">
+ <wsdl:operation name="GetQuote">
+ <documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Get Stock quote for a company Symbol</documentation>
+ <wsdl:input message="tns:GetQuoteHttpGetIn"/>
+ <wsdl:output message="tns:GetQuoteHttpGetOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:portType name="StockQuoteHttpPost">
+ <wsdl:operation name="GetQuote">
+ <documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Get Stock quote for a company Symbol</documentation>
+ <wsdl:input message="tns:GetQuoteHttpPostIn"/>
+ <wsdl:output message="tns:GetQuoteHttpPostOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="StockQuoteSoap" type="tns:StockQuoteSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <wsdl:operation name="GetQuote">
+ <soap:operation soapAction="http://www.webserviceX.NET/GetQuote" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:binding name="StockQuoteHttpGet" type="tns:StockQuoteHttpGet">
+ <http:binding verb="GET"/>
+ <wsdl:operation name="GetQuote">
+ <http:operation location="/GetQuote"/>
+ <wsdl:input>
+ <http:urlEncoded/>
+ </wsdl:input>
+ <wsdl:output>
+ <mime:mimeXml part="Body"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="StockQuoteHttpPost" type="tns:StockQuoteHttpPost">
+ <http:binding verb="POST"/>
+ <wsdl:operation name="GetQuote">
+ <http:operation location="/GetQuote"/>
+ <wsdl:input>
+ <mime:content type="application/x-www-form-urlencoded"/>
+ </wsdl:input>
+ <wsdl:output>
+ <mime:mimeXml part="Body"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="StockQuote">
+ <wsdl:port name="StockQuoteSoap" binding="tns:StockQuoteSoap">
+ <soap:address location="http://www.webservicex.com/stockquote.asmx"/>
+ </wsdl:port>
+ <wsdl:port name="StockQuoteHttpGet" binding="tns:StockQuoteHttpGet">
+ <http:address location="http://www.webservicex.com/stockquote.asmx"/>
+ </wsdl:port>
+ <wsdl:port name="StockQuoteHttpPost" binding="tns:StockQuoteHttpPost">
+ <http:address location="http://www.webservicex.com/stockquote.asmx"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/src/main/webapp/WEB-INF/default.scdl b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/webapp/WEB-INF/default.scdl
new file mode 100644
index 0000000000..7c83a1a648
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/webapp/WEB-INF/default.scdl
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+ name="bigbank.account">
+
+
+ <service name="AccountService">
+ <!-- interface.java interface="com.bigbank.account.AccountService"/-->
+ <interface.wsdl interface="http://www.bigbank.com/account#wsdl.interface(AccountService)"
+ wsdli:wsdlLocation="http://www.bigbank.com/account wsdl/AccountService.wsdl" />
+
+
+ <binding.ws endpoint="http://www.bigbank.com/account#wsdl.endpoint(AccountService/AccountServiceSOAP)"
+ conformanceURIs="http://ws-i.org/profiles/basic/1.1" location="wsdl/AccountService.wsdl" />
+
+ <reference>AccountServiceComponent</reference>
+ </service>
+
+
+ <property name="currency" type="xsd:string">USD</property>
+
+ <component name="AccountServiceComponent">
+ <implementation.java class="bigbank.account.services.account.AccountServiceImpl" />
+ <property name="currency" source="$currency" />
+ <reference name="accountDataService">AccountLoggerDataServiceComponent</reference>
+ <reference name="stockQuoteService">StockQuoteServiceComponent</reference>
+ </component>
+
+ <component name="AccountLoggerDataServiceComponent">
+ <implementation.java class="bigbank.account.services.accountlogger.AccountLoggerDataServiceImpl" />
+ <reference name="accountDataService">AccountDataServiceComponent</reference>
+ <reference name="accountLoggerService">AccountLoggerServiceComponent</reference>
+ </component>
+
+ <component name="AccountDataServiceComponent">
+ <implementation.java class="bigbank.account.services.accountdata.AccountDataServiceDASImpl" />
+ </component>
+
+ <component name="AccountLoggerServiceComponent">
+ <implementation.java class="bigbank.account.services.accountlogger.AccountLoggerServiceImpl" />
+ </component>
+
+ <!-- by default, we use the faked stock quote implemented as a POJO component -->
+ <component name="StockQuoteServiceComponent">
+ <implementation.java class="bigbank.account.services.stockquote.StockQuoteServiceImpl" />
+ </component>
+
+ <!-- Please uncomment the following to get the real stock quote -->
+ <!--
+ <component name="StockQuoteServiceComponent">
+ <implementation.java class="bigbank.account.services.stockquote.StockQuoteWebservicexServiceImpl" />
+ <reference name="stockQuoteService">StockQuoteWebService</reference>
+ </component>
+
+ <reference name="StockQuoteWebService">
+ <interface.wsdl interface="http://www.webserviceX.NET/#wsdl.interface(StockQuoteSoap)"
+ wsdli:wsdlLocation="http://www.webserviceX.NET/ wsdl/stockquotes.webservicex.wsdl" />
+ <binding.ws endpoint="http://www.webserviceX.NET/#wsdl.endpoint(StockQuote/StockQuoteSoap)"
+ location="wsdl/stockquotes.webservicex.wsdl" />
+ </reference>
+ -->
+
+</composite> \ No newline at end of file
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/src/main/webapp/WEB-INF/web.xml b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000000..509e5a052d
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
+Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <display-name>Tuscany Bigbank Account sample</display-name>
+
+ <!-- context-param>
+ <param-name>tuscany.systemScdlPath</param-name>
+ <param-value>/META-INF/tuscany/webapp.scdl</param-value>
+ </context-param -->
+
+ <!-- context-param>
+ <param-name>tuscany.applicationScdlPath</param-name>
+ <param-value>/META-INF/sca/default.scdl</param-value>
+ </context-param -->
+
+ <context-param>
+ <param-name>tuscany.online</param-name>
+ <param-value>false</param-value>
+ </context-param>
+
+
+ <listener>
+ <listener-class>org.apache.tuscany.runtime.webapp.TuscanyContextListener</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>TuscanyServlet</servlet-name>
+ <display-name>Tuscany Servlet</display-name>
+ <servlet-class>org.apache.tuscany.runtime.webapp.TuscanyServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TuscanyServlet</servlet-name>
+ <url-pattern>/*</url-pattern>
+
+ </servlet-mapping>
+ <servlet>
+ <!-- Initialize bigbank database -->
+ <servlet-name>AccountDBInit</servlet-name>
+ <servlet-class>bigbank.account.services.accountdb.AccountDBInit</servlet-class>
+ <load-on-startup>2</load-on-startup>
+ </servlet>
+ <!-- servlet-mapping>
+ <servlet-name>AccountDBInit</servlet-name>
+ <url-pattern>/AccountDBInit</url-pattern>
+ </servlet-mapping -->
+
+
+</web-app>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/account/src/test/java/bigbank/account/client/AccountClient.java b/branches/sca-java-integration/samples/sca/bigbank/account/src/test/java/bigbank/account/client/AccountClient.java
new file mode 100644
index 0000000000..28f9e762f0
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/account/src/test/java/bigbank/account/client/AccountClient.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 bigbank.account.client;
+
+import java.util.Iterator;
+
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+import com.bigbank.account.AccountReport;
+import com.bigbank.account.AccountService;
+import com.bigbank.account.AccountSummary;
+
+public class AccountClient {
+
+ public void start() {
+ }
+
+ public void stop() {
+ }
+
+ public static void main(String[] args) throws Exception {
+
+ CompositeContext context = CurrentCompositeContext.getContext();
+
+ AccountService accountService = context.locateService(AccountService.class, "AccountServiceComponent");
+
+ AccountReport accountReport = accountService.getAccountReport(12345);
+
+ for (Iterator i = accountReport.getAccountSummaries().iterator(); i.hasNext();) {
+ AccountSummary accountSummary = (AccountSummary) i.next();
+
+ System.out.println(accountSummary.getAccountNumber());
+ System.out.println(accountSummary.getAccountType());
+ System.out.println(accountSummary.getBalance());
+ }
+
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/docs/Show.Image.html b/branches/sca-java-integration/samples/sca/bigbank/docs/Show.Image.html
new file mode 100644
index 0000000000..9b18679abf
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/docs/Show.Image.html
@@ -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.
+-->
+<html>
+ <head>
+ <style type="text/css">
+ #image {
+ text-align:center;
+ }
+ #close {
+ text-align:center;
+ }
+ </style>
+ </head>
+ <body>
+ <div id="image">
+ <script language="javascript">
+ var search = document.location.search;
+ var url = search.substring(5,search.length);
+ document.write("<img src='" + url + "' alt='" + url + "'/>");
+ </script>
+ </div>
+ <div id="close"><a href="javascript:window.close()">Close Window</a></div>
+ </body>
+</html>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/docs/accountfiles.png b/branches/sca-java-integration/samples/sca/bigbank/docs/accountfiles.png
new file mode 100644
index 0000000000..9fc46488a0
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/docs/accountfiles.png
Binary files differ
diff --git a/branches/sca-java-integration/samples/sca/bigbank/docs/accountmodule.png b/branches/sca-java-integration/samples/sca/bigbank/docs/accountmodule.png
new file mode 100644
index 0000000000..d4209a01e3
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/docs/accountmodule.png
Binary files differ
diff --git a/branches/sca-java-integration/samples/sca/bigbank/docs/modualoverview.png b/branches/sca-java-integration/samples/sca/bigbank/docs/modualoverview.png
new file mode 100644
index 0000000000..7e6d7ba25e
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/docs/modualoverview.png
Binary files differ
diff --git a/branches/sca-java-integration/samples/sca/bigbank/docs/webclientfiles.png b/branches/sca-java-integration/samples/sca/bigbank/docs/webclientfiles.png
new file mode 100644
index 0000000000..b951ed2e5e
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/docs/webclientfiles.png
Binary files differ
diff --git a/branches/sca-java-integration/samples/sca/bigbank/docs/webclientmodule.png b/branches/sca-java-integration/samples/sca/bigbank/docs/webclientmodule.png
new file mode 100644
index 0000000000..dfd3a34bfb
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/docs/webclientmodule.png
Binary files differ
diff --git a/branches/sca-java-integration/samples/sca/bigbank/pom.xml b/branches/sca-java-integration/samples/sca/bigbank/pom.xml
new file mode 100644
index 0000000000..25eeef1ad9
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/pom.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.sampleapps</groupId>
+ <artifactId>tuscany-sampleapps</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.tuscany.samples.bigbank</groupId>
+ <artifactId>bigbank-scenario</artifactId>
+ <packaging>pom</packaging>
+ <name>Tuscany BigBank Scenario Sample</name>
+
+ <modules>
+ <module>account</module>
+ <module>webclient</module>
+ </modules>
+</project>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/readme.html b/branches/sca-java-integration/samples/sca/bigbank/readme.html
new file mode 100644
index 0000000000..b5e90bb08f
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/readme.html
@@ -0,0 +1,894 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<html>
+<head>
+<script type="text/javascript">
+function expandImage(img,height,width) {
+window.open(img,"Image","menubar=no,resizable=no,status=no,toolbar=no,location=no,height=" + height + ",width=" + width);
+}
+function goURL(url) {
+window.location = url;
+}
+</script>
+ <meta http-equiv="Content-Type" content=
+ "text/html; charset=us-ascii">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+
+ <title>Tuscany BigBank Sample Application</title>
+ <link rel="stylesheet" href="../../css/base.css" type="text/css">
+<style type="text/css" media="all">
+</style>
+</head>
+
+<body>
+
+ <h3>Tuscany BigBank Sample Application</h3>
+
+ <h4>Overview</h4>
+
+ <p>The Tuscany BigBank&nbsp;sample application&nbsp; shows using
+ the Tuscany SCA runtime to build a&nbsp; financial application.
+ There are two modules: webclient provides the front-end user
+ interface and account provides the back-end business services.
+ These are deployed as separate web applications</p>
+
+ <h4>Location</h4>
+ <p>This sample is located&nbsp;in the&nbsp;
+ <a href=".">samples\applications\bigbank</a> directory. There are two
+ subdirectories in that for the two modules <a href="account"
+ target="_blank">account</a> and <a href="webclient" target=
+ "_blank">webclient.</a></p>
+
+
+ <h4>Prerequisites</h4>
+
+ <p>Obtain the following prerequisites and install according to
+ their documentation.</p>
+
+ <ul>
+ <li><a href="http://java.sun.com/javase/downloads/index.jsp"
+ target="_blank">JDK 5.0</a></li>
+
+ <li><a href="http://maven.apache.org/download.html" target=
+ "_blank">Maven 2.0.4</a></li>
+
+ <li><a href="http://tomcat.apache.org/download-55.cgi" target=
+ "_blank">Apache Tomcat 5.xx</a> latest version binary core
+ distribution.&nbsp;</li>
+ </ul>
+
+ <h4><a name="Building" id="Building"></a>Building</h4>
+ <p>This sample
+ can be built from the bigbank directory using Maven 2.0.4 with
+ the following command:</p>
+ <p>
+ <code>&nbsp;mvn<br></code>
+ </p>
+
+ <h4>Setup</h4>
+ <p>If you have enabled remote deployment in Tomcat by
+ adding the line:<br>
+ <code>&nbsp; &lt;user username="admin" password=""
+ roles="manager"/&gt;</code><br>
+ into&nbsp; <span style="font-style: italic;">&lt;tomcat
+ dir&gt;</span>\conf\tomcat-users.xml&nbsp; you can deploy the
+ WARs to Tomcat using the tomcat-maven-plugin:<br>
+ <code>mvn tomcat:deploy</code></p>
+ <p>Alternatively you can copy the WAR files to Tomcat's&nbsp;
+ webapps directory.<br>
+
+ <code>copy account\target\sample-bigbank-account.war <span style=
+ "font-style: italic;">&lt;tomcat dir&gt;</span>\webapps</code><br>
+ <code>copy&nbsp;
+ webclient\target\sample-bigbank-webclient.war&nbsp;<span style=
+ "font-style: italic;">&lt;tomcat dir&gt;</span>\webapps</code><br>
+ </p>
+
+ <h4>Running</h4>
+ <p>Once you've started your web server, use your web
+ browser to view the following URL <a href=
+ "http://localhost:8080/sample-bigbank-webclient/" target=
+ "_blank">http://localhost:8080/sample-bigbank-webclient/</a><br>
+ You can either use an already pre configured&nbsp; account with
+ <span style="font-weight: bold;">Login</span> as <span style=
+ "color: rgb(204, 0, 0); font-weight: bold;">test</span> and
+ <span style="font-weight: bold;">Password</span> as <span style=
+ "color: rgb(204, 0, 0); font-weight: bold;">password,</span> or
+ you can &nbsp;create a new account.<br>
+ The demo is first configured to use a local mock stock quote
+ service that returns random stock data. &nbsp;If you want to use
+ an actual stock quote provider follow these steps:</p>
+
+ <ul>
+ <li>Stop your server by issuing in the&nbsp; <span style=
+ "font-style: italic;">&lt;tomcat dir&gt;</span><span style=
+ "font-weight: bold;">\bin</span> directory</li>
+
+ <li>Issue <span style="font-weight: bold;">shutdown</span>
+ command to stop your web application server<span style=
+ "font-weight: bold;">.</span></li>
+
+ <li>Edit the account SCDL file <span style=
+ "font-style: italic;">&lt;tomcat dir&gt;</span><span style=
+ "font-weight: bold;">\webapps\sample-bigbank-account\WEB-INF\default.scdl</span></li>
+
+ <li>Change the SCDL wiring to remove the mock stock quote
+ service by commenting it out as follows:<br>
+ &lt;!--<br>
+ &nbsp;&nbsp;&nbsp; &lt;component
+ name="StockQuoteServiceComponent"&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ &lt;implementation.java
+ class="bigbank.account.services.stockquote.StockQuoteServiceImpl"
+ /&gt;<br>
+ &nbsp;&nbsp;&nbsp; &lt;/component&gt;<br>
+ --&gt;</li>
+
+ <li>Uncomment the real stockquote service section in lines 68
+ to 80.<br></li>
+
+ <li>Change to the directory &nbsp;<span style=
+ "font-weight: bold;">apache-tomcat-5.5.17\bin&nbsp;</span></li>
+
+ <li>issue <span style="font-weight: bold;">startup
+ &nbsp;</span> command to start up the server in the
+ <span style="font-style: italic;">&lt;tomcat dir&gt;</span>\bin
+ directory<span style="font-weight: bold;">.</span></li>
+ </ul>
+ <p>The sample should now be using the real stock quote
+ provider.&nbsp;</p>
+
+ <h4>Summary</h4><p>This example illustrates using Tuscany runtime
+ in building a financial Web application&nbsp;using SCA programing
+ model. &nbsp;The following key concepts are covered:</p>
+
+ <ul>
+ <li><b><i>Component implementations</i></b>. that provide web
+ based&nbsp; HTML&nbsp;user interface</li>
+
+ <li><b><i>Component implementations</i></b> that provide
+ <b><i>local services</i></b> in Java. Local services implement
+ internal application business logic such as tracking user state
+ and are not exposed remotely.</li>
+
+ <li><b><i>Component implementations</i></b> that have
+ <b><i>configuration properties</i></b> and <b><i>service
+ references</i></b> to other services</li>
+
+ <li><b><i>Components</i></b> that use and
+ <b><i>configure</i></b> <b><i>the properties and
+ references</i></b> of component implementations</li>
+
+ <li><b><i>SCA Services</i></b> to publish remotable services
+ via a <b><i>Web Service binding</i></b>.</li>
+
+ <li><b><i>SCA References&nbsp;</i></b> to consume remotable
+ services via a <b><i>Web Service binding</i></b></li>
+
+ <li>Assembling implementation, components, entry points and
+ external service into composite components.</li>
+
+ <li>Creating a module and all of its artifacts as part of a
+ <b><i>web application</i></b> to show a front-end access to SCA
+ services</li>
+
+ <li>The use of Data Access services to persist and retrieve
+ Service Data Objects from Apache Derby.</li>
+
+ <li style="text-align: left;">The use of &nbsp;existing Web
+ services in&nbsp; SCA.</li>
+ </ul><p>BigBank sample provides the following user services: account
+ balance,&nbsp;making deposits and withdrawals&nbsp; to purchase
+ and sell stock, and to view current stock value.<br>
+ The sample is organized into two SCA modules: webclient and
+ account. The webclient module functionality is to provide user
+ information and obtain user input. The account module is used to
+ retrieve and store user information, account information, current
+ stock information and the purchasing and selling of stock. The
+ two modules interact via web services through SCA references and
+ services.</p>
+ <br>
+
+ <div style="text-align: center;">
+ <img style="width: 381px; height: 169px;" alt=
+ "Overview of modules." title="Overview of modules." src=
+ "docs/modualoverview.png" align="middle">
+
+ <h5>Webclient</h5><br>
+ <a href=
+ "javascript:expandImage('docs/Show.Image.html?url=webclientmodule.png',1000,1100)">
+ <img style="width: 300px; height: 200px;" alt="Webclient files"
+ title="Click to expand" src="docs/webclientmodule.png"></a><br>
+
+ <p>&nbsp;</p>
+
+ <table style="text-align: left; width: 100%;" border="0"
+ cellpadding="1" cellspacing="0" width="100%">
+ <tbody>
+ <tr>
+ <td align="left" valign="top" width="*">
+ <a href=
+ "javascript:expandImage('docs/Show.Image.html?url=webclientfiles.png',850,500)">
+ <img style="width: 262px; height: 360px;" alt=
+ "Webclient files" title="Click to expand" src=
+ "docs/webclientfiles.png"></a>&nbsp;<br>
+
+ <div style="text-align: center;">
+ <small><span style="font-style: italic;">click to
+ enlarge</span></small>
+ </div>
+ </td>
+
+ <td style="text-align: left;" align="left" valign="top"
+ width="80%">
+ <table style="text-align: left; width: 100%;" border=
+ "0" cellpadding="1" cellspacing="0">
+ <tbody>
+ <tr>
+ <td style="text-align: center;" colspan="3">
+ <span style=
+ "font-weight: bold; text-decoration: underline;">Java
+ source files implementing SCA components and
+ interfaces.</span></td>
+ </tr>
+
+ <tr>
+ <td style="width: 10%;">
+ AccountServiceComponentImpl.java</td>
+
+ <td>&nbsp;</td>
+
+ <td>Implements the account service.</td>
+ </tr>
+
+ <tr>
+ <td>AccountLoginServiceImpl.java</td>
+
+ <td></td>
+
+ <td>Implements the Login service.</td>
+ </tr>
+
+ <tr>
+ <td>LoginService.java</td>
+
+ <td></td>
+
+ <td>Interface for a services provided by a
+ login&nbsp; service component.</td>
+ </tr>
+
+ <tr>
+ <td>ProfileService.java</td>
+
+ <td></td>
+
+ <td>Interface for a service provided by a profile
+ component.</td>
+ </tr>
+
+ <tr>
+ <td>ProfileServiceImpl.java</td>
+
+ <td></td>
+
+ <td>Implements the profile component.</td>
+ </tr>
+
+ <tr>
+ <td>SimpleLoginServiceImpl.java</td>
+
+ <td></td>
+
+ <td>A simple in memory login service.</td>
+ </tr>
+
+ <tr>
+ <td style="text-align: center;" colspan="3">
+ <span style=
+ "font-weight: bold; text-decoration: underline;">Java
+ source files implementing Web HTML
+ interface.</span></td>
+ </tr>
+
+ <tr>
+ <td>AccountStatusTag.java</td>
+
+ <td></td>
+
+ <td>Implements a jsp tag that&nbsp;displays the
+ account information</td>
+ </tr>
+
+ <tr>
+ <td>StockStatusTag.java</td>
+
+ <td></td>
+
+ <td>Implements a jsp tag that displays the stock
+ information.</td>
+ </tr>
+
+ <tr>
+ <td>LoginBarrierTag.java</td>
+
+ <td></td>
+
+ <td>Implements a jsp tag that ensures the user is
+ logged in.</td>
+ </tr>
+
+ <tr>
+ <td>ServiceTag.java</td>
+
+ <td></td>
+
+ <td>Places an SCA service in the JSP page
+ context.</td>
+ </tr>
+
+ <tr>
+ <td>FormServlet.java</td>
+
+ <td></td>
+
+ <td>Process user input and uses the
+ AccountService component.</td>
+ </tr>
+
+ <tr>
+ <td>LoginServlet.java</td>
+
+ <td></td>
+
+ <td>Processes logging in and logout.</td>
+ </tr>
+
+ <tr>
+ <td style="text-align: center;" colspan="3">
+ <span style=
+ "font-weight: bold; text-decoration: underline;">Files
+ that will be loaded as resources along
+ classpath.</span></td>
+ </tr>
+
+ <tr>
+ <td>AccountService.wsdl</td>
+
+ <td></td>
+
+ <td>WSDL that &nbsp;defines the account
+ service.</td>
+ </tr>
+
+ <tr>
+ <td>bigbank-tags.tld</td>
+
+ <td></td>
+
+ <td>Defines the tag libs for the user
+ interface.</td>
+ </tr>
+
+ <tr align="center">
+ <td colspan="3"><span style=
+ "font-weight: bold; text-decoration: underline;">Files
+ located in WEB-INF directory.</span></td>
+ </tr>
+
+ <tr>
+ <td><a href="#SCDL">default.scdl</a></td>
+
+ <td></td>
+
+ <td>Application's SCA SCDL file.</td>
+ </tr>
+
+ <tr>
+ <td><a href="#Web.xml">web.xml</a></td>
+
+ <td></td>
+
+ <td>Application's web.xml file.</td>
+ </tr>
+
+ <tr align="center">
+ <td colspan="3"><span style=
+ "font-weight: bold; text-decoration: underline;">Generated
+ Files.</span></td>
+ </tr>
+
+ <tr>
+ <td>sdo source</td>
+
+ <td></td>
+
+ <td>Generated SDO. Created by <a href=
+ "#tuscany-sdo-plugin"><code><span style=
+ "font-weight: bold;">tuscany-sdo-plugin</span></code></a>
+ maven plugin.</td>
+ </tr>
+
+ <tr>
+ <td>wsdl2java-source</td>
+
+ <td></td>
+
+ <td>Generated SDO interface. Created by <a href=
+ "#tuscany-plugin-wsdl2java"><code><span style=
+ "font-weight: bold;">tuscany-plugin-wsdl2java</span></code></a>
+ maven &nbsp;plugin.</td>
+ </tr>
+
+ <tr align="center">
+ <td colspan="3"><span style=
+ "font-weight: bold; text-decoration: underline;">Build
+ files.</span></td>
+ </tr>
+
+ <tr>
+ <td><a href="#pom.xml">pom.xml</a></td>
+
+ <td></td>
+
+ <td>Maven build file.</td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p>&nbsp;</p><!-- account -->
+
+ <h5>Account</h5><br>
+ <a href=
+ "javascript:expandImage('docs/Show.Image.html?url=accountmodule.png',830,1400)">
+ <img style="width: 300px; height: 200px;" alt="Account module"
+ title="Click to expand" src="docs/accountmodule.png"></a><br>
+
+ <p>&nbsp;</p>
+
+ <table style="text-align: left; width: 100%;" border="0"
+ cellpadding="1" cellspacing="0" width="100%">
+ <tbody>
+ <tr>
+ <td align="left" valign="top" width="*">
+ <a href=
+ "javascript:expandImage('docs/Show.Image.html?url=accountfiles.png',850,500)">
+ <img style="width: 262px; height: 360px;" alt=
+ "Webclient files" title="Click to expand" src=
+ "docs/accountfiles.png"></a>&nbsp;<br>
+
+ <div style="text-align: center;">
+ <small><span style="font-style: italic;">click to
+ enlarge</span></small>
+ </div>
+ </td>
+
+ <td style="text-align: left;" align="left" valign="top"
+ width="80%">
+ <table style="text-align: left; width: 100%;" border=
+ "0" cellpadding="1" cellspacing="0">
+ <tbody>
+ <tr>
+ <td style="text-align: center;" colspan="3">
+ <span style=
+ "font-weight: bold; text-decoration: underline;">Java
+ source files implementing SCA components and
+ interfaces.</span></td>
+ </tr>
+
+ <tr>
+ <td style="width: 10%;">
+ AccountServiceImpl.java</td>
+
+ <td>&nbsp;</td>
+
+ <td>Implements the account service
+ component.</td>
+ </tr>
+
+ <tr>
+ <td>AccountDataService.java</td>
+
+ <td></td>
+
+ <td>Interface defined for component implementing
+ &nbsp;an account's data service.</td>
+ </tr>
+
+ <tr>
+ <td>AccountDataServiceDASImpl.java</td>
+
+ <td></td>
+
+ <td>A Data Access Service (DAS) implementation of
+ of the Account Data Service.</td>
+ </tr>
+
+ <tr>
+ <td>AccountDataServiceImpl.java</td>
+
+ <td></td>
+
+ <td>A Data Service implementation not using
+ DAS.</td>
+ </tr>
+
+ <tr>
+ <td>AccountDBInit.java</td>
+
+ <td></td>
+
+ <td>A utility to just create the database and it
+ table and fill in some initial data.</td>
+ </tr>
+
+ <tr>
+ <td>StockQuote.java</td>
+
+ <td></td>
+
+ <td>A class to hold the StockQuote
+ information.</td>
+ </tr>
+
+ <tr>
+ <td>StockQuoteService.java</td>
+
+ <td></td>
+
+ <td>Interface defined for a component
+ implementing a stock quote service.</td>
+ </tr>
+
+ <tr>
+ <td>StockQuoteServiceImpl.java</td>
+
+ <td></td>
+
+ <td>Implements a fake stock quote service.</td>
+ </tr>
+
+ <tr>
+ <td>StockQuoteWebservicexServiceImpl.java</td>
+
+ <td></td>
+
+ <td>Implements an actual stock quote
+ service.</td>
+ </tr>
+
+ <tr>
+ <td style="text-align: center;" colspan="3">
+ <span style=
+ "font-weight: bold; text-decoration: underline;">Files
+ that will be loaded as resources along
+ classpath.</span></td>
+ </tr>
+
+ <tr>
+ <td>AccountService.wsdl</td>
+
+ <td></td>
+
+ <td>WSDL that &nbsp;defines the account
+ service</td>
+ </tr>
+
+ <tr>
+ <td>stockquotes.webservicex.wsdl</td>
+
+ <td></td>
+
+ <td>Actual stock quote service WSDL.</td>
+ </tr>
+
+ <tr>
+ <td><a href=
+ "#DAS_">DasAccountConfiguration.xml</a></td>
+
+ <td></td>
+
+ <td>Provides any needed configuration info
+ including datasource properties, table
+ definitions,</td>
+ </tr>
+
+ <tr align="center">
+ <td colspan="3"><span style=
+ "font-weight: bold; text-decoration: underline;">Files
+ located in WEB-INF directory.</span></td>
+ </tr>
+
+ <tr>
+ <td><a href="#SCDL">default.scdl</a></td>
+
+ <td></td>
+
+ <td>Application's SCA SCDL file.</td>
+ </tr>
+
+ <tr>
+ <td><a href="#Web.xml">web.xml</a></td>
+
+ <td></td>
+
+ <td>Application's web.xml file.</td>
+ </tr>
+
+ <tr align="center">
+ <td colspan="3"><span style=
+ "font-weight: bold; text-decoration: underline;">Generated
+ Files.</span></td>
+ </tr>
+
+ <tr>
+ <td>sdo source</td>
+
+ <td></td>
+
+ <td>Generated SDO. Created by&nbsp;<a href=
+ "#tuscany-sdo-plugin"><code><span style=
+ "font-weight: bold;">tuscany-sdo-plugin</span></code></a>
+ maven plugin.</td>
+ </tr>
+
+ <tr>
+ <td>wsdl2java-source</td>
+
+ <td></td>
+
+ <td>Generated SDO interface. Created
+ by&nbsp;<a href=
+ "#tuscany-plugin-wsdl2java"><code><span style=
+ "font-weight: bold;">tuscany-plugin-wsdl2java</span></code></a>
+ maven &nbsp;plugin.</td>
+ </tr>
+
+ <tr align="center">
+ <td colspan="3"><span style=
+ "font-weight: bold; text-decoration: underline;">Build
+ files.</span></td>
+ </tr>
+
+ <tr>
+ <td><a href="#pom.xml">pom.xml</a></td>
+
+ <td></td>
+
+ <td>Maven build file.</td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div><br>
+ <br>
+
+
+ <h5><a name="pom.xml" id="pom.xml"></a>Pom.xml</h5>
+ <p>The directions
+ for maven&nbsp; how&nbsp; to build the each module is located in
+ each module's directory in the&nbsp;pom.xml file. &nbsp;The
+ application uses Java 1.5 and thus in the build &nbsp;plugin
+ section needs the following compiler directives:</p>
+ &nbsp;&nbsp;<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ &lt;plugin&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ &lt;configuration&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ &lt;source&gt;<span style=
+ "color: rgb(255, 0, 0); font-weight: bold;">1.5</span>&lt;/source&gt;<br>
+
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ &lt;target&gt;<span style=
+ "color: rgb(255, 0, 0); font-weight: bold;">1.5</span>&lt;/target&gt;<br>
+
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ &lt;/configuration&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ &lt;/plugin&gt;</code><br>
+ <p>Both webclient and account uses three maven
+ plugins:&nbsp;<code style=
+ "font-weight: bold;">tuscany-sdo-plugin</code>,&nbsp;<code style=
+ "font-weight: bold;">tuscany-plugin-wsdl2java</code>,
+ and&nbsp;<code style=
+ "font-weight: bold;">tuscany-war-plugin</code>.
+ The&nbsp;tuscany-sdo-plugin is provided by Tuscany 's SDO project
+ while the other two are provided by the Tuscany SCA project.</p>
+ <p>The <code style="font-weight: bold;"><a name="tuscany-sdo-plugin"
+ id="tuscany-sdo-plugin"></a>tuscany-sdo-plugin</code>
+ &nbsp;references the WSDL's schema and generates all the files
+ located in target/sdo_source directory. &nbsp;The application
+ uses these classes as a databinding instead of having to deal
+ directly with XML that &nbsp;represents form as defined in the
+ WSDL's schema.</p>
+ <p>The <code style="font-weight: bold;"><a name=
+ "tuscany-plugin-wsdl2java" id=
+ "tuscany-plugin-wsdl2java"></a>tuscany-plugin-wsdl2java</code>
+ plugin generates a Java interface in the target/wsdl2java-source
+ directory that is used to define the inteface (prottype) in the
+ wsdl.</p>
+ <p>The <code style="font-weight: bold;">tuscany-war-plugin</code> is
+ used to add both the Tuscany runtime and any Tuscany&nbsp;
+ extensions required by the application in the war file.. Looking
+ at the pom.xml and search for &nbsp;"<code style=
+ "font-weight: bold;">tuscany-war-plugin"</code> you'll find the
+ plugin. &nbsp;Which extension you want loaded are specified in
+ the <code><span style=
+ "font-weight: bold;">extensions</span></code> section. The format
+ for this&nbsp; closely follows Maven's artifact naming. &nbsp;The
+ boolean <code><span style=
+ "font-weight: bold;">loadExtensionDependencies</span></code>
+ option if true will &nbsp;resolve all dependencies for each
+ extension listed here and also include them in the war file.
+ &nbsp;<br>
+ <br>
+
+ <h4>Application</h4>
+
+ <h5><a name="Web.xml" id="Web.xml"></a>Web.xml</h5><p>The web.xml
+ file in each module adds necessary "hooks" to initiate and
+ maintain the Tuscany SCA runtime in a web application host.<br>
+ &nbsp;</p>
+
+ <table style="text-align: left; width: 100%;" border="1"
+ cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td>
+ <pre>
+<small>&lt;listener&gt;<br>
+&lt;listener-class&gt;org.apache.tuscany.runtime.webapp.TuscanyContextListener&lt;/listener-class&gt;<br>
+&lt;/listener&gt;</small>
+</pre>
+ </td>
+
+ <td>This class initializes the Tuscany runtime when the
+ applications is started and helps finalize the Tuscany
+ runtime when the application has ended.</td>
+ </tr>
+
+ <tr>
+ <td>
+ <pre>
+<small>&lt;servlet&gt;<br>
+&lt;servlet-name&gt;TuscanyServlet&lt;/servlet-name&gt;<br>
+&lt;display-name&gt;Tuscany Servlet&lt;/display-name&gt;<br>
+&lt;servlet-class&gt;org.apache.tuscany.runtime.webapp.TuscanyServlet&lt;/servlet-class&gt;<br>
+&lt;/servlet&gt;</small>
+</pre>
+ </td>
+
+ <td>This class provides the web applications servlet
+ interface to SCA components. &nbsp;The Axis websevices
+ binding extension requires this.</td>
+ </tr>
+
+ <tr>
+ <td>
+ <pre>
+<small>&lt;listener&gt;<br>
+&lt;listener-class&gt;org.apache.tuscany.runtime.webapp.TuscanySessionListener&lt;/listener-class&gt;<br>
+&lt;/listener&gt;</small>
+</pre>
+ </td>
+
+ <td>This listener helps provide SCA session support .</td>
+ </tr>
+ </tbody>
+ </table><br>
+ <p>The web application can be run in offline or online when
+ resolving dependencies required by the application or it's
+ required extensions. This is configured in the web.xml with the
+ context-param element with a parameter name <code><span style=
+ "font-weight: bold;">tuscany.online</span></code>. If&nbsp; not
+ specified or set to true, dependencies are resolved by searching
+ the local war repository, the local Maven repository, and remote
+ repositories. If specified and set to false, the remote
+ repositories will not be searched.</p>
+
+ <h5><a name="SCDL" id="SCDL"></a>SCDL</h5>
+ <p>Each module's SCA
+ application SCDL is located in the web application&nbsp;
+ WEB-INF/default.scdl file. &nbsp;This is the default location,
+ but within the web.xml it is possible to override this with a
+ context-param element &nbsp;with the name <code><span style=
+ "font-weight: bold;">tuscany.applicationScdlPath</span></code>.
+ &nbsp;The Tuscany System SCDL can also be overridden with another
+ context-param element with the name <code><span style=
+ "font-weight: bold;">tuscany.systemScdlPath</span></code>.<br>
+ The SCDL&nbsp; used by the BigBank application is defined by
+ <a href=
+ "http://www.osoa.org/download/attachments/35/SCA_AssemblyModel_V096.pdf?version=1"
+ target="_blank">SCA Assembly Model V0.96</a> , <a href=
+ "http://www.osoa.org/download/attachments/35/SCA_ClientAndImplementationModelforJava_v0.95.pdf?version=3"
+ target="_blank">SCA Client and Implementation Model for Java
+ (V0.95)</a> &nbsp;and the <a href=
+ "http://www.osoa.org/download/attachments/35/SCA_WebServiceBindings_V096-draft1.pdf?version=3"
+ target="_blank">SCA Web Service bindings</a> specifications.<br>
+ There is one extension to SCDL used by BigBank that is specific
+ to Tuscany that is used by SDO databinding extension.
+ &nbsp;The&nbsp;<code>import.sdo</code> element in the SCDL
+ specifies which&nbsp; SDO factories to register the SDO types.
+ &nbsp;In the case of BigBank the factory is the class generated
+ by the&nbsp;<code style=
+ "font-weight: bold;">tuscany-sdo-plugin</code> maven plugin. An
+ example of this follows:</p>
+ <pre>
+ <code>&lt;dbsdo:import.sdo xmlns:dbsdo="http://incubator.apache.org/tuscany/xmlns/databinding/sdo/1.0-incubator-M2"
+factory="com.bigbank.account.AccountFactory"/&gt; <br>
+</code>
+</pre>
+
+ <h5>Code</h5><p>The Java code for the most part just implements the
+ Web interface and the SCA components necessary to implement the
+ business logic. The code uses Java 5.0 annotations as documented
+ by the <a href=
+ "http://www.osoa.org/download/attachments/35/SCA_ClientAndImplementationModelforJava_v0.95.pdf?version=3"
+ target="_blank">SCA Client and Implementation Model for Java
+ (V0.95)</a> specifications. The samples uses one annotation that
+ is an Tuscany extension that is used by the databinding framework
+ to identify that the components expect to SDO s for complex data
+ types. An example of this is seen in the AccountService interface
+ which has the <code style=
+ "font-weight: bold;">@DataType(name="commonj.sdo.DataObject")</code>
+ annotation.</p>
+
+ <h4><a name="DAS_" id="DAS_"></a><span style=
+ "font-family: monospace;">RDB DAS</span></h4>
+
+ <p>The Relational Database DAS (RDB DAS) is used in this sample to access relational data in terms
+ of SDOs. All the code pertaining to this usage is contained to two one files:
+ AccountDataServiceDASImpl.java and DasAccountConfiguration.xml. The java file provides code that
+ instantiates and invokes the DAS and the XML file provides RDB DAS configuration.</p>
+
+ <p>The sample demonstrates a few of the RDB DAS capabilities including:</p>
+
+ <ul>
+
+ <li>reading a graph of SDOs based on a select query provided inline </li>
+ <li>reading a graph of SDOs based on a named select query defined in the config file </li>
+ <li>executing a named command to manually insert data</li>
+ <li>leveraging SDO Change Summary to by utilizing the DAS "applyChanges" method to flush graph modifications </li>
+ <li>utilizing the DAS column-converter framework </li>
+ <li>using the column/property name mapping (aliasing)</li>
+
+ </ul>
+
+ <p>This sample does not currently demonstrate a few other key DAS features including Object relationships, optimistic
+ concurrency control, and the use of convention over configuration. User level documentation for the RDB DAS can
+ be found in the <a href=
+ "http://wiki.apache.org/ws/Tuscany/TuscanyJava/DAS_Java_Overview/RDBDAS_Java_User_Guide"target="_blank">RDBDAS User's Guide</a>.
+ </p>
+ <p>This sample uses the RDB DAS as a utility. A future version of this sample will access the DAS as an SCA service.
+ </p>
+
+</body>
+</html>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/.pmd b/branches/sca-java-integration/samples/sca/bigbank/webclient/.pmd
new file mode 100644
index 0000000000..ffc4fe2bbb
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/.pmd
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<pmd><useProjectRuleSet>true</useProjectRuleSet><rules/></pmd>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/.ruleset b/branches/sca-java-integration/samples/sca/bigbank/webclient/.ruleset
new file mode 100644
index 0000000000..ba9b5ce886
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/.ruleset
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<ruleset name="pmd-eclipse">
+ <description>PMD Plugin preferences rule set</description>
+
+
+ <rule ref="rulesets/basic.xml/BooleanInstantiation"/>
+ <rule ref="rulesets/basic.xml/CollapsibleIfStatements"/>
+ <rule ref="rulesets/basic.xml/DoubleCheckedLocking"/>
+<!--<rule ref="rulesets/basic.xml/EmptyCatchBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyFinallyBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyIfStmt"/>-->
+ <rule ref="rulesets/basic.xml/EmptyStatementNotInLoop"/>
+<!--<rule ref="rulesets/basic.xml/EmptyStaticInitializer"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptySwitchStatements"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptySynchronizedBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyTryBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyWhileStmt"/>-->
+ <rule ref="rulesets/basic.xml/ForLoopShouldBeWhileLoop"/>
+ <rule ref="rulesets/basic.xml/JumbledIncrementer"/>
+<!--<rule ref="rulesets/basic.xml/OverrideBothEqualsAndHashcode"/>-->
+ <rule ref="rulesets/basic.xml/ReturnFromFinallyBlock"/>
+ <rule ref="rulesets/basic.xml/UnconditionalIfStatement"/>
+ <rule ref="rulesets/basic.xml/UnnecessaryConversionTemporary"/>
+ <rule ref="rulesets/basic.xml/UnnecessaryFinalModifier"/>
+ <rule ref="rulesets/basic.xml/UnnecessaryReturn"/>
+<!--<rule ref="rulesets/basic.xml/UselessOverridingMethod"/>-->
+
+<!--<rule ref="rulesets/braces.xml/ForLoopsMustUseBraces"/>-->
+<!--<rule ref="rulesets/braces.xml/IfElseStmtsMustUseBraces"/>-->
+<!--<rule ref="rulesets/braces.xml/IfStmtsMustUseBraces"/>-->
+<!--<rule ref="rulesets/braces.xml/WhileLoopsMustUseBraces"/>-->
+
+<!--<rule ref="rulesets/clone.xml/CloneMethodMustImplementCloneable"/>-->
+<!--<rule ref="rulesets/clone.xml/CloneThrowsCloneNotSupportedException"/>-->
+<!--<rule ref="rulesets/clone.xml/ProperCloneImplementation"/>-->
+
+<!--<rule ref="rulesets/codesize.xml/CyclomaticComplexity"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessiveClassLength"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessiveMethodLength"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessiveParameterList"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessivePublicCount"/>-->
+<!--<rule ref="rulesets/codesize.xml/TooManyFields"/>-->
+
+<rule ref="rulesets/controversial.xml/AssignmentInOperand"/>
+<!--<rule ref="rulesets/controversial.xml/AtLeastOneConstructor"/>-->
+<!--<rule ref="rulesets/controversial.xml/CallSuperInConstructor"/>-->
+<!--<rule ref="rulesets/controversial.xml/DontImportSun"/>-->
+<!--<rule ref="rulesets/controversial.xml/NullAssignment"/>-->
+<!--<rule ref="rulesets/controversial.xml/OnlyOneReturn"/>-->
+<!--<rule ref="rulesets/controversial.xml/SingularField"/>-->
+<!--<rule ref="rulesets/controversial.xml/SuspiciousOctalEscape"/>-->
+<!--<rule ref="rulesets/controversial.xml/UnnecessaryConstructor"/>-->
+<rule ref="rulesets/controversial.xml/UnnecessaryParentheses"/>
+<!--<rule ref="rulesets/controversial.xml/UnusedModifier"/>-->
+
+<!--<rule ref="rulesets/coupling.xml/CouplingBetweenObjects"/>-->
+<!--<rule ref="rulesets/coupling.xml/ExcessiveImports"/>-->
+<!--<rule ref="rulesets/coupling.xml/LooseCoupling"/>-->
+
+<!--<rule ref="rulesets/design.xml/AbstractClassWithoutAbstractMethod"/>-->
+<!--<rule ref="rulesets/design.xml/AccessorClassGeneration"/>-->
+<!--<rule ref="rulesets/design.xml/AssignmentToNonFinalStatic"/>-->
+<!--<rule ref="rulesets/design.xml/AvoidDeeplyNestedIfStmts"/>-->
+<!--<rule ref="rulesets/design.xml/AvoidInstanceofChecksInCatchClause"/>-->
+<rule ref="rulesets/design.xml/AvoidProtectedFieldInFinalClass"/>
+<!--<rule ref="rulesets/design.xml/AvoidReassigningParameters"/>-->
+<!--<rule ref="rulesets/design.xml/AvoidSynchronizedAtMethodLevel"/>-->
+<!--<rule ref="rulesets/design.xml/BadComparison"/>-->
+<!--<rule ref="rulesets/design.xml/CloseConnection"/>-->
+<!--<rule ref="rulesets/design.xml/CompareObjectsWithEquals"/>-->
+<!--<rule ref="rulesets/design.xml/ConfusingTernary"/>-->
+<rule ref="rulesets/design.xml/ConstructorCallsOverridableMethod"/>
+<!--<rule ref="rulesets/design.xml/DefaultLabelNotLastInSwitchStmt"/>-->
+<!--<rule ref="rulesets/design.xml/FinalFieldCouldBeStatic"/>-->
+<rule ref="rulesets/design.xml/IdempotentOperations"/>
+<!--<rule ref="rulesets/design.xml/ImmutableField"/>-->
+<!--<rule ref="rulesets/design.xml/InstantiationToGetClass"/>-->
+<!--<rule ref="rulesets/design.xml/MissingBreakInSwitch"/>-->
+<!--<rule ref="rulesets/design.xml/MissingStaticMethodInNonInstantiatableClass"/>-->
+<!--<rule ref="rulesets/design.xml/NonCaseLabelInSwitchStatement"/>-->
+<!--<rule ref="rulesets/design.xml/NonStaticInitializer"/>-->
+<rule ref="rulesets/design.xml/OptimizableToArrayCall"/>
+<rule ref="rulesets/design.xml/PositionLiteralsFirstInComparisons"/>
+<rule ref="rulesets/design.xml/SimplifyBooleanExpressions"/>
+<rule ref="rulesets/design.xml/SimplifyBooleanReturns"/>
+<rule ref="rulesets/design.xml/SimplifyConditional"/>
+<!--<rule ref="rulesets/design.xml/SwitchDensity"/>-->
+<!--<rule ref="rulesets/design.xml/SwitchStmtsShouldHaveDefault"/>-->
+<!--<rule ref="rulesets/design.xml/UnnecessaryLocalBeforeReturn"/>-->
+<!--<rule ref="rulesets/design.xml/UseLocaleWithCaseConversions"/>-->
+<!--<rule ref="rulesets/design.xml/UseNotifyAllInsteadOfNotify"/>-->
+<!--<rule ref="rulesets/design.xml/UseSingleton"/>-->
+
+<!--<rule ref="rulesets/finalizers.xml/EmptyFinalizer"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeOnlyCallsSuperFinalize"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeOverloaded"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeDoesNotCallSuperFinalize"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeShouldBeProtected"/>-->
+<!--<rule ref="rulesets/finalizers.xml/AvoidCallingFinalize"/>-->
+
+<!--<rule ref="rulesets/imports.xml/DuplicateImports"/>-->
+<!--<rule ref="rulesets/imports.xml/DontImportJavaLang"/>-->
+<!--<rule ref="rulesets/imports.xml/UnusedImports"/>-->
+<!--<rule ref="rulesets/imports.xml/ImportFromSamePackage"/>-->
+
+<!--<rule ref="rulesets/javabeans.xml/BeanMembersShouldSerialize"/>-->
+<!--<rule ref="rulesets/javabeans.xml/MissingSerialVersionUID"/>-->
+
+<!--<rule ref="rulesets/junit.xml/JUnitStaticSuite"/>-->
+<!--<rule ref="rulesets/junit.xml/JUnitSpelling"/>-->
+<!--<rule ref="rulesets/junit.xml/JUnitAssertionsShouldIncludeMessage"/>-->
+<!--<rule ref="rulesets/junit.xml/JUnitTestsShouldIncludeAssert"/>-->
+<!--<rule ref="rulesets/junit.xml/TestClassWithoutTestCases"/>-->
+<!--<rule ref="rulesets/junit.xml/UnnecessaryBooleanAssertion"/>-->
+<!--<rule ref="rulesets/junit.xml/UseAssertEqualsInsteadOfAssertTrue"/>-->
+<!--<rule ref="rulesets/junit.xml/UseAssertSameInsteadOfAssertTrue"/>-->
+
+ <!--<rule ref="rulesets/logging-java.xml/AvoidPrintStackTrace"/>-->
+ <!--<rule ref="rulesets/logging-java.xml/LoggerIsNotStaticFinal"/>-->
+ <!--<rule ref="rulesets/logging-java.xml/MoreThanOneLogger"/>-->
+ <!--<rule ref="rulesets/logging-java.xml/LoggerIsNotStaticFinal"/>-->
+ <!--<rule ref="rulesets/logging-java.xml/LogBlockWithoutIf"/>-->
+ <!--<rule ref="rulesets/logging-java.xml/SystemPrintln"/>-->
+ <!--<rule ref="rulesets/logging-jakarta-commons.xml/UseCorrectExceptionLogging"/>-->
+ <!--<rule ref="rulesets/logging-jakarta-commons.xml/ProperLogger"/>-->
+
+ <!--<rule ref="rulesets/naming.xml/ShortVariable"/>-->
+ <!--<rule ref="rulesets/naming.xml/LongVariable"/>-->
+ <!--<rule ref="rulesets/naming.xml/ShortMethodName"/>-->
+ <!--<rule ref="rulesets/naming.xml/VariableNamingConventions"/>-->
+ <!--<rule ref="rulesets/naming.xml/MethodNamingConventions"/>-->
+ <!--<rule ref="rulesets/naming.xml/ClassNamingConventions"/>-->
+ <!--<rule ref="rulesets/naming.xml/AbstractNaming"/>-->
+ <!--<rule ref="rulesets/naming.xml/AvoidDollarSigns"/>-->
+ <!--<rule ref="rulesets/naming.xml/MethodWithSameNameAsEnclosingClass"/>-->
+ <!--<rule ref="rulesets/naming.xml/SuspiciousHashcodeMethodName"/>-->
+ <!--<rule ref="rulesets/naming.xml/SuspiciousConstantFieldName"/>-->
+ <!--<rule ref="rulesets/naming.xml/AvoidFieldNameMatchingTypeName"/>-->
+ <!--<rule ref="rulesets/naming.xml/AvoidFieldNameMatchingMethodName"/>-->
+ <!--<rule ref="rulesets/naming.xml/AvoidNonConstructorMethodsWithClassName"/>-->
+ <!--<rule ref="rulesets/naming.xml/NoPackage"/>-->
+ <!--<rule ref="rulesets/naming.xml/PackageCase"/>-->
+
+ <!--<rule ref="rulesets/optimizations.xml/LocalVariableCouldBeFinal"/>-->
+ <!--<rule ref="rulesets/optimizations.xml/MethodArgumentCouldBeFinal"/>-->
+ <!--<rule ref="rulesets/optimizations.xml/AvoidInstantiatingObjectsInLoops"/>-->
+ <!--<rule ref="rulesets/optimizations.xml/UseArrayListInsteadOfVector"/>-->
+ <!--<rule ref="rulesets/optimizations.xml/SimplifyStartsWith"/>-->
+ <!--<rule ref="rulesets/optimizations.xml/UseStringBufferForStringAppends"/>-->
+
+ <!--<rule ref="rulesets/strictexception.xml/AvoidCatchingThrowable"/>-->
+ <!--<rule ref="rulesets/strictexception.xml/SignatureDeclareThrowsException"/>-->
+ <!--<rule ref="rulesets/strictexception.xml/ExceptionAsFlowControl"/>-->
+ <!--<rule ref="rulesets/strictexception.xml/AvoidCatchingNPE"/>-->
+ <!--<rule ref="rulesets/strictexception.xml/AvoidThrowingRawExceptionTypes"/>-->
+ <!--<rule ref="rulesets/strictexception.xml/AvoidThrowingNullPointerException"/>-->
+
+ <!--<rule ref="rulesets/strings.xml/AvoidDuplicateLiterals"/>-->
+ <!--<rule ref="rulesets/strings.xml/StringInstantiation"/>-->
+ <!--<rule ref="rulesets/strings.xml/StringToString"/>-->
+ <!--<rule ref="rulesets/strings.xml/AvoidConcatenatingNonLiteralsInStringBuffer"/>-->
+ <!--<rule ref="rulesets/strings.xml/UnnecessaryCaseChange"/>-->
+
+ <!--<rule ref="rulesets/sunsecure.xml/MethodReturnsInternalArray"/>-->
+ <!--<rule ref="rulesets/sunsecure.xml/ArrayIsStoredDirectly"/>-->
+
+ <rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"/>
+ <rule ref="rulesets/unusedcode.xml/UnusedPrivateField"/>
+ <rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod"/>
+ <!--<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter"/>-->
+
+</ruleset>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/LICENSE.txt b/branches/sca-java-integration/samples/sca/bigbank/webclient/LICENSE.txt
new file mode 100644
index 0000000000..517cda22ca
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/LICENSE.txt
@@ -0,0 +1,416 @@
+
+ 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.
+
+===============================================================================================================
+
+
+License for the Service Data Objects JavaDoc and Interface Definition files.
+
+Permission to copy, make derivative works of, and distribute the Service Data Objects
+JavaDoc and Interface Definition Files files in any medium without fee or royalty as part
+of a compliant implementation of the Service Data Objects Specification is hereby granted.
+The Service Data Objects Specification may be found at any of the following locations:
+
+http://dev2dev.bea.com/technologies/commonj/index.jsp
+http://www.ibm.com/developerworks/library/specification/ws-sdo/
+http://oracle.com/technology/webservices/sca
+https://www.sdn.sap.com/
+http://www.xcalia/xdn/specs/sdo
+
+THE SERVICE DATA OBJECTS SPECIFICATION AND THE JAVADOC AND INTERFACE DEFINITION FILES
+ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS
+SPECIFICATION OR THE JAVADOC AND INTERFACE DEFINITION FILES AND THE IMPLEMENTATION OF THEIR CONTENTS,
+INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+NON-INFRINGEMENT OR TITLE. THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
+INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY USE OR DISTRIBUTION OF THE
+SERVICE DATA OBJECTS SPECIFICATION OR THE JAVADOC OR INTERFACE DEFINTION FILES.
+
+The name and trademarks of the Authors may NOT be used in any manner, including advertising or
+publicity pertaining to the Service Component Architecture Specification or its contents without specific,
+written prior permission. Title to copyright in the Service Data Objects Specification and the
+JavaDoc and Interface Definition Files will at all times remain with the Authors.
+
+No other rights are granted by implication, estoppel or otherwise.
+
+=================================================================================================================
+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.
+
+===================================================================================================
+
+Common Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+ a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+ b) in the case of each subsequent Contributor:
+
+ i) changes to the Program, and
+
+ ii) additions to the Program;
+
+ where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+ a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+
+ b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+
+ c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+
+ d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+ a) it complies with the terms and conditions of this Agreement; and
+
+ b) its license agreement:
+
+ i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+
+ ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+
+ iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+
+ iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+ a) it must be made available under this Agreement; and
+
+ b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
+
+
+
+
+
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/NOTICE.txt b/branches/sca-java-integration/samples/sca/bigbank/webclient/NOTICE.txt
new file mode 100644
index 0000000000..e445fc9ae5
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/NOTICE.txt
@@ -0,0 +1,32 @@
+Apache Tuscany SCA for Java
+Copyright 2006 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+Apache Tuscany is an effort undergoing incubation at The Apache Software Foundation (ASF),
+sponsored by the Apache Web Services PMC. Incubation is required of all newly accepted
+projects until a further review indicates that the infrastructure, communications,
+and decision making process have stabilized in a manner consistent with other successful
+ASF projects. While incubation status is not necessarily a reflection of the completeness
+or stability of the code, it does indicate that the project has yet to be fully endorsed
+by the ASF.
+
+Unless otherwise indicated, all distribution made available by the Apache Software Foundation
+is provided to you under the terms and conditions of the Apache License Version 2.0 ("AL").
+A copy of the AL is provided with this distribution as the LICENSE.txt file present in the
+root directory, and is also available at http://www.apache.org/licenses/.
+
+The terms and conditions governing the distribution may refer to the AL or other license
+agreements, notices or terms and conditions. Some of these other license agreements may
+include (but are not limited to):
+
+ . Eclipse Public License Version 1.0 (available at http://www.eclipse.org/legal/epl-v10.html)
+ . Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)
+
+This product also includes software developed by:
+- the Eclipse Modeling Framework project (http://www.eclipse.org/emf/)
+
+It is your obligation to read and accept all such terms and conditions prior to use of the
+distribution. If term or condition is provided, please contact the Apache Software Foundation
+to determine what terms and conditions govern that particular distribution.
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/pom.xml b/branches/sca-java-integration/samples/sca/bigbank/webclient/pom.xml
new file mode 100644
index 0000000000..8336eb4240
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/pom.xml
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.samples.bigbank</groupId>
+ <artifactId>bigbank-scenario</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>sample-bigbank-webclient</artifactId>
+ <packaging>war</packaging>
+ <name>Tuscany BigBank Web Client Module</name>
+ <description>BigBank Scenario Sample - Web Front-End Module</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-api</artifactId>
+ <version>${scaKernelVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commonj</groupId>
+ <artifactId>sdo-api-r2.1</artifactId>
+ <version>${sdo.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ <!-- SDO's XMLStreamHelper requires StAX API and impl (it's not pulled by
+ tuscany-sdo-impl because the maven dependency scope is provided -->
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>1.0.1</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>3.2.0</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-impl</artifactId>
+ <version>${sdo.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.runtime.webapp</groupId>
+ <artifactId>webapp-api</artifactId>
+ <version>${scaKernelVersion}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-plugin</artifactId>
+ <version>${sdo.version}</version>
+ <executions>
+ <execution>
+ <configuration>
+ <schemaFile>${basedir}/src/main/resources/wsdl/AccountService.wsdl</schemaFile>
+ <noNotification>true</noNotification>
+ <noContainer>true</noContainer>
+ <noUnsettable>true</noUnsettable>
+ </configuration>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.tuscany.sca.extensions.axis2.plugins</groupId>
+ <artifactId>tuscany-plugin-wsdl2java</artifactId>
+ <version>${scaKernelVersion}</version>
+ <executions>
+ <execution>
+ <configuration>
+ <wsdlFile>${basedir}/src/main/resources/wsdl/AccountService.wsdl</wsdlFile>
+ </configuration>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.tuscany.sca.runtime.webapp</groupId>
+ <artifactId>tuscany-war-plugin</artifactId>
+ <version>${scaKernelVersion}</version>
+ <executions>
+ <execution>
+ <id>tuscany-war</id>
+ <goals>
+ <goal>tuscany-war</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <!-- Set to true to embed external jars for extensions in the WAR -->
+ <!-- Set to false to leave external jars for extensions to be resolved from maven repository -->
+ <loadExtensionDependencies>false</loadExtensionDependencies>
+
+ <extensions>
+ <dependency>
+ <groupId>org.apache.tuscany.sca.services.databinding</groupId>
+ <artifactId>databinding-sdo</artifactId>
+ <version>${scaKernelVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca.extensions.axis2</groupId>
+ <artifactId>tuscany-axis2</artifactId>
+ <version>${scaKernelVersion}</version>
+ </dependency>
+
+ </extensions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/account/AccountServiceComponentImpl.java b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/account/AccountServiceComponentImpl.java
new file mode 100644
index 0000000000..a0f98f14f3
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/account/AccountServiceComponentImpl.java
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.webclient.services.account;
+
+import java.rmi.RemoteException;
+
+import org.osoa.sca.ServiceUnavailableException;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+import com.bigbank.account.AccountLog;
+import com.bigbank.account.AccountReport;
+import com.bigbank.account.AccountService;
+import com.bigbank.account.CustomerProfileData;
+import com.bigbank.account.StockSummary;
+
+/**
+ */
+@Service(AccountService.class)
+public class AccountServiceComponentImpl implements AccountService {
+
+ private AccountService accountService;
+
+ @Reference
+ public void setAccountService(AccountService accountService) {
+ this.accountService = accountService;
+ }
+
+ /**
+ *
+ */
+ public AccountServiceComponentImpl() {
+ super();
+ }
+
+ /**
+ * @see bigbank.account.services.account.AccountService#getAccountReport(java.lang.String)
+ */
+ public AccountReport getAccountReport(int customerID) {
+ try {
+ return accountService.getAccountReport(customerID);
+ } catch (Exception e) {
+ throw new ServiceUnavailableException(e);
+ }
+ }
+
+ public StockSummary purchaseStock(int customerID, StockSummary stockSummary) throws RemoteException {
+ try {
+ return accountService.purchaseStock(customerID, stockSummary);
+ } catch (Exception e) {
+ throw new ServiceUnavailableException(e);
+ }
+ }
+
+ public CustomerProfileData getCustomerProfile(String param2) throws RemoteException {
+ try {
+ return accountService.getCustomerProfile(param2);
+ } catch (Exception e) {
+ throw new ServiceUnavailableException(e);
+ }
+ }
+
+ public float deposit(String account, float amount) throws RemoteException {
+ try {
+ return accountService.deposit(account, amount);
+ } catch (Exception e) {
+ throw new ServiceUnavailableException(e);
+ }
+ }
+
+ public StockSummary sellStock(int purchaseLotNumber, int quantity) throws RemoteException {
+ try {
+ return accountService.sellStock(purchaseLotNumber, quantity);
+ } catch (Exception e) {
+ throw new ServiceUnavailableException(e);
+ }
+ }
+
+ public float withdraw(String account, float amount) throws RemoteException {
+ try {
+ return accountService.withdraw(account, amount);
+ } catch (Exception e) {
+ throw new ServiceUnavailableException(e);
+ }
+ }
+
+ public CustomerProfileData createAccount(CustomerProfileData customerProfile, boolean createSavings, boolean createCheckings)
+ throws RemoteException {
+
+ return accountService.createAccount(customerProfile, createSavings, createCheckings);
+ }
+
+ public AccountLog getAccountLog(int customerID) throws RemoteException {
+ try {
+ return accountService.getAccountLog(customerID);
+ } catch (Exception e) {
+ throw new ServiceUnavailableException(e);
+ }
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/AccountLoginServiceImpl.java b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/AccountLoginServiceImpl.java
new file mode 100644
index 0000000000..d6c40e8dda
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/AccountLoginServiceImpl.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank.webclient.services.profile;
+
+import java.rmi.RemoteException;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+import com.bigbank.account.AccountService;
+import com.bigbank.account.CustomerProfileData;
+
+@Service(LoginService.class)
+@Scope("COMPOSITE")
+public class AccountLoginServiceImpl implements LoginService {
+
+ public AccountService accountService;
+
+ @Reference
+ public void setAccountService(AccountService accountService) {
+ this.accountService = accountService;
+ }
+
+ public ProfileService profileService;
+
+ @Reference
+ public void setProfileService(ProfileService profileService) {
+ this.profileService = profileService;
+ }
+
+ public int login(String userName, String password) throws RemoteException {
+
+ CustomerProfileData profileData = accountService.getCustomerProfile(userName);
+
+ if (!password.equals(profileData.getPassword())) {
+ return INVALID_PASSWORD;
+ }
+
+ profileService.setLoggedIn(true);
+ profileService.setFirstName(profileData.getFirstName());
+ profileService.setLastName(profileData.getLastName());
+ profileService.setId(profileData.getId());
+
+ return SUCCESS;
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/LoginService.java b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/LoginService.java
new file mode 100644
index 0000000000..c688df2597
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/LoginService.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank.webclient.services.profile;
+
+import java.rmi.RemoteException;
+
+import org.apache.tuscany.api.annotation.DataType;
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface LoginService {
+
+ static final int SUCCESS = 1;
+
+ static final int INVALID_LOGIN = -1;
+
+ static final int INVALID_PASSWORD = -2;
+
+ int login(String userName, String password) throws RemoteException;
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/ProfileService.java b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/ProfileService.java
new file mode 100644
index 0000000000..551d80c935
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/ProfileService.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 bigbank.webclient.services.profile;
+
+import org.apache.tuscany.api.annotation.DataType;
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface ProfileService {
+
+ String getFirstName();
+
+ void setFirstName(String pName);
+
+ String getLastName();
+
+ void setLastName(String pName);
+
+ boolean isLoggedIn();
+
+ void setLoggedIn(boolean pStatus);
+
+ int getId();
+
+ void setId(int pId);
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/ProfileServiceImpl.java b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/ProfileServiceImpl.java
new file mode 100644
index 0000000000..5385a7c3fc
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/ProfileServiceImpl.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank.webclient.services.profile;
+
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+@Service(ProfileService.class)
+@Scope("SESSION")
+public class ProfileServiceImpl implements ProfileService {
+
+ private String firstName;
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ @Property
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ private String lastName;
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ private boolean loggedIn;
+
+ public boolean isLoggedIn() {
+ return loggedIn;
+ }
+
+ public void setLoggedIn(boolean status) {
+ loggedIn = status;
+ }
+
+ private int id;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/SimpleLoginServiceImpl.java b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/SimpleLoginServiceImpl.java
new file mode 100644
index 0000000000..711c6ba0b9
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/SimpleLoginServiceImpl.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.webclient.services.profile;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+@Service(LoginService.class)
+public class SimpleLoginServiceImpl implements LoginService {
+
+ public ProfileService profileService;
+
+ @Reference
+ public void setProfileService(ProfileService profileService) {
+ this.profileService = profileService;
+ }
+
+ public int login(String userName, String password) {
+
+ if (!"test".equals(userName)) {
+ return INVALID_LOGIN;
+ }
+
+ if (!"password".equals(password)) {
+ return INVALID_PASSWORD;
+ }
+
+ profileService.setLoggedIn(true);
+ profileService.setFirstName("John");
+ profileService.setLastName("Doe");
+ profileService.setId(12345);
+
+ return SUCCESS;
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountLogTag.java b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountLogTag.java
new file mode 100644
index 0000000000..08751bdc3d
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountLogTag.java
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.webclient.tags.account;
+
+import java.util.Iterator;
+import java.util.List;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+import bigbank.webclient.services.profile.ProfileService;
+
+import com.bigbank.account.AccountLog;
+import com.bigbank.account.AccountService;
+
+public class AccountLogTag extends TagSupport {
+
+ public AccountLogTag() {
+ super();
+ }
+
+ private String mAccountService;
+
+ public String getAccountService() {
+ return mAccountService;
+ }
+
+ public void setAccountService(String pAccountService) {
+ mAccountService = pAccountService;
+ }
+
+ private String mProfileService;
+
+ public String getProfileService() {
+ return mProfileService;
+ }
+
+ public void setProfileService(String pProfileService) {
+ mProfileService = pProfileService;
+ }
+
+ private String mId;
+
+ @Override
+ public String getId() {
+ return mId;
+ }
+
+ @Override
+ public void setId(String pId) {
+ mId = pId;
+ }
+
+ private Iterator mIterator;
+
+ @Override
+ public int doStartTag() throws JspException {
+ CompositeContext moduleContext = CurrentCompositeContext.getContext();
+
+ ProfileService profile = moduleContext.locateService(ProfileService.class, mProfileService);
+
+ if (profile == null) {
+ throw new JspException("Profile [" + mProfileService + "] not found in current module context");
+ }
+
+ AccountService service = (AccountService) moduleContext.locateService(AccountService.class, mAccountService);
+ if (service == null) {
+ throw new JspException("Service [" + mAccountService + "] not found in current module context");
+ }
+ List entries;
+ try {
+ AccountLog accountLog = service.getAccountLog(profile.getId());
+ pageContext.setAttribute("StockLogEntries", accountLog.getStockLogEntries());
+ entries = accountLog.getAccountLogEntries();
+ } catch (Exception e) {
+ throw new JspException(e);
+ }
+ mIterator = entries.iterator();
+ if (mIterator.hasNext()) {
+ pageContext.setAttribute(mId, mIterator.next());
+ return EVAL_BODY_INCLUDE;
+ } else {
+ return SKIP_BODY;
+ }
+ }
+
+ @Override
+ public int doAfterBody() {
+ if (mIterator.hasNext()) {
+ pageContext.setAttribute(mId, mIterator.next());
+ return EVAL_BODY_AGAIN;
+ } else {
+ return SKIP_BODY;
+ }
+ }
+
+ @Override
+ public void release() {
+ super.release();
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountStatusTag.java b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountStatusTag.java
new file mode 100644
index 0000000000..3733cc84dd
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountStatusTag.java
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank.webclient.tags.account;
+
+import java.util.Iterator;
+import java.util.List;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+import bigbank.webclient.services.profile.ProfileService;
+
+import com.bigbank.account.AccountReport;
+import com.bigbank.account.AccountService;
+
+/**
+ * Retrieves and iterates over account summary information for the current profile by accessing the remotable account service component
+ */
+
+public class AccountStatusTag extends TagSupport {
+
+ // ----------------------------------
+ // Constructors
+ // ----------------------------------
+
+ public AccountStatusTag() {
+ super();
+ }
+
+ // ----------------------------------
+ // Methods
+ // ----------------------------------
+
+ private String mAccountService;
+
+ public String getAccountService() {
+ return mAccountService;
+ }
+
+ public void setAccountService(String pAccountService) {
+ mAccountService = pAccountService;
+ }
+
+ private String mProfileService;
+
+ public String getProfileService() {
+ return mProfileService;
+ }
+
+ public void setProfileService(String pProfileService) {
+ mProfileService = pProfileService;
+ }
+
+ private String mId;
+
+ @Override
+ public String getId() {
+ return mId;
+ }
+
+ @Override
+ public void setId(String pId) {
+ mId = pId;
+ }
+
+ private Iterator mIterator;
+
+ @Override
+ public int doStartTag() throws JspException {
+ CompositeContext moduleContext = CurrentCompositeContext.getContext();
+
+ ProfileService profile = moduleContext.locateService(ProfileService.class, mProfileService);
+
+ if (profile == null) {
+ throw new JspException("Profile [" + mProfileService + "] not found in current module context");
+ }
+
+ AccountService service = (AccountService) moduleContext.locateService(AccountService.class, mAccountService);
+
+ if (service == null) {
+ throw new JspException("Service [" + mAccountService + "] not found in current module context");
+ }
+ List summaries;
+ try {
+ AccountReport accountReport = service.getAccountReport(profile.getId());
+ pageContext.setAttribute("StockSummaries", accountReport.getStockSummaries());
+ summaries = accountReport.getAccountSummaries();
+ } catch (Exception e) {
+ throw new JspException(e);
+ }
+ mIterator = summaries.iterator();
+ if (mIterator.hasNext()) {
+ pageContext.setAttribute(mId, mIterator.next());
+ return EVAL_BODY_INCLUDE;
+ } else {
+ return SKIP_BODY;
+ }
+ }
+
+ @Override
+ public int doAfterBody() {
+ if (mIterator.hasNext()) {
+ pageContext.setAttribute(mId, mIterator.next());
+ return EVAL_BODY_AGAIN;
+ } else {
+ return SKIP_BODY;
+ }
+ }
+
+ @Override
+ public void release() {
+ super.release();
+ mId = null;
+ mIterator = null;
+ }
+} \ No newline at end of file
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockLogTag.java b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockLogTag.java
new file mode 100644
index 0000000000..ea2df8aa55
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockLogTag.java
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank.webclient.tags.account;
+
+import java.util.Iterator;
+import java.util.List;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+public class StockLogTag extends TagSupport {
+
+ public StockLogTag() {
+ super();
+ }
+
+ private String mId;
+
+ @Override
+ public String getId() {
+ return mId;
+ }
+
+ @Override
+ public void setId(String pId) {
+ mId = pId;
+ }
+
+ private Iterator mIterator;
+
+ @Override
+ public int doStartTag() throws JspException {
+
+ List entries = (List) pageContext.getAttribute("StockLogEntries");
+ if (null == entries) {
+ return SKIP_BODY;
+ }
+ mIterator = entries.iterator();
+ if (mIterator.hasNext()) {
+ pageContext.setAttribute(mId, mIterator.next());
+ return EVAL_BODY_INCLUDE;
+ } else {
+ return SKIP_BODY;
+ }
+ }
+
+ @Override
+ public int doAfterBody() {
+ if (mIterator.hasNext()) {
+ pageContext.setAttribute(mId, mIterator.next());
+ return EVAL_BODY_AGAIN;
+ } else {
+ pageContext.setAttribute("StockLogEntries", null);
+ return SKIP_BODY;
+ }
+ }
+
+ @Override
+ public void release() {
+ pageContext.setAttribute("StockLogEntries", null);
+ super.release();
+ mId = null;
+ mIterator = null;
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockStatusTag.java b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockStatusTag.java
new file mode 100644
index 0000000000..b2c61193e7
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockStatusTag.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.webclient.tags.account;
+
+import java.util.Iterator;
+import java.util.List;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+/**
+ * Retrieves and iterates over account summary information for the current profile by accessing the remotable account service component
+ */
+
+public class StockStatusTag extends TagSupport {
+
+ public StockStatusTag() {
+ super();
+ }
+
+ private String mId;
+
+ @Override
+ public String getId() {
+ return mId;
+ }
+
+ @Override
+ public void setId(String pId) {
+ mId = pId;
+ }
+
+ private Iterator mIterator;
+
+ @Override
+ public int doStartTag() throws JspException {
+
+ List summaries = (List) pageContext.getAttribute("StockSummaries");
+ if (null == summaries) {
+ return SKIP_BODY;
+ }
+ mIterator = summaries.iterator();
+ if (mIterator.hasNext()) {
+ pageContext.setAttribute(mId, mIterator.next());
+ return EVAL_BODY_INCLUDE;
+ } else {
+ return SKIP_BODY;
+ }
+ }
+
+ @Override
+ public int doAfterBody() {
+ if (mIterator.hasNext()) {
+ pageContext.setAttribute(mId, mIterator.next());
+ return EVAL_BODY_AGAIN;
+ } else {
+ pageContext.setAttribute("StockSummaries", null);
+ return SKIP_BODY;
+ }
+ }
+
+ @Override
+ public void release() {
+ pageContext.setAttribute("StockSummaries", null);
+ super.release();
+ mId = null;
+ mIterator = null;
+ }
+} \ No newline at end of file
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/LoginBarrierTag.java b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/LoginBarrierTag.java
new file mode 100644
index 0000000000..6c50595d0f
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/LoginBarrierTag.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank.webclient.tags.sca;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+import bigbank.webclient.services.profile.ProfileService;
+
+public class LoginBarrierTag extends TagSupport {
+
+ public LoginBarrierTag() {
+ super();
+ }
+
+ private String mProfile;
+
+ public String getProfile() {
+ return mProfile;
+ }
+
+ public void setProfile(String pProfile) {
+ mProfile = pProfile;
+ }
+
+ private String mUrl;
+
+ public String getUrl() {
+ return mUrl;
+ }
+
+ public void setUrl(String pUrl) {
+ mUrl = pUrl;
+ }
+
+ int doPage = EVAL_PAGE;
+
+ @Override
+ public int doStartTag() throws JspException {
+ if (mProfile == null || mProfile.length() < 1) {
+ throw new JspException("Invalid profile location specified");
+ }
+
+ CompositeContext moduleContext = CurrentCompositeContext.getContext();
+
+ ProfileService profile = moduleContext.locateService(ProfileService.class, mProfile);
+
+ if (profile == null) {
+ throw new JspException("Profile [" + mProfile + "] not found in current module context");
+ }
+
+ if (profile.isLoggedIn()) {
+ return EVAL_BODY_INCLUDE;
+ } else {
+ try {
+ doPage = SKIP_PAGE;
+ pageContext.forward(mUrl);
+ ((HttpServletResponse) (pageContext.getResponse())).sendRedirect("login.html");
+ return SKIP_BODY;
+ } catch (ServletException e) {
+ throw new JspException("Unable to forward to [" + mUrl + "]");
+ } catch (IOException e) {
+ throw new JspException("Unable to forward to [" + mUrl + "]");
+ }
+ }
+ }
+
+ @Override
+ public int doEndTag() throws JspException {
+ return doPage;
+ }
+
+ @Override
+ public void release() {
+ super.release();
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/ServiceTag.java b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/ServiceTag.java
new file mode 100644
index 0000000000..d1263377c2
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/ServiceTag.java
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank.webclient.tags.sca;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+/**
+ * Places an SCA service in the JSP page context, making it available to other tags corresponding to its id value.
+ */
+
+public class ServiceTag extends TagSupport {
+
+ // ----------------------------------
+ // Constructors
+ // ----------------------------------
+
+ public ServiceTag() {
+ super();
+ }
+
+ // ----------------------------------
+ // Methods
+ // ----------------------------------
+
+ private String mName;
+
+ /**
+ * Returns the name of the SCA service to import into the page context.
+ */
+ public String getName() {
+ return mName;
+ }
+
+ /**
+ * Sets name of the SCA service to import into the page context.
+ */
+ public void setName(String pName) {
+ mName = pName;
+ }
+
+ private String mId;
+
+ /**
+ * Returns the id of the service in the page context
+ */
+ @Override
+ public String getId() {
+ return mId;
+ }
+
+ /**
+ * Sets the id of the service for the page context
+ */
+
+ @Override
+ public void setId(String pId) {
+ mId = pId;
+ }
+
+ @Override
+ public int doStartTag() throws JspException {
+ CompositeContext moduleContext = CurrentCompositeContext.getContext();
+
+ Object service = moduleContext.locateService(Object.class, mName);
+
+ if (service == null) {
+ throw new JspException("Service [" + mName + "] not found in current module context");
+ }
+ if (mId == null) {
+ // if the Id name was not specified, default to the basic name of the
+ // service
+ mId = mName;
+ }
+ pageContext.setAttribute(mId, service);
+ return EVAL_BODY_INCLUDE;
+ }
+
+ @Override
+ public int doEndTag() throws JspException {
+ return EVAL_PAGE;
+ }
+
+ @Override
+ public void release() {
+ super.release();
+ }
+} \ No newline at end of file
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/ui/FormServlet.java b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/ui/FormServlet.java
new file mode 100644
index 0000000000..3acdbee845
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/ui/FormServlet.java
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.webclient.ui;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+import bigbank.webclient.services.profile.ProfileService;
+
+import com.bigbank.account.AccountFactory;
+import com.bigbank.account.AccountService;
+import com.bigbank.account.CustomerProfileData;
+import com.bigbank.account.StockSummary;
+
+public class FormServlet extends HttpServlet {
+
+ // private ServletContext mContext;
+ // public void init(ServletConfig pCfg) throws ServletException {
+ // mContext = pCfg.getServletContext();
+ // }
+
+ @Override
+ public void doPost(HttpServletRequest pReq, HttpServletResponse pResp) throws ServletException {
+
+ try {
+ final String action = pReq.getParameter("action");
+
+ CompositeContext moduleContext = CurrentCompositeContext.getContext();
+ AccountService accountServices = (AccountService) moduleContext.locateService(AccountService.class, "AccountServiceComponent");
+ if (accountServices == null) {
+ throw new ServletException("AccountServiceComponent");
+ }
+ ProfileService profileServices = null;
+ if (!"createAccount".equals(action)) {
+ profileServices = moduleContext.locateService(ProfileService.class, "ProfileServiceComponent");
+ if (profileServices == null) {
+ throw new ServletException("ProfileServiceComponent not found.");
+ }
+ if (!profileServices.isLoggedIn()) {
+ throw new ServletException("User id '" + profileServices.getId() + "' not logged on.");
+ }
+ }
+
+ if ("createAccount".equals(action)) {
+ createAccount(pReq, pResp, accountServices);
+ } else if ("account".equals(action)) {
+ accountTransaction(pReq, pResp, accountServices);
+ } else if ("stockPurchase".equals(action)) {
+ stockPurchase(pReq, pResp, profileServices, accountServices);
+ } else if ("stockSale".equals(action)) {
+ stockSale(pReq, pResp, profileServices, accountServices);
+ } else {
+ throw new IllegalArgumentException("Unknown action in Form servlet '" + action + "'.");
+ }
+ // mContext.getRequestDispatcher("summary.jsp").forward(pReq, pResp);
+ pResp.sendRedirect("summary.jsp");
+ } catch (ServletException e) {
+ e.printStackTrace();
+ throw e;
+
+ } catch (Exception e) {
+
+ throw new ServletException(e);
+ }
+
+ }
+
+ private void stockSale(HttpServletRequest req, HttpServletResponse resp, ProfileService profileServices, AccountService accountServices)
+ throws ServletException {
+ try {
+ if (!"cancel".equals(req.getParameter("cancel"))) {
+
+ int quantity = Integer.parseInt(req.getParameter("quantity"));
+ int purchaseLotNumber = Integer.parseInt(req.getParameter("purchaseLotNumber"));
+ accountServices.sellStock(purchaseLotNumber, quantity);
+ }
+
+ } catch (Exception e) {
+
+ throw new ServletException("stockSale " + e.getMessage(), e);
+ }
+
+ }
+
+ private void stockPurchase(HttpServletRequest req, HttpServletResponse resp, ProfileService profileServices, AccountService accountServices)
+ throws ServletException {
+ try {
+ if (!"cancel".equals(req.getParameter("cancel"))) {
+
+ String symbol = req.getParameter("symbol").trim().toUpperCase();
+ int quantity = Integer.parseInt(req.getParameter("quantity"));
+ StockSummary stockSummry = AccountFactory.INSTANCE.createStockSummary();
+ stockSummry.setSymbol(symbol);
+ stockSummry.setQuantity(quantity);
+ accountServices.purchaseStock(profileServices.getId(), stockSummry);
+ }
+ } catch (Exception e) {
+ throw new ServletException("stockPurchase " + e.getMessage(), e);
+ }
+ }
+
+ private void accountTransaction(HttpServletRequest req, HttpServletResponse resp, AccountService accountServices) throws ServletException {
+ try {
+ if (!"cancel".equals(req.getParameter("cancel"))) {
+ String account = req.getParameter("account");
+ String amount = req.getParameter("Amount");
+ if ("deposit".equals(req.getParameter("actionType"))) {
+ accountServices.deposit(account, Float.parseFloat(amount));
+ } else {
+ accountServices.withdraw(account, Float.parseFloat(amount));
+ }
+ }
+ } catch (Exception e) {
+ throw new ServletException("accountTransaction " + e.getMessage(), e);
+ }
+
+ }
+
+ private void createAccount(HttpServletRequest pReq, HttpServletResponse pResp, AccountService accountServices) throws ServletException {
+ try {
+ CustomerProfileData customerProfileData = AccountFactory.INSTANCE.createCustomerProfileData();
+ customerProfileData.setFirstName(pReq.getParameter("firstName"));
+ customerProfileData.setLastName(pReq.getParameter("lastName"));
+ customerProfileData.setAddress(pReq.getParameter("address"));
+ customerProfileData.setEmail(pReq.getParameter("email"));
+ customerProfileData.setLoginID(pReq.getParameter("loginID"));
+ customerProfileData.setPassword(pReq.getParameter("password"));
+
+ CustomerProfileData resp = accountServices.createAccount(customerProfileData, "savings".equals(pReq.getParameter("savings")), "checkings"
+ .equals(pReq.getParameter("checkings")));
+ LoginServlet.login(resp.getLoginID(), resp.getPassword());
+
+ } catch (IOException e) {
+ throw new ServletException(e);
+ }
+
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/ui/LoginServlet.java b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/ui/LoginServlet.java
new file mode 100644
index 0000000000..784cc4fb40
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/java/bigbank/webclient/ui/LoginServlet.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.webclient.ui;
+
+import java.io.IOException;
+import java.rmi.RemoteException;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+import bigbank.webclient.services.profile.LoginService;
+
+public class LoginServlet extends HttpServlet {
+
+ @Override
+ public void init(ServletConfig pCfg) throws ServletException {
+
+ }
+
+ @Override
+ public void doPost(HttpServletRequest pReq, HttpServletResponse pResp) throws ServletException {
+
+ if ("logout".equals(pReq.getParameter("logout")) || "logoutHIDDEN".equals(pReq.getParameter("logoutHIDDEN"))) {
+ HttpSession sess = pReq.getSession();
+ if (sess != null) {
+ sess.invalidate();
+ }
+ try {
+ pResp.sendRedirect("login.html");
+ } catch (IOException e) {
+
+ e.printStackTrace();
+ throw new ServletException(e);
+ }
+
+ } else {
+ pReq.getSession(); // make sure session started.
+ String login = pReq.getParameter("login");
+ String password = pReq.getParameter("password");
+ try {
+ int resp = login(login, password);
+ if (resp == LoginService.SUCCESS) {
+
+ pResp.sendRedirect("summary.jsp");
+ } else {
+
+ pResp.sendRedirect("login.html");
+ }
+ } catch (IOException e) {
+ throw new ServletException(e);
+ }
+ }
+ }
+
+ static int login(final String login, final String password) throws ServletException {
+
+ CompositeContext moduleContext = CurrentCompositeContext.getContext();
+ LoginService loginMgr = moduleContext.locateService(LoginService.class, "LoginServiceComponent");
+
+ if (loginMgr == null) {
+ throw new ServletException("LoginManager not found");
+ }
+
+ try {
+ return loginMgr.login(login, password);
+ } catch (RemoteException e) {
+
+ throw new ServletException(e);
+ }
+
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/resources/META-INF/LICENSE.txt b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000000..bdec70a4fa
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,416 @@
+
+ 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.
+
+===============================================================================================================
+
+
+License for the Service Data Objects JavaDoc and Interface Definition files.
+
+Permission to copy, make derivative works of, and distribute the Service Data Objects
+JavaDoc and Interface Definition Files files in any medium without fee or royalty as part
+of a compliant implementation of the Service Data Objects Specification is hereby granted.
+The Service Data Objects Specification may be found at any of the following locations:
+
+http://dev2dev.bea.com/technologies/commonj/index.jsp
+http://www.ibm.com/developerworks/library/specification/ws-sdo/
+http://oracle.com/technology/webservices/sca
+https://www.sdn.sap.com/
+http://www.xcalia/xdn/specs/sdo
+
+THE SERVICE DATA OBJECTS SPECIFICATION AND THE JAVADOC AND INTERFACE DEFINITION FILES
+ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS
+SPECIFICATION OR THE JAVADOC AND INTERFACE DEFINITION FILES AND THE IMPLEMENTATION OF THEIR CONTENTS,
+INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+NON-INFRINGEMENT OR TITLE. THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
+INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY USE OR DISTRIBUTION OF THE
+SERVICE DATA OBJECTS SPECIFICATION OR THE JAVADOC OR INTERFACE DEFINTION FILES.
+
+The name and trademarks of the Authors may NOT be used in any manner, including advertising or
+publicity pertaining to the Service Component Architecture Specification or its contents without specific,
+written prior permission. Title to copyright in the Service Data Objects Specification and the
+JavaDoc and Interface Definition Files will at all times remain with the Authors.
+
+No other rights are granted by implication, estoppel or otherwise.
+
+=================================================================================================================
+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.
+
+===================================================================================================
+
+Common Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+ a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+ b) in the case of each subsequent Contributor:
+
+ i) changes to the Program, and
+
+ ii) additions to the Program;
+
+ where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+ a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+
+ b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+
+ c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+
+ d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+ a) it complies with the terms and conditions of this Agreement; and
+
+ b) its license agreement:
+
+ i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+
+ ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+
+ iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+
+ iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+ a) it must be made available under this Agreement; and
+
+ b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
+
+
+
+
+
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/resources/META-INF/NOTICE b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/resources/META-INF/NOTICE
new file mode 100644
index 0000000000..d48810c0ec
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/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/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl
new file mode 100644
index 0000000000..124db9ac04
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl
@@ -0,0 +1,466 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:account="http://www.bigbank.com/account"
+ targetNamespace="http://www.bigbank.com/account"
+ name="AccountService">
+
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://www.bigbank.com/account"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:account="http://www.bigbank.com/account"
+
+ > <!-- xmlns:sdojava="commonj.sdo/java" sdojava:package="org.apache.tuscany.samples.bigbank.account" -->
+
+
+<!-- <xsd:complexType name="DataGraphRoot">
+ <xsd:sequence>
+ <xsd:element name="customerProfileData" type="account:CustomerProfileData" maxOccurs="unbounded" minOccurs="0" />
+ <xsd:element name="StockSummaries" type="account:StockSummary" maxOccurs="unbounded" minOccurs="0" />
+ <xsd:element name="AccountSummaries" type="account:AccountSummary" maxOccurs="unbounded" minOccurs="0" />
+ <xsd:element name="StockLogEntries" type="account:StockLogEntry" maxOccurs="unbounded" minOccurs="0" />
+ <xsd:element name="AccountLogEntries" type="account:AccountLogEntry" maxOccurs="unbounded" minOccurs="0" />
+ </xsd:sequence>
+ </xsd:complexType>-->
+
+
+ <xsd:element name="getAccountReport">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="customerID"
+ type="xsd:int" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="getAccountReportResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="accountReport"
+ type="account:AccountReport" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:complexType name="AccountReport">
+ <xsd:sequence>
+ <xsd:element name="accountSummaries"
+ type="account:AccountSummary" maxOccurs="unbounded" />
+ <xsd:element name="stockSummaries"
+ type="account:StockSummary" maxOccurs="unbounded" />
+
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="AccountSummary">
+ <xsd:attribute name="accountNumber" type="xsd:string" />
+ <xsd:attribute name="accountType" type="xsd:string" />
+ <xsd:attribute name="balance" type="xsd:float" />
+ </xsd:complexType>
+
+ <xsd:complexType name="StockSummary">
+ <xsd:attribute name="purchaseLotNumber" type="xsd:int" />
+ <!-- unique id for this purchase -->
+ <xsd:attribute name="symbol" type="xsd:string" />
+ <xsd:attribute name="quantity" type="xsd:int" />
+ <xsd:attribute name="purchaseDate" type="xsd:dateTime" />
+ <xsd:attribute name="purchasePrice" type="xsd:float" />
+ <xsd:attribute name="currentPrice" type="xsd:float" />
+ <xsd:attribute name="company" type="xsd:string" />
+ <xsd:attribute name="highPrice" type="xsd:float" />
+ <xsd:attribute name="lowPrice" type="xsd:float" />
+
+ </xsd:complexType>
+
+ <!-- Profile in data base -->
+ <xsd:element name="getCustomerProfile">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="loginID" type="xsd:string" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:complexType name="CustomerProfileData">
+ <xsd:sequence>
+ <xsd:element name="firstName" type="xsd:string" />
+ <xsd:element name="lastName" type="xsd:string" />
+ <xsd:element name="address" type="xsd:string" />
+ <xsd:element name="email" type="xsd:string" />
+ <xsd:element name="loginID" type="xsd:string" />
+ <xsd:element name="password" type="xsd:string" />
+ <xsd:element name="id" type="xsd:int" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:element name="getCustomerProfileResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="customerProfile"
+ type="account:CustomerProfileData" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="withdraw">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="accountNumber"
+ type="xsd:string" />
+ <xsd:element name="amount" type="xsd:float" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="withdrawResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="balance" type="xsd:float" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="deposit">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="accountNumber"
+ type="xsd:string" />
+ <xsd:element name="amount" type="xsd:float" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="depositResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="balance" type="xsd:float" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="purchaseStock">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="id" type="xsd:int" />
+ <xsd:element name="stock" type="account:StockSummary" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="purchaseStockResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="purchaseSummary"
+ type="account:StockSummary" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+
+
+ <xsd:element name="sellStock">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="purchaseLotNumber"
+ type="xsd:int" /><!-- unique id for this purchase -->
+ <xsd:element name="quantity" type="xsd:int" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="createAccount">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="customerProfile"
+ type="account:CustomerProfileData" />
+ <xsd:element name="createSavings"
+ type="xsd:boolean" />
+ <xsd:element name="createCheckings"
+ type="xsd:boolean" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="createAccountResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="customerProfile"
+ type="account:CustomerProfileData" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ </xsd:element>
+
+ <xsd:element name="getAccountLog">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="customerID"
+ type="xsd:int" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="getAccountLogResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="accountLog"
+ type="account:AccountLog" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:complexType name="AccountLog">
+ <xsd:sequence>
+ <xsd:element name="accountLogEntries"
+ type="account:AccountLogEntry" maxOccurs="unbounded" />
+ <xsd:element name="stockLogEntries"
+ type="account:StockLogEntry" maxOccurs="unbounded" />
+
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="AccountLogEntry">
+ <xsd:attribute name="logSeqNo" type="xsd:int" />
+ <xsd:attribute name="id" type="xsd:int" />
+ <xsd:attribute name="accountNumber" type="xsd:string" />
+ <xsd:attribute name="actionType" type="xsd:string" />
+ <xsd:attribute name="amount" type="xsd:float" />
+ </xsd:complexType>
+
+ <xsd:complexType name="StockLogEntry">
+ <xsd:attribute name="logSeqNo" type="xsd:int" />
+ <xsd:attribute name="id" type="xsd:int" />
+ <xsd:attribute name="symbol" type="xsd:string" />
+ <xsd:attribute name="quantity" type="xsd:int" />
+ <xsd:attribute name="actionType" type="xsd:string" />
+ <xsd:attribute name="purchaseLotNumber" type="xsd:int" />
+ </xsd:complexType>
+
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="getAccountReportRequest">
+ <wsdl:part element="account:getAccountReport"
+ name="getAccountReportRequest" />
+ </wsdl:message>
+ <wsdl:message name="getAccountReportResponse">
+ <wsdl:part element="account:getAccountReportResponse"
+ name="getAccountReportResponse" />
+ </wsdl:message>
+
+ <wsdl:message name="getCustomerProfileRequest">
+ <wsdl:part element="account:getCustomerProfile"
+ name="getCustomerProfile" />
+ </wsdl:message>
+ <wsdl:message name="getCustomerProfileResponse">
+ <wsdl:part element="account:getCustomerProfileResponse"
+ name="getCustomerProfileResponse" />
+ </wsdl:message>
+
+ <wsdl:message name="withdrawRequest">
+ <wsdl:part element="account:withdraw" name="withdrawRequest" />
+ </wsdl:message>
+
+ <wsdl:message name="withdrawResponse">
+ <wsdl:part element="account:withdrawResponse"
+ name="withdrawResponse" />
+ </wsdl:message>
+
+ <wsdl:message name="depositRequest">
+ <wsdl:part element="account:deposit" name="depositRequest" />
+ </wsdl:message>
+
+ <wsdl:message name="depositResponse">
+ <wsdl:part element="account:depositResponse"
+ name="depositResponse" />
+ </wsdl:message>
+
+ <wsdl:message name="purchaseStockRequest">
+ <wsdl:part element="account:purchaseStock"
+ name="purchaseStockRequest" />
+ </wsdl:message>
+
+ <wsdl:message name="purchaseStockResponse">
+ <wsdl:part element="account:purchaseStockResponse"
+ name="purchaseStockResponse" />
+ </wsdl:message>
+
+ <wsdl:message name="sellStockRequest">
+ <wsdl:part element="account:sellStock" name="sellStockRequest" />
+ </wsdl:message>
+
+ <wsdl:message name="createAccountRequest">
+ <wsdl:part element="account:createAccount" name="createAccountRequest" />
+ </wsdl:message>
+
+ <wsdl:message name="createAccountResponse">
+ <wsdl:part element="account:createAccountResponse" name="createAccountResponse" />
+ </wsdl:message>
+
+ <wsdl:message name="getAccountLogRequest">
+ <wsdl:part element="account:getAccountLog"
+ name="getAccountLogRequest" />
+ </wsdl:message>
+
+ <wsdl:message name="getAccountLogResponse">
+ <wsdl:part element="account:getAccountLogResponse"
+ name="getAccountLogResponse" />
+ </wsdl:message>
+
+ <wsdl:portType name="AccountService">
+ <wsdl:operation name="getAccountReport">
+ <wsdl:input message="account:getAccountReportRequest" />
+ <wsdl:output message="account:getAccountReportResponse" />
+ </wsdl:operation>
+
+ <wsdl:operation name="getCustomerProfile">
+ <wsdl:input message="account:getCustomerProfileRequest" />
+ <wsdl:output message="account:getCustomerProfileResponse" />
+ </wsdl:operation>
+
+ <wsdl:operation name="withdraw">
+ <wsdl:input message="account:withdrawRequest" />
+ <wsdl:output message="account:withdrawResponse" />
+ </wsdl:operation>
+
+ <wsdl:operation name="deposit">
+ <wsdl:input message="account:depositRequest" />
+ <wsdl:output message="account:depositResponse" />
+ </wsdl:operation>
+
+ <wsdl:operation name="purchaseStock">
+ <wsdl:input message="account:purchaseStockRequest" />
+ <wsdl:output message="account:purchaseStockResponse" />
+ </wsdl:operation>
+
+ <wsdl:operation name="sellStock">
+ <wsdl:input message="account:sellStockRequest" />
+ <wsdl:output message="account:purchaseStockResponse" />
+ </wsdl:operation>
+
+
+ <wsdl:operation name="createAccount">
+ <wsdl:input message="account:createAccountRequest" />
+ <wsdl:output message="account:createAccountResponse" />
+ </wsdl:operation>
+
+ <wsdl:operation name="getAccountLog">
+ <wsdl:input message="account:getAccountLogRequest" />
+ <wsdl:output message="account:getAccountLogResponse" />
+ </wsdl:operation>
+
+ </wsdl:portType>
+
+
+
+ <wsdl:binding name="AccountServiceSOAP" type="account:AccountService">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="getAccountReport">
+ <soap:operation
+ soapAction="http://www.bigbank.com/account/getAccountReport" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getCustomerProfile">
+ <soap:operation
+ soapAction="http://www.bigbank.com/account/getCustomerProfile" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="withdraw">
+ <soap:operation
+ soapAction="http://www.bigbank.com/account/withdraw" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="deposit">
+ <soap:operation
+ soapAction="http://www.bigbank.com/account/deposit" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="purchaseStock">
+ <soap:operation
+ soapAction="http://www.bigbank.com/account/purchaseStock" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="sellStock">
+ <soap:operation
+ soapAction="http://www.bigbank.com/account/sellStock" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="createAccount">
+ <soap:operation
+ soapAction="http://www.bigbank.com/account/createAccount" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="getAccountLog">
+ <soap:operation
+ soapAction="http://www.bigbank.com/account/getAccountLog" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+
+ </wsdl:binding>
+ <wsdl:service name="AccountService">
+ <wsdl:port binding="account:AccountServiceSOAP"
+ name="AccountServiceSOAP">
+ <soap:address
+ location="http://localhost:8080/sample-bigbank-account/services/AccountService" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/CustomerProfile.jsp b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/CustomerProfile.jsp
new file mode 100644
index 0000000000..2dc17a8867
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/CustomerProfile.jsp
@@ -0,0 +1,100 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ --%>
+
+<HTML>
+<HEAD>
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+ pageEncoding="ISO-8859-1"%>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META http-equiv="Content-Style-Type" content="text/css">
+<%-- LINK href="theme/Master.css" rel="stylesheet" type="text/css" --%>
+<TITLE>BigBank- Customer Account</TITLE>
+</HEAD>
+<BODY><P><FONT size="+1">Customer Account</FONT><BR>
+<BR>
+</P>
+<FORM method="post" action="FormServlet">
+<input type="hidden" name="action" value='createAccount' />
+<TABLE border="0">
+ <TBODY>
+ <TR>
+ <TD>First name </TD>
+ <TD width="10%"></TD>
+ <TD><INPUT type="text" name="firstName" size="20"></TD>
+ </TR>
+ <TR>
+ <TD>Last name</TD>
+ <TD></TD>
+ <TD><INPUT type="text" name="lastName" size="20"></TD>
+ </TR>
+ <TR>
+ <TD>Address</TD>
+ <TD></TD>
+ <TD><INPUT type="text" name="address" size="36" maxlength="170"></TD>
+ </TR>
+ <TR>
+ <TD>email</TD>
+ <TD></TD>
+ <TD><INPUT type="text" name="email" size="16" maxlength="39"></TD>
+ </TR>
+ <TR>
+ <TD>&nbsp;</TD>
+ <TD></TD>
+ <TD></TD>
+ </TR>
+ <TR>
+ <TD>Checkings</TD>
+ <TD></TD>
+ <TD><INPUT type="checkbox" name="checkings" value="checkings" checked></TD>
+ </TR>
+ <TR>
+ <TD>Savings</TD>
+ <TD></TD>
+ <TD><INPUT type="checkbox" name="savings" value="savings" checked></TD>
+ </TR>
+ <TR>
+ <TD>&nbsp;</TD>
+ <TD></TD>
+ <TD></TD>
+ </TR>
+ <TR>
+ <TD>Logon ID</TD>
+ <TD></TD>
+ <TD><INPUT type="text" name="loginID" size="20"></TD>
+ </TR>
+ <TR>
+ <TD>Password</TD>
+ <TD></TD>
+ <TD><INPUT type="password" name="password" size="20"></TD>
+ </TR>
+ <TR>
+ <TD></TD>
+ <TD></TD>
+ <TD></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<BR>
+<INPUT type="submit" name="update" value="update">&nbsp;&nbsp;
+<INPUT type="button" name="cancel" value="cancel"></FORM>
+<P><BR>
+</P>
+</BODY>
+</HTML>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld
new file mode 100644
index 0000000000..a3d92a2e46
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" version="2.0">
+ <tlibversion>1.0</tlibversion>
+ <jspversion>2.0</jspversion>
+ <shortname>BigBank Tags</shortname>
+ <info>Tag library containing BigBank tags</info>
+ <tag>
+ <name>service</name>
+ <tagclass>bigbank.webclient.tags.sca.ServiceTag</tagclass>
+ <bodycontent>JSP</bodycontent>
+ <info>Places a reference to an SCA Service in the page context</info>
+ <attribute>
+ <name>id</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>name</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ </tag>
+ <tag>
+ <name>login</name>
+ <tagclass>bigbank.webclient.tags.sca.LoginBarrierTag</tagclass>
+ <bodycontent>JSP</bodycontent>
+ <info>Redirects if user is not logged in</info>
+ <attribute>
+ <name>profile</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>url</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+
+ </tag>
+ <tag>
+ <name>accountStatus</name>
+ <tagclass>bigbank.webclient.tags.account.AccountStatusTag</tagclass>
+ <bodycontent>JSP</bodycontent>
+ <info>Accesses and iterates the account service</info>
+ <attribute>
+ <name>id</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>accountService</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>profileService</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ </tag>
+ <tag>
+ <name>stockStatus</name>
+ <tagclass>bigbank.webclient.tags.account.StockStatusTag</tagclass>
+ <bodycontent>JSP</bodycontent>
+ <info>Accesses and iterates the stocks</info>
+ <attribute>
+ <name>id</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ </tag>
+
+ <tag>
+ <name>accountLog</name>
+ <tagclass>bigbank.webclient.tags.account.AccountLogTag</tagclass>
+ <bodycontent>JSP</bodycontent>
+ <info>Accesses and iterates the accounts log</info>
+ <attribute>
+ <name>id</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>accountService</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>profileService</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ </tag>
+ <tag>
+ <name>stockLog</name>
+ <tagclass>bigbank.webclient.tags.account.StockLogTag</tagclass>
+ <bodycontent>JSP</bodycontent>
+ <info>Accesses and iterates the stocks log</info>
+ <attribute>
+ <name>id</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ </tag>
+
+
+</taglib>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/WEB-INF/default.scdl b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/WEB-INF/default.scdl
new file mode 100644
index 0000000000..cf42086edb
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/WEB-INF/default.scdl
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+ name="bigbank.webclient">
+
+
+
+ <dbsdo:import.sdo xmlns:dbsdo="http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0" factory="com.bigbank.account.AccountFactory"/>
+
+ <component name="LoginServiceComponent">
+ <implementation.java class="bigbank.webclient.services.profile.AccountLoginServiceImpl"/>
+ <reference name="accountService">AccountServiceComponent</reference>
+ <reference name="profileService">ProfileServiceComponent</reference>
+ </component>
+
+ <property name="name" type="xsd:string">Anonymous</property>
+
+ <component name="ProfileServiceComponent">
+ <implementation.java class="bigbank.webclient.services.profile.ProfileServiceImpl"/>
+ <property name="firstName" source="$name"/>
+ </component>
+
+ <component name="AccountServiceComponent">
+ <implementation.java class="bigbank.webclient.services.account.AccountServiceComponentImpl"/>
+ <reference name="accountService">AccountService</reference>
+ </component>
+
+
+ <reference name="AccountService">
+ <interface.wsdl interface="http://www.bigbank.com/account#wsdl.interface(AccountService)" wsdli:wsdlLocation="http://www.bigbank.com/account wsdl/AccountService.wsdl" />
+ <binding.ws endpoint="http://www.bigbank.com/account#wsdl.endpoint(AccountService/AccountServiceSOAP)"
+ location="wsdl/AccountService.wsdl" />
+ </reference>
+
+</composite>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/WEB-INF/web.xml b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000000..398767e345
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
+Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <display-name>Tuscany Bigbank Web UI sample</display-name>
+ <welcome-file-list id="WelcomeFileList">
+ <welcome-file>login.html</welcome-file>
+ </welcome-file-list>
+
+ <filter>
+ <filter-name>TuscanyFilter</filter-name>
+ <filter-class>org.apache.tuscany.runtime.webapp.TuscanyFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>TuscanyFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <context-param>
+ <param-name>tuscany.online</param-name>
+ <param-value>false</param-value>
+ </context-param>
+
+
+ <listener>
+ <listener-class>org.apache.tuscany.runtime.webapp.TuscanyContextListener</listener-class>
+ </listener>
+
+ <listener>
+ <listener-class>org.apache.tuscany.runtime.webapp.TuscanySessionListener</listener-class>
+ </listener>
+
+ <listener>
+ <listener-class>org.apache.tuscany.runtime.webapp.TuscanyRequestListener</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>LoginServlet</servlet-name>
+ <servlet-class>bigbank.webclient.ui.LoginServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet>
+ <servlet-name>FormServlet</servlet-name>
+ <servlet-class>bigbank.webclient.ui.FormServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>LoginServlet</servlet-name>
+ <url-pattern>/loginAction/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>FormServlet</servlet-name>
+ <url-pattern>/FormServlet/*</url-pattern>
+ </servlet-mapping>
+
+
+
+
+
+
+
+
+</web-app>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/accountLog.jsp b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/accountLog.jsp
new file mode 100644
index 0000000000..6e91a14dcc
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/accountLog.jsp
@@ -0,0 +1,99 @@
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ --%>
+
+ <%@ page import="com.bigbank.account.AccountLogEntry" %>
+ <%@ page import="com.bigbank.account.StockLogEntry" %>
+ <%@ page session="true" %>
+ <%@ page autoFlush="true" %>
+ <%@ taglib uri="/WEB-INF/bigbank-tags.tld" prefix="sca" %>
+
+ <html>
+ <title>BigBank Account and Stock Log</title>
+
+ <body>
+
+ Account Log
+
+ <table>
+ <tr>
+ <td><strong>Seq</strong></td>
+ <td><strong>Account</strong></td>
+ <td><strong>Action</strong></td>
+ <td><strong>Amount</strong></td>
+ </tr>
+ <sca:accountLog accountService="AccountServiceComponent" profileService="ProfileServiceComponent" id="accountlogentry">
+ <tr>
+ <td>
+ <jsp:getProperty name="accountlogentry" property="logSeqNo"/>
+ </td>
+ <td>
+ <jsp:getProperty name="accountlogentry" property="accountNumber"/>
+ </td>
+ <td>
+ <jsp:getProperty name="accountlogentry" property="actionType"/>
+ </td>
+ <td>
+ <jsp:getProperty name="accountlogentry" property="amount"/>
+ </td>
+ </tr>
+ </sca:accountLog>
+ </table>
+
+
+
+ <hr/>
+ Stock Log
+
+ <table>
+
+ <tr>
+ <td><strong>Seq</strong></td>
+ <td><strong>Symbol</strong></td>
+ <td><strong>Quantity</strong></td>
+ <td>&nbsp;&nbsp;</td> <%-- spacer --%>
+ <td><strong>Action</strong></td>
+ <td><strong>PurchaseLotNumber</strong></td>
+ </tr>
+ <sca:stockLog id="stocklogentry">
+ <tr>
+ <td>
+ <jsp:getProperty name="stocklogentry" property="logSeqNo"/>
+ </td>
+ <td>
+ <jsp:getProperty name="stocklogentry" property="symbol"/>
+ </td>
+ <td>
+ <jsp:getProperty name="stocklogentry" property="quantity"/>
+ </td>
+ <td>&nbsp;&nbsp;</td> <%-- spacer --%>
+ <td>
+ <jsp:getProperty name="stocklogentry" property="actionType"/>
+ </td>
+
+ <td>
+ <jsp:getProperty name="stocklogentry" property="purchaseLotNumber"/>
+ </td>
+ </tr>
+ </FORM>
+ </sca:stockLog>
+ </table>
+
+
+ </body>
+ </html>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/accountTransaction.jsp b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/accountTransaction.jsp
new file mode 100644
index 0000000000..4017834867
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/accountTransaction.jsp
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ --%>
+
+<HTML>
+<HEAD>
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+ pageEncoding="ISO-8859-1"%>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<META http-equiv="Content-Style-Type" content="text/css">
+<LINK href="theme/Master.css" rel="stylesheet" type="text/css">
+<TITLE>BigBank - <%=request.getParameter("account") %> </TITLE>
+</HEAD>
+<BODY>
+<P>Account <%= request.getParameter("account") %><BR>
+<BR>
+<BR>
+</P>
+<FORM method="post" action="FormServlet">
+<input type="hidden" name="action" value='account' />
+<input type="hidden" name="account" value='<%= request.getParameter("account") %>' />
+<input type="hidden" name="actionType" value='<%=request.getParameter("transaction")%>' />
+Amount to <%=request.getParameter("transaction")%> <INPUT type="text" name="Amount" size="10"
+ maxlength="10"><BR>
+<BR>
+<BR>
+<BR>
+<INPUT type="submit" name="Submit"
+ value="Submit">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT type="submit"
+ name="cancel" value="cancel">
+</FORM>
+</BODY>
+</HTML>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/login.html b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/login.html
new file mode 100644
index 0000000000..a1a5440a4f
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/login.html
@@ -0,0 +1,60 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<html>
+<title>Welcome to Big Bank</title>
+
+<body>
+
+<form action="loginAction" method="post">
+ <table>
+ <tr>
+ <td colspan="2">Please login in to access your account</td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>Login</td>
+ <td><input type="text" name="login"/></td>
+ <td><I><FONT
+ size="-1" color="red">(test)</FONT></I></td>
+ </tr>
+ <tr>
+ <td>Password</td>
+ <td><input type="password" name="password"/></td>
+ <td><I><FONT size="-1" color="red">(password)</FONT></I></td>
+ </tr>
+ <tr>&nbsp;<td></td>
+ <td align="right"><input type="submit" name='login' value="login"/></td>
+ <tr>&nbsp;<td></td>
+ </tr>
+ </table>
+</form>
+<P><BR></P>
+<HR/>
+<FORM action="CustomerProfile.jsp" method="get">
+<BR>New to Big Bank? Please open a new account with us.
+<BR/>
+<P>
+<INPUT type="submit" name="createAccount" value="Create a new account">
+
+</FORM>
+
+
+</body>
+</html>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/purchaseStock.jsp b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/purchaseStock.jsp
new file mode 100644
index 0000000000..90c3a813b6
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/purchaseStock.jsp
@@ -0,0 +1,59 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ --%>
+
+<HTML>
+<HEAD>
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+ pageEncoding="ISO-8859-1"%>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META http-equiv="Content-Style-Type" content="text/css">
+<TITLE>BigBank- Stock purchase</TITLE>
+</HEAD>
+<BODY><P><FONT size="+1">Stock purchase</FONT><BR>
+<BR>
+</P>
+<FORM method="post" action="FormServlet">
+<input type="hidden" name="action" value='stockPurchase' />
+<TABLE border="0">
+ <TBODY>
+ <TR>
+ <TD>Symbol </TD>
+ <TD width="10%"></TD>
+ <TD><INPUT type="text" name="symbol" size="6"></TD>
+ </TR>
+ <TR>
+ <TD>Quantity</TD>
+ <TD></TD>
+ <TD><INPUT type="text" name="quantity" size="6"></TD>
+ </TR>
+ <TR>
+ <TD></TD>
+ <TD></TD>
+ <TD></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<BR>
+<INPUT type="submit" name="purchase" value="purchase">&nbsp;&nbsp;
+<INPUT type="submit" name="cancel" value="cancel"></FORM>
+<P><BR>
+</P>
+</BODY>
+</HTML>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/stockSale.jsp b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/stockSale.jsp
new file mode 100644
index 0000000000..a2b08f4352
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/stockSale.jsp
@@ -0,0 +1,56 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ --%>
+
+<HTML>
+<HEAD>
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+ pageEncoding="ISO-8859-1"%>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META http-equiv="Content-Style-Type" content="text/css">
+<TITLE>BigBank- Stock sale</TITLE>
+</HEAD>
+<BODY><P><FONT size="+1">Stock sale</FONT><BR>
+<BR>
+</P>
+<FORM method="post" action="FormServlet">
+<input type="hidden" name="action" value='stockSale' />
+<input type="hidden" name="purchaseLotNumber" value='<%=request.getParameter("purchaseLotNumber")%>' />
+<TABLE border="0">
+ <TBODY>
+
+ <TR>
+ <TD>Quantity</TD>
+ <TD></TD>
+ <TD><INPUT type="text" name="quantity" size="6"></TD>
+ </TR>
+ <TR>
+ <TD></TD>
+ <TD></TD>
+ <TD></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<BR>
+<INPUT type="submit" name="stockSale" value="sell">&nbsp;&nbsp;
+<INPUT type="submit" name="cancel" value="cancel"></FORM>
+<P><BR>
+</P>
+</BODY>
+</HTML>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/summary.jsp b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/summary.jsp
new file mode 100644
index 0000000000..f31ded242f
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/main/webapp/summary.jsp
@@ -0,0 +1,144 @@
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ --%>
+
+ <%@ page import="com.bigbank.account.AccountSummary" %>
+ <%@ page import="com.bigbank.account.StockSummary" %>
+ <%@ page session="true" %>
+ <%@ page autoFlush="true" %>
+<%@ taglib uri="/WEB-INF/bigbank-tags.tld" prefix="sca" %>
+<sca:login profile="ProfileServiceComponent" url="login.html">
+ <sca:service id="profile" name="ProfileServiceComponent"/>
+
+ <html>
+ <title>BigBank Account Summary</title>
+
+ <body>
+
+ Account Information for
+ <FORM method="post" action='loginAction'>
+ <jsp:getProperty name='profile' property='firstName'/>
+ <jsp:getProperty name='profile' property='lastName'/>
+ <input type="hidden" name="logoutHIDDEN" value='logoutHIDDEN' />
+ &nbsp;&nbsp;<INPUT type="submit" name='logout' value="logout">
+ <br>
+ </FORM>
+
+ <table>
+ <tr>
+ <td><strong>Account</strong></td>
+ <td>&nbsp;</td>
+ <td><strong>Balance</strong></td>
+ </tr>
+ <sca:accountStatus accountService="AccountServiceComponent" profileService="ProfileServiceComponent" id="account">
+ <tr>
+ <FORM method="post" action='accountTransaction.jsp'>
+ <input type="hidden" name="account" value='<%=((AccountSummary)pageContext.getAttribute("account")).getAccountNumber()%>' />
+ <td>
+ <jsp:getProperty name="account" property="accountNumber"/>
+ </td>
+
+ <td>
+ <jsp:getProperty name="account" property="accountType"/>
+ </td>
+ <td>
+ <jsp:getProperty name="account" property="balance"/>
+ </td>
+ <td>
+
+ <INPUT type="submit" name='transaction' value="deposit">
+ </td>
+ <td>
+ <INPUT type="submit" name='transaction' value="withdraw">
+ </td>
+ </FORM>
+ </tr>
+ </sca:accountStatus>
+ </table>
+
+
+
+ <hr/>
+ <FORM method="post" action='purchaseStock.jsp'>
+ Stocks: &nbsp;&nbsp;&nbsp;&nbsp;<INPUT type="submit" name='Purchase' value="Purchase"><br/>
+ </FORM>
+
+ <table>
+
+ <tr>
+ <td><strong>Symbol</strong></td>
+ <td><strong>Quantity</strong></td>
+ <td><strong>Purchase Date</strong></td>
+ <td>&nbsp;&nbsp;</td> <%-- spacer --%>
+ <td><strong>Purchase Price</strong></td>
+ <td><strong>Current Price</strong></td>
+ <td><strong>Company Name</strong></td>
+ <td><strong>Today High</strong></td>
+ <td><strong>Today Low</strong></td>
+ <td>&nbsp;&nbsp;</td> <%-- spacer --%>
+ <td> <%-- sell button --%></td>
+ </tr>
+ <sca:stockStatus id="stocksummary">
+ <FORM method="post" action='stockSale.jsp' >
+ <tr>
+ <td>
+ <jsp:getProperty name="stocksummary" property="symbol"/>
+ </td>
+ <td>
+ <jsp:getProperty name="stocksummary" property="quantity"/>
+ </td>
+ <td>
+ <jsp:getProperty name="stocksummary" property="purchaseDate"/>
+ </td>
+ <td>&nbsp;&nbsp;</td> <%-- spacer --%>
+ <td>
+ <jsp:getProperty name="stocksummary" property="purchasePrice"/>
+ </td>
+
+ <td>
+ <jsp:getProperty name="stocksummary" property="currentPrice"/>
+ </td>
+ <td>
+ <jsp:getProperty name="stocksummary" property="company"/>
+ </td>
+
+ <td>
+ <jsp:getProperty name="stocksummary" property="highPrice"/>
+ </td>
+ <td>
+ <jsp:getProperty name="stocksummary" property="lowPrice"/>
+ </td>
+ <td>&nbsp;&nbsp;</td> <%-- spacer --%>
+ <td>
+ <INPUT type="submit" name='stocksale' value="sell"><br/>
+ <input type="hidden" name="purchaseLotNumber" value='<%=((StockSummary)pageContext.getAttribute("stocksummary")).getPurchaseLotNumber()%>' />
+ </td>
+ </tr>
+ </FORM>
+ </sca:stockStatus>
+ </table>
+
+ <hr/>
+ <FORM method="post" action='accountLog.jsp'>
+ Account and Stock Logs: &nbsp;&nbsp;&nbsp;&nbsp;<INPUT type="submit" name='Logs' value="Logs"><br/>
+ </FORM>
+
+
+ </body>
+ </html>
+</sca:login>
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/test/java/bigbank/webclient/client/TestAccountService.java b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/test/java/bigbank/webclient/client/TestAccountService.java
new file mode 100644
index 0000000000..d5ece151de
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/test/java/bigbank/webclient/client/TestAccountService.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package bigbank.webclient.client;
+
+import java.util.List;
+
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+
+import com.bigbank.account.AccountReport;
+import com.bigbank.account.AccountService;
+
+public class TestAccountService {
+
+
+ public static void main(String[] args) throws Exception {
+ CompositeContext moduleContext = CurrentCompositeContext.getContext();
+
+ AccountService accountService = (AccountService) moduleContext.locateService(AccountService.class, "AccountServiceComponent");
+
+ AccountReport report = accountService.getAccountReport(12345);
+ List summaries = report.getAccountSummaries();
+
+ System.out.println("retrieved " + summaries.size() + " summaries");
+
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/bigbank/webclient/src/test/java/bigbank/webclient/client/TestLoginService.java b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/test/java/bigbank/webclient/client/TestLoginService.java
new file mode 100644
index 0000000000..9af80e99db
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/bigbank/webclient/src/test/java/bigbank/webclient/client/TestLoginService.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 bigbank.webclient.client;
+
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+
+import bigbank.webclient.services.profile.LoginService;
+
+public class TestLoginService {
+
+
+
+ public static void main(String[] args) throws Exception {
+
+ CompositeContext moduleContext = CurrentCompositeContext.getContext();
+ LoginService loginService = moduleContext.locateService(LoginService.class, "LoginServiceComponent");
+
+ if (loginService.login("test", "password") == LoginService.SUCCESS) {
+ System.out.println("Success");
+ } else {
+ System.out.println("Failure");
+ }
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/calculator/pom.xml b/branches/sca-java-integration/samples/sca/calculator/pom.xml
new file mode 100644
index 0000000000..34eb1698b2
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/calculator/pom.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.samples.sca</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>tuscany-sample-calculator</artifactId>
+ <packaging>jar</packaging>
+ <name>Apache Tuscany Calculator Sample</name>
+ <description>A sample Calculator made of several SCA components wired together.</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-api</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-core</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>calculator.CalculatorClient</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/branches/sca-java-integration/samples/sca/calculator/readme.html b/branches/sca-java-integration/samples/sca/calculator/readme.html
new file mode 100644
index 0000000000..5d4e2cfcfb
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/calculator/readme.html
@@ -0,0 +1,103 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<html>
+<head>
+ <meta http-equiv="Content-Type" content=
+ "text/html; charset=us-ascii">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+
+ <title>Tuscany Simple Calculator Sample</title>
+ <!-- LINK rel="stylesheet" href="ait.css" type="text/css" -->
+ <link rel="stylesheet" href="../../css/base.css" type="text/css">
+</head>
+
+<body>
+ <h3>Tuscany Simple Calculator Sample</h3>
+
+ <h4>Overview</h4>
+
+ <p>This sample illustrates the use of SCA to wire components together inside a composite.
+All connections between the components are local and are defined using Java interfaces.</p>
+
+ <h4>Location</h4>
+
+ <p>This sample is located &nbsp;in the
+ samples\standalone\calculator directory. All the
+ following commands should be issued while working in the sample
+ directory.</p>
+
+ <h4>Prerequisites</h4>
+
+ <p>Obtain the following prerequisites and install according to
+ their documentation.</p>
+
+ <ul>
+ <li><a href="http://java.sun.com/javase/downloads/index.jsp"
+ target="_blank">JDK 5.0</a></li>
+
+ <li><a href="http://maven.apache.org/download.html" target=
+ "_blank">Maven 2.0.4</a></li>
+ </ul>
+
+ <h4>Building</h4>
+
+ <p>To build the sample&nbsp; issue :</p>
+ <pre>
+<code>mvn<br></code>
+</pre>
+
+ <p>The result after executing is in the <span style=
+ "font-weight: bold;">target</span> subdirectory the <span style=
+ "font-weight: bold;">sample-calculator.jar</span></p>
+
+ <h4>Setup</h4>
+
+ <p>Set up the Tuscany standalone runtime environment using the
+ following command:</p>
+ <pre>
+<code>mvn dependency:unpack <br></code>
+</pre>
+
+ <p>After completion there should be a <span style=
+ "font-weight: bold;">target\distribution</span> subdirectory
+ created that has the Tuscany standalone runtime.</p>
+
+ <h4>Running</h4>
+
+ <p>Execute the following command: (<span style=
+ "font-style: italic;">cut and paste to command line</span>)</p>
+ <pre>
+<code>java -jar target/distribution/bin/launcher.jar target/sample-calculator.jar</code>
+</pre>
+
+ <h4>Results</h4>
+
+ <p>The sample when run should simply display to the standard
+ output:<br>
+<samp>
+<br>3 + 2=5.0
+<br>3 - 2=1.0
+<br>3 * 2=6.0
+<br>3 / 2=1.5
+</samp>
+</p>
+</body>
+</html>
diff --git a/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/AddService.java b/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/AddService.java
new file mode 100644
index 0000000000..4eeb30a9c2
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/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/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/AddServiceImpl.java b/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/AddServiceImpl.java
new file mode 100644
index 0000000000..ea3e5341d5
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/AddServiceImpl.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+import org.osoa.sca.annotations.EagerInit;
+import org.osoa.sca.annotations.Scope;
+
+/**
+ * An implementation of the Add service
+ */
+@Scope("COMPOSITE")
+@EagerInit
+public class AddServiceImpl implements AddService {
+
+ public double add(double n1, double n2) {
+ return n1 + n2;
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/CalculatorClient.java b/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/CalculatorClient.java
new file mode 100644
index 0000000000..7ffaeac194
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/CalculatorClient.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+import org.apache.tuscany.api.SCARuntime;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * locate the Calculator service and invoke it.
+ */
+public class CalculatorClient {
+ public static void main(String[] args) throws Exception {
+
+ SCARuntime.start("Calculator.composite");
+
+ CompositeContext context = CurrentCompositeContext.getContext();
+ CalculatorService calculatorService =
+ context.locateService(CalculatorService.class, "CalculatorServiceComponent");
+
+ // Calculate
+ System.out.println("3 + 2=" + calculatorService.add(3, 2));
+ System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
+ System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
+ System.out.println("3 / 2=" + calculatorService.divide(3, 2));
+
+ SCARuntime.stop();
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/CalculatorService.java b/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/CalculatorService.java
new file mode 100644
index 0000000000..031fa8b912
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/CalculatorService.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package 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/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/CalculatorServiceImpl.java b/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/CalculatorServiceImpl.java
new file mode 100644
index 0000000000..e9e3b7cef0
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/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.Scope;
+
+
+/**
+ * An implementation of the Calculator service.
+ */
+@Scope("COMPOSITE")
+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) {
+ return multiplyService.multiply(n1, n2);
+ }
+
+ public double divide(double n1, double n2) {
+ return divideService.divide(n1, n2);
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/DivideService.java b/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/DivideService.java
new file mode 100644
index 0000000000..131c5a8014
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/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/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/DivideServiceImpl.java b/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/DivideServiceImpl.java
new file mode 100644
index 0000000000..9c7e96a668
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/DivideServiceImpl.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 calculator;
+
+import org.osoa.sca.annotations.Scope;
+
+/**
+ * An implementation of the Divide service.
+ */
+@Scope("COMPOSITE")
+public class DivideServiceImpl implements DivideService {
+
+ public double divide(double n1, double n2) {
+ return n1 / n2;
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/MultiplyService.java b/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/MultiplyService.java
new file mode 100644
index 0000000000..a917896aeb
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/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/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/MultiplyServiceImpl.java b/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/MultiplyServiceImpl.java
new file mode 100644
index 0000000000..4892481203
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/MultiplyServiceImpl.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 calculator;
+
+import org.osoa.sca.annotations.Scope;
+
+/**
+ * An implementation of the Multiply service.
+ */
+@Scope("COMPOSITE")
+public class MultiplyServiceImpl implements MultiplyService {
+
+ public double multiply(double n1, double n2) {
+ return n1 * n2;
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/SubtractService.java b/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/SubtractService.java
new file mode 100644
index 0000000000..e328f024ea
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/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/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/SubtractServiceImpl.java b/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/SubtractServiceImpl.java
new file mode 100644
index 0000000000..ee1d7c3457
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/calculator/src/main/java/calculator/SubtractServiceImpl.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 calculator;
+
+import org.osoa.sca.annotations.Scope;
+
+/**
+ * An implementation of the subtract service.
+ */
+@Scope("COMPOSITE")
+public class SubtractServiceImpl implements SubtractService {
+
+ public double subtract(double n1, double n2) {
+ return n1 - n2;
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/calculator/src/main/resources/Calculator.composite b/branches/sca-java-integration/samples/sca/calculator/src/main/resources/Calculator.composite
new file mode 100644
index 0000000000..dd69271a0f
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/calculator/src/main/resources/Calculator.composite
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ name="Calculator">
+
+ <service name="CalculatorService">
+ <interface.java interface="calculator.CalculatorService"/>
+ <reference>CalculatorServiceComponent</reference>
+ </service>
+
+ <component name="CalculatorServiceComponent">
+ <implementation.java class="calculator.CalculatorServiceImpl"/>
+ <reference name="addService" target="AddServiceComponent"></reference>
+ <reference name="subtractService" target="SubtractServiceComponent"></reference>
+ <reference name="multiplyService" target="MultiplyServiceComponent"></reference>
+ <reference name="divideService" target="DivideServiceComponent"></reference>
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/branches/sca-java-integration/samples/sca/calculator/src/main/resources/META-INF/LICENSE.txt b/branches/sca-java-integration/samples/sca/calculator/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000000..25d78feeac
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/calculator/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/branches/sca-java-integration/samples/sca/calculator/src/main/resources/META-INF/NOTICE b/branches/sca-java-integration/samples/sca/calculator/src/main/resources/META-INF/NOTICE
new file mode 100644
index 0000000000..d48810c0ec
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/calculator/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/branches/sca-java-integration/samples/sca/calculator/src/test/java/calculator/CalculatorTestCase.java b/branches/sca-java-integration/samples/sca/calculator/src/test/java/calculator/CalculatorTestCase.java
new file mode 100644
index 0000000000..53a4b59acc
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/calculator/src/test/java/calculator/CalculatorTestCase.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.api.SCARuntime;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class CalculatorTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+
+ protected void setUp() throws Exception {
+ SCARuntime.start("Calculator.composite");
+
+ CompositeContext context = CurrentCompositeContext.getContext();
+ calculatorService = context.locateService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+
+ protected void tearDown() throws Exception {
+ SCARuntime.stop();
+ }
+
+ public void testCalculator() throws Exception {
+ // Calculate
+ assertEquals(calculatorService.add(3, 2), 5.0);
+ assertEquals(calculatorService.subtract(3, 2), 1.0);
+ assertEquals(calculatorService.multiply(3, 2), 6.0);
+ assertEquals(calculatorService.divide(3, 2), 1.5);
+
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/composite-impl/pom.xml b/branches/sca-java-integration/samples/sca/composite-impl/pom.xml
new file mode 100644
index 0000000000..e828bd48f2
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/composite-impl/pom.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.samples.sca</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>tuscany-sample-composite-impl</artifactId>
+ <packaging>jar</packaging>
+ <name>Apache Tuscany Composite Implementation Sample</name>
+ <description>A sample showing local wiring of a component implemented by a composite.</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-api</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-core</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>composite.CompositeClient</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/CompositeClient.java b/branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/CompositeClient.java
new file mode 100644
index 0000000000..7543b68a29
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/CompositeClient.java
@@ -0,0 +1,26 @@
+package composite;
+
+import org.apache.tuscany.api.SCARuntime;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+/**
+ * Simple client program that invokes the components that we wired together.
+ *
+ * @version $Rev$ $Date$
+ */
+public class CompositeClient {
+
+ public static void main(String[] args) throws Exception {
+ SCARuntime.start("OuterComposite.composite");
+
+ CompositeContext context = CurrentCompositeContext.getContext();
+
+ Source source = context.locateService(Source.class, "SourceComponent/InnerSourceService");
+ System.out.println("Main thread " + Thread.currentThread());
+ source.clientMethod("Client.main");
+ Thread.sleep(500);
+
+ SCARuntime.stop();
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/Source.java b/branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/Source.java
new file mode 100644
index 0000000000..d0efcc1df1
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/Source.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package composite;
+
+public interface Source {
+
+ void clientMethod(String arg);
+}
diff --git a/branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/SourceCallback.java b/branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/SourceCallback.java
new file mode 100644
index 0000000000..baa95a8e39
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/SourceCallback.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package composite;
+
+public interface SourceCallback {
+
+ void receiveResult(String result);
+}
diff --git a/branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/SourceImpl.java b/branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/SourceImpl.java
new file mode 100644
index 0000000000..b9a0c7ff74
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/SourceImpl.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 composite;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+
+@Service(Source.class)
+@Scope("COMPOSITE")
+public class SourceImpl implements Source, SourceCallback {
+
+ private Target targetReference;
+ private Target targetReference2;
+
+ @Reference
+ public void setTargetReference(Target target) {
+ this.targetReference = target;
+ }
+
+ @Reference
+ public void setTargetReference2(Target target) {
+ this.targetReference2 = target;
+ }
+
+ public void clientMethod(String arg) {
+ System.out.println("Source: " + arg + " -> Source.clientMethod");
+ targetReference.someMethod(arg + " -> Source.clientMethod");
+
+ System.out.println("Source: " + arg + " => Source.clientMethod2");
+ targetReference2.someMethod(arg + " => Source.clientMethod2");
+ }
+
+ public void receiveResult(String result) {
+ System.out.println("Work thread " + Thread.currentThread());
+ System.out.println("Result: " + result);
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/Target.java b/branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/Target.java
new file mode 100644
index 0000000000..9a8f68a7fa
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/Target.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 composite;
+
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.OneWay;
+
+
+@Callback(SourceCallback.class)
+public interface Target {
+
+ @OneWay
+ void someMethod(String arg);
+}
diff --git a/branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/TargetImpl.java b/branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/TargetImpl.java
new file mode 100644
index 0000000000..86686e9233
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/TargetImpl.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package composite;
+
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+
+@Service(Target.class)
+@Scope("COMPOSITE")
+public class TargetImpl implements Target {
+
+ private SourceCallback sourceCallback;
+
+ @Callback
+ public void setSourceCallback(SourceCallback sourceCallback) {
+ this.sourceCallback = sourceCallback;
+ }
+
+ public void someMethod(String arg) {
+ System.out.println("Target: " + arg);
+ sourceCallback.receiveResult(arg + " -> Target.someMethod");
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/composite-impl/src/main/resources/InnerComposite.composite b/branches/sca-java-integration/samples/sca/composite-impl/src/main/resources/InnerComposite.composite
new file mode 100644
index 0000000000..fbb32febfb
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/composite-impl/src/main/resources/InnerComposite.composite
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ name="InnerComposite">
+
+ <service name="InnerSourceService" target="InnerSourceComponent">
+ <interface.java interface="composite.Source"/>
+ <reference name="innerSource">InnerSourceComponent</reference>
+ </service>
+
+ <component name="InnerSourceComponent">
+ <implementation.java class="composite.SourceImpl"/>
+ <!--reference name="targetReference">TargetComponentRef</reference>
+ <reference name="targetReference2">TargetComponentRef2</reference-->
+ </component>
+
+ <reference name="TargetComponentRef" promote="InnerSourceComponent/targetReference">
+ <interface.java interface="composite.Target"
+ callbackInterface="composite.SourceCallback"/>
+ </reference>
+
+ <reference name="TargetComponentRef2" promote="InnerSourceComponent/targetReference2">
+ <interface.java interface="composite.Target"
+ callbackInterface="composite.SourceCallback"/>
+ </reference>
+
+</composite>
diff --git a/branches/sca-java-integration/samples/sca/composite-impl/src/main/resources/InnerComposite2.composite b/branches/sca-java-integration/samples/sca/composite-impl/src/main/resources/InnerComposite2.composite
new file mode 100644
index 0000000000..b4c64b39e3
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/composite-impl/src/main/resources/InnerComposite2.composite
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ name="InnerComposite2">
+
+ <service name="InnerTargetService" target="InnerTargetComponent">
+ <interface.java interface="composite.Target"
+ callbackInterface="composite.SourceCallback"/>
+ <reference name="innerSource">InnerTargetComponent</reference>
+ </service>
+
+ <component name="InnerTargetComponent">
+ <implementation.java class="composite.TargetImpl"/>
+ </component>
+
+</composite>
diff --git a/branches/sca-java-integration/samples/sca/composite-impl/src/main/resources/META-INF/LICENSE.txt b/branches/sca-java-integration/samples/sca/composite-impl/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000000..25d78feeac
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/composite-impl/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/branches/sca-java-integration/samples/sca/composite-impl/src/main/resources/META-INF/NOTICE b/branches/sca-java-integration/samples/sca/composite-impl/src/main/resources/META-INF/NOTICE
new file mode 100644
index 0000000000..d48810c0ec
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/composite-impl/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/branches/sca-java-integration/samples/sca/composite-impl/src/main/resources/OuterComposite.composite b/branches/sca-java-integration/samples/sca/composite-impl/src/main/resources/OuterComposite.composite
new file mode 100644
index 0000000000..ad027b0de1
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/composite-impl/src/main/resources/OuterComposite.composite
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ name="OuterComposite">
+
+ <component name="SourceComponent">
+ <implementation.composite name="InnerComposite" scdlLocation="InnerComposite.composite"/>
+ <reference name="TargetComponentRef" target="TargetComponent"></reference>
+ <reference name="TargetComponentRef2" target="TargetComponent2/InnerTargetService"></reference>
+ </component>
+
+ <component name="TargetComponent">
+ <implementation.java class="composite.TargetImpl"/>
+ </component>
+
+ <component name="TargetComponent2">
+ <implementation.composite name="InnerComposite2" scdlLocation="InnerComposite2.composite"/>
+ </component>
+
+</composite>
diff --git a/branches/sca-java-integration/samples/sca/composite-impl/src/test/java/composite/CompositeTestCase.java b/branches/sca-java-integration/samples/sca/composite-impl/src/test/java/composite/CompositeTestCase.java
new file mode 100644
index 0000000000..383150fef9
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/composite-impl/src/test/java/composite/CompositeTestCase.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package composite;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.api.SCARuntime;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+public class CompositeTestCase extends TestCase {
+
+ private Source source;
+
+ protected void setUp() throws Exception {
+ SCARuntime.start("OuterComposite.composite");
+
+ CompositeContext context = CurrentCompositeContext.getContext();
+ source = context.locateService(Source.class, "SourceComponent/InnerSourceService");
+ }
+
+ protected void tearDown() throws Exception {
+ SCARuntime.stop();
+ }
+
+ public void test() throws Exception {
+ try {
+ System.out.println("Main thread " + Thread.currentThread());
+ source.clientMethod("Client.main");
+ System.out.println("Sleeping ...");
+ Thread.sleep(1000);
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-binding/.ruleset b/branches/sca-java-integration/samples/sca/echo-binding/.ruleset
new file mode 100644
index 0000000000..a1547fea92
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-binding/.ruleset
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<ruleset name="pmd-eclipse">
+ <description>PMD Plugin preferences rule set</description>
+
+
+ <rule ref="rulesets/basic.xml/BooleanInstantiation"/>
+ <rule ref="rulesets/basic.xml/CollapsibleIfStatements"/>
+ <rule ref="rulesets/basic.xml/DoubleCheckedLocking"/>
+<!--<rule ref="rulesets/basic.xml/EmptyCatchBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyFinallyBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyIfStmt"/>-->
+ <rule ref="rulesets/basic.xml/EmptyStatementNotInLoop"/>
+<!--<rule ref="rulesets/basic.xml/EmptyStaticInitializer"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptySwitchStatements"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptySynchronizedBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyTryBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyWhileStmt"/>-->
+ <rule ref="rulesets/basic.xml/ForLoopShouldBeWhileLoop"/>
+ <rule ref="rulesets/basic.xml/JumbledIncrementer"/>
+<!--<rule ref="rulesets/basic.xml/OverrideBothEqualsAndHashcode"/>-->
+ <rule ref="rulesets/basic.xml/ReturnFromFinallyBlock"/>
+ <rule ref="rulesets/basic.xml/UnconditionalIfStatement"/>
+ <rule ref="rulesets/basic.xml/UnnecessaryConversionTemporary"/>
+ <rule ref="rulesets/basic.xml/UnnecessaryFinalModifier"/>
+ <rule ref="rulesets/basic.xml/UnnecessaryReturn"/>
+<!--<rule ref="rulesets/basic.xml/UselessOverridingMethod"/>-->
+
+<!--<rule ref="rulesets/braces.xml/ForLoopsMustUseBraces"/>-->
+<!--<rule ref="rulesets/braces.xml/IfElseStmtsMustUseBraces"/>-->
+<!--<rule ref="rulesets/braces.xml/IfStmtsMustUseBraces"/>-->
+<!--<rule ref="rulesets/braces.xml/WhileLoopsMustUseBraces"/>-->
+
+<!--<rule ref="rulesets/clone.xml/CloneMethodMustImplementCloneable"/>-->
+<!--<rule ref="rulesets/clone.xml/CloneThrowsCloneNotSupportedException"/>-->
+<!--<rule ref="rulesets/clone.xml/ProperCloneImplementation"/>-->
+
+<!--<rule ref="rulesets/codesize.xml/CyclomaticComplexity"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessiveClassLength"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessiveMethodLength"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessiveParameterList"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessivePublicCount"/>-->
+<!--<rule ref="rulesets/codesize.xml/TooManyFields"/>-->
+
+<!--<rule ref="rulesets/controversial.xml/AssignmentInOperand"/>-->
+<!--<rule ref="rulesets/controversial.xml/AtLeastOneConstructor"/>-->
+<!--<rule ref="rulesets/controversial.xml/CallSuperInConstructor"/>-->
+<!--<rule ref="rulesets/controversial.xml/DontImportSun"/>-->
+<!--<rule ref="rulesets/controversial.xml/NullAssignment"/>-->
+<!--<rule ref="rulesets/controversial.xml/OnlyOneReturn"/>-->
+<!--<rule ref="rulesets/controversial.xml/SingularField"/>-->
+<!--<rule ref="rulesets/controversial.xml/SuspiciousOctalEscape"/>-->
+<!--<rule ref="rulesets/controversial.xml/UnnecessaryConstructor"/>-->
+<rule ref="rulesets/controversial.xml/UnnecessaryParentheses"/>
+<!--<rule ref="rulesets/controversial.xml/UnusedModifier"/>-->
+
+<!--<rule ref="rulesets/coupling.xml/CouplingBetweenObjects"/>-->
+<!--<rule ref="rulesets/coupling.xml/ExcessiveImports"/>-->
+<!--<rule ref="rulesets/coupling.xml/LooseCoupling"/>-->
+
+<!--<rule ref="rulesets/design.xml/AbstractClassWithoutAbstractMethod"/>-->
+<!--<rule ref="rulesets/design.xml/AccessorClassGeneration"/>-->
+<!--<rule ref="rulesets/design.xml/AssignmentToNonFinalStatic"/>-->
+<!--<rule ref="rulesets/design.xml/AvoidDeeplyNestedIfStmts"/>-->
+<!--<rule ref="rulesets/design.xml/AvoidInstanceofChecksInCatchClause"/>-->
+<rule ref="rulesets/design.xml/AvoidProtectedFieldInFinalClass"/>
+<!--<rule ref="rulesets/design.xml/AvoidReassigningParameters"/>-->
+<!--<rule ref="rulesets/design.xml/AvoidSynchronizedAtMethodLevel"/>-->
+<!--<rule ref="rulesets/design.xml/BadComparison"/>-->
+<!--<rule ref="rulesets/design.xml/CloseConnection"/>-->
+<!--<rule ref="rulesets/design.xml/CompareObjectsWithEquals"/>-->
+<!--<rule ref="rulesets/design.xml/ConfusingTernary"/>-->
+<rule ref="rulesets/design.xml/ConstructorCallsOverridableMethod"/>
+<!--<rule ref="rulesets/design.xml/DefaultLabelNotLastInSwitchStmt"/>-->
+<!--<rule ref="rulesets/design.xml/FinalFieldCouldBeStatic"/>-->
+<rule ref="rulesets/design.xml/IdempotentOperations"/>
+<!--<rule ref="rulesets/design.xml/ImmutableField"/>-->
+<!--<rule ref="rulesets/design.xml/InstantiationToGetClass"/>-->
+<!--<rule ref="rulesets/design.xml/MissingBreakInSwitch"/>-->
+<!--<rule ref="rulesets/design.xml/MissingStaticMethodInNonInstantiatableClass"/>-->
+<!--<rule ref="rulesets/design.xml/NonCaseLabelInSwitchStatement"/>-->
+<!--<rule ref="rulesets/design.xml/NonStaticInitializer"/>-->
+<rule ref="rulesets/design.xml/OptimizableToArrayCall"/>
+<rule ref="rulesets/design.xml/PositionLiteralsFirstInComparisons"/>
+<rule ref="rulesets/design.xml/SimplifyBooleanExpressions"/>
+<rule ref="rulesets/design.xml/SimplifyBooleanReturns"/>
+<rule ref="rulesets/design.xml/SimplifyConditional"/>
+<!--<rule ref="rulesets/design.xml/SwitchDensity"/>-->
+<!--<rule ref="rulesets/design.xml/SwitchStmtsShouldHaveDefault"/>-->
+<rule ref="rulesets/design.xml/UnnecessaryLocalBeforeReturn"/>
+<!--<rule ref="rulesets/design.xml/UseLocaleWithCaseConversions"/>-->
+<!--<rule ref="rulesets/design.xml/UseNotifyAllInsteadOfNotify"/>-->
+<!--<rule ref="rulesets/design.xml/UseSingleton"/>-->
+
+<!--<rule ref="rulesets/finalizers.xml/EmptyFinalizer"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeOnlyCallsSuperFinalize"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeOverloaded"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeDoesNotCallSuperFinalize"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeShouldBeProtected"/>-->
+<!--<rule ref="rulesets/finalizers.xml/AvoidCallingFinalize"/>-->
+
+<!--<rule ref="rulesets/imports.xml/DuplicateImports"/>-->
+<!--<rule ref="rulesets/imports.xml/DontImportJavaLang"/>-->
+<!--<rule ref="rulesets/imports.xml/UnusedImports"/>-->
+<!--<rule ref="rulesets/imports.xml/ImportFromSamePackage"/>-->
+
+<!--<rule ref="rulesets/javabeans.xml/BeanMembersShouldSerialize"/>-->
+<!--<rule ref="rulesets/javabeans.xml/MissingSerialVersionUID"/>-->
+
+<!--<rule ref="rulesets/junit.xml/JUnitStaticSuite"/>-->
+<!--<rule ref="rulesets/junit.xml/JUnitSpelling"/>-->
+<!--<rule ref="rulesets/junit.xml/JUnitAssertionsShouldIncludeMessage"/>-->
+<!--<rule ref="rulesets/junit.xml/JUnitTestsShouldIncludeAssert"/>-->
+<!--<rule ref="rulesets/junit.xml/TestClassWithoutTestCases"/>-->
+<!--<rule ref="rulesets/junit.xml/UnnecessaryBooleanAssertion"/>-->
+<!--<rule ref="rulesets/junit.xml/UseAssertEqualsInsteadOfAssertTrue"/>-->
+<!--<rule ref="rulesets/junit.xml/UseAssertSameInsteadOfAssertTrue"/>-->
+
+ <!--<rule ref="rulesets/logging-java.xml/AvoidPrintStackTrace"/>-->
+ <!--<rule ref="rulesets/logging-java.xml/LoggerIsNotStaticFinal"/>-->
+ <!--<rule ref="rulesets/logging-java.xml/MoreThanOneLogger"/>-->
+ <!--<rule ref="rulesets/logging-java.xml/LoggerIsNotStaticFinal"/>-->
+ <!--<rule ref="rulesets/logging-java.xml/LogBlockWithoutIf"/>-->
+ <!--<rule ref="rulesets/logging-java.xml/SystemPrintln"/>-->
+ <!--<rule ref="rulesets/logging-jakarta-commons.xml/UseCorrectExceptionLogging"/>-->
+ <!--<rule ref="rulesets/logging-jakarta-commons.xml/ProperLogger"/>-->
+
+ <!--<rule ref="rulesets/naming.xml/ShortVariable"/>-->
+ <!--<rule ref="rulesets/naming.xml/LongVariable"/>-->
+ <!--<rule ref="rulesets/naming.xml/ShortMethodName"/>-->
+ <!--<rule ref="rulesets/naming.xml/VariableNamingConventions"/>-->
+ <!--<rule ref="rulesets/naming.xml/MethodNamingConventions"/>-->
+ <!--<rule ref="rulesets/naming.xml/ClassNamingConventions"/>-->
+ <!--<rule ref="rulesets/naming.xml/AbstractNaming"/>-->
+ <!--<rule ref="rulesets/naming.xml/AvoidDollarSigns"/>-->
+ <!--<rule ref="rulesets/naming.xml/MethodWithSameNameAsEnclosingClass"/>-->
+ <!--<rule ref="rulesets/naming.xml/SuspiciousHashcodeMethodName"/>-->
+ <!--<rule ref="rulesets/naming.xml/SuspiciousConstantFieldName"/>-->
+ <!--<rule ref="rulesets/naming.xml/AvoidFieldNameMatchingTypeName"/>-->
+ <!--<rule ref="rulesets/naming.xml/AvoidFieldNameMatchingMethodName"/>-->
+ <!--<rule ref="rulesets/naming.xml/AvoidNonConstructorMethodsWithClassName"/>-->
+ <!--<rule ref="rulesets/naming.xml/NoPackage"/>-->
+ <!--<rule ref="rulesets/naming.xml/PackageCase"/>-->
+
+ <!--<rule ref="rulesets/optimizations.xml/LocalVariableCouldBeFinal"/>-->
+ <!--<rule ref="rulesets/optimizations.xml/MethodArgumentCouldBeFinal"/>-->
+ <!--<rule ref="rulesets/optimizations.xml/AvoidInstantiatingObjectsInLoops"/>-->
+ <!--<rule ref="rulesets/optimizations.xml/UseArrayListInsteadOfVector"/>-->
+ <!--<rule ref="rulesets/optimizations.xml/SimplifyStartsWith"/>-->
+ <!--<rule ref="rulesets/optimizations.xml/UseStringBufferForStringAppends"/>-->
+
+ <!--<rule ref="rulesets/strictexception.xml/AvoidCatchingThrowable"/>-->
+ <!--<rule ref="rulesets/strictexception.xml/SignatureDeclareThrowsException"/>-->
+ <!--<rule ref="rulesets/strictexception.xml/ExceptionAsFlowControl"/>-->
+ <!--<rule ref="rulesets/strictexception.xml/AvoidCatchingNPE"/>-->
+ <!--<rule ref="rulesets/strictexception.xml/AvoidThrowingRawExceptionTypes"/>-->
+ <!--<rule ref="rulesets/strictexception.xml/AvoidThrowingNullPointerException"/>-->
+
+ <!--<rule ref="rulesets/strings.xml/AvoidDuplicateLiterals"/>-->
+ <!--<rule ref="rulesets/strings.xml/StringInstantiation"/>-->
+ <!--<rule ref="rulesets/strings.xml/StringToString"/>-->
+ <!--<rule ref="rulesets/strings.xml/AvoidConcatenatingNonLiteralsInStringBuffer"/>-->
+ <!--<rule ref="rulesets/strings.xml/UnnecessaryCaseChange"/>-->
+
+ <!--<rule ref="rulesets/sunsecure.xml/MethodReturnsInternalArray"/>-->
+ <!--<rule ref="rulesets/sunsecure.xml/ArrayIsStoredDirectly"/>-->
+
+ <rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"/>
+ <rule ref="rulesets/unusedcode.xml/UnusedPrivateField"/>
+ <rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod"/>
+ <!--<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter"/>-->
+
+</ruleset>
diff --git a/branches/sca-java-integration/samples/sca/echo-binding/NOTICE.txt b/branches/sca-java-integration/samples/sca/echo-binding/NOTICE.txt
new file mode 100644
index 0000000000..d83ebbe236
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-binding/NOTICE.txt
@@ -0,0 +1,14 @@
+${pom.name}
+Copyright (c) 2005 - 2006 The Apache Software Foundation
+
+Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/branches/sca-java-integration/samples/sca/echo-binding/pom.xml b/branches/sca-java-integration/samples/sca/echo-binding/pom.xml
new file mode 100644
index 0000000000..e5bbb15a48
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-binding/pom.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+
+ <parent>
+ <groupId>org.apache.tuscany.samples.sca</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>tuscany-sample-echo-binding</artifactId>
+ <name>Apache Tuscany Echo Binding Sample</name>
+ <description>A Sample Binding Extension</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-api</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-core</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-spi</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoBinding.java b/branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoBinding.java
new file mode 100644
index 0000000000..dbab7cb4b5
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoBinding.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package echo;
+
+import org.apache.tuscany.spi.model.BindingDefinition;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoBinding extends BindingDefinition {
+ public Object clone() {
+ return this;
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoBindingLoader.java b/branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoBindingLoader.java
new file mode 100644
index 0000000000..b01510bc74
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoBindingLoader.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 echo;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import static org.osoa.sca.Constants.SCA_NS;
+import org.osoa.sca.annotations.Constructor;
+
+import org.apache.tuscany.spi.annotation.Autowire;
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.deployer.DeploymentContext;
+import org.apache.tuscany.spi.extension.LoaderExtension;
+import org.apache.tuscany.spi.loader.LoaderException;
+import org.apache.tuscany.spi.loader.LoaderRegistry;
+import org.apache.tuscany.spi.model.ModelObject;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoBindingLoader extends LoaderExtension<EchoBinding> {
+
+ public static final QName BINDING_ECHO = new QName(SCA_NS, "binding.echo");
+
+ @Constructor
+ public EchoBindingLoader(@Autowire LoaderRegistry registry) {
+ super(registry);
+ }
+
+ public QName getXMLType() {
+ return BINDING_ECHO;
+ }
+
+ public EchoBinding load(CompositeComponent parent,
+ ModelObject object,
+ XMLStreamReader reader,
+ DeploymentContext context) throws XMLStreamException, LoaderException {
+ return new EchoBinding();
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoBuilder.java b/branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoBuilder.java
new file mode 100644
index 0000000000..7cf1b35617
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoBuilder.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package echo;
+
+import org.apache.tuscany.spi.builder.BuilderException;
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.component.ReferenceBinding;
+import org.apache.tuscany.spi.component.ServiceBinding;
+import org.apache.tuscany.spi.deployer.DeploymentContext;
+import org.apache.tuscany.spi.extension.BindingBuilderExtension;
+import org.apache.tuscany.spi.model.AbstractReferenceDefinition;
+import org.apache.tuscany.spi.model.ServiceDefinition;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoBuilder extends BindingBuilderExtension<EchoBinding> {
+
+ public ServiceBinding build(CompositeComponent parent,
+ ServiceDefinition boundServiceDefinition,
+ EchoBinding bindingDefinition,
+ DeploymentContext deploymentContext) throws BuilderException {
+ return new EchoService(boundServiceDefinition.getName(), parent);
+ }
+
+ public ReferenceBinding build(CompositeComponent parent,
+ AbstractReferenceDefinition boundReferenceDefinition,
+ EchoBinding bindingDefinition,
+ DeploymentContext deploymentContext) throws BuilderException {
+ return new EchoReference(boundReferenceDefinition.getName(), parent);
+ }
+
+ protected Class<EchoBinding> getBindingType() {
+ return EchoBinding.class;
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoInvoker.java b/branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoInvoker.java
new file mode 100644
index 0000000000..83c3dd824d
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoInvoker.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package echo;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.apache.tuscany.spi.wire.InvocationRuntimeException;
+import org.apache.tuscany.spi.wire.Message;
+import org.apache.tuscany.spi.wire.TargetInvoker;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoInvoker implements TargetInvoker {
+
+ private boolean cacheable;
+
+ public boolean isCacheable() {
+ return cacheable;
+ }
+
+ public void setCacheable(boolean cacheable) {
+ this.cacheable = cacheable;
+ }
+
+ public boolean isOptimizable() {
+ return isCacheable();
+ }
+
+ public Object invokeTarget(final Object payload, final short sequence) throws InvocationTargetException {
+ // echo back the result, a real binding would invoke some API for flowing the request
+ return ((Object[])payload)[0];
+ }
+
+ public Message invoke(Message msg) throws InvocationRuntimeException {
+ try {
+ Object resp = invokeTarget(msg.getBody(), NONE);
+ msg.setBody(resp);
+ } catch (InvocationTargetException e) {
+ msg.setBodyWithFault(e.getCause());
+ } catch (Throwable e) {
+ msg.setBodyWithFault(e);
+ }
+ return msg;
+ }
+
+ public Object clone() throws CloneNotSupportedException {
+ return super.clone();
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoReference.java b/branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoReference.java
new file mode 100644
index 0000000000..5d9f5329f5
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoReference.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package echo;
+
+import javax.xml.namespace.QName;
+
+import static org.osoa.sca.Constants.SCA_NS;
+
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.extension.ReferenceBindingExtension;
+import org.apache.tuscany.spi.model.Operation;
+import org.apache.tuscany.spi.model.ServiceContract;
+import org.apache.tuscany.spi.wire.TargetInvoker;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoReference extends ReferenceBindingExtension {
+ private static final QName BINDING_ECHO = new QName(SCA_NS, "binding.echo");
+
+ public EchoReference(String name, CompositeComponent parent) {
+ super(name, parent);
+ }
+
+ public QName getBindingType() {
+ return BINDING_ECHO;
+ }
+
+ public TargetInvoker createTargetInvoker(ServiceContract contract, Operation operation) {
+ return new EchoInvoker();
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoService.java b/branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoService.java
new file mode 100644
index 0000000000..084777a632
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-binding/src/main/java/echo/EchoService.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package echo;
+
+import javax.xml.namespace.QName;
+
+import static org.osoa.sca.Constants.SCA_NS;
+
+import org.apache.tuscany.spi.CoreRuntimeException;
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.extension.ServiceBindingExtension;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoService extends ServiceBindingExtension {
+ private static final QName BINDING_ECHO = new QName(SCA_NS, "binding.echo");
+
+ public EchoService(String name, CompositeComponent parent) throws CoreRuntimeException {
+ super(name, parent);
+ // do nothing, but this could register with the host environment
+ }
+
+
+ public QName getBindingType() {
+ return BINDING_ECHO;
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-binding/src/main/resources/META-INF/sca/extension.composite b/branches/sca-java-integration/samples/sca/echo-binding/src/main/resources/META-INF/sca/extension.composite
new file mode 100644
index 0000000000..12e295bee7
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-binding/src/main/resources/META-INF/sca/extension.composite
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!--
+ JavaScript configuration for the launcher environment.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:system="http://tuscany.apache.org/xmlns/system/1.0-SNAPSHOT"
+
+ name="echobinding-extension">
+
+ <component name="BindingLoader">
+ <system:implementation.system class="echo.EchoBindingLoader"/>
+ </component>
+
+ <component name="BindingBuilder">
+ <system:implementation.system class="echo.EchoBuilder"/>
+ </component>
+
+</composite>
diff --git a/branches/sca-java-integration/samples/sca/echo-binding/src/test/java/echo/Client.java b/branches/sca-java-integration/samples/sca/echo-binding/src/test/java/echo/Client.java
new file mode 100644
index 0000000000..46c4f760d0
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-binding/src/test/java/echo/Client.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 echo;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface Client {
+
+ void call(String msg);
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-binding/src/test/java/echo/ClientImpl.java b/branches/sca-java-integration/samples/sca/echo-binding/src/test/java/echo/ClientImpl.java
new file mode 100644
index 0000000000..f66d84cc4f
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-binding/src/test/java/echo/ClientImpl.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 echo;
+
+import org.osoa.sca.annotations.Constructor;
+import org.osoa.sca.annotations.Reference;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ClientImpl implements Client {
+
+ private Echo echoReference;
+
+ @Constructor
+ public ClientImpl(@Reference(name = "echoReference", required = true) Echo echoReference) {
+ this.echoReference = echoReference;
+ }
+
+ public void call(String msg) {
+ String ret = echoReference.invoke(msg);
+ System.out.println("Returned message: "+ ret);
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-binding/src/test/java/echo/Echo.java b/branches/sca-java-integration/samples/sca/echo-binding/src/test/java/echo/Echo.java
new file mode 100644
index 0000000000..045609853a
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-binding/src/test/java/echo/Echo.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 echo;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface Echo {
+
+ String invoke(String msg);
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-binding/src/test/java/echo/EchoBindingTestCase.java b/branches/sca-java-integration/samples/sca/echo-binding/src/test/java/echo/EchoBindingTestCase.java
new file mode 100644
index 0000000000..8526924253
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-binding/src/test/java/echo/EchoBindingTestCase.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package echo;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.api.SCARuntime;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoBindingTestCase extends TestCase {
+
+ private Client client;
+
+ public void testEchoBinding() {
+ client.call("foo");
+ }
+
+ protected void setUp() throws Exception {
+ SCARuntime.start("EchoBinding.composite");
+ CompositeContext context = CurrentCompositeContext.getContext();
+ client = context.locateService(Client.class, "Client");
+ }
+
+ protected void tearDown() throws Exception {
+ SCARuntime.stop();
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-binding/src/test/resources/EchoBinding.composite b/branches/sca-java-integration/samples/sca/echo-binding/src/test/resources/EchoBinding.composite
new file mode 100644
index 0000000000..b4e214869e
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-binding/src/test/resources/EchoBinding.composite
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" name="echo">
+
+ <service name="ClientService">
+ <interface.java class="echo.Client"/>
+ <binding.echo/>
+ <reference>Client</reference>
+ </service>
+
+ <component name="Client">
+ <implementation.java class="echo.ClientImpl"/>
+ </component>
+
+ <reference name="EchoReference" promote="Client">
+ <interface.java interface="echo.Echo"/>
+ <binding.echo/>
+ </reference>
+
+</composite>
diff --git a/branches/sca-java-integration/samples/sca/echo-databinding/.ruleset b/branches/sca-java-integration/samples/sca/echo-databinding/.ruleset
new file mode 100644
index 0000000000..42a6f1be38
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-databinding/.ruleset
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<ruleset name="pmd-eclipse">
+ <description>PMD Plugin preferences rule set</description>
+
+
+ <rule ref="rulesets/basic.xml/BooleanInstantiation"/>
+ <rule ref="rulesets/basic.xml/CollapsibleIfStatements"/>
+ <rule ref="rulesets/basic.xml/DoubleCheckedLocking"/>
+<!--<rule ref="rulesets/basic.xml/EmptyCatchBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyFinallyBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyIfStmt"/>-->
+ <rule ref="rulesets/basic.xml/EmptyStatementNotInLoop"/>
+<!--<rule ref="rulesets/basic.xml/EmptyStaticInitializer"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptySwitchStatements"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptySynchronizedBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyTryBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyWhileStmt"/>-->
+ <rule ref="rulesets/basic.xml/ForLoopShouldBeWhileLoop"/>
+ <rule ref="rulesets/basic.xml/JumbledIncrementer"/>
+<!--<rule ref="rulesets/basic.xml/OverrideBothEqualsAndHashcode"/>-->
+ <rule ref="rulesets/basic.xml/ReturnFromFinallyBlock"/>
+ <rule ref="rulesets/basic.xml/UnconditionalIfStatement"/>
+ <rule ref="rulesets/basic.xml/UnnecessaryConversionTemporary"/>
+ <rule ref="rulesets/basic.xml/UnnecessaryFinalModifier"/>
+ <rule ref="rulesets/basic.xml/UnnecessaryReturn"/>
+<!--<rule ref="rulesets/basic.xml/UselessOverridingMethod"/>-->
+
+<!--<rule ref="rulesets/braces.xml/ForLoopsMustUseBraces"/>-->
+<!--<rule ref="rulesets/braces.xml/IfElseStmtsMustUseBraces"/>-->
+<!--<rule ref="rulesets/braces.xml/IfStmtsMustUseBraces"/>-->
+<!--<rule ref="rulesets/braces.xml/WhileLoopsMustUseBraces"/>-->
+
+<!--<rule ref="rulesets/clone.xml/CloneMethodMustImplementCloneable"/>-->
+<!--<rule ref="rulesets/clone.xml/CloneThrowsCloneNotSupportedException"/>-->
+<!--<rule ref="rulesets/clone.xml/ProperCloneImplementation"/>-->
+
+<!--<rule ref="rulesets/codesize.xml/CyclomaticComplexity"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessiveClassLength"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessiveMethodLength"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessiveParameterList"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessivePublicCount"/>-->
+<!--<rule ref="rulesets/codesize.xml/TooManyFields"/>-->
+
+<!--<rule ref="rulesets/controversial.xml/AssignmentInOperand"/>-->
+<!--<rule ref="rulesets/controversial.xml/AtLeastOneConstructor"/>-->
+<!--<rule ref="rulesets/controversial.xml/CallSuperInConstructor"/>-->
+<!--<rule ref="rulesets/controversial.xml/DontImportSun"/>-->
+<!--<rule ref="rulesets/controversial.xml/NullAssignment"/>-->
+<!--<rule ref="rulesets/controversial.xml/OnlyOneReturn"/>-->
+<!--<rule ref="rulesets/controversial.xml/SingularField"/>-->
+<!--<rule ref="rulesets/controversial.xml/SuspiciousOctalEscape"/>-->
+<!--<rule ref="rulesets/controversial.xml/UnnecessaryConstructor"/>-->
+<rule ref="rulesets/controversial.xml/UnnecessaryParentheses"/>
+<!--<rule ref="rulesets/controversial.xml/UnusedModifier"/>-->
+
+<!--<rule ref="rulesets/coupling.xml/CouplingBetweenObjects"/>-->
+<!--<rule ref="rulesets/coupling.xml/ExcessiveImports"/>-->
+<!--<rule ref="rulesets/coupling.xml/LooseCoupling"/>-->
+
+<!--<rule ref="rulesets/design.xml/AbstractClassWithoutAbstractMethod"/>-->
+<!--<rule ref="rulesets/design.xml/AccessorClassGeneration"/>-->
+<!--<rule ref="rulesets/design.xml/AssignmentToNonFinalStatic"/>-->
+<!--<rule ref="rulesets/design.xml/AvoidDeeplyNestedIfStmts"/>-->
+<!--<rule ref="rulesets/design.xml/AvoidInstanceofChecksInCatchClause"/>-->
+<rule ref="rulesets/design.xml/AvoidProtectedFieldInFinalClass"/>
+<!--<rule ref="rulesets/design.xml/AvoidReassigningParameters"/>-->
+<!--<rule ref="rulesets/design.xml/AvoidSynchronizedAtMethodLevel"/>-->
+<!--<rule ref="rulesets/design.xml/BadComparison"/>-->
+<!--<rule ref="rulesets/design.xml/CloseConnection"/>-->
+<!--<rule ref="rulesets/design.xml/CompareObjectsWithEquals"/>-->
+<!--<rule ref="rulesets/design.xml/ConfusingTernary"/>-->
+<rule ref="rulesets/design.xml/ConstructorCallsOverridableMethod"/>
+<!--<rule ref="rulesets/design.xml/DefaultLabelNotLastInSwitchStmt"/>-->
+<!--<rule ref="rulesets/design.xml/FinalFieldCouldBeStatic"/>-->
+<rule ref="rulesets/design.xml/IdempotentOperations"/>
+<!--<rule ref="rulesets/design.xml/ImmutableField"/>-->
+<!--<rule ref="rulesets/design.xml/InstantiationToGetClass"/>-->
+<!--<rule ref="rulesets/design.xml/MissingBreakInSwitch"/>-->
+<!--<rule ref="rulesets/design.xml/MissingStaticMethodInNonInstantiatableClass"/>-->
+<!--<rule ref="rulesets/design.xml/NonCaseLabelInSwitchStatement"/>-->
+<!--<rule ref="rulesets/design.xml/NonStaticInitializer"/>-->
+<rule ref="rulesets/design.xml/OptimizableToArrayCall"/>
+<rule ref="rulesets/design.xml/PositionLiteralsFirstInComparisons"/>
+<rule ref="rulesets/design.xml/SimplifyBooleanExpressions"/>
+<rule ref="rulesets/design.xml/SimplifyBooleanReturns"/>
+<rule ref="rulesets/design.xml/SimplifyConditional"/>
+<!--<rule ref="rulesets/design.xml/SwitchDensity"/>-->
+<!--<rule ref="rulesets/design.xml/SwitchStmtsShouldHaveDefault"/>-->
+<rule ref="rulesets/design.xml/UnnecessaryLocalBeforeReturn"/>
+<!--<rule ref="rulesets/design.xml/UseLocaleWithCaseConversions"/>-->
+<!--<rule ref="rulesets/design.xml/UseNotifyAllInsteadOfNotify"/>-->
+<!--<rule ref="rulesets/design.xml/UseSingleton"/>-->
+
+<!--<rule ref="rulesets/finalizers.xml/EmptyFinalizer"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeOnlyCallsSuperFinalize"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeOverloaded"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeDoesNotCallSuperFinalize"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeShouldBeProtected"/>-->
+<!--<rule ref="rulesets/finalizers.xml/AvoidCallingFinalize"/>-->
+
+<!--<rule ref="rulesets/imports.xml/DuplicateImports"/>-->
+<!--<rule ref="rulesets/imports.xml/DontImportJavaLang"/>-->
+<!--<rule ref="rulesets/imports.xml/UnusedImports"/>-->
+<!--<rule ref="rulesets/imports.xml/ImportFromSamePackage"/>-->
+
+<!--<rule ref="rulesets/javabeans.xml/BeanMembersShouldSerialize"/>-->
+<!--<rule ref="rulesets/javabeans.xml/MissingSerialVersionUID"/>-->
+
+<!--<rule ref="rulesets/junit.xml/JUnitStaticSuite"/>-->
+<!--<rule ref="rulesets/junit.xml/JUnitSpelling"/>-->
+<!--<rule ref="rulesets/junit.xml/JUnitAssertionsShouldIncludeMessage"/>-->
+<!--<rule ref="rulesets/junit.xml/JUnitTestsShouldIncludeAssert"/>-->
+<!--<rule ref="rulesets/junit.xml/TestClassWithoutTestCases"/>-->
+<!--<rule ref="rulesets/junit.xml/UnnecessaryBooleanAssertion"/>-->
+<!--<rule ref="rulesets/junit.xml/UseAssertEqualsInsteadOfAssertTrue"/>-->
+<!--<rule ref="rulesets/junit.xml/UseAssertSameInsteadOfAssertTrue"/>-->
+
+ <!--<rule ref="rulesets/logging-java.xml/AvoidPrintStackTrace"/>-->
+ <!--<rule ref="rulesets/logging-java.xml/LoggerIsNotStaticFinal"/>-->
+ <!--<rule ref="rulesets/logging-java.xml/MoreThanOneLogger"/>-->
+ <!--<rule ref="rulesets/logging-java.xml/LoggerIsNotStaticFinal"/>-->
+ <!--<rule ref="rulesets/logging-java.xml/LogBlockWithoutIf"/>-->
+ <!--<rule ref="rulesets/logging-java.xml/SystemPrintln"/>-->
+ <!--<rule ref="rulesets/logging-jakarta-commons.xml/UseCorrectExceptionLogging"/>-->
+ <!--<rule ref="rulesets/logging-jakarta-commons.xml/ProperLogger"/>-->
+
+ <!--<rule ref="rulesets/naming.xml/ShortVariable"/>-->
+ <!--<rule ref="rulesets/naming.xml/LongVariable"/>-->
+ <!--<rule ref="rulesets/naming.xml/ShortMethodName"/>-->
+ <!--<rule ref="rulesets/naming.xml/VariableNamingConventions"/>-->
+ <!--<rule ref="rulesets/naming.xml/MethodNamingConventions"/>-->
+ <!--<rule ref="rulesets/naming.xml/ClassNamingConventions"/>-->
+ <!--<rule ref="rulesets/naming.xml/AbstractNaming"/>-->
+ <!--<rule ref="rulesets/naming.xml/AvoidDollarSigns"/>-->
+ <!--<rule ref="rulesets/naming.xml/MethodWithSameNameAsEnclosingClass"/>-->
+ <!--<rule ref="rulesets/naming.xml/SuspiciousHashcodeMethodName"/>-->
+ <!--<rule ref="rulesets/naming.xml/SuspiciousConstantFieldName"/>-->
+ <!--<rule ref="rulesets/naming.xml/AvoidFieldNameMatchingTypeName"/>-->
+ <!--<rule ref="rulesets/naming.xml/AvoidFieldNameMatchingMethodName"/>-->
+ <!--<rule ref="rulesets/naming.xml/AvoidNonConstructorMethodsWithClassName"/>-->
+ <!--<rule ref="rulesets/naming.xml/NoPackage"/>-->
+ <!--<rule ref="rulesets/naming.xml/PackageCase"/>-->
+
+ <!--<rule ref="rulesets/optimizations.xml/LocalVariableCouldBeFinal"/>-->
+ <!--<rule ref="rulesets/optimizations.xml/MethodArgumentCouldBeFinal"/>-->
+ <!--<rule ref="rulesets/optimizations.xml/AvoidInstantiatingObjectsInLoops"/>-->
+ <!--<rule ref="rulesets/optimizations.xml/UseArrayListInsteadOfVector"/>-->
+ <!--<rule ref="rulesets/optimizations.xml/SimplifyStartsWith"/>-->
+ <!--<rule ref="rulesets/optimizations.xml/UseStringBufferForStringAppends"/>-->
+
+ <!--<rule ref="rulesets/strictexception.xml/AvoidCatchingThrowable"/>-->
+ <!--<rule ref="rulesets/strictexception.xml/SignatureDeclareThrowsException"/>-->
+ <!--<rule ref="rulesets/strictexception.xml/ExceptionAsFlowControl"/>-->
+ <!--<rule ref="rulesets/strictexception.xml/AvoidCatchingNPE"/>-->
+ <!--<rule ref="rulesets/strictexception.xml/AvoidThrowingRawExceptionTypes"/>-->
+ <!--<rule ref="rulesets/strictexception.xml/AvoidThrowingNullPointerException"/>-->
+
+ <!--<rule ref="rulesets/strings.xml/AvoidDuplicateLiterals"/>-->
+ <!--<rule ref="rulesets/strings.xml/StringInstantiation"/>-->
+ <!--<rule ref="rulesets/strings.xml/StringToString"/>-->
+ <!--<rule ref="rulesets/strings.xml/AvoidConcatenatingNonLiteralsInStringBuffer"/>-->
+ <!--<rule ref="rulesets/strings.xml/UnnecessaryCaseChange"/>-->
+
+ <!--<rule ref="rulesets/sunsecure.xml/MethodReturnsInternalArray"/>-->
+ <!--<rule ref="rulesets/sunsecure.xml/ArrayIsStoredDirectly"/>-->
+
+ <rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"/>
+ <rule ref="rulesets/unusedcode.xml/UnusedPrivateField"/>
+ <rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod"/>
+ <!--<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter"/>-->
+
+</ruleset>
diff --git a/branches/sca-java-integration/samples/sca/echo-databinding/NOTICE.txt b/branches/sca-java-integration/samples/sca/echo-databinding/NOTICE.txt
new file mode 100644
index 0000000000..d83ebbe236
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-databinding/NOTICE.txt
@@ -0,0 +1,14 @@
+${pom.name}
+Copyright (c) 2005 - 2006 The Apache Software Foundation
+
+Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/branches/sca-java-integration/samples/sca/echo-databinding/pom.xml b/branches/sca-java-integration/samples/sca/echo-databinding/pom.xml
new file mode 100644
index 0000000000..9303a7d1b0
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-databinding/pom.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.samples.sca</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>tuscany-sample-echo-databinding</artifactId>
+ <name>Apache Tuscany Echo DataBinding Sample</name>
+ <description>A DataBinding Sample</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-api</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-spi</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-core</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.extensions.axis2</groupId>
+ <artifactId>databinding-axiom</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.services.idl</groupId>
+ <artifactId>tuscany-wsdl</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ws.commons.axiom</groupId>
+ <artifactId>axiom-api</artifactId>
+ <version>SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ws.commons.axiom</groupId>
+ <artifactId>axiom-impl</artifactId>
+ <version>SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>3.2.0</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoBinding.java b/branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoBinding.java
new file mode 100644
index 0000000000..da44906cf6
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoBinding.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package echo;
+
+import org.apache.tuscany.spi.model.BindingDefinition;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoBinding extends BindingDefinition {
+
+ public Object clone() {
+ return this;
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoBindingLoader.java b/branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoBindingLoader.java
new file mode 100644
index 0000000000..b77dcca3b9
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoBindingLoader.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package echo;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import static org.osoa.sca.Constants.SCA_NS;
+import org.osoa.sca.annotations.Constructor;
+
+import org.apache.tuscany.spi.annotation.Autowire;
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.deployer.DeploymentContext;
+import org.apache.tuscany.spi.extension.LoaderExtension;
+import org.apache.tuscany.spi.loader.LoaderException;
+import org.apache.tuscany.spi.loader.LoaderRegistry;
+import org.apache.tuscany.spi.model.ModelObject;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoBindingLoader extends LoaderExtension<EchoBinding> {
+
+ public static final QName BINDING_ECHO = new QName(SCA_NS, "binding.echo");
+
+ @Constructor
+ public EchoBindingLoader(@Autowire LoaderRegistry registry) {
+ super(registry);
+ }
+
+ public QName getXMLType() {
+ return BINDING_ECHO;
+ }
+
+ public EchoBinding load(CompositeComponent parent,
+ ModelObject object,
+ XMLStreamReader reader,
+ DeploymentContext context) throws XMLStreamException, LoaderException {
+ return new EchoBinding();
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoBuilder.java b/branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoBuilder.java
new file mode 100644
index 0000000000..7cf1b35617
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoBuilder.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package echo;
+
+import org.apache.tuscany.spi.builder.BuilderException;
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.component.ReferenceBinding;
+import org.apache.tuscany.spi.component.ServiceBinding;
+import org.apache.tuscany.spi.deployer.DeploymentContext;
+import org.apache.tuscany.spi.extension.BindingBuilderExtension;
+import org.apache.tuscany.spi.model.AbstractReferenceDefinition;
+import org.apache.tuscany.spi.model.ServiceDefinition;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoBuilder extends BindingBuilderExtension<EchoBinding> {
+
+ public ServiceBinding build(CompositeComponent parent,
+ ServiceDefinition boundServiceDefinition,
+ EchoBinding bindingDefinition,
+ DeploymentContext deploymentContext) throws BuilderException {
+ return new EchoService(boundServiceDefinition.getName(), parent);
+ }
+
+ public ReferenceBinding build(CompositeComponent parent,
+ AbstractReferenceDefinition boundReferenceDefinition,
+ EchoBinding bindingDefinition,
+ DeploymentContext deploymentContext) throws BuilderException {
+ return new EchoReference(boundReferenceDefinition.getName(), parent);
+ }
+
+ protected Class<EchoBinding> getBindingType() {
+ return EchoBinding.class;
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoInvoker.java b/branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoInvoker.java
new file mode 100644
index 0000000000..972dae843f
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoInvoker.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package echo;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.apache.tuscany.spi.wire.InvocationRuntimeException;
+import org.apache.tuscany.spi.wire.Message;
+import org.apache.tuscany.spi.wire.TargetInvoker;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoInvoker implements TargetInvoker {
+
+ private boolean cacheable;
+
+ public boolean isCacheable() {
+ return cacheable;
+ }
+
+ public void setCacheable(boolean cacheable) {
+ this.cacheable = cacheable;
+ }
+
+ public boolean isOptimizable() {
+ return isCacheable();
+ }
+
+ public Object invokeTarget(final Object payload, final short sequence) throws InvocationTargetException {
+ // echo back the result, a real binding would invoke some API for flowing the request
+ Object result = ((Object[]) payload)[0];
+ System.out.println("Echo: " + result);
+ return result;
+ }
+
+ public Message invoke(Message msg) throws InvocationRuntimeException {
+ try {
+ Object resp = invokeTarget(msg.getBody(), NONE);
+ msg.setBody(resp);
+ } catch (InvocationTargetException e) {
+ msg.setBodyWithFault(e.getCause());
+ } catch (Throwable e) {
+ msg.setBodyWithFault(e);
+ }
+ return msg;
+ }
+
+ public Object clone() throws CloneNotSupportedException {
+ return super.clone();
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoReference.java b/branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoReference.java
new file mode 100644
index 0000000000..9eaf0914cc
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoReference.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 echo;
+
+import static org.osoa.sca.Constants.SCA_NS;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.extension.ReferenceBindingExtension;
+import org.apache.tuscany.spi.model.Operation;
+import org.apache.tuscany.spi.model.ServiceContract;
+import org.apache.tuscany.spi.wire.TargetInvoker;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoReference extends ReferenceBindingExtension {
+
+ private static final String OM_DATA_BINDING = OMElement.class.getName();
+
+ private static final QName BINDING_ECHO = new QName(SCA_NS, "binding.echo");
+
+ public EchoReference(String name, CompositeComponent parent) {
+ super(name, parent);
+ }
+
+ public QName getBindingType() {
+ return BINDING_ECHO;
+ }
+
+ @SuppressWarnings("unchecked")
+ public TargetInvoker createTargetInvoker(ServiceContract contract, Operation operation) {
+ // HACK to set the databinding
+ operation.setDataBinding(OM_DATA_BINDING);
+ return new EchoInvoker();
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoService.java b/branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoService.java
new file mode 100644
index 0000000000..85ed497799
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-databinding/src/main/java/echo/EchoService.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 echo;
+
+import static org.osoa.sca.Constants.SCA_NS;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.spi.CoreRuntimeException;
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.extension.ServiceBindingExtension;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoService extends ServiceBindingExtension {
+ private static final QName BINDING_ECHO = new QName(SCA_NS, "binding.echo");
+
+ public EchoService(String name, CompositeComponent parent) throws CoreRuntimeException {
+ super(name, parent);
+ // do nothing, but this could register with the host environment
+ }
+
+
+ public QName getBindingType() {
+ return BINDING_ECHO;
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-databinding/src/main/resources/META-INF/sca/extension.composite b/branches/sca-java-integration/samples/sca/echo-databinding/src/main/resources/META-INF/sca/extension.composite
new file mode 100644
index 0000000000..34a5bac134
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-databinding/src/main/resources/META-INF/sca/extension.composite
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:system="http://tuscany.apache.org/xmlns/system/1.0-SNAPSHOT"
+ name="binding.echo">
+
+ <component name="BindingLoader">
+ <system:implementation.system class="echo.EchoBindingLoader" />
+ </component>
+
+ <component name="BindingBuilder">
+ <system:implementation.system class="echo.EchoBuilder" />
+ </component>
+
+</composite>
diff --git a/branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/ComponentAImpl.java b/branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/ComponentAImpl.java
new file mode 100644
index 0000000000..84466f90d0
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/ComponentAImpl.java
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package echo;
+
+import org.apache.axiom.om.OMElement;
+import org.osoa.sca.annotations.Constructor;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ComponentAImpl implements Interface1 {
+
+ private Interface1 componentBReference;
+
+ private String prefix;
+
+ private String prefix1;
+
+ private String bar;
+
+ private OMElement omProperty;
+
+ @Constructor
+ public ComponentAImpl(@Reference(name = "componentBReference", required = true)
+ Interface1 componentBReference) {
+ this.componentBReference = componentBReference;
+ }
+
+ public Object call(Object msg) {
+ String request = msg + " [" + msg.getClass().getName() + "]";
+ System.out.println("ComponentA --> Received message: " + request);
+ Object ret = componentBReference.call(msg);
+ String response = ret + " [" + ret.getClass().getName() + "]";
+ System.out.println("ComponentA --> Returned message: " + response);
+ return ret;
+ }
+
+ public Object call1(Object msg) {
+ String request = msg + " [" + msg.getClass().getName() + "]";
+ System.out.println("ComponentA --> Received message: " + request);
+ Object ret = componentBReference.call1(msg);
+ String response = ret + " [" + ret.getClass().getName() + "]";
+ System.out.println("ComponentA --> Returned message: " + response);
+ return ret;
+ }
+
+ @Property(name="prefix")
+ public void setPrefix(String prefix) {
+ System.out.println("[Property] prefix: " + prefix);
+ this.prefix = prefix;
+ }
+
+ @Property(name="prefix1")
+ public void setPrefix1(String prefix1) {
+ System.out.println("[Property] prefix1: " + prefix1);
+ this.prefix1 = prefix1;
+ }
+
+ /**
+ * @param bar the bar to set
+ */
+ @Property(name="bar")
+ public void setBar(String bar) {
+ System.out.println("[Property] bar: " + bar);
+ this.bar = bar;
+ }
+
+ /**
+ * @param omProperty the omProperty to set
+ */
+ @Property(name="omProperty")
+ public void setOmProperty(OMElement omProperty) {
+ this.omProperty = omProperty;
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/ComponentBImpl.java b/branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/ComponentBImpl.java
new file mode 100644
index 0000000000..f8783d39e9
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/ComponentBImpl.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 echo;
+
+import javax.xml.stream.XMLStreamReader;
+
+import org.osoa.sca.annotations.AllowsPassByReference;
+import org.osoa.sca.annotations.Constructor;
+import org.osoa.sca.annotations.Reference;
+import org.w3c.dom.Node;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@AllowsPassByReference
+public class ComponentBImpl implements Interface2 {
+
+ private Echo echoReference;
+
+ @Constructor
+ public ComponentBImpl(@Reference(name = "echoReference", required = true)
+ Echo echoReference) {
+ this.echoReference = echoReference;
+ }
+
+ public Node call(Node msg) {
+ String request = msg + " [" + msg.getClass().getName() + "]";
+ System.out.println("ComponentB --> Received message: " + request);
+ Node ret = (Node) echoReference.echo(msg);
+ String response = ret + " [" + ret.getClass().getName() + "]";
+ System.out.println("ComponentB --> Returned message: " + response);
+ return ret;
+ }
+
+ public XMLStreamReader call1(XMLStreamReader msg) {
+ String request = msg + " [" + msg.getClass().getName() + "]";
+ System.out.println("ComponentB --> Received message: " + request);
+// XMLStreamReader ret = (XMLStreamReader) echoReference.echo(msg);
+ String response = request;
+ System.out.println("ComponentB --> Returned message: " + response);
+ return msg;
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/Echo.java b/branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/Echo.java
new file mode 100644
index 0000000000..f6d10d55c7
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/Echo.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package echo;
+
+import org.apache.tuscany.api.annotation.DataType;
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * @version $Rev$ $Date$
+ */
+// @DataType(name="org.apache.axiom.om.OMElement")
+@DataType(name="org.w3c.dom.Node")
+@Remotable
+public interface Echo {
+ Object echo(Object msg);
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/EchoDataBindingTestCase.java b/branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/EchoDataBindingTestCase.java
new file mode 100644
index 0000000000..f15501a9a5
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/EchoDataBindingTestCase.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package echo;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.api.SCARuntime;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoDataBindingTestCase extends TestCase {
+
+ private Interface1 componentA;
+
+ public void testTransform() {
+ componentA.call("<message><foo>123</foo></message>");
+ componentA.call1("<message><foo>123</foo></message>");
+ }
+
+ protected void setUp() throws Exception {
+ SCARuntime.start("EchoDataBinding.composite");
+
+ CompositeContext context = CurrentCompositeContext.getContext();
+ componentA = context.locateService(Interface1.class, "ComponentA");
+ }
+
+ protected void tearDown() throws Exception {
+ SCARuntime.stop();
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/Interface1.java b/branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/Interface1.java
new file mode 100644
index 0000000000..bce5dd46cb
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/Interface1.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package echo;
+
+import org.apache.tuscany.api.annotation.DataType;
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@DataType(name="java.lang.String")
+@Remotable
+public interface Interface1 {
+ Object call(Object msg);
+ Object call1(Object msg);
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/Interface2.java b/branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/Interface2.java
new file mode 100644
index 0000000000..c2f82971e9
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-databinding/src/test/java/echo/Interface2.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package echo;
+
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.api.annotation.DataType;
+import org.osoa.sca.annotations.Remotable;
+import org.w3c.dom.Node;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@DataType(name="org.w3c.dom.Node")
+@Remotable
+public interface Interface2 {
+ Node call(Node msg);
+ @DataType(name="javax.xml.stream.XMLStreamReader")
+ XMLStreamReader call1(XMLStreamReader msg);
+}
diff --git a/branches/sca-java-integration/samples/sca/echo-databinding/src/test/resources/EchoDataBinding.composite b/branches/sca-java-integration/samples/sca/echo-databinding/src/test/resources/EchoDataBinding.composite
new file mode 100644
index 0000000000..e3407e4ab7
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-databinding/src/test/resources/EchoDataBinding.composite
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:f="http://foo"
+ xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance" name="EchoDataBinding">
+
+ <service name="EchoService">
+ <interface.java class="echo.Interface1" />
+ <binding.echo />
+ <reference>ComponentB</reference>
+ </service>
+
+ <component name="ComponentA">
+ <implementation.java class="echo.ComponentAImpl" />
+ <reference name="componentBReference" target="ComponentB"></reference>
+ <property name="prefix">ABC</property>
+ <property name="prefix1" source="$messagePrefix"></property>
+ <property name="bar" source="$complexProperty/*[local-name()='foo']/*[local-name()='bar']"></property>
+ <property name="omProperty"><a><b>XYZ</b></a></property>
+ </component>
+
+ <component name="ComponentB">
+ <implementation.java class="echo.ComponentBImpl" />
+ </component>
+
+ <reference name="EchoReference" promote="ComponentB/echoReference">
+ <!--
+ <interface.java interface="echo.Echo"/>
+ -->
+ <interface.wsdl interface="http://example.com/echo.wsdl#wsdl.interface(EchoPortType)" wsdli:wsdlLocation="http://example.com/echo.wsdl wsdl/echo.wsdl">
+ <db:databinding xmlns:db="http://tuscany.apache.org/xmlns/sca/databinding/1.0" name="org.apache.axiom.om.OMElement"/>
+ </interface.wsdl>
+ <binding.echo />
+ </reference>
+
+ <property name="messagePrefix" type="xsd:string">ABC</property>
+ <property name="complexProperty" type="f:FooType">
+ <foo>
+ <bar attr="barAttr">BAR</bar>
+ </foo>
+ </property>
+
+</composite>
diff --git a/branches/sca-java-integration/samples/sca/echo-databinding/src/test/resources/wsdl/echo.wsdl b/branches/sca-java-integration/samples/sca/echo-databinding/src/test/resources/wsdl/echo.wsdl
new file mode 100644
index 0000000000..5749bd8aff
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/echo-databinding/src/test/resources/wsdl/echo.wsdl
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+<definitions name="StockQuote" targetNamespace="http://example.com/echo.wsdl" xmlns:tns="http://example.com/echo.wsdl"
+ xmlns:xsd1="http://example.com/echo.xsd" xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <schema targetNamespace="http://example.com/echo.xsd" xmlns:tns="http://example.com/echo.xsd"
+ xmlns="http://www.w3.org/2001/XMLSchema">
+ <complexType name="messageType">
+ <sequence>
+ <element name="foo" type="string"></element>
+ </sequence>
+ </complexType>
+ <element name="echo">
+ <complexType>
+ <sequence>
+ <element name="message" type="tns:messageType" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="echoResponse">
+ <complexType>
+ <sequence>
+ <element name="message" type="tns:messageType" />
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </types>
+
+ <message name="EchoInput">
+ <part name="body" element="xsd1:echo" />
+ </message>
+
+ <message name="EchoOutput">
+ <part name="body" element="xsd1:echoResponse" />
+ </message>
+
+ <portType name="EchoPortType">
+ <operation name="echo">
+ <input message="tns:EchoInput" />
+ <output message="tns:EchoOutput" />
+ </operation>
+ </portType>
+
+</definitions> \ No newline at end of file
diff --git a/branches/sca-java-integration/samples/sca/loanapplication/pom.xml b/branches/sca-java-integration/samples/sca/loanapplication/pom.xml
new file mode 100644
index 0000000000..256bed66a2
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/loanapplication/pom.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.samples.sca</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>tuscany-sample-loanapplication</artifactId>
+ <packaging>jar</packaging>
+ <name>Apache Tuscany Loan Application Conversation Sample</name>
+ <description>A sample implementation of a loan application conversation.</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-api</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-core</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>loanapplication.LoanApplicationClient</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanApplication.java b/branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanApplication.java
new file mode 100644
index 0000000000..441f68ebf0
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanApplication.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package loanapplication;
+
+public class LoanApplication {
+
+ private String customerName;
+ private float loanAmount;
+
+ public LoanApplication(String customerName, float loanAmount) {
+ this.customerName = customerName;
+ this.loanAmount = loanAmount;
+ }
+
+ public String toString() {
+ return "[Customer: " + customerName + ", loan amount: "
+ + loanAmount + "]";
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanApplicationClient.java b/branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanApplicationClient.java
new file mode 100644
index 0000000000..e4380e5e44
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanApplicationClient.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package loanapplication;
+
+
+import org.apache.tuscany.api.SCARuntime;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+public class LoanApplicationClient {
+
+ public static void main(String[] args) throws Exception {
+ SCARuntime.start("loanapplication.composite");
+
+ // Locate the MyClient component and invoke it
+ CompositeContext context = CurrentCompositeContext.getContext();
+
+ LoanClient loanClient = context.locateService(LoanClient.class, "LoanClientComponent");
+ loanClient.applyForLoan("John Doe", 1000.0f);
+ System.out.println(loanClient.displayLoan());
+ System.out.println("Loan approved: " + loanClient.isApproved());
+
+ SCARuntime.stop();
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanClient.java b/branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanClient.java
new file mode 100644
index 0000000000..7e4438bbff
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanClient.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 loanapplication;
+
+public interface LoanClient {
+
+ void applyForLoan(String customerName, float amount);
+ boolean isApproved();
+ boolean isCancelled();
+ String displayLoan();
+ void cancelLoan();
+ void closeLoan();
+}
diff --git a/branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanClientImpl.java b/branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanClientImpl.java
new file mode 100644
index 0000000000..b06d9465a2
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanClientImpl.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package loanapplication;
+
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+
+@Scope("COMPOSITE")
+public class LoanClientImpl implements LoanClient {
+
+ private LoanService loanService;
+
+ @Reference
+ public void setLoanService(LoanService loanService) {
+ this.loanService = loanService;
+ }
+
+ public void applyForLoan(String customerName, float amount) {
+ loanService.apply(new LoanApplication(customerName, amount));
+ }
+
+ public boolean isApproved() {
+ if (loanService.getLoanStatus() == null) {
+ return false;
+ }
+ return loanService.getLoanStatus().equals("approved");
+ }
+
+ public boolean isCancelled() {
+ if (loanService.getLoanStatus() == null) {
+ return false;
+ }
+ return loanService.getLoanStatus().equals("cancelled");
+ }
+
+ public String displayLoan() {
+ return loanService.display();
+ }
+
+ public void cancelLoan() {
+ loanService.cancelApplication();
+ }
+
+ public void closeLoan() {
+ loanService.close();
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanService.java b/branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanService.java
new file mode 100644
index 0000000000..d09864ea55
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanService.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package loanapplication;
+
+import org.osoa.sca.annotations.EndsConversation;
+import org.osoa.sca.annotations.OneWay;
+import org.osoa.sca.annotations.Remotable;
+import org.osoa.sca.annotations.Scope;
+
+@Scope("CONVERSATION")
+@Remotable
+public interface LoanService {
+ void apply(LoanApplication application);
+ void lockCurrentRate(int termInYears);
+ @OneWay
+ void cancelApplication();
+ String getLoanStatus();
+ String display();
+ @EndsConversation
+ void close();
+}
diff --git a/branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanServiceImpl.java b/branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanServiceImpl.java
new file mode 100644
index 0000000000..76a53323bd
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/loanapplication/src/main/java/loanapplication/LoanServiceImpl.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package loanapplication;
+
+import org.osoa.sca.annotations.AllowsPassByReference;
+import org.osoa.sca.annotations.ConversationID;
+import org.osoa.sca.annotations.Scope;
+
+@Scope("CONVERSATION")
+@AllowsPassByReference
+public class LoanServiceImpl implements LoanService {
+
+ private LoanApplication application;
+ private String status;
+ private int termLocked = 0;
+ @ConversationID
+ protected String conversationID;
+
+ public void apply(LoanApplication application) {
+ this.application = application;
+ status = "open";
+ }
+
+ public void lockCurrentRate(int termInYears) {
+ termLocked = termInYears;
+ status = "locked";
+ }
+
+ public void cancelApplication() {
+ status = "cancelled";
+ }
+
+ public String getLoanStatus() {
+ return status;
+ }
+
+ public String display() {
+ return "Loan application: " + application + ", term: "
+ + termLocked + ", status: " + status
+ + ", conversationID: " + conversationID;
+ }
+
+ public void close() {
+ this.application = null;
+ this.status = "closed";
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/loanapplication/src/main/resources/loanapplication.composite b/branches/sca-java-integration/samples/sca/loanapplication/src/main/resources/loanapplication.composite
new file mode 100644
index 0000000000..d69f1e55d6
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/loanapplication/src/main/resources/loanapplication.composite
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" name="loanapplication">
+
+ <component name="LoanClientComponent">
+ <implementation.java class="loanapplication.LoanClientImpl"/>
+ <reference name="loanService" target="LoanServiceComponent"></reference>
+ </component>
+
+ <component name="LoanServiceComponent">
+ <implementation.java class="loanapplication.LoanServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/branches/sca-java-integration/samples/sca/loanapplication/src/test/java/loanapplication/LoanApplicationTestCase.java b/branches/sca-java-integration/samples/sca/loanapplication/src/test/java/loanapplication/LoanApplicationTestCase.java
new file mode 100644
index 0000000000..c6f74e4445
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/loanapplication/src/test/java/loanapplication/LoanApplicationTestCase.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package loanapplication;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.api.SCARuntime;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+public class LoanApplicationTestCase extends TestCase {
+
+ private LoanClient loanClient;
+
+ protected void setUp() throws Exception {
+ SCARuntime.start("loanapplication.composite");
+
+ CompositeContext context = CurrentCompositeContext.getContext();
+ loanClient = context.locateService(LoanClient.class, "LoanClientComponent");
+ }
+
+ protected void tearDown() throws Exception {
+ SCARuntime.stop();
+ }
+
+ public void test() throws Exception {
+ try {
+ loanClient.applyForLoan("John Doe", 1000.0f);
+ System.out.println("Applied: " + loanClient.displayLoan());
+ System.out.println("Loan approved: " + loanClient.isApproved());
+ loanClient.cancelLoan();
+ System.out.println("Sleeping to let cancel complete ...");
+ Thread.sleep(500);
+ if (!loanClient.isCancelled()) {
+ fail("Loan should be cancelled");
+ }
+ System.out.println("Cancelled: " + loanClient.displayLoan());
+ loanClient.closeLoan();
+
+ /* This is a mistake, after @EndsConversation, a new conversation is
+ * started automatically, so we should not get TargetNotFoundException.
+ * Keep this for the timeout case, where we should get the exception
+ try {
+ System.out.println("Trying to use the closed loan in the ended conversation ...");
+ System.out.println("Closed: " + loanClient.displayLoan());
+ fail("Target should not be found");
+ } catch(TargetNotFoundException e) {
+ System.out.println("Target not found as expected");
+ }
+ */
+
+ // Now check that a new conversation's loan is not cancelled
+
+ if (loanClient.isCancelled()) {
+ fail("Loan should not be cancelled");
+ }
+ } catch(Throwable e) {
+ e.printStackTrace();
+ if (e instanceof Exception) {
+ throw (Exception)e;
+ }
+ if (e instanceof Error) {
+ throw (Error)e;
+ }
+ }
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/pom.xml b/branches/sca-java-integration/samples/sca/pom.xml
new file mode 100644
index 0000000000..0451883b33
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/pom.xml
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.tuscany.samples.sca</groupId>
+ <artifactId>parent</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Samples</name>
+
+ <!-- definition of repositories where the parent pom can be found -->
+ <repositories>
+ <repository>
+ <id>apache.snapshots</id>
+ <name>Apache Snapshot Repository</name>
+ <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>apache.incubator</id>
+ <name>Apache Incubator Repository</name>
+ <url>http://people.apache.org/repo/m2-incubating-repository/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <modules>
+ <module>calculator</module>
+ <module>composite-impl</module>
+ <module>loanapplication</module>
+ <module>simple-bigbank</module>
+ <module>simple-callback</module>
+ <module>supplychain</module>
+ <module>echo-binding</module>
+ <module>echo-databinding</module>
+ </modules>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+</project>
diff --git a/branches/sca-java-integration/samples/sca/simple-bigbank/pom.xml b/branches/sca-java-integration/samples/sca/simple-bigbank/pom.xml
new file mode 100644
index 0000000000..1dfa957ed9
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-bigbank/pom.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.samples.sca</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>tuscany-sample-simple-bigbank</artifactId>
+ <packaging>jar</packaging>
+ <name>Apache Tuscany Simplified BigBank Sample</name>
+ <description>Simplified Big Bank Sample</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-api</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-core</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>bigbank.BigBankClient</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/account/AccountReport.java b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/account/AccountReport.java
new file mode 100644
index 0000000000..01cadd43d2
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/account/AccountReport.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank.account;
+
+import bigbank.accountdata.Account;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @version $$Rev$$ $$Date$$
+ */
+
+public class AccountReport {
+ private List<String> summaries = new ArrayList<String>();
+
+ public List getAccountSummaries() { return summaries; }
+
+ protected void addAccount(Account a) { summaries.add(a.getSummary()); }
+}
diff --git a/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/account/AccountService.java b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/account/AccountService.java
new file mode 100644
index 0000000000..a29c8e3609
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/account/AccountService.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 bigbank.account;
+
+/**
+ * @version $$Rev$$ $$Date$$
+ */
+
+public interface AccountService {
+ public AccountReport getAccountReport(String customerID);
+}
diff --git a/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/account/AccountServiceImpl.java b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/account/AccountServiceImpl.java
new file mode 100644
index 0000000000..0de4d11581
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/account/AccountServiceImpl.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank.account;
+
+import org.osoa.sca.annotations.Service;
+import org.osoa.sca.annotations.Reference;
+
+import java.util.List;
+
+import bigbank.accountdata.AccountDataService;
+import bigbank.accountdata.CheckingAccount;
+
+/**
+ * @version $$Rev$$ $$Date$$
+ */
+
+@Service(AccountService.class)
+public class AccountServiceImpl implements AccountService {
+
+ @Reference
+ public AccountDataService accountDataService;
+
+ public AccountReport getAccountReport(String s) {
+ AccountReport report = new AccountReport();
+
+ CheckingAccount ca = accountDataService.getCheckingAccount(s);
+ report.addAccount(ca);
+
+ return report;
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/Account.java b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/Account.java
new file mode 100644
index 0000000000..069577e3b1
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/Account.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 bigbank.accountdata;
+
+/**
+ * @version $$Rev$$ $$Date$$
+ */
+
+public interface Account {
+ String getSummary();
+}
diff --git a/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/AccountDataService.java b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/AccountDataService.java
new file mode 100644
index 0000000000..5213d7e7a5
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/AccountDataService.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 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/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/AccountDataServiceImpl.java b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/AccountDataServiceImpl.java
new file mode 100644
index 0000000000..05e8ce485f
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-bigbank/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(customerID+"_"+"CHA12345");
+ checkingAccount.setBalance(1500.0f);
+
+ return checkingAccount;
+ }
+
+ public SavingsAccount getSavingsAccount(String customerID) {
+
+ SavingsAccount savingsAccount = new SavingsAccount();
+ savingsAccount.setAccountNumber(customerID+"_"+"SAA12345");
+ savingsAccount.setBalance(1500.0f);
+
+ return savingsAccount;
+ }
+
+ public StockAccount getStockAccount(String customerID) {
+
+ StockAccount stockAccount = new StockAccount();
+ stockAccount.setAccountNumber(customerID+"_"+"STA12345");
+ stockAccount.setSymbol("IBM");
+ stockAccount.setQuantity(100);
+
+ return stockAccount;
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/CheckingAccount.java b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/CheckingAccount.java
new file mode 100644
index 0000000000..4c87cda44c
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/CheckingAccount.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank.accountdata;
+
+/**
+ * @version $$Rev$$ $$Date$$
+ */
+
+public class CheckingAccount implements Account {
+ 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; }
+
+ public String getSummary() { return "ID:" + accountNumber + ", balance:" + balance; }
+}
diff --git a/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/SavingsAccount.java b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/SavingsAccount.java
new file mode 100644
index 0000000000..daaa19995d
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/SavingsAccount.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank.accountdata;
+
+/**
+ * @version $$Rev$$ $$Date$$
+ */
+
+public class SavingsAccount implements Account {
+ 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; }
+
+ public String getSummary() { return "ID:" + accountNumber + ", balance:" + balance; }
+}
diff --git a/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/StockAccount.java b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/StockAccount.java
new file mode 100644
index 0000000000..7690e190f7
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/java/bigbank/accountdata/StockAccount.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank.accountdata;
+
+/**
+ * @version $$Rev$$ $$Date$$
+ */
+
+public class StockAccount implements Account {
+ 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; }
+
+ public String getSummary() { return "ID:" + accountNumber + ", symbol:" + symbol + ", quantity:" + quantity; }
+}
diff --git a/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/resources/BigBank.composite b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/resources/BigBank.composite
new file mode 100644
index 0000000000..88636afe53
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/resources/BigBank.composite
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ name="BigBank">
+
+ <service name="AccountService">
+ <interface.java interface="bigbank.account.AccountService"/>
+ <reference>AccountServiceComponent</reference>
+ </service>
+
+ <!--
+ <reference name="StockQuoteService">
+ <interface.java interface="bigbank.stock.StockQuoteService"/>
+ </reference>
+ -->
+
+
+ <component name="AccountServiceComponent">
+ <implementation.java class="bigbank.account.AccountServiceImpl"/>
+ <reference name="accountDataService" target="AccountDataServiceComponent"></reference>
+ </component>
+
+ <component name="AccountDataServiceComponent">
+ <implementation.java class="bigbank.accountdata.AccountDataServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/resources/META-INF/LICENSE.txt b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000000..25d78feeac
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-bigbank/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/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/resources/META-INF/NOTICE b/branches/sca-java-integration/samples/sca/simple-bigbank/src/main/resources/META-INF/NOTICE
new file mode 100644
index 0000000000..d48810c0ec
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-bigbank/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/branches/sca-java-integration/samples/sca/simple-bigbank/src/test/java/bigbank/BigBankTestCase.java b/branches/sca-java-integration/samples/sca/simple-bigbank/src/test/java/bigbank/BigBankTestCase.java
new file mode 100644
index 0000000000..dbed3f8806
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-bigbank/src/test/java/bigbank/BigBankTestCase.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.api.SCARuntime;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+import bigbank.account.AccountService;
+
+public class BigBankTestCase extends TestCase {
+
+ AccountService accountService;
+
+ protected void setUp() throws Exception {
+ SCARuntime.start("BigBank.composite");
+
+ CompositeContext context = CurrentCompositeContext.getContext();
+ accountService = context.locateService(AccountService.class, "AccountServiceComponent");
+ }
+
+ protected void tearDown() throws Exception {
+ SCARuntime.stop();
+ }
+
+ public void test() throws Exception {
+ System.out.println("Account summary: " + accountService.getAccountReport("Foo") );
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/simple-callback/pom.xml b/branches/sca-java-integration/samples/sca/simple-callback/pom.xml
new file mode 100644
index 0000000000..e23f247366
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-callback/pom.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.samples.sca</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>tuscany-sample-simple-callback</artifactId>
+ <packaging>jar</packaging>
+ <name>Apache Tuscany Simple Callback Sample</name>
+ <description>A sample implementation of a simple callback application.</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-api</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-core</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>simplecallback.SimpleCallbackClient</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/MyClient.java b/branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/MyClient.java
new file mode 100644
index 0000000000..4cc00d6d0f
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/MyClient.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 simplecallback;
+
+/**
+ * The client interface
+ */
+public interface MyClient {
+
+ void aClientMethod();
+}
diff --git a/branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/MyClientImpl.java b/branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/MyClientImpl.java
new file mode 100644
index 0000000000..a1b7a987bd
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/MyClientImpl.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package simplecallback;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * Demonstrates a component-to-component callback invocation
+ */
+@Service(MyClient.class)
+@Scope("COMPOSITE")
+public class MyClientImpl implements MyClient, MyServiceCallback {
+
+ private MyService myService;
+
+ @Reference
+ public void setMyService(MyService myService) {
+ this.myService = myService;
+ }
+
+ public void aClientMethod() {
+ myService.someMethod("-> someMethod");
+ }
+
+ public void receiveResult(String result) {
+ System.out.println("Work thread " + Thread.currentThread());
+ System.out.println("Result: " + result);
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/MyService.java b/branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/MyService.java
new file mode 100644
index 0000000000..e78ad6f68f
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/MyService.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package simplecallback;
+
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.OneWay;
+
+/**
+ * This service that will be invoked in a non-blocking fashion
+ */
+@Callback(MyServiceCallback.class)
+public interface MyService {
+
+ @OneWay
+ void someMethod(String arg);
+}
diff --git a/branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/MyServiceCallback.java b/branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/MyServiceCallback.java
new file mode 100644
index 0000000000..b27eea44f5
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/MyServiceCallback.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 simplecallback;
+
+/**
+ * The callback interface for {@link MyService}.
+ */
+public interface MyServiceCallback {
+
+ void receiveResult(String result);
+}
diff --git a/branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/MyServiceImpl.java b/branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/MyServiceImpl.java
new file mode 100644
index 0000000000..fc5e31d14e
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/MyServiceImpl.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 simplecallback;
+
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements MyService and uses a callback.
+ */
+@Service(MyService.class)
+@Scope("COMPOSITE")
+public class MyServiceImpl implements MyService {
+
+ private MyServiceCallback myServiceCallback;
+
+ /**
+ * The setter used by the runtime to set the callback reference
+ * @param myServiceCallback
+ */
+ @Callback
+ public void setMyServiceCallback(MyServiceCallback myServiceCallback) {
+ this.myServiceCallback = myServiceCallback;
+ }
+
+ public void someMethod(String arg) {
+ // invoke the callback
+ try {
+ myServiceCallback.receiveResult(arg + " -> receiveResult");
+ } catch(RuntimeException e) {
+ System.out.println("RuntimeException invoking receiveResult: " + e.toString());
+ }
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/SimpleCallbackClient.java b/branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/SimpleCallbackClient.java
new file mode 100644
index 0000000000..8153d906e2
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-callback/src/main/java/simplecallback/SimpleCallbackClient.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 simplecallback;
+
+import org.apache.tuscany.api.SCARuntime;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+/**
+ * Demonstrates resolving the client service and initiating the callback sequence
+ */
+public class SimpleCallbackClient {
+
+ public static void main(String[] args) throws Exception {
+ SCARuntime.start("simplecallback.composite");
+
+ // Locate the MyClient component and invoke it
+ CompositeContext context = CurrentCompositeContext.getContext();
+ MyClient myClient = context.locateService(MyClient.class, "MyClientComponent");
+ System.out.println("Main thread " + Thread.currentThread());
+ myClient.aClientMethod();
+ Thread.sleep(500);
+
+ SCARuntime.stop();
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/simple-callback/src/main/resources/simplecallback.composite b/branches/sca-java-integration/samples/sca/simple-callback/src/main/resources/simplecallback.composite
new file mode 100644
index 0000000000..1bb67ecfda
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-callback/src/main/resources/simplecallback.composite
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" name="simplecallback">
+
+ <component name="MyClientComponent">
+ <implementation.java class="simplecallback.MyClientImpl"/>
+ <reference name="myService" target="MyServiceComponent"></reference>
+ </component>
+
+ <component name="MyServiceComponent">
+ <implementation.java class="simplecallback.MyServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/branches/sca-java-integration/samples/sca/simple-callback/src/test/java/simplecallback/SimpleCallbackTestCase.java b/branches/sca-java-integration/samples/sca/simple-callback/src/test/java/simplecallback/SimpleCallbackTestCase.java
new file mode 100644
index 0000000000..ecd1c245f4
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/simple-callback/src/test/java/simplecallback/SimpleCallbackTestCase.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 simplecallback;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.api.SCARuntime;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+/**
+ * A testcase that demonstrates resolving the client service and initiating the callback sequence
+ */
+public class SimpleCallbackTestCase extends TestCase {
+
+ private MyClient myClient;
+
+ protected void setUp() throws Exception {
+ SCARuntime.start("simplecallback.composite");
+
+ CompositeContext context = CurrentCompositeContext.getContext();
+ myClient = context.locateService(MyClient.class, "MyClientComponent");
+ }
+
+ protected void tearDown() throws Exception {
+ SCARuntime.stop();
+ }
+
+ public void test() throws Exception {
+ System.out.println("Main thread " + Thread.currentThread());
+ myClient.aClientMethod();
+ System.out.println("Sleeping ...");
+ Thread.sleep(1000);
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/supplychain/pom.xml b/branches/sca-java-integration/samples/sca/supplychain/pom.xml
new file mode 100644
index 0000000000..fb9a6a4bca
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/supplychain/pom.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.samples.sca</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>tuscany-sample-supplychain</artifactId>
+ <packaging>jar</packaging>
+ <name>Apache Tuscany Supply Chain Sample</name>
+ <description>A sample implementation of an asynchronous supply chain application.</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-api</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-core</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>supplychain.SupplyChainClient</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/branches/sca-java-integration/samples/sca/supplychain/readme.htm b/branches/sca-java-integration/samples/sca/supplychain/readme.htm
new file mode 100644
index 0000000000..901df1a741
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/supplychain/readme.htm
@@ -0,0 +1,89 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"><title>Tuscany
+Supply Chain</title><!-- LINK rel="stylesheet" href="ait.css" type="text/css" -->
+<style type="text/css" media="all">
+@import url("../../../../css/maven-base.css");
+@import url("../../../../css/maven-theme.css");
+@import url("../../../../css/site.css");
+</style><link rel="stylesheet" href="./css/print.css" type="text/css" media="print"></head>
+<body><h2>Tuscany
+Supply Chain Sample</h2>
+<h3>Overview</h3>
+<p>The Tuscany supply chain sample shows using the Tuscany SCA
+runtime in a J2SE environment&nbsp;executing the SCA asynchronous API.</p>
+<h3>Location</h3>This
+sample is located &nbsp;in the samples\sca\supplychain directory.<br>
+<h3>Setup</h3>This sample depends on the Tuscany runtime
+and the sample jar,&nbsp;<span style="font-weight: bold;">sample-supplychain-incubating-M1.jar</span>
+, both of these must be available on the classpath to run the sample.
+<h3>Running</h3> In the directory&nbsp;samples\sca\supplychain
+use the JDK 1.5 java command to run the class <span style="font-weight: bold;">supplychain.SupplyChainClient</span> <pre>Linux: java -cp ../../../lib/tuscany-runtime-incubating-M1.jar:target/sample-supplychain-incubating-M1.jar supplychain.SupplyChainClient</pre>
+<pre>Windows: java -cp ../../../lib/tuscany-runtime-incubating-M1.jar;target/sample-supplychain-incubating-M1.jar supplychain.SupplyChainClient</pre><h3>Results</h3>
+<p>The sample when run should simply display to the standard
+output: <code></code></p><p>May 16, 2006
+3:12:13 PM org.apache.tuscany.core.client.TuscanyRuntime$Monitor
+moduleStarted<br>INFO: Started application module [supplychain]<br>Main
+thread Thread[main,5,main]<br>Work thread Thread[Thread-1,5,main]
+- <span style="font-weight: bold;">Order, submitted, fulfilled, shipped</span><code></code></p>
+<h3>Code Overview</h3>
+The source files are physically organized as shown below:
+<table style="text-align: left; width: 100%;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr><td>src<br>+---main<br>&nbsp;&nbsp;&nbsp;
++---java<br>&nbsp;&nbsp;&nbsp;
+&brvbar;&nbsp;&nbsp; +---supplychain<br>&nbsp;&nbsp;&nbsp;
+&brvbar;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+Customer.java<br>&nbsp;&nbsp;&nbsp;
+&brvbar;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+CustomerComponentImpl.java<br>&nbsp;&nbsp;&nbsp;
+&brvbar;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+Retailer.java<br>&nbsp;&nbsp;&nbsp;
+&brvbar;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+RetailerComponentImpl.java<br>&nbsp;&nbsp;&nbsp;
+&brvbar;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+Shipper.java<br>&nbsp;&nbsp;&nbsp;
+&brvbar;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ShipperComponentImpl.java<br>&nbsp;&nbsp;&nbsp;
+&brvbar;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+SupplyChainClient.java<br>&nbsp;&nbsp;&nbsp;
+&brvbar;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+Warehouse.java<br>&nbsp;&nbsp;&nbsp;
+&brvbar;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+WarehouseComponentImpl.java<br>&nbsp;&nbsp;&nbsp;
+&brvbar;<br>&nbsp;&nbsp;&nbsp; +---resources<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+logging.properties<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+sca.module<br></td></tr></tbody></table>
+<br><table style="text-align: left; width: 879px; height: 154px;" border="0" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top;">Customer.java</td>
+<td>Defines the Java interface implemented by the Customer
+component.</td>
+</tr> <tr> <td style="vertical-align: top;">CustomerComponentImpl.java</td>
+<td>Implements the SCA Customer component.</td>
+</tr> <tr> <td style="vertical-align: top;">Retailer.java</td>
+<td>Defines the Java interface implemented by the Retailer
+component.</td>
+</tr><tr><td>RetailerComponentImpl.java</td><td>Implements
+the SCA&nbsp;RetailerComponent component.</td></tr><tr><td>Shipper.java</td><td>Defines
+the Java interface implemented by the&nbsp;Shipper component</td></tr><tr><td>ShipperComponentImpl.java</td><td>Implements
+the SCA&nbsp;ShipperComponent component.</td></tr><tr><td>SupplyChainClient.java</td><td>SupplyChainClient.java
+loads SCA runtime</td></tr><tr><td>Warehouse.java</td><td>Defines
+the Java interface implemented by the&nbsp;Warehouse component.</td></tr><tr><td>WarehouseComponentImpl.java</td><td>Implements
+the SCA&nbsp;WarehouseComponent component.</td></tr><tr><td>logging.properties</td><td>Configures
+Tuscany logging. Provides the output of this demo.</td></tr><tr><td>sca.module</td><td>Defines
+and assembles the SCA components</td></tr> </tbody></table><br></body></html>
diff --git a/branches/sca-java-integration/samples/sca/supplychain/run.bat b/branches/sca-java-integration/samples/sca/supplychain/run.bat
new file mode 100755
index 0000000000..f0dc934ada
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/supplychain/run.bat
@@ -0,0 +1,7 @@
+echo off
+rem set java_debug_set=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=3720,server=y,suspend=y
+mkdir target\standalone
+pushd target\standalone
+jar -xf "%USERPROFILE%\.m2\repository\org\apache\tuscany\standalone\1.0-SNAPSHOT\standalone-1.0-SNAPSHOT-bin.zip"
+popd
+java %java_debug_set% -jar target\standalone\bin\launcher.jar --classpath "%USERPROFILE%\.m2\repository\org\apache\tuscany\samples\sca\sample-supplychain\1.0-SNAPSHOT\sample-supplychain-1.0-SNAPSHOT.jar" %*
diff --git a/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/Customer.java b/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/Customer.java
new file mode 100644
index 0000000000..8088001898
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/Customer.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 supplychain;
+
+import org.osoa.sca.annotations.OneWay;
+
+/**
+ * This is the business interface of the Customer service component.
+ */
+public interface Customer {
+
+ public void purchaseGoods();
+
+ @OneWay
+ public void notifyShipment(String order);
+
+}
diff --git a/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/CustomerComponentImpl.java b/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/CustomerComponentImpl.java
new file mode 100644
index 0000000000..72707e91da
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/CustomerComponentImpl.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package supplychain;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements the Customer service component.
+ */
+@Service(Customer.class)
+@Scope("COMPOSITE")
+public class CustomerComponentImpl implements Customer {
+
+ private Retailer retailer;
+
+ @Reference
+ public void setRetailer(Retailer retailer) {
+ this.retailer = retailer;
+ }
+
+ public void purchaseGoods() {
+ retailer.submitOrder("Order");
+ }
+
+ public void notifyShipment(String order) {
+ System.out.print("Work thread " + Thread.currentThread() + " - ");
+ System.out.println(order);
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/Retailer.java b/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/Retailer.java
new file mode 100644
index 0000000000..1add63fb4e
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/Retailer.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package supplychain;
+
+/**
+ * This is the business interface of the Retailer service component.
+ */
+public interface Retailer {
+
+ public void submitOrder(String order);
+
+}
diff --git a/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/RetailerComponentImpl.java b/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/RetailerComponentImpl.java
new file mode 100644
index 0000000000..2af1443d63
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/RetailerComponentImpl.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package supplychain;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements the Customer service component.
+ */
+@Service(Retailer.class)
+@Scope("COMPOSITE")
+public class RetailerComponentImpl implements Retailer {
+
+ private Warehouse warehouse;
+
+ @Reference
+ public void setWarehouse(Warehouse warehouse) {
+ this.warehouse = warehouse;
+ }
+
+ public void submitOrder(String order) {
+ warehouse.fulfillOrder(order + ", submitted");
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/Shipper.java b/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/Shipper.java
new file mode 100644
index 0000000000..d4d49a922b
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/Shipper.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package supplychain;
+
+/**
+ * This is the business interface of the Shipper service component.
+ */
+public interface Shipper {
+
+ public void processShipment(String order);
+
+}
diff --git a/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/ShipperComponentImpl.java b/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/ShipperComponentImpl.java
new file mode 100644
index 0000000000..143274a279
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/ShipperComponentImpl.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package supplychain;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements the Warehouse service component.
+ */
+@Service(Shipper.class)
+@Scope("COMPOSITE")
+public class ShipperComponentImpl implements Shipper {
+
+ private Customer customer;
+
+ @Reference
+ public void setCustomer(Customer customer) {
+ this.customer = customer;
+ }
+
+ public void processShipment(String order) {
+ customer.notifyShipment(order + ", shipped");
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/SupplyChainClient.java b/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/SupplyChainClient.java
new file mode 100644
index 0000000000..2e1f7fca36
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/SupplyChainClient.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package supplychain;
+
+import org.apache.tuscany.api.SCARuntime;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * locate a Customer service component and invoke it.
+ */
+public class SupplyChainClient {
+
+ public static final void main(String[] args) throws Exception {
+ SCARuntime.start("supplychain.composite");
+
+ // Locate the Customer component and invoke it
+ CompositeContext context = CurrentCompositeContext.getContext();
+ Customer customer =
+ context.locateService(Customer.class, "CustomerComponent");
+
+ System.out.println("Main thread " + Thread.currentThread());
+ customer.purchaseGoods();
+ System.out.println("Main thread sleeping ...");
+ Thread.sleep(1000);
+
+ SCARuntime.stop();
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/Warehouse.java b/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/Warehouse.java
new file mode 100644
index 0000000000..0be499f569
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/Warehouse.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package supplychain;
+
+/**
+ * This is the business interface of the Warehouse service component.
+ */
+public interface Warehouse {
+
+ public void fulfillOrder(String order);
+
+}
diff --git a/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/WarehouseComponentImpl.java b/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/WarehouseComponentImpl.java
new file mode 100644
index 0000000000..cb3e6173bc
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/supplychain/src/main/java/supplychain/WarehouseComponentImpl.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package supplychain;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements the Warehouse service component.
+ */
+@Service(Warehouse.class)
+@Scope("COMPOSITE")
+public class WarehouseComponentImpl implements Warehouse {
+
+ private Shipper shipper;
+
+ @Reference
+ public void setShipper(Shipper shipper) {
+ this.shipper = shipper;
+ }
+
+ public void fulfillOrder(String order) {
+ shipper.processShipment(order + ", fulfilled");
+ }
+
+}
diff --git a/branches/sca-java-integration/samples/sca/supplychain/src/main/resources/META-INF/LICENSE.txt b/branches/sca-java-integration/samples/sca/supplychain/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000000..25d78feeac
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/supplychain/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/branches/sca-java-integration/samples/sca/supplychain/src/main/resources/META-INF/NOTICE b/branches/sca-java-integration/samples/sca/supplychain/src/main/resources/META-INF/NOTICE
new file mode 100644
index 0000000000..d48810c0ec
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/supplychain/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/branches/sca-java-integration/samples/sca/supplychain/src/main/resources/META-INF/README.txt b/branches/sca-java-integration/samples/sca/supplychain/src/main/resources/META-INF/README.txt
new file mode 100644
index 0000000000..9b26d1690a
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/supplychain/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/branches/sca-java-integration/samples/sca/supplychain/src/main/resources/supplychain.composite b/branches/sca-java-integration/samples/sca/supplychain/src/main/resources/supplychain.composite
new file mode 100644
index 0000000000..998d92d50b
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/supplychain/src/main/resources/supplychain.composite
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" name="supplychain">
+
+ <component name="CustomerComponent">
+ <implementation.java class="supplychain.CustomerComponentImpl" />
+ <reference name="retailer" target="RetailerComponent"></reference>
+ </component>
+
+ <component name="RetailerComponent">
+ <implementation.java class="supplychain.RetailerComponentImpl" />
+ <reference name="warehouse" target="WarehouseComponent"></reference>
+ </component>
+
+ <component name="WarehouseComponent">
+ <implementation.java class="supplychain.WarehouseComponentImpl" />
+ <reference name="shipper" target="ShipperComponent"></reference>
+ </component>
+
+ <component name="ShipperComponent">
+ <implementation.java class="supplychain.ShipperComponentImpl" />
+ <reference name="customer" target="CustomerComponent"></reference>
+ </component>
+
+</composite>
diff --git a/branches/sca-java-integration/samples/sca/supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java b/branches/sca-java-integration/samples/sca/supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java
new file mode 100644
index 0000000000..73e765d7f1
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/supplychain/src/test/java/supplychain/SupplyChainClientTestCase.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package supplychain;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.api.SCARuntime;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+/**
+ * This client program shows how to create an SCA runtime, start it, locate a simple HelloWorld service component and
+ * invoke it.
+ */
+public class SupplyChainClientTestCase extends TestCase {
+
+ private Customer customer;
+
+ protected void setUp() throws Exception {
+ SCARuntime.start("supplychain.composite");
+
+ CompositeContext context = CurrentCompositeContext.getContext();
+ customer = context.locateService(Customer.class, "CustomerComponent");
+ }
+
+ protected void tearDown() throws Exception {
+ SCARuntime.stop();
+ }
+
+ public void test() throws Exception {
+
+ System.out.println("Main thread " + Thread.currentThread());
+ customer.purchaseGoods();
+ System.out.println("Sleeping ...");
+ Thread.sleep(1000);
+ }
+}
diff --git a/branches/sca-java-integration/samples/sca/webapp/LICENSE.txt b/branches/sca-java-integration/samples/sca/webapp/LICENSE.txt
new file mode 100644
index 0000000000..0084319535
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/webapp/LICENSE.txt
@@ -0,0 +1,202 @@
+
+ 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, serviceDefinition marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/branches/sca-java-integration/samples/sca/webapp/NOTICE.txt b/branches/sca-java-integration/samples/sca/webapp/NOTICE.txt
new file mode 100644
index 0000000000..d83ebbe236
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/webapp/NOTICE.txt
@@ -0,0 +1,14 @@
+${pom.name}
+Copyright (c) 2005 - 2006 The Apache Software Foundation
+
+Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/branches/sca-java-integration/samples/sca/webapp/pom.xml b/branches/sca-java-integration/samples/sca/webapp/pom.xml
new file mode 100644
index 0000000000..8cde5cfedf
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/webapp/pom.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.samples.sca</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>tuscany-sample-webapp</artifactId>
+ <packaging>war</packaging>
+ <name>Apache Tuscany Simple WebApp Sample</name>
+ <description>A sample Web Application showing how to use SCA from a JSP.</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-api</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-core</artifactId>
+ <version>0.1-integration-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/branches/sca-java-integration/samples/sca/webapp/src/main/webapp/WEB-INF/default.scdl b/branches/sca-java-integration/samples/sca/webapp/src/main/webapp/WEB-INF/default.scdl
new file mode 100644
index 0000000000..20cc092cf0
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/webapp/src/main/webapp/WEB-INF/default.scdl
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ name="CalculatorComposite">
+
+ <component name="CalculatorServiceComponent">
+ <implementation.composite name="CalculatorComposite" jarLocation="lib/sample-calculator-1.0-incubator-SNAPSHOT.jar"/>
+ </component>
+</composite>
diff --git a/branches/sca-java-integration/samples/sca/webapp/src/main/webapp/WEB-INF/web.xml b/branches/sca-java-integration/samples/sca/webapp/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000000..0398578086
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/webapp/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
+
+ <display-name>Apache Tuscany Simple Webapp Sample</display-name>
+
+ <welcome-file-list id="WelcomeFileList">
+ <welcome-file>calc.jsp</welcome-file>
+ </welcome-file-list>
+
+ <filter>
+ <filter-name>TuscanyFilter</filter-name>
+ <filter-class>org.apache.tuscany.runtime.webapp.TuscanyFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>TuscanyFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <listener>
+ <listener-class>org.apache.tuscany.runtime.webapp.TuscanyContextListener</listener-class>
+ </listener>
+</web-app>
diff --git a/branches/sca-java-integration/samples/sca/webapp/src/main/webapp/calc.jsp b/branches/sca-java-integration/samples/sca/webapp/src/main/webapp/calc.jsp
new file mode 100644
index 0000000000..83a368dedb
--- /dev/null
+++ b/branches/sca-java-integration/samples/sca/webapp/src/main/webapp/calc.jsp
@@ -0,0 +1,43 @@
+<%@ page import="calculator.CalculatorService" %>
+<%@ page import="org.osoa.sca.CompositeContext" %>
+<%@ page import="org.osoa.sca.CurrentCompositeContext" %>
+<%--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%
+ CompositeContext context = CurrentCompositeContext.getContext();
+ CalculatorService calc = context.locateService(CalculatorService.class, "CalculatorServiceComponent/CalculatorService");
+%>
+<html>
+<head><title>Calculator sample</title></head>
+
+<body>
+<table>
+ <tr>
+ <th>Expression</th><th>Result</th>
+ </tr>
+ <tr>
+ <td>2 + 3</td><td><%= calc.add(2, 3) %></td>
+ </tr>
+ <tr>
+ <td>3 - 2</td><td><%= calc.subtract(3, 2) %></td>
+ </tr>
+</table>
+</body>
+</html> \ No newline at end of file