From 83355a7557cf91c455a65e0ce79ea8dd4d880052 Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 13 Jan 2010 02:16:12 +0000 Subject: Refactoring sandbox structure to accomodate 1.x versus 2.x stuff git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@898623 13f79535-47bb-0310-9956-ffa450edef68 --- .../lresende/sca-1.x/demos/customer-map/DISCLAIMER | 8 + .../lresende/sca-1.x/demos/customer-map/LICENSE | 205 +++++++ sandbox/lresende/sca-1.x/demos/customer-map/NOTICE | 6 + .../sca-1.x/demos/customer-map/customer-maps.sql | 28 + .../lresende/sca-1.x/demos/customer-map/pom.xml | 171 ++++++ .../src/main/java/customer/CustomerService.java | 35 ++ .../customer-map/src/main/java/launch/Launch.java | 34 ++ .../src/main/resources/customer-map.composite | 42 ++ .../src/main/resources/customer.componentType | 31 + .../customer-map/src/main/resources/customer.xml | 27 + .../customer-map/src/main/resources/customer.xsd | 35 ++ .../customer-map/src/main/resources/dastest/db.lck | Bin 0 -> 38 bytes .../src/main/resources/dastest/log/log.ctrl | Bin 0 -> 48 bytes .../src/main/resources/dastest/log/log1.dat | Bin 0 -> 1048576 bytes .../src/main/resources/dastest/log/logmirror.ctrl | Bin 0 -> 48 bytes .../src/main/resources/dastest/seg0/c10.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c101.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c111.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c121.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c130.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c141.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c150.dat | Bin 0 -> 16384 bytes .../src/main/resources/dastest/seg0/c161.dat | Bin 0 -> 16384 bytes .../src/main/resources/dastest/seg0/c171.dat | Bin 0 -> 16384 bytes .../src/main/resources/dastest/seg0/c180.dat | Bin 0 -> 24576 bytes .../src/main/resources/dastest/seg0/c191.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c1a1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c1b1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c1c0.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c1d1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c1e0.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c1f1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c20.dat | Bin 0 -> 20480 bytes .../src/main/resources/dastest/seg0/c200.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c211.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c221.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c230.dat | Bin 0 -> 274432 bytes .../src/main/resources/dastest/seg0/c241.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c251.dat | Bin 0 -> 12288 bytes .../src/main/resources/dastest/seg0/c260.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c271.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c281.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c290.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c2a1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c2b1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c2c1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c2d0.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c2e1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c2f0.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c300.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c31.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c311.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c41.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c51.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c60.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c71.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c81.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/c90.dat | Bin 0 -> 24576 bytes .../src/main/resources/dastest/seg0/ca1.dat | Bin 0 -> 20480 bytes .../src/main/resources/dastest/seg0/cb1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/cc0.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/cd1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/ce1.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/seg0/cf0.dat | Bin 0 -> 8192 bytes .../src/main/resources/dastest/service.properties | 22 + .../src/main/resources/html/binding-atom.js | 92 +++ .../src/main/resources/html/binding-jsonrpc.js | 494 ++++++++++++++++ .../src/main/resources/html/index-plain.html | 76 +++ .../src/main/resources/html/index.html | 55 ++ .../customer-map/src/main/resources/html/map.json | 27 + .../java/customer/CustomerServiceTestCase.java | 60 ++ .../src/test/resources/customer.componentType | 29 + .../src/test/resources/customer.composite | 35 ++ .../customer-map/src/test/resources/customer.xml | 27 + .../modules/implementation-data-pojo/DISCLAIMER | 8 + .../modules/implementation-data-pojo/LICENSE | 205 +++++++ .../modules/implementation-data-pojo/NOTICE | 6 + .../modules/implementation-data-pojo/README | 33 ++ .../modules/implementation-data-pojo/company.sql | 28 + .../modules/implementation-data-pojo/pom.xml | 174 ++++++ .../implementation/openjpa/JPAImplementation.java | 36 ++ .../openjpa/JPAImplementationFactory.java | 24 + .../openjpa/JPAImplementationProcessor.java | 99 ++++ .../openjpa/PersistenceUnitInfoImplProcessor.java | 109 ++++ .../openjpa/TuscanyBrokerFactory.java | 100 ++++ .../implementation/openjpa/TuscanyBrokerImpl.java | 37 ++ .../openjpa/TuscanyJDBCConfigurationImpl.java | 58 ++ .../openjpa/TuscanyManagerRuntime.java | 51 ++ .../openjpa/TuscanyStoreManager.java | 49 ++ .../openjpa/impl/JPAImplementationFactoryImpl.java | 39 ++ .../openjpa/impl/JPAImplementationImpl.java | 119 ++++ .../provider/JPAImplementationProvider.java | 96 +++ .../provider/JPAImplementationProviderFactory.java | 44 ++ .../openjpa/provider/JPAInvoker.java | 63 ++ ...ca.contribution.processor.StAXArtifactProcessor | 19 + ...ementation.openjpa.OpenJpaImplementationFactory | 18 + ...cany.sca.provider.ImplementationProviderFactory | 19 + .../src/test/java/company/Company.java | 47 ++ .../src/test/java/company/CompanyCollection.java | 25 + .../test/java/company/CompanyCollectionImpl.java | 100 ++++ .../openjpa/CompanyCollectionTestCase.java | 44 ++ .../implementation/openjpa/CompanyTestCase.java | 80 +++ .../src/test/resources/META-INF/orm.xml | 36 ++ .../src/test/resources/META-INF/persistence.xml | 40 ++ .../src/test/resources/company.composite | 47 ++ .../sca-1.x/samples/calculator-jsf-webapp/README | 118 ++++ .../samples/calculator-jsf-webapp/build.xml | 137 +++++ .../calculator-jsf-webapp/calculator-web.png | Bin 0 -> 22916 bytes .../calculator-jsf-webapp/calculator-web.svg | 358 ++++++++++++ .../sca-1.x/samples/calculator-jsf-webapp/pom.xml | 77 +++ .../src/main/java/beans/Calculator.java | 78 +++ .../src/main/java/calculator/AddService.java | 28 + .../src/main/java/calculator/AddServiceImpl.java | 30 + .../src/main/java/calculator/CalculatorClient.java | 47 ++ .../main/java/calculator/CalculatorService.java | 35 ++ .../java/calculator/CalculatorServiceImpl.java | 69 +++ .../src/main/java/calculator/DivideService.java | 28 + .../main/java/calculator/DivideServiceImpl.java | 30 + .../src/main/java/calculator/MultiplyService.java | 28 + .../main/java/calculator/MultiplyServiceImpl.java | 30 + .../src/main/java/calculator/SubtractService.java | 28 + .../main/java/calculator/SubtractServiceImpl.java | 30 + .../src/main/resources/Calculator.composite | 49 ++ .../src/main/resources/wsdl/add.wsdl | 87 +++ .../src/main/webapp/META-INF/sca-contribution.xml | 24 + .../src/main/webapp/WEB-INF/faces-config.xml | 14 + .../src/main/webapp/WEB-INF/web.xml | 59 ++ .../calculator-jsf-webapp/src/main/webapp/calc.jsp | 50 ++ .../src/main/webapp/calc_jsf.jsp | 27 + .../sca-1.x/samples/expertise-atom/pom.xml | 96 +++ .../java/org/apache/tuscany/expertise/Expert.java | 67 +++ .../expertise/atom/AtomExpertiseLocator.java | 130 +++++ .../tuscany/expertise/atom/ExpertiseLocator.java | 29 + .../apache/tuscany/expertise/launch/Launch.java | 34 ++ .../main/resources/META-INF/sca-contribution.xml | 25 + .../src/main/resources/atom.composite | 36 ++ .../src/main/resources/atom.composite_diagram | 71 +++ .../src/main/resources/expertLocator.html | 110 ++++ .../sca-1.x/samples/expertise-restfull/pom.xml | 82 +++ .../java/org/apache/tuscany/expertise/Expert.java | 64 ++ .../apache/tuscany/expertise/launch/Launch.java | 34 ++ .../tuscany/expertise/restfull/ExpertRegistry.java | 37 ++ .../expertise/restfull/ExpertRegistryImpl.java | 92 +++ .../restfull/RestfulExpertiseLocator.java | 100 ++++ .../main/resources/META-INF/sca-contribution.xml | 25 + .../src/main/resources/rest.composite | 34 ++ .../src/main/resources/rest.composite_diagram | 71 +++ sandbox/lresende/sca-1.x/samples/pom.xml | 46 ++ .../sca-1.x/samples/store-distributed/README | 28 + .../sca-1.x/samples/store-distributed/build.xml | 79 +++ .../samples/store-distributed/cloud.composite | 27 + .../samples/store-distributed/domain.composite | 27 + .../sca-1.x/samples/store-distributed/pom.xml | 109 ++++ .../src/main/java/node/LaunchDomain.java | 33 ++ .../src/main/java/node/LaunchStoreNodeA.java | 28 + .../src/main/java/node/LaunchStoreNodeB.java | 28 + .../src/main/java/node/LaunchStoreNodeC.java | 28 + .../src/main/java/services/Cart.java | 28 + .../src/main/java/services/Catalog.java | 27 + .../src/main/java/services/CurrencyConverter.java | 29 + .../main/java/services/CurrencyConverterImpl.java | 38 ++ .../src/main/java/services/FruitsCatalogImpl.java | 52 ++ .../src/main/java/services/Item.java | 51 ++ .../src/main/java/services/ShoppingCartImpl.java | 112 ++++ .../src/main/java/services/Total.java | 29 + .../src/main/resources/cloud/NodeA.composite | 36 ++ .../src/main/resources/cloud/NodeB.composite | 36 ++ .../src/main/resources/cloud/NodeC.composite | 36 ++ .../resources/nodeA/META-INF/sca-contribution.xml | 24 + .../src/main/resources/nodeA/content/store.js | 510 ++++++++++++++++ .../src/main/resources/nodeA/store.composite | 46 ++ .../resources/nodeB/META-INF/sca-contribution.xml | 24 + .../src/main/resources/nodeB/content/store.js | 647 +++++++++++++++++++++ .../src/main/resources/nodeB/store.composite | 43 ++ .../resources/nodeC/META-INF/sca-contribution.xml | 24 + .../src/main/resources/nodeC/content/index.js | 66 +++ .../src/main/resources/nodeC/content/store.html | 114 ++++ .../src/main/resources/nodeC/content/store.js | 39 ++ .../src/main/resources/nodeC/store.composite | 50 ++ .../src/main/resources/nodeC/uiservices/store.html | 162 ++++++ .../src/main/resources/uiservices/store.html | 162 ++++++ .../sca-1.x/samples/store-distributed/store.png | Bin 0 -> 15670 bytes .../sca-1.x/samples/store-distributed/store.svg | 304 ++++++++++ .../samples/store-distributed/workspace.xml | 25 + sandbox/lresende/sca-1.x/samples/store-jsf/README | 2 + sandbox/lresende/sca-1.x/samples/store-jsf/pom.xml | 64 ++ .../store-jsf/src/main/java/beans/Catalog.java | 56 ++ .../store-jsf/src/main/java/beans/Product.java | 56 ++ .../src/main/webapp/WEB-INF/faces-config.xml | 31 + .../src/main/webapp/WEB-INF/lib/ajax4jsf-1.1.1.jar | Bin 0 -> 1262524 bytes .../store-jsf/src/main/webapp/WEB-INF/web.xml | 31 + .../samples/store-jsf/src/main/webapp/catalog.jsp | 82 +++ .../samples/store-secure-webapp/build-dojo.xml | 62 ++ .../sca-1.x/samples/store-secure-webapp/build.xml | 119 ++++ .../sca-1.x/samples/store-secure-webapp/pom.xml | 144 +++++ .../src/main/java/services/Catalog.java | 8 + .../src/main/java/services/CurrencyConverter.java | 12 + .../main/java/services/CurrencyConverterImpl.java | 21 + .../src/main/java/services/FruitsCatalogImpl.java | 35 ++ .../src/main/java/services/Item.java | 30 + .../java/store/security/StoreCallbackHandler.java | 50 ++ .../src/main/resources/definitions.xml | 73 +++ .../src/main/resources/store.composite | 41 ++ .../src/main/webapp/META-INF/sca-contribution.xml | 23 + .../src/main/webapp/WEB-INF/geronimo-web.xml | 73 +++ .../src/main/webapp/WEB-INF/web.xml | 60 ++ .../src/main/webapp/auth/logon.html | 20 + .../src/main/webapp/auth/logonError.html | 5 + .../store-secure-webapp/src/main/webapp/store.html | 48 ++ sandbox/lresende/sca/demos/customer-map/DISCLAIMER | 8 - sandbox/lresende/sca/demos/customer-map/LICENSE | 205 ------- sandbox/lresende/sca/demos/customer-map/NOTICE | 6 - .../sca/demos/customer-map/customer-maps.sql | 28 - sandbox/lresende/sca/demos/customer-map/pom.xml | 171 ------ .../src/main/java/customer/CustomerService.java | 35 -- .../customer-map/src/main/java/launch/Launch.java | 34 -- .../src/main/resources/customer-map.composite | 42 -- .../src/main/resources/customer.componentType | 31 - .../customer-map/src/main/resources/customer.xml | 27 - .../customer-map/src/main/resources/customer.xsd | 35 -- .../customer-map/src/main/resources/dastest/db.lck | Bin 38 -> 0 bytes .../src/main/resources/dastest/log/log.ctrl | Bin 48 -> 0 bytes .../src/main/resources/dastest/log/log1.dat | Bin 1048576 -> 0 bytes .../src/main/resources/dastest/log/logmirror.ctrl | Bin 48 -> 0 bytes .../src/main/resources/dastest/seg0/c10.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c101.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c111.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c121.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c130.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c141.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c150.dat | Bin 16384 -> 0 bytes .../src/main/resources/dastest/seg0/c161.dat | Bin 16384 -> 0 bytes .../src/main/resources/dastest/seg0/c171.dat | Bin 16384 -> 0 bytes .../src/main/resources/dastest/seg0/c180.dat | Bin 24576 -> 0 bytes .../src/main/resources/dastest/seg0/c191.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c1a1.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c1b1.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c1c0.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c1d1.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c1e0.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c1f1.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c20.dat | Bin 20480 -> 0 bytes .../src/main/resources/dastest/seg0/c200.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c211.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c221.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c230.dat | Bin 274432 -> 0 bytes .../src/main/resources/dastest/seg0/c241.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c251.dat | Bin 12288 -> 0 bytes .../src/main/resources/dastest/seg0/c260.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c271.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c281.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c290.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c2a1.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c2b1.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c2c1.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c2d0.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c2e1.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c2f0.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c300.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c31.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c311.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c41.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c51.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c60.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c71.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c81.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/c90.dat | Bin 24576 -> 0 bytes .../src/main/resources/dastest/seg0/ca1.dat | Bin 20480 -> 0 bytes .../src/main/resources/dastest/seg0/cb1.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/cc0.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/cd1.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/ce1.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/seg0/cf0.dat | Bin 8192 -> 0 bytes .../src/main/resources/dastest/service.properties | 22 - .../src/main/resources/html/binding-atom.js | 92 --- .../src/main/resources/html/binding-jsonrpc.js | 494 ---------------- .../src/main/resources/html/index-plain.html | 76 --- .../src/main/resources/html/index.html | 55 -- .../customer-map/src/main/resources/html/map.json | 27 - .../java/customer/CustomerServiceTestCase.java | 60 -- .../src/test/resources/customer.componentType | 29 - .../src/test/resources/customer.composite | 35 -- .../customer-map/src/test/resources/customer.xml | 27 - .../modules/implementation-data-pojo/DISCLAIMER | 8 - .../sca/modules/implementation-data-pojo/LICENSE | 205 ------- .../sca/modules/implementation-data-pojo/NOTICE | 6 - .../sca/modules/implementation-data-pojo/README | 33 -- .../modules/implementation-data-pojo/company.sql | 28 - .../sca/modules/implementation-data-pojo/pom.xml | 174 ------ .../implementation/openjpa/JPAImplementation.java | 36 -- .../openjpa/JPAImplementationFactory.java | 24 - .../openjpa/JPAImplementationProcessor.java | 99 ---- .../openjpa/PersistenceUnitInfoImplProcessor.java | 109 ---- .../openjpa/TuscanyBrokerFactory.java | 100 ---- .../implementation/openjpa/TuscanyBrokerImpl.java | 37 -- .../openjpa/TuscanyJDBCConfigurationImpl.java | 58 -- .../openjpa/TuscanyManagerRuntime.java | 51 -- .../openjpa/TuscanyStoreManager.java | 49 -- .../openjpa/impl/JPAImplementationFactoryImpl.java | 39 -- .../openjpa/impl/JPAImplementationImpl.java | 119 ---- .../provider/JPAImplementationProvider.java | 96 --- .../provider/JPAImplementationProviderFactory.java | 44 -- .../openjpa/provider/JPAInvoker.java | 63 -- ...ca.contribution.processor.StAXArtifactProcessor | 19 - ...ementation.openjpa.OpenJpaImplementationFactory | 18 - ...cany.sca.provider.ImplementationProviderFactory | 19 - .../src/test/java/company/Company.java | 47 -- .../src/test/java/company/CompanyCollection.java | 25 - .../test/java/company/CompanyCollectionImpl.java | 100 ---- .../openjpa/CompanyCollectionTestCase.java | 44 -- .../implementation/openjpa/CompanyTestCase.java | 80 --- .../src/test/resources/META-INF/orm.xml | 36 -- .../src/test/resources/META-INF/persistence.xml | 40 -- .../src/test/resources/company.composite | 47 -- .../sca/samples/calculator-jsf-webapp/README | 118 ---- .../sca/samples/calculator-jsf-webapp/build.xml | 137 ----- .../calculator-jsf-webapp/calculator-web.png | Bin 22916 -> 0 bytes .../calculator-jsf-webapp/calculator-web.svg | 358 ------------ .../sca/samples/calculator-jsf-webapp/pom.xml | 77 --- .../src/main/java/beans/Calculator.java | 78 --- .../src/main/java/calculator/AddService.java | 28 - .../src/main/java/calculator/AddServiceImpl.java | 30 - .../src/main/java/calculator/CalculatorClient.java | 47 -- .../main/java/calculator/CalculatorService.java | 35 -- .../java/calculator/CalculatorServiceImpl.java | 69 --- .../src/main/java/calculator/DivideService.java | 28 - .../main/java/calculator/DivideServiceImpl.java | 30 - .../src/main/java/calculator/MultiplyService.java | 28 - .../main/java/calculator/MultiplyServiceImpl.java | 30 - .../src/main/java/calculator/SubtractService.java | 28 - .../main/java/calculator/SubtractServiceImpl.java | 30 - .../src/main/resources/Calculator.composite | 49 -- .../src/main/resources/wsdl/add.wsdl | 87 --- .../src/main/webapp/META-INF/sca-contribution.xml | 24 - .../src/main/webapp/WEB-INF/faces-config.xml | 14 - .../src/main/webapp/WEB-INF/web.xml | 59 -- .../calculator-jsf-webapp/src/main/webapp/calc.jsp | 50 -- .../src/main/webapp/calc_jsf.jsp | 27 - .../lresende/sca/samples/expertise-atom/pom.xml | 96 --- .../java/org/apache/tuscany/expertise/Expert.java | 67 --- .../expertise/atom/AtomExpertiseLocator.java | 130 ----- .../tuscany/expertise/atom/ExpertiseLocator.java | 29 - .../apache/tuscany/expertise/launch/Launch.java | 34 -- .../main/resources/META-INF/sca-contribution.xml | 25 - .../src/main/resources/atom.composite | 36 -- .../src/main/resources/atom.composite_diagram | 71 --- .../src/main/resources/expertLocator.html | 110 ---- .../sca/samples/expertise-restfull/pom.xml | 82 --- .../java/org/apache/tuscany/expertise/Expert.java | 64 -- .../apache/tuscany/expertise/launch/Launch.java | 34 -- .../tuscany/expertise/restfull/ExpertRegistry.java | 37 -- .../expertise/restfull/ExpertRegistryImpl.java | 92 --- .../restfull/RestfulExpertiseLocator.java | 100 ---- .../main/resources/META-INF/sca-contribution.xml | 25 - .../src/main/resources/rest.composite | 34 -- .../src/main/resources/rest.composite_diagram | 71 --- sandbox/lresende/sca/samples/pom.xml | 46 -- .../lresende/sca/samples/store-distributed/README | 28 - .../sca/samples/store-distributed/build.xml | 79 --- .../sca/samples/store-distributed/cloud.composite | 27 - .../sca/samples/store-distributed/domain.composite | 27 - .../lresende/sca/samples/store-distributed/pom.xml | 109 ---- .../src/main/java/node/LaunchDomain.java | 33 -- .../src/main/java/node/LaunchStoreNodeA.java | 28 - .../src/main/java/node/LaunchStoreNodeB.java | 28 - .../src/main/java/node/LaunchStoreNodeC.java | 28 - .../src/main/java/services/Cart.java | 28 - .../src/main/java/services/Catalog.java | 27 - .../src/main/java/services/CurrencyConverter.java | 29 - .../main/java/services/CurrencyConverterImpl.java | 38 -- .../src/main/java/services/FruitsCatalogImpl.java | 52 -- .../src/main/java/services/Item.java | 51 -- .../src/main/java/services/ShoppingCartImpl.java | 112 ---- .../src/main/java/services/Total.java | 29 - .../src/main/resources/cloud/NodeA.composite | 36 -- .../src/main/resources/cloud/NodeB.composite | 36 -- .../src/main/resources/cloud/NodeC.composite | 36 -- .../resources/nodeA/META-INF/sca-contribution.xml | 24 - .../src/main/resources/nodeA/content/store.js | 510 ---------------- .../src/main/resources/nodeA/store.composite | 46 -- .../resources/nodeB/META-INF/sca-contribution.xml | 24 - .../src/main/resources/nodeB/content/store.js | 647 --------------------- .../src/main/resources/nodeB/store.composite | 43 -- .../resources/nodeC/META-INF/sca-contribution.xml | 24 - .../src/main/resources/nodeC/content/index.js | 66 --- .../src/main/resources/nodeC/content/store.html | 114 ---- .../src/main/resources/nodeC/content/store.js | 39 -- .../src/main/resources/nodeC/store.composite | 50 -- .../src/main/resources/nodeC/uiservices/store.html | 162 ------ .../src/main/resources/uiservices/store.html | 162 ------ .../sca/samples/store-distributed/store.png | Bin 15670 -> 0 bytes .../sca/samples/store-distributed/store.svg | 304 ---------- .../sca/samples/store-distributed/workspace.xml | 25 - sandbox/lresende/sca/samples/store-jsf/README | 2 - sandbox/lresende/sca/samples/store-jsf/pom.xml | 64 -- .../store-jsf/src/main/java/beans/Catalog.java | 56 -- .../store-jsf/src/main/java/beans/Product.java | 56 -- .../src/main/webapp/WEB-INF/faces-config.xml | 31 - .../src/main/webapp/WEB-INF/lib/ajax4jsf-1.1.1.jar | Bin 1262524 -> 0 bytes .../store-jsf/src/main/webapp/WEB-INF/web.xml | 31 - .../samples/store-jsf/src/main/webapp/catalog.jsp | 82 --- .../sca/samples/store-secure-webapp/build-dojo.xml | 62 -- .../sca/samples/store-secure-webapp/build.xml | 119 ---- .../sca/samples/store-secure-webapp/pom.xml | 144 ----- .../src/main/java/services/Catalog.java | 8 - .../src/main/java/services/CurrencyConverter.java | 12 - .../main/java/services/CurrencyConverterImpl.java | 21 - .../src/main/java/services/FruitsCatalogImpl.java | 35 -- .../src/main/java/services/Item.java | 30 - .../java/store/security/StoreCallbackHandler.java | 50 -- .../src/main/resources/definitions.xml | 73 --- .../src/main/resources/store.composite | 41 -- .../src/main/webapp/META-INF/sca-contribution.xml | 23 - .../src/main/webapp/WEB-INF/geronimo-web.xml | 73 --- .../src/main/webapp/WEB-INF/web.xml | 60 -- .../src/main/webapp/auth/logon.html | 20 - .../src/main/webapp/auth/logonError.html | 5 - .../store-secure-webapp/src/main/webapp/store.html | 48 -- 418 files changed, 10283 insertions(+), 10283 deletions(-) create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/DISCLAIMER create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/LICENSE create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/NOTICE create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/customer-maps.sql create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/pom.xml create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/java/customer/CustomerService.java create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/java/launch/Launch.java create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer-map.composite create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.componentType create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.xml create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.xsd create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/db.lck create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/log.ctrl create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/log1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/logmirror.ctrl create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c10.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c101.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c111.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c121.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c130.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c141.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c150.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c161.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c171.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c180.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c191.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1a1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1b1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1c0.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1d1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1e0.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1f1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c20.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c200.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c211.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c221.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c230.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c241.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c251.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c260.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c271.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c281.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c290.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2a1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2b1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2c1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2d0.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2e1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2f0.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c300.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c31.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c311.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c41.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c51.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c60.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c71.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c81.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c90.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/ca1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cb1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cc0.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cd1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/ce1.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cf0.dat create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/service.properties create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/binding-atom.js create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/binding-jsonrpc.js create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/index-plain.html create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/index.html create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/map.json create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/test/java/customer/CustomerServiceTestCase.java create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.componentType create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.composite create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.xml create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/DISCLAIMER create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/LICENSE create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/NOTICE create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/README create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/company.sql create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/pom.xml create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementation.java create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementationFactory.java create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementationProcessor.java create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/PersistenceUnitInfoImplProcessor.java create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyBrokerFactory.java create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyBrokerImpl.java create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyJDBCConfigurationImpl.java create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyManagerRuntime.java create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyStoreManager.java create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/impl/JPAImplementationFactoryImpl.java create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/impl/JPAImplementationImpl.java create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAImplementationProvider.java create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAImplementationProviderFactory.java create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAInvoker.java create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.openjpa.OpenJpaImplementationFactory create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/java/company/Company.java create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/java/company/CompanyCollection.java create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/java/company/CompanyCollectionImpl.java create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/java/org/apache/tuscany/sca/implementation/openjpa/CompanyCollectionTestCase.java create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/java/org/apache/tuscany/sca/implementation/openjpa/CompanyTestCase.java create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/resources/META-INF/orm.xml create mode 100644 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/resources/META-INF/persistence.xml create mode 100755 sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/resources/company.composite create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/README create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/build.xml create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/calculator-web.png create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/calculator-web.svg create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/pom.xml create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/beans/Calculator.java create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/AddService.java create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/AddServiceImpl.java create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorClient.java create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorService.java create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorServiceImpl.java create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/DivideService.java create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/DivideServiceImpl.java create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/MultiplyService.java create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/MultiplyServiceImpl.java create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/SubtractService.java create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/SubtractServiceImpl.java create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/resources/Calculator.composite create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/resources/wsdl/add.wsdl create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/webapp/META-INF/sca-contribution.xml create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/webapp/WEB-INF/faces-config.xml create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/webapp/WEB-INF/web.xml create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/webapp/calc.jsp create mode 100644 sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/webapp/calc_jsf.jsp create mode 100644 sandbox/lresende/sca-1.x/samples/expertise-atom/pom.xml create mode 100644 sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/Expert.java create mode 100644 sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/atom/AtomExpertiseLocator.java create mode 100644 sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/atom/ExpertiseLocator.java create mode 100644 sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/launch/Launch.java create mode 100644 sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/resources/atom.composite create mode 100644 sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/resources/atom.composite_diagram create mode 100644 sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/resources/expertLocator.html create mode 100644 sandbox/lresende/sca-1.x/samples/expertise-restfull/pom.xml create mode 100644 sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/Expert.java create mode 100644 sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/launch/Launch.java create mode 100644 sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/ExpertRegistry.java create mode 100644 sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/ExpertRegistryImpl.java create mode 100644 sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/RestfulExpertiseLocator.java create mode 100644 sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/resources/rest.composite create mode 100644 sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/resources/rest.composite_diagram create mode 100644 sandbox/lresende/sca-1.x/samples/pom.xml create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/README create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/build.xml create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/cloud.composite create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/domain.composite create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/pom.xml create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/node/LaunchDomain.java create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/node/LaunchStoreNodeA.java create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/node/LaunchStoreNodeB.java create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/node/LaunchStoreNodeC.java create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/Cart.java create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/Catalog.java create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/CurrencyConverter.java create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/CurrencyConverterImpl.java create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/FruitsCatalogImpl.java create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/Item.java create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/ShoppingCartImpl.java create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/Total.java create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/cloud/NodeA.composite create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/cloud/NodeB.composite create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/cloud/NodeC.composite create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeA/META-INF/sca-contribution.xml create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeA/content/store.js create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeA/store.composite create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeB/META-INF/sca-contribution.xml create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeB/content/store.js create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeB/store.composite create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeC/META-INF/sca-contribution.xml create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeC/content/index.js create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeC/content/store.html create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeC/content/store.js create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeC/store.composite create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeC/uiservices/store.html create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/uiservices/store.html create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/store.png create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/store.svg create mode 100644 sandbox/lresende/sca-1.x/samples/store-distributed/workspace.xml create mode 100644 sandbox/lresende/sca-1.x/samples/store-jsf/README create mode 100644 sandbox/lresende/sca-1.x/samples/store-jsf/pom.xml create mode 100644 sandbox/lresende/sca-1.x/samples/store-jsf/src/main/java/beans/Catalog.java create mode 100644 sandbox/lresende/sca-1.x/samples/store-jsf/src/main/java/beans/Product.java create mode 100644 sandbox/lresende/sca-1.x/samples/store-jsf/src/main/webapp/WEB-INF/faces-config.xml create mode 100644 sandbox/lresende/sca-1.x/samples/store-jsf/src/main/webapp/WEB-INF/lib/ajax4jsf-1.1.1.jar create mode 100644 sandbox/lresende/sca-1.x/samples/store-jsf/src/main/webapp/WEB-INF/web.xml create mode 100644 sandbox/lresende/sca-1.x/samples/store-jsf/src/main/webapp/catalog.jsp create mode 100644 sandbox/lresende/sca-1.x/samples/store-secure-webapp/build-dojo.xml create mode 100644 sandbox/lresende/sca-1.x/samples/store-secure-webapp/build.xml create mode 100644 sandbox/lresende/sca-1.x/samples/store-secure-webapp/pom.xml create mode 100644 sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/services/Catalog.java create mode 100644 sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/services/CurrencyConverter.java create mode 100644 sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/services/CurrencyConverterImpl.java create mode 100644 sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/services/FruitsCatalogImpl.java create mode 100644 sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/services/Item.java create mode 100644 sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/store/security/StoreCallbackHandler.java create mode 100644 sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/resources/definitions.xml create mode 100644 sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/resources/store.composite create mode 100644 sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/META-INF/sca-contribution.xml create mode 100644 sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/WEB-INF/geronimo-web.xml create mode 100644 sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/WEB-INF/web.xml create mode 100644 sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/auth/logon.html create mode 100644 sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/auth/logonError.html create mode 100644 sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/store.html delete mode 100644 sandbox/lresende/sca/demos/customer-map/DISCLAIMER delete mode 100644 sandbox/lresende/sca/demos/customer-map/LICENSE delete mode 100644 sandbox/lresende/sca/demos/customer-map/NOTICE delete mode 100644 sandbox/lresende/sca/demos/customer-map/customer-maps.sql delete mode 100644 sandbox/lresende/sca/demos/customer-map/pom.xml delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/java/customer/CustomerService.java delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/java/launch/Launch.java delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/customer-map.composite delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/customer.componentType delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/customer.xml delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/customer.xsd delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/db.lck delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/log/log.ctrl delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/log/log1.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/log/logmirror.ctrl delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c10.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c101.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c111.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c121.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c130.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c141.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c150.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c161.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c171.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c180.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c191.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1a1.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1b1.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1c0.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1d1.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1e0.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1f1.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c20.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c200.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c211.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c221.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c230.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c241.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c251.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c260.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c271.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c281.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c290.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2a1.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2b1.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2c1.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2d0.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2e1.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2f0.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c300.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c31.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c311.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c41.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c51.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c60.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c71.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c81.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c90.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/ca1.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cb1.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cc0.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cd1.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/ce1.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cf0.dat delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/service.properties delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/html/binding-atom.js delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/html/binding-jsonrpc.js delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/html/index-plain.html delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/html/index.html delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/main/resources/html/map.json delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/test/java/customer/CustomerServiceTestCase.java delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/test/resources/customer.componentType delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/test/resources/customer.composite delete mode 100644 sandbox/lresende/sca/demos/customer-map/src/test/resources/customer.xml delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/DISCLAIMER delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/LICENSE delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/NOTICE delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/README delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/company.sql delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/pom.xml delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementation.java delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementationFactory.java delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementationProcessor.java delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/PersistenceUnitInfoImplProcessor.java delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyBrokerFactory.java delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyBrokerImpl.java delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyJDBCConfigurationImpl.java delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyManagerRuntime.java delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyStoreManager.java delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/impl/JPAImplementationFactoryImpl.java delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/impl/JPAImplementationImpl.java delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAImplementationProvider.java delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAImplementationProviderFactory.java delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAInvoker.java delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.openjpa.OpenJpaImplementationFactory delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/company/Company.java delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/company/CompanyCollection.java delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/company/CompanyCollectionImpl.java delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/org/apache/tuscany/sca/implementation/openjpa/CompanyCollectionTestCase.java delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/org/apache/tuscany/sca/implementation/openjpa/CompanyTestCase.java delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/test/resources/META-INF/orm.xml delete mode 100644 sandbox/lresende/sca/modules/implementation-data-pojo/src/test/resources/META-INF/persistence.xml delete mode 100755 sandbox/lresende/sca/modules/implementation-data-pojo/src/test/resources/company.composite delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/README delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/build.xml delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/calculator-web.png delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/calculator-web.svg delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/pom.xml delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/beans/Calculator.java delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/AddService.java delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/AddServiceImpl.java delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorClient.java delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorService.java delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorServiceImpl.java delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/DivideService.java delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/DivideServiceImpl.java delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/MultiplyService.java delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/MultiplyServiceImpl.java delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/SubtractService.java delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/SubtractServiceImpl.java delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/resources/Calculator.composite delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/resources/wsdl/add.wsdl delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/META-INF/sca-contribution.xml delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/WEB-INF/faces-config.xml delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/WEB-INF/web.xml delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/calc.jsp delete mode 100644 sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/calc_jsf.jsp delete mode 100644 sandbox/lresende/sca/samples/expertise-atom/pom.xml delete mode 100644 sandbox/lresende/sca/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/Expert.java delete mode 100644 sandbox/lresende/sca/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/atom/AtomExpertiseLocator.java delete mode 100644 sandbox/lresende/sca/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/atom/ExpertiseLocator.java delete mode 100644 sandbox/lresende/sca/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/launch/Launch.java delete mode 100644 sandbox/lresende/sca/samples/expertise-atom/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sandbox/lresende/sca/samples/expertise-atom/src/main/resources/atom.composite delete mode 100644 sandbox/lresende/sca/samples/expertise-atom/src/main/resources/atom.composite_diagram delete mode 100644 sandbox/lresende/sca/samples/expertise-atom/src/main/resources/expertLocator.html delete mode 100644 sandbox/lresende/sca/samples/expertise-restfull/pom.xml delete mode 100644 sandbox/lresende/sca/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/Expert.java delete mode 100644 sandbox/lresende/sca/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/launch/Launch.java delete mode 100644 sandbox/lresende/sca/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/ExpertRegistry.java delete mode 100644 sandbox/lresende/sca/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/ExpertRegistryImpl.java delete mode 100644 sandbox/lresende/sca/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/RestfulExpertiseLocator.java delete mode 100644 sandbox/lresende/sca/samples/expertise-restfull/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sandbox/lresende/sca/samples/expertise-restfull/src/main/resources/rest.composite delete mode 100644 sandbox/lresende/sca/samples/expertise-restfull/src/main/resources/rest.composite_diagram delete mode 100644 sandbox/lresende/sca/samples/pom.xml delete mode 100644 sandbox/lresende/sca/samples/store-distributed/README delete mode 100644 sandbox/lresende/sca/samples/store-distributed/build.xml delete mode 100644 sandbox/lresende/sca/samples/store-distributed/cloud.composite delete mode 100644 sandbox/lresende/sca/samples/store-distributed/domain.composite delete mode 100644 sandbox/lresende/sca/samples/store-distributed/pom.xml delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/java/node/LaunchDomain.java delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/java/node/LaunchStoreNodeA.java delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/java/node/LaunchStoreNodeB.java delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/java/node/LaunchStoreNodeC.java delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/java/services/Cart.java delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/java/services/Catalog.java delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/java/services/CurrencyConverter.java delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/java/services/CurrencyConverterImpl.java delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/java/services/FruitsCatalogImpl.java delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/java/services/Item.java delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/java/services/ShoppingCartImpl.java delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/java/services/Total.java delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/resources/cloud/NodeA.composite delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/resources/cloud/NodeB.composite delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/resources/cloud/NodeC.composite delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeA/META-INF/sca-contribution.xml delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeA/content/store.js delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeA/store.composite delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeB/META-INF/sca-contribution.xml delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeB/content/store.js delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeB/store.composite delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeC/META-INF/sca-contribution.xml delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeC/content/index.js delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeC/content/store.html delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeC/content/store.js delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeC/store.composite delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeC/uiservices/store.html delete mode 100644 sandbox/lresende/sca/samples/store-distributed/src/main/resources/uiservices/store.html delete mode 100644 sandbox/lresende/sca/samples/store-distributed/store.png delete mode 100644 sandbox/lresende/sca/samples/store-distributed/store.svg delete mode 100644 sandbox/lresende/sca/samples/store-distributed/workspace.xml delete mode 100644 sandbox/lresende/sca/samples/store-jsf/README delete mode 100644 sandbox/lresende/sca/samples/store-jsf/pom.xml delete mode 100644 sandbox/lresende/sca/samples/store-jsf/src/main/java/beans/Catalog.java delete mode 100644 sandbox/lresende/sca/samples/store-jsf/src/main/java/beans/Product.java delete mode 100644 sandbox/lresende/sca/samples/store-jsf/src/main/webapp/WEB-INF/faces-config.xml delete mode 100644 sandbox/lresende/sca/samples/store-jsf/src/main/webapp/WEB-INF/lib/ajax4jsf-1.1.1.jar delete mode 100644 sandbox/lresende/sca/samples/store-jsf/src/main/webapp/WEB-INF/web.xml delete mode 100644 sandbox/lresende/sca/samples/store-jsf/src/main/webapp/catalog.jsp delete mode 100644 sandbox/lresende/sca/samples/store-secure-webapp/build-dojo.xml delete mode 100644 sandbox/lresende/sca/samples/store-secure-webapp/build.xml delete mode 100644 sandbox/lresende/sca/samples/store-secure-webapp/pom.xml delete mode 100644 sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/services/Catalog.java delete mode 100644 sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/services/CurrencyConverter.java delete mode 100644 sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/services/CurrencyConverterImpl.java delete mode 100644 sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/services/FruitsCatalogImpl.java delete mode 100644 sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/services/Item.java delete mode 100644 sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/store/security/StoreCallbackHandler.java delete mode 100644 sandbox/lresende/sca/samples/store-secure-webapp/src/main/resources/definitions.xml delete mode 100644 sandbox/lresende/sca/samples/store-secure-webapp/src/main/resources/store.composite delete mode 100644 sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/META-INF/sca-contribution.xml delete mode 100644 sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/WEB-INF/geronimo-web.xml delete mode 100644 sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/WEB-INF/web.xml delete mode 100644 sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/auth/logon.html delete mode 100644 sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/auth/logonError.html delete mode 100644 sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/store.html (limited to 'sandbox/lresende') diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/DISCLAIMER b/sandbox/lresende/sca-1.x/demos/customer-map/DISCLAIMER new file mode 100644 index 0000000000..d68a410903 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/demos/customer-map/LICENSE b/sandbox/lresende/sca-1.x/demos/customer-map/LICENSE new file mode 100644 index 0000000000..8aa906c321 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/demos/customer-map/NOTICE b/sandbox/lresende/sca-1.x/demos/customer-map/NOTICE new file mode 100644 index 0000000000..94481d6cfa --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/demos/customer-map/customer-maps.sql b/sandbox/lresende/sca-1.x/demos/customer-map/customer-maps.sql new file mode 100644 index 0000000000..c57678c5d0 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/demos/customer-map/pom.xml b/sandbox/lresende/sca-1.x/demos/customer-map/pom.xml new file mode 100644 index 0000000000..501cbfec3e --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/pom.xml @@ -0,0 +1,171 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-demos + 1.2-incubating-SNAPSHOT + ../pom.xml + + org.apache.tuscany.sca + demo-customer-map + Apache Tuscany Customer Map Demo + http://cwiki.apache.org/TUSCANY + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.2-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.2-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-resource + 1.2-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-feed + 1.2-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-binding-jsonrpc + 1.2-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-http + 1.2-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + 1.2-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-databinding + 1.2-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-databinding-json + 1.2-incubating-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-databinding-sdo + 1.2-incubating-SNAPSHOT + runtime + + + + + org.apache.tuscany.sdo + tuscany-sdo-impl + 1.0-incubating-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-das + 1.1-incubating-SNAPSHOT + runtime + + + + org.apache.derby + derby + 10.1.2.1 + + + + + junit + junit + 3.8.1 + test + + + + httpunit + httpunit + 1.6.1 + test + + + + + demo-customer-map + + + org.apache.tuscany.sdo + tuscany-sdo-plugin + 1.0-incubating-SNAPSHOT + + + customer + + ${basedir}/src/main/resources/customer.xsd + + true + + + generate + + + + + + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/java/customer/CustomerService.java b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/java/customer/CustomerService.java new file mode 100644 index 0000000000..5a99f0bc77 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/demos/customer-map/src/main/java/launch/Launch.java b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/java/launch/Launch.java new file mode 100644 index 0000000000..2bbb40c6a5 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/demos/customer-map/src/main/resources/customer-map.composite b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer-map.composite new file mode 100644 index 0000000000..f7c979687d --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer-map.composite @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.componentType b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.componentType new file mode 100644 index 0000000000..bf56a3f4e9 --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.componentType @@ -0,0 +1,31 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.xml b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.xml new file mode 100644 index 0000000000..17d5da9cd6 --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.xml @@ -0,0 +1,27 @@ + + + + + + + + +
+
diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.xsd b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.xsd new file mode 100644 index 0000000000..f00d0ec56a --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/customer.xsd @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/db.lck b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/db.lck new file mode 100644 index 0000000000..6b9b2452e0 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/db.lck differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/log.ctrl b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/log.ctrl new file mode 100644 index 0000000000..4238225f1f Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/log.ctrl differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/log1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/log1.dat new file mode 100644 index 0000000000..e9eb981c16 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/log1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/logmirror.ctrl b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/logmirror.ctrl new file mode 100644 index 0000000000..4238225f1f Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/log/logmirror.ctrl differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c10.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c10.dat new file mode 100644 index 0000000000..27e2ac866e Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c10.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c101.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c101.dat new file mode 100644 index 0000000000..fc4340b2e7 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c101.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c111.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c111.dat new file mode 100644 index 0000000000..750dffff3f Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c111.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c121.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c121.dat new file mode 100644 index 0000000000..0d0b53b30e Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c121.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c130.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c130.dat new file mode 100644 index 0000000000..65f1689e47 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c130.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c141.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c141.dat new file mode 100644 index 0000000000..5b509fb668 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c141.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c150.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c150.dat new file mode 100644 index 0000000000..d985c31be4 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c150.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c161.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c161.dat new file mode 100644 index 0000000000..d3af4852f2 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c161.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c171.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c171.dat new file mode 100644 index 0000000000..731d9e87fb Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c171.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c180.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c180.dat new file mode 100644 index 0000000000..82298723d7 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c180.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c191.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c191.dat new file mode 100644 index 0000000000..b2d149a0f3 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c191.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1a1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1a1.dat new file mode 100644 index 0000000000..5001ad3d63 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1a1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1b1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1b1.dat new file mode 100644 index 0000000000..b3a539d635 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1b1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1c0.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1c0.dat new file mode 100644 index 0000000000..359525a31a Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1c0.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1d1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1d1.dat new file mode 100644 index 0000000000..9f257df932 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1d1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1e0.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1e0.dat new file mode 100644 index 0000000000..e43e52fb7f Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1e0.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1f1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1f1.dat new file mode 100644 index 0000000000..7e6ee3b1e0 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c1f1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c20.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c20.dat new file mode 100644 index 0000000000..2b9a6b96d4 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c20.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c200.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c200.dat new file mode 100644 index 0000000000..cae919d022 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c200.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c211.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c211.dat new file mode 100644 index 0000000000..c7e311b00e Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c211.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c221.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c221.dat new file mode 100644 index 0000000000..28e89367ce Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c221.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c230.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c230.dat new file mode 100644 index 0000000000..c8aca2ee6f Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c230.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c241.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c241.dat new file mode 100644 index 0000000000..3478bc897d Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c241.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c251.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c251.dat new file mode 100644 index 0000000000..d3d6adf4fb Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c251.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c260.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c260.dat new file mode 100644 index 0000000000..8d7333df7d Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c260.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c271.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c271.dat new file mode 100644 index 0000000000..af722f7d73 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c271.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c281.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c281.dat new file mode 100644 index 0000000000..3972983c2e Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c281.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c290.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c290.dat new file mode 100644 index 0000000000..31577b8124 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c290.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2a1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2a1.dat new file mode 100644 index 0000000000..0f700d13a7 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2a1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2b1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2b1.dat new file mode 100644 index 0000000000..1d6382fb3d Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2b1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2c1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2c1.dat new file mode 100644 index 0000000000..3bc60d886b Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2c1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2d0.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2d0.dat new file mode 100644 index 0000000000..c542d3c91c Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2d0.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2e1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2e1.dat new file mode 100644 index 0000000000..16abd20b5f Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2e1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2f0.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2f0.dat new file mode 100644 index 0000000000..eb26be5932 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c2f0.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c300.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c300.dat new file mode 100644 index 0000000000..35a164db8a Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c300.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c31.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c31.dat new file mode 100644 index 0000000000..44f7fa784d Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c31.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c311.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c311.dat new file mode 100644 index 0000000000..85c095cadb Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c311.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c41.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c41.dat new file mode 100644 index 0000000000..519f1a49be Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c41.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c51.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c51.dat new file mode 100644 index 0000000000..452a28db9b Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c51.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c60.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c60.dat new file mode 100644 index 0000000000..94c357868f Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c60.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c71.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c71.dat new file mode 100644 index 0000000000..9ca2ca97d1 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c71.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c81.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c81.dat new file mode 100644 index 0000000000..85bc9c8351 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c81.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c90.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c90.dat new file mode 100644 index 0000000000..14e77ef636 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/c90.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/ca1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/ca1.dat new file mode 100644 index 0000000000..624ae61a85 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/ca1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cb1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cb1.dat new file mode 100644 index 0000000000..97e6f19260 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cb1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cc0.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cc0.dat new file mode 100644 index 0000000000..5126021a83 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cc0.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cd1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cd1.dat new file mode 100644 index 0000000000..2e135b64ab Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cd1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/ce1.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/ce1.dat new file mode 100644 index 0000000000..076423c10a Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/ce1.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cf0.dat b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cf0.dat new file mode 100644 index 0000000000..bfae1c8b85 Binary files /dev/null and b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/seg0/cf0.dat differ diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/service.properties b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/dastest/service.properties new file mode 100644 index 0000000000..997a33e4db --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/demos/customer-map/src/main/resources/html/binding-atom.js b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/binding-atom.js new file mode 100644 index 0000000000..aacf864f14 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/demos/customer-map/src/main/resources/html/binding-jsonrpc.js b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/binding-jsonrpc.js new file mode 100644 index 0000000000..7f4a092f71 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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 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-1.x/demos/customer-map/src/main/resources/html/index-plain.html b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/index-plain.html new file mode 100644 index 0000000000..0783c3facb --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/index-plain.html @@ -0,0 +1,76 @@ + + + + + Google Maps JavaScript API Example + + + + +
+ + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/index.html b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/index.html new file mode 100644 index 0000000000..53f637bed2 --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/index.html @@ -0,0 +1,55 @@ + + + +Customer Mashup + + + + + + + + + + +

MyCompany.com

+
+

Customer List

+ +
None yet.
+
+
+ + + diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/map.json b/sandbox/lresende/sca-1.x/demos/customer-map/src/main/resources/html/map.json new file mode 100644 index 0000000000..a884141a3c --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/demos/customer-map/src/test/java/customer/CustomerServiceTestCase.java b/sandbox/lresende/sca-1.x/demos/customer-map/src/test/java/customer/CustomerServiceTestCase.java new file mode 100644 index 0000000000..7d289fd62a --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/demos/customer-map/src/test/resources/customer.componentType b/sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.componentType new file mode 100644 index 0000000000..0d1992d597 --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.componentType @@ -0,0 +1,29 @@ + + + + + + + + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.composite b/sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.composite new file mode 100644 index 0000000000..72a692e38b --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.composite @@ -0,0 +1,35 @@ + + + + + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.xml b/sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.xml new file mode 100644 index 0000000000..7b17903540 --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/test/resources/customer.xml @@ -0,0 +1,27 @@ + + + + + + + + +
+
diff --git a/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/DISCLAIMER b/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/DISCLAIMER new file mode 100644 index 0000000000..d68a410903 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/modules/implementation-data-pojo/LICENSE b/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/LICENSE new file mode 100644 index 0000000000..8aa906c321 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/modules/implementation-data-pojo/NOTICE b/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/NOTICE new file mode 100644 index 0000000000..94481d6cfa --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/modules/implementation-data-pojo/README b/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/README new file mode 100644 index 0000000000..ff6ee6a8f4 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/modules/implementation-data-pojo/company.sql b/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/company.sql new file mode 100644 index 0000000000..4911f9e62f --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/modules/implementation-data-pojo/pom.xml b/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/pom.xml new file mode 100644 index 0000000000..7e56a256a2 --- /dev/null +++ b/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/pom.xml @@ -0,0 +1,174 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-modules + 1.5-SNAPSHOT + ../pom.xml + + tuscany-implementation-data-pojo + Apache Tuscany SCA OpenJPA Implementation Extension + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + org.apache.tuscany.sca + tuscany-assembly + 1.5-SNAPSHOT + + + org.apache.tuscany.sca + tuscany-core + 1.5-SNAPSHOT + + + org.apache.tuscany.sca + tuscany-interface + 1.5-SNAPSHOT + + + org.apache.tuscany.sca + tuscany-assembly-xml + 1.5-SNAPSHOT + + + org.apache.tuscany.sca + tuscany-contribution-impl + 1.5-SNAPSHOT + + + org.apache.tuscany.sca + tuscany-sca-api + 1.5-SNAPSHOT + + + org.apache.tuscany.sca + tuscany-databinding + 1.5-SNAPSHOT + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.5-SNAPSHOT + + + org.apache.tuscany.sca + tuscany-data-api + 1.5-SNAPSHOT + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.5-SNAPSHOT + + + org.apache.tuscany.sca + tuscany-policy-transaction + 1.5-SNAPSHOT + + + org.apache.geronimo.specs + geronimo-jpa_3.0_spec + 1.1 + + + org.apache.openjpa + openjpa + 1.0.0 + + + junit + junit + 3.8.1 + test + + + org.apache.derby + derby + 10.3.1.4 + compile + + + + + ${artifactId} + + + + org.codehaus.mojo + sql-maven-plugin + 1.3 + + + + org.apache.derby + derby + + 10.3.1.4 + + + + + + create-db + generate-resources + + execute + + + org.apache.derby.jdbc.EmbeddedDriver + jdbc:derby:${pom.basedir}/target/test-classes/company;create=true + true + continue + skip + ; + + ${pom.basedir}/company.sql + + + + + + + shutdown-database-sothat-test-can-run + process-test-resources + + execute + + + org.apache.derby.jdbc.EmbeddedDriver + jdbc:derby:${pom.basedir}/target/test-classes/company;shutdown=true + true + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementation.java b/sandbox/lresende/sca-1.x/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-1.x/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-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementationFactory.java b/sandbox/lresende/sca-1.x/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-1.x/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-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementationProcessor.java b/sandbox/lresende/sca-1.x/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-1.x/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 { + 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 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 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-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/PersistenceUnitInfoImplProcessor.java b/sandbox/lresende/sca-1.x/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-1.x/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 { + 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 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-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyBrokerFactory.java b/sandbox/lresende/sca-1.x/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-1.x/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-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyBrokerImpl.java b/sandbox/lresende/sca-1.x/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-1.x/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-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyJDBCConfigurationImpl.java b/sandbox/lresende/sca-1.x/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-1.x/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-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyManagerRuntime.java b/sandbox/lresende/sca-1.x/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-1.x/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-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyStoreManager.java b/sandbox/lresende/sca-1.x/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-1.x/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-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/impl/JPAImplementationFactoryImpl.java b/sandbox/lresende/sca-1.x/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-1.x/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-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/impl/JPAImplementationImpl.java b/sandbox/lresende/sca-1.x/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-1.x/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 getProperties() { + // TODO Auto-generated method stub + return Collections.emptyList(); + } + + public List getReferences() { + return Collections.emptyList(); + } + + public List 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-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAImplementationProvider.java b/sandbox/lresende/sca-1.x/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-1.x/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-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAImplementationProviderFactory.java b/sandbox/lresende/sca-1.x/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-1.x/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 { + private ExtensionPointRegistry extensionPointRegistry; + + public JPAImplementationProviderFactory(ExtensionPointRegistry extensionPoints) { + extensionPointRegistry = extensionPoints; + } + + public ImplementationProvider createImplementationProvider(RuntimeComponent component, + JPAImplementation implementation) { + return new JPAImplementationProvider(component, implementation, extensionPointRegistry); + } + + public Class getModelType() { + return JPAImplementation.class; + } + +} diff --git a/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAInvoker.java b/sandbox/lresende/sca-1.x/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-1.x/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-1.x/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/sandbox/lresende/sca-1.x/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-1.x/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-1.x/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.openjpa.OpenJpaImplementationFactory b/sandbox/lresende/sca-1.x/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-1.x/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-1.x/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/sandbox/lresende/sca-1.x/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-1.x/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-1.x/modules/implementation-data-pojo/src/test/java/company/Company.java b/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/java/company/Company.java new file mode 100644 index 0000000000..3ea6e65c0d --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/modules/implementation-data-pojo/src/test/java/company/CompanyCollection.java b/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/java/company/CompanyCollection.java new file mode 100644 index 0000000000..b74f53aa8b --- /dev/null +++ b/sandbox/lresende/sca-1.x/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 { + +} diff --git a/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/java/company/CompanyCollectionImpl.java b/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/java/company/CompanyCollectionImpl.java new file mode 100644 index 0000000000..385defeb0b --- /dev/null +++ b/sandbox/lresende/sca-1.x/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[] 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[] query(String arg0) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/java/org/apache/tuscany/sca/implementation/openjpa/CompanyCollectionTestCase.java b/sandbox/lresende/sca-1.x/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-1.x/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-1.x/modules/implementation-data-pojo/src/test/java/org/apache/tuscany/sca/implementation/openjpa/CompanyTestCase.java b/sandbox/lresende/sca-1.x/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-1.x/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-1.x/modules/implementation-data-pojo/src/test/resources/META-INF/orm.xml b/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/resources/META-INF/orm.xml new file mode 100644 index 0000000000..75e329964f --- /dev/null +++ b/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/resources/META-INF/orm.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/resources/META-INF/persistence.xml b/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/resources/META-INF/persistence.xml new file mode 100644 index 0000000000..302fbfe845 --- /dev/null +++ b/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/resources/META-INF/persistence.xml @@ -0,0 +1,40 @@ + + + + + + + + company.Company + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/resources/company.composite b/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/resources/company.composite new file mode 100755 index 0000000000..fd164d2519 --- /dev/null +++ b/sandbox/lresende/sca-1.x/modules/implementation-data-pojo/src/test/resources/company.composite @@ -0,0 +1,47 @@ + + + + + + + + + + org.apache.tuscany.sca.implementation.openjpa.TuscanyBrokerFactory + managed + DefaultLevel=WARN,SQL=TRACE + buildSchema + + company.Company + + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/README b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/README new file mode 100644 index 0000000000..9f041f4ecb --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/samples/calculator-jsf-webapp/build.xml b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/build.xml new file mode 100644 index 0000000000..11b30c48d2 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/build.xml @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/calculator-web.png b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/calculator-web.png new file mode 100644 index 0000000000..896ddc4093 Binary files /dev/null and b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/calculator-web.png differ diff --git a/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/calculator-web.svg b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/calculator-web.svg new file mode 100644 index 0000000000..00ed27556f --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/calculator-web.svg @@ -0,0 +1,358 @@ + + + + + + + + + + image/svg+xml + + + + + + + + Calculator + + CalculatorServiceComponent + + + CalculatorService + AddServiceComponent + + SubtractServiceComponent + + MultiplyServiceComponent + + DivideServiceComponent + addService + subtractService + multiplyService + divideService + + + + + + WebApp + + diff --git a/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/pom.xml b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/pom.xml new file mode 100644 index 0000000000..0354a8265a --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/pom.xml @@ -0,0 +1,77 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.7-SNAPSHOT + + sample-calculator-jsf-webapp + war + Apache Tuscany SCA Calculator Sample using JSF in a WebApp + + + + org.apache.myfaces.core + myfaces-impl + 1.1.5 + + + + org.apache.myfaces.core + myfaces-api + 1.1.5 + + + + org.apache.tuscany.sca + tuscany-host-webapp + 1.7-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.7-SNAPSHOT + runtime + + + + + javax.servlet + servlet-api + 2.3 + provided + + + + junit + junit + 4.2 + test + + + + + + ${artifactId} + + diff --git a/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/beans/Calculator.java b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/beans/Calculator.java new file mode 100644 index 0000000000..f8ca02f8db --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/AddService.java b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/AddService.java new file mode 100644 index 0000000000..a235e648c7 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/AddServiceImpl.java b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/AddServiceImpl.java new file mode 100644 index 0000000000..8b6fe066a6 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorClient.java b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorClient.java new file mode 100644 index 0000000000..ac76137fcb --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorService.java b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorService.java new file mode 100644 index 0000000000..031fa8b912 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorServiceImpl.java b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorServiceImpl.java new file mode 100644 index 0000000000..ba897fa301 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/DivideService.java b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/DivideService.java new file mode 100644 index 0000000000..497dafd4fd --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/DivideServiceImpl.java b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/DivideServiceImpl.java new file mode 100644 index 0000000000..f7ac0b7287 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/MultiplyService.java b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/MultiplyService.java new file mode 100644 index 0000000000..5290605938 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/MultiplyServiceImpl.java b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/MultiplyServiceImpl.java new file mode 100644 index 0000000000..b7dca792b2 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/SubtractService.java b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/SubtractService.java new file mode 100644 index 0000000000..376b3e5bb9 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/SubtractServiceImpl.java b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/java/calculator/SubtractServiceImpl.java new file mode 100644 index 0000000000..77b128ab8d --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/samples/calculator-jsf-webapp/src/main/resources/Calculator.composite b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/resources/Calculator.composite new file mode 100644 index 0000000000..ac9d010b48 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/resources/Calculator.composite @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/resources/wsdl/add.wsdl b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/resources/wsdl/add.wsdl new file mode 100644 index 0000000000..ae1986c588 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/resources/wsdl/add.wsdl @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/webapp/META-INF/sca-contribution.xml b/sandbox/lresende/sca-1.x/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-1.x/samples/calculator-jsf-webapp/src/main/webapp/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/webapp/WEB-INF/faces-config.xml b/sandbox/lresende/sca-1.x/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-1.x/samples/calculator-jsf-webapp/src/main/webapp/WEB-INF/faces-config.xml @@ -0,0 +1,14 @@ + + + + + + + calculator + beans.Calculator + session + + + diff --git a/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/webapp/WEB-INF/web.xml b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..329e0a5bad --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,59 @@ + + + + + + + Apache Tuscany Calculator Web Service Sample + + + tuscany + org.apache.tuscany.sca.host.webapp.TuscanyServletFilter + + + + tuscany + /* + + + + org.apache.myfaces.webapp.StartupServletContextListener + + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + + Faces Servlet + *.faces + + + + calc.jsp + + + diff --git a/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/webapp/calc.jsp b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/webapp/calc.jsp new file mode 100644 index 0000000000..4c4366747d --- /dev/null +++ b/sandbox/lresende/sca-1.x/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"); +%> + +Calculator sample + + +
+ + + + + + + + + + + + + + + +
ExpressionResult
2 + 3<%= calculatorService.add(2, 3) %>
3 - 2<%= calculatorService.subtract(3, 2) %>
3 * 2<%= calculatorService.multiply(3, 2) %>
3 / 2<%= calculatorService.divide(3, 2) %>
+ + diff --git a/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/webapp/calc_jsf.jsp b/sandbox/lresende/sca-1.x/samples/calculator-jsf-webapp/src/main/webapp/calc_jsf.jsp new file mode 100644 index 0000000000..37985724d0 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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"%> + + + + +Insert title here + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/samples/expertise-atom/pom.xml b/sandbox/lresende/sca-1.x/samples/expertise-atom/pom.xml new file mode 100644 index 0000000000..54840dca7e --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/expertise-atom/pom.xml @@ -0,0 +1,96 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.7-SNAPSHOT + + sample-expertise-atom + Apache Tuscany SCA ATOM Expertise Locator + + + + org.apache.tuscany.sca + tuscany-sca-api + 1.7-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-data-api + 1.7-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.7-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.7-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-widget-runtime-tuscany + 1.7-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-atom-abdera + 1.7-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-atom-js + 1.7-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-http-runtime + 1.7-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-tomcat + 1.7-SNAPSHOT + runtime + + + + + ${artifactId} + + + diff --git a/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/Expert.java b/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/Expert.java new file mode 100644 index 0000000000..5bc3325a18 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/Expert.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.expertise; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import org.apache.tuscany.expertise.Expert; + +public class Expert implements Serializable { + private static final long serialVersionUID = 2026687637313310397L; + + private String id; + private String name; + private String location; + private List expertises = new ArrayList(); + + public Expert() { + + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public List getExpertise() { + return this.expertises; + } + +} diff --git a/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/atom/AtomExpertiseLocator.java b/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/atom/AtomExpertiseLocator.java new file mode 100644 index 0000000000..a2fde8f938 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/atom/AtomExpertiseLocator.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.expertise.atom; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.tuscany.expertise.Expert; +import org.apache.tuscany.sca.data.collection.Entry; +import org.apache.tuscany.sca.data.collection.NotFoundException; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; + +@Scope("COMPOSITE") +public class AtomExpertiseLocator implements ExpertiseLocator { + + private Map experts = new HashMap(); + + @Init + public void init() { + Expert expert; + + expert = new Expert(); + expert.setId("1"); + expert.setName("John Smith"); + expert.setLocation("CA"); + expert.getExpertise().add("SOA"); + expert.getExpertise().add("SCA"); + expert.getExpertise().add("WAS"); + + experts.put(expert.getId(), expert); + + expert = new Expert(); + expert.setId("2"); + expert.setName("Ken Johnson"); + expert.setLocation("NY"); + expert.getExpertise().add("Search"); + + experts.put(expert.getId(), expert); + + expert = new Expert(); + expert.setId("3"); + expert.setName("Mark Smith"); + expert.setLocation("CA"); + expert.getExpertise().add("SCA"); + expert.getExpertise().add("WASCE"); + + experts.put(expert.getId(), expert); + } + + + public Entry[] getAll() { + Entry[] entries = new Entry[experts.size()]; + int i = 0; + for (Map.Entry e: experts.entrySet()) { + entries[i++] = new Entry(e.getKey(), e.getValue()); + } + return entries; + + } + + public Expert get(String key) throws NotFoundException { + Expert item = experts.get(key); + if (item == null) { + throw new NotFoundException(key); + } else { + return item; + } + } + + public String post(String key, Expert item) { + if (key == null) { + int size = experts.entrySet().size() + 1; + key = Integer.toString(size); + item.setId(key); + } + experts.put(key, item); + return key; + } + + public void put(String key, Expert item) throws NotFoundException { + if (!experts.containsKey(key)) { + throw new NotFoundException(key); + } + experts.put(key, item); + } + + public void delete(String key) throws NotFoundException { + if (key == null || key.equals("")) { + experts.clear(); + } else { + Expert expert = experts.remove(key); + if (expert == null) + throw new NotFoundException(key); + } + } + + public Entry[] query(String queryString) { + List> entries = new ArrayList>(); + if (queryString.startsWith("location=")) { + String location = queryString.substring(9); + for (Map.Entry e: experts.entrySet()) { + Expert expert = e.getValue(); + if (expert.getLocation().equals(location)) { + entries.add(new Entry(e.getKey(), e.getValue())); + } + } + } + return entries.toArray(new Entry[entries.size()]); + } +} diff --git a/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/atom/ExpertiseLocator.java b/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/atom/ExpertiseLocator.java new file mode 100644 index 0000000000..84683528cc --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/atom/ExpertiseLocator.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.expertise.atom; + +import org.apache.tuscany.expertise.Expert; +import org.apache.tuscany.sca.data.collection.Collection; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface ExpertiseLocator extends Collection { + +} diff --git a/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/launch/Launch.java b/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/launch/Launch.java new file mode 100644 index 0000000000..eb82100092 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/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 org.apache.tuscany.expertise.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("atom.composite"); + System.out.println("atom.composite ready for big business !!!"); + System.in.read(); + System.out.println("Stopping ..."); + scaDomain.close(); + System.out.println(); + } +} diff --git a/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/resources/META-INF/sca-contribution.xml b/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..c1e9be425c --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/resources/atom.composite b/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/resources/atom.composite new file mode 100644 index 0000000000..75d04f1fe4 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/resources/atom.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/resources/atom.composite_diagram b/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/resources/atom.composite_diagram new file mode 100644 index 0000000000..50c1ccf578 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/resources/atom.composite_diagram @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/resources/expertLocator.html b/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/resources/expertLocator.html new file mode 100644 index 0000000000..22579cb0ce --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/expertise-atom/src/main/resources/expertLocator.html @@ -0,0 +1,110 @@ + + + +Expert Locator + + + + + + + + +

Expertise Locator

+
+

Add new Expert

+
+ Name
+
+ Location
+
+ Expertise
+ separate multiple values with commas (,)
+
+ +
+
+ +
+

Experts

+
+
+
+
+
+ + + diff --git a/sandbox/lresende/sca-1.x/samples/expertise-restfull/pom.xml b/sandbox/lresende/sca-1.x/samples/expertise-restfull/pom.xml new file mode 100644 index 0000000000..8d5459be84 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/expertise-restfull/pom.xml @@ -0,0 +1,82 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.7-SNAPSHOT + + sample-expertise-restfull + Apache Tuscany SCA RESTFull Expertise Locator + + + + org.apache.tuscany.sca + tuscany-sca-api + 1.7-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-data-api + 1.7-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.7-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.7-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-http-runtime + 1.7-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-tomcat + 1.7-SNAPSHOT + runtime + + + + javax.servlet + servlet-api + 2.5 + provided + + + + + ${artifactId} + + + diff --git a/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/Expert.java b/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/Expert.java new file mode 100644 index 0000000000..61ac1c12b7 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/Expert.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.expertise; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class Expert implements Serializable { + private static final long serialVersionUID = 2026687637313310397L; + + private String id; + private String name; + private String location; + private List expertises = new ArrayList(); + + public Expert() { + + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public List getExpertise() { + return this.expertises; + } +} diff --git a/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/launch/Launch.java b/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/launch/Launch.java new file mode 100644 index 0000000000..306abd5465 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/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 org.apache.tuscany.expertise.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("rest.composite"); + System.out.println("rest.composite ready for big business !!!"); + System.in.read(); + System.out.println("Stopping ..."); + scaDomain.close(); + System.out.println(); + } +} diff --git a/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/ExpertRegistry.java b/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/ExpertRegistry.java new file mode 100644 index 0000000000..1b90df36d2 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/ExpertRegistry.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.expertise.restfull; + +import java.util.List; + +import org.apache.tuscany.expertise.Expert; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface ExpertRegistry { + + void addExpert(Expert expert); + + void removeExpert(Expert expert); + + List getExperts(); + + List getExpertsByExpertise(String expertise); +} \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/ExpertRegistryImpl.java b/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/ExpertRegistryImpl.java new file mode 100644 index 0000000000..bf7b2ea03e --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/ExpertRegistryImpl.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.expertise.restfull; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.tuscany.expertise.Expert; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Service; + +@Service(ExpertRegistry.class) +public class ExpertRegistryImpl implements ExpertRegistry { + private List experts = new ArrayList(); + + public ExpertRegistryImpl() { + + } + + @Init + public void init() { + Expert expert; + + expert = new Expert(); + expert.setId("1"); + expert.setName("John Smith"); + expert.setLocation("CA"); + expert.getExpertise().add("SOA"); + expert.getExpertise().add("SCA"); + expert.getExpertise().add("WAS"); + + experts.add(expert); + + expert = new Expert(); + expert.setId("2"); + expert.setName("Ken Johnson"); + expert.setLocation("NY"); + expert.getExpertise().add("Search"); + + experts.add(expert); + + expert = new Expert(); + expert.setId("3"); + expert.setName("Mark Smith"); + expert.setLocation("CA"); + expert.getExpertise().add("SCA"); + expert.getExpertise().add("WASCE"); + + experts.add(expert); + } + + public void addExpert(Expert expert) { + experts.add(expert); + } + + public void removeExpert(Expert expert) { + experts.remove(expert); + } + + public List getExperts() { + return experts; + } + + public List getExpertsByExpertise(String expertise) { + List expertsByExpertise = new ArrayList(); + + for (Expert expert : experts) { + if (expert.getExpertise().contains(expertise)) { + expertsByExpertise.add(expert); + } + } + + return expertsByExpertise; + } +} diff --git a/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/RestfulExpertiseLocator.java b/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/RestfulExpertiseLocator.java new file mode 100644 index 0000000000..ea3915ccb5 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/RestfulExpertiseLocator.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.expertise.restfull; + +import java.io.IOException; +import java.net.URLDecoder; +import java.util.List; + +import javax.servlet.Servlet; +import javax.servlet.ServletException; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.tuscany.expertise.Expert; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(Servlet.class) +@Scope("COMPOSITE") +public class RestfulExpertiseLocator extends HttpServlet implements Servlet { + + private static final long serialVersionUID = 4021701701436888369L; + + @Reference + protected ExpertRegistry experts; + + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String path = URLDecoder.decode(getRequestPath(request), "UTF-8"); + String expertise = path.substring(1); + + if (expertise != null && expertise.length() > 0 ) { + printExperts(response.getOutputStream(), experts.getExpertsByExpertise(expertise)); + } else { + printExperts(response.getOutputStream(), experts.getExperts()); + } + + } + + + private void printExperts(ServletOutputStream out, List experts) throws IOException { + out.print(""); + out.print("

Expertise Locator

"); + + if (experts.size() > 0) { + for (Expert expert: experts) { + out.print("Location: " + expert.getLocation() + " - " + expert.getName() +" ==> "); + for (String expertise : expert.getExpertise()) { + out.print(expertise + ";"); + } + out.print("
"); + } + } else { + out.println("No experts found"); + } + out.print(""); + } + + /** + * + * @param request + * @return + */ + private static String getRequestPath(HttpServletRequest request) { + // Get the request path + String contextPath = request.getContextPath(); + String servletPath = request.getServletPath(); + String requestURI = request.getRequestURI(); + + int contextPathLength = request.getContextPath().length(); + int servletPathLenght = servletPath.contains(contextPath) ? servletPath.length() - contextPath.length() : servletPath.length(); + + String requestPath = requestURI.substring(contextPathLength + servletPathLenght); + + return requestPath; + } + + +} diff --git a/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/resources/META-INF/sca-contribution.xml b/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..96d2cc3c66 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/resources/rest.composite b/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/resources/rest.composite new file mode 100644 index 0000000000..50f19a7c79 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/resources/rest.composite @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/resources/rest.composite_diagram b/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/resources/rest.composite_diagram new file mode 100644 index 0000000000..05dae0d547 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/expertise-restfull/src/main/resources/rest.composite_diagram @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/pom.xml b/sandbox/lresende/sca-1.x/samples/pom.xml new file mode 100644 index 0000000000..e481abc47a --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/pom.xml @@ -0,0 +1,46 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.7-SNAPSHOT + + tuscany-samples-lresende + pom + Apache Tuscany Samples (lresende sandbox) + + + + default + + true + + + expertise-atom + expertise-restfull + store-secure-webapp + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/README b/sandbox/lresende/sca-1.x/samples/store-distributed/README new file mode 100644 index 0000000000..d4797618ff --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/README @@ -0,0 +1,28 @@ +Store Sample +====================================== + +This is a sample store scenario that is used as a getting started guide +for Tuscany SCA. For detailed information, please see: + +http://incubator.apache.org/tuscany/getting-started-with-tuscany.html + +or + +http://incubator.apache.org/tuscany/getting-started-with-tuscany-using-tuscany-eclipse-plugin.html + + +Building And Running The Sample Using Ant +----------------------------------------- +With the binary distribution the sample can be built using Ant as follows: + +cd store +ant compile + +and then, to run: + +ant run + +Once the store application is running use your browser to visit the following +URL: + +http://localhost:8080/store/ diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/build.xml b/sandbox/lresende/sca-1.x/samples/store-distributed/build.xml new file mode 100644 index 0000000000..652afc3570 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/build.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/cloud.composite b/sandbox/lresende/sca-1.x/samples/store-distributed/cloud.composite new file mode 100644 index 0000000000..7bd13d5b6f --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/cloud.composite @@ -0,0 +1,27 @@ + + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/domain.composite b/sandbox/lresende/sca-1.x/samples/store-distributed/domain.composite new file mode 100644 index 0000000000..6898c454af --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/domain.composite @@ -0,0 +1,27 @@ + + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/pom.xml b/sandbox/lresende/sca-1.x/samples/store-distributed/pom.xml new file mode 100644 index 0000000000..bb24b6cedd --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/pom.xml @@ -0,0 +1,109 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.7-SNAPSHOT + + sample-store-distributed + Apache Tuscany SCA Getting Started Online Store Sample + + + + org.apache.tuscany.sca + tuscany-node2-api + 1.7-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-node2-launcher + 1.7-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-domain-manager + 1.7-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-data-api + 1.7-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.7-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-widget-runtime + 1.7-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-atom-abdera + 1.7-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jsonrpc-runtime + 1.7-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-http-runtime + 1.7-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-tomcat + 1.7-SNAPSHOT + runtime + + + + junit + junit + 4.2 + test + + + + + ${artifactId} + + + diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/node/LaunchDomain.java b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/node/LaunchDomain.java new file mode 100644 index 0000000000..dd19f6b49b --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/node/LaunchDomain.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package node; + +import org.apache.tuscany.sca.node.launcher.DomainManagerLauncher; + +/** + * This server program that loads a composite to provide simple registry function. + * This server can be replaced with any registry that is appropriate but the components + * in each node that talk to the registry should be replaced also. + */ +public class LaunchDomain { + public static void main(String[] args) throws Exception { + DomainManagerLauncher.main(args); + } + +} diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/node/LaunchStoreNodeA.java b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/node/LaunchStoreNodeA.java new file mode 100644 index 0000000000..9016e515fb --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/node/LaunchStoreNodeA.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 node; + +import org.apache.tuscany.sca.node.launcher.NodeLauncher; + +public class LaunchStoreNodeA { + public static void main(String[] args) throws Exception { + NodeLauncher.main(new String[] {"http://localhost:9990/node-config/NodeA"}); + } +} diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/node/LaunchStoreNodeB.java b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/node/LaunchStoreNodeB.java new file mode 100644 index 0000000000..2b387aec82 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/node/LaunchStoreNodeB.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 node; + +import org.apache.tuscany.sca.node.launcher.NodeLauncher; + +public class LaunchStoreNodeB { + public static void main(String[] args) throws Exception { + NodeLauncher.main(new String[] {"http://localhost:9990/node-config/NodeB"}); + } +} diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/node/LaunchStoreNodeC.java b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/node/LaunchStoreNodeC.java new file mode 100644 index 0000000000..fb138e484f --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/node/LaunchStoreNodeC.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 node; + +import org.apache.tuscany.sca.node.launcher.NodeLauncher; + +public class LaunchStoreNodeC { + public static void main(String[] args) throws Exception { + NodeLauncher.main(new String[] {"http://localhost:9990/node-config/NodeC"}); + } +} diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/Cart.java b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/Cart.java new file mode 100644 index 0000000000..9e6226d963 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/Cart.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 services; + +import org.apache.tuscany.sca.data.collection.Collection; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Cart extends Collection { + +} diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/Catalog.java b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/Catalog.java new file mode 100644 index 0000000000..2c3b19f579 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/Catalog.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package services; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Catalog { + Item[] get(); +} diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/CurrencyConverter.java b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/CurrencyConverter.java new file mode 100644 index 0000000000..e104a0423a --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/CurrencyConverter.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package services; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface CurrencyConverter { + public double getConversion(String fromCurrenycCode, String toCurrencyCode, double amount); + + public String getCurrencySymbol(String currencyCode); +} diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/CurrencyConverterImpl.java b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/CurrencyConverterImpl.java new file mode 100644 index 0000000000..c354aed447 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/CurrencyConverterImpl.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 services; + +public class CurrencyConverterImpl implements CurrencyConverter { + public double getConversion(String fromCurrencyCode, String toCurrencyCode, double amount) { + if (toCurrencyCode.equals("USD")) + return amount; + else if (toCurrencyCode.equals("EUR")) + return ((double)Math.round(amount * 0.7256 * 100)) /100; + return 0; + } + + public String getCurrencySymbol(String currencyCode) { + if (currencyCode.equals("USD")) + return "$"; + else if (currencyCode.equals("EUR")) + return "E"; //"€"; + return "?"; + } +} diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/FruitsCatalogImpl.java b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/FruitsCatalogImpl.java new file mode 100644 index 0000000000..377b3d7e59 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/FruitsCatalogImpl.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package services; + +import java.util.ArrayList; +import java.util.List; + +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Property; +import org.osoa.sca.annotations.Reference; + +public class FruitsCatalogImpl implements Catalog { + + @Property + public String currencyCode = "USD"; + + @Reference + public CurrencyConverter currencyConverter; + + private List catalog = new ArrayList(); + + @Init + public void init() { + String currencySymbol = currencyConverter.getCurrencySymbol(currencyCode); + catalog.add(new Item("Apple", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 2.99))); + catalog.add(new Item("Orange", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 3.55))); + catalog.add(new Item("Pear", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 1.55))); + } + + public Item[] get() { + Item[] catalogArray = new Item[catalog.size()]; + catalog.toArray(catalogArray); + return catalogArray; + } +} diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/Item.java b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/Item.java new file mode 100644 index 0000000000..27abd4f016 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/Item.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 services; + + +public class Item { + private String name; + private String price; + + public Item() { + } + + public Item(String name, String price) { + this.name = name; + this.price = price; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPrice() { + return price; + } + + public void setPrice(String price) { + this.price = price; + } + +} diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/ShoppingCartImpl.java b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/ShoppingCartImpl.java new file mode 100644 index 0000000000..9889921a96 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/ShoppingCartImpl.java @@ -0,0 +1,112 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package services; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import org.apache.tuscany.sca.data.collection.Entry; +import org.apache.tuscany.sca.data.collection.NotFoundException; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; + +@Scope("COMPOSITE") +public class ShoppingCartImpl implements Cart, Total { + + private Map cart; + + @Init + public void init() { + cart = new HashMap(); + } + + public Entry[] getAll() { + Entry[] entries = new Entry[cart.size()]; + int i = 0; + for (Map.Entry e: cart.entrySet()) { + entries[i++] = new Entry(e.getKey(), e.getValue()); + } + return entries; + } + + public Item get(String key) throws NotFoundException { + Item item = cart.get(key); + if (item == null) { + throw new NotFoundException(key); + } else { + return item; + } + } + + public String post(String key, Item item) { + if (key == null) { + key ="cart-" + UUID.randomUUID().toString(); + } + cart.put(key, item); + return key; + } + + public void put(String key, Item item) throws NotFoundException { + if (!cart.containsKey(key)) { + throw new NotFoundException(key); + } + cart.put(key, item); + } + + public void delete(String key) throws NotFoundException { + if (key == null || key.equals("")) { + cart.clear(); + } else { + Item item = cart.remove(key); + if (item == null) + throw new NotFoundException(key); + } + } + + public Entry[] query(String queryString) { + List> entries = new ArrayList>(); + if (queryString.startsWith("name=")) { + String name = queryString.substring(5); + for (Map.Entry e: cart.entrySet()) { + Item item = e.getValue(); + if (item.getName().equals(name)) { + entries.add(new Entry(e.getKey(), e.getValue())); + } + } + } + return entries.toArray(new Entry[entries.size()]); + } + + public String getTotal() { + double total = 0; + String currencySymbol = ""; + if (!cart.isEmpty()) { + Item item = cart.values().iterator().next(); + currencySymbol = item.getPrice().substring(0, 1); + } + for (Item item : cart.values()) { + total += Double.valueOf(item.getPrice().substring(1)); + } + return currencySymbol + String.valueOf(total); + } +} diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/Total.java b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/Total.java new file mode 100644 index 0000000000..8f464e526f --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/java/services/Total.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package services; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Total { + + String getTotal(); + +} diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/cloud/NodeA.composite b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/cloud/NodeA.composite new file mode 100644 index 0000000000..f7bfd0fcb6 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/cloud/NodeA.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/cloud/NodeB.composite b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/cloud/NodeB.composite new file mode 100644 index 0000000000..187c5caf1c --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/cloud/NodeB.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/cloud/NodeC.composite b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/cloud/NodeC.composite new file mode 100644 index 0000000000..96c2e02acb --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/cloud/NodeC.composite @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeA/META-INF/sca-contribution.xml b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeA/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..f165ee0e29 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeA/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeA/content/store.js b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeA/content/store.js new file mode 100644 index 0000000000..7df50eef64 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeA/content/store.js @@ -0,0 +1,510 @@ +/* Apache Tuscany SCA Widget header */ + +/* + * 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 */ + +alert('loading sotre.js from nodeA'); + +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 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"); +}; + +//--------------------- + + +var propertyMapA = new Object(); +var referenceMapA = new Object(); + +alert("referenceMapA : " + referenceMapA); +referenceMapA.catalog = new JSONRpcClient("http://luck.ibm.com:8100/Catalog").Service; + +alert('finished loading store.js from nodeA'); + +/** End of Apache Tuscany SCA Widget */ + diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeA/store.composite b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeA/store.composite new file mode 100644 index 0000000000..99d1fb5dd7 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeA/store.composite @@ -0,0 +1,46 @@ + + + + + + + USD + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeB/META-INF/sca-contribution.xml b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeB/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..0f8e76ccd7 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeB/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeB/content/store.js b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeB/content/store.js new file mode 100644 index 0000000000..c95a3b2f95 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeB/content/store.js @@ -0,0 +1,647 @@ +/* Apache Tuscany SCA Widget header */ + +/* + * 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 */ + +alert('loading sotre.js from nodeB'); + +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 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"); +}; + + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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.msxmlNames = [ "MSXML2.XMLHTTP.5.0", + "MSXML2.XMLHTTP.4.0", + "MSXML2.XMLHTTP.3.0", + "MSXML2.XMLHTTP", + "Microsoft.XMLHTTP" ]; + + this.uri=uri; + + this.get = function(id, responseFunction) { + var xhr = this.createXMLHttpRequest(); + xhr.onreadystatechange = function() { + if (xhr.readyState == 4) { + if (xhr.status == 200) { + var strDocument = xhr.responseText; + var xmlDocument = xhr.responseXML; + if(!xmlDocument || xmlDocument.childNodes.length==0){ + xmlDocument = (new DOMParser()).parseFromString(strDocument, "text/xml"); + } + if (responseFunction != null) responseFunction(xmlDocument); + } 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) { + var strDocument = xhr.responseText; + var xmlDocument = xhr.responseXML; + if(!xmlDocument || xmlDocument.childNodes.length==0){ + xmlDocument = (new DOMParser()).parseFromString(strDocument, "text/xml"); + } + if (responseFunction != null) responseFunction(xmlDocument); + } 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) { + var strDocument = xhr.responseText; + var xmlDocument = xhr.responseXML; + if(!xmlDocument || xmlDocument.childNodes.length==0){ + xmlDocument = (new DOMParser()).parseFromString(strDocument, "text/xml"); + } + if (responseFunction != null) responseFunction(xmlDocument); + } 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.del = 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 () { + /* Mozilla XMLHttpRequest */ + try {return new XMLHttpRequest();} catch(e) {} + + /* Microsoft MSXML ActiveX */ + for (var i=0;i < this.msxmlNames.length; i++) { + try {return new ActiveXObject(this.msxmlNames[i]);} catch (e) {} + } + alert("XML http request not supported"); + return null; + } + if (typeof DOMParser == "undefined") { + DOMParser = function () {} + + DOMParser.prototype.parseFromString = function (str, contentType) { + if (typeof ActiveXObject != "undefined") { + var d = new ActiveXObject("MSXML.DomDocument"); + d.loadXML(str); + return d; + } else if (typeof XMLHttpRequest != "undefined") { + var req = new XMLHttpRequest; + req.open("GET", "data:" + (contentType || "application/xml") + + ";charset=utf-8," + encodeURIComponent(str), false); + if (req.overrideMimeType) { + req.overrideMimeType(contentType); + } + req.send(null); + return req.responseXML; + } + } + } +} + + +alert(window.top); +alert(window.parent); +alert(window.top.document.referenceMap); +window.top.document.referenceMap.shoppingCart = new AtomClient("http://localhost:8200/ShoppingCart/Cart"); +window.top.document.referenceMap.shoppingTotal = new JSONRpcClient("http://localhost:8200/ShoppingCart/Total").Service; + +alert('finished loading store.js from nodeB'); + +/** End of Apache Tuscany SCA Widget */ + diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeB/store.composite b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeB/store.composite new file mode 100644 index 0000000000..b66b937546 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeB/store.composite @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeC/META-INF/sca-contribution.xml b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeC/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..15bab17c1a --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeC/META-INF/sca-contribution.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeC/content/index.js b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeC/content/index.js new file mode 100644 index 0000000000..d42dc5512d --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeC/content/index.js @@ -0,0 +1,66 @@ +/*-----------------------------------------------------------------------------+ +| Product: index.js - Ajile's default auto-loader for shared dependencies. +|+-----------------------------------------------------------------------------+ +| Author: Michael A. I. Lee [ http://ajile.iskitz.com/ ] +| +| Created: Friday, November 2, 2006 [2006.06.02 - 19:44:40 EDT] +| Modified: Saturday December 16, 2006 [2006.12.16 - 13:00:00 EST] +|+-----------------------------------------------------------------------------+ +| +| README: +| +| If you need a way to import/load a common set of scripts for every page on +| your site or in your web application, this is the file you should use. +| +| This index.js file can be used to define scripting dependencies for a page, +| site, or application in a single place for use in many places. +| +| As of Ajile 0.6.5, Ajile automatically loads the index.js file found in its +| directory. To disable this behavior, use the "mvcshareoff" load-time option +| in the src parameter of the script tag used to load Ajile. +| +| Placing your top-level Namespace, Import, and Load directives in this file +| allows Ajile to automatically load, import, and initialize all required +| modules at startup for every page that uses Ajile. +| +| By using this file as described, all scripting logic can be controlled from +| a single point separate from the page, site or application's display logic. +| +| When used within web pages (e.g. HTML, XHTML, HTA, JSP, ASP, PHP, CGI, etc.) +| only 1 SCRIPT tag is required. That SCRIPT tag must identify the location of +| the Ajile module. For example: +| +| +| +| Visit http://ajile.iskitz.com/ to start creating "Smart scripts that play nice!" +|+----------------------------------------------------------------------------*/ + +// You may copy this file into your own projects and use it to define your +// shared dependencies. This file must reside in the same location as the Ajile +// module. The logic below demonstrates how this file can be used to define an +// auto-loader. You'll most-likely use index.js to auto-load common or shared +// functionality. + +/* + + // Example options setting... + Ajile.EnableCloak(false); + Ajile.EnableDebug(); + Ajile.EnableOverride(false); + + // Define your namespace. + Namespace ("your.namespace"); + + // Import a versioned namespace. + Import ("some.namespace.*.0.6", "some/path/"); + + // Import a module's public members. + Import ("some.other.Module.*"); + + // Define a new module. + your.namespace.NewModule = new function() + { + // Your implementation here... + }; + +//*/ \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeC/content/store.html b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeC/content/store.html new file mode 100644 index 0000000000..0e3ab370b3 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeC/content/store.html @@ -0,0 +1,114 @@ + + + +Store + + + + + + + +

Store

+ + + +
+

Catalog

+
+
+
+ +
+ +
+ +

Your Shopping Cart

+
+
+
+
+
+ + + (feed) +
+
+ + + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeC/content/store.js b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeC/content/store.js new file mode 100644 index 0000000000..088a80a1d1 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/nodeC/content/store.js @@ -0,0 +1,39 @@ + +function dhtmlLoadScript(url) { + var script = document.createElement('script'); + script.type = 'text/javascript'; + script.src = url; + document.getElementsByTagName('head')[0].appendChild(script); +} + +function dhtmlLoadScriptIFrame(iframeId, url) { + var iframe = document.createElement("IFRAME"); + iframe.style.display="none"; + iframe.name = iframeId; + iframe.id = iframeId; + iframe.src = url; + document.body.appendChild(iframe); + + //var iframeDocument = window.frames[iframeId].document; + //iframeDocument.write(' + + + + + + +

Store

+
+

Catalog

+
+
+
+ +
+ +
+ +

Your Shopping Cart

+
+
+
+
+
+ + + (feed) +
+
+ + diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/uiservices/store.html b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/uiservices/store.html new file mode 100644 index 0000000000..45604463d1 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/src/main/resources/uiservices/store.html @@ -0,0 +1,162 @@ + + + +Store + + + + + + + + +

Store

+
+

Catalog

+
+
+
+ +
+ +
+ +

Your Shopping Cart

+
+
+
+
+
+ + + (feed) +
+
+ + diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/store.png b/sandbox/lresende/sca-1.x/samples/store-distributed/store.png new file mode 100644 index 0000000000..da413edeee Binary files /dev/null and b/sandbox/lresende/sca-1.x/samples/store-distributed/store.png differ diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/store.svg b/sandbox/lresende/sca-1.x/samples/store-distributed/store.svg new file mode 100644 index 0000000000..74f8ecd36d --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/store.svg @@ -0,0 +1,304 @@ + + + + + + + + + + image/svg+xml + + + + + + + + store + ufs + + ShoppingCart + + CurrencyConverter + + + + + + + + + + CurrenyCode HTTP JSONRPC Atom + + Catalog + + + + diff --git a/sandbox/lresende/sca-1.x/samples/store-distributed/workspace.xml b/sandbox/lresende/sca-1.x/samples/store-distributed/workspace.xml new file mode 100644 index 0000000000..d6cb2bfc81 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-distributed/workspace.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/store-jsf/README b/sandbox/lresende/sca-1.x/samples/store-jsf/README new file mode 100644 index 0000000000..79ddb03568 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/samples/store-jsf/pom.xml b/sandbox/lresende/sca-1.x/samples/store-jsf/pom.xml new file mode 100644 index 0000000000..fe68a0e4b5 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-jsf/pom.xml @@ -0,0 +1,64 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.7-SNAPSHOT + + sample-store-jsf + war + Apache Tuscany SCA Getting Started Online Store Sample using JSF + + + + + org.apache.myfaces.core + myfaces-impl + 1.1.5 + + + + org.apache.myfaces.core + myfaces-api + 1.1.5 + + + + + + junit + junit + 4.2 + test + + + + + + ${artifactId} + + + diff --git a/sandbox/lresende/sca-1.x/samples/store-jsf/src/main/java/beans/Catalog.java b/sandbox/lresende/sca-1.x/samples/store-jsf/src/main/java/beans/Catalog.java new file mode 100644 index 0000000000..01e4a0d481 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/samples/store-jsf/src/main/java/beans/Product.java b/sandbox/lresende/sca-1.x/samples/store-jsf/src/main/java/beans/Product.java new file mode 100644 index 0000000000..9f3df2f95c --- /dev/null +++ b/sandbox/lresende/sca-1.x/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-1.x/samples/store-jsf/src/main/webapp/WEB-INF/faces-config.xml b/sandbox/lresende/sca-1.x/samples/store-jsf/src/main/webapp/WEB-INF/faces-config.xml new file mode 100644 index 0000000000..1dd376a58f --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-jsf/src/main/webapp/WEB-INF/faces-config.xml @@ -0,0 +1,31 @@ + + + + + + + catalog + beans.Catalog + session + + + diff --git a/sandbox/lresende/sca-1.x/samples/store-jsf/src/main/webapp/WEB-INF/lib/ajax4jsf-1.1.1.jar b/sandbox/lresende/sca-1.x/samples/store-jsf/src/main/webapp/WEB-INF/lib/ajax4jsf-1.1.1.jar new file mode 100644 index 0000000000..347b0d2066 Binary files /dev/null and b/sandbox/lresende/sca-1.x/samples/store-jsf/src/main/webapp/WEB-INF/lib/ajax4jsf-1.1.1.jar differ diff --git a/sandbox/lresende/sca-1.x/samples/store-jsf/src/main/webapp/WEB-INF/web.xml b/sandbox/lresende/sca-1.x/samples/store-jsf/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..a39a51eefc --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-jsf/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,31 @@ + + + + SkeletonProject + + ajax4jsf + Ajax4jsf Filter + org.ajax4jsf.Filter + + + ajax4jsf + Faces Servlet + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + + Faces Servlet + *.faces + + + + catalog.jsp + + diff --git a/sandbox/lresende/sca-1.x/samples/store-jsf/src/main/webapp/catalog.jsp b/sandbox/lresende/sca-1.x/samples/store-jsf/src/main/webapp/catalog.jsp new file mode 100644 index 0000000000..d456bedcc0 --- /dev/null +++ b/sandbox/lresende/sca-1.x/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"%> + + + + +Basic JSF/Ajax sample + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/samples/store-secure-webapp/build-dojo.xml b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/build-dojo.xml new file mode 100644 index 0000000000..6167eba10e --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/build-dojo.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/store-secure-webapp/build.xml b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/build.xml new file mode 100644 index 0000000000..fce9338312 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/build.xml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/store-secure-webapp/pom.xml b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/pom.xml new file mode 100644 index 0000000000..b95dda30fd --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/pom.xml @@ -0,0 +1,144 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.7-SNAPSHOT + + sample-store-secure-webapp + war + Apache Tuscany SCA Sample Store in a WebApp + + + + org.apache.tuscany.sca + tuscany-host-webapp + 1.7-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.7-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jsonrpc-runtime + 1.7-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-policy-security + 1.7-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-policy-security-http + 1.7-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-policy-security-geronimo + 1.7-SNAPSHOT + + + + + stax + stax-api + 1.0.1 + provided + + + + + javax.servlet + servlet-api + 2.3 + provided + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-antrun-plugin + + + + ant + ant-trax + 1.6.5 + + + + + copy-dojo-files + generate-resources + + run + + + + + + + + + + + + clean-dojo-files + clean + + run + + + + + + + + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/services/Catalog.java b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/services/Catalog.java new file mode 100644 index 0000000000..0d8d3d561a --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/services/Catalog.java @@ -0,0 +1,8 @@ +package services; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Catalog { + Item[] get(); +} diff --git a/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/services/CurrencyConverter.java b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/services/CurrencyConverter.java new file mode 100644 index 0000000000..15b2c6e3a6 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/services/CurrencyConverter.java @@ -0,0 +1,12 @@ +package services; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface CurrencyConverter { + public double getConversion(String fromCurrenycCode, + String toCurrencyCode, + double amount); + + public String getCurrencySymbol(String currencyCode); +} diff --git a/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/services/CurrencyConverterImpl.java b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/services/CurrencyConverterImpl.java new file mode 100644 index 0000000000..2bf9d8d42b --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/services/CurrencyConverterImpl.java @@ -0,0 +1,21 @@ +package services; + +public class CurrencyConverterImpl implements CurrencyConverter { + public double getConversion(String fromCurrencyCode, + String toCurrencyCode, + double amount) { + if (toCurrencyCode.equals("USD")) + return amount; + else if (toCurrencyCode.equals("EUR")) + return ((double)Math.round(amount * 0.7256 * 100)) /100; + return 0; + } + + public String getCurrencySymbol(String currencyCode) { + if (currencyCode.equals("USD")) + return "$"; + else if (currencyCode.equals("EUR")) + return "E"; //"€"; + return "?"; + } +} diff --git a/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/services/FruitsCatalogImpl.java b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/services/FruitsCatalogImpl.java new file mode 100644 index 0000000000..4cac4ac21d --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/services/FruitsCatalogImpl.java @@ -0,0 +1,35 @@ +package services; + +import java.util.ArrayList; +import java.util.List; + +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Property; +import org.osoa.sca.annotations.Reference; + +public class FruitsCatalogImpl implements Catalog { + @Property + public String currencyCode = "USD"; + @Reference + public CurrencyConverter currencyConverter; + + private List catalog = new ArrayList(); + + @Init + public void init() { + String currencySymbol = currencyConverter + .getCurrencySymbol(currencyCode); + catalog.add(new Item("Apple", currencySymbol + + currencyConverter.getConversion("USD", currencyCode, 2.99))); + catalog.add(new Item("Orange", currencySymbol + + currencyConverter.getConversion("USD", currencyCode, 3.55))); + catalog.add(new Item("Pear", currencySymbol + + currencyConverter.getConversion("USD", currencyCode, 1.55))); + } + + public Item[] get() { + Item[] catalogArray = new Item[catalog.size()]; + catalog.toArray(catalogArray); + return catalogArray; + } +} diff --git a/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/services/Item.java b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/services/Item.java new file mode 100644 index 0000000000..e8bcfabfb1 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/services/Item.java @@ -0,0 +1,30 @@ +package services; + +public class Item { + private String name; + private String price; + + public Item() { + } + + public Item(String name, String price) { + this.name = name; + this.price = price; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPrice() { + return price; + } + + public void setPrice(String price) { + this.price = price; + } +} diff --git a/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/store/security/StoreCallbackHandler.java b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/store/security/StoreCallbackHandler.java new file mode 100644 index 0000000000..88e3a778a0 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/java/store/security/StoreCallbackHandler.java @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package store.security; + +import java.io.IOException; + +import javax.security.auth.callback.Callback; +import javax.security.auth.callback.CallbackHandler; +import javax.security.auth.callback.NameCallback; +import javax.security.auth.callback.PasswordCallback; +import javax.security.auth.callback.UnsupportedCallbackException; + +/** + * @version $Rev$ $Date$ + */ +public class StoreCallbackHandler implements CallbackHandler { + + public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { + for (int i = 0; i < callbacks.length; i++) { + if (callbacks[i] instanceof NameCallback) { + NameCallback nc = (NameCallback)callbacks[i]; + nc.setName("PWEST"); + } else if (callbacks[i] instanceof PasswordCallback) { + PasswordCallback pc = (PasswordCallback)callbacks[i]; + pc.setPassword("xxx".toCharArray()); + } else { + throw new UnsupportedCallbackException + (callbacks[i], "Unsupported Callback!"); + } + } + } + +} diff --git a/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/resources/definitions.xml b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/resources/definitions.xml new file mode 100644 index 0000000000..55789c8443 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/resources/definitions.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + ldap-realm + ldap-realm + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/resources/store.composite b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/resources/store.composite new file mode 100644 index 0000000000..5c567cbd15 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/resources/store.composite @@ -0,0 +1,41 @@ + + + + + + + + + USD + + + + + + + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/META-INF/sca-contribution.xml b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..41c84c9a44 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/WEB-INF/geronimo-web.xml b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/WEB-INF/geronimo-web.xml new file mode 100644 index 0000000000..705010bf7c --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/WEB-INF/geronimo-web.xml @@ -0,0 +1,73 @@ + + + + + org.apache.tuscany + sample-store-secure-webapp + 1.0 + car + + + + org.apache.axiom + org.apache.axis2 + org.apache.commons + org.jdom + + + + /sample-store-secure-webapp + + ldap-realm + + + + + + + + + + + ldap-realm + + + + ldap-realm + org.apache.geronimo.security.realm.providers.LDAPLoginModule + + com.sun.jndi.ldap.LdapCtxFactory + ldap://dpev007.innovate.ibm.com:389 + cn=ldaproot,dc=tnc,dc=org + ldappass + simple + ou=people,dc=tnc,dc=org + uid={0} + false + ou=groups,dc=tnc,dc=org + cn + (member={0}) + false + + + + + diff --git a/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/WEB-INF/web.xml b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..704c7631b0 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,60 @@ + + + sample-store-secure-webapp + + + tuscany + org.apache.tuscany.sca.host.webapp.TuscanyServletFilter + + + + tuscany + /* + + + + store.html + + + + + + FORM + ldap-realm + + /auth/logon.html + /auth/logonError.html + + + + + Application managers + manager + + + + Application users + user + + + + + Areas with authentication required + /protected/* + GET + POST + + + manager + + + + + org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled + java.lang.String + false + + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/auth/logon.html b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/auth/logon.html new file mode 100644 index 0000000000..09191f7010 --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/auth/logon.html @@ -0,0 +1,20 @@ + +

Store Authentication

+
+ + + + + + + + + + + + +
Username:
Password:
+ +
+
+ \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/auth/logonError.html b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/auth/logonError.html new file mode 100644 index 0000000000..c0c0f7b75d --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/auth/logonError.html @@ -0,0 +1,5 @@ + +

Store Authentication ERROR

+Username, password or role incorrect. +                                                         + \ No newline at end of file diff --git a/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/store.html b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/store.html new file mode 100644 index 0000000000..e4cd0ba12d --- /dev/null +++ b/sandbox/lresende/sca-1.x/samples/store-secure-webapp/src/main/webapp/store.html @@ -0,0 +1,48 @@ + + +Store + + + + + + + + + + +

Store

+
+

Catalog

+
+
+
+
+ +
+
+ + diff --git a/sandbox/lresende/sca/demos/customer-map/DISCLAIMER b/sandbox/lresende/sca/demos/customer-map/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 8aa906c321..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - 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 deleted file mode 100644 index 94481d6cfa..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${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 deleted file mode 100644 index c57678c5d0..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/customer-maps.sql +++ /dev/null @@ -1,28 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT 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 deleted file mode 100644 index 501cbfec3e..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/pom.xml +++ /dev/null @@ -1,171 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-demos - 1.2-incubating-SNAPSHOT - ../pom.xml - - org.apache.tuscany.sca - demo-customer-map - Apache Tuscany Customer Map Demo - http://cwiki.apache.org/TUSCANY - - - - apache.incubator - http://people.apache.org/repo/m2-incubating-repository - - - - - - - org.apache.tuscany.sca - tuscany-host-embedded - 1.2-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.2-incubating-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-implementation-resource - 1.2-incubating-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-feed - 1.2-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-binding-jsonrpc - 1.2-incubating-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-http - 1.2-incubating-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-host-jetty - 1.2-incubating-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-databinding - 1.2-incubating-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-databinding-json - 1.2-incubating-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-databinding-sdo - 1.2-incubating-SNAPSHOT - runtime - - - - - org.apache.tuscany.sdo - tuscany-sdo-impl - 1.0-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-das - 1.1-incubating-SNAPSHOT - runtime - - - - org.apache.derby - derby - 10.1.2.1 - - - - - junit - junit - 3.8.1 - test - - - - httpunit - httpunit - 1.6.1 - test - - - - - demo-customer-map - - - org.apache.tuscany.sdo - tuscany-sdo-plugin - 1.0-incubating-SNAPSHOT - - - customer - - ${basedir}/src/main/resources/customer.xsd - - true - - - generate - - - - - - - \ 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 deleted file mode 100644 index 5a99f0bc77..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/src/main/java/customer/CustomerService.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index 2bbb40c6a5..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/src/main/java/launch/Launch.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index f7c979687d..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/src/main/resources/customer-map.composite +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ 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 deleted file mode 100644 index bf56a3f4e9..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/src/main/resources/customer.componentType +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - \ 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 deleted file mode 100644 index 17d5da9cd6..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/src/main/resources/customer.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - -
-
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 deleted file mode 100644 index f00d0ec56a..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/src/main/resources/customer.xsd +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - 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 deleted file mode 100644 index 6b9b2452e0..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/db.lck and /dev/null 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 deleted file mode 100644 index 4238225f1f..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/log/log.ctrl and /dev/null 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 deleted file mode 100644 index e9eb981c16..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/log/log1.dat and /dev/null 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 deleted file mode 100644 index 4238225f1f..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/log/logmirror.ctrl and /dev/null 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 deleted file mode 100644 index 27e2ac866e..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c10.dat and /dev/null 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 deleted file mode 100644 index fc4340b2e7..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c101.dat and /dev/null 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 deleted file mode 100644 index 750dffff3f..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c111.dat and /dev/null 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 deleted file mode 100644 index 0d0b53b30e..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c121.dat and /dev/null 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 deleted file mode 100644 index 65f1689e47..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c130.dat and /dev/null 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 deleted file mode 100644 index 5b509fb668..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c141.dat and /dev/null 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 deleted file mode 100644 index d985c31be4..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c150.dat and /dev/null 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 deleted file mode 100644 index d3af4852f2..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c161.dat and /dev/null 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 deleted file mode 100644 index 731d9e87fb..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c171.dat and /dev/null 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 deleted file mode 100644 index 82298723d7..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c180.dat and /dev/null 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 deleted file mode 100644 index b2d149a0f3..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c191.dat and /dev/null 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 deleted file mode 100644 index 5001ad3d63..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1a1.dat and /dev/null 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 deleted file mode 100644 index b3a539d635..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1b1.dat and /dev/null 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 deleted file mode 100644 index 359525a31a..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1c0.dat and /dev/null 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 deleted file mode 100644 index 9f257df932..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1d1.dat and /dev/null 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 deleted file mode 100644 index e43e52fb7f..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1e0.dat and /dev/null 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 deleted file mode 100644 index 7e6ee3b1e0..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c1f1.dat and /dev/null 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 deleted file mode 100644 index 2b9a6b96d4..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c20.dat and /dev/null 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 deleted file mode 100644 index cae919d022..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c200.dat and /dev/null 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 deleted file mode 100644 index c7e311b00e..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c211.dat and /dev/null 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 deleted file mode 100644 index 28e89367ce..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c221.dat and /dev/null 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 deleted file mode 100644 index c8aca2ee6f..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c230.dat and /dev/null 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 deleted file mode 100644 index 3478bc897d..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c241.dat and /dev/null 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 deleted file mode 100644 index d3d6adf4fb..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c251.dat and /dev/null 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 deleted file mode 100644 index 8d7333df7d..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c260.dat and /dev/null 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 deleted file mode 100644 index af722f7d73..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c271.dat and /dev/null 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 deleted file mode 100644 index 3972983c2e..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c281.dat and /dev/null 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 deleted file mode 100644 index 31577b8124..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c290.dat and /dev/null 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 deleted file mode 100644 index 0f700d13a7..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2a1.dat and /dev/null 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 deleted file mode 100644 index 1d6382fb3d..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2b1.dat and /dev/null 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 deleted file mode 100644 index 3bc60d886b..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2c1.dat and /dev/null 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 deleted file mode 100644 index c542d3c91c..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2d0.dat and /dev/null 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 deleted file mode 100644 index 16abd20b5f..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2e1.dat and /dev/null 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 deleted file mode 100644 index eb26be5932..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c2f0.dat and /dev/null 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 deleted file mode 100644 index 35a164db8a..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c300.dat and /dev/null 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 deleted file mode 100644 index 44f7fa784d..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c31.dat and /dev/null 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 deleted file mode 100644 index 85c095cadb..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c311.dat and /dev/null 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 deleted file mode 100644 index 519f1a49be..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c41.dat and /dev/null 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 deleted file mode 100644 index 452a28db9b..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c51.dat and /dev/null 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 deleted file mode 100644 index 94c357868f..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c60.dat and /dev/null 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 deleted file mode 100644 index 9ca2ca97d1..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c71.dat and /dev/null 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 deleted file mode 100644 index 85bc9c8351..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c81.dat and /dev/null 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 deleted file mode 100644 index 14e77ef636..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/c90.dat and /dev/null 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 deleted file mode 100644 index 624ae61a85..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/ca1.dat and /dev/null 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 deleted file mode 100644 index 97e6f19260..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cb1.dat and /dev/null 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 deleted file mode 100644 index 5126021a83..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cc0.dat and /dev/null 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 deleted file mode 100644 index 2e135b64ab..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cd1.dat and /dev/null 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 deleted file mode 100644 index 076423c10a..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/ce1.dat and /dev/null 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 deleted file mode 100644 index bfae1c8b85..0000000000 Binary files a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/seg0/cf0.dat and /dev/null 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 deleted file mode 100644 index 997a33e4db..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/src/main/resources/dastest/service.properties +++ /dev/null @@ -1,22 +0,0 @@ -#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 deleted file mode 100644 index aacf864f14..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/src/main/resources/html/binding-atom.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 deleted file mode 100644 index 7f4a092f71..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/src/main/resources/html/binding-jsonrpc.js +++ /dev/null @@ -1,494 +0,0 @@ -/* - * 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 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 deleted file mode 100644 index 0783c3facb..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/src/main/resources/html/index-plain.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Google Maps JavaScript API Example - - - - -
- - \ 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 deleted file mode 100644 index 53f637bed2..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/src/main/resources/html/index.html +++ /dev/null @@ -1,55 +0,0 @@ - - - -Customer Mashup - - - - - - - - - - -

MyCompany.com

-
-

Customer List

- -
None yet.
-
-
- - - 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 deleted file mode 100644 index a884141a3c..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/src/main/resources/html/map.json +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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 deleted file mode 100644 index 7d289fd62a..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/src/test/java/customer/CustomerServiceTestCase.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index 0d1992d597..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/src/test/resources/customer.componentType +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - \ 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 deleted file mode 100644 index 72a692e38b..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/src/test/resources/customer.composite +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - 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 deleted file mode 100644 index 7b17903540..0000000000 --- a/sandbox/lresende/sca/demos/customer-map/src/test/resources/customer.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - -
-
diff --git a/sandbox/lresende/sca/modules/implementation-data-pojo/DISCLAIMER b/sandbox/lresende/sca/modules/implementation-data-pojo/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 8aa906c321..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - 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 deleted file mode 100644 index 94481d6cfa..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${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 deleted file mode 100644 index ff6ee6a8f4..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/README +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100644 index 4911f9e62f..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/company.sql +++ /dev/null @@ -1,28 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT 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 deleted file mode 100644 index 7e56a256a2..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/pom.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 1.5-SNAPSHOT - ../pom.xml - - tuscany-implementation-data-pojo - Apache Tuscany SCA OpenJPA Implementation Extension - - - - apache.incubator - http://people.apache.org/repo/m2-incubating-repository - - - - - - org.apache.tuscany.sca - tuscany-assembly - 1.5-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-core - 1.5-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-interface - 1.5-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-assembly-xml - 1.5-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-contribution-impl - 1.5-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-sca-api - 1.5-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-databinding - 1.5-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.5-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-data-api - 1.5-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-host-embedded - 1.5-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-policy-transaction - 1.5-SNAPSHOT - - - org.apache.geronimo.specs - geronimo-jpa_3.0_spec - 1.1 - - - org.apache.openjpa - openjpa - 1.0.0 - - - junit - junit - 3.8.1 - test - - - org.apache.derby - derby - 10.3.1.4 - compile - - - - - ${artifactId} - - - - org.codehaus.mojo - sql-maven-plugin - 1.3 - - - - org.apache.derby - derby - - 10.3.1.4 - - - - - - create-db - generate-resources - - execute - - - org.apache.derby.jdbc.EmbeddedDriver - jdbc:derby:${pom.basedir}/target/test-classes/company;create=true - true - continue - skip - ; - - ${pom.basedir}/company.sql - - - - - - - shutdown-database-sothat-test-can-run - process-test-resources - - execute - - - org.apache.derby.jdbc.EmbeddedDriver - jdbc:derby:${pom.basedir}/target/test-classes/company;shutdown=true - true - - - - - - - - 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 deleted file mode 100644 index c1ed6b4e58..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementation.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index a5812b26e4..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementationFactory.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index 8ea83e7bfb..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/JPAImplementationProcessor.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 { - 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 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 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 deleted file mode 100644 index d6e8276f25..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/PersistenceUnitInfoImplProcessor.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 { - 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 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 deleted file mode 100644 index c4b14a1a90..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyBrokerFactory.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index f5972142de..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyBrokerImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index 78de14cc1c..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyJDBCConfigurationImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index 2fb35f83a1..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyManagerRuntime.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index 441ba666d7..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/TuscanyStoreManager.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index 2a7d1abd70..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/impl/JPAImplementationFactoryImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index 055ecd4a4d..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/impl/JPAImplementationImpl.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 getProperties() { - // TODO Auto-generated method stub - return Collections.emptyList(); - } - - public List getReferences() { - return Collections.emptyList(); - } - - public List 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 deleted file mode 100644 index 5a863a8ae7..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAImplementationProvider.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index e1e821113c..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAImplementationProviderFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 { - private ExtensionPointRegistry extensionPointRegistry; - - public JPAImplementationProviderFactory(ExtensionPointRegistry extensionPoints) { - extensionPointRegistry = extensionPoints; - } - - public ImplementationProvider createImplementationProvider(RuntimeComponent component, - JPAImplementation implementation) { - return new JPAImplementationProvider(component, implementation, extensionPointRegistry); - } - - public Class 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 deleted file mode 100644 index 8b74209d3e..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/provider/JPAInvoker.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index 8c82832e01..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT 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 deleted file mode 100644 index 13067543c9..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.openjpa.OpenJpaImplementationFactory +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT 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 deleted file mode 100644 index fb62ff853b..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT 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 deleted file mode 100644 index 3ea6e65c0d..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/company/Company.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index b74f53aa8b..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/company/CompanyCollection.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 { - -} 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 deleted file mode 100644 index 385defeb0b..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/company/CompanyCollectionImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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[] 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[] 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 deleted file mode 100644 index bc9fbb3543..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/org/apache/tuscany/sca/implementation/openjpa/CompanyCollectionTestCase.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index 1c4d6fb254..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/java/org/apache/tuscany/sca/implementation/openjpa/CompanyTestCase.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index 75e329964f..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/resources/META-INF/orm.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - \ 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 deleted file mode 100644 index 302fbfe845..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/resources/META-INF/persistence.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - company.Company - - - - - - - - - - - - \ 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 deleted file mode 100755 index fd164d2519..0000000000 --- a/sandbox/lresende/sca/modules/implementation-data-pojo/src/test/resources/company.composite +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - org.apache.tuscany.sca.implementation.openjpa.TuscanyBrokerFactory - managed - DefaultLevel=WARN,SQL=TRACE - buildSchema - - company.Company - - - - - - - - - diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/README b/sandbox/lresende/sca/samples/calculator-jsf-webapp/README deleted file mode 100644 index 9f041f4ecb..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/README +++ /dev/null @@ -1,118 +0,0 @@ -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 deleted file mode 100644 index 11b30c48d2..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/build.xml +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/calculator-web.png b/sandbox/lresende/sca/samples/calculator-jsf-webapp/calculator-web.png deleted file mode 100644 index 896ddc4093..0000000000 Binary files a/sandbox/lresende/sca/samples/calculator-jsf-webapp/calculator-web.png and /dev/null 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 deleted file mode 100644 index 00ed27556f..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/calculator-web.svg +++ /dev/null @@ -1,358 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - Calculator - - CalculatorServiceComponent - - - CalculatorService - AddServiceComponent - - SubtractServiceComponent - - MultiplyServiceComponent - - DivideServiceComponent - addService - subtractService - multiplyService - divideService - - - - - - WebApp - - diff --git a/sandbox/lresende/sca/samples/calculator-jsf-webapp/pom.xml b/sandbox/lresende/sca/samples/calculator-jsf-webapp/pom.xml deleted file mode 100644 index 0354a8265a..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/pom.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.7-SNAPSHOT - - sample-calculator-jsf-webapp - war - Apache Tuscany SCA Calculator Sample using JSF in a WebApp - - - - org.apache.myfaces.core - myfaces-impl - 1.1.5 - - - - org.apache.myfaces.core - myfaces-api - 1.1.5 - - - - org.apache.tuscany.sca - tuscany-host-webapp - 1.7-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.7-SNAPSHOT - runtime - - - - - javax.servlet - servlet-api - 2.3 - provided - - - - junit - junit - 4.2 - test - - - - - - ${artifactId} - - 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 deleted file mode 100644 index f8ca02f8db..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/beans/Calculator.java +++ /dev/null @@ -1,78 +0,0 @@ -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 deleted file mode 100644 index a235e648c7..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/AddService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index 8b6fe066a6..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/AddServiceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index ac76137fcb..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorClient.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index 031fa8b912..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index ba897fa301..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index 497dafd4fd..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/DivideService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index f7ac0b7287..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index 5290605938..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index b7dca792b2..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index 376b3e5bb9..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/SubtractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index 77b128ab8d..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/java/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index ac9d010b48..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/resources/Calculator.composite +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 deleted file mode 100644 index ae1986c588..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/resources/wsdl/add.wsdl +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 deleted file mode 100644 index 3ce1f21836..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - \ 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 deleted file mode 100644 index 4670164d90..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/WEB-INF/faces-config.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - calculator - beans.Calculator - session - - - 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 deleted file mode 100644 index 329e0a5bad..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - Apache Tuscany Calculator Web Service Sample - - - tuscany - org.apache.tuscany.sca.host.webapp.TuscanyServletFilter - - - - tuscany - /* - - - - org.apache.myfaces.webapp.StartupServletContextListener - - - - Faces Servlet - javax.faces.webapp.FacesServlet - 1 - - - Faces Servlet - /faces/* - - - Faces Servlet - *.faces - - - - calc.jsp - - - 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 deleted file mode 100644 index 4c4366747d..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/calc.jsp +++ /dev/null @@ -1,50 +0,0 @@ -<%-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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"); -%> - -Calculator sample - - -
- - - - - - - - - - - - - - - -
ExpressionResult
2 + 3<%= calculatorService.add(2, 3) %>
3 - 2<%= calculatorService.subtract(3, 2) %>
3 * 2<%= calculatorService.multiply(3, 2) %>
3 / 2<%= calculatorService.divide(3, 2) %>
- - 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 deleted file mode 100644 index 37985724d0..0000000000 --- a/sandbox/lresende/sca/samples/calculator-jsf-webapp/src/main/webapp/calc_jsf.jsp +++ /dev/null @@ -1,27 +0,0 @@ -<%@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"%> - - - - -Insert title here - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sandbox/lresende/sca/samples/expertise-atom/pom.xml b/sandbox/lresende/sca/samples/expertise-atom/pom.xml deleted file mode 100644 index 54840dca7e..0000000000 --- a/sandbox/lresende/sca/samples/expertise-atom/pom.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.7-SNAPSHOT - - sample-expertise-atom - Apache Tuscany SCA ATOM Expertise Locator - - - - org.apache.tuscany.sca - tuscany-sca-api - 1.7-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-data-api - 1.7-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-host-embedded - 1.7-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.7-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-implementation-widget-runtime-tuscany - 1.7-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-atom-abdera - 1.7-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-atom-js - 1.7-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-http-runtime - 1.7-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-host-tomcat - 1.7-SNAPSHOT - runtime - - - - - ${artifactId} - - - diff --git a/sandbox/lresende/sca/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/Expert.java b/sandbox/lresende/sca/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/Expert.java deleted file mode 100644 index 5bc3325a18..0000000000 --- a/sandbox/lresende/sca/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/Expert.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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.expertise; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.expertise.Expert; - -public class Expert implements Serializable { - private static final long serialVersionUID = 2026687637313310397L; - - private String id; - private String name; - private String location; - private List expertises = new ArrayList(); - - public Expert() { - - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getLocation() { - return location; - } - - public void setLocation(String location) { - this.location = location; - } - - public List getExpertise() { - return this.expertises; - } - -} diff --git a/sandbox/lresende/sca/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/atom/AtomExpertiseLocator.java b/sandbox/lresende/sca/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/atom/AtomExpertiseLocator.java deleted file mode 100644 index a2fde8f938..0000000000 --- a/sandbox/lresende/sca/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/atom/AtomExpertiseLocator.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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.expertise.atom; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.expertise.Expert; -import org.apache.tuscany.sca.data.collection.Entry; -import org.apache.tuscany.sca.data.collection.NotFoundException; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -@Scope("COMPOSITE") -public class AtomExpertiseLocator implements ExpertiseLocator { - - private Map experts = new HashMap(); - - @Init - public void init() { - Expert expert; - - expert = new Expert(); - expert.setId("1"); - expert.setName("John Smith"); - expert.setLocation("CA"); - expert.getExpertise().add("SOA"); - expert.getExpertise().add("SCA"); - expert.getExpertise().add("WAS"); - - experts.put(expert.getId(), expert); - - expert = new Expert(); - expert.setId("2"); - expert.setName("Ken Johnson"); - expert.setLocation("NY"); - expert.getExpertise().add("Search"); - - experts.put(expert.getId(), expert); - - expert = new Expert(); - expert.setId("3"); - expert.setName("Mark Smith"); - expert.setLocation("CA"); - expert.getExpertise().add("SCA"); - expert.getExpertise().add("WASCE"); - - experts.put(expert.getId(), expert); - } - - - public Entry[] getAll() { - Entry[] entries = new Entry[experts.size()]; - int i = 0; - for (Map.Entry e: experts.entrySet()) { - entries[i++] = new Entry(e.getKey(), e.getValue()); - } - return entries; - - } - - public Expert get(String key) throws NotFoundException { - Expert item = experts.get(key); - if (item == null) { - throw new NotFoundException(key); - } else { - return item; - } - } - - public String post(String key, Expert item) { - if (key == null) { - int size = experts.entrySet().size() + 1; - key = Integer.toString(size); - item.setId(key); - } - experts.put(key, item); - return key; - } - - public void put(String key, Expert item) throws NotFoundException { - if (!experts.containsKey(key)) { - throw new NotFoundException(key); - } - experts.put(key, item); - } - - public void delete(String key) throws NotFoundException { - if (key == null || key.equals("")) { - experts.clear(); - } else { - Expert expert = experts.remove(key); - if (expert == null) - throw new NotFoundException(key); - } - } - - public Entry[] query(String queryString) { - List> entries = new ArrayList>(); - if (queryString.startsWith("location=")) { - String location = queryString.substring(9); - for (Map.Entry e: experts.entrySet()) { - Expert expert = e.getValue(); - if (expert.getLocation().equals(location)) { - entries.add(new Entry(e.getKey(), e.getValue())); - } - } - } - return entries.toArray(new Entry[entries.size()]); - } -} diff --git a/sandbox/lresende/sca/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/atom/ExpertiseLocator.java b/sandbox/lresende/sca/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/atom/ExpertiseLocator.java deleted file mode 100644 index 84683528cc..0000000000 --- a/sandbox/lresende/sca/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/atom/ExpertiseLocator.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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.expertise.atom; - -import org.apache.tuscany.expertise.Expert; -import org.apache.tuscany.sca.data.collection.Collection; -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface ExpertiseLocator extends Collection { - -} diff --git a/sandbox/lresende/sca/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/launch/Launch.java b/sandbox/lresende/sca/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/launch/Launch.java deleted file mode 100644 index eb82100092..0000000000 --- a/sandbox/lresende/sca/samples/expertise-atom/src/main/java/org/apache/tuscany/expertise/launch/Launch.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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.expertise.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("atom.composite"); - System.out.println("atom.composite ready for big business !!!"); - System.in.read(); - System.out.println("Stopping ..."); - scaDomain.close(); - System.out.println(); - } -} diff --git a/sandbox/lresende/sca/samples/expertise-atom/src/main/resources/META-INF/sca-contribution.xml b/sandbox/lresende/sca/samples/expertise-atom/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index c1e9be425c..0000000000 --- a/sandbox/lresende/sca/samples/expertise-atom/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/sandbox/lresende/sca/samples/expertise-atom/src/main/resources/atom.composite b/sandbox/lresende/sca/samples/expertise-atom/src/main/resources/atom.composite deleted file mode 100644 index 75d04f1fe4..0000000000 --- a/sandbox/lresende/sca/samples/expertise-atom/src/main/resources/atom.composite +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sandbox/lresende/sca/samples/expertise-atom/src/main/resources/atom.composite_diagram b/sandbox/lresende/sca/samples/expertise-atom/src/main/resources/atom.composite_diagram deleted file mode 100644 index 50c1ccf578..0000000000 --- a/sandbox/lresende/sca/samples/expertise-atom/src/main/resources/atom.composite_diagram +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/lresende/sca/samples/expertise-atom/src/main/resources/expertLocator.html b/sandbox/lresende/sca/samples/expertise-atom/src/main/resources/expertLocator.html deleted file mode 100644 index 22579cb0ce..0000000000 --- a/sandbox/lresende/sca/samples/expertise-atom/src/main/resources/expertLocator.html +++ /dev/null @@ -1,110 +0,0 @@ - - - -Expert Locator - - - - - - - - -

Expertise Locator

-
-

Add new Expert

-
- Name
-
- Location
-
- Expertise
- separate multiple values with commas (,)
-
- -
-
- -
-

Experts

-
-
-
-
-
- - - diff --git a/sandbox/lresende/sca/samples/expertise-restfull/pom.xml b/sandbox/lresende/sca/samples/expertise-restfull/pom.xml deleted file mode 100644 index 8d5459be84..0000000000 --- a/sandbox/lresende/sca/samples/expertise-restfull/pom.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.7-SNAPSHOT - - sample-expertise-restfull - Apache Tuscany SCA RESTFull Expertise Locator - - - - org.apache.tuscany.sca - tuscany-sca-api - 1.7-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-data-api - 1.7-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-host-embedded - 1.7-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.7-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-http-runtime - 1.7-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-host-tomcat - 1.7-SNAPSHOT - runtime - - - - javax.servlet - servlet-api - 2.5 - provided - - - - - ${artifactId} - - - diff --git a/sandbox/lresende/sca/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/Expert.java b/sandbox/lresende/sca/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/Expert.java deleted file mode 100644 index 61ac1c12b7..0000000000 --- a/sandbox/lresende/sca/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/Expert.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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.expertise; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -public class Expert implements Serializable { - private static final long serialVersionUID = 2026687637313310397L; - - private String id; - private String name; - private String location; - private List expertises = new ArrayList(); - - public Expert() { - - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getLocation() { - return location; - } - - public void setLocation(String location) { - this.location = location; - } - - public List getExpertise() { - return this.expertises; - } -} diff --git a/sandbox/lresende/sca/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/launch/Launch.java b/sandbox/lresende/sca/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/launch/Launch.java deleted file mode 100644 index 306abd5465..0000000000 --- a/sandbox/lresende/sca/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/launch/Launch.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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.expertise.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("rest.composite"); - System.out.println("rest.composite ready for big business !!!"); - System.in.read(); - System.out.println("Stopping ..."); - scaDomain.close(); - System.out.println(); - } -} diff --git a/sandbox/lresende/sca/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/ExpertRegistry.java b/sandbox/lresende/sca/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/ExpertRegistry.java deleted file mode 100644 index 1b90df36d2..0000000000 --- a/sandbox/lresende/sca/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/ExpertRegistry.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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.expertise.restfull; - -import java.util.List; - -import org.apache.tuscany.expertise.Expert; -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface ExpertRegistry { - - void addExpert(Expert expert); - - void removeExpert(Expert expert); - - List getExperts(); - - List getExpertsByExpertise(String expertise); -} \ No newline at end of file diff --git a/sandbox/lresende/sca/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/ExpertRegistryImpl.java b/sandbox/lresende/sca/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/ExpertRegistryImpl.java deleted file mode 100644 index bf7b2ea03e..0000000000 --- a/sandbox/lresende/sca/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/ExpertRegistryImpl.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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.expertise.restfull; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.expertise.Expert; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Service; - -@Service(ExpertRegistry.class) -public class ExpertRegistryImpl implements ExpertRegistry { - private List experts = new ArrayList(); - - public ExpertRegistryImpl() { - - } - - @Init - public void init() { - Expert expert; - - expert = new Expert(); - expert.setId("1"); - expert.setName("John Smith"); - expert.setLocation("CA"); - expert.getExpertise().add("SOA"); - expert.getExpertise().add("SCA"); - expert.getExpertise().add("WAS"); - - experts.add(expert); - - expert = new Expert(); - expert.setId("2"); - expert.setName("Ken Johnson"); - expert.setLocation("NY"); - expert.getExpertise().add("Search"); - - experts.add(expert); - - expert = new Expert(); - expert.setId("3"); - expert.setName("Mark Smith"); - expert.setLocation("CA"); - expert.getExpertise().add("SCA"); - expert.getExpertise().add("WASCE"); - - experts.add(expert); - } - - public void addExpert(Expert expert) { - experts.add(expert); - } - - public void removeExpert(Expert expert) { - experts.remove(expert); - } - - public List getExperts() { - return experts; - } - - public List getExpertsByExpertise(String expertise) { - List expertsByExpertise = new ArrayList(); - - for (Expert expert : experts) { - if (expert.getExpertise().contains(expertise)) { - expertsByExpertise.add(expert); - } - } - - return expertsByExpertise; - } -} diff --git a/sandbox/lresende/sca/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/RestfulExpertiseLocator.java b/sandbox/lresende/sca/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/RestfulExpertiseLocator.java deleted file mode 100644 index ea3915ccb5..0000000000 --- a/sandbox/lresende/sca/samples/expertise-restfull/src/main/java/org/apache/tuscany/expertise/restfull/RestfulExpertiseLocator.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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.expertise.restfull; - -import java.io.IOException; -import java.net.URLDecoder; -import java.util.List; - -import javax.servlet.Servlet; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.tuscany.expertise.Expert; -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -@Service(Servlet.class) -@Scope("COMPOSITE") -public class RestfulExpertiseLocator extends HttpServlet implements Servlet { - - private static final long serialVersionUID = 4021701701436888369L; - - @Reference - protected ExpertRegistry experts; - - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - String path = URLDecoder.decode(getRequestPath(request), "UTF-8"); - String expertise = path.substring(1); - - if (expertise != null && expertise.length() > 0 ) { - printExperts(response.getOutputStream(), experts.getExpertsByExpertise(expertise)); - } else { - printExperts(response.getOutputStream(), experts.getExperts()); - } - - } - - - private void printExperts(ServletOutputStream out, List experts) throws IOException { - out.print(""); - out.print("

Expertise Locator

"); - - if (experts.size() > 0) { - for (Expert expert: experts) { - out.print("Location: " + expert.getLocation() + " - " + expert.getName() +" ==> "); - for (String expertise : expert.getExpertise()) { - out.print(expertise + ";"); - } - out.print("
"); - } - } else { - out.println("No experts found"); - } - out.print(""); - } - - /** - * - * @param request - * @return - */ - private static String getRequestPath(HttpServletRequest request) { - // Get the request path - String contextPath = request.getContextPath(); - String servletPath = request.getServletPath(); - String requestURI = request.getRequestURI(); - - int contextPathLength = request.getContextPath().length(); - int servletPathLenght = servletPath.contains(contextPath) ? servletPath.length() - contextPath.length() : servletPath.length(); - - String requestPath = requestURI.substring(contextPathLength + servletPathLenght); - - return requestPath; - } - - -} diff --git a/sandbox/lresende/sca/samples/expertise-restfull/src/main/resources/META-INF/sca-contribution.xml b/sandbox/lresende/sca/samples/expertise-restfull/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index 96d2cc3c66..0000000000 --- a/sandbox/lresende/sca/samples/expertise-restfull/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/sandbox/lresende/sca/samples/expertise-restfull/src/main/resources/rest.composite b/sandbox/lresende/sca/samples/expertise-restfull/src/main/resources/rest.composite deleted file mode 100644 index 50f19a7c79..0000000000 --- a/sandbox/lresende/sca/samples/expertise-restfull/src/main/resources/rest.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sandbox/lresende/sca/samples/expertise-restfull/src/main/resources/rest.composite_diagram b/sandbox/lresende/sca/samples/expertise-restfull/src/main/resources/rest.composite_diagram deleted file mode 100644 index 05dae0d547..0000000000 --- a/sandbox/lresende/sca/samples/expertise-restfull/src/main/resources/rest.composite_diagram +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/lresende/sca/samples/pom.xml b/sandbox/lresende/sca/samples/pom.xml deleted file mode 100644 index e481abc47a..0000000000 --- a/sandbox/lresende/sca/samples/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.7-SNAPSHOT - - tuscany-samples-lresende - pom - Apache Tuscany Samples (lresende sandbox) - - - - default - - true - - - expertise-atom - expertise-restfull - store-secure-webapp - - - - - - diff --git a/sandbox/lresende/sca/samples/store-distributed/README b/sandbox/lresende/sca/samples/store-distributed/README deleted file mode 100644 index d4797618ff..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/README +++ /dev/null @@ -1,28 +0,0 @@ -Store Sample -====================================== - -This is a sample store scenario that is used as a getting started guide -for Tuscany SCA. For detailed information, please see: - -http://incubator.apache.org/tuscany/getting-started-with-tuscany.html - -or - -http://incubator.apache.org/tuscany/getting-started-with-tuscany-using-tuscany-eclipse-plugin.html - - -Building And Running The Sample Using Ant ------------------------------------------ -With the binary distribution the sample can be built using Ant as follows: - -cd store -ant compile - -and then, to run: - -ant run - -Once the store application is running use your browser to visit the following -URL: - -http://localhost:8080/store/ diff --git a/sandbox/lresende/sca/samples/store-distributed/build.xml b/sandbox/lresende/sca/samples/store-distributed/build.xml deleted file mode 100644 index 652afc3570..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/build.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/lresende/sca/samples/store-distributed/cloud.composite b/sandbox/lresende/sca/samples/store-distributed/cloud.composite deleted file mode 100644 index 7bd13d5b6f..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/cloud.composite +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - diff --git a/sandbox/lresende/sca/samples/store-distributed/domain.composite b/sandbox/lresende/sca/samples/store-distributed/domain.composite deleted file mode 100644 index 6898c454af..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/domain.composite +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - diff --git a/sandbox/lresende/sca/samples/store-distributed/pom.xml b/sandbox/lresende/sca/samples/store-distributed/pom.xml deleted file mode 100644 index bb24b6cedd..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/pom.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.7-SNAPSHOT - - sample-store-distributed - Apache Tuscany SCA Getting Started Online Store Sample - - - - org.apache.tuscany.sca - tuscany-node2-api - 1.7-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-node2-launcher - 1.7-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-domain-manager - 1.7-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-data-api - 1.7-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.7-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-implementation-widget-runtime - 1.7-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-atom-abdera - 1.7-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-jsonrpc-runtime - 1.7-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-http-runtime - 1.7-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-host-tomcat - 1.7-SNAPSHOT - runtime - - - - junit - junit - 4.2 - test - - - - - ${artifactId} - - - diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/java/node/LaunchDomain.java b/sandbox/lresende/sca/samples/store-distributed/src/main/java/node/LaunchDomain.java deleted file mode 100644 index dd19f6b49b..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/java/node/LaunchDomain.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package node; - -import org.apache.tuscany.sca.node.launcher.DomainManagerLauncher; - -/** - * This server program that loads a composite to provide simple registry function. - * This server can be replaced with any registry that is appropriate but the components - * in each node that talk to the registry should be replaced also. - */ -public class LaunchDomain { - public static void main(String[] args) throws Exception { - DomainManagerLauncher.main(args); - } - -} diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/java/node/LaunchStoreNodeA.java b/sandbox/lresende/sca/samples/store-distributed/src/main/java/node/LaunchStoreNodeA.java deleted file mode 100644 index 9016e515fb..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/java/node/LaunchStoreNodeA.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package node; - -import org.apache.tuscany.sca.node.launcher.NodeLauncher; - -public class LaunchStoreNodeA { - public static void main(String[] args) throws Exception { - NodeLauncher.main(new String[] {"http://localhost:9990/node-config/NodeA"}); - } -} diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/java/node/LaunchStoreNodeB.java b/sandbox/lresende/sca/samples/store-distributed/src/main/java/node/LaunchStoreNodeB.java deleted file mode 100644 index 2b387aec82..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/java/node/LaunchStoreNodeB.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package node; - -import org.apache.tuscany.sca.node.launcher.NodeLauncher; - -public class LaunchStoreNodeB { - public static void main(String[] args) throws Exception { - NodeLauncher.main(new String[] {"http://localhost:9990/node-config/NodeB"}); - } -} diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/java/node/LaunchStoreNodeC.java b/sandbox/lresende/sca/samples/store-distributed/src/main/java/node/LaunchStoreNodeC.java deleted file mode 100644 index fb138e484f..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/java/node/LaunchStoreNodeC.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package node; - -import org.apache.tuscany.sca.node.launcher.NodeLauncher; - -public class LaunchStoreNodeC { - public static void main(String[] args) throws Exception { - NodeLauncher.main(new String[] {"http://localhost:9990/node-config/NodeC"}); - } -} diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/Cart.java b/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/Cart.java deleted file mode 100644 index 9e6226d963..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/Cart.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import org.apache.tuscany.sca.data.collection.Collection; -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface Cart extends Collection { - -} diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/Catalog.java b/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/Catalog.java deleted file mode 100644 index 2c3b19f579..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/Catalog.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface Catalog { - Item[] get(); -} diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/CurrencyConverter.java b/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/CurrencyConverter.java deleted file mode 100644 index e104a0423a..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/CurrencyConverter.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface CurrencyConverter { - public double getConversion(String fromCurrenycCode, String toCurrencyCode, double amount); - - public String getCurrencySymbol(String currencyCode); -} diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/CurrencyConverterImpl.java b/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/CurrencyConverterImpl.java deleted file mode 100644 index c354aed447..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/CurrencyConverterImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -public class CurrencyConverterImpl implements CurrencyConverter { - public double getConversion(String fromCurrencyCode, String toCurrencyCode, double amount) { - if (toCurrencyCode.equals("USD")) - return amount; - else if (toCurrencyCode.equals("EUR")) - return ((double)Math.round(amount * 0.7256 * 100)) /100; - return 0; - } - - public String getCurrencySymbol(String currencyCode) { - if (currencyCode.equals("USD")) - return "$"; - else if (currencyCode.equals("EUR")) - return "E"; //"€"; - return "?"; - } -} diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/FruitsCatalogImpl.java b/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/FruitsCatalogImpl.java deleted file mode 100644 index 377b3d7e59..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/FruitsCatalogImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import java.util.ArrayList; -import java.util.List; - -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Reference; - -public class FruitsCatalogImpl implements Catalog { - - @Property - public String currencyCode = "USD"; - - @Reference - public CurrencyConverter currencyConverter; - - private List catalog = new ArrayList(); - - @Init - public void init() { - String currencySymbol = currencyConverter.getCurrencySymbol(currencyCode); - catalog.add(new Item("Apple", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 2.99))); - catalog.add(new Item("Orange", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 3.55))); - catalog.add(new Item("Pear", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 1.55))); - } - - public Item[] get() { - Item[] catalogArray = new Item[catalog.size()]; - catalog.toArray(catalogArray); - return catalogArray; - } -} diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/Item.java b/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/Item.java deleted file mode 100644 index 27abd4f016..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/Item.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - - -public class Item { - private String name; - private String price; - - public Item() { - } - - public Item(String name, String price) { - this.name = name; - this.price = price; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - -} diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/ShoppingCartImpl.java b/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/ShoppingCartImpl.java deleted file mode 100644 index 9889921a96..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/ShoppingCartImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import org.apache.tuscany.sca.data.collection.Entry; -import org.apache.tuscany.sca.data.collection.NotFoundException; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -@Scope("COMPOSITE") -public class ShoppingCartImpl implements Cart, Total { - - private Map cart; - - @Init - public void init() { - cart = new HashMap(); - } - - public Entry[] getAll() { - Entry[] entries = new Entry[cart.size()]; - int i = 0; - for (Map.Entry e: cart.entrySet()) { - entries[i++] = new Entry(e.getKey(), e.getValue()); - } - return entries; - } - - public Item get(String key) throws NotFoundException { - Item item = cart.get(key); - if (item == null) { - throw new NotFoundException(key); - } else { - return item; - } - } - - public String post(String key, Item item) { - if (key == null) { - key ="cart-" + UUID.randomUUID().toString(); - } - cart.put(key, item); - return key; - } - - public void put(String key, Item item) throws NotFoundException { - if (!cart.containsKey(key)) { - throw new NotFoundException(key); - } - cart.put(key, item); - } - - public void delete(String key) throws NotFoundException { - if (key == null || key.equals("")) { - cart.clear(); - } else { - Item item = cart.remove(key); - if (item == null) - throw new NotFoundException(key); - } - } - - public Entry[] query(String queryString) { - List> entries = new ArrayList>(); - if (queryString.startsWith("name=")) { - String name = queryString.substring(5); - for (Map.Entry e: cart.entrySet()) { - Item item = e.getValue(); - if (item.getName().equals(name)) { - entries.add(new Entry(e.getKey(), e.getValue())); - } - } - } - return entries.toArray(new Entry[entries.size()]); - } - - public String getTotal() { - double total = 0; - String currencySymbol = ""; - if (!cart.isEmpty()) { - Item item = cart.values().iterator().next(); - currencySymbol = item.getPrice().substring(0, 1); - } - for (Item item : cart.values()) { - total += Double.valueOf(item.getPrice().substring(1)); - } - return currencySymbol + String.valueOf(total); - } -} diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/Total.java b/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/Total.java deleted file mode 100644 index 8f464e526f..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/java/services/Total.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface Total { - - String getTotal(); - -} diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/cloud/NodeA.composite b/sandbox/lresende/sca/samples/store-distributed/src/main/resources/cloud/NodeA.composite deleted file mode 100644 index f7bfd0fcb6..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/cloud/NodeA.composite +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/cloud/NodeB.composite b/sandbox/lresende/sca/samples/store-distributed/src/main/resources/cloud/NodeB.composite deleted file mode 100644 index 187c5caf1c..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/cloud/NodeB.composite +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/cloud/NodeC.composite b/sandbox/lresende/sca/samples/store-distributed/src/main/resources/cloud/NodeC.composite deleted file mode 100644 index 96c2e02acb..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/cloud/NodeC.composite +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeA/META-INF/sca-contribution.xml b/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeA/META-INF/sca-contribution.xml deleted file mode 100644 index f165ee0e29..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeA/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeA/content/store.js b/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeA/content/store.js deleted file mode 100644 index 7df50eef64..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeA/content/store.js +++ /dev/null @@ -1,510 +0,0 @@ -/* Apache Tuscany SCA Widget header */ - -/* - * 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 */ - -alert('loading sotre.js from nodeA'); - -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 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"); -}; - -//--------------------- - - -var propertyMapA = new Object(); -var referenceMapA = new Object(); - -alert("referenceMapA : " + referenceMapA); -referenceMapA.catalog = new JSONRpcClient("http://luck.ibm.com:8100/Catalog").Service; - -alert('finished loading store.js from nodeA'); - -/** End of Apache Tuscany SCA Widget */ - diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeA/store.composite b/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeA/store.composite deleted file mode 100644 index 99d1fb5dd7..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeA/store.composite +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - USD - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeB/META-INF/sca-contribution.xml b/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeB/META-INF/sca-contribution.xml deleted file mode 100644 index 0f8e76ccd7..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeB/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeB/content/store.js b/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeB/content/store.js deleted file mode 100644 index c95a3b2f95..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeB/content/store.js +++ /dev/null @@ -1,647 +0,0 @@ -/* Apache Tuscany SCA Widget header */ - -/* - * 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 */ - -alert('loading sotre.js from nodeB'); - -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 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"); -}; - - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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.msxmlNames = [ "MSXML2.XMLHTTP.5.0", - "MSXML2.XMLHTTP.4.0", - "MSXML2.XMLHTTP.3.0", - "MSXML2.XMLHTTP", - "Microsoft.XMLHTTP" ]; - - this.uri=uri; - - this.get = function(id, responseFunction) { - var xhr = this.createXMLHttpRequest(); - xhr.onreadystatechange = function() { - if (xhr.readyState == 4) { - if (xhr.status == 200) { - var strDocument = xhr.responseText; - var xmlDocument = xhr.responseXML; - if(!xmlDocument || xmlDocument.childNodes.length==0){ - xmlDocument = (new DOMParser()).parseFromString(strDocument, "text/xml"); - } - if (responseFunction != null) responseFunction(xmlDocument); - } 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) { - var strDocument = xhr.responseText; - var xmlDocument = xhr.responseXML; - if(!xmlDocument || xmlDocument.childNodes.length==0){ - xmlDocument = (new DOMParser()).parseFromString(strDocument, "text/xml"); - } - if (responseFunction != null) responseFunction(xmlDocument); - } 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) { - var strDocument = xhr.responseText; - var xmlDocument = xhr.responseXML; - if(!xmlDocument || xmlDocument.childNodes.length==0){ - xmlDocument = (new DOMParser()).parseFromString(strDocument, "text/xml"); - } - if (responseFunction != null) responseFunction(xmlDocument); - } 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.del = 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 () { - /* Mozilla XMLHttpRequest */ - try {return new XMLHttpRequest();} catch(e) {} - - /* Microsoft MSXML ActiveX */ - for (var i=0;i < this.msxmlNames.length; i++) { - try {return new ActiveXObject(this.msxmlNames[i]);} catch (e) {} - } - alert("XML http request not supported"); - return null; - } - if (typeof DOMParser == "undefined") { - DOMParser = function () {} - - DOMParser.prototype.parseFromString = function (str, contentType) { - if (typeof ActiveXObject != "undefined") { - var d = new ActiveXObject("MSXML.DomDocument"); - d.loadXML(str); - return d; - } else if (typeof XMLHttpRequest != "undefined") { - var req = new XMLHttpRequest; - req.open("GET", "data:" + (contentType || "application/xml") + - ";charset=utf-8," + encodeURIComponent(str), false); - if (req.overrideMimeType) { - req.overrideMimeType(contentType); - } - req.send(null); - return req.responseXML; - } - } - } -} - - -alert(window.top); -alert(window.parent); -alert(window.top.document.referenceMap); -window.top.document.referenceMap.shoppingCart = new AtomClient("http://localhost:8200/ShoppingCart/Cart"); -window.top.document.referenceMap.shoppingTotal = new JSONRpcClient("http://localhost:8200/ShoppingCart/Total").Service; - -alert('finished loading store.js from nodeB'); - -/** End of Apache Tuscany SCA Widget */ - diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeB/store.composite b/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeB/store.composite deleted file mode 100644 index b66b937546..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeB/store.composite +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeC/META-INF/sca-contribution.xml b/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeC/META-INF/sca-contribution.xml deleted file mode 100644 index 15bab17c1a..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeC/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeC/content/index.js b/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeC/content/index.js deleted file mode 100644 index d42dc5512d..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeC/content/index.js +++ /dev/null @@ -1,66 +0,0 @@ -/*-----------------------------------------------------------------------------+ -| Product: index.js - Ajile's default auto-loader for shared dependencies. -|+-----------------------------------------------------------------------------+ -| Author: Michael A. I. Lee [ http://ajile.iskitz.com/ ] -| -| Created: Friday, November 2, 2006 [2006.06.02 - 19:44:40 EDT] -| Modified: Saturday December 16, 2006 [2006.12.16 - 13:00:00 EST] -|+-----------------------------------------------------------------------------+ -| -| README: -| -| If you need a way to import/load a common set of scripts for every page on -| your site or in your web application, this is the file you should use. -| -| This index.js file can be used to define scripting dependencies for a page, -| site, or application in a single place for use in many places. -| -| As of Ajile 0.6.5, Ajile automatically loads the index.js file found in its -| directory. To disable this behavior, use the "mvcshareoff" load-time option -| in the src parameter of the script tag used to load Ajile. -| -| Placing your top-level Namespace, Import, and Load directives in this file -| allows Ajile to automatically load, import, and initialize all required -| modules at startup for every page that uses Ajile. -| -| By using this file as described, all scripting logic can be controlled from -| a single point separate from the page, site or application's display logic. -| -| When used within web pages (e.g. HTML, XHTML, HTA, JSP, ASP, PHP, CGI, etc.) -| only 1 SCRIPT tag is required. That SCRIPT tag must identify the location of -| the Ajile module. For example: -| -| -| -| Visit http://ajile.iskitz.com/ to start creating "Smart scripts that play nice!" -|+----------------------------------------------------------------------------*/ - -// You may copy this file into your own projects and use it to define your -// shared dependencies. This file must reside in the same location as the Ajile -// module. The logic below demonstrates how this file can be used to define an -// auto-loader. You'll most-likely use index.js to auto-load common or shared -// functionality. - -/* - - // Example options setting... - Ajile.EnableCloak(false); - Ajile.EnableDebug(); - Ajile.EnableOverride(false); - - // Define your namespace. - Namespace ("your.namespace"); - - // Import a versioned namespace. - Import ("some.namespace.*.0.6", "some/path/"); - - // Import a module's public members. - Import ("some.other.Module.*"); - - // Define a new module. - your.namespace.NewModule = new function() - { - // Your implementation here... - }; - -//*/ \ No newline at end of file diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeC/content/store.html b/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeC/content/store.html deleted file mode 100644 index 0e3ab370b3..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeC/content/store.html +++ /dev/null @@ -1,114 +0,0 @@ - - - -Store - - - - - - - -

Store

- - - -
-

Catalog

-
-
-
- -
- -
- -

Your Shopping Cart

-
-
-
-
-
- - - (feed) -
-
- - - - - - - - diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeC/content/store.js b/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeC/content/store.js deleted file mode 100644 index 088a80a1d1..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/nodeC/content/store.js +++ /dev/null @@ -1,39 +0,0 @@ - -function dhtmlLoadScript(url) { - var script = document.createElement('script'); - script.type = 'text/javascript'; - script.src = url; - document.getElementsByTagName('head')[0].appendChild(script); -} - -function dhtmlLoadScriptIFrame(iframeId, url) { - var iframe = document.createElement("IFRAME"); - iframe.style.display="none"; - iframe.name = iframeId; - iframe.id = iframeId; - iframe.src = url; - document.body.appendChild(iframe); - - //var iframeDocument = window.frames[iframeId].document; - //iframeDocument.write(' - - - - - - -

Store

-
-

Catalog

-
-
-
- -
- -
- -

Your Shopping Cart

-
-
-
-
-
- - - (feed) -
-
- - diff --git a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/uiservices/store.html b/sandbox/lresende/sca/samples/store-distributed/src/main/resources/uiservices/store.html deleted file mode 100644 index 45604463d1..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/src/main/resources/uiservices/store.html +++ /dev/null @@ -1,162 +0,0 @@ - - - -Store - - - - - - - - -

Store

-
-

Catalog

-
-
-
- -
- -
- -

Your Shopping Cart

-
-
-
-
-
- - - (feed) -
-
- - diff --git a/sandbox/lresende/sca/samples/store-distributed/store.png b/sandbox/lresende/sca/samples/store-distributed/store.png deleted file mode 100644 index da413edeee..0000000000 Binary files a/sandbox/lresende/sca/samples/store-distributed/store.png and /dev/null differ diff --git a/sandbox/lresende/sca/samples/store-distributed/store.svg b/sandbox/lresende/sca/samples/store-distributed/store.svg deleted file mode 100644 index 74f8ecd36d..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/store.svg +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - store - ufs - - ShoppingCart - - CurrencyConverter - - - - - - - - - - CurrenyCode HTTP JSONRPC Atom - - Catalog - - - - diff --git a/sandbox/lresende/sca/samples/store-distributed/workspace.xml b/sandbox/lresende/sca/samples/store-distributed/workspace.xml deleted file mode 100644 index d6cb2bfc81..0000000000 --- a/sandbox/lresende/sca/samples/store-distributed/workspace.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/sandbox/lresende/sca/samples/store-jsf/README b/sandbox/lresende/sca/samples/store-jsf/README deleted file mode 100644 index 79ddb03568..0000000000 --- a/sandbox/lresende/sca/samples/store-jsf/README +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index fe68a0e4b5..0000000000 --- a/sandbox/lresende/sca/samples/store-jsf/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.7-SNAPSHOT - - sample-store-jsf - war - Apache Tuscany SCA Getting Started Online Store Sample using JSF - - - - - org.apache.myfaces.core - myfaces-impl - 1.1.5 - - - - org.apache.myfaces.core - myfaces-api - 1.1.5 - - - - - - junit - junit - 4.2 - test - - - - - - ${artifactId} - - - 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 deleted file mode 100644 index 01e4a0d481..0000000000 --- a/sandbox/lresende/sca/samples/store-jsf/src/main/java/beans/Catalog.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index 9f3df2f95c..0000000000 --- a/sandbox/lresende/sca/samples/store-jsf/src/main/java/beans/Product.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 deleted file mode 100644 index 1dd376a58f..0000000000 --- a/sandbox/lresende/sca/samples/store-jsf/src/main/webapp/WEB-INF/faces-config.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - catalog - beans.Catalog - session - - - 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 deleted file mode 100644 index 347b0d2066..0000000000 Binary files a/sandbox/lresende/sca/samples/store-jsf/src/main/webapp/WEB-INF/lib/ajax4jsf-1.1.1.jar and /dev/null 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 deleted file mode 100644 index a39a51eefc..0000000000 --- a/sandbox/lresende/sca/samples/store-jsf/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - SkeletonProject - - ajax4jsf - Ajax4jsf Filter - org.ajax4jsf.Filter - - - ajax4jsf - Faces Servlet - - - Faces Servlet - javax.faces.webapp.FacesServlet - 1 - - - Faces Servlet - /faces/* - - - Faces Servlet - *.faces - - - - catalog.jsp - - 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 deleted file mode 100644 index d456bedcc0..0000000000 --- a/sandbox/lresende/sca/samples/store-jsf/src/main/webapp/catalog.jsp +++ /dev/null @@ -1,82 +0,0 @@ -<%-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT 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"%> - - - - -Basic JSF/Ajax sample - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/sandbox/lresende/sca/samples/store-secure-webapp/build-dojo.xml b/sandbox/lresende/sca/samples/store-secure-webapp/build-dojo.xml deleted file mode 100644 index 6167eba10e..0000000000 --- a/sandbox/lresende/sca/samples/store-secure-webapp/build-dojo.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/lresende/sca/samples/store-secure-webapp/build.xml b/sandbox/lresende/sca/samples/store-secure-webapp/build.xml deleted file mode 100644 index fce9338312..0000000000 --- a/sandbox/lresende/sca/samples/store-secure-webapp/build.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/lresende/sca/samples/store-secure-webapp/pom.xml b/sandbox/lresende/sca/samples/store-secure-webapp/pom.xml deleted file mode 100644 index b95dda30fd..0000000000 --- a/sandbox/lresende/sca/samples/store-secure-webapp/pom.xml +++ /dev/null @@ -1,144 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.7-SNAPSHOT - - sample-store-secure-webapp - war - Apache Tuscany SCA Sample Store in a WebApp - - - - org.apache.tuscany.sca - tuscany-host-webapp - 1.7-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.7-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-jsonrpc-runtime - 1.7-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-policy-security - 1.7-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-policy-security-http - 1.7-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-policy-security-geronimo - 1.7-SNAPSHOT - - - - - stax - stax-api - 1.0.1 - provided - - - - - javax.servlet - servlet-api - 2.3 - provided - - - - junit - junit - 4.5 - test - - - - - - ${artifactId} - - - org.apache.maven.plugins - maven-antrun-plugin - - - - ant - ant-trax - 1.6.5 - - - - - copy-dojo-files - generate-resources - - run - - - - - - - - - - - - clean-dojo-files - clean - - run - - - - - - - - - - - - - - - diff --git a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/services/Catalog.java b/sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/services/Catalog.java deleted file mode 100644 index 0d8d3d561a..0000000000 --- a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/services/Catalog.java +++ /dev/null @@ -1,8 +0,0 @@ -package services; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface Catalog { - Item[] get(); -} diff --git a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/services/CurrencyConverter.java b/sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/services/CurrencyConverter.java deleted file mode 100644 index 15b2c6e3a6..0000000000 --- a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/services/CurrencyConverter.java +++ /dev/null @@ -1,12 +0,0 @@ -package services; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface CurrencyConverter { - public double getConversion(String fromCurrenycCode, - String toCurrencyCode, - double amount); - - public String getCurrencySymbol(String currencyCode); -} diff --git a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/services/CurrencyConverterImpl.java b/sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/services/CurrencyConverterImpl.java deleted file mode 100644 index 2bf9d8d42b..0000000000 --- a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/services/CurrencyConverterImpl.java +++ /dev/null @@ -1,21 +0,0 @@ -package services; - -public class CurrencyConverterImpl implements CurrencyConverter { - public double getConversion(String fromCurrencyCode, - String toCurrencyCode, - double amount) { - if (toCurrencyCode.equals("USD")) - return amount; - else if (toCurrencyCode.equals("EUR")) - return ((double)Math.round(amount * 0.7256 * 100)) /100; - return 0; - } - - public String getCurrencySymbol(String currencyCode) { - if (currencyCode.equals("USD")) - return "$"; - else if (currencyCode.equals("EUR")) - return "E"; //"€"; - return "?"; - } -} diff --git a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/services/FruitsCatalogImpl.java b/sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/services/FruitsCatalogImpl.java deleted file mode 100644 index 4cac4ac21d..0000000000 --- a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/services/FruitsCatalogImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -package services; - -import java.util.ArrayList; -import java.util.List; - -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Reference; - -public class FruitsCatalogImpl implements Catalog { - @Property - public String currencyCode = "USD"; - @Reference - public CurrencyConverter currencyConverter; - - private List catalog = new ArrayList(); - - @Init - public void init() { - String currencySymbol = currencyConverter - .getCurrencySymbol(currencyCode); - catalog.add(new Item("Apple", currencySymbol - + currencyConverter.getConversion("USD", currencyCode, 2.99))); - catalog.add(new Item("Orange", currencySymbol - + currencyConverter.getConversion("USD", currencyCode, 3.55))); - catalog.add(new Item("Pear", currencySymbol - + currencyConverter.getConversion("USD", currencyCode, 1.55))); - } - - public Item[] get() { - Item[] catalogArray = new Item[catalog.size()]; - catalog.toArray(catalogArray); - return catalogArray; - } -} diff --git a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/services/Item.java b/sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/services/Item.java deleted file mode 100644 index e8bcfabfb1..0000000000 --- a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/services/Item.java +++ /dev/null @@ -1,30 +0,0 @@ -package services; - -public class Item { - private String name; - private String price; - - public Item() { - } - - public Item(String name, String price) { - this.name = name; - this.price = price; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } -} diff --git a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/store/security/StoreCallbackHandler.java b/sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/store/security/StoreCallbackHandler.java deleted file mode 100644 index 88e3a778a0..0000000000 --- a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/java/store/security/StoreCallbackHandler.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package store.security; - -import java.io.IOException; - -import javax.security.auth.callback.Callback; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.callback.NameCallback; -import javax.security.auth.callback.PasswordCallback; -import javax.security.auth.callback.UnsupportedCallbackException; - -/** - * @version $Rev$ $Date$ - */ -public class StoreCallbackHandler implements CallbackHandler { - - public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { - for (int i = 0; i < callbacks.length; i++) { - if (callbacks[i] instanceof NameCallback) { - NameCallback nc = (NameCallback)callbacks[i]; - nc.setName("PWEST"); - } else if (callbacks[i] instanceof PasswordCallback) { - PasswordCallback pc = (PasswordCallback)callbacks[i]; - pc.setPassword("xxx".toCharArray()); - } else { - throw new UnsupportedCallbackException - (callbacks[i], "Unsupported Callback!"); - } - } - } - -} diff --git a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/resources/definitions.xml b/sandbox/lresende/sca/samples/store-secure-webapp/src/main/resources/definitions.xml deleted file mode 100644 index 55789c8443..0000000000 --- a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/resources/definitions.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - ldap-realm - ldap-realm - - - - - - - - - - - - \ No newline at end of file diff --git a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/resources/store.composite b/sandbox/lresende/sca/samples/store-secure-webapp/src/main/resources/store.composite deleted file mode 100644 index 5c567cbd15..0000000000 --- a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/resources/store.composite +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - USD - - - - - - - - - - - diff --git a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/META-INF/sca-contribution.xml b/sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/META-INF/sca-contribution.xml deleted file mode 100644 index 41c84c9a44..0000000000 --- a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/WEB-INF/geronimo-web.xml b/sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/WEB-INF/geronimo-web.xml deleted file mode 100644 index 705010bf7c..0000000000 --- a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/WEB-INF/geronimo-web.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - org.apache.tuscany - sample-store-secure-webapp - 1.0 - car - - - - org.apache.axiom - org.apache.axis2 - org.apache.commons - org.jdom - - - - /sample-store-secure-webapp - - ldap-realm - - - - - - - - - - - ldap-realm - - - - ldap-realm - org.apache.geronimo.security.realm.providers.LDAPLoginModule - - com.sun.jndi.ldap.LdapCtxFactory - ldap://dpev007.innovate.ibm.com:389 - cn=ldaproot,dc=tnc,dc=org - ldappass - simple - ou=people,dc=tnc,dc=org - uid={0} - false - ou=groups,dc=tnc,dc=org - cn - (member={0}) - false - - - - - diff --git a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/WEB-INF/web.xml b/sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 704c7631b0..0000000000 --- a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - sample-store-secure-webapp - - - tuscany - org.apache.tuscany.sca.host.webapp.TuscanyServletFilter - - - - tuscany - /* - - - - store.html - - - - - - FORM - ldap-realm - - /auth/logon.html - /auth/logonError.html - - - - - Application managers - manager - - - - Application users - user - - - - - Areas with authentication required - /protected/* - GET - POST - - - manager - - - - - org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled - java.lang.String - false - - \ No newline at end of file diff --git a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/auth/logon.html b/sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/auth/logon.html deleted file mode 100644 index 09191f7010..0000000000 --- a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/auth/logon.html +++ /dev/null @@ -1,20 +0,0 @@ - -

Store Authentication

-
- - - - - - - - - - - - -
Username:
Password:
- -
-
- \ No newline at end of file diff --git a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/auth/logonError.html b/sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/auth/logonError.html deleted file mode 100644 index c0c0f7b75d..0000000000 --- a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/auth/logonError.html +++ /dev/null @@ -1,5 +0,0 @@ - -

Store Authentication ERROR

-Username, password or role incorrect. -                                                         - \ No newline at end of file diff --git a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/store.html b/sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/store.html deleted file mode 100644 index e4cd0ba12d..0000000000 --- a/sandbox/lresende/sca/samples/store-secure-webapp/src/main/webapp/store.html +++ /dev/null @@ -1,48 +0,0 @@ - - -Store - - - - - - - - - - -

Store

-
-

Catalog

-
-
-
-
- -
-
- - -- cgit v1.2.3