summaryrefslogtreecommitdiffstats
path: root/sandbox/lresende
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/lresende')
-rw-r--r--sandbox/lresende/backup/container.das.client/build.xml55
-rw-r--r--sandbox/lresende/backup/container.das.client/pom.xml113
-rw-r--r--sandbox/lresende/backup/container.das.client/readme.html199
-rw-r--r--sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/CustomersOrdersService.java43
-rw-r--r--sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/CustomersOrdersServiceImpl.java74
-rw-r--r--sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/StoredProcs.java42
-rw-r--r--sandbox/lresende/backup/container.das.client/src/main/resources/CustomersOrders.componentType26
-rw-r--r--sandbox/lresende/backup/container.das.client/src/main/resources/CustomersOrders.xml82
-rw-r--r--sandbox/lresende/backup/container.das.client/src/main/resources/META-INF/LICENSE.txt202
-rw-r--r--sandbox/lresende/backup/container.das.client/src/main/resources/META-INF/NOTICE32
-rw-r--r--sandbox/lresende/backup/container.das.client/src/main/resources/META-INF/README.txt35
-rw-r--r--sandbox/lresende/backup/container.das.client/src/main/resources/log4j.properties29
-rw-r--r--sandbox/lresende/backup/container.das.client/src/main/webapp/Company.jsp70
-rw-r--r--sandbox/lresende/backup/container.das.client/src/main/webapp/Customer.jsp419
-rw-r--r--sandbox/lresende/backup/container.das.client/src/main/webapp/META-INF/context.xml25
-rw-r--r--sandbox/lresende/backup/container.das.client/src/main/webapp/WEB-INF/default.scdl30
-rw-r--r--sandbox/lresende/backup/container.das.client/src/main/webapp/WEB-INF/web.xml44
-rw-r--r--sandbox/lresende/backup/container.das/.ruleset190
-rw-r--r--sandbox/lresende/backup/container.das/LICENSE.txt202
-rw-r--r--sandbox/lresende/backup/container.das/NOTICE.txt14
-rw-r--r--sandbox/lresende/backup/container.das/README.txt35
-rw-r--r--sandbox/lresende/backup/container.das/pom.xml89
-rw-r--r--sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessComponent.java128
-rw-r--r--sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessComponentBuilder.java108
-rw-r--r--sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessComponentConfiguration.java137
-rw-r--r--sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessComponentType.java58
-rw-r--r--sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessComponentTypeLoader.java130
-rw-r--r--sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessImplementation.java79
-rw-r--r--sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessImplementationLoader.java92
-rw-r--r--sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessInstance.java30
-rw-r--r--sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessInstanceFactory.java92
-rw-r--r--sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessInvoker.java67
-rw-r--r--sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/MissingSideFileException.java44
-rw-r--r--sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccessscript/CommandMapper.java44
-rw-r--r--sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccessscript/DataAccessEngine.java65
-rw-r--r--sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccessscript/DataAccessInstanceImpl.java328
-rw-r--r--sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccessscript/DataAccessUtils.java90
-rw-r--r--sandbox/lresende/backup/container.das/src/main/resources/META-INF/sca/das.system.scdl39
-rw-r--r--sandbox/lresende/backup/container.das/src/main/resources/META-INF/sca/default.scdl38
-rw-r--r--sandbox/lresende/das/api/pom.xml139
-rw-r--r--sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/Command.java68
-rw-r--r--sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/ConfigHelper.java54
-rw-r--r--sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/Converter.java54
-rw-r--r--sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/DAS.java68
-rw-r--r--sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/DASFactory.java114
-rw-r--r--sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/Implementation.java17
-rw-r--r--sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/Pager.java64
-rw-r--r--sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/service/ServiceLoader.java110
-rw-r--r--sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/service/ServiceProvider.java97
-rw-r--r--sandbox/lresende/das/api/src/main/resources/META-INF/LICENSE.txt323
-rw-r--r--sandbox/lresende/das/api/src/main/resources/META-INF/MANIFEST.MF13
-rw-r--r--sandbox/lresende/das/api/src/main/resources/META-INF/NOTICE.txt18
-rw-r--r--sandbox/lresende/das/api/src/main/resources/META-INF/README.txt35
-rw-r--r--sandbox/lresende/das/api/src/main/resources/config.xsd35
-rw-r--r--sandbox/lresende/das/ldap/pom.xml144
-rw-r--r--sandbox/lresende/das/ldap/src/main/java/org/apache/tuscany/das/ldap/impl/LdapDASFactoryImpl.java66
-rw-r--r--sandbox/lresende/das/ldap/src/main/resources/META-INF/LICENSE.txt323
-rw-r--r--sandbox/lresende/das/ldap/src/main/resources/META-INF/MANIFEST.MF13
-rw-r--r--sandbox/lresende/das/ldap/src/main/resources/META-INF/NOTICE.txt18
-rw-r--r--sandbox/lresende/das/ldap/src/main/resources/META-INF/README.txt35
-rw-r--r--sandbox/lresende/das/ldap/src/main/resources/META-INF/services/org.apache.tuscany.das.DASFactory1
-rw-r--r--sandbox/lresende/das/ldap/src/main/resources/ldap-config.xsd59
-rw-r--r--sandbox/lresende/das/ldap/src/test/java/org/apache/tuscany/das/ldap/DASFactoryTestCase.java38
-rw-r--r--sandbox/lresende/das/pom.xml123
-rw-r--r--sandbox/lresende/das/xquery/pom.xml113
-rw-r--r--sandbox/lresende/das/xquery/src/main/java/org/apache/tuscany/das/xquery/impl/XQueryDASFactoryImpl.java45
-rw-r--r--sandbox/lresende/das/xquery/src/main/resources/META-INF/LICENSE.txt323
-rw-r--r--sandbox/lresende/das/xquery/src/main/resources/META-INF/MANIFEST.MF13
-rw-r--r--sandbox/lresende/das/xquery/src/main/resources/META-INF/NOTICE.txt18
-rw-r--r--sandbox/lresende/das/xquery/src/main/resources/META-INF/README.txt35
-rw-r--r--sandbox/lresende/das/xquery/src/main/resources/META-INF/services/org.apache.tuscany.das.DASFactory1
-rw-r--r--sandbox/lresende/das/xquery/src/main/resources/config.xsd62
-rw-r--r--sandbox/lresende/das/xquery/src/test/java/org/apache/tuscany/das/xquery/XQueryDASFactoryTestCase.java39
-rw-r--r--sandbox/lresende/etc/download-script/README30
-rwxr-xr-xsandbox/lresende/etc/download-script/all-report.sh4
-rwxr-xr-xsandbox/lresende/etc/download-script/cpp-report.sh130
-rwxr-xr-xsandbox/lresende/etc/download-script/cpp_sca-m1.sh2
-rwxr-xr-xsandbox/lresende/etc/download-script/cpp_sca-m2.sh2
-rwxr-xr-xsandbox/lresende/etc/download-script/cpp_sca-m3.sh2
-rwxr-xr-xsandbox/lresende/etc/download-script/cpp_sdo-m1.sh2
-rwxr-xr-xsandbox/lresende/etc/download-script/cpp_sdo-m2.sh2
-rwxr-xr-xsandbox/lresende/etc/download-script/cpp_sdo-m3.sh2
-rwxr-xr-xsandbox/lresende/etc/download-script/das-beta1.sh2
-rwxr-xr-xsandbox/lresende/etc/download-script/das-beta2.sh2
-rwxr-xr-xsandbox/lresende/etc/download-script/das-m2.sh2
-rwxr-xr-xsandbox/lresende/etc/download-script/das-report.sh52
-rwxr-xr-xsandbox/lresende/etc/download-script/sca-090.sh2
-rwxr-xr-xsandbox/lresende/etc/download-script/sca-091.sh2
-rwxr-xr-xsandbox/lresende/etc/download-script/sca-099.sh2
-rw-r--r--sandbox/lresende/etc/download-script/sca-100.sh2
-rwxr-xr-xsandbox/lresende/etc/download-script/sca-101.sh2
-rwxr-xr-xsandbox/lresende/etc/download-script/sca-11.sh2
-rwxr-xr-xsandbox/lresende/etc/download-script/sca-12.sh2
-rwxr-xr-xsandbox/lresende/etc/download-script/sca-m2.sh2
-rwxr-xr-xsandbox/lresende/etc/download-script/sca-report.sh110
-rwxr-xr-xsandbox/lresende/etc/download-script/sdo-1.sh2
-rwxr-xr-xsandbox/lresende/etc/download-script/sdo-beta1.sh2
-rwxr-xr-xsandbox/lresende/etc/download-script/sdo-m2.sh2
-rwxr-xr-xsandbox/lresende/etc/download-script/sdo-report.sh57
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo1/pom.xml65
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo1/src/main/java/calculadora/Calculadora.java31
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo1/src/main/java/calculadora/CalculadoraImpl.java39
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo1/src/main/java/calculadora/Cliente.java42
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo1/src/main/resources/calculadora.composite27
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo2/pom.xml65
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/Calculadora.java31
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/CalculadoraImpl.java66
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/Cliente.java42
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoAdicionar.java24
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoAdicionarImpl.java28
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoDividir.java24
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoDividirImpl.java28
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoMultiplicar.java24
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoMultiplicarImpl.java28
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoSubtrair.java24
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoSubtrairImpl.java28
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo2/src/main/resources/calculadora.composite48
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo3/pom.xml79
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/Calculadora.java31
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/CalculadoraImpl.java69
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/Cliente.java42
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/ServicoAdicionar.java24
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/ServicoDividir.java24
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/ServicoMultiplicar.java24
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/ServicoSubtrair.java24
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/demo/ServidorCalculadora.java41
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo3/src/main/resources/calculadora.composite55
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo3/src/main/resources/calculadora/ServicoAdicionarImpl.js22
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo3/src/main/resources/calculadora/ServicoDividirImpl.groovy22
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo3/src/main/resources/calculadora/ServicoMultiplicarImpl.py20
-rw-r--r--sandbox/lresende/mundo-java/calculadora-passo3/src/main/resources/calculadora/ServicoSubtrairImpl.rb21
-rw-r--r--sandbox/lresende/mundo-java/pom.xml47
-rw-r--r--sandbox/lresende/pom.xml114
-rw-r--r--sandbox/lresende/sca/demos/customer-map/DISCLAIMER8
-rw-r--r--sandbox/lresende/sca/demos/customer-map/LICENSE205
-rw-r--r--sandbox/lresende/sca/demos/customer-map/NOTICE6
-rw-r--r--sandbox/lresende/sca/demos/customer-map/customer-maps.sql28
-rw-r--r--sandbox/lresende/sca/demos/customer-map/pom.xml171
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/java/customer/CustomerService.java35
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/java/launch/Launch.java34
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/customer-map.composite42
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/customer.componentType31
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/customer.xml27
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/customer.xsd35
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/db.lckbin0 -> 38 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/log/log.ctrlbin0 -> 48 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/log/log1.datbin0 -> 1048576 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/log/logmirror.ctrlbin0 -> 48 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c10.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c101.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c111.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c121.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c130.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c141.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c150.datbin0 -> 16384 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c161.datbin0 -> 16384 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c171.datbin0 -> 16384 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c180.datbin0 -> 24576 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c191.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1a1.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1b1.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1c0.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1d1.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1e0.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1f1.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c20.datbin0 -> 20480 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c200.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c211.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c221.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c230.datbin0 -> 274432 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c241.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c251.datbin0 -> 12288 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c260.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c271.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c281.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c290.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2a1.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2b1.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2c1.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2d0.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2e1.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2f0.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c300.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c31.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c311.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c41.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c51.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c60.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c71.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c81.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c90.datbin0 -> 24576 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/ca1.datbin0 -> 20480 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cb1.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cc0.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cd1.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/ce1.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cf0.datbin0 -> 8192 bytes
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/service.properties22
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/html/binding-atom.js92
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/html/binding-jsonrpc.js494
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/html/index-plain.html76
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/html/index.html55
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/main/resources/html/map.json27
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/test/java/customer/CustomerServiceTestCase.java60
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/test/resources/customer.componentType29
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/test/resources/customer.composite35
-rw-r--r--sandbox/lresende/sca/demos/customer-map/src/test/resources/customer.xml27
-rw-r--r--sandbox/lresende/sca/modules/contribution-installer/.checkstyle24
-rw-r--r--sandbox/lresende/sca/modules/contribution-installer/.pmd20
-rw-r--r--sandbox/lresende/sca/modules/contribution-installer/.ruleset190
-rw-r--r--sandbox/lresende/sca/modules/contribution-installer/DISCLAIMER8
-rw-r--r--sandbox/lresende/sca/modules/contribution-installer/LICENSE.txt202
-rw-r--r--sandbox/lresende/sca/modules/contribution-installer/NOTICE.txt14
-rw-r--r--sandbox/lresende/sca/modules/contribution-installer/pom.xml77
-rw-r--r--sandbox/lresende/sca/modules/contribution-installer/src/main/java/org/apache/tuscany/contribution/installer/Main.java95
-rw-r--r--sandbox/lresende/sca/modules/contribution-installer/src/main/resources/org/apache/tuscany/services/contribution/installer/Main.properties23
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/DISCLAIMER8
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/LICENSE205
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/NOTICE6
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/README33
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/company.sql28
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/pom.xml174
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementation.java36
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementationFactory.java24
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementationProcessor.java99
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/PersistenceUnitInfoImplProcessor.java109
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyBrokerFactory.java100
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyBrokerImpl.java37
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyJDBCConfigurationImpl.java58
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyManagerRuntime.java51
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyStoreManager.java49
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/impl/JPAImplementationFactoryImpl.java39
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/impl/JPAImplementationImpl.java119
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAImplementationProvider.java96
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAImplementationProviderFactory.java44
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAInvoker.java63
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor19
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.openjpa.OpenJpaImplementationFactory18
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory19
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/company/Company.java47
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/company/CompanyCollection.java25
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/company/CompanyCollectionImpl.java100
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/org/apache/tuscany/sca/implementation/openjpa/CompanyCollectionTestCase.java44
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/org/apache/tuscany/sca/implementation/openjpa/CompanyTestCase.java80
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/test/resources/META-INF/orm.xml36
-rw-r--r--sandbox/lresende/sca/modules/implementation-data-pojo/src/test/resources/META-INF/persistence.xml40
-rwxr-xr-xsandbox/lresende/sca/modules/implementation-data-pojo/src/test/resources/company.composite47
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/README118
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/build.xml137
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/calculator-web.pngbin0 -> 22916 bytes
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/calculator-web.svg358
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/pom.xml99
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/beans/Calculator.java78
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/AddService.java28
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/AddServiceImpl.java30
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorClient.java47
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorService.java35
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorServiceImpl.java69
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/DivideService.java28
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/DivideServiceImpl.java30
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/MultiplyService.java28
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/MultiplyServiceImpl.java30
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/SubtractService.java28
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/SubtractServiceImpl.java30
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/resources/Calculator.composite49
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/resources/wsdl/add.wsdl87
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/META-INF/sca-contribution.xml24
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/WEB-INF/faces-config.xml14
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/WEB-INF/web.xml59
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/calc.jsp50
-rw-r--r--sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/calc_jsf.jsp27
-rw-r--r--sandbox/lresende/sca/samples/company-das-webapp/build.xml55
-rw-r--r--sandbox/lresende/sca/samples/company-das-webapp/company.sql40
-rw-r--r--sandbox/lresende/sca/samples/company-das-webapp/pom.xml138
-rw-r--r--sandbox/lresende/sca/samples/company-das-webapp/readme.html199
-rw-r--r--sandbox/lresende/sca/samples/company-das-webapp/src/main/java/das/DASService.java61
-rw-r--r--sandbox/lresende/sca/samples/company-das-webapp/src/main/java/das/DASServiceException.java37
-rw-r--r--sandbox/lresende/sca/samples/company-das-webapp/src/main/java/das/DASServiceImpl.java146
-rw-r--r--sandbox/lresende/sca/samples/company-das-webapp/src/main/resources/company.xml46
-rw-r--r--sandbox/lresende/sca/samples/company-das-webapp/src/main/resources/dasservice.composite29
-rw-r--r--sandbox/lresende/sca/samples/company-das-webapp/src/main/resources/log4j.properties29
-rw-r--r--sandbox/lresende/sca/samples/company-das-webapp/src/main/webapp/Company.jsp97
-rw-r--r--sandbox/lresende/sca/samples/company-das-webapp/src/main/webapp/META-INF/context.xml25
-rw-r--r--sandbox/lresende/sca/samples/company-das-webapp/src/main/webapp/META-INF/sca-contribution.xml25
-rw-r--r--sandbox/lresende/sca/samples/company-das-webapp/src/main/webapp/WEB-INF/web.xml35
-rw-r--r--sandbox/lresende/sca/samples/company-das/build.xml116
-rw-r--r--sandbox/lresende/sca/samples/company-das/company.sql40
-rw-r--r--sandbox/lresende/sca/samples/company-das/pom.xml149
-rw-r--r--sandbox/lresende/sca/samples/company-das/readme.html110
-rw-r--r--sandbox/lresende/sca/samples/company-das/src/main/java/das/DASService.java61
-rw-r--r--sandbox/lresende/sca/samples/company-das/src/main/java/das/DASServiceClient.java48
-rw-r--r--sandbox/lresende/sca/samples/company-das/src/main/java/das/DASServiceException.java37
-rw-r--r--sandbox/lresende/sca/samples/company-das/src/main/java/das/DASServiceImpl.java153
-rw-r--r--sandbox/lresende/sca/samples/company-das/src/main/resources/company.xml52
-rw-r--r--sandbox/lresende/sca/samples/company-das/src/main/resources/dasservice.composite29
-rw-r--r--sandbox/lresende/sca/samples/company-das/src/main/resources/log4j.properties36
-rw-r--r--sandbox/lresende/sca/samples/company-das/src/test/java/das/DASServiceTestCase.java53
-rw-r--r--sandbox/lresende/sca/samples/company-das/src/test/resources/company.xml52
-rw-r--r--sandbox/lresende/sca/samples/company-das/src/test/resources/log4j.properties36
-rw-r--r--sandbox/lresende/sca/samples/pom.xml49
-rw-r--r--sandbox/lresende/sca/samples/store-jsf/README2
-rw-r--r--sandbox/lresende/sca/samples/store-jsf/pom.xml72
-rw-r--r--sandbox/lresende/sca/samples/store-jsf/src/main/java/beans/Catalog.java56
-rw-r--r--sandbox/lresende/sca/samples/store-jsf/src/main/java/beans/Product.java56
-rw-r--r--sandbox/lresende/sca/samples/store-jsf/src/main/webapp/WEB-INF/faces-config.xml31
-rw-r--r--sandbox/lresende/sca/samples/store-jsf/src/main/webapp/WEB-INF/lib/ajax4jsf-1.1.1.jarbin0 -> 1262524 bytes
-rw-r--r--sandbox/lresende/sca/samples/store-jsf/src/main/webapp/WEB-INF/web.xml31
-rw-r--r--sandbox/lresende/sca/samples/store-jsf/src/main/webapp/catalog.jsp82
308 files changed, 15884 insertions, 0 deletions
diff --git a/sandbox/lresende/backup/container.das.client/build.xml b/sandbox/lresende/backup/container.das.client/build.xml
new file mode 100644
index 0000000000..feef76481b
--- /dev/null
+++ b/sandbox/lresende/backup/container.das.client/build.xml
@@ -0,0 +1,55 @@
+<?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 name="samples" default="compile">
+ <property name="mainDir" value="../../.."/>
+ <path id="javac.classpath">
+ <fileset dir="${mainDir}/lib">
+ <include name="tuscany-runtime-incubating-M1.jar"/>
+ </fileset>
+ </path>
+ <path id="java.classpath">
+ <fileset dir="${mainDir}/lib">
+ <include name="tuscany-runtime-incubating-M1.jar"/>
+ </fileset>
+ <pathelement path="target/sample-companyweb.jar"/>
+ </path>
+
+ <target name="init">
+ <mkdir dir="target/classes"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac srcdir="src/main/java" destdir="target/classes" debug="on" source="1.5" target="1.5">
+ <classpath refid="javac.classpath"/>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ </copy>
+ <war destfile="target/sample-companyweb.war" webxml="src/main/webapp/WEB-INF/web.xml">
+ <classes dir="target/classes"/>
+ </war>
+ </target>
+
+ <target name="clean">
+ <delete quiet="true" includeemptydirs="true">
+ <fileset dir="target" excludes="sample-companyweb-incubating-M1.war"/>
+ </delete>
+ </target>
+</project>
diff --git a/sandbox/lresende/backup/container.das.client/pom.xml b/sandbox/lresende/backup/container.das.client/pom.xml
new file mode 100644
index 0000000000..1d1acf6df5
--- /dev/null
+++ b/sandbox/lresende/backup/container.das.client/pom.xml
@@ -0,0 +1,113 @@
+<?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.das.samples</groupId>
+ <artifactId>tuscany-samples-das</artifactId>
+ <version>1.0-incubator-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>container-das-sample-client</artifactId>
+ <packaging>war</packaging>
+ <name>Tuscany DAS Container Client Application Sample</name>
+ <description>Sample web application using a DAS Container</description>
+
+ <dependencies>
+
+ <!-- runtime is need for webapp integration to include jar -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-api</artifactId>
+ <version>${pom.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.runtime.webapp</groupId>
+ <artifactId>webapp-api</artifactId>
+ <version>${pom.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>test</artifactId>
+ <version>${pom.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.das</groupId>
+ <artifactId>tuscany-das-rdb</artifactId>
+ <version>${pom.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-impl</artifactId>
+ <version>${pom.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ </dependencies>
+
+ <!-- this will place the java source files inside the war -->
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.sca.plugins</groupId>
+ <artifactId>tuscany-war-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>tuscany-war</id>
+ <goals>
+ <goal>tuscany-war</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <extensions>
+ <dependency>
+ <groupId>org.apache.tuscany.sca.services.containers</groupId>
+ <artifactId>das</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ </extensions>
+ </configuration>
+ </plugin>
+ </plugins>
+
+
+
+
+ <sourceDirectory>src/main/java</sourceDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/java</directory>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+ </build>
+</project>
diff --git a/sandbox/lresende/backup/container.das.client/readme.html b/sandbox/lresende/backup/container.das.client/readme.html
new file mode 100644
index 0000000000..65a50de320
--- /dev/null
+++ b/sandbox/lresende/backup/container.das.client/readme.html
@@ -0,0 +1,199 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT 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=windows-1252">
+<title>Tuscany RDB DAS Service client</title>
+
+<style>
+.code {font-size: 11px; color: #006699}
+.codebox {border: 1px solid #6699CC; background-color: #F1F7FA;padding:15px}
+.codebox2 {border: 1px solid #6699CC; background-color: #F1F7FA;padding:15px; width:85%}
+.codeboxW {border: 1px solid #6699CC; background-color: #FFFFFF;padding:15px}
+.codeboxB {background-color: #C9DBED;padding:1px 10px 10px 10px}
+</style>
+
+</head>
+
+
+
+
+<body>
+
+<h1>Tuscany RDB DAS Service client</h1>
+
+
+<h3>Introduction</h3>
+
+<p>
+This stand-alone sample application demonstrate how to consume the DAS Service exposed trough an SCA service.<br>
+The application starts with a canned database of Companies and their related Departments.<br>
+Through the web page interface, a user can consume the DAS Service to display the list of available companies.<br>
+The sample runs on Tomcat 5.5 and employs a Derby database accessed via a DataSource.
+</p>
+
+
+
+
+
+<h3>Running the sample</h3>
+
+<p>There are two options for running this sample:</p>
+
+<ol>
+ <li>Run from Tomcat configured by the build</li>
+ <li>Deploying the DASService.client WAR into a Tomcat you configure yourself</li>
+</ol>
+
+
+<h3>Running from Tomcat configured by the build</h3>
+
+<p>
+This sample application is deployed (along with the canned test database) to an instance of Tomcat as part of our automated sample
+testing.This means you can run the java/samples/testing/tomcat build (see java/das/samples/testing/tomcat/readme.htm ) and then access
+the application by pointing your browser to http://localhost:8080/companyweb-service-client/
+</p>
+
+
+
+<h3>Deploying the DASService.client WAR into a Tomcat you configure yourself</h3>
+
+<p>
+Alternatively, you can deploy the sample to your own configured Tomcat installation by following the instructions below.
+These instructions assume that you have either 1) downloaded the Tuscany sample distribution or 2) Downloaded the Tuscany
+source and run our maven build, see the following link to more details steps on how to build DAS Sample applications <a
+href="http://incubator.apache.org/tuscany/java_das_overview.html">http://incubator.apache.org/tuscany/java_das_overview.html</a>.
+</p>
+
+<p><b><u>Set Up:</u></b></p>
+
+
+<ol>
+ <li>Download and install the most recent stable version of Tomcat 5.5. You can find it here: <a
+ href="http://tomcat.apache.org/download-55.cgi">http://tomcat.apache.org/download-55.cgi</a></li>
+ <li>Download the most recent official release of Derby from here: <a href="http://db.apache.org/derby/index.html">http://db.apache.org/derby/index.html</a>.
+ The only file you’ll need from this download is derby.jar</li>
+ <li>Stop Tomcat</li>
+ <li>Copy derby.jar (from the derby distribution) to {Tomcat_Home}/common/lib:</li>
+ <li>Add the sample war file to {Tomcat_Home}/webapps</li>
+ <ol start=1 type=a>
+ <li>sample-das-service-client-xxx.war (e.g.sample-das-service-client-1.0-incubator-SNAPSHOT.war)</li>
+ </ol>
+ <li>Install the canned Derby database to Tomcat: </li>
+ <ol start=1 type=a>
+ <li>First, create a new directory named “Databases” to hold the sample database. Create {Tomcat_Home}/Databases</li>
+ <li>Copy the <b>dastest</b> folder (and all its contents) from {build directory root OR
+ where samples where unzipped}/java/das/samples/DASService.client to {Tomcat_Home}/Databases.<br>
+ <br>
+ <b>NOTE</b>: If you are running this from a sample distribution, the canned database is available in the
+ distribution, inside the databases directory. </li>
+ </ol>
+ <li>Define a DataSource by adding a datasource definition to {Tomcat_Home}/conf/server.xml.</li>
+ <ol start=1 type=a>
+ <li>Find the end-of-section marker &lt;/GlobalNamingResources&gt; and add the following lines just above it:
+ <p>
+ <div class="codebox2">
+ <pre>
+ &lt;!-- Global Datasource for Derby dastest database --&gt;
+ &lt;Resource name="jdbc/dastest"
+ type="javax.sql.DataSource" auth="Container"
+ description="Derby database for DAS Company sample"
+ maxActive="100" maxIdle="30" maxWait="10000"
+ username="" password=""
+ driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
+ url="jdbc:derby:{absolute path}Databases/dastest"/&gt;
+ </pre>
+ </div>
+ </p>
+ <p><b>Requirement</b>:You must include the absolute path to the “Databases” directory in the above url attribute. Fore example:</p>
+ <p><pre> url=&quot;jdbc:derby:c:\apache-tomcat-5.5.17\Databases/dastest&quot;</pre></p>
+ </li>
+ </ol>
+ <li><p>Start tomcat and point your browser to: <a href="http://localhost:8080/sample-das-service-client-%7bversion%20tag%7d/">http://localhost:8080/sample-das-service-client-{version
+ tag}/</a>. Example:</p>
+ <p><pre> http://localhost:8080/sample-das-service-client-1.0-incubator-SNAPSHOT/</pre></p>
+
+ </li>
+
+</ol>
+
+
+
+
+<h3>Sample Architecture</h3>
+
+<p>This is a simple, single-page, web application to consume DAS exposed as an SCA service.</p>
+<p>The main components of this application are:</p>
+
+<ul type=disc>
+ <li>The SCA DAS Service</li>
+ <li>SDO</li>
+ <li>Company.jsp</li>
+ <li>The canned Derby database</li>
+</ul>
+
+
+<p>The <b>Company.jsp</b> directly invoke the DAS Service to get a list of companies available and then iterate trough the SDO data graphs and manipulate SDO directly to display data</p>
+
+<p>The canned <b>Derby database</b> comes preloaded with Companies and related Departments. The Derby database instance is a simple file folder.</p>
+
+<p>The <b>SCA DAS Service</b> accepts directives (commands) and reads and writes to the derby database instance appropriately using DAS as the service implementation.</p>
+
+
+
+<h3>Consuming the DAS service</h3>
+
+<p>First, note that the application have dependencies on the DAS Service:</p>
+
+
+<p>
+<div class="codebox2">
+<pre>
+&lt;!-- DAS Service --&gt;
+&lt;dependency&gt;
+ &lt;groupId&gt;org.apache.tuscany.das.samples&lt;/groupId&gt;
+ &lt;artifactId&gt;sample-das-service&lt;/artifactId&gt;
+ &lt;version&gt;${pom.version}&lt;/version&gt;
+&lt;/dependency&gt;
+</pre>
+</div>
+</p>
+
+<br>
+<p>And the SCDL references the service:</p>
+
+<p>
+<div class="codebox2">
+<pre>
+&lt;composite xmlns="http://www.osoa.org/xmlns/sca/1.0" name="DASServiceComposite"&gt;
+ &lt;component name="DASServiceComponent"&gt;
+ &lt;implementation.composite name="DASServiceComposite" jarLocation="lib/sample-das-service-1.0-incubator-SNAPSHOT.jar"/&gt;
+ &lt;/component&gt;
+&lt;/composite&gt;
+</pre>
+</div>
+</p>
+
+
+
+
+</body>
+
+</html>
diff --git a/sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/CustomersOrdersService.java b/sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/CustomersOrdersService.java
new file mode 100644
index 0000000000..f301483be3
--- /dev/null
+++ b/sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/CustomersOrdersService.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 org.apache.tuscany.samples.das.orders;
+
+import java.util.ArrayList;
+import java.util.Vector;
+
+import commonj.sdo.DataObject;
+
+public interface CustomersOrdersService {
+
+ //dynamic way - demoed in J2SE client only
+ public void execute(Vector params);
+ public DataObject executeQuery(Vector params);
+ public void applyChanges(Vector params);
+ public DataObject executeAdhoc(Vector params);//adhoc query implementation - not done
+
+ //static way - demoed in JSP, J2SE clients
+ public DataObject getAllCustomers(Vector paramsList);
+ public DataObject getRangeCustomers(Vector paramsList);
+ public void getInsertCustomerExecute(Vector paramsList);
+ public void getInsertCustomerApplyChanges(Vector paramsList);
+ public void getDeleteCustomerExecute(Vector paramsList);
+ public void getDeleteCustomerApplyChanges(Vector paramsList);
+ public void getUpdateCustomer(Vector paramsList);
+ public DataObject getNamedCustomers(Vector paramsList);
+}
diff --git a/sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/CustomersOrdersServiceImpl.java b/sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/CustomersOrdersServiceImpl.java
new file mode 100644
index 0000000000..ffd02a8f85
--- /dev/null
+++ b/sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/CustomersOrdersServiceImpl.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.samples.das.orders;
+
+import java.util.Vector;
+import commonj.sdo.DataObject;
+
+public class CustomersOrdersServiceImpl implements CustomersOrdersService {
+
+ //dynamic way
+ public void execute(Vector params) {
+ }
+
+ public DataObject executeQuery(Vector params){
+ return null;
+ }
+
+ public void applyChanges(Vector params){
+
+ }
+
+ public DataObject executeAdhoc(Vector params){
+ return null;
+ }
+
+ // static way
+ public DataObject getAllCustomers(Vector paramsList){
+ return null;
+ }
+
+ public DataObject getRangeCustomers(Vector paramsList){
+ return null;
+ }
+
+ public void getInsertCustomerExecute(Vector paramsList){
+ return ;
+ }
+
+ public void getInsertCustomerApplyChanges(Vector paramsList){
+ return ;
+ }
+
+ public void getDeleteCustomerExecute(Vector paramsList){
+ return ;
+ }
+
+ public void getDeleteCustomerApplyChanges(Vector paramsList){
+ return ;
+ }
+
+ public void getUpdateCustomer(Vector paramsList){
+ return;
+ }
+
+ public DataObject getNamedCustomers(Vector paramsList){
+ return null;
+ }
+}
diff --git a/sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/StoredProcs.java b/sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/StoredProcs.java
new file mode 100644
index 0000000000..fd064f006e
--- /dev/null
+++ b/sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/StoredProcs.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.samples.das.orders;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+//Example stored procedure in Derby
+public class StoredProcs {
+ public static void getNamedCustomers(String theName, int[] outCount, ResultSet[] results) throws SQLException {
+
+ Connection conn = DriverManager.getConnection("jdbc:default:connection");
+ PreparedStatement ps = conn.prepareStatement("SELECT * FROM CUSTOMER WHERE LASTNAME = ?");
+ ps.setString(1, theName);
+ results[0] = ps.executeQuery();
+
+ ps = conn.prepareStatement("SELECT COUNT(*) FROM CUSTOMER WHERE LASTNAME = ?");
+ ps.setString(1, theName);
+
+ ResultSet rs = ps.executeQuery();
+ rs.next();
+ outCount[0] = rs.getInt(1);
+ }
+}
diff --git a/sandbox/lresende/backup/container.das.client/src/main/resources/CustomersOrders.componentType b/sandbox/lresende/backup/container.das.client/src/main/resources/CustomersOrders.componentType
new file mode 100644
index 0000000000..67307e7275
--- /dev/null
+++ b/sandbox/lresende/backup/container.das.client/src/main/resources/CustomersOrders.componentType
@@ -0,0 +1,26 @@
+<?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.
+-->
+
+<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <service name="CustomersOrdersService">
+ <interface.java interface="org.apache.tuscany.samples.das.orders.CustomersOrdersService"/>
+ </service>
+</componentType>
diff --git a/sandbox/lresende/backup/container.das.client/src/main/resources/CustomersOrders.xml b/sandbox/lresende/backup/container.das.client/src/main/resources/CustomersOrders.xml
new file mode 100644
index 0000000000..12f4bf8bac
--- /dev/null
+++ b/sandbox/lresende/backup/container.das.client/src/main/resources/CustomersOrders.xml
@@ -0,0 +1,82 @@
+<?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 xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <ConnectionInfo dataSource="derby:dastest" managedtx="true"/>
+
+ <Command name="AllCustomers" SQL="select * from CUSTOMER" kind="Select"/>
+
+ <Command name="RangeCustomers" SQL="select * from CUSTOMER where ID >= ?" kind="Select"/>
+
+ <Command name="customer and orders"
+ SQL="select * from CUSTOMER left join ANORDER on CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = ?"
+ kind="Select">
+ </Command>
+
+ <Command name="InsertCustomerExecute"
+ SQL="insert into CUSTOMER (ID, LASTNAME, ADDRESS) values (?, ?, ?)"
+ kind="Insert">
+ </Command>
+
+ <Command name="delete customer"
+ SQL="delete from CUSTOMER where ID = ?"
+ kind="Delete">
+ </Command>
+
+ <Command name="DeleteCustomerExecute"
+ SQL="delete from CUSTOMER where ID = ?"
+ kind="Delete">
+ </Command>
+
+ <Command name="orderby id" SQL="select * from ANORDER where ANORDER.ID = ?"
+ kind="Select">
+ </Command>
+
+ <Command name="UpdateCustomer"
+ SQL="update CUSTOMER set LASTNAME = ? where ID = ?"
+ kind="update">
+ </Command>
+
+ <Command name="update customer"
+ SQL="update CUSTOMER set LASTNAME = 'Pavick' where ID = ?"
+ kind="update">
+ </Command>
+
+ <Table tableName="CUSTOMER">
+ <Column columnName="ID" primaryKey="true"/>
+ </Table>
+
+ <Table tableName="ANORDER">
+ <Column columnName="ID" primaryKey="true"/>
+ </Table>
+
+ <Command name="getAllCompanies" SQL="{call GETALLCOMPANIES()}" kind="procedure">
+ </Command>
+
+ <Command name="NamedCustomers" SQL="{call GETNAMEDCUSTOMERS(?,?)}" kind="procedure">
+ <Parameter direction="IN" index="1" columnType="commonj.sdo.String"/>
+ <Parameter direction="OUT" index="2" columnType="commonj.sdo.IntObject"/>
+ </Command>
+
+ <Relationship name="orders" primaryKeyTable="CUSTOMER"
+ foreignKeyTable="ANORDER" many="true">
+ <KeyPair primaryKeyColumn="ID" foreignKeyColumn="CUSTOMER_ID"/>
+ </Relationship>
+
+</Config> \ No newline at end of file
diff --git a/sandbox/lresende/backup/container.das.client/src/main/resources/META-INF/LICENSE.txt b/sandbox/lresende/backup/container.das.client/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000000..75b52484ea
--- /dev/null
+++ b/sandbox/lresende/backup/container.das.client/src/main/resources/META-INF/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, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/sandbox/lresende/backup/container.das.client/src/main/resources/META-INF/NOTICE b/sandbox/lresende/backup/container.das.client/src/main/resources/META-INF/NOTICE
new file mode 100644
index 0000000000..59f0b4314f
--- /dev/null
+++ b/sandbox/lresende/backup/container.das.client/src/main/resources/META-INF/NOTICE
@@ -0,0 +1,32 @@
+Apache Tuscany DAS 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/sandbox/lresende/backup/container.das.client/src/main/resources/META-INF/README.txt b/sandbox/lresende/backup/container.das.client/src/main/resources/META-INF/README.txt
new file mode 100644
index 0000000000..d1905ee3e8
--- /dev/null
+++ b/sandbox/lresende/backup/container.das.client/src/main/resources/META-INF/README.txt
@@ -0,0 +1,35 @@
+Apache Tuscany M2 build (October, 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/sandbox/lresende/backup/container.das.client/src/main/resources/log4j.properties b/sandbox/lresende/backup/container.das.client/src/main/resources/log4j.properties
new file mode 100644
index 0000000000..c5c2868aaa
--- /dev/null
+++ b/sandbox/lresende/backup/container.das.client/src/main/resources/log4j.properties
@@ -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.
+#
+# Set root logger level to DEBUG and its only appender to A1.
+log4j.rootLogger=INFO, A1
+
+# A1 is set to be a ConsoleAppender.
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+
+# A1 uses PatternLayout.
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=[DAS RDB] - %c{1}.%M (%L) : %m %n
+
+# Print only messages of level WARN or above in the package com.foo.
+log4j.logger.org.apache.tuscany=NONE \ No newline at end of file
diff --git a/sandbox/lresende/backup/container.das.client/src/main/webapp/Company.jsp b/sandbox/lresende/backup/container.das.client/src/main/webapp/Company.jsp
new file mode 100644
index 0000000000..9fadd79766
--- /dev/null
+++ b/sandbox/lresende/backup/container.das.client/src/main/webapp/Company.jsp
@@ -0,0 +1,70 @@
+<!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.
+ -->
+
+<%@ page import="java.util.*" %>
+
+<%@ page import="org.osoa.sca.CompositeContext" %>
+<%@ page import="org.osoa.sca.CurrentCompositeContext" %>
+
+<%@ page import="commonj.sdo.*" %>
+
+<%@ page import="org.apache.tuscany.samples.das.orders.*" %>
+
+<html>
+<head>
+<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
+<%
+//
+ CompositeContext context = CurrentCompositeContext.getContext();
+ CustomersOrdersService service = context.locateService(CustomersOrdersService.class, "CustomersOrdersComponent");
+ List customers = null;
+ try{
+ DataObject root = service.getAllCustomers(null);
+ customers = root.getList("CUSTOMERS");
+ }catch(Exception e){
+ //TODO: handle case where dasService can't be initiated properly
+ }
+%>
+
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>DASService Client Test</title>
+</head>
+<body>
+
+<H2>Tuscany DAS Service WEB Client Application Example</H2>
+
+<!-- Do Fill -->
+<table border>
+ <thead>
+ <tr>
+ <th>ID</th>
+ <th>Name</th>
+ </tr>
+ </thead>
+ <tbody>
+
+ </tbody>
+</table>
+
+
+
+</form>
+</body>
+</html>
diff --git a/sandbox/lresende/backup/container.das.client/src/main/webapp/Customer.jsp b/sandbox/lresende/backup/container.das.client/src/main/webapp/Customer.jsp
new file mode 100644
index 0000000000..b963d51263
--- /dev/null
+++ b/sandbox/lresende/backup/container.das.client/src/main/webapp/Customer.jsp
@@ -0,0 +1,419 @@
+<!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.
+ -->
+
+<%@ page import="java.util.*" %>
+
+<%@ page import="org.osoa.sca.CompositeContext" %>
+<%@ page import="org.osoa.sca.CurrentCompositeContext" %>
+
+<%@ page import="commonj.sdo.*" %>
+
+<%@ page import="org.apache.tuscany.samples.das.orders.*" %>
+
+<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">
+<title>DAS - SCA Container Test</title>
+</head>
+<body>
+
+<H2>Tuscany DAS - SCA container Test </H2>
+<H3>(demo for static service API approach e.g. getAllCustomers())</H3>
+<form>
+<input type="submit" id="doSelectStatic" name="doSelectStatic" value="RangeCustomers (SELECT/WHERE as executeQuery())">
+<input type="submit" id="doInsertExecute" name="doInsertExecute" value="InsertCustomer (INSERT AS execute())">
+<input type="submit" id="doInsertApplyChanges" name="doInsertApplyChanges" value="InsertCustomer (INSERT AS applyChanges())">
+<input type="submit" id="doDeleteExecute" name="doDeleteExecute" value="DeleteCustomer (DELETE AS execute())">
+<input type="submit" id="doDeleteApplyChanges" name="doDeleteApplyChanges" value="DeleteCustomer (DELETE AS applyChanges())">
+<input type="submit" id="doUpdateApplyChanges" name="doUpdateApplyChanges" value="UpdateCustomer (UPDATE AS applyChanges())">
+<input type="submit" id="doSP" name="doSP" value="SPCustomer - get customer for name">
+
+<%
+CompositeContext context = CurrentCompositeContext.getContext();
+CustomersOrdersService service = context.locateService(CustomersOrdersService.class, "CustomersOrdersComponent");
+List customers = null;
+Map<Integer, Object> inParams = new Hashtable<Integer, Object>();
+Vector params = new Vector();
+%>
+
+<%! //common code to display latest results
+ public Iterator getResult(){
+ List custList = null;
+ java.util.Iterator i = null;
+ try{
+ Map<Integer, Object> inParams = new Hashtable<Integer, Object>();
+ Vector params = new Vector();
+ CompositeContext context = CurrentCompositeContext.getContext();
+ CustomersOrdersService service = context.locateService(CustomersOrdersService.class, "CustomersOrdersComponent");
+ params.clear();
+ params.add("");//of no use - as is derived using CommandMapper
+ params.add("select"); //is needed to understand whether execute/executeQuery/applyChanges
+ inParams.clear();
+ inParams.put(1, new Integer(1));
+ params.add(inParams);
+
+ DataObject root = service.getRangeCustomers(params);
+ custList = root.getList("CUSTOMER");
+ if(custList != null){
+ i = custList.iterator();
+ return i;
+ }
+ }catch(Exception e){
+ e.printStackTrace();
+ //TODO: handle case where dasService can't be initiated properly
+ }finally{
+ }
+
+ return i;
+ }
+%>
+<hr>
+
+<!--------------------------------------------------------------------------->
+<!--doSelectStatic -->
+<%if(request.getParameter("doSelectStatic") != null){%>
+
+<table border>
+ <thead>
+ <tr>
+ <th>ID</th>
+ <th>LastName</th>
+ </tr>
+ </thead>
+ <tbody>
+ <%
+ java.util.Iterator i = getResult();
+ while (i.hasNext()) {
+ DataObject customer = (DataObject)i.next();
+ %>
+ <tr>
+ <td><%=customer.getInt("ID")%></td>
+ <td><%=customer.getString("LASTNAME")%></td>
+ <tr>
+ <%
+ }//while
+ %>
+ </tbody>
+</table>
+
+<%}//doSelectStatic %>
+<!--------------------------------------------------------------------------->
+<!--doInsertExecute -->
+<%if(request.getParameter("doInsertExecute") != null){%>
+
+ <%try{
+ params.clear();
+ inParams.clear();
+
+ System.out.println("Calling InsertCustomerExecute");
+ params.clear();
+ inParams.clear();
+ params.add("");
+ params.add("insert");
+
+ inParams.put(1, new Integer(4));
+ inParams.put(2, new String("11"));
+ inParams.put(3, new String("111"));
+
+ params.add(inParams);
+
+ service.getInsertCustomerExecute(params);
+
+ }catch(Exception e){
+ e.printStackTrace();
+ }%>
+<table border>
+ <thead>
+ <tr>
+ <th>ID</th>
+ <th>LastName</th>
+ </tr>
+ </thead>
+ <tbody>
+ <%
+ java.util.Iterator i = getResult();
+ while (i.hasNext()) {
+ DataObject customer = (DataObject)i.next();
+ %>
+ <tr>
+ <td><%=customer.getInt("ID")%></td>
+ <td><%=customer.getString("LASTNAME")%></td>
+ <tr>
+ <%
+ }//while
+ %>
+ </tbody>
+</table>
+<%}//doInsertExecute %>
+<!--------------------------------------------------------------------------->
+<!--doInsertApplyChanges -->
+<%if(request.getParameter("doInsertApplyChanges") != null){%>
+
+ <%try{
+ Map<String, Object> insertParams = new Hashtable<String, Object>();
+ System.out.println("Calling InsertCustomerApplyChanges");
+ params.clear();
+ insertParams.clear();
+ params.add("");
+ params.add("insert:CUSTOMER");
+
+ insertParams.put("ID", new Integer("9"));
+ insertParams.put("LASTNAME", "222");
+ insertParams.put("ADDRESS", "2222");
+
+ params.add(insertParams);
+
+ service.getInsertCustomerApplyChanges(params);
+ }catch(Exception e){
+ e.printStackTrace();
+ }%>
+<table border>
+ <thead>
+ <tr>
+ <th>ID</th>
+ <th>LastName</th>
+ </tr>
+ </thead>
+ <tbody>
+ <%
+ java.util.Iterator i = getResult();
+ while (i.hasNext()) {
+ DataObject customer = (DataObject)i.next();
+ %>
+ <tr>
+ <td><%=customer.getInt("ID")%></td>
+ <td><%=customer.getString("LASTNAME")%></td>
+ <tr>
+ <%
+ }//while
+ %>
+ </tbody>
+</table>
+<%}//doInsertApplyChanges %>
+<!--------------------------------------------------------------------------->
+<!--doDeleteExecute -->
+<%if(request.getParameter("doDeleteExecute") != null){%>
+
+ <%
+ try{
+ System.out.println("Calling DeleteCustomerExecute");
+ params.clear();
+ inParams.clear();
+ params.add("");
+ params.add("delete");
+
+ inParams.put(1, new Integer(9));
+
+ params.add(inParams);
+
+ service.getDeleteCustomerExecute(params);
+
+ }catch(Exception e){
+ e.printStackTrace();
+ }%>
+
+<table border>
+ <thead>
+ <tr>
+ <th>ID</th>
+ <th>LastName</th>
+ </tr>
+ </thead>
+ <tbody>
+ <%
+ java.util.Iterator i = getResult();
+ while (i.hasNext()) {
+ DataObject customer = (DataObject)i.next();
+ %>
+ <tr>
+ <td><%=customer.getInt("ID")%></td>
+ <td><%=customer.getString("LASTNAME")%></td>
+ <tr>
+ <%
+ }//while
+ %>
+ </tbody>
+</table>
+<%}//doDeleteExecute %>
+<!--------------------------------------------------------------------------->
+<!--doDeleteApplyChanges -->
+<%if(request.getParameter("doDeleteApplyChanges") != null){%>
+ <%try{
+ Map<String, Object> whereParams = new Hashtable<String, Object>();
+ params.clear();
+
+ whereParams.clear();
+ whereParams.put("ID", new Integer(1));
+
+ params.add("");
+ params.add("delete:CUSTOMER");//command type:tableName
+ params.add(whereParams);
+ service.getDeleteCustomerApplyChanges(params);
+ }catch(Exception e){
+ e.printStackTrace();
+ }%>
+
+<table border>
+ <thead>
+ <tr>
+ <th>ID</th>
+ <th>LastName</th>
+ </tr>
+ </thead>
+ <tbody>
+ <%
+ java.util.Iterator i = getResult();
+ while (i.hasNext()) {
+ DataObject customer = (DataObject)i.next();
+ %>
+ <tr>
+ <td><%=customer.getInt("ID")%></td>
+ <td><%=customer.getString("LASTNAME")%></td>
+ <tr>
+ <%
+ }//while
+ %>
+ </tbody>
+</table>
+<%}//doDeleteApplyChanges %>
+<!--------------------------------------------------------------------------->
+<!--doUpdateApplyChanges -->
+<%if(request.getParameter("doUpdateApplyChanges") != null){%>
+<%try{
+ Map<String, Object> updParams = new Hashtable<String, Object>();//as its not position based but name based
+ Map<String, Object> whereParams = new Hashtable<String, Object>();
+
+ params.clear();
+
+ updParams.clear();
+ updParams.put("LASTNAME", "Berry");
+
+ whereParams.put("ID", new Integer(1));
+
+ params.add("");
+ params.add("update:CUSTOMER");//command type:tableName
+ params.add(updParams);
+ params.add(whereParams);
+ System.out.println("whereParams:"+whereParams.get("ID"));
+ service.getUpdateCustomer(params);
+
+ }catch(Exception e){
+ e.printStackTrace();
+ }%>
+
+<table border>
+ <thead>
+ <tr>
+ <th>ID</th>
+ <th>LastName</th>
+ </tr>
+ </thead>
+ <tbody>
+ <%
+ java.util.Iterator i = getResult();
+ while (i.hasNext()) {
+ DataObject customer = (DataObject)i.next();
+ %>
+ <tr>
+ <td><%=customer.getInt("ID")%></td>
+ <td><%=customer.getString("LASTNAME")%></td>
+ <tr>
+ <%
+ }//while
+ %>
+ </tbody>
+</table>
+<%}//doUpdateApplyChanges %>
+<!--------------------------------------------------------------------------->
+<!--doSP -->
+<%if(request.getParameter("doSP") != null){%>
+<%try{
+ Map<Integer, Object> outParams = new Hashtable<Integer, Object>();
+ System.out.println("Calling getNamedCustomers");
+
+ params.clear();
+ inParams.clear();
+ outParams.clear();
+
+ inParams.put(1, new String("Berry"));
+
+ outParams.put(2, new Object());
+
+ params.add("");
+ params.add("procedure");
+ params.add(inParams);
+ params.add(outParams);
+
+ Object returnObj = service.getNamedCustomers(params);
+
+ //check values in OUT params
+ Map<Integer, Object> resParams = (Map<Integer, Object> )params.get(3);
+ int cnt = 0;
+ if(resParams.size() != 0){
+ Set<Integer> resSet = (Set<Integer>)resParams.keySet();
+ Iterator res = resSet.iterator();
+ Object resObj = null;
+ while(res.hasNext()){
+ Integer rdx = (Integer)res.next();
+ resObj = (Object)resParams.get(rdx);
+ System.out.println("result :"+rdx +","+resObj);
+ cnt = ((Integer)resObj).intValue();
+ }
+ }
+
+ //check value in return result
+ if(cnt > 0){
+ if(returnObj instanceof DataObject){
+ DataObject doResult = (DataObject)returnObj;
+ customers = doResult.getList("CUSTOMER");
+ java.util.Iterator i = customers.iterator();
+ System.out.println("customers:"+customers.size());
+%>
+
+<table border>
+ <thead>
+ <tr>
+ <th>ID</th>
+ <th>LastName</th>
+ </tr>
+ </thead>
+ <tbody>
+
+<% while (i.hasNext()) {
+ DataObject customer = (DataObject)i.next();
+%>
+ <tr>
+ <td><%=customer.getInt("ID")%></td>
+ <td><%=customer.getString("LASTNAME")%></td>
+ <tr>
+ <%}//while
+ }//if DataObj
+ }//if cnt
+
+}catch(Exception e){
+ e.printStackTrace();
+}%>
+
+<%}//doSP %>
+<!--------------------------------------------------------------------------->
+</form>
+</body>
+</html>
diff --git a/sandbox/lresende/backup/container.das.client/src/main/webapp/META-INF/context.xml b/sandbox/lresende/backup/container.das.client/src/main/webapp/META-INF/context.xml
new file mode 100644
index 0000000000..0e90eb0a83
--- /dev/null
+++ b/sandbox/lresende/backup/container.das.client/src/main/webapp/META-INF/context.xml
@@ -0,0 +1,25 @@
+<?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.
+ -->
+<Context path="/DAS Stand alone app" debug="5" reloadable="true" crossContext="true">
+
+ <Manager pathname=""/>
+ <ResourceLink name="jdbc/dastest" global="jdbc/dastest" type="javax.sql.DataSource" />
+
+</Context>
diff --git a/sandbox/lresende/backup/container.das.client/src/main/webapp/WEB-INF/default.scdl b/sandbox/lresende/backup/container.das.client/src/main/webapp/WEB-INF/default.scdl
new file mode 100644
index 0000000000..db438a88c0
--- /dev/null
+++ b/sandbox/lresende/backup/container.das.client/src/main/webapp/WEB-INF/default.scdl
@@ -0,0 +1,30 @@
+<?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="CustomersOrdersComposite">
+
+ <component name="CustomersOrdersComponent">
+ <implementation.das config="CustomersOrders.xml" dataAccessType="rdb"/>
+ </component>
+
+ <component name="CustomersOrdersJavaReference">
+ <implementation.java class="org.apache.tuscany.samples.das.orders.CustomersOrdersServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/sandbox/lresende/backup/container.das.client/src/main/webapp/WEB-INF/web.xml b/sandbox/lresende/backup/container.das.client/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000000..b464b082d7
--- /dev/null
+++ b/sandbox/lresende/backup/container.das.client/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,44 @@
+<?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.
+ -->
+<!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>
+ <display-name>Tuscany DAS Container Sample Client Application</display-name>
+
+ <welcome-file-list id="WelcomeFileList">
+ <welcome-file>Customer.jsp</welcome-file>
+ </welcome-file-list>
+
+ <!-- SCA Related configuration -->
+ <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>
+ <!-- END of SCA Related configuration -->
+</web-app>
diff --git a/sandbox/lresende/backup/container.das/.ruleset b/sandbox/lresende/backup/container.das/.ruleset
new file mode 100644
index 0000000000..ac8671859d
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/.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/sandbox/lresende/backup/container.das/LICENSE.txt b/sandbox/lresende/backup/container.das/LICENSE.txt
new file mode 100644
index 0000000000..5f6ab3e05c
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/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/sandbox/lresende/backup/container.das/NOTICE.txt b/sandbox/lresende/backup/container.das/NOTICE.txt
new file mode 100644
index 0000000000..ecc68a9614
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/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/sandbox/lresende/backup/container.das/README.txt b/sandbox/lresende/backup/container.das/README.txt
new file mode 100644
index 0000000000..723f3fd3ab
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/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/sandbox/lresende/backup/container.das/pom.xml b/sandbox/lresende/backup/container.das/pom.xml
new file mode 100644
index 0000000000..ff927a7bb6
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/pom.xml
@@ -0,0 +1,89 @@
+<?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.sca.services.containers</groupId>
+ <artifactId>parent</artifactId>
+ <version>1.0-incubator-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>das</artifactId>
+ <name>Apache Tuscany DAS Container</name>
+ <description>Container for Data Access Services</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-spi</artifactId>
+ <version>${sca.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>core</artifactId>
+ <version>${sca.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.runtime.webapp</groupId>
+ <artifactId>webapp-api</artifactId>
+ <version>${sca.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.4</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>test</artifactId>
+ <version>${sca.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.das</groupId>
+ <artifactId>tuscany-das-rdb</artifactId>
+ <version>${pom.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymockclassextension</artifactId>
+ </dependency>
+
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessComponent.java b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessComponent.java
new file mode 100644
index 0000000000..abd1a587d0
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessComponent.java
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.container.dataaccess;
+
+import static org.apache.tuscany.spi.idl.java.JavaIDLUtils.findMethod;
+
+import java.lang.reflect.Method;
+import java.util.List;
+
+import org.apache.tuscany.container.dataaccessscript.DataAccessInstanceImpl;
+import org.apache.tuscany.spi.ObjectCreationException;
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.component.ScopeContainer;
+import org.apache.tuscany.spi.component.TargetResolutionException;
+import org.apache.tuscany.spi.component.WorkContext;
+import org.apache.tuscany.spi.extension.AtomicComponentExtension;
+import org.apache.tuscany.spi.model.Operation;
+import org.apache.tuscany.spi.services.work.WorkScheduler;
+import org.apache.tuscany.spi.wire.InboundWire;
+import org.apache.tuscany.spi.wire.TargetInvoker;
+import org.apache.tuscany.spi.wire.WireService;
+
+/**
+ * The DAS component implementation.
+ */
+public class DataAccessComponent extends AtomicComponentExtension {
+
+ private final List<Class<?>> services;
+ //private final Map<String, Object> properties;
+
+ private DataAccessInstanceFactory factory;
+
+
+ public DataAccessComponent(String name,
+ DataAccessInstanceFactory factory,
+ /*Map<String, Object> propValues,*/
+ List<Class<?>> services,
+ CompositeComponent parent,
+ ScopeContainer scopeContainer,
+ WireService wireService,
+ WorkScheduler workScheduler,
+ WorkContext workContext) {
+ super(name, parent, /*scopeContainer,*/ wireService, workContext, workScheduler, null, 0);
+ this.factory = factory;
+ this.services = services;
+ this.scope = scopeContainer.getScope();
+ //this.properties = propValues;
+ }
+
+ public DataAccessComponent(DataAccessComponentConfiguration config) {
+ super(config.getName(),
+ config.getParent(),
+ /*config.getScopeContainer(),*/
+ config.getWireService(),
+ config.getWorkContext(),
+ config.getWorkScheduler(),
+ config.getMonitor(),
+ config.getInitLevel());
+ this.factory = config.getFactory();
+ this.services = config.getServices();
+ this.scope = config.getScopeContainer().getScope();
+ //this.properties = config.getPropertyValues();
+ }
+
+
+
+ public Object createInstance() throws ObjectCreationException {
+// Map<String, Object> context = new HashMap<String, Object>(getProperties());
+// Object instance = dataAccessAdapter.createScriptInstance(context, dataAccessAdapter.getDataAccessType());
+//
+// return instance;
+
+ return factory.getInstance();
+ }
+
+
+ public TargetInvoker createTargetInvoker(String targetName, Operation operation, InboundWire callbackWire) {
+ //System.out.println("operation:"+operation.getName()+operation.getMetaData());
+ //return new DataAccessInvoker(operation.getName(), this, operation.getOutputType().getPhysical().getClass());
+
+ Method[] methods = operation.getServiceContract().getInterfaceClass().getMethods();
+ Method method = findMethod(operation, methods);
+ return new DataAccessInvoker(method.getName(), this, operation.getOutputType().getPhysical().getClass());
+ }
+ // TODO: move all the following up to AtomicComponentExtension?
+ public List<Class<?>> getServiceInterfaces() {
+ return services;
+ }
+
+// public Map<String, Object> getProperties() {
+// return properties;
+// }
+
+ public Object getServiceInstance() throws TargetResolutionException {
+ return getServiceInstance(null);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getServiceInstance(String service) throws TargetResolutionException {
+ InboundWire wire = getInboundWire(service);
+ if (wire == null) {
+ throw new TargetResolutionException("Service '" + service + "'not found"); // TODO better error message
+ }
+ Class<?> clazz = wire.getServiceContract().getInterfaceClass();
+ return wireService.createProxy(clazz, wire);
+ }
+
+ public DataAccessInstanceImpl getTargetInstance() throws TargetResolutionException {
+ return (DataAccessInstanceImpl) scopeContainer.getInstance(this);
+ }
+
+}
diff --git a/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessComponentBuilder.java b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessComponentBuilder.java
new file mode 100644
index 0000000000..339ca2e233
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessComponentBuilder.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.container.dataaccess;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.spi.builder.BuilderConfigException;
+import org.apache.tuscany.spi.component.Component;
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.component.ScopeContainer;
+import org.apache.tuscany.spi.deployer.DeploymentContext;
+import org.apache.tuscany.spi.extension.ComponentBuilderExtension;
+import org.apache.tuscany.spi.model.ComponentDefinition;
+import org.apache.tuscany.spi.model.PropertyValue;
+import org.apache.tuscany.spi.model.Scope;
+import org.apache.tuscany.spi.model.ServiceDefinition;
+
+/**
+ * Extension point for creating {@link DataAccessComponent}s from an assembly configuration
+ */
+public class DataAccessComponentBuilder extends ComponentBuilderExtension<DataAccessImplementation> {
+
+ protected Class<DataAccessImplementation> getImplementationType() {
+ return DataAccessImplementation.class;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Component build(CompositeComponent parent,
+ ComponentDefinition<DataAccessImplementation> componentDefinition,
+ DeploymentContext deploymentContext) throws BuilderConfigException {
+
+ String name = componentDefinition.getName();
+ DataAccessImplementation implementation = componentDefinition.getImplementation();
+ DataAccessComponentType componentType = implementation.getComponentType();
+
+ // get list of services provided by this component
+ Collection<ServiceDefinition> collection = componentType.getServices().values();
+ List<Class<?>> services = new ArrayList<Class<?>>(collection.size());
+ for (ServiceDefinition serviceDefinition : collection) {
+ services.add(serviceDefinition.getServiceContract().getInterfaceClass());
+ }
+
+
+ //TODO: have ComponentBuilderExtension pass ScopeContainer in on build method?
+ ScopeContainer scopeContainer;
+ Scope scope = componentType.getLifecycleScope();
+ if (Scope.COMPOSITE == scope) {
+ scopeContainer = deploymentContext.getCompositeScope();
+ } else {
+ scopeContainer = scopeRegistry.getScopeContainer(scope);
+ }
+
+
+ //removed per jim's comments
+ //Map<String, Object> propertyValues = new Hashtable<String, Object>();
+ //Collection<PropertyValue<?>> propValueSettings = componentDefinition.getPropertyValues().values();
+ //for (PropertyValue propertyValue : propValueSettings) {
+ // propertyValues.put(propertyValue.getName(), propertyValue.getValueFactory().getInstance());
+ //}
+
+ String dasConfig = implementation.getDasConfig();
+ InputStream dasConfigStream = implementation.getDasConfigStream();
+ String dataAccessType = implementation.getDataAccessType();
+ ClassLoader cl = implementation.getClassLoader();
+
+ DataAccessInstanceFactory instanceFactory = new DataAccessInstanceFactory(dasConfig, dasConfigStream, dataAccessType, cl);
+
+
+ //get the properties for the component
+ for (PropertyValue propertyValue : componentDefinition.getPropertyValues().values()) {
+ //TODO this is not safe for since multiple instances can share mutable properties
+ instanceFactory.addContextObjectFactory(propertyValue.getName(), propertyValue.getValueFactory ());
+ }
+
+
+
+ DataAccessComponentConfiguration config = new DataAccessComponentConfiguration();
+ config.setName(name);
+ config.setFactory(instanceFactory);
+ config.setServices(services);
+ config.setParent(parent);
+ config.setScopeContainer(scopeContainer);
+ config.setWireService(wireService);
+ config.setWorkContext(workContext);
+ config.setWorkScheduler(workScheduler);
+
+ return new DataAccessComponent(config);
+ }
+}
diff --git a/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessComponentConfiguration.java b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessComponentConfiguration.java
new file mode 100644
index 0000000000..01ef7391f7
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessComponentConfiguration.java
@@ -0,0 +1,137 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.container.dataaccess;
+
+import java.util.List;
+
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.component.ScopeContainer;
+import org.apache.tuscany.spi.component.WorkContext;
+import org.apache.tuscany.spi.extension.ExecutionMonitor;
+import org.apache.tuscany.spi.services.work.WorkScheduler;
+import org.apache.tuscany.spi.wire.WireService;
+
+/**
+ * Configuration holder for creating script components
+ *
+ * @version $Rev: 471211 $ $Date: 2006-11-04 07:06:05 -0800 (Sat, 04 Nov 2006) $
+ */
+public class DataAccessComponentConfiguration {
+
+ private String name;
+ private DataAccessInstanceFactory factory;
+ private List<Class<?>> services;
+ //private Map<String, Object> propertyValues;
+ private CompositeComponent parent;
+ private ScopeContainer scopeContainer;
+ private WireService wireService;
+ private WorkContext workContext;
+ private WorkScheduler workScheduler;
+ private ExecutionMonitor monitor;
+ private int initLevel;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public DataAccessInstanceFactory getFactory() {
+ return factory;
+ }
+
+ public void setFactory(DataAccessInstanceFactory factory) {
+ this.factory = factory;
+ }
+
+ public List<Class<?>> getServices() {
+ return services;
+ }
+
+ public void setServices(List<Class<?>> services) {
+ this.services = services;
+ }
+
+// public Map<String, Object> getPropertyValues() {
+// return propertyValues;
+// }
+//
+// public void setPropertyValues(Map<String, Object> propValues) {
+// this.propertyValues = propValues;
+// }
+
+ public CompositeComponent getParent() {
+ return parent;
+ }
+
+ public void setParent(CompositeComponent parent) {
+ this.parent = parent;
+ }
+
+ public ScopeContainer getScopeContainer() {
+ return scopeContainer;
+ }
+
+ public void setScopeContainer(ScopeContainer scopeContainer) {
+ this.scopeContainer = scopeContainer;
+ }
+
+ public WireService getWireService() {
+ return wireService;
+ }
+
+ public void setWireService(WireService wireService) {
+ this.wireService = wireService;
+ }
+
+ public WorkContext getWorkContext() {
+ return workContext;
+ }
+
+ public void setWorkContext(WorkContext workContext) {
+ this.workContext = workContext;
+ }
+
+ public WorkScheduler getWorkScheduler() {
+ return workScheduler;
+ }
+
+ public void setWorkScheduler(WorkScheduler workScheduler) {
+ this.workScheduler = workScheduler;
+ }
+
+ public ExecutionMonitor getMonitor() {
+ return monitor;
+ }
+
+ public void setMonitor(ExecutionMonitor monitor) {
+ this.monitor = monitor;
+ }
+
+ public int getInitLevel() {
+ return initLevel;
+ }
+
+ public void setInitLevel(int initLevel) {
+ this.initLevel = initLevel;
+ }
+
+}
diff --git a/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessComponentType.java b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessComponentType.java
new file mode 100644
index 0000000000..7b2573fb68
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessComponentType.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 org.apache.tuscany.container.dataaccess;
+
+import org.apache.tuscany.spi.model.ComponentType;
+import org.apache.tuscany.spi.model.Property;
+import org.apache.tuscany.spi.model.ReferenceDefinition;
+import org.apache.tuscany.spi.model.Scope;
+import org.apache.tuscany.spi.model.ServiceDefinition;
+
+public class DataAccessComponentType extends ComponentType<ServiceDefinition, ReferenceDefinition, Property<?>> {
+
+ private Scope lifecycleScope = Scope.COMPOSITE;
+
+ public DataAccessComponentType() {
+ }
+
+ @SuppressWarnings("unchecked")
+ public DataAccessComponentType(ComponentType ct) {
+ if(ct != null){
+ setInitLevel(ct.getInitLevel());
+ for (Object property : ct.getProperties().values()) {
+ add((Property) property);
+ }
+ for (Object reference : ct.getReferences().values()) {
+ add((ReferenceDefinition) reference);
+ }
+ for (Object service : ct.getServices().values()) {
+ add((ServiceDefinition) service);
+ }
+ }
+ }
+
+ public Scope getLifecycleScope() {
+ return lifecycleScope;
+ }
+
+ public void setLifecycleScope(Scope lifecycleScope) {
+ this.lifecycleScope = lifecycleScope;
+ }
+
+}
diff --git a/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessComponentTypeLoader.java b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessComponentTypeLoader.java
new file mode 100644
index 0000000000..f8521eb901
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessComponentTypeLoader.java
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.container.dataaccess;
+
+import java.net.URL;
+
+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.ComponentTypeLoaderExtension;
+import org.apache.tuscany.spi.idl.java.JavaInterfaceProcessorRegistry;
+import org.apache.tuscany.spi.loader.LoaderException;
+import org.apache.tuscany.spi.model.ComponentType;
+
+/**
+ * @version $Rev: 442514 $ $Date: 2006-09-12 13:44:43 +0530 (Tue, 12 Sep 2006) $
+ */
+public class DataAccessComponentTypeLoader extends ComponentTypeLoaderExtension<DataAccessImplementation> {
+
+ //private JavaInterfaceProcessorRegistry processorRegistry;
+
+ public DataAccessComponentTypeLoader(@Autowire JavaInterfaceProcessorRegistry processorRegistry) {
+ //this.processorRegistry = processorRegistry;
+ }
+
+ @Override
+ protected Class<DataAccessImplementation> getImplementationClass() {
+ return DataAccessImplementation.class;
+ }
+/*
+// protected String getResourceName(DataAccessImplementation implementation) {
+// return implementation.getDataAccessAdapter().getScriptName();
+// }
+
+ // TODO: must be possible to move all the following up in to ComponentTypeLoaderExtension
+
+ public void load(CompositeComponent parent,
+ DataAccessImplementation implementation,
+ DeploymentContext deploymentContext) throws LoaderException {
+
+
+ DataAccessComponentType componentType;
+ componentType = loadFromSidefile(null, deploymentContext);
+
+ implementation.setComponentType(componentType);
+ }
+
+ protected DataAccessComponentType loadFromSidefile(URL url, DeploymentContext deploymentContext) throws LoaderException {
+ ComponentType ct = loaderRegistry.load(null, null,
+ url,
+ ComponentType.class,
+ deploymentContext);
+ DataAccessComponentType dasCt = new DataAccessComponentType(ct);
+ return dasCt;
+ }
+
+// private String getSideFileName(DataAccessImplementation implementation) {
+// String baseName = getResourceName(implementation);
+// int lastDot = baseName.lastIndexOf('.');
+// if (lastDot != -1) {
+// baseName = baseName.substring(0,lastDot);
+// }
+// return baseName + ".componentType";
+// }
+*/
+
+ protected String getResourceName(DataAccessImplementation implementation) {
+ //System.out.println("config file name:"+implementation.getDasConfig());
+ return implementation.getDasConfig();
+ }
+
+ // TODO: must be possible to move all the following up in to ComponentTypeLoaderExtension
+
+ public void load(CompositeComponent parent,
+ DataAccessImplementation implementation,
+ DeploymentContext deploymentContext) throws LoaderException {
+
+ String sideFile = getSideFileName(implementation);
+ URL resource = implementation.getClassLoader().getResource(sideFile);
+ DataAccessComponentType componentType;
+
+ if (resource == null) {
+ throw new MissingSideFileException("Component type side file not found : '" + sideFile + "'");
+ // TODO: or else implement introspection
+ } else {
+ componentType = loadFromSidefile(resource, deploymentContext);
+ }
+
+ implementation.setComponentType(componentType);
+ }
+
+ protected DataAccessComponentType loadFromSidefile(URL url, DeploymentContext deploymentContext) throws LoaderException {
+ //Amita
+ DataAccessComponentType compType = new DataAccessComponentType();
+ ComponentType ct = loaderRegistry.load(null,
+ compType,
+ url,
+ ComponentType.class,
+ deploymentContext);
+ return new DataAccessComponentType(ct);
+ }
+
+ private String getSideFileName(DataAccessImplementation implementation) {
+ String baseName = getResourceName(implementation);
+ int lastDot = baseName.lastIndexOf('.');
+ if (lastDot != -1) {
+ baseName = baseName.substring(0,
+ lastDot);
+ }
+ return baseName + ".componentType";
+ }
+
+
+}
diff --git a/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessImplementation.java b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessImplementation.java
new file mode 100644
index 0000000000..6ed98b88be
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessImplementation.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.container.dataaccess;
+
+import java.io.InputStream;
+
+import org.apache.tuscany.spi.model.AtomicImplementation;
+
+/**
+ * Model object for a DataAccess implementation.
+ */
+public class DataAccessImplementation extends AtomicImplementation<DataAccessComponentType> {
+ private String dasConfig;
+ private InputStream dasConfigStream;
+ private String dataAccessType;
+ private ClassLoader classLoader;
+
+ /**
+ * @return the dasConfig
+ */
+ public String getDasConfig() {
+ return dasConfig;
+ }
+ /**
+ * @param dasConfig the dasConfig to set
+ */
+ public void setDasConfig(String dasConfig) {
+ this.dasConfig = dasConfig;
+ }
+
+ /**
+ * @return the dasConfigStream
+ */
+ public InputStream getDasConfigStream() {
+ return dasConfigStream;
+ }
+ /**
+ * @param dasConfigStream the dasConfigStream to set
+ */
+ public void setDasConfigStream(InputStream dasConfigStream) {
+ this.dasConfigStream = dasConfigStream;
+ }
+ /**
+ * @return the dataAccessType
+ */
+ public String getDataAccessType() {
+ return dataAccessType;
+ }
+ /**
+ * @param dataAccessType the dataAccessType to set
+ */
+ public void setDataAccessType(String dataAccessType) {
+ this.dataAccessType = dataAccessType;
+ }
+
+ public ClassLoader getClassLoader() {
+ return classLoader;
+ }
+
+ public void setClassLoader(ClassLoader classLoader) {
+ this.classLoader = classLoader;
+ }
+} \ No newline at end of file
diff --git a/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessImplementationLoader.java b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessImplementationLoader.java
new file mode 100644
index 0000000000..01fb6ba89e
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessImplementationLoader.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.container.dataaccess;
+
+import java.io.InputStream;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+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.loader.LoaderUtil;
+import org.apache.tuscany.spi.loader.MissingResourceException;
+import org.apache.tuscany.spi.model.ModelObject;
+import org.osoa.sca.annotations.Constructor;
+
+/**
+ * Loader for handling JavaScript <da:implementation.da> elements.
+ *
+ * Example would be as below
+ * <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:das="http://tuscany.apache.org/xmlns/das/1.0" name="CustomersOrdersComposite">
+ * <component name="CustomersOrdersComponent">
+ * <das:implementation.das config="customersOrders/CustomersOrders.xml" dataAccessType="rdb"/>
+ * </component>
+ * </composite>
+ */
+public class DataAccessImplementationLoader extends LoaderExtension<DataAccessImplementation> {
+ private static String XML_DATAACCESS_NAMESPACE = "http://tuscany.apache.org/xmlns/das/1.0";
+ private static final QName IMPLEMENTATION_DATAACCESS = new QName(XML_DATAACCESS_NAMESPACE, "implementation.das");
+
+ @Constructor({"registry"})
+ public DataAccessImplementationLoader(@Autowire LoaderRegistry registry) {
+ super(registry);
+ }
+
+ public QName getXMLType() {
+ return IMPLEMENTATION_DATAACCESS;
+ }
+
+ public DataAccessImplementation load(CompositeComponent parent,
+ ModelObject mo,
+ XMLStreamReader reader,
+ DeploymentContext deploymentContext) throws XMLStreamException, LoaderException {
+
+ String dasConfig = reader.getAttributeValue(null, "config");
+ String dataAccessType = reader.getAttributeValue(null, "dataAccessType");
+
+ if ( dasConfig == null ) {
+ throw new MissingResourceException("No config provided supplied");
+ }
+
+ ClassLoader cl = deploymentContext.getClassLoader();
+ InputStream dasConfigStream = loadConfig(cl, dasConfig);
+
+ LoaderUtil.skipToEndElement(reader);
+
+ DataAccessImplementation implementation = new DataAccessImplementation();
+ implementation.setDasConfig(dasConfig);
+ implementation.setDasConfigStream(dasConfigStream);
+ implementation.setDataAccessType(dataAccessType);
+ implementation.setClassLoader(cl);
+
+ registry.loadComponentType(parent, implementation, deploymentContext);
+ return implementation;
+ }
+
+ protected InputStream loadConfig(ClassLoader classLoader, String configResource) throws LoaderException {
+ return classLoader.getResourceAsStream(configResource);
+
+ }
+}
diff --git a/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessInstance.java b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessInstance.java
new file mode 100644
index 0000000000..6ea3bd6613
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessInstance.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.container.dataaccess;
+
+
+/**
+ * An invokable instance of a script
+ *
+ * Basically just a wrapper around a BSF engine with an optional script class object.
+ */
+public interface DataAccessInstance {
+
+ public Object invokeFunction(String functionName, Object[] args, Class returnType);
+}
diff --git a/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessInstanceFactory.java b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessInstanceFactory.java
new file mode 100644
index 0000000000..96b1deab00
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessInstanceFactory.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.container.dataaccess;
+
+import java.io.InputStream;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tuscany.container.dataaccessscript.DataAccessEngine;
+import org.apache.tuscany.container.dataaccessscript.DataAccessInstanceImpl;
+import org.apache.tuscany.das.rdb.DAS;
+import org.apache.tuscany.spi.ObjectCreationException;
+import org.apache.tuscany.spi.ObjectFactory;
+
+/**
+ * A data access script
+ */
+public class DataAccessInstanceFactory implements ObjectFactory<DataAccessInstance> {
+ protected String dasConfig;
+ protected InputStream dasConfigStream;
+ protected String dataAccessType;
+ protected ClassLoader classLoader;
+ protected Map<String, ObjectFactory> contextObjects;
+
+ private DataAccessEngine dataAccessEngine = new DataAccessEngine();
+
+ /**
+ * Create a new DataAccess object.
+ *
+ * @param dasConfig
+ * the name of the Data Access configuration file to be used
+ * @param dataAccessType
+ * what type of data access mechanism is being used (e.g rdb)
+ */
+ public DataAccessInstanceFactory(String dasConfiguration, InputStream dasConfigStream, String dataAccessType, ClassLoader classLoader) {
+ this.dasConfig = dasConfiguration;
+ this.dasConfigStream = dasConfigStream;
+ this.dataAccessType = dataAccessType;
+ this.classLoader = classLoader;
+ }
+
+ /**
+ * Create a new invokeable instance of the script <p/> objects to add to scope of the script instance
+ *
+ * @return a DataAccessInstance
+ */
+ public DataAccessInstance getInstance() throws ObjectCreationException {
+ if (dataAccessType == null) {
+ return null;
+ } else {
+ //the commented one gives STREAM CLOSED exception from xerces - in JUnit???
+ DAS das = dataAccessEngine.getDAS(dataAccessType, dasConfig);// factory, currently only for rdb
+ //DAS das = dataAccessEngine.getDAS(dataAccessType, dasConfigStream);// factory, currently only for rdb
+
+ return new DataAccessInstanceImpl(das, this.dataAccessType);
+ }
+ }
+
+ protected Map<String, Class> getResponseClasses(List<Class> services) {
+ Map<String, Class> responseClasses = new HashMap<String, Class>();
+ if (services != null) {
+ for (Class s : services) {
+ for (Method m : s.getMethods()) {
+ responseClasses.put(m.getName(), m.getReturnType());
+ }
+ }
+ }
+ return responseClasses;
+ }
+
+ public void addContextObjectFactory(String name, ObjectFactory<?> factory) {
+ contextObjects.put(name, factory);
+ }
+}
diff --git a/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessInvoker.java b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessInvoker.java
new file mode 100644
index 0000000000..f9d7aaf225
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/DataAccessInvoker.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.container.dataaccess;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.apache.tuscany.container.dataaccessscript.DataAccessInstanceImpl;
+import org.apache.tuscany.spi.component.TargetException;
+import org.apache.tuscany.spi.extension.TargetInvokerExtension;
+
+/**
+ * Dispatches to a DataAccessScript implementation instance
+ *
+ * @version $$Rev: 441072 $$ $$Date: 2006-09-07 18:03:39 +0530 (Thu, 07 Sep 2006) $$
+ */
+public class DataAccessInvoker extends TargetInvokerExtension {
+
+ private DataAccessComponent component;
+ private String functionName;
+ private Class returnType;
+
+
+ public DataAccessInvoker(String functionName, DataAccessComponent component, Class returnType) {
+ super(null,null,null);
+ this.functionName = functionName;
+ this.component = component;
+ this.returnType = returnType;
+ }
+
+
+ public Object invokeTarget(final Object payload, final short sequence) throws InvocationTargetException {
+ DataAccessInstanceImpl target;
+
+ //get the component
+ try{
+ target = (DataAccessInstanceImpl) component.getTargetInstance();
+ }catch(TargetException e){
+ throw new InvocationTargetException(e);
+ }
+
+ //invoke it
+ try {
+ return target.invokeFunction(functionName,
+ (Object[]) payload,
+ returnType);
+ } catch (Exception e) {
+ throw new InvocationTargetException(e);
+ }
+ }
+
+}
diff --git a/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/MissingSideFileException.java b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/MissingSideFileException.java
new file mode 100644
index 0000000000..f19cb91406
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccess/MissingSideFileException.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 org.apache.tuscany.container.dataaccess;
+
+import org.apache.tuscany.spi.loader.LoaderException;
+
+/**
+ * @version $Rev: 471211 $ $Date: 2006-11-04 07:06:05 -0800 (Sat, 04 Nov 2006) $
+ */
+public class MissingSideFileException extends LoaderException {
+
+ private static final long serialVersionUID = -2616590185174691724L;
+
+ public MissingSideFileException() {
+ }
+
+ public MissingSideFileException(String message) {
+ super(message);
+ }
+
+ public MissingSideFileException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public MissingSideFileException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccessscript/CommandMapper.java b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccessscript/CommandMapper.java
new file mode 100644
index 0000000000..9e8565b507
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccessscript/CommandMapper.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 org.apache.tuscany.container.dataaccessscript;
+
+/**
+ * This class maps service APIs with the DAS config commands
+ * the logic can be more of some code generation tool type
+ * At present a simple mapping is introduced
+ */
+public class CommandMapper {
+
+ public static String getCommandName(String serviceAPIName) throws Exception{
+ int idx = serviceAPIName.indexOf("get");
+ if(idx != -1){
+ return serviceAPIName.substring(idx+3);
+ }
+ else{
+ //TODO better way to handle
+ throw new Exception("invalid service API name");
+ }
+ }
+
+ public static String getServiceAPIName(String commandName){
+ //TODO to be implemented
+ return null;
+ }
+}
+
diff --git a/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccessscript/DataAccessEngine.java b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccessscript/DataAccessEngine.java
new file mode 100644
index 0000000000..1302315eeb
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccessscript/DataAccessEngine.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.container.dataaccessscript;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+import org.apache.tuscany.das.rdb.DAS;
+
+public class DataAccessEngine {
+ public final static String SEPARATOR = ":";
+ //For RDB
+ public final static String RDB = "rdb";
+ public final static String SELECT = "select";
+ public final static String DELETE = "delete";
+ public final static String UPDATE = "update";
+ public final static String INSERT = "insert";
+ public final static String PROCEDURE = "procedure";
+
+ //For XQUERY
+ public final static String XQUERY = "xquery";
+ //...
+ //TODO...this is the place to accomodate different data access mechanisms
+
+ public final static String DERBY = "derby";
+ public final static String MySQL = "mysql";
+ //...
+ //TODO ...this is the place to accomodate different databases
+
+ public DAS getDAS(String dataAccessType, String dasConfig){
+ if(dataAccessType.equals(RDB)){
+ return DAS.FACTORY.createDAS(new ByteArrayInputStream(dasConfig.getBytes()));//i18n? //do you need cl information here
+ }
+ else{
+ //TODO ..for different mechs - need to implement
+ return null;
+ }
+ }
+
+ public DAS getDAS(String dataAccessType, InputStream dasConfigStream){
+ if(dataAccessType.equals(RDB)){
+ return DAS.FACTORY.createDAS(dasConfigStream);//i18n?
+ }
+ else{
+ //TODO ..for different mechs - need to implement
+ return null;
+ }
+ }
+}
diff --git a/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccessscript/DataAccessInstanceImpl.java b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccessscript/DataAccessInstanceImpl.java
new file mode 100644
index 0000000000..22300b4e56
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccessscript/DataAccessInstanceImpl.java
@@ -0,0 +1,328 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.container.dataaccessscript;
+
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Vector;
+
+import org.apache.tuscany.container.dataaccess.DataAccessInstance;
+import org.apache.tuscany.das.rdb.Command;
+import org.apache.tuscany.das.rdb.DAS;
+
+import commonj.sdo.DataObject;
+/**
+ * An invokeable instance of a DataAccess config script.
+ */
+public class DataAccessInstanceImpl implements DataAccessInstance {
+
+ private DAS dasInstance;
+ private String dataAccessType;
+ private String tableName = null;
+ private String genericSelectForRoot = "select * from "+ tableName;
+
+ public DataAccessInstanceImpl(DAS das, String dataAccessType){
+ this.dasInstance = das;
+ this.dataAccessType = dataAccessType;
+ }
+
+ public Object invokeFunction(String functionName, Object[] args, Class returnType) {
+ Command cmd = null;
+ //System.out.println("functionName:"+functionName);
+
+ Vector paramsList = null;
+ if(args != null){
+ try{
+ paramsList = (Vector)args[0];
+ }catch(ClassCastException e){
+ //TODO
+ e.printStackTrace();
+ }
+ }
+
+ //if any of the 3 below - its dynamic way , else , its static way
+ if(! "execute".equals(functionName) &&
+ ! "executeQuery".equals(functionName) &&
+ ! "applyChanges".equals(functionName)){
+ //try for static way
+ try{
+ String commandName = CommandMapper.getCommandName(functionName);
+ //System.out.println("commandName:"+commandName);
+ if(paramsList != null && paramsList.size()>1 &&
+ paramsList.get(1).toString().indexOf(DataAccessEngine.SEPARATOR) == -1){
+ cmd = dasInstance.getCommand(commandName);//got in static way
+ }
+ }catch(Exception e){
+ //TODO
+ e.printStackTrace();//if command not found in config or other exception
+ }
+ }
+ else{//dynamic way
+ //upto below statement is generic DAS..but select,etc..are particular
+ //to RDBDAS
+ //TODO if no matching command is found
+ if(!((String)paramsList.get(0)).equals("")){
+ cmd = dasInstance.getCommand((String)paramsList.get(0));//got in dynamic way
+ }else{
+ //this can be insert or delete as applyChanges-dynamic way
+ }
+ }
+
+ //TODO handle better
+ //this is not error case - as can be case for dynamic/static approach with applyChanges(), where command is
+ //obtained for generic select at later point. So, don't throw exception
+ /*if(cmd == null){
+ Exception e = new Exception("No command could be found!");
+ e.printStackTrace();
+ }*/
+
+ //Particular to RDBDAS
+ if(this.dataAccessType.equals(DataAccessEngine.RDB)){
+ DataObject dataObj = null;
+ dataObj = invokeRDBDASFunction(cmd, paramsList);
+ return dataObj;
+ }
+
+ //TODO ...implement for other than RDB
+ return null;
+ }
+
+ private DataObject invokeRDBDASSelect(Command cmd, Vector paramsList){
+ DataObject dObject = null;
+
+ if(paramsList != null && paramsList.size()>=3){
+ Map<Integer, Object> inParams = new Hashtable<Integer, Object>();
+ inParams = (Map<Integer, Object>)paramsList.get(2);
+ DataAccessUtils.fromJavaToRDBDASPositionBased(inParams, cmd);
+ }
+ dObject = cmd.executeQuery();
+ if(dObject == null){
+ System.out.println("null result returned in select");
+ }
+ //dasInstance.releaseResources();
+ return dObject;
+ }
+
+ private void invokeRDBDASDeleteExecute(Command cmd, Vector paramsList){
+ if(paramsList != null && paramsList.size()>=3){
+ Map<Integer, Object> inParams = new Hashtable<Integer, Object>();
+ inParams = (Map<Integer, Object>)paramsList.get(2);
+ DataAccessUtils.fromJavaToRDBDASPositionBased(inParams, cmd);
+ }
+ cmd.execute();
+ //dasInstance.releaseResources();
+ }
+
+ private void invokeRDBDASDeleteApplyChanges(Command cmd, Vector paramsList){
+ if(paramsList != null && paramsList.size()>=3){
+ String paramsTableName = paramsList.get(1).toString();
+ int idx = paramsTableName.indexOf(DataAccessEngine.SEPARATOR);
+ tableName = paramsTableName.substring(idx+1);
+ genericSelectForRoot = "select * from "+ tableName;
+ //System.out.println("genericSelectForRoot:"+genericSelectForRoot);
+ cmd = dasInstance.createCommand(genericSelectForRoot);
+
+ //set WHERE params
+ if(paramsList.get(2) instanceof Map){
+ Map<String, Object> whereParams = (Map<String, Object>)paramsList.get(2);
+
+ String whereStr = null;
+ //TODO needs better way
+ if(whereParams != null && whereParams.size()> 0){
+ for (Iterator i = whereParams.keySet().iterator(); i.hasNext();) {
+ String idxDel = (String)i.next();
+
+ Object val = whereParams.get(idxDel);
+ whereStr = tableName+"["+val+"]";
+ //System.out.println("whereStr:"+whereStr);
+ }
+ DataObject root = cmd.executeQuery();
+ DataObject dObj = root.getDataObject(whereStr);
+ dObj.delete();
+ dasInstance.applyChanges(root);
+ }
+ }
+ }
+
+ //dasInstance.releaseResources();
+ }
+
+ private void invokeRDBDASInsertExecute(Command cmd, Vector paramsList){
+ if(paramsList != null && paramsList.size()>=3){
+ Map<Integer, Object> inParams = new Hashtable<Integer, Object>();
+ inParams = (Map<Integer, Object>)paramsList.get(2);
+ DataAccessUtils.fromJavaToRDBDASPositionBased(inParams, cmd);
+ }
+ //System.out.println("before execute insert");
+
+ cmd.execute();
+ //dasInstance.releaseResources();
+ }
+
+ private void invokeRDBDASInsertApplyChanges(Command cmd, Vector paramsList){
+ if(paramsList != null && paramsList.size()>=3){
+ String paramsTableName = paramsList.get(1).toString();
+ int idx = paramsTableName.indexOf(DataAccessEngine.SEPARATOR);
+ tableName = paramsTableName.substring(idx+1);
+ genericSelectForRoot = "select * from "+ tableName;
+ //System.out.println("genericSelectForRoot:"+genericSelectForRoot);
+ cmd = dasInstance.createCommand(genericSelectForRoot);
+
+ //set INSERT params
+ if(paramsList.get(2) instanceof Map){
+ Map<String, Object> insertParams = (Map<String, Object>)paramsList.get(2);
+ DataObject root = cmd.executeQuery();
+ DataObject insertObj = root.createDataObject(tableName);
+
+ if(insertParams != null && insertParams.size()> 0){
+ for (Iterator i = insertParams.keySet().iterator(); i.hasNext();) {
+ String idxIns = (String)i.next();
+
+ Object val = insertParams.get(idxIns);
+ //System.out.println(idxIns+","+val+val.getClass().getName());
+ insertObj.set(idxIns, val);
+ }
+
+ }
+
+ dasInstance.applyChanges(root);
+ }
+ }
+ //dasInstance.releaseResources();
+ }
+
+ private void invokeRDBDASUpdate(Command cmd, Vector paramsList){
+ if(paramsList != null && paramsList.size()>=4){
+ String paramsTableName = paramsList.get(1).toString();
+ int idx = paramsTableName.indexOf(DataAccessEngine.SEPARATOR);
+ tableName = paramsTableName.substring(idx+1);
+ genericSelectForRoot = "select * from "+ tableName;
+ //System.out.println("genericSelectForRoot:"+genericSelectForRoot);
+ cmd = dasInstance.createCommand(genericSelectForRoot);
+
+ //set UPD and WHERE params
+ if(paramsList.get(2) instanceof Map){
+ Map<String, Object> updParams = (Map<String, Object>)paramsList.get(2);
+
+ if(paramsList.get(3) instanceof Map){
+ Map<String, Object> whereParams = (Map<String, Object>)paramsList.get(3);
+ DataObject root = DataAccessUtils.fromJavaToRDBDASNameBased(updParams, whereParams, cmd, tableName);
+ dasInstance.applyChanges(root);
+ }
+ }
+ }
+ //dasInstance.releaseResources();
+ }
+
+ private DataObject invokeRDBDASProcedure(Command cmd, Vector paramsList){
+ DataObject dataObj = null;
+ if(paramsList != null && paramsList.size()>=3){
+ //set IN params
+ if(paramsList.get(2) instanceof Map){
+ Map<Integer, Object> inParams = (Map<Integer, Object>)paramsList.get(2);
+ DataAccessUtils.fromJavaToRDBDASPositionBased(inParams, cmd);
+ }
+
+ dataObj = cmd.executeQuery();
+
+ if(paramsList.size()>=4 && paramsList.get(3) instanceof Map){
+ try{
+ Map<Integer, Object> outParams = (Map<Integer, Object>)paramsList.get(3);
+ DataAccessUtils.fromRDBDASToJavaPositionBased(outParams, cmd);
+ paramsList.add(3, outParams);
+ }catch(Exception e){
+ //TODO what if map is not of proper type
+ e.printStackTrace();
+ }
+ }
+
+ //System.out.println("executed SP..");
+ }
+ //dasInstance.releaseResources();
+ return dataObj; // NOPMD
+ }
+
+ //this method detects further what exact DAS function needs to be called e.g. applyChanges(), ...
+ private DataObject invokeRDBDASFunction(Command cmd, Vector paramsList){
+ String commandKind = null;
+ commandKind = (String)paramsList.get(1);//e.g. select, update, - sim. to one in DAS config for current command
+
+
+
+ //System.out.println("commandKind:"+commandKind);
+ //static or dynamic both - executeQuery()
+ if(commandKind.equals(DataAccessEngine.SELECT)){
+ DataObject dataObj = invokeRDBDASSelect(cmd, paramsList);
+ return dataObj; //NOPMD
+ }
+
+ //Delete can happen through execute() or applyChanges()
+ if(commandKind.startsWith(DataAccessEngine.DELETE)){
+ if(paramsList.get(0).toString().equals("")){
+ if(commandKind.indexOf(DataAccessEngine.SEPARATOR) != -1){//this will be applyChanges()-static/dynamic delete:tableName - cmd has no meaning here
+ invokeRDBDASDeleteApplyChanges(cmd, paramsList);
+ }else{//this will be execute() - static
+ invokeRDBDASDeleteExecute(cmd, paramsList);
+ return null;
+ }
+ }else{//this will be execute() - dynamic
+ invokeRDBDASDeleteExecute(cmd, paramsList);
+ return null;
+ }
+
+ return null;
+ }
+
+ //Insert can happen through execute() or applyChanges()
+ if(commandKind.startsWith(DataAccessEngine.INSERT)){
+ if(paramsList.get(0).toString().equals("")){
+ if(commandKind.indexOf(DataAccessEngine.SEPARATOR) != -1){//this will be applyChanges()-static/dynamic
+ invokeRDBDASInsertApplyChanges(cmd, paramsList);
+ }
+ else{//this will be execute() - static
+ //System.out.println("calling insert execute");
+ invokeRDBDASInsertExecute(cmd, paramsList);
+ return null;
+ }
+ }
+ else{//this will be execute() - dynamic
+ //System.out.println("calling insert execute");
+ invokeRDBDASInsertExecute(cmd, paramsList);
+ return null;
+ }
+
+ return null;
+ }
+
+ if(commandKind.startsWith(DataAccessEngine.UPDATE)){//update:tableName
+ invokeRDBDASUpdate(cmd, paramsList); //cmd has no meaning here
+ return null;
+ }
+
+ if(commandKind.equals(DataAccessEngine.PROCEDURE)){//executeQuery()
+ DataObject dataObj = invokeRDBDASProcedure(cmd, paramsList);
+ return dataObj;
+ }
+
+
+ return null;
+ }
+}
+
diff --git a/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccessscript/DataAccessUtils.java b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccessscript/DataAccessUtils.java
new file mode 100644
index 0000000000..8d28a753f1
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/src/main/java/org/apache/tuscany/container/dataaccessscript/DataAccessUtils.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.container.dataaccessscript;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.tuscany.das.rdb.Command;
+
+import commonj.sdo.DataObject;
+
+public class DataAccessUtils {
+ //in SP - when returning result - OUT params are populated here
+ public static void fromRDBDASToJavaPositionBased(Map outParams, Command cmd){
+ if(outParams != null && outParams.size()> 0){
+ for (Iterator i = outParams.keySet().iterator(); i.hasNext();) {
+ Integer odx = (Integer)i.next();
+
+ //result can be of any Object type
+ Object outRes = null;
+ outRes = cmd.getParameter(odx);
+
+ outParams.put(odx, outRes);
+ }
+ }
+
+ }
+
+ //in SP when calling executeQuery on SP, IN params are populated here
+ public static void fromJavaToRDBDASPositionBased(Map inParams, Command cmd){
+ if(inParams != null && inParams.size()> 0){
+ for (Iterator i = inParams.keySet().iterator(); i.hasNext();) {
+ Integer idx = (Integer)i.next();
+
+ Object val = inParams.get(idx);
+ cmd.setParameter(idx, val);
+ }
+ }
+ }
+
+ //Used in UPDATE
+ public static DataObject fromJavaToRDBDASNameBased(Map updParams, Map whereParams, Command cmd, String tableName){
+ //currently where clause is only for PKs - by convention
+ String whereStr = null;
+ //TODO needs better way
+ if(whereParams != null && whereParams.size()> 0){
+ for (Iterator i = whereParams.keySet().iterator(); i.hasNext();) {
+ String idx = (String)i.next();
+
+ Object val = whereParams.get(idx);
+ whereStr = tableName+"["+val+"]";
+ //System.out.println("whereStr:"+whereStr);
+ }
+ DataObject root = cmd.executeQuery();
+ DataObject dObj = root.getDataObject(whereStr);
+
+ if(updParams != null && updParams.size()> 0){
+ for (Iterator i = updParams.keySet().iterator(); i.hasNext();) {
+ String idx = (String)i.next();
+
+ Object val = updParams.get(idx);
+ dObj.set(idx, val);
+ }
+
+ return root;
+ }
+ }
+
+ return null;
+ }
+
+ //TODO ..similarly there will be fromJavaToXQueryDAS()..and revese etc.
+}
+
diff --git a/sandbox/lresende/backup/container.das/src/main/resources/META-INF/sca/das.system.scdl b/sandbox/lresende/backup/container.das/src/main/resources/META-INF/sca/das.system.scdl
new file mode 100644
index 0000000000..1af249a1cd
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/src/main/resources/META-INF/sca/das.system.scdl
@@ -0,0 +1,39 @@
+<?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="org.apache.tuscany.launcher.DasImplementation">
+
+ <component name="das.implementationLoader">
+ <system:implementation.system class="org.apache.tuscany.container.dataaccess.DataAccessImplementationLoader"/>
+ </component>
+
+ <component name="das.componentTypeLoader">
+ <system:implementation.system class="org.apache.tuscany.container.dataaccess.DataAccessComponentTypeLoader"/>
+ </component>
+
+ <component name="das.componentBuilder">
+ <system:implementation.system class="org.apache.tuscany.container.dataaccess.DataAccessComponentBuilder"/>
+ </component>
+
+</composite>
diff --git a/sandbox/lresende/backup/container.das/src/main/resources/META-INF/sca/default.scdl b/sandbox/lresende/backup/container.das/src/main/resources/META-INF/sca/default.scdl
new file mode 100644
index 0000000000..a1b145a1ef
--- /dev/null
+++ b/sandbox/lresende/backup/container.das/src/main/resources/META-INF/sca/default.scdl
@@ -0,0 +1,38 @@
+<?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.
+-->
+<!--
+ DataAccess 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="org.apache.tuscany.launcher.DataAccessImplementation">
+
+ <component name="das.implementationLoader">
+ <system:implementation.system class="org.apache.tuscany.container.dataaccess.DataAccessImplementationLoader"/>
+ </component>
+
+ <component name="das.componentTypeLoader">
+ <system:implementation.system class="org.apache.tuscany.container.dataaccess.DataAccessComponentTypeLoader"/>
+ </component>
+
+ <component name="das.componentBuilder">
+ <system:implementation.system class="org.apache.tuscany.container.dataaccess.DataAccessComponentBuilder"/>
+ </component>
+</composite> \ No newline at end of file
diff --git a/sandbox/lresende/das/api/pom.xml b/sandbox/lresende/das/api/pom.xml
new file mode 100644
index 0000000000..59d68038e7
--- /dev/null
+++ b/sandbox/lresende/das/api/pom.xml
@@ -0,0 +1,139 @@
+<?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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.das</groupId>
+ <artifactId>tuscany-das</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>tuscany-das-api</artifactId>
+ <name>Tuscany DAS API</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-impl</artifactId>
+ <version>${sdo.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ </build>
+
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+
+ <build>
+ <plugins>
+ <!-- Generate SDO DataObjects from XSD -->
+ <plugin>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>config</id>
+ <configuration>
+ <schemaFile>${basedir}/src/main/resources/config.xsd</schemaFile>
+ <noNotification>true</noNotification>
+ <noUnsettable>true</noUnsettable>
+ </configuration>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/*AllTestsDerby.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ </profile>
+
+ <profile>
+ <id>javadoc</id>
+
+ <build>
+ <plugins>
+ <!-- Generates JavaDoc for DAS RDB API -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <version>2.0</version>
+ <maven.javadoc.failonerror>0</maven.javadoc.failonerror>
+ <maven.javadoc.warningsreport>false</maven.javadoc.warningsreport>
+ </configuration>
+ <executions>
+ <execution>
+ <id>package</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ </profile>
+ </profiles>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</project>
+
+
diff --git a/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/Command.java b/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/Command.java
new file mode 100644
index 0000000000..0d82b839ab
--- /dev/null
+++ b/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/Command.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 org.apache.tuscany.das;
+
+import commonj.sdo.DataObject;
+
+/**
+ * A Command is used to execute a read or write to a database
+ */
+public interface Command {
+
+ /**
+ * Performs the function defined by the command
+ */
+ void execute();
+
+ /**
+ * Performs the function defined by the command and return the results in the root DataObject
+ *
+ * @return the root DataObject
+ */
+ DataObject executeQuery();
+
+ /**
+ * Sets the value of the associated Parameter
+ *
+ * @param index
+ * the index of the Parameter
+ * @param value
+ * the value for the Parameter
+ */
+ void setParameter(int index, Object value);
+
+ /**
+ * Returns the value of the associated Parameter
+ *
+ * @param index
+ * the index of the Parameter
+ * @return the value of the Parameter
+ */
+ Object getParameter(int index);
+
+ /**
+ * Returns the value of the database-generated key. This method is specific
+ * to an "insert" command and will be valid only after the command has
+ * been executed.
+ *
+ * @return the generated key
+ */
+ int getGeneratedKey();
+
+}
diff --git a/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/ConfigHelper.java b/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/ConfigHelper.java
new file mode 100644
index 0000000000..c9117a5d0a
--- /dev/null
+++ b/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/ConfigHelper.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.das;
+
+
+import org.apache.tuscany.das.config.Config;
+import org.apache.tuscany.das.config.ConfigFactory;
+
+/**
+ * A ConfigHelper is used as an aid in programmatic construction of Config instances.
+ * Manual contrution fo COnfig is an alternative to providing needed configuration
+ * information in an XML file
+ *
+ */
+public class ConfigHelper {
+
+ private Config config;
+
+ //private MappingWrapper configWrapper;
+
+ private ConfigFactory factory = ConfigFactory.INSTANCE;
+
+ public ConfigHelper() {
+ config = factory.createConfig();
+ //configWrapper = new MappingWrapper(config);
+ }
+
+ public ConfigHelper(Config config) {
+ this.config = config;
+ //configWrapper = new MappingWrapper(config);
+ }
+
+
+ public Config getConfig() {
+ return config;
+ }
+
+}
diff --git a/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/Converter.java b/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/Converter.java
new file mode 100644
index 0000000000..dde6e81771
--- /dev/null
+++ b/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/Converter.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.das;
+
+/**
+ * A lightweight Table-column <--> DataObject-property converter framework. Converters
+ * allow a user to insert a transformation between a column value
+ * and is destination DataObject property value. For example, by default, a VARCHAR
+ * column will be represented as a String in its corresponding
+ * DataObject property. A user could insert a converter that transforms the the VARCHAR
+ * value to an Integer. If this is done then although the column
+ * returns character data, the DataObject property will be an Integer
+ *
+ *
+ */
+public interface Converter {
+
+ /**
+ * Transform the columnData object to a new value and possibly
+ * new type. This should be the invers operation of #getColumnValue
+ *
+ * @param columnData
+ * The column value to transorm
+ * @return Returns the transformed value
+ */
+ Object getPropertyValue(Object columnData);
+
+ /**
+ * Transform the columnData object to a new value and possibly new
+ * type. This should be the invers operation of #getPropertyValue
+ *
+ * @param propertyData
+ * The property value to transform
+ * @return Returns the transformed value
+ */
+ Object getColumnValue(Object propertyData);
+
+}
diff --git a/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/DAS.java b/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/DAS.java
new file mode 100644
index 0000000000..bdbab71bb8
--- /dev/null
+++ b/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/DAS.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 org.apache.tuscany.das;
+
+//import org.apache.tuscany.das.rdb.impl.DASFactoryImpl;
+
+import commonj.sdo.DataObject;
+
+/**
+ * A CommandGroup represents a set of {@link Command} and single {@link ApplyChangesCommand}
+ * that are created from a common config file.
+ *
+ */
+public interface DAS {
+
+ //DASFactory FACTORY = new DASFactoryImpl();
+
+
+ /**
+ * The change history is scanned and modifications to the graph of data objects are flushed to the database.
+ *
+ * @param root
+ * the topmost containing data object
+ */
+ void applyChanges(DataObject root);
+
+ /**
+ * Gets the named command from this factory's inventory
+ *
+ * @param name
+ * The identifying name of the requested command
+ * @return Returns the identified command
+ */
+ Command getCommand(String name);
+
+ /**
+ * If the CommandGroup is managing connections then this method must be called
+ * when the client is done with the instance.
+ *
+ */
+ void releaseResources();
+
+ /**
+ * Creates a Command based on the provided SQL statement
+ *
+ * @param sql
+ * The SQL statement
+ * @return returns a Command instance
+ */
+ Command createCommand(String sql);
+
+}
diff --git a/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/DASFactory.java b/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/DASFactory.java
new file mode 100644
index 0000000000..25be55db96
--- /dev/null
+++ b/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/DASFactory.java
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.das;
+
+import java.io.InputStream;
+import java.sql.Connection;
+import java.util.Iterator;
+
+import org.apache.tuscany.das.config.Config;
+
+import sun.misc.Service;
+
+/**
+ * A DASFactory produces {@link DAS} instances.
+ *
+ *
+ */
+public abstract class DASFactory {
+
+ /**
+ * Return a concrete factory based on specific implementation namespace
+ * @param implementationNamespace
+ * @return
+ */
+ public static DASFactory getInstance(String implementationNamespace){
+ return DASFactory.getInstance(implementationNamespace, DASFactory.class.getClassLoader());
+ }
+
+ /**
+ * Return a concrete factory based on specific implementation namespace and consider a given classloader
+ * @param implementationNamespace
+ * @param cl
+ * @return
+ */
+ public static DASFactory getInstance(String implementationNamespace, ClassLoader cl){
+ DASFactory factoryInstance = null;
+ Iterator ps = Service.providers(DASFactory.class);
+ while(ps.hasNext()){
+ DASFactory factory = (DASFactory) ps.next();
+ if(factory.getNamespace().equalsIgnoreCase(implementationNamespace)) {
+ factoryInstance = factory;
+ break;
+ }
+ }
+
+ return factoryInstance;
+ }
+
+ /**
+ * Namespace that identifies the implementation
+ * @return
+ */
+ public abstract String getNamespace();
+
+ /**
+ * Creates a DAS based on the provided config file stream
+ *
+ * @param configStream
+ * A stream over a DAS config file
+ * @return returns a DAS instance
+ */
+ public abstract DAS createDAS(InputStream configStream);
+
+ /**
+ * Creates a DAS based on the provide config file stream and connection
+ * @param configStream
+ * @param connection
+ * @return
+ */
+ public abstract DAS createDAS(InputStream configStream, Connection connection);
+
+ /**
+ * Creates a DAS based on the provided config
+ *
+ * @param config
+ * A DAS config object
+ * @return returns a DAS instance
+ */
+ public abstract DAS createDAS(Config config);
+
+ /**
+ * Creates a DAS based on the provided config and connection
+ * @param config
+ * @param connection
+ * @return
+ */
+ public abstract DAS createDAS(Config config, Connection connection);
+
+ /**
+ * Creates a DAS based on the provided connection
+ * @param connection
+ * @return
+ */
+ public abstract DAS createDAS(Connection connection);
+
+
+}
+
diff --git a/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/Implementation.java b/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/Implementation.java
new file mode 100644
index 0000000000..5f999a30cf
--- /dev/null
+++ b/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/Implementation.java
@@ -0,0 +1,17 @@
+package org.apache.tuscany.das;
+
+public enum Implementation {
+ RDB ("das://rdb"),
+ LDAP ("das://ldap"),
+ XQUERY ("das://xquery");
+
+ private final String key;
+
+ Implementation(String key){
+ this.key = key;
+ }
+
+ public String getKey(){
+ return this.key;
+ }
+}
diff --git a/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/Pager.java b/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/Pager.java
new file mode 100644
index 0000000000..4a4ac1cae7
--- /dev/null
+++ b/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/Pager.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 org.apache.tuscany.das;
+
+import commonj.sdo.DataObject;
+
+/**
+ * An iterator-like interface to conveniently move through chunks of data. The
+ * idea is that a Pager works with a read Command. The read command
+ * returns a large amount of data and the client wants to work with chunks
+ * of it at a time. So the Pager is created on the command and each call to
+ * next returns the next chunk of data. This is done completely disconnected.
+ * No cursor is maintained between calls to #next.
+ *
+ * TODO - This is very preliminary. We need to look at this interface
+ * in the context of disonnected scenarios such as a web app. The Pager instance
+ * will probably be saved in session so it must be very light and cannot
+ * reference a connection. Also, we probably need to define a factory or add a
+ * method to set page size.
+ *
+ *
+ */
+public interface Pager {
+
+ /**
+ * Get the next page of data
+ *
+ * @return the next page of data
+ */
+ DataObject next();
+
+ /**
+ * Get the page prior to the last page returned
+ *
+ * @return the previous page
+ */
+ DataObject previous();
+
+ /**
+ * Return a specific identified page.
+ *
+ * @param page
+ * The number of the page to return
+ * @return the indicated page
+ */
+ DataObject getPage(int page);
+
+}
diff --git a/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/service/ServiceLoader.java b/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/service/ServiceLoader.java
new file mode 100644
index 0000000000..34466778df
--- /dev/null
+++ b/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/service/ServiceLoader.java
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.das.service;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * This class loads services present in the class path.
+ */
+public class ServiceLoader {
+
+ private static Map providerMap = new java.util.Hashtable();
+
+ public static synchronized Iterator providers(Class cls) {
+ ClassLoader cl = cls.getClassLoader();
+ // null if loaded by bootstrap class loader
+ if (cl == null) {
+ cl = ClassLoader.getSystemClassLoader();
+ }
+ String serviceFile = "META-INF/services/" + cls.getName();
+
+ // log.debug("File: " + serviceFile);
+
+ List lst = (List)providerMap.get(serviceFile);
+ if (lst != null) {
+ return lst.iterator();
+ }
+
+ lst = new java.util.Vector();
+ providerMap.put(serviceFile, lst);
+
+ Enumeration e;
+ try {
+ e = cl.getResources(serviceFile);
+ } catch (IOException ioe) {
+ return lst.iterator();
+ }
+
+ while (e.hasMoreElements()) {
+ try {
+ java.net.URL u = (java.net.URL)e.nextElement();
+ //log.debug("URL: " + u);
+
+ InputStream is = u.openStream();
+ Reader r = new InputStreamReader(is, "UTF-8");
+ BufferedReader br = new BufferedReader(r);
+
+ String line = br.readLine();
+ while (line != null) {
+ try {
+ // First strip any comment...
+ int idx = line.indexOf('#');
+ if (idx != -1) {
+ line = line.substring(0, idx);
+ }
+
+ // Trim whitespace.
+ line = line.trim();
+
+ // If nothing left then loop around...
+ if (line.length() == 0) {
+ line = br.readLine();
+ continue;
+ }
+ // log.debug("Line: " + line);
+
+ // Try and load the class
+ // Object obj = cl.loadClass(line).newInstance();
+ // stick it into our vector...
+ lst.add(line);
+ } catch (Exception ex) {
+ // Just try the next line
+ }
+
+ line = br.readLine();
+ }
+ } catch (Exception ex) {
+ // Just try the next file...
+ }
+
+ }
+ return lst.iterator();
+ }
+
+ }
diff --git a/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/service/ServiceProvider.java b/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/service/ServiceProvider.java
new file mode 100644
index 0000000000..37f7183130
--- /dev/null
+++ b/sandbox/lresende/das/api/src/main/java/org/apache/tuscany/das/service/ServiceProvider.java
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.das.service;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.tuscany.das.DASFactory;
+
+import sun.misc.Service;
+
+
+public class ServiceProvider {
+ /**
+ * The name of the property used to identify the LogFactory implementation class name.
+ */
+ public static final String FACTORY_PROPERTY = "org.apache.tuscany.das.DASFactory";
+
+ /**
+ * 'Service Provider' specification ( http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html )
+ */
+ protected static final String SERVICE_ID = "META-INF/services/org.apache.tuscany.das.DASFactory";
+
+
+ private static final String FACTORY_RESOURCE = "org.apache.tuscany.das.das";
+
+
+ private Map<String, String> registry = new HashMap<String, String>();
+
+ private static final ServiceProvider instance = new ServiceProvider();
+
+ protected ServiceProvider() {
+
+ }
+
+ public static ServiceProvider getInstance(){
+ return instance;
+ }
+
+
+ public static void Something(){
+// Second, try to find a service by using the JDK1.3 jar
+ // discovery mechanism. This will allow users to plug a logger
+ // by just placing it in the lib/ directory of the webapp ( or in
+ // CLASSPATH or equivalent ). This is similar with the second
+ // step, except that it uses the (standard?) jdk1.3 location in the jar.
+
+ Iterator ps = Service.providers(DASFactory.class);
+ while(ps.hasNext()){
+ DASFactory factory = (DASFactory) ps.next();
+ System.out.println( factory.getClass().getName());
+ }
+
+
+ }
+
+ public static void Anotherthing() throws Exception{
+// Second, try to find a service by using the JDK1.3 jar
+ // discovery mechanism. This will allow users to plug a logger
+ // by just placing it in the lib/ directory of the webapp ( or in
+ // CLASSPATH or equivalent ). This is similar with the second
+ // step, except that it uses the (standard?) jdk1.3 location in the jar.
+
+ Iterator ps = ServiceLoader.providers(DASFactory.class);
+ while(ps.hasNext()){
+ String className = (String) ps.next();
+ DASFactory factory = (DASFactory) Class.forName(className).newInstance();
+ System.out.println( factory.getClass().getName() );
+ }
+
+
+ }
+
+
+ public static void main(String[] args) throws Exception{
+ //DASFactory factory = ServiceProvider.getInstance().getFactory(Implementation.LDAP);
+ ServiceProvider.Something();
+ ServiceProvider.Anotherthing();
+ }
+}
diff --git a/sandbox/lresende/das/api/src/main/resources/META-INF/LICENSE.txt b/sandbox/lresende/das/api/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000000..db5936c86e
--- /dev/null
+++ b/sandbox/lresende/das/api/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,323 @@
+
+ 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.
+
+===================================================================================================
diff --git a/sandbox/lresende/das/api/src/main/resources/META-INF/MANIFEST.MF b/sandbox/lresende/das/api/src/main/resources/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..cc18a3894b
--- /dev/null
+++ b/sandbox/lresende/das/api/src/main/resources/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Extension-Name: tuscany-das-api
+Specification-Title: Tuscany DAS API for Relational Databases
+Specification-Vendor: Apache Software Foundation
+Implementation-Vendor: Apache Software Foundation
+Implementation-Vendor-Id: org.apache
+Implementation-Title: tuscany-das-api
+Implementation-Version: incubating-Mx
+Bundle-ManifestVersion: 2
+Bundle-Name: Tuscany DAS API
+Bundle-SymbolicName: org.apache.tuscany.das.api
+Bundle-Version: 1.0.0
+Bundle-Vendor: Apache Software Foundation
diff --git a/sandbox/lresende/das/api/src/main/resources/META-INF/NOTICE.txt b/sandbox/lresende/das/api/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 0000000000..11c564eb19
--- /dev/null
+++ b/sandbox/lresende/das/api/src/main/resources/META-INF/NOTICE.txt
@@ -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/sandbox/lresende/das/api/src/main/resources/META-INF/README.txt b/sandbox/lresende/das/api/src/main/resources/META-INF/README.txt
new file mode 100644
index 0000000000..723f3fd3ab
--- /dev/null
+++ b/sandbox/lresende/das/api/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/sandbox/lresende/das/api/src/main/resources/config.xsd b/sandbox/lresende/das/api/src/main/resources/config.xsd
new file mode 100644
index 0000000000..eeefaca600
--- /dev/null
+++ b/sandbox/lresende/das/api/src/main/resources/config.xsd
@@ -0,0 +1,35 @@
+<?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.
+ -->
+<xsd:schema
+ xmlns:config="http:///org.apache.tuscany.das/config.xsd"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http:///org.apache.tuscany.das/config.xsd"
+ elementFormDefault="qualified">
+
+ <xsd:element name="Config" type="config:Config"/>
+
+ <xsd:complexType name="Config">
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="Command" type="config:Command"/>
+ </xsd:sequence>
+ <xsd:attribute name="uri" type="xsd:string"/>
+ <xsd:attribute name="dataObjectModel" type="xsd:string"/>
+ </xsd:complexType>
+</xsd:schema>
diff --git a/sandbox/lresende/das/ldap/pom.xml b/sandbox/lresende/das/ldap/pom.xml
new file mode 100644
index 0000000000..6a616d4128
--- /dev/null
+++ b/sandbox/lresende/das/ldap/pom.xml
@@ -0,0 +1,144 @@
+<?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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.das</groupId>
+ <artifactId>tuscany-das</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.tuscany.das.das-ldap</groupId>
+ <artifactId>tuscany-das-ldap</artifactId>
+ <name>Tuscany DAS for LDAP</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.das</groupId>
+ <artifactId>tuscany-das-api</artifactId>
+ <version>${das.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-impl</artifactId>
+ <version>${sdo.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ </build>
+
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+
+ <build>
+ <plugins>
+ <!-- Generate SDO DataObjects from XSD -->
+ <plugin>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>config</id>
+ <configuration>
+ <schemaFile>${basedir}/src/main/resources/ldap-config.xsd</schemaFile>
+ <noNotification>true</noNotification>
+ <noUnsettable>true</noUnsettable>
+ </configuration>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/*AllTestsDerby.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>javadoc</id>
+ <build>
+ <plugins>
+ <!-- Generates JavaDoc for DAS LDAP -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <version>2.0</version>
+ <maven.javadoc.failonerror>0</maven.javadoc.failonerror>
+ <maven.javadoc.warningsreport>false</maven.javadoc.warningsreport>
+ </configuration>
+ <executions>
+ <execution>
+ <id>package</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</project>
+
+
diff --git a/sandbox/lresende/das/ldap/src/main/java/org/apache/tuscany/das/ldap/impl/LdapDASFactoryImpl.java b/sandbox/lresende/das/ldap/src/main/java/org/apache/tuscany/das/ldap/impl/LdapDASFactoryImpl.java
new file mode 100644
index 0000000000..a16c40f856
--- /dev/null
+++ b/sandbox/lresende/das/ldap/src/main/java/org/apache/tuscany/das/ldap/impl/LdapDASFactoryImpl.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 org.apache.tuscany.das.ldap.impl;
+
+import java.io.InputStream;
+import java.sql.Connection;
+
+import org.apache.tuscany.das.DAS;
+import org.apache.tuscany.das.DASFactory;
+import org.apache.tuscany.das.config.Config;
+
+
+
+public class LdapDASFactoryImpl extends DASFactory {
+ public static final String NAMESPACE = "das://ldap";
+
+ public LdapDASFactoryImpl(){
+
+ }
+
+ @Override
+ public String getNamespace() {
+ return NAMESPACE;
+ }
+
+ @Override
+ public DAS createDAS(InputStream configStream) {
+ return null;
+ }
+
+ @Override
+ public DAS createDAS(Config config) {
+ return null;
+ }
+
+ @Override
+ public DAS createDAS(InputStream configStream, Connection connection) {
+ return null;
+ }
+
+ @Override
+ public DAS createDAS(Config config, Connection connection) {
+ return null;
+ }
+
+ @Override
+ public DAS createDAS(Connection connection) {
+ return null;
+ }
+}
diff --git a/sandbox/lresende/das/ldap/src/main/resources/META-INF/LICENSE.txt b/sandbox/lresende/das/ldap/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000000..db5936c86e
--- /dev/null
+++ b/sandbox/lresende/das/ldap/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,323 @@
+
+ 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.
+
+===================================================================================================
diff --git a/sandbox/lresende/das/ldap/src/main/resources/META-INF/MANIFEST.MF b/sandbox/lresende/das/ldap/src/main/resources/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..cc18a3894b
--- /dev/null
+++ b/sandbox/lresende/das/ldap/src/main/resources/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Extension-Name: tuscany-das-api
+Specification-Title: Tuscany DAS API for Relational Databases
+Specification-Vendor: Apache Software Foundation
+Implementation-Vendor: Apache Software Foundation
+Implementation-Vendor-Id: org.apache
+Implementation-Title: tuscany-das-api
+Implementation-Version: incubating-Mx
+Bundle-ManifestVersion: 2
+Bundle-Name: Tuscany DAS API
+Bundle-SymbolicName: org.apache.tuscany.das.api
+Bundle-Version: 1.0.0
+Bundle-Vendor: Apache Software Foundation
diff --git a/sandbox/lresende/das/ldap/src/main/resources/META-INF/NOTICE.txt b/sandbox/lresende/das/ldap/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 0000000000..11c564eb19
--- /dev/null
+++ b/sandbox/lresende/das/ldap/src/main/resources/META-INF/NOTICE.txt
@@ -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/sandbox/lresende/das/ldap/src/main/resources/META-INF/README.txt b/sandbox/lresende/das/ldap/src/main/resources/META-INF/README.txt
new file mode 100644
index 0000000000..723f3fd3ab
--- /dev/null
+++ b/sandbox/lresende/das/ldap/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/sandbox/lresende/das/ldap/src/main/resources/META-INF/services/org.apache.tuscany.das.DASFactory b/sandbox/lresende/das/ldap/src/main/resources/META-INF/services/org.apache.tuscany.das.DASFactory
new file mode 100644
index 0000000000..e061c47fea
--- /dev/null
+++ b/sandbox/lresende/das/ldap/src/main/resources/META-INF/services/org.apache.tuscany.das.DASFactory
@@ -0,0 +1 @@
+org.apache.tuscany.das.ldap.impl.LdapDASFactoryImpl \ No newline at end of file
diff --git a/sandbox/lresende/das/ldap/src/main/resources/ldap-config.xsd b/sandbox/lresende/das/ldap/src/main/resources/ldap-config.xsd
new file mode 100644
index 0000000000..95a491d464
--- /dev/null
+++ b/sandbox/lresende/das/ldap/src/main/resources/ldap-config.xsd
@@ -0,0 +1,59 @@
+<?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.
+ -->
+<xsd:schema
+ xmlns:config="http://org.apache.tuscany.das/config.xsd"
+ xmlns:ldap-config="http://org.apache.tuscany.das.ldap/config.xsd"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://org.apache.tuscany.das.ldap/config.xsd"
+ elementFormDefault="qualified">
+
+ <import namespace="http://org.apache.tuscany.das/config.xsd" schemaLocation="config.xsd"/>
+ <xsd:include schemaLocation="http://org.apache.tuscany.das/config.xsd"/>
+
+ <xsd:element name="LdapConfig" type="ldap-config:Config"/>
+
+ <xsd:complexType name="LdapConfig">
+ <xsd:complexContent>
+ <xsd:extension base="http://org.apache.tuscany.das/config.xsd:Config">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0" name="ConnectionInfo" type="config:ConnectionInfo"/>
+ </xsd:sequence>
+ <xsd:attribute name="uri" type="xsd:string"/>
+ <xsd:attribute name="dataObjectModel" type="xsd:string"/>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="ConnectionProperties">
+ <xsd:attribute name="driverClass" type="xsd:string"/>
+ <xsd:attribute name="databaseURL" type="xsd:string"/>
+ <xsd:attribute name="userName" type="xsd:string" default=""/>
+ <xsd:attribute name="password" type="xsd:string" default=""/>
+ <xsd:attribute name="loginTimeout" type="xsd:int" default="0"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="ConnectionInfo">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0" name="ConnectionProperties" type="config:ConnectionProperties"/>
+ </xsd:sequence>
+ <xsd:attribute name="dataSource" type="xsd:string"/>
+ <xsd:attribute name="managedtx" type="xsd:boolean" default="true"/>
+ </xsd:complexType>
+</xsd:schema>
diff --git a/sandbox/lresende/das/ldap/src/test/java/org/apache/tuscany/das/ldap/DASFactoryTestCase.java b/sandbox/lresende/das/ldap/src/test/java/org/apache/tuscany/das/ldap/DASFactoryTestCase.java
new file mode 100644
index 0000000000..99910ab61b
--- /dev/null
+++ b/sandbox/lresende/das/ldap/src/test/java/org/apache/tuscany/das/ldap/DASFactoryTestCase.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.das.ldap;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.das.DASFactory;
+import org.apache.tuscany.das.ldap.impl.LdapDASFactoryImpl;
+
+public class DASFactoryTestCase extends TestCase {
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testDiscoverFactoryInstance() {
+ DASFactory factory = DASFactory.getInstance(LdapDASFactoryImpl.NAMESPACE);
+
+ assertNotNull(factory);
+ assertEquals(factory.getNamespace(), LdapDASFactoryImpl.NAMESPACE);
+ }
+}
diff --git a/sandbox/lresende/das/pom.xml b/sandbox/lresende/das/pom.xml
new file mode 100644
index 0000000000..7149709089
--- /dev/null
+++ b/sandbox/lresende/das/pom.xml
@@ -0,0 +1,123 @@
+<?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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany</groupId>
+ <artifactId>parent</artifactId>
+ <version>2-incubating-SNAPSHOT</version>
+ </parent>
+
+ <groupId>sandbox</groupId>
+ <artifactId>lresende</artifactId>
+ <packaging>pom</packaging>
+ <name>Tuscany Sanbox</name>
+ <version>1.0-incubating-SNAPSHOT</version>
+
+ <properties>
+ <das.version>1.0-incubating-SNAPSHOT</das.version>
+ <sdo.version>1.0-incubator-SNAPSHOT</sdo.version>
+ </properties>
+
+ <modules>
+ <module>api</module>
+ <module>ldap</module>
+ <module>xquery</module>
+ </modules>
+
+ <!-- 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>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-impl</artifactId>
+ <version>1.0-incubator-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+
+ <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-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/*TestCase.java</include>
+ </includes>
+ <reportFormat>brief</reportFormat>
+ <useFile>false</useFile>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sandbox/lresende/das/xquery/pom.xml b/sandbox/lresende/das/xquery/pom.xml
new file mode 100644
index 0000000000..abf6c33f35
--- /dev/null
+++ b/sandbox/lresende/das/xquery/pom.xml
@@ -0,0 +1,113 @@
+<?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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.das</groupId>
+ <artifactId>tuscany-das</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.tuscany.das.das-xquery</groupId>
+ <artifactId>tuscany-das-xquery</artifactId>
+ <name>Tuscany DAS for XQUERY</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.das</groupId>
+ <artifactId>tuscany-das-api</artifactId>
+ <version>${das.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-impl</artifactId>
+ <version>${sdo.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ </build>
+
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ </profile>
+
+ <profile>
+ <id>javadoc</id>
+
+ <build>
+ <plugins>
+ <!-- Generates JavaDoc for DAS LDAP -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <version>2.0</version>
+ <maven.javadoc.failonerror>0</maven.javadoc.failonerror>
+ <maven.javadoc.warningsreport>false</maven.javadoc.warningsreport>
+ </configuration>
+ <executions>
+ <execution>
+ <id>package</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ </profile>
+ </profiles>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</project>
+
+
diff --git a/sandbox/lresende/das/xquery/src/main/java/org/apache/tuscany/das/xquery/impl/XQueryDASFactoryImpl.java b/sandbox/lresende/das/xquery/src/main/java/org/apache/tuscany/das/xquery/impl/XQueryDASFactoryImpl.java
new file mode 100644
index 0000000000..219af9db11
--- /dev/null
+++ b/sandbox/lresende/das/xquery/src/main/java/org/apache/tuscany/das/xquery/impl/XQueryDASFactoryImpl.java
@@ -0,0 +1,45 @@
+package org.apache.tuscany.das.xquery.impl;
+
+import java.io.InputStream;
+import java.sql.Connection;
+
+import org.apache.tuscany.das.DAS;
+import org.apache.tuscany.das.DASFactory;
+import org.apache.tuscany.das.config.Config;
+
+public class XQueryDASFactoryImpl extends DASFactory {
+ public static final String NAMESPACE = "das://xquery";
+ public XQueryDASFactoryImpl(){
+
+ }
+
+ @Override
+ public String getNamespace() {
+ return NAMESPACE;
+ }
+
+ @Override
+ public DAS createDAS(InputStream configStream) {
+ return null;
+ }
+
+ @Override
+ public DAS createDAS(Config config) {
+ return null;
+ }
+
+ @Override
+ public DAS createDAS(InputStream configStream, Connection connection) {
+ return null;
+ }
+
+ @Override
+ public DAS createDAS(Config config, Connection connection) {
+ return null;
+ }
+
+ @Override
+ public DAS createDAS(Connection connection) {
+ return null;
+ }
+}
diff --git a/sandbox/lresende/das/xquery/src/main/resources/META-INF/LICENSE.txt b/sandbox/lresende/das/xquery/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000000..db5936c86e
--- /dev/null
+++ b/sandbox/lresende/das/xquery/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,323 @@
+
+ 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.
+
+===================================================================================================
diff --git a/sandbox/lresende/das/xquery/src/main/resources/META-INF/MANIFEST.MF b/sandbox/lresende/das/xquery/src/main/resources/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..cc18a3894b
--- /dev/null
+++ b/sandbox/lresende/das/xquery/src/main/resources/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Extension-Name: tuscany-das-api
+Specification-Title: Tuscany DAS API for Relational Databases
+Specification-Vendor: Apache Software Foundation
+Implementation-Vendor: Apache Software Foundation
+Implementation-Vendor-Id: org.apache
+Implementation-Title: tuscany-das-api
+Implementation-Version: incubating-Mx
+Bundle-ManifestVersion: 2
+Bundle-Name: Tuscany DAS API
+Bundle-SymbolicName: org.apache.tuscany.das.api
+Bundle-Version: 1.0.0
+Bundle-Vendor: Apache Software Foundation
diff --git a/sandbox/lresende/das/xquery/src/main/resources/META-INF/NOTICE.txt b/sandbox/lresende/das/xquery/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 0000000000..11c564eb19
--- /dev/null
+++ b/sandbox/lresende/das/xquery/src/main/resources/META-INF/NOTICE.txt
@@ -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/sandbox/lresende/das/xquery/src/main/resources/META-INF/README.txt b/sandbox/lresende/das/xquery/src/main/resources/META-INF/README.txt
new file mode 100644
index 0000000000..723f3fd3ab
--- /dev/null
+++ b/sandbox/lresende/das/xquery/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/sandbox/lresende/das/xquery/src/main/resources/META-INF/services/org.apache.tuscany.das.DASFactory b/sandbox/lresende/das/xquery/src/main/resources/META-INF/services/org.apache.tuscany.das.DASFactory
new file mode 100644
index 0000000000..991face120
--- /dev/null
+++ b/sandbox/lresende/das/xquery/src/main/resources/META-INF/services/org.apache.tuscany.das.DASFactory
@@ -0,0 +1 @@
+org.apache.tuscany.das.xquery.impl.XQueryDASFactoryImpl \ No newline at end of file
diff --git a/sandbox/lresende/das/xquery/src/main/resources/config.xsd b/sandbox/lresende/das/xquery/src/main/resources/config.xsd
new file mode 100644
index 0000000000..c9ca53f54a
--- /dev/null
+++ b/sandbox/lresende/das/xquery/src/main/resources/config.xsd
@@ -0,0 +1,62 @@
+<?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.
+ -->
+<xsd:schema
+ xmlns:config="http:///org.apache.tuscany.das.xquery/config.xsd"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http:///org.apache.tuscany.das.xquery/config.xsd"
+ elementFormDefault="qualified">
+
+ <xsd:element name="Config" type="config:Config"/>
+
+ <xsd:complexType name="Config">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0" name="ConnectionInfo"
+ type="config:ConnectionInfo"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="Command"
+ type="config:Command"/>
+ </xsd:sequence>
+ <xsd:attribute name="uri" type="xsd:string"/>
+ <xsd:attribute name="dataObjectModel" type="xsd:string"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="ConnectionInfo">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0" name="ConnectionProperties" type="config:ConnectionProperties"/>
+ </xsd:sequence>
+ <xsd:attribute name="dataSource" type="xsd:string"/>
+ <xsd:attribute name="dataSourceType" type="xsd:string" default="Database"/><!--FileSystem-->
+ <xsd:attribute name="managedtx" type="xsd:boolean" default="true"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="ConnectionProperties">
+ <xsd:attribute name="driverClass" type="xsd:string"/>
+ <xsd:attribute name="databaseURL" type="xsd:string"/>
+ <xsd:attribute name="userName" type="xsd:string" default=""/>
+ <xsd:attribute name="password" type="xsd:string" default=""/>
+ <xsd:attribute name="loginTimeout" type="xsd:int" default="0"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="Command">
+ <xsd:attribute name="name" type="xsd:string"/>
+ <xsd:attribute name="dataFileName" type="xsd:string"/>
+ <xsd:attribute name="queryString" type="xsd:string"/>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/sandbox/lresende/das/xquery/src/test/java/org/apache/tuscany/das/xquery/XQueryDASFactoryTestCase.java b/sandbox/lresende/das/xquery/src/test/java/org/apache/tuscany/das/xquery/XQueryDASFactoryTestCase.java
new file mode 100644
index 0000000000..02d905ef9d
--- /dev/null
+++ b/sandbox/lresende/das/xquery/src/test/java/org/apache/tuscany/das/xquery/XQueryDASFactoryTestCase.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.das.xquery;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.das.DASFactory;
+import org.apache.tuscany.das.xquery.impl.XQueryDASFactoryImpl;
+
+public class XQueryDASFactoryTestCase extends TestCase {
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testDiscoverFactoryInstance() {
+ DASFactory factory = DASFactory.getInstance(XQueryDASFactoryImpl.NAMESPACE);
+
+ assertNotNull(factory);
+ assertEquals(factory.getNamespace(), XQueryDASFactoryImpl.NAMESPACE);
+ }
+}
diff --git a/sandbox/lresende/etc/download-script/README b/sandbox/lresende/etc/download-script/README
new file mode 100644
index 0000000000..c129dc8b13
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/README
@@ -0,0 +1,30 @@
+These are set of scripts used to count the release downloads from apache http stat logs.
+
+1.Where to download the http stat logs from
+The logs are located in people.apache.org under x1/logarchive/people/<year>/<month>/??.bz2
+I usually download them on a folder structure like : <year>/<month>
+
+2.Get ready to process the scripts
+Unzip the log files
+ >bunzip2 ??.bz2
+Concatenate together all the logs from a given month
+ >ls -1 | xargs -i -t cat {} >> ../<year>-<month>.log
+
+3.Running the scripts
+all-report.sh - runs all the scripts
+ >./all-reports.sh
+
+???-report.sh - runs reports for a given type of release/project (e.g cpp, sca, sdo, das)
+ >./sca.report.sh
+
+
+4.Adding a new month to be processed
+Edit the ???-report.sh and add a new line for the new month as appropriated
+ >./sca-099.sh 2007/2007-09.log >> sca-downloads.log
+
+5.Adding a new project/release
+Create a new script that filters the specific project/release
+ >total=$(cat $1 | grep tuscany-das-1.0-incubating-beta1 | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
+
+The update the other scripts to properly call this to process a given month
diff --git a/sandbox/lresende/etc/download-script/all-report.sh b/sandbox/lresende/etc/download-script/all-report.sh
new file mode 100755
index 0000000000..aa4059263e
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/all-report.sh
@@ -0,0 +1,4 @@
+./sdo-report.sh
+./das-report.sh
+./sca-report.sh
+./cpp-report.sh
diff --git a/sandbox/lresende/etc/download-script/cpp-report.sh b/sandbox/lresende/etc/download-script/cpp-report.sh
new file mode 100755
index 0000000000..9ced9e1afc
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/cpp-report.sh
@@ -0,0 +1,130 @@
+#clean the file
+echo "" > cpp-downloads.log
+
+#process M1 release
+echo "SCA M1 release (jul 31 2006)" >> cpp-downloads.log
+
+# M1 release was released in Jul 31 2006
+./cpp_sca-m1.sh 2007/2007-01.log >> cpp-downloads.log
+./cpp_sca-m1.sh 2007/2007-02.log >> cpp-downloads.log
+./cpp_sca-m1.sh 2007/2007-03.log >> cpp-downloads.log
+./cpp_sca-m1.sh 2007/2007-04.log >> cpp-downloads.log
+./cpp_sca-m1.sh 2007/2007-05.log >> cpp-downloads.log
+./cpp_sca-m1.sh 2007/2007-06.log >> cpp-downloads.log
+./cpp_sca-m1.sh 2007/2007-07.log >> cpp-downloads.log
+./cpp_sca-m1.sh 2007/2007-08.log >> cpp-downloads.log
+./cpp_sca-m1.sh 2007/2007-09.log >> cpp-downloads.log
+./cpp_sca-m1.sh 2007/2007-10.log >> cpp-downloads.log
+./cpp_sca-m1.sh 2007/2007-11.log >> cpp-downloads.log
+./cpp_sca-m1.sh 2007/2007-12.log >> cpp-downloads.log
+./cpp_sca-m1.sh 2008/2008-01.log >> cpp-downloads.log
+./cpp_sca-m1.sh 2008/2008-02.log >> cpp-downloads.log
+./cpp_sca-m1.sh 2008/2008-03.log >> cpp-downloads.log
+./cpp_sca-m1.sh 2008/2008-04.log >> cpp-downloads.log
+./cpp_sca-m1.sh 2008/2008-05.log >> cpp-downloads.log
+
+#process M2 release
+echo "SCA M2 release (nov 03 2006)" >> cpp-downloads.log
+
+# M2 release was released in nov 03 2006
+./cpp_sca-m2.sh 2007/2007-01.log >> cpp-downloads.log
+./cpp_sca-m2.sh 2007/2007-02.log >> cpp-downloads.log
+./cpp_sca-m2.sh 2007/2007-03.log >> cpp-downloads.log
+./cpp_sca-m2.sh 2007/2007-04.log >> cpp-downloads.log
+./cpp_sca-m2.sh 2007/2007-05.log >> cpp-downloads.log
+./cpp_sca-m2.sh 2007/2007-06.log >> cpp-downloads.log
+./cpp_sca-m2.sh 2007/2007-07.log >> cpp-downloads.log
+./cpp_sca-m2.sh 2007/2007-08.log >> cpp-downloads.log
+./cpp_sca-m2.sh 2007/2007-09.log >> cpp-downloads.log
+./cpp_sca-m2.sh 2007/2007-10.log >> cpp-downloads.log
+./cpp_sca-m2.sh 2007/2007-11.log >> cpp-downloads.log
+./cpp_sca-m2.sh 2007/2007-12.log >> cpp-downloads.log
+./cpp_sca-m2.sh 2008/2008-01.log >> cpp-downloads.log
+./cpp_sca-m2.sh 2008/2008-02.log >> cpp-downloads.log
+./cpp_sca-m2.sh 2008/2008-03.log >> cpp-downloads.log
+./cpp_sca-m2.sh 2008/2008-04.log >> cpp-downloads.log
+./cpp_sca-m2.sh 2008/2008-05.log >> cpp-downloads.log
+
+#process M3 release
+echo "SCA M3 release (Apr 30 2007)" >> cpp-downloads.log
+
+# M3 release was released in apr 30 2007
+./cpp_sca-m3.sh 2007/2007-04.log >> cpp-downloads.log
+./cpp_sca-m3.sh 2007/2007-05.log >> cpp-downloads.log
+./cpp_sca-m3.sh 2007/2007-06.log >> cpp-downloads.log
+./cpp_sca-m3.sh 2007/2007-07.log >> cpp-downloads.log
+./cpp_sca-m3.sh 2007/2007-08.log >> cpp-downloads.log
+./cpp_sca-m3.sh 2007/2007-09.log >> cpp-downloads.log
+./cpp_sca-m3.sh 2007/2007-10.log >> cpp-downloads.log
+./cpp_sca-m3.sh 2007/2007-11.log >> cpp-downloads.log
+./cpp_sca-m3.sh 2007/2007-12.log >> cpp-downloads.log
+./cpp_sca-m3.sh 2008/2008-01.log >> cpp-downloads.log
+./cpp_sca-m3.sh 2008/2008-02.log >> cpp-downloads.log
+./cpp_sca-m3.sh 2008/2008-03.log >> cpp-downloads.log
+./cpp_sca-m3.sh 2008/2008-04.log >> cpp-downloads.log
+./cpp_sca-m3.sh 2008/2008-05.log >> cpp-downloads.log
+
+###################
+
+#process M1 release
+echo "SDO M1 release (jul 31 2006)" >> cpp-downloads.log
+
+# M1 release was released in Jul 31 2006
+./cpp_sdo-m1.sh 2007/2007-01.log >> cpp-downloads.log
+./cpp_sdo-m1.sh 2007/2007-02.log >> cpp-downloads.log
+./cpp_sdo-m1.sh 2007/2007-03.log >> cpp-downloads.log
+./cpp_sdo-m1.sh 2007/2007-04.log >> cpp-downloads.log
+./cpp_sdo-m1.sh 2007/2007-05.log >> cpp-downloads.log
+./cpp_sdo-m1.sh 2007/2007-06.log >> cpp-downloads.log
+./cpp_sdo-m1.sh 2007/2007-07.log >> cpp-downloads.log
+./cpp_sdo-m1.sh 2007/2007-08.log >> cpp-downloads.log
+./cpp_sdo-m1.sh 2007/2007-09.log >> cpp-downloads.log
+./cpp_sdo-m1.sh 2007/2007-10.log >> cpp-downloads.log
+./cpp_sdo-m1.sh 2007/2007-11.log >> cpp-downloads.log
+./cpp_sdo-m1.sh 2007/2007-12.log >> cpp-downloads.log
+./cpp_sdo-m1.sh 2008/2008-01.log >> cpp-downloads.log
+./cpp_sdo-m1.sh 2008/2008-02.log >> cpp-downloads.log
+./cpp_sdo-m1.sh 2008/2008-03.log >> cpp-downloads.log
+./cpp_sdo-m1.sh 2008/2008-04.log >> cpp-downloads.log
+./cpp_sdo-m1.sh 2008/2008-05.log >> cpp-downloads.log
+
+#process M2 release
+echo "SDO M2 release (nov 03 2006)" >> cpp-downloads.log
+
+# M2 release was released in nov 03 2006
+./cpp_sdo-m2.sh 2007/2007-01.log >> cpp-downloads.log
+./cpp_sdo-m2.sh 2007/2007-02.log >> cpp-downloads.log
+./cpp_sdo-m2.sh 2007/2007-03.log >> cpp-downloads.log
+./cpp_sdo-m2.sh 2007/2007-04.log >> cpp-downloads.log
+./cpp_sdo-m2.sh 2007/2007-05.log >> cpp-downloads.log
+./cpp_sdo-m2.sh 2007/2007-06.log >> cpp-downloads.log
+./cpp_sdo-m2.sh 2007/2007-07.log >> cpp-downloads.log
+./cpp_sdo-m2.sh 2007/2007-08.log >> cpp-downloads.log
+./cpp_sdo-m2.sh 2007/2007-09.log >> cpp-downloads.log
+./cpp_sdo-m2.sh 2007/2007-10.log >> cpp-downloads.log
+./cpp_sdo-m2.sh 2007/2007-11.log >> cpp-downloads.log
+./cpp_sdo-m2.sh 2007/2007-12.log >> cpp-downloads.log
+./cpp_sdo-m2.sh 2008/2008-01.log >> cpp-downloads.log
+./cpp_sdo-m2.sh 2008/2008-02.log >> cpp-downloads.log
+./cpp_sdo-m2.sh 2008/2008-03.log >> cpp-downloads.log
+./cpp_sdo-m2.sh 2008/2008-04.log >> cpp-downloads.log
+./cpp_sdo-m2.sh 2008/2008-05.log >> cpp-downloads.log
+
+#process M3 release
+echo "SDO M3 release (Apr 30 2007)" >> cpp-downloads.log
+
+# M3 release was released in apr 30 2006
+./cpp_sdo-m3.sh 2007/2007-04.log >> cpp-downloads.log
+./cpp_sdo-m3.sh 2007/2007-05.log >> cpp-downloads.log
+./cpp_sdo-m3.sh 2007/2007-06.log >> cpp-downloads.log
+./cpp_sdo-m3.sh 2007/2007-07.log >> cpp-downloads.log
+./cpp_sdo-m3.sh 2007/2007-08.log >> cpp-downloads.log
+./cpp_sdo-m3.sh 2007/2007-09.log >> cpp-downloads.log
+./cpp_sdo-m3.sh 2007/2007-10.log >> cpp-downloads.log
+./cpp_sdo-m3.sh 2007/2007-11.log >> cpp-downloads.log
+./cpp_sdo-m3.sh 2007/2007-12.log >> cpp-downloads.log
+./cpp_sdo-m3.sh 2008/2008-01.log >> cpp-downloads.log
+./cpp_sdo-m3.sh 2008/2008-02.log >> cpp-downloads.log
+./cpp_sdo-m3.sh 2008/2008-03.log >> cpp-downloads.log
+./cpp_sdo-m3.sh 2008/2008-04.log >> cpp-downloads.log
+./cpp_sdo-m3.sh 2008/2008-05.log >> cpp-downloads.log
diff --git a/sandbox/lresende/etc/download-script/cpp_sca-m1.sh b/sandbox/lresende/etc/download-script/cpp_sca-m1.sh
new file mode 100755
index 0000000000..28ebd053bc
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/cpp_sca-m1.sh
@@ -0,0 +1,2 @@
+total=$(cat $1 | grep cpp/incubating-M1/ | grep _sca_ | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
diff --git a/sandbox/lresende/etc/download-script/cpp_sca-m2.sh b/sandbox/lresende/etc/download-script/cpp_sca-m2.sh
new file mode 100755
index 0000000000..636bc50979
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/cpp_sca-m2.sh
@@ -0,0 +1,2 @@
+total=$(cat $1 | grep cpp/1.0-incubator-M2/ | grep _sca_ | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
diff --git a/sandbox/lresende/etc/download-script/cpp_sca-m3.sh b/sandbox/lresende/etc/download-script/cpp_sca-m3.sh
new file mode 100755
index 0000000000..8cf4c36f37
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/cpp_sca-m3.sh
@@ -0,0 +1,2 @@
+total=$(cat $1 | grep cpp/1.0-incubator-M3/ | grep _sca_ | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
diff --git a/sandbox/lresende/etc/download-script/cpp_sdo-m1.sh b/sandbox/lresende/etc/download-script/cpp_sdo-m1.sh
new file mode 100755
index 0000000000..b3f1e35071
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/cpp_sdo-m1.sh
@@ -0,0 +1,2 @@
+total=$(cat $1 | grep cpp/incubating-M1/ | grep _sdo_ | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
diff --git a/sandbox/lresende/etc/download-script/cpp_sdo-m2.sh b/sandbox/lresende/etc/download-script/cpp_sdo-m2.sh
new file mode 100755
index 0000000000..9225aa4f70
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/cpp_sdo-m2.sh
@@ -0,0 +1,2 @@
+total=$(cat $1 | grep cpp/1.0-incubator-M2/ | grep _sdo_ | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
diff --git a/sandbox/lresende/etc/download-script/cpp_sdo-m3.sh b/sandbox/lresende/etc/download-script/cpp_sdo-m3.sh
new file mode 100755
index 0000000000..d84a6421da
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/cpp_sdo-m3.sh
@@ -0,0 +1,2 @@
+total=$(cat $1 | grep cpp/1.0-incubator-M3/ | grep _sdo_ | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
diff --git a/sandbox/lresende/etc/download-script/das-beta1.sh b/sandbox/lresende/etc/download-script/das-beta1.sh
new file mode 100755
index 0000000000..18ce972f6d
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/das-beta1.sh
@@ -0,0 +1,2 @@
+total=$(cat $1 | grep tuscany-das-1.0-incubating-beta1 | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
diff --git a/sandbox/lresende/etc/download-script/das-beta2.sh b/sandbox/lresende/etc/download-script/das-beta2.sh
new file mode 100755
index 0000000000..31cfbb0e2a
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/das-beta2.sh
@@ -0,0 +1,2 @@
+total=$(cat $1 | grep tuscany-das-1.0-incubating-beta2 | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
diff --git a/sandbox/lresende/etc/download-script/das-m2.sh b/sandbox/lresende/etc/download-script/das-m2.sh
new file mode 100755
index 0000000000..1835303680
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/das-m2.sh
@@ -0,0 +1,2 @@
+total=$(cat $1 | grep dist/incubator/tuscany/java/das/1.0-incubator-M2 | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
diff --git a/sandbox/lresende/etc/download-script/das-report.sh b/sandbox/lresende/etc/download-script/das-report.sh
new file mode 100755
index 0000000000..0d12881a61
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/das-report.sh
@@ -0,0 +1,52 @@
+#clean the file
+echo "" > das-downloads.log
+
+#process M2 release
+echo "DAS M2 release (nov 20 2006)" >> das-downloads.log
+
+# M2 release was released in Nov 20 2006
+./das-m2.sh 2007/2007-01.log >> das-downloads.log
+./das-m2.sh 2007/2007-02.log >> das-downloads.log
+./das-m2.sh 2007/2007-03.log >> das-downloads.log
+./das-m2.sh 2007/2007-04.log >> das-downloads.log
+./das-m2.sh 2007/2007-05.log >> das-downloads.log
+./das-m2.sh 2007/2007-06.log >> das-downloads.log
+./das-m2.sh 2007/2007-07.log >> das-downloads.log
+./das-m2.sh 2007/2007-08.log >> das-downloads.log
+./das-m2.sh 2007/2007-09.log >> das-downloads.log
+./das-m2.sh 2007/2007-10.log >> das-downloads.log
+./das-m2.sh 2007/2007-11.log >> das-downloads.log
+./das-m2.sh 2007/2007-12.log >> das-downloads.log
+./das-m2.sh 2008/2008-01.log >> das-downloads.log
+./das-m2.sh 2008/2008-02.log >> das-downloads.log
+./das-m2.sh 2008/2008-03.log >> das-downloads.log
+./das-m2.sh 2008/2008-04.log >> das-downloads.log
+./das-m2.sh 2008/2008-05.log >> das-downloads.log
+
+#process beta1 release
+echo "DAS Beta1 release (aug 21 2007)" >> das-downloads.log
+
+# Beta1 release was released in August 21 2007
+./das-beta1.sh 2007/2007-08.log >> das-downloads.log
+./das-beta1.sh 2007/2007-09.log >> das-downloads.log
+./das-beta1.sh 2007/2007-10.log >> das-downloads.log
+./das-beta1.sh 2007/2007-11.log >> das-downloads.log
+./das-beta1.sh 2007/2007-12.log >> das-downloads.log
+./das-beta1.sh 2008/2008-01.log >> das-downloads.log
+./das-beta1.sh 2008/2008-02.log >> das-downloads.log
+./das-beta1.sh 2008/2008-03.log >> das-downloads.log
+./das-beta1.sh 2008/2008-04.log >> das-downloads.log
+./das-beta1.sh 2008/2008-05.log >> das-downloads.log
+
+#process beta2 release
+echo "DAS Beta2 release (Oct 07 2007)" >> das-downloads.log
+
+# Beta2 release was released in October 07 21 2007
+./das-beta2.sh 2007/2007-10.log >> das-downloads.log
+./das-beta2.sh 2007/2007-11.log >> das-downloads.log
+./das-beta2.sh 2007/2007-12.log >> das-downloads.log
+./das-beta2.sh 2008/2008-01.log >> das-downloads.log
+./das-beta2.sh 2008/2008-02.log >> das-downloads.log
+./das-beta2.sh 2008/2008-03.log >> das-downloads.log
+./das-beta2.sh 2008/2008-04.log >> das-downloads.log
+./das-beta2.sh 2008/2008-05.log >> das-downloads.log
diff --git a/sandbox/lresende/etc/download-script/sca-090.sh b/sandbox/lresende/etc/download-script/sca-090.sh
new file mode 100755
index 0000000000..b286ba3616
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/sca-090.sh
@@ -0,0 +1,2 @@
+total=$(cat $1 | grep apache-tuscany-sca-0.90-incubating | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
diff --git a/sandbox/lresende/etc/download-script/sca-091.sh b/sandbox/lresende/etc/download-script/sca-091.sh
new file mode 100755
index 0000000000..988b2c0a64
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/sca-091.sh
@@ -0,0 +1,2 @@
+total=$(cat $1 | grep apache-tuscany-sca-0.91-incubating | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
diff --git a/sandbox/lresende/etc/download-script/sca-099.sh b/sandbox/lresende/etc/download-script/sca-099.sh
new file mode 100755
index 0000000000..327e73d5d1
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/sca-099.sh
@@ -0,0 +1,2 @@
+total=$(cat $1 | grep apache-tuscany-sca-0.99-incubating | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
diff --git a/sandbox/lresende/etc/download-script/sca-100.sh b/sandbox/lresende/etc/download-script/sca-100.sh
new file mode 100644
index 0000000000..b2d66e31b6
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/sca-100.sh
@@ -0,0 +1,2 @@
+total=$(cat $1 | grep apache-tuscany-sca-1.0-incubating | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
diff --git a/sandbox/lresende/etc/download-script/sca-101.sh b/sandbox/lresende/etc/download-script/sca-101.sh
new file mode 100755
index 0000000000..20d1c8d5df
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/sca-101.sh
@@ -0,0 +1,2 @@
+total=$(cat $1 | grep apache-tuscany-sca-1.0.1-incubating | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
diff --git a/sandbox/lresende/etc/download-script/sca-11.sh b/sandbox/lresende/etc/download-script/sca-11.sh
new file mode 100755
index 0000000000..bb0d2a841b
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/sca-11.sh
@@ -0,0 +1,2 @@
+total=$(cat $1 | grep apache-tuscany-sca-1.1-incubating | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
diff --git a/sandbox/lresende/etc/download-script/sca-12.sh b/sandbox/lresende/etc/download-script/sca-12.sh
new file mode 100755
index 0000000000..f2cf3cb975
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/sca-12.sh
@@ -0,0 +1,2 @@
+total=$(cat $1 | grep apache-tuscany-sca-1.2-incubating | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
diff --git a/sandbox/lresende/etc/download-script/sca-m2.sh b/sandbox/lresende/etc/download-script/sca-m2.sh
new file mode 100755
index 0000000000..a5287a3246
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/sca-m2.sh
@@ -0,0 +1,2 @@
+total=$(cat $1 | grep /dist/incubator/tuscany/java/sca/1.0-incubator-M2 | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
diff --git a/sandbox/lresende/etc/download-script/sca-report.sh b/sandbox/lresende/etc/download-script/sca-report.sh
new file mode 100755
index 0000000000..e15db7e9fb
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/sca-report.sh
@@ -0,0 +1,110 @@
+#clean the file
+echo "" > sca-downloads.log
+
+# M2 was released in dec 18
+echo "SCA M2 release (dec 18th 2006)" >> sca-downloads.log
+
+# 0.90 release was released in may 31st
+./sca-m2.sh 2007/2007-01.log >> sca-downloads.log
+./sca-m2.sh 2007/2007-02.log >> sca-downloads.log
+./sca-m2.sh 2007/2007-03.log >> sca-downloads.log
+./sca-m2.sh 2007/2007-04.log >> sca-downloads.log
+./sca-m2.sh 2007/2007-05.log >> sca-downloads.log
+./sca-m2.sh 2007/2007-06.log >> sca-downloads.log
+./sca-m2.sh 2007/2007-07.log >> sca-downloads.log
+./sca-m2.sh 2007/2007-08.log >> sca-downloads.log
+./sca-m2.sh 2007/2007-09.log >> sca-downloads.log
+./sca-m2.sh 2007/2007-10.log >> sca-downloads.log
+./sca-m2.sh 2007/2007-11.log >> sca-downloads.log
+./sca-m2.sh 2007/2007-12.log >> sca-downloads.log
+./sca-m2.sh 2008/2008-01.log >> sca-downloads.log
+./sca-m2.sh 2008/2008-02.log >> sca-downloads.log
+./sca-m2.sh 2008/2008-03.log >> sca-downloads.log
+./sca-m2.sh 2008/2008-04.log >> sca-downloads.log
+./sca-m2.sh 2008/2008-05.log >> sca-downloads.log
+
+#process 0.90 release
+echo "SCA 0.90 release (may 31st 2007)" >> sca-downloads.log
+
+# 0.90 release was released in may 31st
+./sca-090.sh 2007/2007-05.log >> sca-downloads.log
+./sca-090.sh 2007/2007-06.log >> sca-downloads.log
+./sca-090.sh 2007/2007-07.log >> sca-downloads.log
+./sca-090.sh 2007/2007-08.log >> sca-downloads.log
+./sca-090.sh 2007/2007-09.log >> sca-downloads.log
+./sca-090.sh 2007/2007-10.log >> sca-downloads.log
+./sca-090.sh 2007/2007-11.log >> sca-downloads.log
+./sca-090.sh 2007/2007-12.log >> sca-downloads.log
+./sca-090.sh 2008/2008-01.log >> sca-downloads.log
+./sca-090.sh 2008/2008-02.log >> sca-downloads.log
+./sca-090.sh 2008/2008-03.log >> sca-downloads.log
+./sca-090.sh 2008/2008-04.log >> sca-downloads.log
+./sca-090.sh 2008/2008-05.log >> sca-downloads.log
+
+#process 0.91 release
+echo "SCA 0.91 release (july 23 2007)" >> sca-downloads.log
+
+# 0.91 release was released in jul 23
+./sca-091.sh 2007/2007-07.log >> sca-downloads.log
+./sca-091.sh 2007/2007-08.log >> sca-downloads.log
+./sca-091.sh 2007/2007-09.log >> sca-downloads.log
+./sca-091.sh 2007/2007-10.log >> sca-downloads.log
+./sca-091.sh 2007/2007-11.log >> sca-downloads.log
+./sca-091.sh 2007/2007-12.log >> sca-downloads.log
+./sca-091.sh 2008/2008-01.log >> sca-downloads.log
+./sca-091.sh 2008/2008-02.log >> sca-downloads.log
+./sca-091.sh 2008/2008-03.log >> sca-downloads.log
+./sca-091.sh 2008/2008-04.log >> sca-downloads.log
+./sca-091.sh 2008/2008-05.log >> sca-downloads.log
+
+#process 0.99 release
+echo "SCA 0.99 release (August 31 2007)" >> sca-downloads.log
+
+# 0.99 release was released in August 31
+./sca-099.sh 2007/2007-08.log >> sca-downloads.log
+./sca-099.sh 2007/2007-09.log >> sca-downloads.log
+./sca-099.sh 2007/2007-10.log >> sca-downloads.log
+./sca-099.sh 2007/2007-11.log >> sca-downloads.log
+./sca-099.sh 2007/2007-12.log >> sca-downloads.log
+./sca-099.sh 2008/2008-01.log >> sca-downloads.log
+./sca-099.sh 2008/2008-02.log >> sca-downloads.log
+./sca-099.sh 2008/2008-03.log >> sca-downloads.log
+./sca-099.sh 2008/2008-04.log >> sca-downloads.log
+./sca-099.sh 2008/2008-05.log >> sca-downloads.log
+
+#process 1.00 release
+echo "SCA 1.00 release (September 24 2007)" >> sca-downloads.log
+
+# 1.00 release was released in September 24
+./sca-100.sh 2007/2007-09.log >> sca-downloads.log
+./sca-100.sh 2007/2007-10.log >> sca-downloads.log
+./sca-100.sh 2007/2007-11.log >> sca-downloads.log
+./sca-100.sh 2007/2007-12.log >> sca-downloads.log
+./sca-100.sh 2008/2008-01.log >> sca-downloads.log
+./sca-100.sh 2008/2008-02.log >> sca-downloads.log
+./sca-100.sh 2008/2008-03.log >> sca-downloads.log
+./sca-100.sh 2008/2008-04.log >> sca-downloads.log
+./sca-100.sh 2008/2008-05.log >> sca-downloads.log
+
+#process 1.0.1 release
+echo "SCA 1.0.1 release (November 19 2007" >> sca-downloads.log
+./sca-101.sh 2007/2007-11.log >> sca-downloads.log
+./sca-101.sh 2007/2007-12.log >> sca-downloads.log
+./sca-101.sh 2008/2008-01.log >> sca-downloads.log
+./sca-101.sh 2008/2008-02.log >> sca-downloads.log
+./sca-101.sh 2008/2008-03.log >> sca-downloads.log
+./sca-101.sh 2008/2008-04.log >> sca-downloads.log
+./sca-101.sh 2008/2008-05.log >> sca-downloads.log
+
+#process 1.1 release
+echo "SCA 1.1 release (February 05 2008" >> sca-downloads.log
+./sca-11.sh 2008/2008-02.log >> sca-downloads.log
+./sca-11.sh 2008/2008-03.log >> sca-downloads.log
+./sca-11.sh 2008/2008-04.log >> sca-downloads.log
+./sca-11.sh 2008/2008-05.log >> sca-downloads.log
+
+
+#process 1.2 release
+echo "SCA 1.2 release (Abril 27 2008" >> sca-downloads.log
+./sca-12.sh 2008/2008-04.log >> sca-downloads.log
+./sca-12.sh 2008/2008-05.log >> sca-downloads.log
diff --git a/sandbox/lresende/etc/download-script/sdo-1.sh b/sandbox/lresende/etc/download-script/sdo-1.sh
new file mode 100755
index 0000000000..e118004918
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/sdo-1.sh
@@ -0,0 +1,2 @@
+total=$(cat $1 | grep dist/incubator/tuscany/java/sdo/1.0-incubating | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
diff --git a/sandbox/lresende/etc/download-script/sdo-beta1.sh b/sandbox/lresende/etc/download-script/sdo-beta1.sh
new file mode 100755
index 0000000000..8e4982c277
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/sdo-beta1.sh
@@ -0,0 +1,2 @@
+total=$(cat $1 | grep dist/incubator/tuscany/java/sdo/1.0-incubating-beta1 | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
diff --git a/sandbox/lresende/etc/download-script/sdo-m2.sh b/sandbox/lresende/etc/download-script/sdo-m2.sh
new file mode 100755
index 0000000000..8f22f80e19
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/sdo-m2.sh
@@ -0,0 +1,2 @@
+total=$(cat $1 | grep dist/incubator/tuscany/java/sdo/1.0-incubator-M2 | awk '{ print $2 }' | uniq | wc -l)
+echo $1 $total
diff --git a/sandbox/lresende/etc/download-script/sdo-report.sh b/sandbox/lresende/etc/download-script/sdo-report.sh
new file mode 100755
index 0000000000..b586015588
--- /dev/null
+++ b/sandbox/lresende/etc/download-script/sdo-report.sh
@@ -0,0 +1,57 @@
+#clean the file
+echo "" > sdo-downloads.log
+
+#process M2 release
+echo "SDO M2 release (nov 15 2006)" >> sdo-downloads.log
+
+# M2 release was released in Nov 15 2006
+./sdo-m2.sh 2007/2007-01.log >> sdo-downloads.log
+./sdo-m2.sh 2007/2007-02.log >> sdo-downloads.log
+./sdo-m2.sh 2007/2007-03.log >> sdo-downloads.log
+./sdo-m2.sh 2007/2007-04.log >> sdo-downloads.log
+./sdo-m2.sh 2007/2007-05.log >> sdo-downloads.log
+./sdo-m2.sh 2007/2007-06.log >> sdo-downloads.log
+./sdo-m2.sh 2007/2007-07.log >> sdo-downloads.log
+./sdo-m2.sh 2007/2007-08.log >> sdo-downloads.log
+./sdo-m2.sh 2007/2007-09.log >> sdo-downloads.log
+./sdo-m2.sh 2007/2007-10.log >> sdo-downloads.log
+./sdo-m2.sh 2007/2007-11.log >> sdo-downloads.log
+./sdo-m2.sh 2007/2007-12.log >> sdo-downloads.log
+./sdo-m2.sh 2008/2008-01.log >> sdo-downloads.log
+./sdo-m2.sh 2008/2008-02.log >> sdo-downloads.log
+./sdo-m2.sh 2008/2008-03.log >> sdo-downloads.log
+./sdo-m2.sh 2008/2008-04.log >> sdo-downloads.log
+./sdo-m2.sh 2008/2008-05.log >> sdo-downloads.log
+
+#process beta1 release
+echo "SDO Beta1 release (may 15 2007)" >> sdo-downloads.log
+
+# Beta1 release was released in may 15
+./sdo-beta1.sh 2007/2007-05.log >> sdo-downloads.log
+./sdo-beta1.sh 2007/2007-06.log >> sdo-downloads.log
+./sdo-beta1.sh 2007/2007-07.log >> sdo-downloads.log
+./sdo-beta1.sh 2007/2007-08.log >> sdo-downloads.log
+./sdo-beta1.sh 2007/2007-09.log >> sdo-downloads.log
+./sdo-beta1.sh 2007/2007-10.log >> sdo-downloads.log
+./sdo-beta1.sh 2007/2007-11.log >> sdo-downloads.log
+./sdo-beta1.sh 2007/2007-12.log >> sdo-downloads.log
+./sdo-beta1.sh 2008/2008-01.log >> sdo-downloads.log
+./sdo-beta1.sh 2008/2008-02.log >> sdo-downloads.log
+./sdo-beta1.sh 2008/2008-03.log >> sdo-downloads.log
+./sdo-beta1.sh 2008/2008-04.log >> sdo-downloads.log
+./sdo-beta1.sh 2008/2008-05.log >> sdo-downloads.log
+
+#process 1.0 release
+echo "SDO 1.0 release (aug 09 2007)" >> sdo-downloads.log
+
+# Beta1 release was released in Aug 09
+./sdo-1.sh 2007/2007-08.log >> sdo-downloads.log
+./sdo-1.sh 2007/2007-09.log >> sdo-downloads.log
+./sdo-1.sh 2007/2007-10.log >> sdo-downloads.log
+./sdo-1.sh 2007/2007-11.log >> sdo-downloads.log
+./sdo-1.sh 2007/2007-12.log >> sdo-downloads.log
+./sdo-1.sh 2008/2008-01.log >> sdo-downloads.log
+./sdo-1.sh 2008/2008-02.log >> sdo-downloads.log
+./sdo-1.sh 2008/2008-03.log >> sdo-downloads.log
+./sdo-1.sh 2008/2008-04.log >> sdo-downloads.log
+./sdo-1.sh 2008/2008-05.log >> sdo-downloads.log
diff --git a/sandbox/lresende/mundo-java/calculadora-passo1/pom.xml b/sandbox/lresende/mundo-java/calculadora-passo1/pom.xml
new file mode 100644
index 0000000000..43823c5df6
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo1/pom.xml
@@ -0,0 +1,65 @@
+<?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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <artifactId>mundo-java-calculadora-passo1</artifactId>
+ <name>Exemplo de uma Simples calculadora</name>
+
+ <repositories>
+ <repository>
+ <id>apache.incubator</id>
+ <url>http://people.apache.org/repo/m2-incubating-repository</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+
+</project>
diff --git a/sandbox/lresende/mundo-java/calculadora-passo1/src/main/java/calculadora/Calculadora.java b/sandbox/lresende/mundo-java/calculadora-passo1/src/main/java/calculadora/Calculadora.java
new file mode 100644
index 0000000000..cf9afc1e5d
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo1/src/main/java/calculadora/Calculadora.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 calculadora;
+
+public interface Calculadora {
+
+ double adicionar(double n1, double n2);
+
+ double subtrair(double n1, double n2);
+
+ double multiplicar(double n1, double n2);
+
+ double dividir(double n1, double n2);
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo1/src/main/java/calculadora/CalculadoraImpl.java b/sandbox/lresende/mundo-java/calculadora-passo1/src/main/java/calculadora/CalculadoraImpl.java
new file mode 100644
index 0000000000..fb3da05b2d
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo1/src/main/java/calculadora/CalculadoraImpl.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package calculadora;
+
+public class CalculadoraImpl implements Calculadora {
+
+ public double adicionar(double n1, double n2) {
+ return n1 + n2;
+ }
+
+ public double dividir(double n1, double n2) {
+ return n1 / n2;
+ }
+
+ public double multiplicar(double n1, double n2) {
+ return n1 * n2;
+ }
+
+ public double subtrair(double n1, double n2) {
+ return n1 - n2;
+ }
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo1/src/main/java/calculadora/Cliente.java b/sandbox/lresende/mundo-java/calculadora-passo1/src/main/java/calculadora/Cliente.java
new file mode 100644
index 0000000000..aa18dedee1
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo1/src/main/java/calculadora/Cliente.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 calculadora;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+/**
+ * This client program shows how to create an SCA runtime, start it, locate the
+ * HelloWorld service and invoke it.
+ */
+public class Cliente {
+
+ public final static void main(String[] args) throws Exception {
+ SCADomain scaDomain = SCADomain.newInstance("calculadora.composite");
+ Calculadora servicoCalculadora =
+ scaDomain.getService(Calculadora.class, "ComponenteCalculadora");
+
+ //Calculate
+ System.out.println("3 + 2=" + servicoCalculadora.adicionar(3, 2));
+ System.out.println("3 - 2=" + servicoCalculadora.subtrair(3, 2));
+ System.out.println("3 * 2=" + servicoCalculadora.multiplicar(3, 2));
+ System.out.println("3 / 2=" + servicoCalculadora.dividir(3, 2));
+
+ scaDomain.close();
+ }
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo1/src/main/resources/calculadora.composite b/sandbox/lresende/mundo-java/calculadora-passo1/src/main/resources/calculadora.composite
new file mode 100644
index 0000000000..ad80062a4b
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo1/src/main/resources/calculadora.composite
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://calculadora"
+ name="calculadora">
+
+ <component name="ComponenteCalculadora">
+ <implementation.java class="calculadora.CalculadoraImpl" />
+ </component>
+</composite>
diff --git a/sandbox/lresende/mundo-java/calculadora-passo2/pom.xml b/sandbox/lresende/mundo-java/calculadora-passo2/pom.xml
new file mode 100644
index 0000000000..56917866ff
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo2/pom.xml
@@ -0,0 +1,65 @@
+<?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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <artifactId>mundo-java-calculadora-passo2</artifactId>
+ <name>Exemplo de uma Calculadora implementada por varios componentes</name>
+
+ <repositories>
+ <repository>
+ <id>apache.incubator</id>
+ <url>http://people.apache.org/repo/m2-incubating-repository</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+
+</project>
diff --git a/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/Calculadora.java b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/Calculadora.java
new file mode 100644
index 0000000000..cf9afc1e5d
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/Calculadora.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 calculadora;
+
+public interface Calculadora {
+
+ double adicionar(double n1, double n2);
+
+ double subtrair(double n1, double n2);
+
+ double multiplicar(double n1, double n2);
+
+ double dividir(double n1, double n2);
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/CalculadoraImpl.java b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/CalculadoraImpl.java
new file mode 100644
index 0000000000..1f7196f4f1
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/CalculadoraImpl.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 calculadora;
+
+import org.osoa.sca.annotations.Reference;
+
+public class CalculadoraImpl implements Calculadora {
+
+ private ServicoAdicionar servicoAdicionar;
+ private ServicoSubtrair servicoSubtrair;
+ private ServicoMultiplicar servicoMultiplicar;
+ private ServicoDividir servicoDividir;
+
+ @Reference
+ public void setServicoAdicionar(ServicoAdicionar servicoAdicionar) {
+ this.servicoAdicionar = servicoAdicionar;
+ }
+
+ @Reference
+ public void setServicoSubtrair(ServicoSubtrair servicoSubtrair) {
+ this.servicoSubtrair = servicoSubtrair;
+ }
+
+ @Reference
+ public void setServicoDividir(ServicoDividir servicoDividir) {
+ this.servicoDividir = servicoDividir;
+ }
+
+ @Reference
+ public void setServicoMultiplicar(ServicoMultiplicar servicoMultiplicar) {
+ this.servicoMultiplicar = servicoMultiplicar;
+ }
+
+ public double adicionar(double n1, double n2) {
+ return this.servicoAdicionar.adicionar(n1 , n2);
+ }
+
+ public double dividir(double n1, double n2) {
+ return this.servicoDividir.dividir(n1, n2);
+ }
+
+ public double multiplicar(double n1, double n2) {
+ return this.servicoMultiplicar.multiplicar(n1, n2);
+ }
+
+ public double subtrair(double n1, double n2) {
+ return this.servicoSubtrair.subtrair(n1, n2);
+ }
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/Cliente.java b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/Cliente.java
new file mode 100644
index 0000000000..aa18dedee1
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/Cliente.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 calculadora;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+/**
+ * This client program shows how to create an SCA runtime, start it, locate the
+ * HelloWorld service and invoke it.
+ */
+public class Cliente {
+
+ public final static void main(String[] args) throws Exception {
+ SCADomain scaDomain = SCADomain.newInstance("calculadora.composite");
+ Calculadora servicoCalculadora =
+ scaDomain.getService(Calculadora.class, "ComponenteCalculadora");
+
+ //Calculate
+ System.out.println("3 + 2=" + servicoCalculadora.adicionar(3, 2));
+ System.out.println("3 - 2=" + servicoCalculadora.subtrair(3, 2));
+ System.out.println("3 * 2=" + servicoCalculadora.multiplicar(3, 2));
+ System.out.println("3 / 2=" + servicoCalculadora.dividir(3, 2));
+
+ scaDomain.close();
+ }
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoAdicionar.java b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoAdicionar.java
new file mode 100644
index 0000000000..623c044411
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoAdicionar.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 calculadora;
+
+public interface ServicoAdicionar {
+ double adicionar(double n1, double n2);
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoAdicionarImpl.java b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoAdicionarImpl.java
new file mode 100644
index 0000000000..8b3ba82d51
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoAdicionarImpl.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 calculadora;
+
+public class ServicoAdicionarImpl implements ServicoAdicionar {
+
+ public double adicionar(double n1, double n2) {
+ return n1 + n2;
+ }
+
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoDividir.java b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoDividir.java
new file mode 100644
index 0000000000..9ca3242606
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoDividir.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 calculadora;
+
+public interface ServicoDividir {
+ double dividir(double n1, double n2);
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoDividirImpl.java b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoDividirImpl.java
new file mode 100644
index 0000000000..af99201610
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoDividirImpl.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 calculadora;
+
+public class ServicoDividirImpl implements ServicoDividir {
+
+ public double dividir(double n1, double n2) {
+ return n1 / n2;
+ }
+
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoMultiplicar.java b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoMultiplicar.java
new file mode 100644
index 0000000000..e0240abc78
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoMultiplicar.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 calculadora;
+
+public interface ServicoMultiplicar {
+ double multiplicar(double n1, double n2);
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoMultiplicarImpl.java b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoMultiplicarImpl.java
new file mode 100644
index 0000000000..db332d72fa
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoMultiplicarImpl.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 calculadora;
+
+public class ServicoMultiplicarImpl implements ServicoMultiplicar {
+
+ public double multiplicar(double n1, double n2) {
+ return n1 * n2;
+ }
+
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoSubtrair.java b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoSubtrair.java
new file mode 100644
index 0000000000..384edc0498
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoSubtrair.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 calculadora;
+
+public interface ServicoSubtrair {
+ double subtrair(double n1, double n2);
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoSubtrairImpl.java b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoSubtrairImpl.java
new file mode 100644
index 0000000000..84d866175a
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/java/calculadora/ServicoSubtrairImpl.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 calculadora;
+
+public class ServicoSubtrairImpl implements ServicoSubtrair {
+
+ public double subtrair(double n1, double n2) {
+ return n1 - n2;
+ }
+
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo2/src/main/resources/calculadora.composite b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/resources/calculadora.composite
new file mode 100644
index 0000000000..2b957b192c
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo2/src/main/resources/calculadora.composite
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://calculadora"
+ name="calculadora">
+
+ <component name="ComponenteCalculadora">
+ <implementation.java class="calculadora.CalculadoraImpl"/>
+
+ <reference name="servicoAdicionar" target="ComponenteAdicionar" />
+ <reference name="servicoSubtrair" target="ComponentSubtrair" />
+ <reference name="servicoMultiplicar" target="ComponentMultiplicar" />
+ <reference name="servicoDividir" target="ComponentDividir" />
+ </component>
+
+ <component name="ComponenteAdicionar">
+ <implementation.java class="calculadora.ServicoAdicionarImpl"/>
+ </component>
+
+ <component name="ComponentSubtrair">
+ <implementation.java class="calculadora.ServicoSubtrairImpl"/>
+ </component>
+
+ <component name="ComponentMultiplicar">
+ <implementation.java class="calculadora.ServicoMultiplicarImpl"/>
+ </component>
+
+ <component name="ComponentDividir">
+ <implementation.java class="calculadora.ServicoDividirImpl"/>
+ </component>
+</composite>
diff --git a/sandbox/lresende/mundo-java/calculadora-passo3/pom.xml b/sandbox/lresende/mundo-java/calculadora-passo3/pom.xml
new file mode 100644
index 0000000000..588cd878d0
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo3/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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <artifactId>mundo-java-calculadora-passo3</artifactId>
+ <name>Exemplo de uma Calculadora implementada por componentes em varias linguagems</name>
+
+ <repositories>
+ <repository>
+ <id>apache.incubator</id>
+ <url>http://people.apache.org/repo/m2-incubating-repository</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-script</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+
+</project>
diff --git a/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/Calculadora.java b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/Calculadora.java
new file mode 100644
index 0000000000..cf9afc1e5d
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/Calculadora.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 calculadora;
+
+public interface Calculadora {
+
+ double adicionar(double n1, double n2);
+
+ double subtrair(double n1, double n2);
+
+ double multiplicar(double n1, double n2);
+
+ double dividir(double n1, double n2);
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/CalculadoraImpl.java b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/CalculadoraImpl.java
new file mode 100644
index 0000000000..2dff940eff
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/CalculadoraImpl.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 calculadora;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+@Service(Calculadora.class)
+public class CalculadoraImpl implements Calculadora {
+
+ private ServicoAdicionar servicoAdicionar;
+ private ServicoSubtrair servicoSubtrair;
+ private ServicoMultiplicar servicoMultiplicar;
+ private ServicoDividir servicoDividir;
+
+ @Reference
+ public void setServicoAdicionar(ServicoAdicionar servicoAdicionar) {
+ this.servicoAdicionar = servicoAdicionar;
+ }
+
+ @Reference
+ public void setServicoSubtrair(ServicoSubtrair servicoSubtrair) {
+ this.servicoSubtrair = servicoSubtrair;
+ }
+
+ @Reference
+ public void setServicoDividir(ServicoDividir servicoDividir) {
+ this.servicoDividir = servicoDividir;
+ }
+
+ @Reference
+ public void setServicoMultiplicar(ServicoMultiplicar servicoMultiplicar) {
+ this.servicoMultiplicar = servicoMultiplicar;
+ }
+
+ public double adicionar(double n1, double n2) {
+ return this.servicoAdicionar.adicionar(n1 , n2);
+ }
+
+ public double dividir(double n1, double n2) {
+ return this.servicoDividir.dividir(n1, n2);
+ }
+
+ public double multiplicar(double n1, double n2) {
+ return this.servicoMultiplicar.multiplicar(n1, n2);
+ }
+
+ public double subtrair(double n1, double n2) {
+ return this.servicoSubtrair.subtrair(n1, n2);
+ }
+
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/Cliente.java b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/Cliente.java
new file mode 100644
index 0000000000..2d98eecf26
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/Cliente.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 calculadora;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+/**
+ * This client program shows how to create an SCA runtime, start it, locate the
+ * HelloWorld service and invoke it.
+ */
+public class Cliente {
+
+ public final static void main(String[] args) throws Exception {
+ SCADomain scaDomain = SCADomain.newInstance("calculadora.composite");
+ Calculadora servicoCalculadora =
+ scaDomain.getService(Calculadora.class, "ComponenteCalculadora/Calculadora");
+
+ //Calculate
+ System.out.println("3 + 2=" + servicoCalculadora.adicionar(3, 2));
+ System.out.println("3 - 2=" + servicoCalculadora.subtrair(3, 2));
+ System.out.println("3 * 2=" + servicoCalculadora.multiplicar(3, 2));
+ System.out.println("3 / 2=" + servicoCalculadora.dividir(3, 2));
+
+ scaDomain.close();
+ }
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/ServicoAdicionar.java b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/ServicoAdicionar.java
new file mode 100644
index 0000000000..623c044411
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/ServicoAdicionar.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 calculadora;
+
+public interface ServicoAdicionar {
+ double adicionar(double n1, double n2);
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/ServicoDividir.java b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/ServicoDividir.java
new file mode 100644
index 0000000000..9ca3242606
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/ServicoDividir.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 calculadora;
+
+public interface ServicoDividir {
+ double dividir(double n1, double n2);
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/ServicoMultiplicar.java b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/ServicoMultiplicar.java
new file mode 100644
index 0000000000..e0240abc78
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/ServicoMultiplicar.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 calculadora;
+
+public interface ServicoMultiplicar {
+ double multiplicar(double n1, double n2);
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/ServicoSubtrair.java b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/ServicoSubtrair.java
new file mode 100644
index 0000000000..384edc0498
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/ServicoSubtrair.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 calculadora;
+
+public interface ServicoSubtrair {
+ double subtrair(double n1, double n2);
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/demo/ServidorCalculadora.java b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/demo/ServidorCalculadora.java
new file mode 100644
index 0000000000..0dd85a516d
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/java/calculadora/demo/ServidorCalculadora.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 calculadora.demo;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+public class ServidorCalculadora {
+
+ public static void main(String[] args) throws Exception {
+
+ System.out.println("Iniciando o exemplo de uma Calculadora em SCA...");
+
+ SCADomain domain = SCADomain.newInstance("calculadora.composite");
+
+ System.out.println("Pressione Enter para sair...");
+ System.in.read();
+
+ domain.close();
+
+ System.out.println("Tchau !!!");
+ System.exit(0);
+ }
+
+}
diff --git a/sandbox/lresende/mundo-java/calculadora-passo3/src/main/resources/calculadora.composite b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/resources/calculadora.composite
new file mode 100644
index 0000000000..1eb402e6ef
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/resources/calculadora.composite
@@ -0,0 +1,55 @@
+<?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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ targetNamespace="http://calculadora"
+ name="calculadora">
+
+
+ <component name="ComponenteCalculadora">
+ <service name="Calculadora">
+ <!-- tuscany:binding.rmi host="localhost" port="8099" serviceName="ServicoCalculadoraRMI"/ -->
+ <binding.sca/>
+ </service>
+
+ <implementation.java class="calculadora.CalculadoraImpl"/>
+
+ <reference name="servicoAdicionar" target="ComponenteAdicionar" />
+ <reference name="servicoSubtrair" target="ComponentSubtrair" />
+ <reference name="servicoMultiplicar" target="ComponentMultiplicar" />
+ <reference name="servicoDividir" target="ComponentDividir" />
+ </component>
+
+ <component name="ComponenteAdicionar">
+ <tuscany:implementation.script script="calculadora/ServicoAdicionarImpl.js"/>
+ </component>
+
+ <component name="ComponentSubtrair">
+ <tuscany:implementation.script script="calculadora/ServicoSubtrairImpl.rb"/>
+ </component>
+
+ <component name="ComponentMultiplicar">
+ <tuscany:implementation.script script="calculadora/ServicoMultiplicarImpl.py"/>
+ </component>
+
+ <component name="ComponentDividir">
+ <tuscany:implementation.script script="calculadora/ServicoDividirImpl.groovy"/>
+ </component>
+</composite>
diff --git a/sandbox/lresende/mundo-java/calculadora-passo3/src/main/resources/calculadora/ServicoAdicionarImpl.js b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/resources/calculadora/ServicoAdicionarImpl.js
new file mode 100644
index 0000000000..e66d4d9236
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/resources/calculadora/ServicoAdicionarImpl.js
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+function adicionar(n1, n2) {
+ return n1 + n2;
+} \ No newline at end of file
diff --git a/sandbox/lresende/mundo-java/calculadora-passo3/src/main/resources/calculadora/ServicoDividirImpl.groovy b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/resources/calculadora/ServicoDividirImpl.groovy
new file mode 100644
index 0000000000..ad54eda832
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/resources/calculadora/ServicoDividirImpl.groovy
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+def dividir(n1, n2) {
+ return n1 / n2
+} \ No newline at end of file
diff --git a/sandbox/lresende/mundo-java/calculadora-passo3/src/main/resources/calculadora/ServicoMultiplicarImpl.py b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/resources/calculadora/ServicoMultiplicarImpl.py
new file mode 100644
index 0000000000..c6a906f741
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/resources/calculadora/ServicoMultiplicarImpl.py
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+def multiplicar(n1, n2):
+ return n1 * n2 \ No newline at end of file
diff --git a/sandbox/lresende/mundo-java/calculadora-passo3/src/main/resources/calculadora/ServicoSubtrairImpl.rb b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/resources/calculadora/ServicoSubtrairImpl.rb
new file mode 100644
index 0000000000..a696d0ecb2
--- /dev/null
+++ b/sandbox/lresende/mundo-java/calculadora-passo3/src/main/resources/calculadora/ServicoSubtrairImpl.rb
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+def subtrair(n1, n2)
+ return n1 - n2
+end \ No newline at end of file
diff --git a/sandbox/lresende/mundo-java/pom.xml b/sandbox/lresende/mundo-java/pom.xml
new file mode 100644
index 0000000000..98141bae53
--- /dev/null
+++ b/sandbox/lresende/mundo-java/pom.xml
@@ -0,0 +1,47 @@
+<?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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <artifactId>mundo-java</artifactId>
+ <packaging>pom</packaging>
+ <name>Exemplos para o artigo sobre SCA na revista Mundo Java</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>calculadora-passo1</module>
+ <module>calculadora-passo2</module>
+ <module>calculadora-passo3</module>
+ </modules>
+ </profile>
+
+ </profiles>
+
+</project>
diff --git a/sandbox/lresende/pom.xml b/sandbox/lresende/pom.xml
new file mode 100644
index 0000000000..16f9d19365
--- /dev/null
+++ b/sandbox/lresende/pom.xml
@@ -0,0 +1,114 @@
+<?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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany</groupId>
+ <artifactId>parent</artifactId>
+ <version>2-incubator-SNAPSHOT</version>
+ </parent>
+ <groupId>sandbox</groupId>
+ <artifactId>lresende</artifactId>
+ <packaging>pom</packaging>
+ <name>Tuscany Sanbox</name>
+ <version>1.0-incubator-SNAPSHOT</version>
+
+ <modules>
+ </modules>
+
+ <!-- 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>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-impl</artifactId>
+ <version>1.0-incubator-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+
+ <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-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/*TestCase.java</include>
+ </includes>
+ <reportFormat>brief</reportFormat>
+ <useFile>false</useFile>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sandbox/lresende/sca/demos/customer-map/DISCLAIMER b/sandbox/lresende/sca/demos/customer-map/DISCLAIMER
new file mode 100644
index 0000000000..d68a410903
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/DISCLAIMER
@@ -0,0 +1,8 @@
+Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+
diff --git a/sandbox/lresende/sca/demos/customer-map/LICENSE b/sandbox/lresende/sca/demos/customer-map/LICENSE
new file mode 100644
index 0000000000..8aa906c321
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/LICENSE
@@ -0,0 +1,205 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+
diff --git a/sandbox/lresende/sca/demos/customer-map/NOTICE b/sandbox/lresende/sca/demos/customer-map/NOTICE
new file mode 100644
index 0000000000..94481d6cfa
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/NOTICE
@@ -0,0 +1,6 @@
+${pom.name}
+Copyright (c) 2005 - 2007 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/sandbox/lresende/sca/demos/customer-map/customer-maps.sql b/sandbox/lresende/sca/demos/customer-map/customer-maps.sql
new file mode 100644
index 0000000000..c57678c5d0
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/customer-maps.sql
@@ -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.
+--
+
+DROP TABLE CUSTOMER;
+
+CREATE TABLE CUSTOMER (ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY ,
+ NAME VARCHAR(30),
+ ADDRESS VARCHAR(30),
+ CITY VARCHAR(20),
+ STATE VARCHAR(2),
+ LATITUDE VARCHAR(20),
+ LONGITUDE VARCHAR(30) ) \ No newline at end of file
diff --git a/sandbox/lresende/sca/demos/customer-map/pom.xml b/sandbox/lresende/sca/demos/customer-map/pom.xml
new file mode 100644
index 0000000000..501cbfec3e
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/pom.xml
@@ -0,0 +1,171 @@
+<?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 xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-demos</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>demo-customer-map</artifactId>
+ <name>Apache Tuscany Customer Map Demo</name>
+ <url>http://cwiki.apache.org/TUSCANY</url>
+
+ <repositories>
+ <repository>
+ <id>apache.incubator</id>
+ <url>http://people.apache.org/repo/m2-incubating-repository</url>
+ </repository>
+ </repositories>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-resource</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-feed</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jsonrpc</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-http</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-json</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-sdo</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- DAS Related dependencies -->
+ <dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-impl</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-das</artifactId>
+ <version>1.1-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.1.2.1</version>
+ </dependency>
+
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>httpunit</groupId>
+ <artifactId>httpunit</artifactId>
+ <version>1.6.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>demo-customer-map</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-plugin</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>customer</id>
+ <configuration>
+ <schemaFile>${basedir}/src/main/resources/customer.xsd
+ </schemaFile>
+ <noUnsettable>true</noUnsettable>
+ </configuration>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project> \ No newline at end of file
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/java/customer/CustomerService.java b/sandbox/lresende/sca/demos/customer-map/src/main/java/customer/CustomerService.java
new file mode 100644
index 0000000000..5a99f0bc77
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/java/customer/CustomerService.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 customer;
+
+import org.osoa.sca.annotations.Remotable;
+
+import commonj.sdo.DataObject;
+
+/**
+ *
+ * @version $Rev$ $Date$
+ */
+@Remotable
+public interface CustomerService {
+
+ public DataObject getCustomers();
+
+}
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/java/launch/Launch.java b/sandbox/lresende/sca/demos/customer-map/src/main/java/launch/Launch.java
new file mode 100644
index 0000000000..2bbb40c6a5
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/java/launch/Launch.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package launch;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+public class Launch {
+ public static void main(String[] args) throws Exception {
+ System.out.println("Starting ...");
+ SCADomain scaDomain = SCADomain.newInstance("customer-map.composite");
+ System.out.println("customer-map.composite ready for big business !!!");
+ System.in.read();
+ System.out.println("Stopping ...");
+ scaDomain.close();
+ System.out.println();
+ }
+}
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/customer-map.composite b/sandbox/lresende/sca/demos/customer-map/src/main/resources/customer-map.composite
new file mode 100644
index 0000000000..f7c979687d
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/customer-map.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"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ targetNamespace="http://demo/customer-map"
+ name="customer">
+
+ <component name="customer-map">
+ <tuscany:implementation.resource location="html"/>
+ <service name="Resource">
+ <tuscany:binding.http uri="http://localhost:8080/customer-map"/>
+ </service>
+ </component>
+
+ <component name="CustomerServiceComponent">
+ <tuscany:implementation.das config="customer.xml" dataAccessType="rdb">
+ <tuscany:connectionInfo>
+ <tuscany:connectionProperties
+ driverClass="org.apache.derby.jdbc.EmbeddedDriver"
+ databaseURL="jdbc:derby:target/classes/dastest; create = true"
+ loginTimeout="600000" />
+ </tuscany:connectionInfo>
+ </tuscany:implementation.das>
+ </component>
+</composite> \ No newline at end of file
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/customer.componentType b/sandbox/lresende/sca/demos/customer-map/src/main/resources/customer.componentType
new file mode 100644
index 0000000000..bf56a3f4e9
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/customer.componentType
@@ -0,0 +1,31 @@
+<?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.
+-->
+<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <service name="CustomerService">
+ <interface.java interface="customer.CustomerService"/>
+ <tuscany:binding.jsonrpc/>
+ </service>
+
+</componentType> \ No newline at end of file
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/customer.xml b/sandbox/lresende/sca/demos/customer-map/src/main/resources/customer.xml
new file mode 100644
index 0000000000..17d5da9cd6
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/customer.xml
@@ -0,0 +1,27 @@
+<?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.
+ -->
+<Config xmlns="http:///org.apache.tuscany.das.rdb/config.xsd">
+
+ <Command name="getCustomers" SQL="select * from CUSTOMER" kind="Select"/>
+
+ <Table tableName="CUSTOMER" typeName="Customer">
+ <Column columnName="ID" primaryKey="true" generated="true"/>
+ </Table>
+</Config>
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/customer.xsd b/sandbox/lresende/sca/demos/customer-map/src/main/resources/customer.xsd
new file mode 100644
index 0000000000..f00d0ec56a
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/customer.xsd
@@ -0,0 +1,35 @@
+<?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.
+ -->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:this="http:///org.apache.tuscany.das.rdb.test/customer.xsd"
+ targetNamespace="http:///org.apache.tuscany.das.rdb.test/customer.xsd">
+
+ <xsd:complexType name="Customer">
+ <xsd:sequence>
+ <xsd:element name="ID" nillable="false" type="xsd:int"/>
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="address" type="xsd:string"/>
+ <xsd:element name="city" type="xsd:string"/>
+ <xsd:element name="state" type="xsd:string"/>
+ <xsd:element name="latitude" type="xsd:string"/>
+ <xsd:element name="longitude" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+</xsd:schema>
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/db.lck b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/db.lck
new file mode 100644
index 0000000000..6b9b2452e0
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/db.lck
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/log/log.ctrl b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/log/log.ctrl
new file mode 100644
index 0000000000..4238225f1f
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/log/log.ctrl
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/log/log1.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/log/log1.dat
new file mode 100644
index 0000000000..e9eb981c16
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/log/log1.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/log/logmirror.ctrl b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/log/logmirror.ctrl
new file mode 100644
index 0000000000..4238225f1f
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/log/logmirror.ctrl
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c10.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c10.dat
new file mode 100644
index 0000000000..27e2ac866e
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c10.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c101.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c101.dat
new file mode 100644
index 0000000000..fc4340b2e7
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c101.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c111.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c111.dat
new file mode 100644
index 0000000000..750dffff3f
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c111.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c121.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c121.dat
new file mode 100644
index 0000000000..0d0b53b30e
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c121.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c130.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c130.dat
new file mode 100644
index 0000000000..65f1689e47
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c130.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c141.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c141.dat
new file mode 100644
index 0000000000..5b509fb668
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c141.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c150.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c150.dat
new file mode 100644
index 0000000000..d985c31be4
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c150.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c161.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c161.dat
new file mode 100644
index 0000000000..d3af4852f2
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c161.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c171.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c171.dat
new file mode 100644
index 0000000000..731d9e87fb
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c171.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c180.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c180.dat
new file mode 100644
index 0000000000..82298723d7
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c180.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c191.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c191.dat
new file mode 100644
index 0000000000..b2d149a0f3
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c191.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1a1.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1a1.dat
new file mode 100644
index 0000000000..5001ad3d63
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1a1.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1b1.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1b1.dat
new file mode 100644
index 0000000000..b3a539d635
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1b1.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1c0.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1c0.dat
new file mode 100644
index 0000000000..359525a31a
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1c0.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1d1.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1d1.dat
new file mode 100644
index 0000000000..9f257df932
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1d1.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1e0.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1e0.dat
new file mode 100644
index 0000000000..e43e52fb7f
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1e0.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1f1.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1f1.dat
new file mode 100644
index 0000000000..7e6ee3b1e0
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1f1.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c20.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c20.dat
new file mode 100644
index 0000000000..2b9a6b96d4
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c20.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c200.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c200.dat
new file mode 100644
index 0000000000..cae919d022
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c200.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c211.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c211.dat
new file mode 100644
index 0000000000..c7e311b00e
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c211.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c221.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c221.dat
new file mode 100644
index 0000000000..28e89367ce
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c221.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c230.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c230.dat
new file mode 100644
index 0000000000..c8aca2ee6f
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c230.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c241.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c241.dat
new file mode 100644
index 0000000000..3478bc897d
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c241.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c251.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c251.dat
new file mode 100644
index 0000000000..d3d6adf4fb
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c251.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c260.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c260.dat
new file mode 100644
index 0000000000..8d7333df7d
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c260.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c271.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c271.dat
new file mode 100644
index 0000000000..af722f7d73
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c271.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c281.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c281.dat
new file mode 100644
index 0000000000..3972983c2e
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c281.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c290.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c290.dat
new file mode 100644
index 0000000000..31577b8124
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c290.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2a1.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2a1.dat
new file mode 100644
index 0000000000..0f700d13a7
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2a1.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2b1.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2b1.dat
new file mode 100644
index 0000000000..1d6382fb3d
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2b1.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2c1.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2c1.dat
new file mode 100644
index 0000000000..3bc60d886b
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2c1.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2d0.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2d0.dat
new file mode 100644
index 0000000000..c542d3c91c
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2d0.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2e1.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2e1.dat
new file mode 100644
index 0000000000..16abd20b5f
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2e1.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2f0.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2f0.dat
new file mode 100644
index 0000000000..eb26be5932
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2f0.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c300.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c300.dat
new file mode 100644
index 0000000000..35a164db8a
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c300.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c31.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c31.dat
new file mode 100644
index 0000000000..44f7fa784d
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c31.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c311.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c311.dat
new file mode 100644
index 0000000000..85c095cadb
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c311.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c41.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c41.dat
new file mode 100644
index 0000000000..519f1a49be
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c41.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c51.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c51.dat
new file mode 100644
index 0000000000..452a28db9b
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c51.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c60.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c60.dat
new file mode 100644
index 0000000000..94c357868f
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c60.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c71.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c71.dat
new file mode 100644
index 0000000000..9ca2ca97d1
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c71.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c81.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c81.dat
new file mode 100644
index 0000000000..85bc9c8351
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c81.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c90.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c90.dat
new file mode 100644
index 0000000000..14e77ef636
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c90.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/ca1.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/ca1.dat
new file mode 100644
index 0000000000..624ae61a85
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/ca1.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cb1.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cb1.dat
new file mode 100644
index 0000000000..97e6f19260
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cb1.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cc0.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cc0.dat
new file mode 100644
index 0000000000..5126021a83
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cc0.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cd1.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cd1.dat
new file mode 100644
index 0000000000..2e135b64ab
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cd1.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/ce1.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/ce1.dat
new file mode 100644
index 0000000000..076423c10a
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/ce1.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cf0.dat b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cf0.dat
new file mode 100644
index 0000000000..bfae1c8b85
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cf0.dat
Binary files differ
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/service.properties b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/service.properties
new file mode 100644
index 0000000000..997a33e4db
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/service.properties
@@ -0,0 +1,22 @@
+#D:\dev\Opensource\Apache\Tuscany\source\java\sca\demos\google-maps\src\main\resources\dastest
+# ********************************************************************
+# *** Please do NOT edit this file. ***
+# *** CHANGING THE CONTENT OF THIS FILE MAY CAUSE DATA CORRUPTION. ***
+# ********************************************************************
+#Wed Aug 29 13:46:31 PDT 2007
+SysschemasIndex2Identifier=225
+SyscolumnsIdentifier=144
+SysconglomeratesIndex1Identifier=49
+SysconglomeratesIdentifier=32
+SyscolumnsIndex2Identifier=177
+SysschemasIndex1Identifier=209
+SysconglomeratesIndex3Identifier=81
+SystablesIndex2Identifier=129
+SyscolumnsIndex1Identifier=161
+derby.serviceProtocol=org.apache.derby.database.Database
+SysschemasIdentifier=192
+derby.storage.propertiesId=16
+SysconglomeratesIndex2Identifier=65
+derby.serviceLocale=en_US
+SystablesIdentifier=96
+SystablesIndex1Identifier=113 \ No newline at end of file
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/html/binding-atom.js b/sandbox/lresende/sca/demos/customer-map/src/main/resources/html/binding-atom.js
new file mode 100644
index 0000000000..aacf864f14
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/html/binding-atom.js
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+function AtomClient(uri) {
+
+ this.uri=uri;
+
+ this.get = function(id, responseFunction) {
+ var xhr = this.createXMLHttpRequest();
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == 4) {
+ if (xhr.status == 200) {
+ if (responseFunction != null) responseFunction(xhr.responseXML);
+ } else {
+ alert("get - Error getting data from the server");
+ }
+ }
+ }
+ xhr.open("GET", uri + id, true);
+ xhr.send(null);
+ }
+ this.post = function (entry, responseFunction) {
+ var xhr = this.createXMLHttpRequest();
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == 4) {
+ if (xhr.status == 201) {
+ if (responseFunction != null) responseFunction(xhr.responseXML);
+ } else {
+ alert("post - Error getting data from the server");
+ }
+ }
+ }
+ xhr.open("POST", uri, true);
+ xhr.setRequestHeader("Content-Type", "application/atom+xml");
+ xhr.send(entry);
+ }
+ this.put = function (id, entry, responseFunction) {
+ var xhr = this.createXMLHttpRequest();
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == 4) {
+ if (xhr.status == 200) {
+ if (responseFunction != null) responseFunction(xhr.responseXML);
+ } else {
+ alert("put - Error getting data from the server");
+ }
+ }
+ }
+ xhr.open("PUT", uri + id, true);
+ xhr.setRequestHeader("Content-Type", "application/atom+xml");
+ xhr.send(entry);
+ }
+ this.delete = function (id, responseFunction) {
+ var xhr = this.createXMLHttpRequest();
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == 4) {
+ if (xhr.status == 200) {
+ if (responseFunction != null) responseFunction();
+ } else {
+ alert("delete - Error getting data from the server");
+ }
+ }
+ }
+ xhr.open("DELETE", uri + id, true);
+ xhr.send(null);
+ }
+
+ this.createXMLHttpRequest = function () {
+ try {return new XMLHttpRequest();} catch(e) {}
+ try {return new ActiveXObject("Msxml2.XMLHTTP");} catch(e) {}
+ try {return new ActiveXObject("Microsoft.XMLHTTP");} catch(e) {}
+ alert("XML http request not supported");
+ return null;
+ }
+}
+
+bindingatom = "loaded"; \ No newline at end of file
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/html/binding-jsonrpc.js b/sandbox/lresende/sca/demos/customer-map/src/main/resources/html/binding-jsonrpc.js
new file mode 100644
index 0000000000..7f4a092f71
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/html/binding-jsonrpc.js
@@ -0,0 +1,494 @@
+/*
+ * JSON-RPC JavaScript client
+ *
+ * $Id: jsonrpc.js,v 1.36.2.3 2006/03/08 15:09:37 mclark Exp $
+ *
+ * Copyright (c) 2003-2004 Jan-Klaas Kollhof
+ * Copyright (c) 2005 Michael Clark, Metaparadigm Pte Ltd
+ *
+ * This code is based on Jan-Klaas' JavaScript o lait library (jsolait).
+ *
+ * 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.
+ *
+ */
+
+/*
+ * Modifications for Apache Tuscany:
+ * - JSONRpcClient_createMethod changed so callback is last arg
+ */
+
+/* escape a character */
+
+escapeJSONChar =
+function escapeJSONChar(c)
+{
+ if(c == "\"" || c == "\\") return "\\" + c;
+ else if (c == "\b") return "\\b";
+ else if (c == "\f") return "\\f";
+ else if (c == "\n") return "\\n";
+ else if (c == "\r") return "\\r";
+ else if (c == "\t") return "\\t";
+ var hex = c.charCodeAt(0).toString(16);
+ if(hex.length == 1) return "\\u000" + hex;
+ else if(hex.length == 2) return "\\u00" + hex;
+ else if(hex.length == 3) return "\\u0" + hex;
+ else return "\\u" + hex;
+};
+
+
+/* encode a string into JSON format */
+
+escapeJSONString =
+function escapeJSONString(s)
+{
+ /* The following should suffice but Safari's regex is b0rken
+ (doesn't support callback substitutions)
+ return "\"" + s.replace(/([^\u0020-\u007f]|[\\\"])/g,
+ escapeJSONChar) + "\"";
+ */
+
+ /* Rather inefficient way to do it */
+ var parts = s.split("");
+ for(var i=0; i < parts.length; i++) {
+ var c =parts[i];
+ if(c == '"' ||
+ c == '\\' ||
+ c.charCodeAt(0) < 32 ||
+ c.charCodeAt(0) >= 128)
+ parts[i] = escapeJSONChar(parts[i]);
+ }
+ return "\"" + parts.join("") + "\"";
+};
+
+
+/* Marshall objects to JSON format */
+
+toJSON = function toJSON(o)
+{
+ if(o == null) {
+ return "null";
+ } else if(o.constructor == String) {
+ return escapeJSONString(o);
+ } else if(o.constructor == Number) {
+ return o.toString();
+ } else if(o.constructor == Boolean) {
+ return o.toString();
+ } else if(o.constructor == Date) {
+ return '{javaClass: "java.util.Date", time: ' + o.valueOf() +'}';
+ } else if(o.constructor == Array) {
+ var v = [];
+ for(var i = 0; i < o.length; i++) v.push(toJSON(o[i]));
+ return "[" + v.join(", ") + "]";
+ } else {
+ var v = [];
+ for(attr in o) {
+ if(o[attr] == null) v.push("\"" + attr + "\": null");
+ else if(typeof o[attr] == "function"); /* skip */
+ else v.push(escapeJSONString(attr) + ": " + toJSON(o[attr]));
+ }
+ return "{" + v.join(", ") + "}";
+ }
+};
+
+
+/* JSONRpcClient constructor */
+
+JSONRpcClient =
+function JSONRpcClient_ctor(serverURL, user, pass, objectID)
+{
+ this.serverURL = serverURL;
+ this.user = user;
+ this.pass = pass;
+ this.objectID = objectID;
+
+ /* Add standard methods */
+ if(this.objectID) {
+ this._addMethods(["listMethods"]);
+ var req = this._makeRequest("listMethods", []);
+ } else {
+ this._addMethods(["system.listMethods"]);
+ var req = this._makeRequest("system.listMethods", []);
+ }
+ var m = this._sendRequest(req);
+ this._addMethods(m);
+};
+
+
+/* JSONRpcCLient.Exception */
+
+JSONRpcClient.Exception =
+function JSONRpcClient_Exception_ctor(code, message, javaStack)
+{
+ this.code = code;
+ var name;
+ if(javaStack) {
+ this.javaStack = javaStack;
+ var m = javaStack.match(/^([^:]*)/);
+ if(m) name = m[0];
+ }
+ if(name) this.name = name;
+ else this.name = "JSONRpcClientException";
+ this.message = message;
+};
+
+JSONRpcClient.Exception.CODE_REMOTE_EXCEPTION = 490;
+JSONRpcClient.Exception.CODE_ERR_CLIENT = 550;
+JSONRpcClient.Exception.CODE_ERR_PARSE = 590;
+JSONRpcClient.Exception.CODE_ERR_NOMETHOD = 591;
+JSONRpcClient.Exception.CODE_ERR_UNMARSHALL = 592;
+JSONRpcClient.Exception.CODE_ERR_MARSHALL = 593;
+
+JSONRpcClient.Exception.prototype = new Error();
+
+JSONRpcClient.Exception.prototype.toString =
+function JSONRpcClient_Exception_toString(code, msg)
+{
+ return this.name + ": " + this.message;
+};
+
+
+/* Default top level exception handler */
+
+JSONRpcClient.default_ex_handler =
+function JSONRpcClient_default_ex_handler(e) { alert(e); };
+
+
+/* Client settable variables */
+
+JSONRpcClient.toplevel_ex_handler = JSONRpcClient.default_ex_handler;
+JSONRpcClient.profile_async = false;
+JSONRpcClient.max_req_active = 1;
+JSONRpcClient.requestId = 1;
+
+
+/* JSONRpcClient implementation */
+
+JSONRpcClient.prototype._createMethod =
+function JSONRpcClient_createMethod(methodName)
+{
+ var fn=function()
+ {
+ var args = [];
+ var callback = null;
+ for(var i=0;i<arguments.length;i++) args.push(arguments[i]);
+
+/* TUSCANY change callback to be last arg instead of first to match binding.ajax
+ if(typeof args[0] == "function") callback = args.shift();
+*/
+ if(typeof args[arguments.length-1] == "function") callback = args.pop();
+
+ var req = fn.client._makeRequest.call(fn.client, fn.methodName,
+ args, callback);
+ if(callback == null) {
+ return fn.client._sendRequest.call(fn.client, req);
+ } else {
+ JSONRpcClient.async_requests.push(req);
+ JSONRpcClient.kick_async();
+ return req.requestId;
+ }
+ };
+ fn.client = this;
+ fn.methodName = methodName;
+ return fn;
+};
+
+JSONRpcClient.prototype._addMethods =
+function JSONRpcClient_addMethods(methodNames)
+{
+ for(var i=0; i<methodNames.length; i++) {
+ var obj = this;
+ var names = methodNames[i].split(".");
+ for(var n=0; n<names.length-1; n++) {
+ var name = names[n];
+ if(obj[name]) {
+ obj = obj[name];
+ } else {
+ obj[name] = new Object();
+ obj = obj[name];
+ }
+ }
+ var name = names[names.length-1];
+ if(!obj[name]) {
+ var method = this._createMethod(methodNames[i]);
+ obj[name] = method;
+ }
+ }
+};
+
+JSONRpcClient._getCharsetFromHeaders =
+function JSONRpcClient_getCharsetFromHeaders(http)
+{
+ try {
+ var contentType = http.getResponseHeader("Content-type");
+ var parts = contentType.split(/\s*;\s*/);
+ for(var i =0; i < parts.length; i++) {
+ if(parts[i].substring(0, 8) == "charset=")
+ return parts[i].substring(8, parts[i].length);
+ }
+ } catch (e) {}
+ return "UTF-8"; /* default */
+};
+
+/* Async queue globals */
+JSONRpcClient.async_requests = [];
+JSONRpcClient.async_inflight = {};
+JSONRpcClient.async_responses = [];
+JSONRpcClient.async_timeout = null;
+JSONRpcClient.num_req_active = 0;
+
+JSONRpcClient._async_handler =
+function JSONRpcClient_async_handler()
+{
+ JSONRpcClient.async_timeout = null;
+
+ while(JSONRpcClient.async_responses.length > 0) {
+ var res = JSONRpcClient.async_responses.shift();
+ if(res.canceled) continue;
+ if(res.profile) res.profile.dispatch = new Date();
+ try {
+ res.cb(res.result, res.ex, res.profile);
+ } catch(e) {
+ JSONRpcClient.toplevel_ex_handler(e);
+ }
+ }
+
+ while(JSONRpcClient.async_requests.length > 0 &&
+ JSONRpcClient.num_req_active < JSONRpcClient.max_req_active) {
+ var req = JSONRpcClient.async_requests.shift();
+ if(req.canceled) continue;
+ req.client._sendRequest.call(req.client, req);
+ }
+};
+
+JSONRpcClient.kick_async =
+function JSONRpcClient_kick_async()
+{
+ if(JSONRpcClient.async_timeout == null)
+ JSONRpcClient.async_timeout =
+ setTimeout(JSONRpcClient._async_handler, 0);
+};
+
+JSONRpcClient.cancelRequest =
+function JSONRpcClient_cancelRequest(requestId)
+{
+ /* If it is in flight then mark it as canceled in the inflight map
+ and the XMLHttpRequest callback will discard the reply. */
+ if(JSONRpcClient.async_inflight[requestId]) {
+ JSONRpcClient.async_inflight[requestId].canceled = true;
+ return true;
+ }
+
+ /* If its not in flight yet then we can just mark it as canceled in
+ the the request queue and it will get discarded before being sent. */
+ for(var i in JSONRpcClient.async_requests) {
+ if(JSONRpcClient.async_requests[i].requestId == requestId) {
+ JSONRpcClient.async_requests[i].canceled = true;
+ return true;
+ }
+ }
+
+ /* It may have returned from the network and be waiting for its callback
+ to be dispatched, so mark it as canceled in the response queue
+ and the response will get discarded before calling the callback. */
+ for(var i in JSONRpcClient.async_responses) {
+ if(JSONRpcClient.async_responses[i].requestId == requestId) {
+ JSONRpcClient.async_responses[i].canceled = true;
+ return true;
+ }
+ }
+
+ return false;
+};
+
+JSONRpcClient.prototype._makeRequest =
+function JSONRpcClient_makeRequest(methodName, args, cb)
+{
+ var req = {};
+ req.client = this;
+ req.requestId = JSONRpcClient.requestId++;
+
+ var obj = {};
+ obj.id = req.requestId;
+ if (this.objectID)
+ obj.method = ".obj#" + this.objectID + "." + methodName;
+ else
+ obj.method = methodName;
+ obj.params = args;
+
+ if (cb) req.cb = cb;
+ if (JSONRpcClient.profile_async)
+ req.profile = { "submit": new Date() };
+ req.data = toJSON(obj);
+
+ return req;
+};
+
+JSONRpcClient.prototype._sendRequest =
+function JSONRpcClient_sendRequest(req)
+{
+ if(req.profile) req.profile.start = new Date();
+
+ /* Get free http object from the pool */
+ var http = JSONRpcClient.poolGetHTTPRequest();
+ JSONRpcClient.num_req_active++;
+
+ /* Send the request */
+ if (typeof(this.user) == "undefined") {
+ http.open("POST", this.serverURL, (req.cb != null));
+ } else {
+ http.open("POST", this.serverURL, (req.cb != null), this.user, this.pass);
+ }
+
+ /* setRequestHeader is missing in Opera 8 Beta */
+ try { http.setRequestHeader("Content-type", "text/plain"); } catch(e) {}
+
+ /* Construct call back if we have one */
+ if(req.cb) {
+ var self = this;
+ http.onreadystatechange = function() {
+ if(http.readyState == 4) {
+ http.onreadystatechange = function () {};
+ var res = { "cb": req.cb, "result": null, "ex": null};
+ if (req.profile) {
+ res.profile = req.profile;
+ res.profile.end = new Date();
+ }
+ try { res.result = self._handleResponse(http); }
+ catch(e) { res.ex = e; }
+ if(!JSONRpcClient.async_inflight[req.requestId].canceled)
+ JSONRpcClient.async_responses.push(res);
+ delete JSONRpcClient.async_inflight[req.requestId];
+ JSONRpcClient.kick_async();
+ }
+ };
+ } else {
+ http.onreadystatechange = function() {};
+ }
+
+ JSONRpcClient.async_inflight[req.requestId] = req;
+
+ try {
+ http.send(req.data);
+ } catch(e) {
+ JSONRpcClient.poolReturnHTTPRequest(http);
+ JSONRpcClient.num_req_active--;
+ throw new JSONRpcClient.Exception
+ (JSONRpcClient.Exception.CODE_ERR_CLIENT, "Connection failed");
+ }
+
+ if(!req.cb) return this._handleResponse(http);
+};
+
+JSONRpcClient.prototype._handleResponse =
+function JSONRpcClient_handleResponse(http)
+{
+ /* Get the charset */
+ if(!this.charset) {
+ this.charset = JSONRpcClient._getCharsetFromHeaders(http);
+ }
+
+ /* Get request results */
+ var status, statusText, data;
+ try {
+ status = http.status;
+ statusText = http.statusText;
+ data = http.responseText;
+ } catch(e) {
+ JSONRpcClient.poolReturnHTTPRequest(http);
+ JSONRpcClient.num_req_active--;
+ JSONRpcClient.kick_async();
+ throw new JSONRpcClient.Exception
+ (JSONRpcClient.Exception.CODE_ERR_CLIENT, "Connection failed");
+ }
+
+ /* Return http object to the pool; */
+ JSONRpcClient.poolReturnHTTPRequest(http);
+ JSONRpcClient.num_req_active--;
+
+ /* Unmarshall the response */
+ if(status != 200) {
+ throw new JSONRpcClient.Exception(status, statusText);
+ }
+ var obj;
+ try {
+ eval("obj = " + data);
+ } catch(e) {
+ throw new JSONRpcClient.Exception(550, "error parsing result");
+ }
+ if(obj.error)
+ throw new JSONRpcClient.Exception(obj.error.code, obj.error.msg,
+ obj.error.trace);
+ var res = obj.result;
+
+ /* Handle CallableProxy */
+ if(res && res.objectID && res.JSONRPCType == "CallableReference")
+ return new JSONRpcClient(this.serverURL, this.user,
+ this.pass, res.objectID);
+
+ return res;
+};
+
+
+/* XMLHttpRequest wrapper code */
+
+/* XMLHttpRequest pool globals */
+JSONRpcClient.http_spare = [];
+JSONRpcClient.http_max_spare = 8;
+
+JSONRpcClient.poolGetHTTPRequest =
+function JSONRpcClient_pool_getHTTPRequest()
+{
+ if(JSONRpcClient.http_spare.length > 0) {
+ return JSONRpcClient.http_spare.pop();
+ }
+ return JSONRpcClient.getHTTPRequest();
+};
+
+JSONRpcClient.poolReturnHTTPRequest =
+function JSONRpcClient_poolReturnHTTPRequest(http)
+{
+ if(JSONRpcClient.http_spare.length >= JSONRpcClient.http_max_spare)
+ delete http;
+ else
+ JSONRpcClient.http_spare.push(http);
+};
+
+JSONRpcClient.msxmlNames = [ "MSXML2.XMLHTTP.5.0",
+ "MSXML2.XMLHTTP.4.0",
+ "MSXML2.XMLHTTP.3.0",
+ "MSXML2.XMLHTTP",
+ "Microsoft.XMLHTTP" ];
+
+JSONRpcClient.getHTTPRequest =
+function JSONRpcClient_getHTTPRequest()
+{
+ /* Mozilla XMLHttpRequest */
+ try {
+ JSONRpcClient.httpObjectName = "XMLHttpRequest";
+ return new XMLHttpRequest();
+ } catch(e) {}
+
+ /* Microsoft MSXML ActiveX */
+ for (var i=0;i < JSONRpcClient.msxmlNames.length; i++) {
+ try {
+ JSONRpcClient.httpObjectName = JSONRpcClient.msxmlNames[i];
+ return new ActiveXObject(JSONRpcClient.msxmlNames[i]);
+ } catch (e) {}
+ }
+
+ /* None found */
+ JSONRpcClient.httpObjectName = null;
+ throw new JSONRpcClient.Exception(0, "Can't create XMLHttpRequest object");
+};
+
+bindingjsonrpc = "loaded"; \ No newline at end of file
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/html/index-plain.html b/sandbox/lresende/sca/demos/customer-map/src/main/resources/html/index-plain.html
new file mode 100644
index 0000000000..0783c3facb
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/html/index-plain.html
@@ -0,0 +1,76 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+ <title>Google Maps JavaScript API Example</title>
+ <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAm88JxNt0WTuRM7JcraL3dBTwM0brOpm-All5BF6PoaKBxRWWERRebL1SxVq4ZL7LvM8MmxNYPufSBA"
+ type="text/javascript"></script>
+ <script type="text/javascript">
+
+ //<![CDATA[
+
+ function load() {
+ if (GBrowserIsCompatible()) {
+ var map = new GMap(document.getElementById("map"));
+ map.addControl(new GLargeMapControl());
+ map.addControl(new GMapTypeControl());
+ map.setCenter(new GLatLng(0,0),0);
+ map.setZoom(1);
+ //map.setCenter(new GLatLng(-15.5833,-56.0833), 13);
+
+ // A function to create the marker and set up the event window
+ function createMarker(point,name,html) {
+ var marker = new GMarker(point);
+ GEvent.addListener(marker, "click", function() {
+ marker.openInfoWindowHtml(html);
+ });
+ return marker;
+ }
+
+ // ================================================================
+ // === JSON handler ===============================================
+ // ================================================================
+ process_it = function(doc) {
+ // === Parse the JSON document ===
+ var jsonData = eval('(' + doc + ')');
+
+ // === Plot the markers ===
+ for (var i=0; i<jsonData.markers.length; i++) {
+ var marker = createMarker(jsonData.markers[i].point, jsonData.markers[i].label, jsonData.markers[i].html);
+ map.addOverlay(marker);
+ }
+ }
+
+ // ================================================================
+ // === Fetch the JSON data file ====
+ GDownloadUrl("map.json", process_it);
+ // ================================================================
+
+
+ }
+ }
+
+ //]]>
+ </script>
+ </head>
+ <body onload="load()" onunload="GUnload()">
+ <div id="map" style="width: 800px; height: 500px"></div>
+ </body>
+</html> \ No newline at end of file
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/html/index.html b/sandbox/lresende/sca/demos/customer-map/src/main/resources/html/index.html
new file mode 100644
index 0000000000..53f637bed2
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/html/index.html
@@ -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.
+-->
+<html>
+<head>
+<title>Customer Mashup</TITLE>
+
+
+<script type="text/javascript" src="binding-jsonrpc.js"></script>
+<script language="JavaScript">
+ //Reference
+ customer = (new JSONRpcClient("http://localhost:8080/CustomerServiceComponent/CustomerService")).CustomerService;
+
+ function getCustomers() {
+ customer.getCustomers(customer_handleResponse);
+ }
+
+ function customer_handleResponse(result) {
+ alert(result["p0:dataObject"].CUSTOMER);
+ alert(result["p0:dataObject"].CUSTOMER.NAME["$"]);
+
+ document.getElementById('result').innerHTML=result;
+ }
+</script>
+
+<link rel="stylesheet" type="text/css" href="style.css" />
+</head>
+
+<body>
+
+<h1>MyCompany.com</h1>
+<div id="customer">
+ <h2>Customer List</h2>
+ <input type="button" value="Submit" onclick="getCustomers()" />
+ <div id="result">None yet.</div>
+ <div id="customer_list" ></div>
+</div>
+
+</body>
+</html>
diff --git a/sandbox/lresende/sca/demos/customer-map/src/main/resources/html/map.json b/sandbox/lresende/sca/demos/customer-map/src/main/resources/html/map.json
new file mode 100644
index 0000000000..a884141a3c
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/main/resources/html/map.json
@@ -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.
+ */
+
+{"markers": [
+ {"country":"Brazil", "city":"Cuiaba", "point":new GLatLng(-15.625702586903822, -56.07351064682007), "html":"My home town","label":"Cuiaba"},
+ {"country":"Brazil", "city":"Chapada dos Guimaraes", "point":new GLatLng(-15.44329, -55.75835), "html":"Chapada, Wonderful landscape and beautiful whaterfalls ","label":"Chapada dos Guimaraes"},
+ {"country":"Brazil", "city":"Pantanal Matogrossense", "point":new GLatLng(-16.223575372658782, -56.631431579589844), "html":"Pantanal and it's amazing biologic diversity","label":"Pantanal Matogrossensse"},
+ {"country":"Brazil", "city":"Rio de Janeiro", "point":new GLatLng(-22.963984709280982, -43.17753553390503), "html":"Wonderful City","label":"Rio de Janeiro"},
+ {"country":"Brazil", "city":"Sao Paulo", "point":new GLatLng(-23.54329433556302, -46.71802997589111), "html":"Sao Paulo","label":"Sao Paulo"},
+ ]
+} \ No newline at end of file
diff --git a/sandbox/lresende/sca/demos/customer-map/src/test/java/customer/CustomerServiceTestCase.java b/sandbox/lresende/sca/demos/customer-map/src/test/java/customer/CustomerServiceTestCase.java
new file mode 100644
index 0000000000..7d289fd62a
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/test/java/customer/CustomerServiceTestCase.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package customer;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+import commonj.sdo.DataObject;
+import customer.CustomerService;
+
+/**
+ * Tests the DAS service
+ */
+public class CustomerServiceTestCase extends TestCase {
+
+ private SCADomain scaDomain;
+ private CustomerService customerService;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @Override
+ protected void setUp() throws Exception {
+ scaDomain = SCADomain.newInstance("customer.composite");
+ customerService = scaDomain.getService(CustomerService.class, "CustomerServiceComponent/CustomerService");
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @Override
+ protected void tearDown() throws Exception {
+ scaDomain.close();
+ }
+
+ public void testGetCustomers() throws Exception {
+ DataObject root = customerService.getCustomers();
+ assertNotNull(root);
+ assertEquals("Luciano Resende", root.getString("CUSTOMER[1]/NAME"));
+ }
+
+
+}
diff --git a/sandbox/lresende/sca/demos/customer-map/src/test/resources/customer.componentType b/sandbox/lresende/sca/demos/customer-map/src/test/resources/customer.componentType
new file mode 100644
index 0000000000..0d1992d597
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/test/resources/customer.componentType
@@ -0,0 +1,29 @@
+<?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.
+-->
+<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <service name="CustomerService">
+ <interface.java interface="customer.CustomerService"/>
+ </service>
+
+</componentType> \ No newline at end of file
diff --git a/sandbox/lresende/sca/demos/customer-map/src/test/resources/customer.composite b/sandbox/lresende/sca/demos/customer-map/src/test/resources/customer.composite
new file mode 100644
index 0000000000..72a692e38b
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/test/resources/customer.composite
@@ -0,0 +1,35 @@
+<?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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ targetNamespace="http://demo/google-maps"
+ name="customer">
+
+ <component name="CustomerServiceComponent">
+ <tuscany:implementation.das config="customer.xml" dataAccessType="rdb">
+ <tuscany:connectionInfo>
+ <tuscany:connectionProperties
+ driverClass="org.apache.derby.jdbc.EmbeddedDriver"
+ databaseURL="jdbc:derby:target/classes/dastest; create = true"
+ loginTimeout="600000" />
+ </tuscany:connectionInfo>
+ </tuscany:implementation.das>
+ </component>
+</composite>
diff --git a/sandbox/lresende/sca/demos/customer-map/src/test/resources/customer.xml b/sandbox/lresende/sca/demos/customer-map/src/test/resources/customer.xml
new file mode 100644
index 0000000000..7b17903540
--- /dev/null
+++ b/sandbox/lresende/sca/demos/customer-map/src/test/resources/customer.xml
@@ -0,0 +1,27 @@
+<?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.
+ -->
+<Config xmlns="http:///org.apache.tuscany.das.rdb/config.xsd">
+
+ <Command name="getCustomers" SQL="select * from CUSTOMER" kind="Select"/>
+
+ <Table tableName="CUSTOMER">
+ <Column columnName="ID" primaryKey="true" generated="true"/>
+ </Table>
+</Config>
diff --git a/sandbox/lresende/sca/modules/contribution-installer/.checkstyle b/sandbox/lresende/sca/modules/contribution-installer/.checkstyle
new file mode 100644
index 0000000000..e3c216986d
--- /dev/null
+++ b/sandbox/lresende/sca/modules/contribution-installer/.checkstyle
@@ -0,0 +1,24 @@
+<?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.
+-->
+<fileset-config file-format-version="1.2.0" simple-config="true">
+ <fileset name="all" enabled="true" check-config-name="Tuscany Checks" local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
diff --git a/sandbox/lresende/sca/modules/contribution-installer/.pmd b/sandbox/lresende/sca/modules/contribution-installer/.pmd
new file mode 100644
index 0000000000..84af2f4d5d
--- /dev/null
+++ b/sandbox/lresende/sca/modules/contribution-installer/.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/sandbox/lresende/sca/modules/contribution-installer/.ruleset b/sandbox/lresende/sca/modules/contribution-installer/.ruleset
new file mode 100644
index 0000000000..a7ff3be272
--- /dev/null
+++ b/sandbox/lresende/sca/modules/contribution-installer/.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/sandbox/lresende/sca/modules/contribution-installer/DISCLAIMER b/sandbox/lresende/sca/modules/contribution-installer/DISCLAIMER
new file mode 100644
index 0000000000..d68a410903
--- /dev/null
+++ b/sandbox/lresende/sca/modules/contribution-installer/DISCLAIMER
@@ -0,0 +1,8 @@
+Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+
diff --git a/sandbox/lresende/sca/modules/contribution-installer/LICENSE.txt b/sandbox/lresende/sca/modules/contribution-installer/LICENSE.txt
new file mode 100644
index 0000000000..5f6ab3e05c
--- /dev/null
+++ b/sandbox/lresende/sca/modules/contribution-installer/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/sandbox/lresende/sca/modules/contribution-installer/NOTICE.txt b/sandbox/lresende/sca/modules/contribution-installer/NOTICE.txt
new file mode 100644
index 0000000000..ecc68a9614
--- /dev/null
+++ b/sandbox/lresende/sca/modules/contribution-installer/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/sandbox/lresende/sca/modules/contribution-installer/pom.xml b/sandbox/lresende/sca/modules/contribution-installer/pom.xml
new file mode 100644
index 0000000000..04fc07fd7d
--- /dev/null
+++ b/sandbox/lresende/sca/modules/contribution-installer/pom.xml
@@ -0,0 +1,77 @@
+<?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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-contribution-installer</artifactId>
+ <name>Apache Tuscany SCA Contribution Service Installer</name>
+
+ <!--
+ This library will typically be added to the application's classpath and so should
+ should have as few dependencies as possible and nothing from the Tuscany runtime.
+ -->
+ <dependencies>
+ <dependency>
+ <groupId>org.osoa</groupId>
+ <artifactId>sca-api</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution-impl</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>org.apache.tuscany.services.contribution.installer.Main</mainClass>
+ <addClasspath>true</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sandbox/lresende/sca/modules/contribution-installer/src/main/java/org/apache/tuscany/contribution/installer/Main.java b/sandbox/lresende/sca/modules/contribution-installer/src/main/java/org/apache/tuscany/contribution/installer/Main.java
new file mode 100644
index 0000000000..dc1b1d7587
--- /dev/null
+++ b/sandbox/lresende/sca/modules/contribution-installer/src/main/java/org/apache/tuscany/contribution/installer/Main.java
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.contribution.installer;
+
+import java.io.File;
+import java.io.InputStream;
+import java.net.URL;
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+
+import org.apache.tuscany.assembly.DefaultAssemblyFactory;
+import org.apache.tuscany.contribution.impl.ContributionFactoryImpl;
+import org.apache.tuscany.contribution.service.ContributionRepository;
+import org.apache.tuscany.contribution.service.ContributionService;
+import org.apache.tuscany.contribution.service.impl.ContributionRepositoryImpl;
+import org.apache.tuscany.contribution.service.impl.ContributionServiceImpl;
+import org.apache.tuscany.contribution.service.util.IOHelper;
+
+/**
+ * Main class for Contribution Services installer. <code>
+ * usage: java [jvm-options] -jar installer.jar <contributionURI> <contribution source>
+ * </code>
+ * where the componentURI identifies the URI that identifies the new contribution and
+ * contribution source is the actual archive with the contribution contents
+ *
+ * @version $Rev: 513906 $ $Date: 2007-03-02 11:38:00 -0800 (Fri, 02 Mar 2007) $
+ */
+public class Main {
+
+ /**
+ * Main method.
+ *
+ * @param args the command line args
+ * @throws Throwable if there are problems launching the runtime or
+ * application
+ */
+ public static void main(String[] args) throws Throwable {
+
+ if (args.length < 2) {
+ usage();
+ throw new AssertionError();
+ }
+
+ String contributionURI = args[0];
+
+ File contributionSource = new File(args[1]);
+ if (!contributionSource.exists()) {
+ System.err.println(getMessage("org.apache.tuscany.services.contribution.installer.Invalid_Contribution", contributionSource));
+ System.exit(2);
+ }
+
+ //start the process of installing the contribution
+ ContributionRepository contributionRepository = new ContributionRepositoryImpl(null);
+ ContributionService contributionService =
+ new ContributionServiceImpl(contributionRepository, null, null, new DefaultAssemblyFactory(), new ContributionFactoryImpl(), null);
+
+ URL contributionURL = contributionSource.toURL();
+ InputStream contributionStream = null;
+ try {
+ contributionStream = contributionURL.openStream();
+ contributionService.contribute(contributionURI, contributionURL, contributionStream);
+ } finally {
+ IOHelper.closeQuietly(contributionStream);
+ }
+
+ System.exit(0);
+ }
+
+ private static void usage() {
+ System.err.println(getMessage("org.apache.tuscany.services.contribution.installer.Usage"));
+ System.exit(1);
+ }
+
+ private static String getMessage(String id, Object... params) {
+ ResourceBundle bundle = ResourceBundle.getBundle(Main.class.getName());
+ String message = bundle.getString(id);
+ return MessageFormat.format(message, params);
+ }
+}
diff --git a/sandbox/lresende/sca/modules/contribution-installer/src/main/resources/org/apache/tuscany/services/contribution/installer/Main.properties b/sandbox/lresende/sca/modules/contribution-installer/src/main/resources/org/apache/tuscany/services/contribution/installer/Main.properties
new file mode 100644
index 0000000000..6db064529c
--- /dev/null
+++ b/sandbox/lresende/sca/modules/contribution-installer/src/main/resources/org/apache/tuscany/services/contribution/installer/Main.properties
@@ -0,0 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# $Rev: 513906 $ $Date: 2007-03-02 11:38:00 -0800 (Fri, 02 Mar 2007) $
+#
+org.apache.tuscany.services.contribution.installer.Usage=usage: java [jvm-options] -jar installer.jar <contributionURI> <contribution source>
+org.apache.tuscany.services.contribution.installer.Invalid_Contribution=No contribution source found "{0}"
+org.apache.tuscany.services.contribution.installer.NoComposite=No composite archive found: {0}
+org.apache.tuscany.services.contribution.installer.NoApplicationSCDL=No application SCDL found: {0}
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/DISCLAIMER b/sandbox/lresende/sca/modules/implementation-data-pojo/DISCLAIMER
new file mode 100644
index 0000000000..d68a410903
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/DISCLAIMER
@@ -0,0 +1,8 @@
+Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/LICENSE b/sandbox/lresende/sca/modules/implementation-data-pojo/LICENSE
new file mode 100644
index 0000000000..8aa906c321
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/LICENSE
@@ -0,0 +1,205 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/NOTICE b/sandbox/lresende/sca/modules/implementation-data-pojo/NOTICE
new file mode 100644
index 0000000000..94481d6cfa
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/NOTICE
@@ -0,0 +1,6 @@
+${pom.name}
+Copyright (c) 2005 - 2007 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/README b/sandbox/lresende/sca/modules/implementation-data-pojo/README
new file mode 100644
index 0000000000..ff6ee6a8f4
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/README
@@ -0,0 +1,33 @@
+Tuscany implementation OpenJpa
+===============================
+Persistence technology is a very part of enterprise level application system. Tuscany has provided
+SDO implementation and a non standard but useful DAS infrastructure.
+But Tuscany also considered much existed software resource has used popular technologies as
+hibernate and jpa.
+Hibernate has license problem so an implementation based on it can not be hosted by Apache.
+This implementation is developed on the bases of Tuscany¡¯s robust extensible architecture and of
+course the jpa implementation project: Apache OpenJPA.
+
+This module is under the process of more improvement:
+
+For the time being, user of this module could configure a component as did by the *.composite file
+in this module. The component is infact a proxy of a JPA top api:
+ javax.persitence.EntityManager
+User of this module could use all the method provided by this interface.
+
+An difference is: OpenJPA could work with 2PC only if there is JNDI context and
+TransactionManager registered in the JNDI. This module modified much to work with
+policy-transaction module.
+
+For the time being, the Transaction boundary is located around one invocation of the EntityManager. But in the future, these boundary will move up to an component who references the EntityManager, that will be the righteous way for SCA developers!
+
+The data base working in this module is now Derby, it is for the ease of test running. MySQL
+could also work with this module, but it need database deployment in before. Not all types of database could work with this module, such as HSql, it did not provided a XA DataSource implementation up to now.
+
+There are much powerful features provided by openjpa, such as table auto generation, it is now also working in this module.
+
+User could get start from looking at what is done by:
+??org.apache.tuscany.sca.implementation.openjpa.ImplJpaTestCase
+??and
+??openjpa.composite
+When running the testcase, a RuntimeException stack trace(from inside openjpa api) will get printed on your screen, it is just ok, because of a trying of duplication primary key insertion, and it causes transaction rolling back.
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/company.sql b/sandbox/lresende/sca/modules/implementation-data-pojo/company.sql
new file mode 100644
index 0000000000..4911f9e62f
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/company.sql
@@ -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.
+--
+
+DROP TABLE COMPANY;
+
+CREATE TABLE COMPANY (
+ ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY,
+ NAME VARCHAR(30));
+
+INSERT INTO COMPANY (NAME) VALUES('ACME Publishing');
+INSERT INTO COMPANY (NAME) VALUES('Do-rite plumbing');
+INSERT INTO COMPANY (NAME) VALUES('MegaCorp'); \ No newline at end of file
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/pom.xml b/sandbox/lresende/sca/modules/implementation-data-pojo/pom.xml
new file mode 100644
index 0000000000..e61fcb8cee
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/pom.xml
@@ -0,0 +1,174 @@
+<?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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-implementation-data-pojo</artifactId>
+ <name>Apache Tuscany SCA OpenJPA Implementation Extension</name>
+
+ <repositories>
+ <repository>
+ <id>apache.incubator</id>
+ <url>http://people.apache.org/repo/m2-incubating-repository</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly-xml</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution-impl</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-data-api</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy-transaction</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jpa_3.0_spec</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openjpa</groupId>
+ <artifactId>openjpa</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.1.2.1</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sql-maven-plugin</artifactId>
+ <!-- 1.1 due to MOJO-619 -->
+ <version>1.1-SNAPSHOT</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.1.2.1</version>
+ </dependency>
+ </dependencies>
+
+ <executions>
+ <execution>
+ <id>create-db</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:${pom.basedir}/target/test-classes/company;create=true</url>
+ <autocommit>true</autocommit>
+ <onError>continue</onError>
+ <onConnectionError>skip</onConnectionError>
+ <delimiter>;</delimiter>
+ <srcFiles>
+ <srcFile>${pom.basedir}/company.sql</srcFile>
+ </srcFiles>
+ </configuration>
+ </execution>
+
+ <!-- Shutdown DB in order to be able to run unit tests -->
+ <execution>
+ <id>shutdown-database-sothat-test-can-run</id>
+ <phase>process-test-resources</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:${pom.basedir}/target/test-classes/company;shutdown=true</url>
+ <skipOnConnectionError>true</skipOnConnectionError>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementation.java b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementation.java
new file mode 100644
index 0000000000..c1ed6b4e58
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementation.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 org.apache.tuscany.sca.implementation.openjpa;
+
+import java.util.Properties;
+
+import org.apache.openjpa.persistence.PersistenceUnitInfoImpl;
+import org.apache.tuscany.sca.assembly.Implementation;
+
+public interface JPAImplementation extends Implementation {
+
+ void setPersistenceUnitInfoImpl(PersistenceUnitInfoImpl buii);
+
+ PersistenceUnitInfoImpl getPersistenceUnitInfoImpl();
+
+ void setDataSourceMeta(Properties p);
+
+ Properties getDataSourceMeta();
+}
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementationFactory.java b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementationFactory.java
new file mode 100644
index 0000000000..a5812b26e4
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementationFactory.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 org.apache.tuscany.sca.implementation.openjpa;
+
+public interface JPAImplementationFactory {
+ JPAImplementation createOpenJpaImplementation();
+}
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementationProcessor.java b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementationProcessor.java
new file mode 100644
index 0000000000..8ea83e7bfb
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementationProcessor.java
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.openjpa;
+
+import java.util.Properties;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.openjpa.persistence.PersistenceUnitInfoImpl;
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.service.ContributionReadException;
+import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
+import org.apache.tuscany.sca.implementation.openjpa.impl.JPAImplementationFactoryImpl;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+
+public class JPAImplementationProcessor implements StAXArtifactProcessor<JPAImplementation> {
+ private final QName QNAME = new QName(Constants.SCA10_TUSCANY_NS, "implementation.data.pojo");
+ private QName DS = new QName(Constants.SCA10_TUSCANY_NS, "datasource");
+
+ private JPAImplementationFactory jpaFactory;
+ private Log log = LogFactory.getLog(this.getClass());
+ private StAXArtifactProcessor<PersistenceUnitInfoImpl> puiiProcessor;
+
+ public JPAImplementationProcessor(ModelFactoryExtensionPoint modelFactories) {
+ AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
+ JavaInterfaceFactory javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
+
+ this.jpaFactory = new JPAImplementationFactoryImpl(assemblyFactory, javaFactory);
+ this.puiiProcessor = new PersistenceUnitInfoImplProcessor(modelFactories);
+ }
+
+ public Class<JPAImplementation> getModelType() {
+ return JPAImplementation.class;
+ }
+
+ public QName getArtifactType() {
+ return QNAME;
+ }
+
+ public JPAImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
+ assert QNAME.equals(reader.getName());
+ JPAImplementation implementation = jpaFactory.createOpenJpaImplementation();
+
+ implementation.setPersistenceUnitInfoImpl(puiiProcessor.read(reader));
+ Properties dsmeta = new Properties();
+ do {
+ int event = reader.next();
+ if (event == XMLStreamConstants.START_ELEMENT) {
+ if (!reader.getName().equals(DS)) {
+ dsmeta.setProperty(reader.getName().getLocalPart(), reader.getElementText());
+ }
+ } else if (event == XMLStreamConstants.END_ELEMENT && reader.getName().equals(DS)) {
+ implementation.setDataSourceMeta(dsmeta);
+ break;
+ }
+ } while (true);
+
+ return implementation;
+
+ }
+
+ public void write(JPAImplementation model, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void resolve(JPAImplementation model, ModelResolver resolver) throws ContributionResolveException {
+
+ }
+
+}
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/PersistenceUnitInfoImplProcessor.java b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/PersistenceUnitInfoImplProcessor.java
new file mode 100644
index 0000000000..d6e8276f25
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/PersistenceUnitInfoImplProcessor.java
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.openjpa;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.openjpa.persistence.PersistenceUnitInfoImpl;
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.service.ContributionReadException;
+import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
+
+public class PersistenceUnitInfoImplProcessor implements StAXArtifactProcessor<PersistenceUnitInfoImpl> {
+ private QName P_U = new QName(Constants.SCA10_TUSCANY_NS, "persistence-unit");
+ private QName BrokerFactory = new QName(Constants.SCA10_TUSCANY_NS, "jpa.BrokerFactory");
+ private QName CLASS = new QName(Constants.SCA10_TUSCANY_NS, "class");
+ private QName TRAN_MD = new QName(Constants.SCA10_TUSCANY_NS, "jpa.TransactionMode");
+ private QName LOG = new QName(Constants.SCA10_TUSCANY_NS, "jpa.Log");
+ private QName SYNCHRON = new QName(Constants.SCA10_TUSCANY_NS, "jpa.jdbc.SynchronizeMappings");
+
+ public PersistenceUnitInfoImplProcessor(ModelFactoryExtensionPoint modelFactories) {
+
+ }
+
+ public QName getArtifactType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public PersistenceUnitInfoImpl read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
+
+ PersistenceUnitInfoImpl _info = new PersistenceUnitInfoImpl();
+
+ while (true) {
+ int event = reader.next();
+ switch (event) {
+
+ case XMLStreamConstants.START_ELEMENT:
+ QName qn = reader.getName();
+ /*
+ * if (qn.equals(BrokerFactory)) {
+ * _info.setProperty("openjpa.BrokerFactory", reader
+ * .getElementText()); }
+ */
+ if (qn.equals(CLASS)) {
+ _info.addManagedClassName(reader.getElementText());
+
+ } else if (qn.equals(P_U)) {
+ _info.setPersistenceUnitName(reader.getAttributeValue(null, "name"));
+ } else {
+ _info.setProperty(qn.getLocalPart(), reader.getElementText());
+ } /*
+ * else if (qn.equals(LOG)) {
+ * _info.setProperty("openjpa.Log",
+ * reader.getElementText()); } else if
+ * (qn.equals(SYNCHRON)) {
+ * _info.setProperty("openjpa.jdbc.SynchronizeMappings",
+ * reader.getElementText()); }
+ */
+ break;
+ case XMLStreamConstants.END_ELEMENT:
+ if (reader.getName().equals(P_U))
+ return _info;
+ }
+ }
+ }
+
+ public void write(PersistenceUnitInfoImpl model, XMLStreamWriter writer) throws ContributionWriteException,
+ XMLStreamException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Class<PersistenceUnitInfoImpl> getModelType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void resolve(PersistenceUnitInfoImpl model, ModelResolver resolver) throws ContributionResolveException {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyBrokerFactory.java b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyBrokerFactory.java
new file mode 100644
index 0000000000..c4b14a1a90
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyBrokerFactory.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.openjpa;
+
+import javax.sql.XAConnection;
+import javax.transaction.TransactionManager;
+
+import org.apache.derby.jdbc.*;
+import org.apache.openjpa.conf.OpenJPAConfiguration;
+import org.apache.openjpa.kernel.AbstractBrokerFactory;
+import org.apache.openjpa.kernel.StoreManager;
+import org.apache.openjpa.lib.conf.ConfigurationProvider;
+import java.util.*;
+import org.apache.commons.logging.*;
+import org.apache.openjpa.jdbc.meta.MappingTool;
+import org.apache.openjpa.jdbc.conf.*;
+import org.apache.openjpa.meta.*;
+
+public class TuscanyBrokerFactory extends AbstractBrokerFactory {
+ private Log log = LogFactory.getLog(this.getClass());
+ protected TuscanyBrokerFactory(OpenJPAConfiguration conf) {
+ super(conf);
+ if (buildSchema != null && buildSchema.equals("buildSchema")) {
+ MappingTool tool = new MappingTool((JDBCConfiguration) conf,
+ (String) buildSchema, false);
+ Collection classes = meta.loadPersistentTypes(false, this
+ .getClass().getClassLoader());
+ for (Iterator itr = classes.iterator(); itr.hasNext();) {
+ tool.run((Class) itr.next());
+ }
+ log
+ .info("creating database and tables accroding to class mappings...");
+ tool.record();
+ }
+ }
+
+ private XAConnection xaconn;
+
+ @Override
+ protected StoreManager newStoreManager() {
+ try {
+ if (xaconn == null) {
+ if (cp.getProperties().get("dbtype").equals("Derby")) {
+ EmbeddedXADataSource xads = new EmbeddedXADataSource();
+ xads.setDatabaseName((String)cp.getProperties().get("dbname"));
+
+ xaconn = xads.getXAConnection();
+ }
+
+ System.out.println("------------TuscanyBrokerFactory.newStoreManager....");
+
+ }
+ return new TuscanyStoreManager(xaconn);
+
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ throw new RuntimeException(ex);
+ }
+ }
+
+ private static TransactionManager tm;
+ private static ConfigurationProvider cp;
+ private static Object buildSchema;
+ private static MetaDataRepository meta;
+
+ public static TuscanyBrokerFactory newInstance(ConfigurationProvider _cp) {
+ tm = (TransactionManager)_cp.getProperties().get("TransactionManager");
+ EmbeddedDataSource ds2 = null;
+ if (_cp.getProperties().get("dbtype").equals("Derby")) {
+ ds2 = new EmbeddedDataSource();
+ ds2.setDatabaseName((String) _cp.getProperties().get("dbname"));
+ ds2.setCreateDatabase((String) _cp.getProperties().get("dbcreate"));
+ }
+ TuscanyJDBCConfigurationImpl conf = new TuscanyJDBCConfigurationImpl(tm, ds2);
+ _cp.setInto(conf);
+ buildSchema = _cp.getProperties().get(
+ "openjpa.jdbc.SynchronizeMappings");
+
+ meta = conf.getMetaDataRepositoryInstance();
+ cp = _cp;
+ return new TuscanyBrokerFactory(conf);
+ }
+}
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyBrokerImpl.java b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyBrokerImpl.java
new file mode 100644
index 0000000000..f5972142de
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyBrokerImpl.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 org.apache.tuscany.sca.implementation.openjpa;
+
+import javax.transaction.TransactionManager;
+
+import org.apache.openjpa.ee.ManagedRuntime;
+import org.apache.openjpa.kernel.BrokerImpl;
+
+public class TuscanyBrokerImpl extends BrokerImpl {
+ private TransactionManager tm;
+
+ public TuscanyBrokerImpl(TransactionManager tm) {
+ this.tm = tm;
+ }
+
+ public ManagedRuntime getManagedRuntime() {
+ return new TuscanyManagerRuntime(tm);
+ }
+}
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyJDBCConfigurationImpl.java b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyJDBCConfigurationImpl.java
new file mode 100644
index 0000000000..78de14cc1c
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyJDBCConfigurationImpl.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 org.apache.tuscany.sca.implementation.openjpa;
+
+import javax.sql.DataSource;
+import javax.transaction.TransactionManager;
+
+import org.apache.openjpa.ee.ManagedRuntime;
+import org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl;
+import org.apache.openjpa.jdbc.sql.DBDictionary;
+import org.apache.openjpa.jdbc.sql.DerbyDictionary;
+import org.apache.openjpa.kernel.StoreContext;
+import org.apache.openjpa.lib.conf.Configurations;
+
+public class TuscanyJDBCConfigurationImpl extends JDBCConfigurationImpl {
+ private TransactionManager tm;
+
+ public TuscanyJDBCConfigurationImpl(TransactionManager tm,DataSource _ds) {
+ this.tm = tm;
+ ds2 = _ds;
+ }
+ public ManagedRuntime getManagedRuntimeInstance() {
+ return new TuscanyManagerRuntime(tm);
+ }
+
+ public Object getConnectionFactory() {
+ return null;
+ }
+
+ public DBDictionary getDBDictionaryInstance() {
+ DerbyDictionary dd = new DerbyDictionary();
+ Configurations.configureInstance(dd, this, "", "");
+ return dd;
+ }
+ private DataSource ds2;
+ @Override
+ public DataSource getDataSource2(StoreContext ctx) {
+
+ return ds2;
+ }
+}
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyManagerRuntime.java b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyManagerRuntime.java
new file mode 100644
index 0000000000..2fb35f83a1
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyManagerRuntime.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 org.apache.tuscany.sca.implementation.openjpa;
+import javax.transaction.SystemException;
+import javax.transaction.TransactionManager;
+
+import org.apache.openjpa.ee.ManagedRuntime;
+
+public class TuscanyManagerRuntime implements ManagedRuntime{
+ public TuscanyManagerRuntime(TransactionManager tm){
+ this.tm = tm;
+ }
+ public Throwable getRollbackCause() throws Exception {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Object getTransactionKey() throws Exception, SystemException {
+ // TODO Auto-generated method stub
+ return "Geng";
+ }
+ private TransactionManager tm;
+ public TransactionManager getTransactionManager() throws Exception {
+
+
+ return tm;
+ }
+
+ public void setRollbackOnly(Throwable cause) throws Exception {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyStoreManager.java b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyStoreManager.java
new file mode 100644
index 0000000000..441ba666d7
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyStoreManager.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 org.apache.tuscany.sca.implementation.openjpa;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import javax.sql.XAConnection;
+
+import org.apache.openjpa.jdbc.kernel.JDBCStoreManager;
+
+public class TuscanyStoreManager extends JDBCStoreManager {
+ private XAConnection xaconn;
+
+ public TuscanyStoreManager(XAConnection xaconn) {
+ this.xaconn = xaconn;
+ }
+
+ protected _RefCountConnection connectInternal() throws SQLException {
+ Connection conn = xaconn.getConnection();
+ // conn.setAutoCommit(false);
+ _RefCountConnection rc = new _RefCountConnection(conn);
+ return rc;
+ }
+
+ class _RefCountConnection extends RefCountConnection {
+ public _RefCountConnection(Connection conn) {
+
+ super(conn);
+ }
+ }
+}
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/impl/JPAImplementationFactoryImpl.java b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/impl/JPAImplementationFactoryImpl.java
new file mode 100644
index 0000000000..2a7d1abd70
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/impl/JPAImplementationFactoryImpl.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.openjpa.impl;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.implementation.openjpa.*;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+
+public class JPAImplementationFactoryImpl implements JPAImplementationFactory {
+ private AssemblyFactory assemblyFactory;
+ private JavaInterfaceFactory javaFactory;
+
+ public JPAImplementationFactoryImpl(AssemblyFactory aF, JavaInterfaceFactory javaIF) {
+ this.assemblyFactory = aF;
+ this.javaFactory = javaIF;
+ }
+
+ public JPAImplementation createOpenJpaImplementation() {
+ return new JPAImplementationImpl(assemblyFactory, javaFactory);
+ }
+
+}
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/impl/JPAImplementationImpl.java b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/impl/JPAImplementationImpl.java
new file mode 100644
index 0000000000..055ecd4a4d
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/impl/JPAImplementationImpl.java
@@ -0,0 +1,119 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.openjpa.impl;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+
+import javax.persistence.EntityManager;
+
+import org.apache.openjpa.persistence.PersistenceUnitInfoImpl;
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.ConstrainingType;
+import org.apache.tuscany.sca.assembly.Property;
+import org.apache.tuscany.sca.assembly.Reference;
+import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.implementation.openjpa.JPAImplementation;
+import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+
+public class JPAImplementationImpl implements JPAImplementation {
+ private Service jpaService;
+ private PersistenceUnitInfoImpl puii;
+ private Properties dsmeta;
+
+ public void setPersistenceUnitInfoImpl(PersistenceUnitInfoImpl puii) {
+ this.puii = puii;
+ }
+
+ public PersistenceUnitInfoImpl getPersistenceUnitInfoImpl() {
+ return this.puii;
+ }
+
+ public void setDataSourceMeta(Properties p) {
+ dsmeta = p;
+ }
+
+ public Properties getDataSourceMeta() {
+ return dsmeta;
+ }
+
+ JPAImplementationImpl(AssemblyFactory assemblyFactory, JavaInterfaceFactory javaFactory) {
+
+ jpaService = assemblyFactory.createService();
+ jpaService.setName("EntityManager");
+ JavaInterface javaInterface;
+ try {
+ javaInterface = javaFactory.createJavaInterface(EntityManager.class);
+ } catch (InvalidInterfaceException e) {
+ throw new IllegalArgumentException(e);
+ }
+ JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
+ interfaceContract.setInterface(javaInterface);
+ jpaService.setInterfaceContract(interfaceContract);
+ }
+
+ public boolean isUnresolved() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public ConstrainingType getConstrainingType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<Property> getProperties() {
+ // TODO Auto-generated method stub
+ return Collections.emptyList();
+ }
+
+ public List<Reference> getReferences() {
+ return Collections.emptyList();
+ }
+
+ public List<Service> getServices() {
+ return Collections.singletonList(jpaService);
+ }
+
+ public String getURI() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setConstrainingType(ConstrainingType constrainingType) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setURI(String uri) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAImplementationProvider.java b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAImplementationProvider.java
new file mode 100644
index 0000000000..5a863a8ae7
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAImplementationProvider.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 org.apache.tuscany.sca.implementation.openjpa.provider;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.persistence.EntityManagerFactory;
+import javax.transaction.TransactionManager;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.openjpa.kernel.Bootstrap;
+import org.apache.openjpa.kernel.BrokerFactory;
+import org.apache.openjpa.persistence.JPAFacadeHelper;
+import org.apache.openjpa.persistence.PersistenceUnitInfoImpl;
+import org.apache.openjpa.persistence.PersistenceProductDerivation.ConfigurationProviderImpl;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.implementation.openjpa.JPAImplementation;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.provider.ImplementationProvider;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+
+public class JPAImplementationProvider implements ImplementationProvider {
+ private RuntimeComponent component;
+ private JPAImplementation implementation;
+ private EntityManagerFactory emf;
+ private TransactionManager tm;
+
+ public JPAImplementationProvider(RuntimeComponent component,
+ JPAImplementation implementation,
+ ExtensionPointRegistry extensionPoints) {
+ this.component = component;
+ this.implementation = implementation;
+ tm = (TransactionManager)extensionPoints.getExtensionPoint(org.apache.geronimo.transaction.manager.XAWork.class);
+
+ initEntityManager();
+ }
+
+ private void initEntityManager() {
+ Map map = new HashMap();
+ map.put("TransactionManager", tm);
+ PersistenceUnitInfoImpl _info = implementation.getPersistenceUnitInfoImpl();
+ _info.fromUserProperties(map);
+ ConfigurationProviderImpl cp = new ConfigurationProviderImpl();
+ cp.addProperties(_info.toOpenJPAProperties());
+ cp.addProperties(implementation.getDataSourceMeta());
+
+ BrokerFactory factory = Bootstrap.newBrokerFactory(cp, null);
+
+ emf = JPAFacadeHelper.toEntityManagerFactory(factory);
+
+ }
+
+ private Log log = LogFactory.getLog(this.getClass());
+
+ public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
+
+ return new JPAInvoker(operation, emf, tm);
+ }
+
+ public void start() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void stop() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public boolean supportsOneWayInvocation() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+}
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAImplementationProviderFactory.java b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAImplementationProviderFactory.java
new file mode 100644
index 0000000000..e1e821113c
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAImplementationProviderFactory.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 org.apache.tuscany.sca.implementation.openjpa.provider;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.implementation.openjpa.JPAImplementation;
+import org.apache.tuscany.sca.provider.ImplementationProvider;
+import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+public class JPAImplementationProviderFactory implements ImplementationProviderFactory<JPAImplementation> {
+ private ExtensionPointRegistry extensionPointRegistry;
+
+ public JPAImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
+ extensionPointRegistry = extensionPoints;
+ }
+
+ public ImplementationProvider createImplementationProvider(RuntimeComponent component,
+ JPAImplementation implementation) {
+ return new JPAImplementationProvider(component, implementation, extensionPointRegistry);
+ }
+
+ public Class<JPAImplementation> getModelType() {
+ return JPAImplementation.class;
+ }
+
+}
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAInvoker.java b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAInvoker.java
new file mode 100644
index 0000000000..8b74209d3e
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAInvoker.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 org.apache.tuscany.sca.implementation.openjpa.provider;
+
+import java.lang.reflect.Method;
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.transaction.TransactionManager;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+
+public class JPAInvoker implements Invoker {
+ private Operation operation;
+ private TransactionManager tm;
+
+ public JPAInvoker(Operation operation, EntityManagerFactory emf, TransactionManager tm) {
+ this.operation = operation;
+ this.tm = tm;
+ this.emf = emf;
+ }
+
+ private Log log = LogFactory.getLog(this.getClass());
+ private EntityManagerFactory emf;
+
+ public Message invoke(Message msg) {
+ try {
+ tm.begin();
+ Method method = JavaInterfaceUtil.findMethod(EntityManager.class, operation);
+ Object r = method.invoke(emf.createEntityManager(), (Object[])msg.getBody());
+ tm.commit();
+ log.info(method);
+ msg.setBody(r);
+ return msg;
+ } catch (Exception ex) {
+ throw new RuntimeException(ex);
+
+ }
+ }
+
+}
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
new file mode 100644
index 0000000000..8c82832e01
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Implementation class for the artifact processor extension
+org.apache.tuscany.sca.implementation.openjpa.JPAImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#implementation.data.pojo,model=org.apache.tuscany.sca.implementation.openjpa.JPAImplementation \ No newline at end of file
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.openjpa.OpenJpaImplementationFactory b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.openjpa.OpenJpaImplementationFactory
new file mode 100644
index 0000000000..13067543c9
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.openjpa.OpenJpaImplementationFactory
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+org.apache.tuscany.sca.implementation.openjpa.impl.JPAImplementationFactoryImpl \ No newline at end of file
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
new file mode 100644
index 0000000000..fb62ff853b
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Implementation class for the implementation extension
+org.apache.tuscany.sca.implementation.openjpa.provider.JPAImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.openjpa.JPAImplementation \ No newline at end of file
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/company/Company.java b/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/company/Company.java
new file mode 100644
index 0000000000..3ea6e65c0d
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/company/Company.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 company;
+
+import javax.persistence.*;
+
+@Entity
+public class Company {
+ @Id private int id;
+ @Basic private String name;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int i) {
+ id = i;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String toString() {
+ return "Company (" + getId() + ") is is " + getName();
+ }
+}
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/company/CompanyCollection.java b/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/company/CompanyCollection.java
new file mode 100644
index 0000000000..b74f53aa8b
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/company/CompanyCollection.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 company;
+
+import org.apache.tuscany.sca.implementation.data.collection.Collection;
+
+public interface CompanyCollection extends Collection<String, Company> {
+
+}
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/company/CompanyCollectionImpl.java b/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/company/CompanyCollectionImpl.java
new file mode 100644
index 0000000000..385defeb0b
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/company/CompanyCollectionImpl.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package company;
+
+import java.util.Iterator;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.EntityTransaction;
+import javax.persistence.Persistence;
+import javax.persistence.Query;
+
+import org.apache.tuscany.sca.implementation.data.collection.Entry;
+import org.apache.tuscany.sca.implementation.data.collection.NotFoundException;
+
+public class CompanyCollectionImpl implements CompanyCollection {
+ EntityManagerFactory emf = null;
+ EntityManager em = null;
+
+ public CompanyCollectionImpl() {
+ System.out.println(">>>");
+ try {
+ emf = Persistence.createEntityManagerFactory("company-openJPA");
+ em = emf.createEntityManager();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void delete(String arg0) throws NotFoundException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Company get(String arg0) throws NotFoundException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Entry<String, Company>[] getAll() {
+ EntityTransaction tx = em.getTransaction();
+ try {
+ tx.begin();
+
+ Query q = em.createQuery("SELECT c FROM company c");
+ List results = q.getResultList();
+ Iterator iter = results.iterator();
+ while (iter.hasNext()) {
+ Company company = (Company)iter.next();
+
+ System.out.println(company);
+ }
+
+ tx.commit();
+ } catch(Exception e) {
+ e.printStackTrace();
+ } finally {
+ if (tx.isActive()) {
+ tx.rollback();
+ }
+
+ em.close();
+ }
+
+ return null;
+ }
+
+ public String post(String arg0, Company arg1) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void put(String arg0, Company arg1) throws NotFoundException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Entry<String, Company>[] query(String arg0) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/org/apache/tuscany/sca/implementation/openjpa/CompanyCollectionTestCase.java b/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/org/apache/tuscany/sca/implementation/openjpa/CompanyCollectionTestCase.java
new file mode 100644
index 0000000000..bc9fbb3543
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/org/apache/tuscany/sca/implementation/openjpa/CompanyCollectionTestCase.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 org.apache.tuscany.sca.implementation.openjpa;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import company.CompanyCollection;
+import company.CompanyCollectionImpl;
+
+public class CompanyCollectionTestCase extends TestCase {
+ private Log log = LogFactory.getLog(this.getClass());
+ private CompanyCollection collection = null;
+
+ public void setUp() {
+ collection = new CompanyCollectionImpl();
+ }
+
+ public void testGetAll() {
+ collection.getAll();
+ }
+
+ public void tearDown() {
+
+ }
+}
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/org/apache/tuscany/sca/implementation/openjpa/CompanyTestCase.java b/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/org/apache/tuscany/sca/implementation/openjpa/CompanyTestCase.java
new file mode 100644
index 0000000000..1c4d6fb254
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/org/apache/tuscany/sca/implementation/openjpa/CompanyTestCase.java
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.openjpa;
+
+import junit.framework.*;
+import org.apache.tuscany.sca.host.embedded.*;
+import org.apache.commons.logging.*;
+
+import company.*;
+
+import javax.persistence.*;
+import java.util.*;
+
+public class CompanyTestCase extends TestCase {
+ private EntityManager em;
+ private Log log = LogFactory.getLog(this.getClass());
+ private SCADomain domain;
+
+ public void setUp() {
+ domain = SCADomain.newInstance("openjpa.composite");
+ em = domain.getService(EntityManager.class, "CompanyServiceComponent");
+
+ }
+
+ public void testAccess() {
+ Company company = new Company();
+ int id = new Random().nextInt();
+
+ company.setId(id);
+ company.setName("Company " + id);
+
+ em.persist(company);
+ log.info(em.find(Company.class, id));
+
+ Query q = em.createQuery("select company from Company company");
+ q.setMaxResults(5);
+ log.info("There are " + q.getResultList().size() + " Company in the database now");
+ }
+
+ public void testRollback() {
+ try {
+ Company company1 = new Company();
+ Company company2 = new Company();
+
+ int id = new Random().nextInt();
+
+ company1.setId(id);
+ company1.setName("Company " + id);
+ em.persist(company1);
+
+ company2.setId(id);
+ company2.setName("Company " + id);
+ em.persist(company2);
+
+ } catch (RuntimeException ex) {
+ log.info("An expected exception occured, Tuscany is rolling back...");
+ }
+ }
+
+ public void tearDown() {
+ em.close();
+ domain.close();
+ }
+}
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/resources/META-INF/orm.xml b/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/resources/META-INF/orm.xml
new file mode 100644
index 0000000000..75e329964f
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/resources/META-INF/orm.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.
+-->
+
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
+ version="1.0">
+ <entity class="company.Company" name="company">
+ <table name="COMPANY"/>
+ <attributes>
+ <id name="id">
+ <generated-value strategy="TABLE"/>
+ </id>
+ <basic name="name">
+ <column name="NAME" length="30"/>
+ </basic>
+ </attributes>
+ </entity>
+</entity-mappings> \ No newline at end of file
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/resources/META-INF/persistence.xml b/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/resources/META-INF/persistence.xml
new file mode 100644
index 0000000000..302fbfe845
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/resources/META-INF/persistence.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
+ http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
+
+ <persistence-unit name="company-openJPA">
+ <!--mapping-file>orm.xml</mapping-file-->
+ <class>company.Company</class>
+
+ <properties>
+ <property name="openjpa.ConnectionDriverName" value="org.apache.derby.jdbc.EmbeddedDriver"/>
+ <property name="openjpa.ConnectionURL" value="jdbc:derby:target/test-classes/company"/>
+ <property name="openjpa.ConnectionUserName" value=""/>
+ <property name="openjpa.ConnectionPassword" value=""/>
+
+ <property name="openjpa.Log" value="DefaultLevel=TRACE, Tool=TRACE"/>
+ </properties>
+ </persistence-unit>
+
+</persistence> \ No newline at end of file
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/resources/company.composite b/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/resources/company.composite
new file mode 100755
index 0000000000..fd164d2519
--- /dev/null
+++ b/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/resources/company.composite
@@ -0,0 +1,47 @@
+<?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.
+-->
+
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ targetNamespace="http://sample/openjpa"
+ name="company">
+
+ <component name="CompanyServiceComponent">
+ <tuscany:implementation.data.pojo>
+
+ <tuscany:persistence-unit name="company">
+ <tuscany:openjpa.BrokerFactory>org.apache.tuscany.sca.implementation.openjpa.TuscanyBrokerFactory</tuscany:openjpa.BrokerFactory>
+ <tuscany:openjpa.TransactionMode>managed</tuscany:openjpa.TransactionMode>
+ <tuscany:openjpa.Log>DefaultLevel=WARN,SQL=TRACE</tuscany:openjpa.Log>
+ <tuscany:openjpa.jdbc.SynchronizeMappings>buildSchema</tuscany:openjpa.jdbc.SynchronizeMappings>
+
+ <tuscany:class>company.Company</tuscany:class>
+ </tuscany:persistence-unit>
+
+ <tuscany:connectionInfo>
+ <tuscany:connectionProperties
+ driverClass="org.apache.derby.jdbc.EmbeddedDriver"
+ databaseURL="jdbc:derby:target/test-classes/company; create = true"
+ loginTimeout="600000"/>
+ </tuscany:connectionInfo>
+ </tuscany:implementation.data.pojo>
+ </component>
+
+</composite>
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/README b/sandbox/lresende/sca/samples/calculator-jsf-webapp/README
new file mode 100644
index 0000000000..9f041f4ecb
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/README
@@ -0,0 +1,118 @@
+Calculator Sample
+=================
+This sample uses the same code as the calculator sample but deploys the
+sample wrapped in a web app.
+
+The README in the samples directory (the directory above this) provides
+general instructions about building and running samples. Take a look there
+first.
+
+As this sample provides a web app there is a manual step where the WAR file
+that contains the sample is copied to your web app container. If you just want
+to give this sample a go deploy the WAR file (target/sample-calculator-webapp.war)
+to you web application server.
+
+Once the web app is deployed use your browser to visit the following URL;
+
+http://localhost.localdomain:8080/sample-calculator-jsf-webapp/faces/calc_jsf.jsp
+
+The port and hostname will of course vary depending on your local installation.
+
+Sample Overview
+---------------
+The sample provides a single calculator service with a default SCA (java)
+binding. The CalculatorClient exercises this interface by calling add,
+subtract, multiply and divide operations. This results in messages passing to
+the appropriate components in the composite across the local wires.
+
+calculator-webapp/
+ src/
+ main/
+ java/
+ calculator/
+ CalculatorService.java - As calculator sample
+ CalculatorServiceImpl.java
+ AddService.java - As calculator sample
+ AddServiceImpl.java
+ SubtractService.java - As calculator sample
+ SubtractServiceImpl.java
+ MultiplyService.java - As calculator sample
+ MultiplyServiceImpl.java
+ DivideService.java - As calculator sample
+ DivideServiceImpl.java
+ CalculatorClient.java - As calculator sample
+ resources/
+ Calculator.composite - As calculator sample
+ webapp
+ META-INF/
+ sca-contribution.xml - specifies the composite to be deployed
+ WEB-INF/
+ web.xml - defines the listener that starts up the
+ Tuscany SCA runtime
+ calc.jsp - the web application that makes use of the
+ SCA application
+ test/
+ java/
+ calculator/
+ CalculatorTestCase.java - JUnit test case
+
+ calculator.png - a pictorial representation of the sample .composite file
+ build.xml - the Ant build file
+ pom.xml - the Maven build file
+
+Building And Running The Sample Using Ant
+-----------------------------------------
+With the binary distribution the sample can be built using Ant as
+follows
+
+cd calculator-webapp
+ant package
+
+This should result in a war file (sample-calculator-webapp.war) in the target
+directory. Copy this war file to your web app deployment directory in you
+web app container.
+
+The process for getting the web app running will depend on which web app container
+you are using. For example, if you are using Tomcat then it is simply a matter
+of copying the WAR file to the webapps directory.
+
+Once the web app is deployed use your browser to visit the following URL;
+
+http://localhost:8080/sample-calculator-webapp/calc.jsp
+
+The port and hostname will of course vary depending on your local installation.
+
+You should see the following output.
+
+Expression Result
+2 + 3 5.0
+3 - 2 1.0
+3 * 2 6.0
+3 / 2 1.5
+
+Building And Running The Sample Using Maven
+-------------------------------------------
+With either the binary or source distributions the sample can be built and run
+using Maven as follows.
+
+cd calculator-webapp
+mvn
+
+
+You should see the following output from the test phase.
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running calculator.CalculatorTestCase
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.852 sec
+
+Results :
+
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
+
+Again this should result in a war file (sample-calculator-webapp.war) in the target
+directory. Follow the steps described in the previous section for running the web
+app and for the expected results.
+
+
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/build.xml b/sandbox/lresende/sca/samples/calculator-jsf-webapp/build.xml
new file mode 100644
index 0000000000..11b30c48d2
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/build.xml
@@ -0,0 +1,137 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<project name="sample-calculator-jsf-webapp" default="compile">
+
+ <target name="compile">
+ <mkdir dir="target/classes"/>
+ <javac destdir="target/classes" debug="on" source="1.5" target="1.5">
+ <src path="src/main/java"/>
+ <classpath>
+ <fileset refid="tuscany.jars"/>
+ <fileset refid="3rdparty.jars"/>
+ </classpath>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ <fileset dir="." includes="*" excludes="src, target, pom.xml, build.xml"/>
+ </copy>
+ <war destfile="target/sample-calculator-jsf-webapp.war" webxml="src/main/webapp/WEB-INF/web.xml">
+ <fileset dir="src/main/webapp"/>
+ <lib refid="tuscany.jars"/>
+ <lib refid="3rdparty.jars"/>
+ <classes dir="target/classes"/>
+ </war>
+ </target>
+
+ <target name="package" depends="compile"/>
+
+ <target name="clean">
+ <delete includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ </target>
+
+ <fileset id="tuscany.jars" dir="../../modules">
+ <include name="tuscany-assembly-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-assembly-xml-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-assembly-xsd-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-binding-sca-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-binding-sca-xml-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-contribution-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-contribution-impl-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-contribution-java-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-contribution-namespace-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-contribution-xml-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-core-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-core-databinding-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-core-spi-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-databinding-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-databinding-jaxb-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-definitions-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-definitions-xml-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-domain-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-domain-api-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-host-embedded-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-host-http-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-host-webapp-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-implementation-java-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-implementation-java-runtime-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-implementation-java-xml-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-interface-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-interface-java-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-interface-java-jaxws-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-interface-java-xml-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-node-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-node-api-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-policy-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-policy-logging-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-policy-security-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-policy-xml-1.2-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-sca-api-1.2-incubating-SNAPSHOT.jar"/>
+ </fileset>
+ <fileset id="3rdparty.jars" dir="../../lib">
+ <include name="XmlSchema-1.3.2.jar"/>
+ <include name="activation-1.1.jar"/>
+ <include name="annogen-0.1.0.jar"/>
+ <include name="axiom-api-1.2.5.jar"/>
+ <include name="axiom-dom-1.2.5.jar"/>
+ <include name="axiom-impl-1.2.5.jar"/>
+ <include name="axis2-kernel-1.3.jar"/>
+ <include name="backport-util-concurrent-2.2.jar"/>
+ <include name="cglib-nodep-2.1_3.jar"/>
+ <include name="commons-beanutils-1.7.0.jar"/>
+ <include name="commons-codec-1.3.jar"/>
+ <include name="commons-collections-3.1.jar"/>
+ <include name="commons-digester-1.6.jar"/>
+ <include name="commons-el-1.0.jar"/>
+ <include name="commons-fileupload-1.1.1.jar"/>
+ <include name="commons-httpclient-3.0.1.jar"/>
+ <include name="commons-io-1.2.jar"/>
+ <include name="commons-lang-2.1.jar"/>
+ <include name="commons-logging-1.0.4.jar"/>
+ <include name="geronimo-commonj_1.1_spec-1.0.jar"/>
+ <include name="geronimo-jms_1.1_spec-1.1.jar"/>
+ <include name="httpcore-4.0-alpha5.jar"/>
+ <include name="httpcore-nio-4.0-alpha5.jar"/>
+ <include name="httpcore-niossl-4.0-alpha5.jar"/>
+ <include name="jaxb-api-2.1.jar"/>
+ <include name="jaxb-impl-2.1.6.jar"/>
+ <include name="jaxb2-reflection-2.1.4.jar"/>
+ <include name="jaxen-1.1-beta-9.jar"/>
+ <include name="jaxws-api-2.1.jar"/>
+ <include name="jsr181-api-1.0-MR1.jar"/>
+ <include name="jsr250-api-1.0.jar"/>
+ <include name="jstl-1.1.0.jar"/>
+ <include name="mail-1.4.jar"/>
+ <include name="myfaces-api-1.1.5.jar"/>
+ <include name="myfaces-impl-1.1.5.jar"/>
+ <include name="neethi-2.0.2.jar"/>
+ <include name="saaj-api-1.3.jar"/>
+ <include name="stax-api-1.0-2.jar"/>
+ <include name="stax-api-1.0.1.jar"/>
+ <include name="woden-1.0-incubating-M7b.jar"/>
+ <include name="wsdl4j-1.6.2.jar"/>
+ <include name="wstx-asl-3.2.1.jar"/>
+ <include name="xalan-2.7.0.jar"/>
+ <include name="xercesImpl-2.8.1.jar"/>
+ <include name="xml-apis-1.3.03.jar"/>
+ </fileset>
+
+</project>
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/calculator-web.png b/sandbox/lresende/sca/samples/calculator-jsf-webapp/calculator-web.png
new file mode 100644
index 0000000000..896ddc4093
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/calculator-web.png
Binary files differ
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/calculator-web.svg b/sandbox/lresende/sca/samples/calculator-jsf-webapp/calculator-web.svg
new file mode 100644
index 0000000000..00ed27556f
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/calculator-web.svg
@@ -0,0 +1,358 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="1052.3622"
+ height="744.09448"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.44"
+ sodipodi:docbase="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator-web"
+ sodipodi:docname="calculator-web.svg"
+ version="1.0"
+ inkscape:export-filename="C:\simon\Projects\Tuscany\java\java-head\sca\samples\calculator-web\calculator-web.png"
+ inkscape:export-xdpi="52.84"
+ inkscape:export-ydpi="52.84">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1.4"
+ inkscape:cx="471.80491"
+ inkscape:cy="378.84265"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ inkscape:window-width="1054"
+ inkscape:window-height="721"
+ inkscape:window-x="59"
+ inkscape:window-y="79" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <g
+ id="g2997"
+ transform="matrix(1,0,0,1.144214,0,-27.53557)">
+ <rect
+ rx="15.307091"
+ ry="12.692303"
+ y="192.00233"
+ x="258.31146"
+ height="299.99988"
+ width="495.71429"
+ id="rect2067"
+ style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:1.86971939;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <flowRoot
+ id="flowRoot2954"
+ xml:space="preserve"><flowRegion
+ id="flowRegion2956"><rect
+ y="212.66591"
+ x="281.42856"
+ height="61.42857"
+ width="170"
+ id="rect2958" /></flowRegion><flowPara
+ id="flowPara2960">Calculator</flowPara></flowRoot> </g>
+ <rect
+ style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:1.9999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect2988"
+ width="115.66247"
+ height="191.57716"
+ x="339.91632"
+ y="262.1673"
+ rx="6.9961648"
+ ry="15.892869" />
+ <flowRoot
+ xml:space="preserve"
+ id="flowRoot2966"
+ transform="translate(79.61125,62.65764)"><flowRegion
+ id="flowRegion2968"><rect
+ id="rect2970"
+ width="170"
+ height="61.42857"
+ x="281.42856"
+ y="212.66591" /></flowRegion><flowPara
+ id="flowPara2972">Calculator</flowPara><flowPara
+ id="flowPara1895">Service</flowPara><flowPara
+ id="flowPara1897">Component</flowPara></flowRoot> <path
+ style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 322.76581,342.58603 L 356.10085,342.58603 L 362.16176,355.71801 L 355.0907,367.83985 L 322.76581,367.83985 L 330.34196,355.71801 L 322.76581,342.58603 z "
+ id="path3017" />
+ <path
+ style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 431.01809,321.46204 L 471.00147,321.46204 L 478.27117,334.59402 L 469.78986,346.71586 L 431.01809,346.71586 L 440.10523,334.59402 L 431.01809,321.46204 z "
+ id="path3019" />
+ <path
+ style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.00000024px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 223.15923,328.61046 L 282.4833,328.61046 L 293.26948,355.48529 L 280.68561,380.29286 L 223.15923,380.29286 L 236.64198,355.48529 L 223.15923,328.61046 z "
+ id="path1883" />
+ <flowRoot
+ xml:space="preserve"
+ id="flowRoot1885"
+ transform="translate(-46.16225,128.7269)"
+ style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%"><flowRegion
+ id="flowRegion1887"><rect
+ id="rect1889"
+ width="170"
+ height="61.42857"
+ x="281.42856"
+ y="212.66591"
+ style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:11;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%" /></flowRegion><flowPara
+ id="flowPara1891">Calculator</flowPara><flowPara
+ id="flowPara1893">Service</flowPara></flowRoot> <rect
+ style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect1899"
+ width="115.66247"
+ height="70.148659"
+ x="594.75488"
+ y="209.73451"
+ rx="6.9961648"
+ ry="5.8193965" />
+ <flowRoot
+ xml:space="preserve"
+ id="flowRoot1901"
+ transform="translate(334.4498,10.22481)"><flowRegion
+ id="flowRegion1903"><rect
+ id="rect1905"
+ width="170"
+ height="61.42857"
+ x="281.42856"
+ y="212.66591" /></flowRegion><flowPara
+ id="flowPara1907">Add</flowPara><flowPara
+ id="flowPara1909">Service</flowPara><flowPara
+ id="flowPara1911">Component</flowPara></flowRoot> <path
+ style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 573.31867,232.29606 L 606.65371,232.29606 L 612.71462,245.42804 L 605.64356,257.54988 L 573.31867,257.54988 L 580.89482,245.42804 L 573.31867,232.29606 z "
+ id="path1913" />
+ <rect
+ style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect1917"
+ width="115.66247"
+ height="70.148659"
+ x="594.06543"
+ y="292.59158"
+ rx="6.9961648"
+ ry="5.8193965" />
+ <flowRoot
+ xml:space="preserve"
+ id="flowRoot1919"
+ transform="translate(333.7604,93.08188)"><flowRegion
+ id="flowRegion1921"><rect
+ id="rect1923"
+ width="170"
+ height="61.42857"
+ x="281.42856"
+ y="212.66591" /></flowRegion><flowPara
+ id="flowPara1925">Subtract</flowPara><flowPara
+ id="flowPara1927">Service</flowPara><flowPara
+ id="flowPara1929">Component</flowPara></flowRoot> <path
+ style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 572.62924,315.15313 L 605.96428,315.15313 L 612.02519,328.28511 L 604.95413,340.40695 L 572.62924,340.40695 L 580.20539,328.28511 L 572.62924,315.15313 z "
+ id="path1931" />
+ <rect
+ style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect1933"
+ width="115.66247"
+ height="70.148659"
+ x="594.77979"
+ y="371.87729"
+ rx="6.9961648"
+ ry="5.8193965" />
+ <flowRoot
+ xml:space="preserve"
+ id="flowRoot1935"
+ transform="translate(334.4747,172.3676)"><flowRegion
+ id="flowRegion1937"><rect
+ id="rect1939"
+ width="170"
+ height="61.42857"
+ x="281.42856"
+ y="212.66591" /></flowRegion><flowPara
+ id="flowPara1941">Multiply</flowPara><flowPara
+ id="flowPara1943">Service</flowPara><flowPara
+ id="flowPara1945">Component</flowPara></flowRoot> <path
+ style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 573.34352,394.43884 L 606.67856,394.43884 L 612.73947,407.57082 L 605.66841,419.69266 L 573.34352,419.69266 L 580.91967,407.57082 L 573.34352,394.43884 z "
+ id="path1947" />
+ <rect
+ style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.00000024;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect1949"
+ width="115.66247"
+ height="70.148659"
+ x="596.20831"
+ y="452.59158"
+ rx="6.9961648"
+ ry="5.8193965" />
+ <flowRoot
+ xml:space="preserve"
+ id="flowRoot1951"
+ transform="translate(335.9032,253.0819)"><flowRegion
+ id="flowRegion1953"><rect
+ id="rect1955"
+ width="170"
+ height="61.42857"
+ x="281.42856"
+ y="212.66591" /></flowRegion><flowPara
+ id="flowPara1957">Divide</flowPara><flowPara
+ id="flowPara1959">Service</flowPara><flowPara
+ id="flowPara1961">Component</flowPara></flowRoot> <path
+ style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 574.77209,475.15313 L 608.10713,475.15313 L 614.16804,488.28511 L 607.09698,500.40695 L 574.77209,500.40695 L 582.34824,488.28511 L 574.77209,475.15313 z "
+ id="path1963" />
+ <flowRoot
+ xml:space="preserve"
+ id="flowRoot1965"
+ transform="translate(161.0221,114.967)"
+ style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
+ id="flowRegion1967"><rect
+ id="rect1969"
+ width="170"
+ height="61.42857"
+ x="281.42856"
+ y="212.66591"
+ style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
+ id="flowPara1973">add</flowPara><flowPara
+ id="flowPara1977">Service</flowPara></flowRoot> <path
+ style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 430.65917,357.18186 L 470.64255,357.18186 L 477.91225,370.31384 L 469.43094,382.43568 L 430.65917,382.43568 L 439.74631,370.31384 L 430.65917,357.18186 z "
+ id="path1979" />
+ <flowRoot
+ xml:space="preserve"
+ id="flowRoot1981"
+ transform="translate(160.6632,150.6868)"
+ style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
+ id="flowRegion1983"><rect
+ id="rect1985"
+ width="170"
+ height="61.42857"
+ x="281.42856"
+ y="212.66591"
+ style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
+ id="flowPara1987">subtract</flowPara><flowPara
+ id="flowPara1989">Service</flowPara></flowRoot> <path
+ style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 431.37346,390.75329 L 471.35684,390.75329 L 478.62654,403.88527 L 470.14523,416.00711 L 431.37346,416.00711 L 440.4606,403.88527 L 431.37346,390.75329 z "
+ id="path1991" />
+ <flowRoot
+ xml:space="preserve"
+ id="flowRoot1993"
+ transform="translate(161.3775,184.2583)"
+ style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
+ id="flowRegion1995"><rect
+ id="rect1997"
+ width="170"
+ height="61.42857"
+ x="281.42856"
+ y="212.66591"
+ style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
+ id="flowPara1999">multiply</flowPara><flowPara
+ id="flowPara2001">Service</flowPara></flowRoot> <path
+ style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:0.99999982px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 429.94489,422.18186 L 469.92827,422.18186 L 477.19797,435.31384 L 468.71666,447.43568 L 429.94489,447.43568 L 439.03203,435.31384 L 429.94489,422.18186 z "
+ id="path2003" />
+ <flowRoot
+ xml:space="preserve"
+ id="flowRoot2005"
+ transform="translate(159.9489,215.6868)"
+ style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
+ id="flowRegion2007"><rect
+ id="rect2009"
+ width="170"
+ height="61.42857"
+ x="281.42856"
+ y="212.66591"
+ style="font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
+ id="flowPara2011">divide</flowPara><flowPara
+ id="flowPara2013">Service</flowPara></flowRoot> <path
+ style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 477.85714,335.52305 L 511.42857,335.52305 L 510.71429,245.52305 L 579.28571,245.52305"
+ id="path2015" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 477.85714,369.80877 L 528.57143,369.80877 L 528.57143,329.80877 L 580,329.80877"
+ id="path2017" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 478.57143,402.66591 L 528.57143,401.95163 L 528.57143,408.3802 L 580,407.66591"
+ id="path2019" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 475.71429,435.52305 L 509.28571,435.52305 L 510,486.95163 L 582.14286,486.23734"
+ id="path2021" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 292.85714,355.52305 L 330,354.80877"
+ id="path2023" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;fill:#f19a9a;fill-opacity:1;stroke:#2e2424;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:3, 1;stroke-dashoffset:0;stroke-opacity:1"
+ id="path1950"
+ sodipodi:cx="179.28572"
+ sodipodi:cy="352.66592"
+ sodipodi:rx="32.857143"
+ sodipodi:ry="35"
+ d="M 197.59435,323.60313 A 32.857143,35 0 1 1 196.81963,323.06603"
+ sodipodi:start="5.3034219"
+ sodipodi:end="11.558474"
+ sodipodi:open="true"
+ transform="translate(-12.85714,0.714286)" />
+ <flowRoot
+ xml:space="preserve"
+ id="flowRoot1952"
+ transform="translate(-142.5493,128.5383)"
+ style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
+ id="flowRegion1954"><rect
+ id="rect1956"
+ width="170"
+ height="61.42857"
+ x="281.42856"
+ y="212.66591"
+ style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
+ id="flowPara1960">WebApp</flowPara></flowRoot> <path
+ style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 235,356.23734 C 200.71429,356.23734 200.71429,356.23734 200.71429,356.23734"
+ id="path1972" />
+ </g>
+</svg>
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/pom.xml b/sandbox/lresende/sca/samples/calculator-jsf-webapp/pom.xml
new file mode 100644
index 0000000000..9d874bf18c
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/pom.xml
@@ -0,0 +1,99 @@
+<?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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-calculator-jsf-webapp</artifactId>
+ <packaging>war</packaging>
+ <name>Apache Tuscany SCA Calculator Sample using JSF in a WebApp</name>
+
+ <repositories>
+ <repository>
+ <id>apache.incubator</id>
+ <url>http://people.apache.org/repo/m2-incubating-repository</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <version>1.1.5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>1.1.5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-webapp</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- marking dependency as provided to exclude from war file -->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.3</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.sca</groupId>
+ <artifactId>tuscany-maven-ant-generator</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/beans/Calculator.java b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/beans/Calculator.java
new file mode 100644
index 0000000000..f8ca02f8db
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/beans/Calculator.java
@@ -0,0 +1,78 @@
+package beans;
+
+import javax.faces.context.FacesContext;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+import calculator.CalculatorService;
+
+public class Calculator {
+ CalculatorService calculatorService;
+ Double number1 = 2.0;
+ Double number2 = 3.0;
+ Double result;
+ String operation;
+
+ public Double getNumber1() {
+ return number1;
+ }
+
+ public void setNumber1(Double number1) {
+ this.number1 = number1;
+ }
+
+ public Double getNumber2() {
+ return number2;
+ }
+
+ public void setNumber2(Double number2) {
+ this.number2 = number2;
+ }
+
+ public String getOperation() {
+ return operation;
+ }
+
+ public void setOperation(String operation) {
+ this.operation = operation;
+ }
+
+ public Calculator() {
+ SCADomain scaDomain = (SCADomain) FacesContext.getCurrentInstance().getExternalContext().getApplicationMap().get("org.apache.tuscany.sca.SCADomain");
+ System.out.println("scaDomain: " + scaDomain);
+// SCADomain scaDomain = (SCADomain) application.getAttribute("org.apache.tuscany.sca.SCADomain");
+ if(scaDomain != null) {
+ calculatorService = (CalculatorService)scaDomain.getService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+ }
+
+ public String callService() {
+ if(operation == null || calculatorService == null) {
+ result = 0.0;
+ }
+ else if(operation.equals("+")) {
+ result = calculatorService.add(number1, number2);
+ }
+ else if(operation.equals("-")) {
+ result = calculatorService.subtract(number1, number2);
+ }
+ else if(operation.equals("*")) {
+ result = calculatorService.multiply(number1, number2);
+ }
+ else if(operation.equals("/")) {
+ result = calculatorService.divide(number1, number2);
+ }
+ else {
+ result = 0.0;
+ }
+ return null;
+ }
+
+ public Double getResult() {
+ return result;
+ }
+
+ public void setResult(Double result) {
+ this.result = result;
+ }
+}
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/AddService.java b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/AddService.java
new file mode 100644
index 0000000000..a235e648c7
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/AddService.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 calculator;
+
+/**
+ * The interface for the add service
+ */
+public interface AddService {
+
+ double add(double n1, double n2);
+
+}
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/AddServiceImpl.java b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/AddServiceImpl.java
new file mode 100644
index 0000000000..8b6fe066a6
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/AddServiceImpl.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 calculator;
+
+/**
+ * An implementation of the Add service
+ */
+public class AddServiceImpl implements AddService {
+
+ public double add(double n1, double n2) {
+ return n1 + n2;
+ }
+
+}
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorClient.java b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorClient.java
new file mode 100644
index 0000000000..ac76137fcb
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorClient.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 calculator;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * and locate and invoke a SCA component
+ *
+ * (not really necessary as this sample runs in a webapp)
+ */
+public class CalculatorClient {
+ public static void main(String[] args) throws Exception {
+
+ SCADomain scaDomain = SCADomain.newInstance("Calculator.composite");
+ CalculatorService calculatorService =
+ scaDomain.getService(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));
+
+ scaDomain.close();
+
+ }
+
+}
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorService.java b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorService.java
new file mode 100644
index 0000000000..031fa8b912
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/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/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorServiceImpl.java b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorServiceImpl.java
new file mode 100644
index 0000000000..ba897fa301
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorServiceImpl.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 calculator;
+
+import org.osoa.sca.annotations.Reference;
+
+/**
+ * An implementation of the Calculator service.
+ */
+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/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/DivideService.java b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/DivideService.java
new file mode 100644
index 0000000000..497dafd4fd
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/DivideService.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 calculator;
+
+/**
+ * The interface for the divide service
+ */
+public interface DivideService {
+
+ double divide(double n1, double n2);
+
+}
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/DivideServiceImpl.java b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/DivideServiceImpl.java
new file mode 100644
index 0000000000..f7ac0b7287
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/DivideServiceImpl.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 calculator;
+
+/**
+ * An implementation of the Divide service.
+ */
+public class DivideServiceImpl implements DivideService {
+
+ public double divide(double n1, double n2) {
+ return n1 / n2;
+ }
+
+}
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/MultiplyService.java b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/MultiplyService.java
new file mode 100644
index 0000000000..5290605938
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/MultiplyService.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 calculator;
+
+/**
+ * The interface for the multiply service
+ */
+public interface MultiplyService {
+
+ double multiply(double n1, double n2);
+
+}
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/MultiplyServiceImpl.java b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/MultiplyServiceImpl.java
new file mode 100644
index 0000000000..b7dca792b2
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/MultiplyServiceImpl.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 calculator;
+
+/**
+ * An implementation of the Multiply service.
+ */
+public class MultiplyServiceImpl implements MultiplyService {
+
+ public double multiply(double n1, double n2) {
+ return n1 * n2;
+ }
+
+}
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/SubtractService.java b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/SubtractService.java
new file mode 100644
index 0000000000..376b3e5bb9
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/SubtractService.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 calculator;
+
+/**
+ * The interface for the subtract service
+ */
+public interface SubtractService {
+
+ double subtract(double n1, double n2);
+
+}
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/SubtractServiceImpl.java b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/SubtractServiceImpl.java
new file mode 100644
index 0000000000..77b128ab8d
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/SubtractServiceImpl.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 calculator;
+
+/**
+ * An implementation of the subtract service.
+ */
+public class SubtractServiceImpl implements SubtractService {
+
+ public double subtract(double n1, double n2) {
+ return n1 - n2;
+ }
+
+}
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/resources/Calculator.composite b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/resources/Calculator.composite
new file mode 100644
index 0000000000..ac9d010b48
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/resources/Calculator.composite
@@ -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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="Calculator">
+
+ <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/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/resources/wsdl/add.wsdl b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/resources/wsdl/add.wsdl
new file mode 100644
index 0000000000..ae1986c588
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/resources/wsdl/add.wsdl
@@ -0,0 +1,87 @@
+<?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 targetNamespace="http://calculator"
+ xmlns:tns="http://calculator"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ name="add">
+
+ <wsdl:types>
+ <schema elementFormDefault="qualified"
+ targetNamespace="http://calculator"
+ xmlns="http://www.w3.org/2001/XMLSchema">
+
+ <element name="add">
+ <complexType>
+ <sequence>
+ <element name="n1" type="xsd:double"/>
+ <element name="n2" type="xsd:double"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="addResponse">
+ <complexType>
+ <sequence>
+ <element name="response" type="xsd:double"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="addRequest">
+ <wsdl:part element="tns:add" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:message name="addResponse">
+ <wsdl:part element="tns:addResponse" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:portType name="Add">
+ <wsdl:operation name="add">
+ <wsdl:input message="tns:addRequest" name="addRequest"/>
+ <wsdl:output message="tns:addResponse" name="addResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="AddSoapBinding" type="tns:Add">
+ <wsdlsoap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="add">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input name="addRequest">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="addResponse">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="AddService">
+ <wsdl:port binding="tns:AddSoapBinding" name="AddSoapPort">
+ <wsdlsoap:address location="http://localhost:8080/sample-calculator-webapp/services/AddService"/>
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/META-INF/sca-contribution.xml b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..3ce1f21836
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:Calculator"/>
+</contribution> \ No newline at end of file
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/WEB-INF/faces-config.xml b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/WEB-INF/faces-config.xml
new file mode 100644
index 0000000000..4670164d90
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/WEB-INF/faces-config.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE faces-config PUBLIC
+ "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>calculator</managed-bean-name>
+ <managed-bean-class>beans.Calculator</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+</faces-config>
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/WEB-INF/web.xml b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000000..329e0a5bad
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,59 @@
+<?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.
+-->
+
+<!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>
+
+ <display-name>Apache Tuscany Calculator Web Service Sample</display-name>
+
+ <filter>
+ <filter-name>tuscany</filter-name>
+ <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>tuscany</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <listener>
+ <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.faces</url-pattern>
+ </servlet-mapping>
+
+ <welcome-file-list id="WelcomeFileList">
+ <welcome-file>calc.jsp</welcome-file>
+ </welcome-file-list>
+
+</web-app>
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/calc.jsp b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/calc.jsp
new file mode 100644
index 0000000000..4c4366747d
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/calc.jsp
@@ -0,0 +1,50 @@
+<%--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+--%>
+
+<%@ page import="org.apache.tuscany.sca.host.embedded.SCADomain"%>
+<%@ page import="calculator.CalculatorService" %>
+
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%
+ SCADomain scaDomain = (SCADomain) application.getAttribute("org.apache.tuscany.sca.SCADomain");
+ CalculatorService calculatorService = (CalculatorService)scaDomain.getService(CalculatorService.class, "CalculatorServiceComponent");
+%>
+<html>
+<head><title>Calculator sample</title></head>
+
+<body>
+<table>
+ <tr>
+ <th>Expression</th><th>Result</th>
+ </tr>
+ <tr>
+ <td>2 + 3</td><td><%= calculatorService.add(2, 3) %></td>
+ </tr>
+ <tr>
+ <td>3 - 2</td><td><%= calculatorService.subtract(3, 2) %></td>
+ </tr>
+ <tr>
+ <td>3 * 2</td><td><%= calculatorService.multiply(3, 2) %></td>
+ </tr>
+ <tr>
+ <td>3 / 2</td><td><%= calculatorService.divide(3, 2) %></td>
+ </tr>
+</table>
+</body>
+</html>
diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/calc_jsf.jsp b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/calc_jsf.jsp
new file mode 100644
index 0000000000..37985724d0
--- /dev/null
+++ b/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/calc_jsf.jsp
@@ -0,0 +1,27 @@
+<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%><%@taglib
+ uri="http://java.sun.com/jsf/html" prefix="h"%><%@ page language="java"
+ contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Insert title here</title>
+</head>
+<body>
+
+<f:view>
+ <h:form>
+ <h:inputText value="#{calculator.number1}" size="5"></h:inputText>
+ <h:selectOneMenu value="#{calculator.operation}">
+ <f:selectItem itemValue="+" />
+ <f:selectItem itemValue="-" />
+ <f:selectItem itemValue="*" />
+ <f:selectItem itemValue="/" />
+ </h:selectOneMenu>
+ <h:inputText value="#{calculator.number2}" size="5"></h:inputText>
+ <h:commandButton value="=" action="#{calculator.callService}"></h:commandButton>
+ <h:outputText value="#{calculator.result}"></h:outputText>
+ </h:form>
+</f:view>
+</body>
+</html> \ No newline at end of file
diff --git a/sandbox/lresende/sca/samples/company-das-webapp/build.xml b/sandbox/lresende/sca/samples/company-das-webapp/build.xml
new file mode 100644
index 0000000000..feef76481b
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das-webapp/build.xml
@@ -0,0 +1,55 @@
+<?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 name="samples" default="compile">
+ <property name="mainDir" value="../../.."/>
+ <path id="javac.classpath">
+ <fileset dir="${mainDir}/lib">
+ <include name="tuscany-runtime-incubating-M1.jar"/>
+ </fileset>
+ </path>
+ <path id="java.classpath">
+ <fileset dir="${mainDir}/lib">
+ <include name="tuscany-runtime-incubating-M1.jar"/>
+ </fileset>
+ <pathelement path="target/sample-companyweb.jar"/>
+ </path>
+
+ <target name="init">
+ <mkdir dir="target/classes"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac srcdir="src/main/java" destdir="target/classes" debug="on" source="1.5" target="1.5">
+ <classpath refid="javac.classpath"/>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ </copy>
+ <war destfile="target/sample-companyweb.war" webxml="src/main/webapp/WEB-INF/web.xml">
+ <classes dir="target/classes"/>
+ </war>
+ </target>
+
+ <target name="clean">
+ <delete quiet="true" includeemptydirs="true">
+ <fileset dir="target" excludes="sample-companyweb-incubating-M1.war"/>
+ </delete>
+ </target>
+</project>
diff --git a/sandbox/lresende/sca/samples/company-das-webapp/company.sql b/sandbox/lresende/sca/samples/company-das-webapp/company.sql
new file mode 100644
index 0000000000..8fb5c2d4cd
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das-webapp/company.sql
@@ -0,0 +1,40 @@
+DROP TABLE EMPLOYEE;
+DROP TABLE DEPARTMENT;
+DROP TABLE COMPANY;
+
+CREATE TABLE COMPANY (
+ ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY,
+ NAME VARCHAR(30));
+
+CREATE TABLE DEPARTMENT (ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY,
+ NAME VARCHAR(30),
+ LOCATION VARCHAR(30),
+ DEPNUMBER VARCHAR(10),
+ COMPANYID INT);
+
+CREATE TABLE EMPLOYEE (ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY,
+ NAME VARCHAR(30),
+ SN VARCHAR(10),
+ MANAGER SMALLINT,
+ DEPARTMENTID INT);
+
+
+INSERT INTO COMPANY (NAME) VALUES('ACME Publishing');
+INSERT INTO COMPANY (NAME) VALUES('Do-rite plumbing');
+INSERT INTO COMPANY (NAME) VALUES('MegaCorp');
+
+INSERT INTO DEPARTMENT (NAME, LOCATION, DEPNUMBER, COMPANYID) VALUES('Advanced Technologies','NY','123', 1);
+INSERT INTO DEPARTMENT (NAME, LOCATION, DEPNUMBER, COMPANYID) VALUES('Default Name 2','','', 1);
+INSERT INTO DEPARTMENT (NAME, LOCATION, DEPNUMBER, COMPANYID) VALUES('Default Name 3','','', 1);
+INSERT INTO DEPARTMENT (NAME, LOCATION, DEPNUMBER, COMPANYID) VALUES('Default Name 4','','', 1);
+INSERT INTO DEPARTMENT (NAME, LOCATION, DEPNUMBER, COMPANYID) VALUES('Default Name 5','','', 1);
+INSERT INTO DEPARTMENT (NAME, LOCATION, DEPNUMBER, COMPANYID) VALUES('Default Name 6','','', 1);
+INSERT INTO DEPARTMENT (NAME, LOCATION, DEPNUMBER, COMPANYID) VALUES('Default Name 7','','', 1);
+INSERT INTO DEPARTMENT (NAME, LOCATION, DEPNUMBER, COMPANYID) VALUES('Default Name 8','','', 1);
+
+INSERT INTO EMPLOYEE (NAME, SN, MANAGER, DEPARTMENTID) VALUES('John Jones','E0001', 0, 1);
+INSERT INTO EMPLOYEE (NAME, SN, MANAGER, DEPARTMENTID) VALUES('Mary Smith','E0002', 1, null);
+INSERT INTO EMPLOYEE (NAME, SN, MANAGER, DEPARTMENTID) VALUES('Jane Doe','E0003', 0, 1);
+INSERT INTO EMPLOYEE (NAME, SN, MANAGER, DEPARTMENTID) VALUES('Al Smith','E0004', 1, 1);
+
+
diff --git a/sandbox/lresende/sca/samples/company-das-webapp/pom.xml b/sandbox/lresende/sca/samples/company-das-webapp/pom.xml
new file mode 100644
index 0000000000..12838b6565
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das-webapp/pom.xml
@@ -0,0 +1,138 @@
+<?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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>1.1-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-company-das-webapp</artifactId>
+ <name>Apache Tuscany SCA Company Sample Web Client</name>
+ <packaging>war</packaging>
+
+ <dependencies>
+
+ <!-- runtime is need for webapp integration to include jar -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-webapp</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- das & sdo -->
+ <dependency>
+ <groupId>org.apache.tuscany.das</groupId>
+ <artifactId>tuscany-das-rdb</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-impl</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- testing -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <!-- this will place the java source files inside the war -->
+ <build>
+ <finalName>${artifactId}</finalName>
+ <sourceDirectory>src/main/java</sourceDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/java</directory>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sql-maven-plugin</artifactId>
+ <!-- 1.1 due to MOJO-619 -->
+ <version>1.1-SNAPSHOT</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.1.2.1</version>
+ </dependency>
+ </dependencies>
+
+ <executions>
+ <execution>
+ <id>create-db</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:${pom.basedir}/target/classes/company_db;create=true</url>
+ <autocommit>true</autocommit>
+ <onError>continue</onError>
+ <onConnectionError>skip</onConnectionError>
+ <delimiter>;</delimiter>
+ <srcFiles>
+ <srcFile>${pom.basedir}/company.sql</srcFile>
+ </srcFiles>
+ </configuration>
+ </execution>
+
+ <!-- Shutdown DB in order to be able to run unit tests -->
+ <execution>
+ <id>shutdown-database-sothat-test-can-run</id>
+ <phase>process-test-resources</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:${pom.basedir}/target/classes/company_db;shutdown=true</url>
+ <skipOnConnectionError>true</skipOnConnectionError>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sandbox/lresende/sca/samples/company-das-webapp/readme.html b/sandbox/lresende/sca/samples/company-das-webapp/readme.html
new file mode 100644
index 0000000000..65a50de320
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das-webapp/readme.html
@@ -0,0 +1,199 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT 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=windows-1252">
+<title>Tuscany RDB DAS Service client</title>
+
+<style>
+.code {font-size: 11px; color: #006699}
+.codebox {border: 1px solid #6699CC; background-color: #F1F7FA;padding:15px}
+.codebox2 {border: 1px solid #6699CC; background-color: #F1F7FA;padding:15px; width:85%}
+.codeboxW {border: 1px solid #6699CC; background-color: #FFFFFF;padding:15px}
+.codeboxB {background-color: #C9DBED;padding:1px 10px 10px 10px}
+</style>
+
+</head>
+
+
+
+
+<body>
+
+<h1>Tuscany RDB DAS Service client</h1>
+
+
+<h3>Introduction</h3>
+
+<p>
+This stand-alone sample application demonstrate how to consume the DAS Service exposed trough an SCA service.<br>
+The application starts with a canned database of Companies and their related Departments.<br>
+Through the web page interface, a user can consume the DAS Service to display the list of available companies.<br>
+The sample runs on Tomcat 5.5 and employs a Derby database accessed via a DataSource.
+</p>
+
+
+
+
+
+<h3>Running the sample</h3>
+
+<p>There are two options for running this sample:</p>
+
+<ol>
+ <li>Run from Tomcat configured by the build</li>
+ <li>Deploying the DASService.client WAR into a Tomcat you configure yourself</li>
+</ol>
+
+
+<h3>Running from Tomcat configured by the build</h3>
+
+<p>
+This sample application is deployed (along with the canned test database) to an instance of Tomcat as part of our automated sample
+testing.This means you can run the java/samples/testing/tomcat build (see java/das/samples/testing/tomcat/readme.htm ) and then access
+the application by pointing your browser to http://localhost:8080/companyweb-service-client/
+</p>
+
+
+
+<h3>Deploying the DASService.client WAR into a Tomcat you configure yourself</h3>
+
+<p>
+Alternatively, you can deploy the sample to your own configured Tomcat installation by following the instructions below.
+These instructions assume that you have either 1) downloaded the Tuscany sample distribution or 2) Downloaded the Tuscany
+source and run our maven build, see the following link to more details steps on how to build DAS Sample applications <a
+href="http://incubator.apache.org/tuscany/java_das_overview.html">http://incubator.apache.org/tuscany/java_das_overview.html</a>.
+</p>
+
+<p><b><u>Set Up:</u></b></p>
+
+
+<ol>
+ <li>Download and install the most recent stable version of Tomcat 5.5. You can find it here: <a
+ href="http://tomcat.apache.org/download-55.cgi">http://tomcat.apache.org/download-55.cgi</a></li>
+ <li>Download the most recent official release of Derby from here: <a href="http://db.apache.org/derby/index.html">http://db.apache.org/derby/index.html</a>.
+ The only file you’ll need from this download is derby.jar</li>
+ <li>Stop Tomcat</li>
+ <li>Copy derby.jar (from the derby distribution) to {Tomcat_Home}/common/lib:</li>
+ <li>Add the sample war file to {Tomcat_Home}/webapps</li>
+ <ol start=1 type=a>
+ <li>sample-das-service-client-xxx.war (e.g.sample-das-service-client-1.0-incubator-SNAPSHOT.war)</li>
+ </ol>
+ <li>Install the canned Derby database to Tomcat: </li>
+ <ol start=1 type=a>
+ <li>First, create a new directory named “Databases” to hold the sample database. Create {Tomcat_Home}/Databases</li>
+ <li>Copy the <b>dastest</b> folder (and all its contents) from {build directory root OR
+ where samples where unzipped}/java/das/samples/DASService.client to {Tomcat_Home}/Databases.<br>
+ <br>
+ <b>NOTE</b>: If you are running this from a sample distribution, the canned database is available in the
+ distribution, inside the databases directory. </li>
+ </ol>
+ <li>Define a DataSource by adding a datasource definition to {Tomcat_Home}/conf/server.xml.</li>
+ <ol start=1 type=a>
+ <li>Find the end-of-section marker &lt;/GlobalNamingResources&gt; and add the following lines just above it:
+ <p>
+ <div class="codebox2">
+ <pre>
+ &lt;!-- Global Datasource for Derby dastest database --&gt;
+ &lt;Resource name="jdbc/dastest"
+ type="javax.sql.DataSource" auth="Container"
+ description="Derby database for DAS Company sample"
+ maxActive="100" maxIdle="30" maxWait="10000"
+ username="" password=""
+ driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
+ url="jdbc:derby:{absolute path}Databases/dastest"/&gt;
+ </pre>
+ </div>
+ </p>
+ <p><b>Requirement</b>:You must include the absolute path to the “Databases” directory in the above url attribute. Fore example:</p>
+ <p><pre> url=&quot;jdbc:derby:c:\apache-tomcat-5.5.17\Databases/dastest&quot;</pre></p>
+ </li>
+ </ol>
+ <li><p>Start tomcat and point your browser to: <a href="http://localhost:8080/sample-das-service-client-%7bversion%20tag%7d/">http://localhost:8080/sample-das-service-client-{version
+ tag}/</a>. Example:</p>
+ <p><pre> http://localhost:8080/sample-das-service-client-1.0-incubator-SNAPSHOT/</pre></p>
+
+ </li>
+
+</ol>
+
+
+
+
+<h3>Sample Architecture</h3>
+
+<p>This is a simple, single-page, web application to consume DAS exposed as an SCA service.</p>
+<p>The main components of this application are:</p>
+
+<ul type=disc>
+ <li>The SCA DAS Service</li>
+ <li>SDO</li>
+ <li>Company.jsp</li>
+ <li>The canned Derby database</li>
+</ul>
+
+
+<p>The <b>Company.jsp</b> directly invoke the DAS Service to get a list of companies available and then iterate trough the SDO data graphs and manipulate SDO directly to display data</p>
+
+<p>The canned <b>Derby database</b> comes preloaded with Companies and related Departments. The Derby database instance is a simple file folder.</p>
+
+<p>The <b>SCA DAS Service</b> accepts directives (commands) and reads and writes to the derby database instance appropriately using DAS as the service implementation.</p>
+
+
+
+<h3>Consuming the DAS service</h3>
+
+<p>First, note that the application have dependencies on the DAS Service:</p>
+
+
+<p>
+<div class="codebox2">
+<pre>
+&lt;!-- DAS Service --&gt;
+&lt;dependency&gt;
+ &lt;groupId&gt;org.apache.tuscany.das.samples&lt;/groupId&gt;
+ &lt;artifactId&gt;sample-das-service&lt;/artifactId&gt;
+ &lt;version&gt;${pom.version}&lt;/version&gt;
+&lt;/dependency&gt;
+</pre>
+</div>
+</p>
+
+<br>
+<p>And the SCDL references the service:</p>
+
+<p>
+<div class="codebox2">
+<pre>
+&lt;composite xmlns="http://www.osoa.org/xmlns/sca/1.0" name="DASServiceComposite"&gt;
+ &lt;component name="DASServiceComponent"&gt;
+ &lt;implementation.composite name="DASServiceComposite" jarLocation="lib/sample-das-service-1.0-incubator-SNAPSHOT.jar"/&gt;
+ &lt;/component&gt;
+&lt;/composite&gt;
+</pre>
+</div>
+</p>
+
+
+
+
+</body>
+
+</html>
diff --git a/sandbox/lresende/sca/samples/company-das-webapp/src/main/java/das/DASService.java b/sandbox/lresende/sca/samples/company-das-webapp/src/main/java/das/DASService.java
new file mode 100644
index 0000000000..0387341b87
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das-webapp/src/main/java/das/DASService.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package das;
+
+import java.io.InputStream;
+import java.util.Vector;
+
+import commonj.sdo.DataObject;
+
+public interface DASService {
+
+ /**
+ * Set DAS configuration file to be used
+ * @param configStream
+ * @throws DASServiceException
+ */
+ public void configureService(InputStream configStream) throws DASServiceException;
+
+ /**
+ * Execute an existing command. The commands are defined in the DAS Configuration file being used by the service
+ * @param commandName Command name as it appears on the DAS Configuration file
+ * @param commandArguments Vector with arguments to be used by the command
+ * @throws DASServiceException
+ * @return
+ */
+ public DataObject executeCommand(String commandName, Vector commandArguments) throws DASServiceException;
+
+ /**
+ * Execute a new command, this can be any arbitrary valid query based on the backend implementation (e.g. SQL Query for DAS RDB)
+ * @param adHocQuery A new command to be executed (e.g SQL Query)
+ * @param commandArguments Vector with arguments to be used by the command
+ * @throws DASServiceException
+ * @return
+ */
+ public DataObject execute(String adHocQuery, Vector commandArguments) throws DASServiceException;
+
+ /**
+ * Apply all changes on the graph back to the persistent repository.
+ * This would save the changes on the SDO ChangeSummary back to the database
+ * Note: Your SDO ojects should have been created with ChangeSummary support
+ * @param graphRoot SDO Object with changes to be commited to persistent repository
+ * @throws DASServiceException
+ */
+ public void applyChanges(DataObject graphRoot) throws DASServiceException;
+}
diff --git a/sandbox/lresende/sca/samples/company-das-webapp/src/main/java/das/DASServiceException.java b/sandbox/lresende/sca/samples/company-das-webapp/src/main/java/das/DASServiceException.java
new file mode 100644
index 0000000000..e62201a4de
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das-webapp/src/main/java/das/DASServiceException.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 das;
+
+public class DASServiceException extends Exception {
+
+ private static final long serialVersionUID = -7514653215235902874L;
+
+ public DASServiceException() {
+ super();
+ }
+
+ public DASServiceException(String msg) {
+ super(msg);
+ }
+
+ public DASServiceException(String msg, Throwable ex) {
+ super(msg, ex);
+ }
+
+}
diff --git a/sandbox/lresende/sca/samples/company-das-webapp/src/main/java/das/DASServiceImpl.java b/sandbox/lresende/sca/samples/company-das-webapp/src/main/java/das/DASServiceImpl.java
new file mode 100644
index 0000000000..a0dd38601a
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das-webapp/src/main/java/das/DASServiceImpl.java
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package das;
+
+import java.io.InputStream;
+import java.util.Vector;
+
+import org.apache.tuscany.das.rdb.Command;
+import org.apache.tuscany.das.rdb.DAS;
+import org.osoa.sca.annotations.Scope;
+
+import commonj.sdo.DataObject;
+
+@Scope("COMPOSITE")
+public class DASServiceImpl implements DASService {
+
+ private DAS das = null;
+
+
+ /**
+ * Initialize DAS
+ * @return
+ * @throws DASServiceException
+ */
+ private void initDAS(InputStream config) throws DASServiceException {
+ if(config == null){
+ throw new DASServiceException("Missing configuration information");
+ }
+
+ if(this.das != null){
+ this.das.releaseResources();
+ this.das = null;
+ }
+
+ this.das = DAS.FACTORY.createDAS(config);
+ }
+
+ /**
+ * Get a DAS instance based on the configuration
+ * @return
+ * @throws DASServiceException
+ */
+ private DAS getDAS() throws DASServiceException {
+ if(this.das == null){
+ throw new DASServiceException("DAS not initialized. Please provide DAS configuration torugh das.SetConfig");
+ }
+
+ return this.das;
+ }
+
+ /**
+ * Set DAS configuration file to be used
+ * @param configStream
+ * @throws DASServiceException
+ */
+ public void configureService(InputStream configStream) throws DASServiceException{
+ this.initDAS(configStream);
+ }
+
+
+
+ /**
+ * Execute an existing command. The commands are defined in the DAS Configuration file being used by the service
+ * @param commandName Command name as it appears on the DAS Configuration file
+ * @param commandArguments Vector with arguments to be used by the command
+ * @throws DASServiceException
+ * @return
+ */
+ public DataObject executeCommand(String commandName, Vector commandArguments) throws DASServiceException{
+ Command command = this.getDAS().getCommand(commandName);
+
+ if(command == null){
+ throw new DASServiceException("Invalid command: " + commandName);
+ }
+
+ //check if arguments was passed
+ if(commandArguments != null && commandArguments.size() > 0){
+ //we need to set the arguments
+ int pos=0;
+ for(Object argument : commandArguments){
+ pos++;
+ command.setParameter(pos, argument);
+ }
+ }
+
+ DataObject root = command.executeQuery();
+
+ return root;
+ }
+
+ /**
+ * Execute a new command, this can be any arbitrary valid query based on the backend implementation (e.g. SQL Query for DAS RDB)
+ * @param newCommand A new command to be executed (e.g SQL Query)
+ * @param commandArguments Vector with arguments to be used by the command
+ * @throws DASServiceException
+ * @return
+ */
+ public DataObject execute(String adHocQuery, Vector commandArguments) throws DASServiceException {
+ Command command = this.getDAS().createCommand(adHocQuery);
+
+ if(command == null){
+ throw new DASServiceException("Invalid command: " + adHocQuery);
+ }
+
+ //check if arguments was passed
+ if(commandArguments != null && commandArguments.size() > 0){
+ //we need to set the arguments
+ int pos=0;
+ for(Object argument : commandArguments){
+ pos++;
+ command.setParameter(pos, argument);
+ }
+ }
+ DataObject root = command.executeQuery();
+
+ return root;
+ }
+
+ /**
+ * Apply all changes on the graph back to the persistent repository.
+ * This would save the changes on the SDO ChangeSummary back to the database
+ * Note: Your SDO ojects should have been created with ChangeSummary support
+ * @throws DASServiceException
+ * @param graphRoot SDO Object with changes to be commited to persistent repository
+ */
+ public void applyChanges(DataObject graphRoot) throws DASServiceException{
+ // TODO Auto-generated method stub
+
+ }
+}
diff --git a/sandbox/lresende/sca/samples/company-das-webapp/src/main/resources/company.xml b/sandbox/lresende/sca/samples/company-das-webapp/src/main/resources/company.xml
new file mode 100644
index 0000000000..9d0d8e944c
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das-webapp/src/main/resources/company.xml
@@ -0,0 +1,46 @@
+<?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.
+ -->
+<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <ConnectionInfo dataSource="java:comp/env/jdbc/company_db"/>
+
+ <Command name="all companies" SQL="select * from COMPANY" kind="Select"/>
+
+ <Command name="all companies and departments" SQL="select * from COMPANY left outer join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID" kind="Select"/>
+
+ <Command name="all departments for company" SQL="select * from COMPANY inner join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID where COMPANY.ID = ?" kind="Select"/>
+
+ <Command name="company by id with departments" SQL="select * from COMPANY left outer join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID where COMPANY.ID = ?" kind="Select"/>
+
+
+ <Table tableName="COMPANY">
+ <Column columnName="ID" primaryKey="true" generated="true"/>
+ </Table>
+
+ <Table tableName="DEPARTMENT">
+ <Column columnName="ID" primaryKey="true" generated="true"/>
+ </Table>
+
+ <Relationship name="departments" primaryKeyTable="COMPANY" foreignKeyTable="DEPARTMENT" many="true">
+ <KeyPair primaryKeyColumn="ID" foreignKeyColumn="COMPANYID"/>
+ </Relationship>
+
+
+</Config>
diff --git a/sandbox/lresende/sca/samples/company-das-webapp/src/main/resources/dasservice.composite b/sandbox/lresende/sca/samples/company-das-webapp/src/main/resources/dasservice.composite
new file mode 100644
index 0000000000..6530e68050
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das-webapp/src/main/resources/dasservice.composite
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://das-service"
+ xmlns:das-service="http://das-service"
+ name="DASService">
+
+ <component name="DASServiceComponent">
+ <implementation.java class="das.DASServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/sandbox/lresende/sca/samples/company-das-webapp/src/main/resources/log4j.properties b/sandbox/lresende/sca/samples/company-das-webapp/src/main/resources/log4j.properties
new file mode 100644
index 0000000000..c5c2868aaa
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das-webapp/src/main/resources/log4j.properties
@@ -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.
+#
+# Set root logger level to DEBUG and its only appender to A1.
+log4j.rootLogger=INFO, A1
+
+# A1 is set to be a ConsoleAppender.
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+
+# A1 uses PatternLayout.
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=[DAS RDB] - %c{1}.%M (%L) : %m %n
+
+# Print only messages of level WARN or above in the package com.foo.
+log4j.logger.org.apache.tuscany=NONE \ No newline at end of file
diff --git a/sandbox/lresende/sca/samples/company-das-webapp/src/main/webapp/Company.jsp b/sandbox/lresende/sca/samples/company-das-webapp/src/main/webapp/Company.jsp
new file mode 100644
index 0000000000..67d7ead499
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das-webapp/src/main/webapp/Company.jsp
@@ -0,0 +1,97 @@
+<!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.
+ -->
+
+<%@ page import="java.util.*" %>
+
+<%@ page import="org.apache.tuscany.sca.host.embedded.SCADomain"%>
+
+<%@ page import="commonj.sdo.*" %>
+<%@ page import="das.*" %>
+
+<html>
+<head>
+<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
+<%
+
+ SCADomain domain = (SCADomain) application.getAttribute("org.apache.tuscany.sca.SCADomain");
+ if (domain == null) {
+ System.out.println("domain == NULL");
+ }
+
+
+ DASService dasService = domain.getService(DASService.class, "DASServiceComponent");
+
+ if (dasService == null) {
+ System.out.println("DASService == NULL");
+ }
+
+ List companyList = null;
+
+ try{
+ dasService.configureService(this.getClass().getClassLoader().getResourceAsStream("company.xml"));
+ DataObject root = dasService.executeCommand("all companies", null);
+ companyList = root.getList("COMPANY");
+ if(companyList == null) {
+ System.out.println("::NULL::");
+ }
+ }catch(Exception e){
+ //TODO: handle case where dasService can't be initiated properly
+ e.printStackTrace();
+ }
+
+%>
+
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>DASService Client Test</title>
+</head>
+<body>
+
+<H2>Tuscany DAS Service WEB Client Application Example</H2>
+
+<!-- Do Fill -->
+<table border>
+ <thead>
+ <tr>
+ <th>ID</th>
+ <th>Name</th>
+ </tr>
+ </thead>
+ <tbody>
+
+ <%
+ java.util.Iterator i = companyList.iterator();
+ while (i.hasNext()) {
+ DataObject company = (DataObject)i.next();
+ %>
+ <tr>
+ <td><%=company.getInt("ID")%></td>
+ <td><%=company.getString("NAME")%></td>
+ <tr>
+ <%
+ }
+ %>
+ </tbody>
+</table>
+
+
+
+</form>
+</body>
+</html>
diff --git a/sandbox/lresende/sca/samples/company-das-webapp/src/main/webapp/META-INF/context.xml b/sandbox/lresende/sca/samples/company-das-webapp/src/main/webapp/META-INF/context.xml
new file mode 100644
index 0000000000..0e90eb0a83
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das-webapp/src/main/webapp/META-INF/context.xml
@@ -0,0 +1,25 @@
+<?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.
+ -->
+<Context path="/DAS Stand alone app" debug="5" reloadable="true" crossContext="true">
+
+ <Manager pathname=""/>
+ <ResourceLink name="jdbc/dastest" global="jdbc/dastest" type="javax.sql.DataSource" />
+
+</Context>
diff --git a/sandbox/lresende/sca/samples/company-das-webapp/src/main/webapp/META-INF/sca-contribution.xml b/sandbox/lresende/sca/samples/company-das-webapp/src/main/webapp/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..25849fa6b9
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das-webapp/src/main/webapp/META-INF/sca-contribution.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:DASService"/>
+</contribution> \ No newline at end of file
diff --git a/sandbox/lresende/sca/samples/company-das-webapp/src/main/webapp/WEB-INF/web.xml b/sandbox/lresende/sca/samples/company-das-webapp/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000000..67a782269e
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das-webapp/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,35 @@
+<?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.
+ -->
+<!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>
+
+ <display-name>Tuscany DAS Service Client Application</display-name>
+
+ <listener>
+ <listener-class>org.apache.tuscany.sca.host.webapp.TuscanyContextListener</listener-class>
+ </listener>
+
+ <welcome-file-list id="WelcomeFileList">
+ <welcome-file>Company.jsp</welcome-file>
+ </welcome-file-list>
+
+</web-app>
diff --git a/sandbox/lresende/sca/samples/company-das/build.xml b/sandbox/lresende/sca/samples/company-das/build.xml
new file mode 100644
index 0000000000..704b698aac
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das/build.xml
@@ -0,0 +1,116 @@
+<?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 name="sample-company-das" default="compile">
+
+ <target name="compile">
+ <mkdir dir="target/classes"/>
+ <javac destdir="target/classes" debug="on" source="1.5" target="1.5">
+ <src path="src\main\java"/>
+ <classpath>
+ <fileset refid="tuscany.jars"/>
+ <fileset refid="3rdparty.jars"/>
+ </classpath>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src\main\resources"/>
+ <fileset dir="."/>
+ </copy>
+ <jar destfile="target/sample-company-das.jar" basedir="target/classes">
+ <manifest>
+ <attribute name="Main-Class" value="das.DASServiceClient"/>
+ </manifest>
+ </jar>
+ </target>
+
+ <target name="run">
+ <java classname="org.apache.tuscany.samples.das.service.client.DASServiceClient" fork="true">
+ <classpath>
+ <pathelement location="target/sample-company-das.jar"/>
+ <fileset refid="tuscany.jars"/>
+ <fileset refid="3rdparty.jars"/>
+ </classpath>
+ </java>
+ </target>
+
+ <target name="clean">
+ <delete includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ </target>
+
+ <fileset id="tuscany.jars" dir="../../modules">
+ <include name="tuscany-interface-java-xml-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-implementation-java-runtime-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-implementation-java-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-node-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-binding-sca-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-assembly-xml-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-interface-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-contribution-java-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-implementation-java-xml-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-policy-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-binding-sca-xml-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-contribution-impl-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-definitions-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-core-spi-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-contribution-namespace-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-domain-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-contribution-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-node-api-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-interface-java-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-definitions-xml-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-sca-api-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-assembly-xsd-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-policy-logging-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-assembly-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-core-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-core-databinding-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-host-embedded-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-domain-api-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-databinding-1.0.1-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-policy-xml-1.0.1-incubating-SNAPSHOT.jar"/>
+ </fileset>
+ <fileset id="3rdparty.jars" dir="../../lib">
+ <include name="stax-api-1.0.1.jar"/>
+ <include name="tuscany-das-rdb-1.0-incubating-beta2.jar"/>
+ <include name="xml-apis-1.3.03.jar"/>
+ <include name="wstx-asl-3.2.0.jar"/>
+ <include name="commons-logging-1.1.jar"/>
+ <include name="axiom-impl-1.2.5.jar"/>
+ <include name="xalan-2.7.0.jar"/>
+ <include name="log4j-1.2.14.jar"/>
+ <include name="tuscany-sdo-lib-1.0-incubating.jar"/>
+ <include name="tuscany-sdo-api-r2.1-1.0-incubating.jar"/>
+ <include name="ecore-xmi-2.2.3.jar"/>
+ <include name="neethi-2.0.2.jar"/>
+ <include name="geronimo-commonj_1.1_spec-1.0.jar"/>
+ <include name="jaxen-1.1-beta-9.jar"/>
+ <include name="ecore-2.2.3.jar"/>
+ <include name="common-2.2.3.jar"/>
+ <include name="axiom-api-1.2.5.jar"/>
+ <include name="xsd-2.2.3.jar"/>
+ <include name="xercesImpl-2.8.1.jar"/>
+ <include name="cglib-nodep-2.1_3.jar"/>
+ <include name="tuscany-sdo-impl-1.0-incubating.jar"/>
+ <include name="ecore-change-2.2.3.jar"/>
+ </fileset>
+
+</project>
diff --git a/sandbox/lresende/sca/samples/company-das/company.sql b/sandbox/lresende/sca/samples/company-das/company.sql
new file mode 100644
index 0000000000..8fb5c2d4cd
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das/company.sql
@@ -0,0 +1,40 @@
+DROP TABLE EMPLOYEE;
+DROP TABLE DEPARTMENT;
+DROP TABLE COMPANY;
+
+CREATE TABLE COMPANY (
+ ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY,
+ NAME VARCHAR(30));
+
+CREATE TABLE DEPARTMENT (ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY,
+ NAME VARCHAR(30),
+ LOCATION VARCHAR(30),
+ DEPNUMBER VARCHAR(10),
+ COMPANYID INT);
+
+CREATE TABLE EMPLOYEE (ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY,
+ NAME VARCHAR(30),
+ SN VARCHAR(10),
+ MANAGER SMALLINT,
+ DEPARTMENTID INT);
+
+
+INSERT INTO COMPANY (NAME) VALUES('ACME Publishing');
+INSERT INTO COMPANY (NAME) VALUES('Do-rite plumbing');
+INSERT INTO COMPANY (NAME) VALUES('MegaCorp');
+
+INSERT INTO DEPARTMENT (NAME, LOCATION, DEPNUMBER, COMPANYID) VALUES('Advanced Technologies','NY','123', 1);
+INSERT INTO DEPARTMENT (NAME, LOCATION, DEPNUMBER, COMPANYID) VALUES('Default Name 2','','', 1);
+INSERT INTO DEPARTMENT (NAME, LOCATION, DEPNUMBER, COMPANYID) VALUES('Default Name 3','','', 1);
+INSERT INTO DEPARTMENT (NAME, LOCATION, DEPNUMBER, COMPANYID) VALUES('Default Name 4','','', 1);
+INSERT INTO DEPARTMENT (NAME, LOCATION, DEPNUMBER, COMPANYID) VALUES('Default Name 5','','', 1);
+INSERT INTO DEPARTMENT (NAME, LOCATION, DEPNUMBER, COMPANYID) VALUES('Default Name 6','','', 1);
+INSERT INTO DEPARTMENT (NAME, LOCATION, DEPNUMBER, COMPANYID) VALUES('Default Name 7','','', 1);
+INSERT INTO DEPARTMENT (NAME, LOCATION, DEPNUMBER, COMPANYID) VALUES('Default Name 8','','', 1);
+
+INSERT INTO EMPLOYEE (NAME, SN, MANAGER, DEPARTMENTID) VALUES('John Jones','E0001', 0, 1);
+INSERT INTO EMPLOYEE (NAME, SN, MANAGER, DEPARTMENTID) VALUES('Mary Smith','E0002', 1, null);
+INSERT INTO EMPLOYEE (NAME, SN, MANAGER, DEPARTMENTID) VALUES('Jane Doe','E0003', 0, 1);
+INSERT INTO EMPLOYEE (NAME, SN, MANAGER, DEPARTMENTID) VALUES('Al Smith','E0004', 1, 1);
+
+
diff --git a/sandbox/lresende/sca/samples/company-das/pom.xml b/sandbox/lresende/sca/samples/company-das/pom.xml
new file mode 100644
index 0000000000..2c0ba4da8b
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das/pom.xml
@@ -0,0 +1,149 @@
+<?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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>1.1-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-company-das</artifactId>
+ <name>Apache Tuscany SCA Company Data Access Service Sample</name>
+ <packaging>jar</packaging>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-impl</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.das</groupId>
+ <artifactId>tuscany-das-rdb</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.1.2.1</version>
+ <scope>test</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>das.DASServiceClient</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sql-maven-plugin</artifactId>
+ <!-- 1.1 due to MOJO-619 -->
+ <version>1.1-SNAPSHOT</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.1.2.1</version>
+ </dependency>
+ </dependencies>
+
+ <executions>
+ <execution>
+ <id>create-db</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:${pom.basedir}/target/company_db;create=true</url>
+ <autocommit>true</autocommit>
+ <onError>continue</onError>
+ <onConnectionError>skip</onConnectionError>
+ <delimiter>;</delimiter>
+ <srcFiles>
+ <srcFile>${pom.basedir}/company.sql</srcFile>
+ </srcFiles>
+ </configuration>
+ </execution>
+
+ <!-- Shutdown DB in order to be able to run unit tests -->
+ <execution>
+ <id>shutdown-database-sothat-test-can-run</id>
+ <phase>process-test-resources</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+ <url>jdbc:derby:${pom.basedir}/target/company_db;shutdown=true</url>
+ <skipOnConnectionError>true</skipOnConnectionError>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sandbox/lresende/sca/samples/company-das/readme.html b/sandbox/lresende/sca/samples/company-das/readme.html
new file mode 100644
index 0000000000..ec6b492b72
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das/readme.html
@@ -0,0 +1,110 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT 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=windows-1252">
+<title>Tuscany RDB DAS exposed as an SCA service</title>
+
+<style>
+.code {font-size: 11px; color: #006699}
+.codebox {border: 1px solid #6699CC; background-color: #F1F7FA;padding:15px}
+.codebox2 {border: 1px solid #6699CC; background-color: #F1F7FA;padding:15px; width:85%}
+.codeboxW {border: 1px solid #6699CC; background-color: #FFFFFF;padding:15px}
+.codeboxB {background-color: #C9DBED;padding:1px 10px 10px 10px}
+</style>
+
+</head>
+
+
+
+
+<body>
+
+<h1>Tuscany RDB DAS exposed as an SCA service</h1>
+
+
+<h3>Introduction</h3>
+
+<p>This is a sample SCA service that exposes DAS functionality.</p>
+<p>This service would allow you to utilize DAS in a language neutral fashion, consuming existent or adHoc commands.</p>
+
+
+<h3>Consuming the DAS service</h3>
+
+
+<p>You should add the dependency on your client project pom file</p>
+
+
+<p>
+<div class="codebox2">
+<pre>
+&lt;!-- DAS Service --&gt;
+&lt;dependency&gt;
+ &lt;groupId&gt;org.apache.tuscany.das.samples&lt;/groupId&gt;
+ &lt;artifactId&gt;sample-das-service&lt;/artifactId&gt;
+ &lt;version&gt;${pom.version}&lt;/version&gt;
+&lt;/dependency&gt;
+</pre>
+</div>
+</p>
+
+<br>
+<p>In order to consume the service, you would have to create a SCDL that references it, see sample below:</p>
+
+<p>
+<div class="codebox2">
+<pre>
+&lt;composite xmlns="http://www.osoa.org/xmlns/sca/1.0" name="DASServiceComposite"&gt;
+ &lt;component name="DASServiceComponent"&gt;
+ &lt;implementation.composite name="DASServiceComposite" jarLocation="lib/sample-das-service-1.0-incubator-SNAPSHOT.jar"/&gt;
+ &lt;/component&gt;
+&lt;/composite&gt;
+</pre>
+</div>
+</p>
+
+
+<h3>Sample Architecture</h3>
+
+<p>This service utilizes the following Interface as its definition:</p>
+
+
+<p>
+<div class="codebox2">
+<pre>
+
+public interface DASService {
+
+ public void configureService(InputStream configStream) throws DASServiceException;
+
+ public DataObject executeCommand(String commandName, Vector commandArguments) throws DASServiceException;
+
+ public DataObject execute(String adHocQuery, Vector commandArguments) throws DASServiceException;
+
+ public void applyChanges(DataObject graphRoot) throws DASServiceException;
+
+}
+</pre>
+</div>
+</p>
+
+</body>
+
+</html>
diff --git a/sandbox/lresende/sca/samples/company-das/src/main/java/das/DASService.java b/sandbox/lresende/sca/samples/company-das/src/main/java/das/DASService.java
new file mode 100644
index 0000000000..0387341b87
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das/src/main/java/das/DASService.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package das;
+
+import java.io.InputStream;
+import java.util.Vector;
+
+import commonj.sdo.DataObject;
+
+public interface DASService {
+
+ /**
+ * Set DAS configuration file to be used
+ * @param configStream
+ * @throws DASServiceException
+ */
+ public void configureService(InputStream configStream) throws DASServiceException;
+
+ /**
+ * Execute an existing command. The commands are defined in the DAS Configuration file being used by the service
+ * @param commandName Command name as it appears on the DAS Configuration file
+ * @param commandArguments Vector with arguments to be used by the command
+ * @throws DASServiceException
+ * @return
+ */
+ public DataObject executeCommand(String commandName, Vector commandArguments) throws DASServiceException;
+
+ /**
+ * Execute a new command, this can be any arbitrary valid query based on the backend implementation (e.g. SQL Query for DAS RDB)
+ * @param adHocQuery A new command to be executed (e.g SQL Query)
+ * @param commandArguments Vector with arguments to be used by the command
+ * @throws DASServiceException
+ * @return
+ */
+ public DataObject execute(String adHocQuery, Vector commandArguments) throws DASServiceException;
+
+ /**
+ * Apply all changes on the graph back to the persistent repository.
+ * This would save the changes on the SDO ChangeSummary back to the database
+ * Note: Your SDO ojects should have been created with ChangeSummary support
+ * @param graphRoot SDO Object with changes to be commited to persistent repository
+ * @throws DASServiceException
+ */
+ public void applyChanges(DataObject graphRoot) throws DASServiceException;
+}
diff --git a/sandbox/lresende/sca/samples/company-das/src/main/java/das/DASServiceClient.java b/sandbox/lresende/sca/samples/company-das/src/main/java/das/DASServiceClient.java
new file mode 100644
index 0000000000..b23731df21
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das/src/main/java/das/DASServiceClient.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 das;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+import commonj.sdo.DataObject;
+
+public class DASServiceClient {
+
+ public static void main(String[] args) throws Exception {
+
+ SCADomain scaDomain = SCADomain.newInstance("dasservice.composite");
+ DASService dasService = scaDomain.getService(DASService.class, "DASServiceComponent");
+
+
+ dasService.configureService(DASServiceClient.class.getClassLoader().getResourceAsStream("company.xml"));
+
+ DataObject root = dasService.executeCommand("all companies", null);
+ List companyList = root.getList("COMPANY");
+
+ for(int i=0; i<companyList.size(); i++){
+ System.out.println(" ID:"+(((DataObject)companyList.get(i)).getInt("ID"))+
+ " NAME:"+(((DataObject)companyList.get(i)).getString("NAME")));
+ }
+
+ }
+
+}
diff --git a/sandbox/lresende/sca/samples/company-das/src/main/java/das/DASServiceException.java b/sandbox/lresende/sca/samples/company-das/src/main/java/das/DASServiceException.java
new file mode 100644
index 0000000000..e62201a4de
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das/src/main/java/das/DASServiceException.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 das;
+
+public class DASServiceException extends Exception {
+
+ private static final long serialVersionUID = -7514653215235902874L;
+
+ public DASServiceException() {
+ super();
+ }
+
+ public DASServiceException(String msg) {
+ super(msg);
+ }
+
+ public DASServiceException(String msg, Throwable ex) {
+ super(msg, ex);
+ }
+
+}
diff --git a/sandbox/lresende/sca/samples/company-das/src/main/java/das/DASServiceImpl.java b/sandbox/lresende/sca/samples/company-das/src/main/java/das/DASServiceImpl.java
new file mode 100644
index 0000000000..5b9beb21cb
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das/src/main/java/das/DASServiceImpl.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 das;
+
+import java.io.InputStream;
+import java.util.Vector;
+
+import org.apache.tuscany.das.rdb.Command;
+import org.apache.tuscany.das.rdb.DAS;
+import org.osoa.sca.annotations.Destroy;
+import org.osoa.sca.annotations.Scope;
+
+import commonj.sdo.DataObject;
+
+@Scope("COMPOSITE")
+public class DASServiceImpl implements DASService {
+
+ private DAS das = null;
+
+ /**
+ * Initialize DAS
+ * @return
+ * @throws DASServiceException
+ */
+ private void initDAS(InputStream config) throws DASServiceException {
+ if(config == null){
+ throw new DASServiceException("Missing configuration information");
+ }
+
+ if(this.das != null){
+ this.das.releaseResources();
+ this.das = null;
+ }
+
+ this.das = DAS.FACTORY.createDAS(config);
+ }
+
+ @Destroy
+ protected void destroyDAS() {
+ if(das != null) {
+ das.releaseResources();
+ }
+ }
+
+ /**
+ * Get a DAS instance based on the configuration
+ * @return
+ * @throws DASServiceException
+ */
+ private DAS getDAS() throws DASServiceException {
+ if(this.das == null){
+ throw new DASServiceException("DAS not initialized. Please provide DAS configuration torugh das.SetConfig");
+ }
+
+ return this.das;
+ }
+
+ /**
+ * Set DAS configuration file to be used
+ * @param configStream
+ * @throws DASServiceException
+ */
+ public void configureService(InputStream configStream) throws DASServiceException{
+ this.initDAS(configStream);
+ }
+
+
+
+ /**
+ * Execute an existing command. The commands are defined in the DAS Configuration file being used by the service
+ * @param commandName Command name as it appears on the DAS Configuration file
+ * @param commandArguments Vector with arguments to be used by the command
+ * @throws DASServiceException
+ * @return
+ */
+ public DataObject executeCommand(String commandName, Vector commandArguments) throws DASServiceException{
+ Command command = this.getDAS().getCommand(commandName);
+
+ if(command == null){
+ throw new DASServiceException("Invalid command: " + commandName);
+ }
+
+ //check if arguments was passed
+ if(commandArguments != null && commandArguments.size() > 0){
+ //we need to set the arguments
+ int pos=0;
+ for(Object argument : commandArguments){
+ pos++;
+ command.setParameter(pos, argument);
+ }
+ }
+
+ DataObject root = command.executeQuery();
+
+ return root;
+ }
+
+ /**
+ * Execute a new command, this can be any arbitrary valid query based on the backend implementation (e.g. SQL Query for DAS RDB)
+ * @param newCommand A new command to be executed (e.g SQL Query)
+ * @param commandArguments Vector with arguments to be used by the command
+ * @throws DASServiceException
+ * @return
+ */
+ public DataObject execute(String adHocQuery, Vector commandArguments) throws DASServiceException {
+ Command command = this.getDAS().createCommand(adHocQuery);
+
+ if(command == null){
+ throw new DASServiceException("Invalid command: " + adHocQuery);
+ }
+
+ //check if arguments was passed
+ if(commandArguments != null && commandArguments.size() > 0){
+ //we need to set the arguments
+ int pos=0;
+ for(Object argument : commandArguments){
+ pos++;
+ command.setParameter(pos, argument);
+ }
+ }
+ DataObject root = command.executeQuery();
+
+ return root;
+ }
+
+ /**
+ * Apply all changes on the graph back to the persistent repository.
+ * This would save the changes on the SDO ChangeSummary back to the database
+ * Note: Your SDO ojects should have been created with ChangeSummary support
+ * @throws DASServiceException
+ * @param graphRoot SDO Object with changes to be commited to persistent repository
+ */
+ public void applyChanges(DataObject graphRoot) throws DASServiceException{
+ // TODO Auto-generated method stub
+
+ }
+}
diff --git a/sandbox/lresende/sca/samples/company-das/src/main/resources/company.xml b/sandbox/lresende/sca/samples/company-das/src/main/resources/company.xml
new file mode 100644
index 0000000000..39935fe025
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das/src/main/resources/company.xml
@@ -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.
+ -->
+<Config xmlns="http:///org.apache.tuscany.das.rdb/config.xsd">
+
+ <ConnectionInfo>
+ <ConnectionProperties
+ driverClass="org.apache.derby.jdbc.EmbeddedDriver"
+ databaseURL="jdbc:derby:target/company_db;create=true"
+ loginTimeout="600000"/>
+ </ConnectionInfo>
+
+
+ <Command name="all companies" SQL="select * from COMPANY" kind="Select"/>
+
+ <Command name="all companies and departments" SQL="select * from COMPANY left outer join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID" kind="Select"/>
+
+ <Command name="all departments for company" SQL="select * from COMPANY inner join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID where COMPANY.ID = ?" kind="Select"/>
+
+ <Command name="company by id with departments" SQL="select * from COMPANY left outer join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID where COMPANY.ID = ?" kind="Select"/>
+
+
+ <Table tableName="COMPANY">
+ <Column columnName="ID" primaryKey="true" generated="true"/>
+ </Table>
+
+ <Table tableName="DEPARTMENT">
+ <Column columnName="ID" primaryKey="true" generated="true"/>
+ </Table>
+
+ <Relationship name="departments" primaryKeyTable="COMPANY" foreignKeyTable="DEPARTMENT" many="true">
+ <KeyPair primaryKeyColumn="ID" foreignKeyColumn="COMPANYID"/>
+ </Relationship>
+
+
+</Config>
diff --git a/sandbox/lresende/sca/samples/company-das/src/main/resources/dasservice.composite b/sandbox/lresende/sca/samples/company-das/src/main/resources/dasservice.composite
new file mode 100644
index 0000000000..06063184c9
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das/src/main/resources/dasservice.composite
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://das-service"
+ xmlns:das-service="http://das-service"
+ name="DASService">
+
+ <component name="DASServiceComponent">
+ <implementation.java class="das.DASServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/sandbox/lresende/sca/samples/company-das/src/main/resources/log4j.properties b/sandbox/lresende/sca/samples/company-das/src/main/resources/log4j.properties
new file mode 100644
index 0000000000..ab4ebbb785
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das/src/main/resources/log4j.properties
@@ -0,0 +1,36 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# Set root logger level to DEBUG and its only appender to A1.
+log4j.rootLogger=INFO, NULL
+
+# NULL Appender
+log4j.appender.NULL=org.apache.log4j.varia.NullAppender
+
+log4j.appender.NULL.layout=org.apache.log4j.PatternLayout
+log4j.appender.NULL.layout.ConversionPattern=[DAS RDB] - %c{1}.%M (%L) : %m %n
+
+# CONSOLE is set to be a ConsoleAppender.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+
+# A1 uses PatternLayout.
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=[DAS RDB] - %c{1}.%M (%L) : %m %n
+
+
+# Print only messages of level WARN or above in the package com.foo.
+log4j.logger.org.apache.tuscany=NONE \ No newline at end of file
diff --git a/sandbox/lresende/sca/samples/company-das/src/test/java/das/DASServiceTestCase.java b/sandbox/lresende/sca/samples/company-das/src/test/java/das/DASServiceTestCase.java
new file mode 100644
index 0000000000..b866336db6
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das/src/test/java/das/DASServiceTestCase.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 das;
+
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+import commonj.sdo.DataObject;
+
+public class DASServiceTestCase extends TestCase {
+
+ private SCADomain scaDomain;
+ private DASService dasService;
+
+ @Override
+ protected void setUp() throws Exception {
+ scaDomain = SCADomain.newInstance("dasservice.composite");
+ dasService = scaDomain.getService(DASService.class, "DASServiceComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ scaDomain.close();
+ }
+
+ public void testDAS() throws Exception{
+ dasService.configureService(getClass().getResourceAsStream("/company.xml"));
+ DataObject root = dasService.executeCommand("all companies", null);
+ List companyList = root.getList("COMPANY");
+
+ assertNotNull(companyList);
+ assertEquals(3,companyList.size());
+ }
+}
diff --git a/sandbox/lresende/sca/samples/company-das/src/test/resources/company.xml b/sandbox/lresende/sca/samples/company-das/src/test/resources/company.xml
new file mode 100644
index 0000000000..43da819521
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das/src/test/resources/company.xml
@@ -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.
+ -->
+<Config xmlns="http:///org.apache.tuscany.das.rdb/config.xsd">
+
+ <ConnectionInfo>
+ <ConnectionProperties
+ driverClass="org.apache.derby.jdbc.EmbeddedDriver"
+ databaseURL="jdbc:derby:target/company_db;create=true"
+ loginTimeout="600000"/>
+ </ConnectionInfo>
+
+
+ <Command name="all companies" SQL="select * from COMPANY" kind="Select"/>
+
+ <Command name="all companies and departments" SQL="select * from COMPANY left outer join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID" kind="Select"/>
+
+ <Command name="all departments for company" SQL="select * from COMPANY inner join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID where COMPANY.ID = ?" kind="Select"/>
+
+ <Command name="company by id with departments" SQL="select * from COMPANY left outer join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID where COMPANY.ID = ?" kind="Select"/>
+
+
+ <Table tableName="COMPANY">
+ <Column columnName="ID" primaryKey="true" generated="true"/>
+ </Table>
+
+ <Table tableName="DEPARTMENT">
+ <Column columnName="ID" primaryKey="true" generated="true"/>
+ </Table>
+
+ <Relationship name="departments" primaryKeyTable="COMPANY" foreignKeyTable="DEPARTMENT" many="true">
+ <KeyPair primaryKeyColumn="ID" foreignKeyColumn="COMPANYID"/>
+ </Relationship>
+
+
+</Config>
diff --git a/sandbox/lresende/sca/samples/company-das/src/test/resources/log4j.properties b/sandbox/lresende/sca/samples/company-das/src/test/resources/log4j.properties
new file mode 100644
index 0000000000..ab4ebbb785
--- /dev/null
+++ b/sandbox/lresende/sca/samples/company-das/src/test/resources/log4j.properties
@@ -0,0 +1,36 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# Set root logger level to DEBUG and its only appender to A1.
+log4j.rootLogger=INFO, NULL
+
+# NULL Appender
+log4j.appender.NULL=org.apache.log4j.varia.NullAppender
+
+log4j.appender.NULL.layout=org.apache.log4j.PatternLayout
+log4j.appender.NULL.layout.ConversionPattern=[DAS RDB] - %c{1}.%M (%L) : %m %n
+
+# CONSOLE is set to be a ConsoleAppender.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+
+# A1 uses PatternLayout.
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=[DAS RDB] - %c{1}.%M (%L) : %m %n
+
+
+# Print only messages of level WARN or above in the package com.foo.
+log4j.logger.org.apache.tuscany=NONE \ No newline at end of file
diff --git a/sandbox/lresende/sca/samples/pom.xml b/sandbox/lresende/sca/samples/pom.xml
new file mode 100644
index 0000000000..63b7dc5259
--- /dev/null
+++ b/sandbox/lresende/sca/samples/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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-consumer-provider</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany Consumer/Provider Sample</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>calculator-jsf-webapp</module>
+ <module>company-das</module>
+ <module>company-das-webapp</module>
+ <module>store-jsf</module>
+ <!--module>room-scheduler</module-->
+ </modules>
+ </profile>
+
+ </profiles>
+
+</project>
diff --git a/sandbox/lresende/sca/samples/store-jsf/README b/sandbox/lresende/sca/samples/store-jsf/README
new file mode 100644
index 0000000000..79ddb03568
--- /dev/null
+++ b/sandbox/lresende/sca/samples/store-jsf/README
@@ -0,0 +1,2 @@
+To access the deployed application :
+http://localhost.localdomain:8080/sample-store-jsf/faces/catalog.jsp \ No newline at end of file
diff --git a/sandbox/lresende/sca/samples/store-jsf/pom.xml b/sandbox/lresende/sca/samples/store-jsf/pom.xml
new file mode 100644
index 0000000000..f1ca99bd5f
--- /dev/null
+++ b/sandbox/lresende/sca/samples/store-jsf/pom.xml
@@ -0,0 +1,72 @@
+<?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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-store-jsf</artifactId>
+ <packaging>war</packaging>
+ <name>Apache Tuscany SCA Getting Started Online Store Sample using JSF</name>
+
+ <repositories>
+ <repository>
+ <id>apache.incubator</id>
+ <url>http://people.apache.org/repo/m2-incubating-repository</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <version>1.1.5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>1.1.5</version>
+ </dependency>
+
+ <!-- dependency>
+ <groupId>net.java.dev.ajax4jsf</groupId>
+ <artifactId>ajax4jsf</artifactId>
+ <version>1.0.6</version>
+ </dependency -->
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+
+</project>
diff --git a/sandbox/lresende/sca/samples/store-jsf/src/main/java/beans/Catalog.java b/sandbox/lresende/sca/samples/store-jsf/src/main/java/beans/Catalog.java
new file mode 100644
index 0000000000..01e4a0d481
--- /dev/null
+++ b/sandbox/lresende/sca/samples/store-jsf/src/main/java/beans/Catalog.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 beans;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Catalog {
+ Product[] products;
+
+ public Catalog() {
+ products = new Product[3];
+ products[0] = new Product("Apple", 2.99);
+ products[1] = new Product("Orange", 3.55);
+ products[2] = new Product("Pear", 1.55);
+ }
+
+ public Product[] getProducts() {
+ return products;
+ }
+
+ public void setProducts(Product[] products) {
+ this.products = products;
+ }
+
+ public List getProductsInCart() {
+ List productsInCart = new ArrayList();
+ double total = 0.0;
+ for (int i = 0; i < products.length; i++) {
+ Product product = products[i];
+ if (product.isInCart()) {
+ productsInCart.add(product);
+ total += product.getPrice();
+ }
+ }
+ productsInCart.add(new Product("Total", total));
+ return productsInCart;
+ }
+
+}
diff --git a/sandbox/lresende/sca/samples/store-jsf/src/main/java/beans/Product.java b/sandbox/lresende/sca/samples/store-jsf/src/main/java/beans/Product.java
new file mode 100644
index 0000000000..9f3df2f95c
--- /dev/null
+++ b/sandbox/lresende/sca/samples/store-jsf/src/main/java/beans/Product.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 beans;
+
+public class Product {
+ String name;
+ double price;
+ boolean inCart;
+
+ public Product(String name, double price) {
+ this.name = name;
+ this.price = price;
+ this.inCart = false;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public double getPrice() {
+ return price;
+ }
+
+ public void setPrice(double price) {
+ this.price = price;
+ }
+
+ public boolean isInCart() {
+ return inCart;
+ }
+
+ public void setInCart(boolean inCart) {
+ this.inCart = inCart;
+ }
+
+}
diff --git a/sandbox/lresende/sca/samples/store-jsf/src/main/webapp/WEB-INF/faces-config.xml b/sandbox/lresende/sca/samples/store-jsf/src/main/webapp/WEB-INF/faces-config.xml
new file mode 100644
index 0000000000..1dd376a58f
--- /dev/null
+++ b/sandbox/lresende/sca/samples/store-jsf/src/main/webapp/WEB-INF/faces-config.xml
@@ -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.
+-->
+<!DOCTYPE faces-config PUBLIC
+ "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>catalog</managed-bean-name>
+ <managed-bean-class>beans.Catalog</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+</faces-config>
diff --git a/sandbox/lresende/sca/samples/store-jsf/src/main/webapp/WEB-INF/lib/ajax4jsf-1.1.1.jar b/sandbox/lresende/sca/samples/store-jsf/src/main/webapp/WEB-INF/lib/ajax4jsf-1.1.1.jar
new file mode 100644
index 0000000000..347b0d2066
--- /dev/null
+++ b/sandbox/lresende/sca/samples/store-jsf/src/main/webapp/WEB-INF/lib/ajax4jsf-1.1.1.jar
Binary files differ
diff --git a/sandbox/lresende/sca/samples/store-jsf/src/main/webapp/WEB-INF/web.xml b/sandbox/lresende/sca/samples/store-jsf/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000000..a39a51eefc
--- /dev/null
+++ b/sandbox/lresende/sca/samples/store-jsf/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!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">
+ <display-name>SkeletonProject</display-name>
+ <filter>
+ <filter-name>ajax4jsf</filter-name>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ </filter-mapping>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.faces</url-pattern>
+ </servlet-mapping>
+
+ <welcome-file-list>
+ <welcome-file>catalog.jsp</welcome-file>
+ </welcome-file-list>
+</web-app>
diff --git a/sandbox/lresende/sca/samples/store-jsf/src/main/webapp/catalog.jsp b/sandbox/lresende/sca/samples/store-jsf/src/main/webapp/catalog.jsp
new file mode 100644
index 0000000000..d456bedcc0
--- /dev/null
+++ b/sandbox/lresende/sca/samples/store-jsf/src/main/webapp/catalog.jsp
@@ -0,0 +1,82 @@
+<%--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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 uri="http://java.sun.com/jsf/html" prefix="h"%><%@taglib
+ uri="http://java.sun.com/jsf/core" prefix="f"%><%@taglib
+ uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%><%@ page language="java"
+ contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Basic JSF/Ajax sample</title>
+</head>
+<body>
+
+<f:view>
+ <h:form>
+ <h:outputText value="Store" style="font-size: 28px"/>
+ <h:outputText value="Catalog" style="font-size: 24px"/>
+ <h:dataTable border="0" value="#{catalog.products}" var="item">
+ <h:column id="column1">
+ <h:outputText value="#{item.name}"></h:outputText>
+ <f:facet name="header">
+ <h:outputText value="Product"></h:outputText>
+ </f:facet>
+ </h:column>
+ <h:column id="column2">
+ <h:outputText value="#{item.price}">
+ <f:convertNumber type="currency" currencySymbol="$" />
+ </h:outputText>
+ <f:facet name="header">
+ <h:outputText value="Price"></h:outputText>
+ </f:facet>
+ </h:column>
+ <h:column id="column3">
+ <f:facet name="header">
+ <h:outputText value=""></h:outputText>
+ </f:facet>
+ <h:selectBooleanCheckbox value="#{item.inCart}"></h:selectBooleanCheckbox>
+ </h:column>
+ </h:dataTable>
+ <a4j:commandButton value="Add to Cart" reRender="cart"></a4j:commandButton>
+ </h:form>
+
+ <br>
+
+ <h:outputText value="Your Cart" style="font-size: 24px"/>
+ <h:dataTable border="1" value="#{catalog.productsInCart}" var="item" id="cart">
+ <h:column id="column1">
+ <h:outputText value="#{item.name}"></h:outputText>
+ <f:facet name="header">
+ <h:outputText value=""></h:outputText>
+ </f:facet>
+ </h:column>
+ <h:column id="column2">
+ <h:outputText value="#{item.price}">
+ <f:convertNumber type="currency" currencySymbol="$" />
+ </h:outputText>
+ <f:facet name="header">
+ <h:outputText value=""></h:outputText>
+ </f:facet>
+ </h:column>
+ </h:dataTable>
+
+</f:view>
+</body>
+</html> \ No newline at end of file