From 36436b71b9977d6b5940cb6285d5335708ef9bfa Mon Sep 17 00:00:00 2001 From: lresende Date: Sat, 21 Nov 2009 07:55:20 +0000 Subject: Moving 1.x tags git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@882851 13f79535-47bb-0310-9956-ffa450edef68 --- tags/java-stable-20060304/BUILDING.txt | 41 - tags/java-stable-20060304/LICENSE.txt | 202 - tags/java-stable-20060304/das/pom.xml | 34 - tags/java-stable-20060304/das/rdb/LICENSE.txt | 202 - tags/java-stable-20060304/das/rdb/pom.xml | 80 - .../tuscany/das/rdb/ApplyChangesCommand.java | 186 - .../java/org/apache/tuscany/das/rdb/Command.java | 283 - .../org/apache/tuscany/das/rdb/CommandFactory.java | 67 - .../org/apache/tuscany/das/rdb/CommandGroup.java | 56 - .../tuscany/das/rdb/CommandGroupFactory.java | 37 - .../java/org/apache/tuscany/das/rdb/Converter.java | 52 - .../main/java/org/apache/tuscany/das/rdb/Key.java | 58 - .../java/org/apache/tuscany/das/rdb/Pager.java | 62 - .../java/org/apache/tuscany/das/rdb/Parameter.java | 128 - .../org/apache/tuscany/das/rdb/ResultSetShape.java | 122 - .../org/apache/tuscany/das/rdb/SDODataTypes.java | 68 - .../org/apache/tuscany/das/rdb/config/Column.java | 306 - .../org/apache/tuscany/das/rdb/config/Command.java | 156 - .../org/apache/tuscany/das/rdb/config/Config.java | 121 - .../tuscany/das/rdb/config/ConfigFactory.java | 108 - .../das/rdb/config/ConnectionProperties.java | 175 - .../org/apache/tuscany/das/rdb/config/KeyPair.java | 100 - .../apache/tuscany/das/rdb/config/Parameter.java | 100 - .../tuscany/das/rdb/config/Relationship.java | 193 - .../tuscany/das/rdb/config/ResultDescriptor.java | 150 - .../org/apache/tuscany/das/rdb/config/Table.java | 191 - .../tuscany/das/rdb/config/impl/ColumnImpl.java | 675 -- .../tuscany/das/rdb/config/impl/CommandImpl.java | 444 -- .../das/rdb/config/impl/ConfigFactoryImpl.java | 212 - .../tuscany/das/rdb/config/impl/ConfigImpl.java | 387 - .../das/rdb/config/impl/ConfigPackageImpl.java | 2808 ------- .../rdb/config/impl/ConnectionPropertiesImpl.java | 455 -- .../tuscany/das/rdb/config/impl/KeyPairImpl.java | 287 - .../tuscany/das/rdb/config/impl/ParameterImpl.java | 287 - .../das/rdb/config/impl/RelationshipImpl.java | 497 -- .../das/rdb/config/impl/ResultDescriptorImpl.java | 399 - .../tuscany/das/rdb/config/impl/TableImpl.java | 517 -- .../das/rdb/config/wrapper/MappingWrapper.java | 381 - .../das/rdb/config/wrapper/QualifiedColumn.java | 41 - .../rdb/config/wrapper/RelationshipWrapper.java | 44 - .../das/rdb/config/wrapper/TableWrapper.java | 124 - .../das/rdb/generator/impl/CudGenerator.java | 64 - .../das/rdb/generator/impl/DeleteGenerator.java | 98 - .../das/rdb/generator/impl/InsertGenerator.java | 164 - .../das/rdb/generator/impl/UpdateGenerator.java | 206 - .../das/rdb/graphbuilder/impl/DataObjectMaker.java | 120 - .../rdb/graphbuilder/impl/DefaultConverter.java | 91 - .../graphbuilder/impl/GraphBuilderMetadata.java | 98 - .../rdb/graphbuilder/impl/MultiTableRegistry.java | 105 - .../das/rdb/graphbuilder/impl/ResultMetadata.java | 277 - .../rdb/graphbuilder/impl/ResultSetProcessor.java | 137 - .../das/rdb/graphbuilder/impl/ResultSetRow.java | 169 - .../das/rdb/graphbuilder/impl/RowObjects.java | 140 - .../rdb/graphbuilder/impl/SingleTableRegistry.java | 52 - .../das/rdb/graphbuilder/impl/TableData.java | 75 - .../das/rdb/graphbuilder/impl/TableRegistry.java | 43 - .../rdb/graphbuilder/schema/EAttributeMaker.java | 67 - .../rdb/graphbuilder/schema/EReferenceMaker.java | 131 - .../das/rdb/graphbuilder/schema/ESchemaMaker.java | 261 - .../rdb/graphbuilder/schema/ResultSetTypeMap.java | 133 - .../das/rdb/impl/ApplyChangesCommandImpl.java | 176 - .../apache/tuscany/das/rdb/impl/ChangeFactory.java | 172 - .../tuscany/das/rdb/impl/ChangeOperation.java | 71 - .../tuscany/das/rdb/impl/ChangeSummarizer.java | 225 - .../org/apache/tuscany/das/rdb/impl/Changes.java | 81 - .../tuscany/das/rdb/impl/CommandFactoryImpl.java | 80 - .../das/rdb/impl/CommandGroupFactoryImpl.java | 15 - .../tuscany/das/rdb/impl/CommandGroupImpl.java | 195 - .../apache/tuscany/das/rdb/impl/CommandImpl.java | 177 - .../tuscany/das/rdb/impl/ConnectionImpl.java | 95 - .../tuscany/das/rdb/impl/CreateOperation.java | 29 - .../tuscany/das/rdb/impl/DatabaseObject.java | 130 - .../tuscany/das/rdb/impl/DeleteCommandImpl.java | 25 - .../apache/tuscany/das/rdb/impl/DeleteList.java | 72 - .../tuscany/das/rdb/impl/DeleteOperation.java | 38 - .../tuscany/das/rdb/impl/FactoryRegistry.java | 49 - .../tuscany/das/rdb/impl/InsertCommandImpl.java | 79 - .../apache/tuscany/das/rdb/impl/InsertList.java | 80 - .../das/rdb/impl/OptimisticWriteCommandImpl.java | 45 - .../org/apache/tuscany/das/rdb/impl/PagerImpl.java | 64 - .../apache/tuscany/das/rdb/impl/ParameterImpl.java | 107 - .../apache/tuscany/das/rdb/impl/Parameters.java | 150 - .../apache/tuscany/das/rdb/impl/QueryString.java | 87 - .../tuscany/das/rdb/impl/ReadCommandImpl.java | 204 - .../tuscany/das/rdb/impl/SDODataTypeHelper.java | 100 - .../apache/tuscany/das/rdb/impl/SPCommandImpl.java | 73 - .../org/apache/tuscany/das/rdb/impl/Statement.java | 206 - .../tuscany/das/rdb/impl/UpdateCommandImpl.java | 25 - .../apache/tuscany/das/rdb/impl/UpdateList.java | 42 - .../tuscany/das/rdb/impl/UpdateOperation.java | 30 - .../tuscany/das/rdb/impl/WriteCommandImpl.java | 97 - .../tuscany/das/rdb/merge/impl/GraphMerger.java | 166 - .../tuscany/das/rdb/util/DataObjectUtil.java | 73 - .../tuscany/das/rdb/util/DebugFormatter.java | 34 - .../org/apache/tuscany/das/rdb/util/DebugUtil.java | 66 - .../rdb/src/main/resources/META-INF/MANIFEST.MF | 8 - .../das/rdb/src/main/resources/config.xsd | 88 - .../das/rdb/src/main/resources/dasmodel4.mdl | 4645 ------------ .../tuscany/das/rdb/test/BestPracticeTests.java | 89 - .../apache/tuscany/das/rdb/test/CUDGeneration.java | 165 - .../tuscany/das/rdb/test/CommandGroupTests.java | 165 - .../apache/tuscany/das/rdb/test/CompanyTests.java | 107 - .../tuscany/das/rdb/test/CompoundKeyTests.java | 113 - .../tuscany/das/rdb/test/ConverterTests.java | 118 - .../tuscany/das/rdb/test/CorrectedDefectTests.java | 258 - .../das/rdb/test/CrudWithChangeHistory.java | 254 - .../apache/tuscany/das/rdb/test/DefectTests.java | 353 - .../tuscany/das/rdb/test/ExceptionTests.java | 75 - .../das/rdb/test/GeneratedCommandTests.java | 93 - .../apache/tuscany/das/rdb/test/GeneratedId.java | 305 - .../tuscany/das/rdb/test/GraphMergeTests.java | 163 - .../tuscany/das/rdb/test/NameMappingTests.java | 64 - .../org/apache/tuscany/das/rdb/test/OCCTests.java | 68 - .../das/rdb/test/OperationOrderingTests.java | 85 - .../org/apache/tuscany/das/rdb/test/Paging.java | 108 - .../tuscany/das/rdb/test/PartialUpdateTests.java | 108 - .../das/rdb/test/PassiveConnectionTests.java | 88 - .../tuscany/das/rdb/test/ReadDBSchemaTests.java | 62 - .../tuscany/das/rdb/test/RecursiveTests.java | 84 - .../tuscany/das/rdb/test/RelationshipTests.java | 195 - .../tuscany/das/rdb/test/ResultSetShapeTests.java | 108 - .../tuscany/das/rdb/test/SerializationTests.java | 90 - .../apache/tuscany/das/rdb/test/SimplestCrud.java | 256 - .../apache/tuscany/das/rdb/test/StoredProcs.java | 203 - .../org/apache/tuscany/das/rdb/test/TopDown.java | 139 - .../org/apache/tuscany/das/rdb/test/TypeTests.java | 65 - .../commands/ReadCustomersByLastnameCommand.java | 54 - .../rdb/test/commands/ReadCustomersCommand.java | 55 - .../commands/ReadCustomersStaticTypesCommand.java | 62 - .../commands/ReadCustomersWithShapeCommand.java | 40 - .../SimpleReadCustomersWithShapeCommand.java | 66 - .../das/rdb/test/company/CompanyFactory.java | 63 - .../tuscany/das/rdb/test/company/CompanyType.java | 91 - .../das/rdb/test/company/DatagraphRoot.java | 71 - .../das/rdb/test/company/DepartmentType.java | 143 - .../tuscany/das/rdb/test/company/EmployeeType.java | 127 - .../rdb/test/company/impl/CompanyFactoryImpl.java | 164 - .../rdb/test/company/impl/CompanyPackageImpl.java | 1248 ---- .../das/rdb/test/company/impl/CompanyTypeImpl.java | 293 - .../rdb/test/company/impl/DatagraphRootImpl.java | 242 - .../rdb/test/company/impl/DepartmentTypeImpl.java | 385 - .../rdb/test/company/impl/EmployeeTypeImpl.java | 323 - .../tuscany/das/rdb/test/customer/AnOrder.java | 206 - .../tuscany/das/rdb/test/customer/Customer.java | 143 - .../das/rdb/test/customer/CustomerFactory.java | 54 - .../das/rdb/test/customer/DataGraphRoot.java | 56 - .../das/rdb/test/customer/impl/AnOrderImpl.java | 451 -- .../test/customer/impl/CustomerFactoryImpl.java | 140 - .../das/rdb/test/customer/impl/CustomerImpl.java | 385 - .../test/customer/impl/CustomerPackageImpl.java | 837 --- .../rdb/test/customer/impl/DataGraphRootImpl.java | 203 - .../apache/tuscany/das/rdb/test/data/BookData.java | 45 - .../apache/tuscany/das/rdb/test/data/CityData.java | 54 - .../tuscany/das/rdb/test/data/CompanyData.java | 45 - .../tuscany/das/rdb/test/data/CompanyDeptData.java | 42 - .../tuscany/das/rdb/test/data/CustomerData.java | 45 - .../tuscany/das/rdb/test/data/DepEmpData.java | 45 - .../tuscany/das/rdb/test/data/DepartmentData.java | 41 - .../tuscany/das/rdb/test/data/EmployeeData.java | 44 - .../tuscany/das/rdb/test/data/OrderData.java | 42 - .../das/rdb/test/data/OrderDetailsData.java | 43 - .../apache/tuscany/das/rdb/test/data/PartData.java | 52 - .../tuscany/das/rdb/test/data/StateData.java | 51 - .../tuscany/das/rdb/test/data/TypesData.java | 64 - .../tuscany/das/rdb/test/framework/DB2Setup.java | 35 - .../tuscany/das/rdb/test/framework/DasTest.java | 155 - .../das/rdb/test/framework/DatabaseSetup.java | 245 - .../tuscany/das/rdb/test/framework/DerbySetup.java | 42 - .../das/rdb/test/framework/JavaStoredProcs.java | 85 - .../tuscany/das/rdb/test/framework/MySQLSetup.java | 96 - .../das/rdb/test/framework/RelationshipData.java | 81 - .../tuscany/das/rdb/test/framework/TestData.java | 87 - .../framework/TestDataWithExplicitColumns.java | 82 - .../test/mappings/IntegerToBooleanConverter.java | 40 - .../test/mappings/SillyDateStringConverter.java | 73 - .../test/mappings/StringToIntegerConverter.java | 37 - .../rdb/test/mappings/StringToLongConverter.java | 35 - .../das/rdb/test/suites/AllCommonTests.java | 93 - .../tuscany/das/rdb/test/suites/AllTestsDB2.java | 39 - .../tuscany/das/rdb/test/suites/AllTestsDerby.java | 34 - .../tuscany/das/rdb/test/suites/AllTestsMySQL.java | 34 - .../das/rdb/test/typed/SimplestStaticCrud.java | 58 - .../rdb/src/test/resources/1xM_mapping_no_cud.xml | 18 - .../das/rdb/src/test/resources/CompanyConfig.xml | 33 - .../test/resources/CustOrdersConnectionProps.xml | 46 - .../src/test/resources/CustomersOrdersConfig.xml | 30 - .../resources/basicCompanyDepartmentMapping.xml | 21 - .../rdb/src/test/resources/basicCompanyMapping.xml | 7 - .../src/test/resources/basicCustomerMapping.xml | 10 - .../test/resources/basicCustomerMappingWithCUD.xml | 13 - .../basicCustomerMappingWithInvalidCUD.xml | 13 - .../test/resources/basicCustomerOrderMapping.xml | 17 - .../rdb/src/test/resources/basicStaticCustomer.xml | 10 - .../das/rdb/src/test/resources/cityStates.xml | 22 - .../das/rdb/src/test/resources/company.ecore | 130 - .../das/rdb/src/test/resources/company.genmodel | 38 - .../das/rdb/src/test/resources/company.xsd | 38 - .../das/rdb/src/test/resources/companyMapping.xml | 23 - .../das/rdb/src/test/resources/customer.ecore | 96 - .../das/rdb/src/test/resources/customer.genmodel | 32 - .../das/rdb/src/test/resources/customer.xsd | 32 - .../das/rdb/src/test/resources/customerMapping.xml | 10 - .../resources/customerOrderRelationshipMapping.xml | 16 - tags/java-stable-20060304/pom.xml | 119 - .../samples/bigbank/account/pom.xml | 77 - .../services/account/AccountServiceImpl.java | 91 - .../services/accountdata/AccountDataService.java | 26 - .../accountdata/AccountDataServiceImpl.java | 51 - .../services/accountdata/CheckingAccount.java | 39 - .../services/accountdata/SavingsAccount.java | 39 - .../account/services/accountdata/StockAccount.java | 48 - .../services/stockquote/StockQuoteService.java | 27 - .../services/stockquote/StockQuoteServiceImpl.java | 28 - .../bigbank/account/src/main/resources/sca.module | 61 - .../account/src/main/resources/sca.subsystem | 24 - .../src/main/resources/wsdl/AccountService.wsdl | 90 - .../main/resources/wsdl/StockQuoteWebService.wsdl | 98 - .../account/src/main/webapp/WEB-INF/axis2.xml | 167 - .../account/src/main/webapp/WEB-INF/web.xml | 21 - .../bigbank/account/client/AccountClient.java | 56 - .../samples/bigbank/customers/META-INF/MANIFEST.MF | 7 - .../samples/bigbank/customers/pom.xml | 44 - .../samples/bigbank/customers/readme.htm | 190 - .../tuscany/samples/customers/CustomerClient.java | 41 - .../customers/CustomerServiceComponent.java | 29 - .../CustomerServiceComponentImpl.componentType | 21 - .../customers/CustomerServiceComponentImpl.java | 76 - .../bigbank/customers/src/main/java/sca.module | 23 - .../bigbank/customers/src/main/webapp/Customer.jsp | 94 - .../customers/src/main/webapp/WEB-INF/web.xml | 38 - .../src/main/webapp/customerdb/log/log.ctrl | Bin 48 -> 0 bytes .../src/main/webapp/customerdb/log/log1.dat | Bin 1048576 -> 0 bytes .../src/main/webapp/customerdb/log/logmirror.ctrl | Bin 48 -> 0 bytes .../src/main/webapp/customerdb/seg0/c10.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c101.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c111.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c121.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c130.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c141.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c150.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c161.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c171.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c180.dat | Bin 24576 -> 0 bytes .../src/main/webapp/customerdb/seg0/c191.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c1a1.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c1b1.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c1c0.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c1d1.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c1e0.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c1f1.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c20.dat | Bin 20480 -> 0 bytes .../src/main/webapp/customerdb/seg0/c200.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c211.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c221.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c230.dat | Bin 86016 -> 0 bytes .../src/main/webapp/customerdb/seg0/c241.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c251.dat | Bin 12288 -> 0 bytes .../src/main/webapp/customerdb/seg0/c260.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c271.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c281.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c290.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c2a1.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c2b1.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c2c1.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c2d0.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c2e1.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c2f0.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c300.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c31.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c311.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c41.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c51.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c60.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c71.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c81.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/c90.dat | Bin 16384 -> 0 bytes .../src/main/webapp/customerdb/seg0/ca1.dat | Bin 16384 -> 0 bytes .../src/main/webapp/customerdb/seg0/cb1.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/cc0.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/cd1.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/ce1.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/seg0/cf0.dat | Bin 8192 -> 0 bytes .../src/main/webapp/customerdb/service.properties | 22 - tags/java-stable-20060304/samples/bigbank/pom.xml | 35 - .../samples/bigbank/webclient/pom.xml | 89 - .../account/AccountServiceComponentImpl.java | 57 - .../webclient/services/profile/LoginService.java | 27 - .../webclient/services/profile/ProfileService.java | 36 - .../services/profile/ProfileServiceImpl.java | 68 - .../services/profile/SimpleLoginServiceImpl.java | 45 - .../webclient/tags/account/AccountStatusTag.java | 125 - .../webclient/tags/sca/LoginBarrierTag.java | 87 - .../bigbank/webclient/tags/sca/ServiceTag.java | 100 - .../samples/bigbank/webclient/ui/LoginServlet.java | 67 - .../webclient/src/main/resources/sca.module | 55 - .../webclient/src/main/resources/sca.subsystem | 28 - .../src/main/resources/wsdl/AccountService.wsdl | 90 - .../webclient/src/main/webapp/WEB-INF/axis2.xml | 167 - .../src/main/webapp/WEB-INF/bigbank-tags.tld | 79 - .../webclient/src/main/webapp/WEB-INF/web.xml | 35 - .../bigbank/webclient/src/main/webapp/login.html | 24 - .../bigbank/webclient/src/main/webapp/summary.jsp | 48 - .../webclient/client/TestAccountService.java | 51 - .../bigbank/webclient/client/TestLoginService.java | 49 - .../samples/das/companyweb/CompanyAppGbl.xml | 11 - .../samples/das/companyweb/dastest/db.lck | Bin 38 -> 0 bytes .../samples/das/companyweb/dastest/log/log.ctrl | Bin 48 -> 0 bytes .../samples/das/companyweb/dastest/log/log1.dat | Bin 1048576 -> 0 bytes .../das/companyweb/dastest/log/logmirror.ctrl | Bin 48 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c10.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c101.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c111.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c121.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c130.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c141.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c150.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c161.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c171.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c180.dat | Bin 24576 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c191.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c1a1.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c1b1.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c1c0.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c1d1.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c1e0.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c1f1.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c20.dat | Bin 24576 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c200.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c211.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c221.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c230.dat | Bin 86016 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c241.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c251.dat | Bin 12288 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c260.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c271.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c281.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c290.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c2a1.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c2b1.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c2c1.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c2d0.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c2e1.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c2f0.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c300.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c31.dat | Bin 16384 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c311.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c320.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c331.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c340.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c351.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c360.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c371.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c380.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c391.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c3a0.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c3b1.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c3c0.dat | Bin 24576 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c3d1.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c3e0.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c3f1.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c400.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c41.dat | Bin 16384 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c411.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c420.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c431.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c440.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c451.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c460.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c471.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c481.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c490.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c4a1.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c51.dat | Bin 16384 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c60.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c71.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c81.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/c90.dat | Bin 20480 -> 0 bytes .../samples/das/companyweb/dastest/seg0/ca1.dat | Bin 24576 -> 0 bytes .../samples/das/companyweb/dastest/seg0/cb1.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/cc0.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/cd1.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/ce1.dat | Bin 8192 -> 0 bytes .../samples/das/companyweb/dastest/seg0/cf0.dat | Bin 8192 -> 0 bytes .../das/companyweb/dastest/service.properties | 22 - .../samples/das/companyweb/pom.xml | 42 - .../samples/das/companyweb/readme.htm | 567 -- .../tuscany/samples/companyweb/CompanyClient.java | 133 - .../src/main/resources/CompanyConfig.xml | 33 - .../das/companyweb/src/main/webapp/Company.jsp | 151 - .../das/companyweb/src/main/webapp/WEB-INF/web.xml | 27 - tags/java-stable-20060304/samples/das/pom.xml | 33 - .../samples/helloworld/helloworld/pom.xml | 57 - .../samples/helloworld/helloworld/readme.htm | 112 - .../samples/helloworld/HelloWorldClient.java | 51 - .../samples/helloworld/HelloWorldService.java | 26 - .../helloworld/HelloWorldServiceComponentImpl.java | 34 - .../helloworld/src/main/resources/sca.module | 25 - .../HelloWorldServiceComponentTestCase.java | 79 - .../samples/helloworld/helloworldaxis/axiscmds.bat | 2 - .../helloworld/helloworldaxis/helloworld.wsdl | 97 - .../samples/helloworldaxis/HelloWorldService.java | 27 - .../helloworldaxis/HelloWorldServiceImpl.java | 35 - .../samples/helloworld/helloworldaxis/pom.xml | 50 - .../samples/helloworld/helloworldaxis/readme.htm | 118 - .../helloworldaxis/HelloWorldAxisClient.java | 53 - .../helloworldaxis/HelloWorldServiceImpl.java | 21 - .../HelloWorldServiceImplService.java | 25 - .../HelloWorldServiceImplServiceLocator.java | 148 - .../helloworldaxis/HelloworldSoapBindingImpl.java | 24 - .../HelloworldSoapBindingSkeleton.java | 69 - .../helloworldaxis/HelloworldSoapBindingStub.java | 133 - .../tuscany/samples/helloworldaxis/deploy.wsdd | 41 - .../tuscany/samples/helloworldaxis/undeploy.wsdd | 30 - .../samples/helloworld/helloworldaxis2/build.xml | 127 - .../samples/helloworld/helloworldaxis2/pom.xml | 205 - .../samples/helloworldaxis/GetGreetings.java | 94 - .../helloworldaxis/GetGreetingsResponse.java | 96 - .../HelloWorldServiceImplCallbackHandler.java | 39 - .../HelloWorldServiceImplMessageReceiver.java | 146 - .../HelloWorldServiceImplSkeleton.java | 24 - .../helloworldaxis/HelloWorldServiceImplStub.java | 269 - .../src/main/resources/helloworld.wsdl | 97 - .../src/main/resources/services.xml | 7 - .../src/test/java/META-INF/MANIFEST.MF | 3 - .../helloworldaxis/HelloWorldServiceImplTest.java | 63 - .../samples/helloworld/helloworldaxissvc/pom.xml | 38 - .../helloworld/helloworldaxissvc/readme.htm | 53 - .../src/main/webapp/WEB-INF/server-config.wsdd | 48 - .../src/main/webapp/WEB-INF/web.xml | 101 - .../src/webapp/WEB-INF/server-config.wsdd | 48 - .../helloworldaxissvc/src/webapp/WEB-INF/web.xml | 101 - .../samples/helloworld/helloworldjs/pom.xml | 58 - .../samples/helloworld/helloworldjs/readme.htm | 117 - .../samples/helloworldjs/HelloWorldClient.java | 51 - .../helloworldjs/HelloWorldServiceComponent.java | 26 - .../HelloWorldServiceComponentImpl.componentType | 9 - .../helloworldjs/HelloWorldServiceComponentImpl.js | 20 - .../helloworldjs/src/main/resources/sca.module | 26 - .../HelloWorldServiceComponentTestCase.java | 80 - .../samples/helloworld/helloworldmc/pom.xml | 57 - .../samples/helloworld/helloworldmc/readme.htm | 151 - .../helloworldmc/GreetingPortionProvider.java | 22 - .../helloworldmc/GreetingPortionProviderImpl.java | 32 - .../samples/helloworldmc/HelloWorldClient.java | 51 - .../samples/helloworldmc/HelloWorldService.java | 26 - .../HelloWorldServiceComponentImpl.java | 51 - .../helloworldmc/src/main/resources/sca.module | 45 - .../HelloWorldServiceComponentTestCase.java | 74 - .../samples/helloworld/helloworldweb/pom.xml | 51 - .../samples/helloworld/helloworldweb/readme.htm | 130 - .../helloworldweb/HelloWorldServiceComponent.java | 26 - .../HelloWorldServiceComponentImpl.java | 34 - .../helloworldweb/src/main/resources/sca.module | 25 - .../src/main/webapp/HelloWorldWeb.jsp | 79 - .../helloworldweb/src/main/webapp/WEB-INF/web.xml | 27 - .../HelloWorldServiceComponentTestCase.java | 84 - .../samples/helloworld/helloworldws/pom.xml | 87 - .../samples/helloworld/helloworldws/readme.htm | 186 - .../samples/helloworldws/HelloWorldService.java | 26 - .../HelloWorldServiceComponentImpl.java | 34 - .../helloworldws/src/main/resources/sca.module | 35 - .../src/main/resources/wsdl/helloworld.wsdl | 97 - .../helloworldws/src/main/webapp/WEB-INF/axis2.xml | 167 - .../helloworldws/src/main/webapp/WEB-INF/web.xml | 23 - .../samples/helloworld/helloworldwsclient/pom.xml | 50 - .../helloworld/helloworldwsclient/readme.htm | 189 - .../helloworldwsclient/HelloWorldClient.java | 51 - .../helloworldwsclient/HelloWorldService.java | 26 - .../HelloWorldServiceComponentImpl.java | 43 - .../src/main/resources/axis2.xml | 167 - .../src/main/resources/sca.module | 40 - .../src/main/resources/wsdl/helloworld.wsdl | 103 - .../samples/helloworld/pom.xml | 42 - tags/java-stable-20060304/samples/pom.xml | 35 - .../sca/binding.axis/LICENSE.txt | 202 - tags/java-stable-20060304/sca/binding.axis/pom.xml | 70 - .../axis/assembly/WebServiceAssemblyFactory.java | 31 - .../binding/axis/assembly/WebServiceBinding.java | 51 - .../impl/WebServiceAssemblyFactoryImpl.java | 42 - .../axis/assembly/impl/WebServiceBindingImpl.java | 116 - .../ExternalWebServiceConfigurationBuilder.java | 150 - .../builder/ExternalWebServiceWireBuilder.java | 61 - .../WebServiceEntryPointConfigurationBuilder.java | 170 - .../ExternalWebServiceRuntimeConfiguration.java | 32 - .../WebServiceEntryPointRuntimeConfiguration.java | 32 - .../config/AxisEngineConfigurationFactory.java | 265 - .../axis/handler/ExternalWebServiceClient.java | 119 - .../handler/ExternalWebServiceTargetInvoker.java | 109 - .../axis/handler/WebServiceEntryPointServlet.java | 82 - .../axis/handler/WebServiceOperationMetaData.java | 484 -- .../axis/handler/WebServicePortMetaData.java | 362 - .../axis/loader/WebServiceSCDLModelLoader.java | 74 - .../tuscany/binding/axis/Messages.properties | 28 - .../binding/axis/engine/config/server-config.wsdd | 60 - .../src/main/resources/system.fragment | 37 - .../tests/WebServiceAssemblyLoaderTestCase.java | 87 - .../account/services/account/AccountReport.java | 32 - .../account/services/account/AccountService.java | 25 - .../services/account/AccountServiceImpl.java | 42 - .../account/services/account/AccountSummary.java | 46 - .../services/accountdata/AccountDataService.java | 26 - .../accountdata/AccountDataServiceImpl.java | 48 - .../services/accountdata/CheckingAccount.java | 39 - .../services/accountdata/SavingsAccount.java | 39 - .../account/services/accountdata/StockAccount.java | 48 - .../services/stockquote/StockQuoteService.java | 24 - .../account/services/account/AccountService.wsdl | 78 - .../services/stockquote/StockQuoteWebService.wsdl | 98 - .../tuscany/binding/axis/assembly/tests/sca.module | 66 - .../binding/axis/mediator/tests/DocLit.wsdl | 76 - .../binding/axis/mediator/tests/DocLitWrapped.wsdl | 83 - .../binding/axis/mediator/tests/RpcLit.wsdl | 75 - .../tuscany/binding/axis/mediator/tests/sca.module | 20 - .../sca/binding.axis2/LICENSE.txt | 202 - .../java-stable-20060304/sca/binding.axis2/pom.xml | 130 - .../axis2/assembly/WebServiceAssemblyFactory.java | 31 - .../binding/axis2/assembly/WebServiceBinding.java | 51 - .../impl/WebServiceAssemblyFactoryImpl.java | 42 - .../axis2/assembly/impl/WebServiceBindingImpl.java | 116 - .../ExternalWebServiceConfigurationBuilder.java | 153 - .../builder/ExternalWebServiceWireBuilder.java | 61 - .../WebServiceEntryPointConfigurationBuilder.java | 170 - .../ExternalWebServiceRuntimeConfiguration.java | 32 - .../WebServiceEntryPointRuntimeConfiguration.java | 32 - .../axis2/handler/ExternalWebServiceClient.java | 143 - .../handler/ExternalWebServiceTargetInvoker.java | 110 - ...bServiceEntryPointInOutSyncMessageReceiver.java | 177 - .../axis2/handler/WebServiceEntryPointServlet.java | 480 -- .../axis2/handler/WebServiceOperationMetaData.java | 484 -- .../axis2/handler/WebServicePortMetaData.java | 362 - .../axis2/loader/WebServiceSCDLModelLoader.java | 74 - .../tuscany/binding/axis2/util/AxiomHelper.java | 185 - .../tuscany/binding/axis2/engine/config/axis2.xml | 167 - .../src/main/resources/system.fragment | 37 - .../tests/WebServiceAssemblyLoaderTestCase.java | 87 - .../account/services/account/AccountReport.java | 32 - .../account/services/account/AccountService.java | 25 - .../services/account/AccountServiceImpl.java | 42 - .../account/services/account/AccountSummary.java | 46 - .../services/accountdata/AccountDataService.java | 26 - .../accountdata/AccountDataServiceImpl.java | 48 - .../services/accountdata/CheckingAccount.java | 39 - .../services/accountdata/SavingsAccount.java | 39 - .../account/services/accountdata/StockAccount.java | 48 - .../services/stockquote/StockQuoteService.java | 24 - .../binding/axis2/util/AxiomHelperTestCase.java | 88 - .../account/services/account/AccountService.wsdl | 78 - .../services/stockquote/StockQuoteWebService.wsdl | 98 - .../binding/axis2/assembly/tests/sca.module | 66 - .../binding/axis2/mediator/tests/DocLit.wsdl | 76 - .../axis2/mediator/tests/DocLitWrapped.wsdl | 83 - .../binding/axis2/mediator/tests/RpcLit.wsdl | 75 - .../binding/axis2/mediator/tests/sca.module | 20 - .../tuscany/binding/axis2/util/helloworld.wsdl | 106 - tags/java-stable-20060304/sca/common/LICENSE.txt | 202 - tags/java-stable-20060304/sca/common/pom.xml | 37 - .../apache/tuscany/common/TuscanyException.java | 85 - .../tuscany/common/TuscanyRuntimeException.java | 91 - .../discovery/util/ServiceProviderRegistry.java | 177 - .../io/util/ClassLoaderObjectInputStream.java | 73 - .../common/io/util/FixedURLClassLoader.java | 310 - .../common/io/util/FixedURLInputStream.java | 119 - .../apache/tuscany/common/io/util/IOHelper.java | 128 - .../apache/tuscany/common/io/util/UTF8String.java | 107 - .../apache/tuscany/common/monitor/LogLevel.java | 37 - .../tuscany/common/monitor/MonitorFactory.java | 35 - .../common/monitor/impl/InvalidLevelException.java | 43 - .../monitor/impl/JavaLoggingMonitorFactory.java | 139 - .../common/monitor/impl/NullMonitorFactory.java | 48 - .../tuscany/common/resource/ResourceLoader.java | 94 - .../common/resource/impl/ResourceLoaderImpl.java | 175 - .../org.apache.tuscany.common.logging.LogProvider | 1 - ...y.common.resource.loader.ResourceLoaderProvider | 1 - .../org/apache/tuscany/common/Messages.properties | 25 - .../common/monitor/impl/JavaLoggingTestCase.java | 145 - .../impl/JavaLoggingTestCase$Monitor.properties | 1 - .../sca/container.java/LICENSE.txt | 202 - .../sca/container.java/pom.xml | 44 - .../java/assembly/JavaAssemblyFactory.java | 32 - .../java/assembly/JavaImplementation.java | 37 - .../assembly/impl/JavaAssemblyFactoryImpl.java | 42 - .../java/assembly/impl/JavaImplementationImpl.java | 97 - .../java/builder/JavaComponentContextBuilder.java | 348 - .../java/builder/JavaTargetWireBuilder.java | 85 - .../config/JavaComponentRuntimeConfiguration.java | 151 - .../java/context/JavaComponentContext.java | 206 - .../invocation/AbstractJavaComponentInvoker.java | 92 - .../invocation/ScopedJavaComponentInvoker.java | 86 - .../StaticJavaComponentTargetInvoker.java | 50 - .../container/java/loader/JavaSCDLModelLoader.java | 81 - .../tuscany/container/java/Messages.properties | 25 - .../src/main/resources/system.fragment | 38 - .../sca/container.java/src/main/test/sca.module | 75 - .../assembly/impl/JavaImplementationTestCase.java | 137 - .../assembly/mock/HelloWorldImpl.componentType | 23 - .../java/assembly/mock/HelloWorldImpl.java | 36 - .../java/assembly/mock/HelloWorldService.java | 27 - .../mock/HelloWorldWithFieldProperties.java | 40 - .../java/assembly/mock/NakedHelloWorld.java | 26 - .../mock/NakedHelloWorldWithInterface.java | 28 - .../assembly/tests/JavaAssemblyLoaderTestCase.java | 88 - .../account/services/account/AccountReport.java | 32 - .../account/services/account/AccountService.java | 25 - .../account/services/account/AccountService.wsdl | 78 - .../services/account/AccountServiceImpl.java | 42 - .../account/services/account/AccountSummary.java | 46 - .../services/accountdata/AccountDataService.java | 26 - .../accountdata/AccountDataServiceImpl.java | 48 - .../services/accountdata/CheckingAccount.java | 39 - .../services/accountdata/SavingsAccount.java | 39 - .../account/services/accountdata/StockAccount.java | 48 - .../services/stockquote/StockQuoteService.java | 24 - .../services/stockquote/StockQuoteServiceImpl.java | 28 - .../services/stockquote/StockQuoteWebService.wsdl | 98 - .../JavaComponentContextBuilderTestCase.java | 111 - .../builder/JavaTargetWireBuilderTestCase.java | 115 - .../container/java/builder/MockHandlerBuilder.java | 86 - .../java/builder/MockInterceptorBuilder.java | 74 - ...ModuleComponentConfigurationLoaderTestCase.java | 80 - .../container/java/context/BadPojoTestCase.java | 70 - .../java/context/PojoLifecycleTestCase.java | 71 - .../container/java/context/PojoTestCase.java | 94 - .../JavaBuilderContextIntegrationTestCase.java | 240 - .../java/integration/JavaIntegrationTestCase.java | 64 - .../integration/JavaRuntimeBootstrapTestCase.java | 54 - .../binding/EntryPointToJavaTestCase.java | 248 - .../binding/JavaToExternalServiceTestCase.java | 61 - .../context/ScopeReferenceTestCase.java | 709 -- .../java/invocation/MediationTestCase.java | 53 - .../java/invocation/ScopedPojoInvokerTestCase.java | 54 - .../java/invocation/StaticPojoInvokerTestCase.java | 155 - .../java/invocation/mock/MockHandler.java | 25 - .../java/invocation/mock/MockSyncInterceptor.java | 45 - .../java/invocation/mock/SimpleSource.java | 25 - .../java/invocation/mock/SimpleSourceImpl.java | 36 - .../java/invocation/mock/SimpleTarget.java | 28 - .../java/invocation/mock/SimpleTargetImpl.java | 39 - .../container/java/mock/MockConfigContext.java | 56 - .../tuscany/container/java/mock/MockFactory.java | 548 -- .../container/java/mock/MockScopeContext.java | 137 - .../java/mock/binding/foo/FooBinding.java | 59 - .../java/mock/binding/foo/FooBindingBuilder.java | 192 - .../mock/binding/foo/FooBindingWireBuilder.java | 56 - .../container/java/mock/binding/foo/FooClient.java | 37 - .../java/mock/binding/foo/FooESTargetInvoker.java | 97 - .../foo/FooEntryPointRuntimeConfiguration.java | 31 - .../FooExternalServiceRuntimeConfiguration.java | 32 - .../mock/components/AbstractGenericComponent.java | 296 - .../java/mock/components/BadContextPojo.java | 26 - .../java/mock/components/BadNamePojo.java | 24 - .../container/java/mock/components/DataObject.java | 38 - .../java/mock/components/GenericComponent.java | 142 - .../java/mock/components/HelloWorldClient.java | 46 - .../java/mock/components/LocalComponentImpl.java | 97 - .../java/mock/components/ModuleScopeComponent.java | 29 - .../ModuleScopeComponentImpl.componentType | 32 - .../mock/components/ModuleScopeComponentImpl.java | 47 - .../ModuleScopeDestroyOnlyComponent.java | 34 - .../components/ModuleScopeEagerInitComponent.java | 39 - .../ModuleScopeEagerInitDestroyComponent.java | 33 - .../ModuleScopeInitDestroyComponent.java | 34 - .../components/ModuleScopeInitOnlyComponent.java | 38 - .../java/mock/components/RemotableService.java | 40 - .../java/mock/components/RemotableServiceImpl.java | 61 - .../mock/components/RequestScopeComponent.java | 28 - .../mock/components/RequestScopeComponentImpl.java | 25 - .../mock/components/SessionScopeComponent.java | 28 - .../mock/components/SessionScopeComponentImpl.java | 25 - .../SessionScopeDestroyOnlyComponent.java | 34 - .../SessionScopeInitDestroyComponent.java | 34 - .../components/SessionScopeInitOnlyComponent.java | 35 - .../java/mock/components/StatelessComponent.java | 28 - .../mock/components/StatelessComponentImpl.java | 25 - .../java/scopes/AggregateScopeTestCase.java | 178 - .../java/scopes/BasicHttpSessionScopeTestCase.java | 223 - .../java/scopes/BasicModuleScopeTestCase.java | 126 - .../java/scopes/BasicRequestScopeTestCase.java | 148 - .../java/scopes/BasicStatelessScopeTestCase.java | 125 - .../scopes/HttpSessionScopeLifecycleTestCase.java | 157 - .../java/scopes/ModuleScopeLifecycleTestCase.java | 224 - .../container/java/scopes/OrderException.java | 38 - .../java/scopes/OrderedEagerInitPojo.java | 54 - .../container/java/scopes/OrderedInitPojo.java | 54 - .../java/scopes/RequestScopeLifecycleTestCase.java | 146 - .../container/java/assembly/tests/sca.module | 54 - .../java/config/ModuleComponentLoaderTest1.module | 24 - .../sca/container.js/LICENSE.txt | 202 - tags/java-stable-20060304/sca/container.js/pom.xml | 75 - .../js/assembly/JavaScriptAssemblyFactory.java | 28 - .../js/assembly/JavaScriptImplementation.java | 34 - .../impl/JavaScriptAssemblyFactoryImpl.java | 33 - .../impl/JavaScriptImplementationImpl.java | 116 - .../builder/JavaScriptComponentContextBuilder.java | 217 - .../js/builder/JavaScriptTargetWireBuilder.java | 75 - .../JavaScriptComponentRuntimeConfiguration.java | 101 - .../js/context/JavaScriptComponentContext.java | 161 - .../js/loader/JavaScriptSCDLModelLoader.java | 77 - .../tuscany/container/js/rhino/RhinoScript.java | 298 - .../container/js/rhino/RhinoTargetInvoker.java | 81 - .../main/resources/model/sca-implementation-js.xsd | 41 - ...riptComponentConfigurationHandler.componentType | 23 - .../src/main/resources/system.fragment | 33 - .../container/js/sample/helloworld/HelloWorld.java | 7 - .../sample/helloworld/HelloWorldImpl.componentType | 9 - .../js/sample/helloworld/HelloWorldImpl.js | 4 - .../container/js/sample/helloworld/Main.java | 25 - .../sca/container.js/src/samples/java/sca.module | 25 - .../impl/JavaScriptImplementationTestCase.java | 75 - .../js/assembly/mock/HelloWorldService.java | 24 - .../tests/JavaScriptAssemblyLoaderTestCase.java | 76 - .../account/services/account/AccountReport.java | 32 - .../account/services/account/AccountService.java | 25 - .../account/services/account/AccountSummary.java | 46 - .../services/accountdata/AccountDataService.java | 26 - .../accountdata/AccountDataServiceImpl.java | 48 - .../services/accountdata/CheckingAccount.java | 39 - .../services/accountdata/SavingsAccount.java | 39 - .../account/services/accountdata/StockAccount.java | 48 - .../services/stockquote/StockQuoteService.java | 24 - .../services/stockquote/StockQuoteServiceImpl.java | 28 - .../services/stockquote/StockQuoteWebService.wsdl | 98 - .../builder/JSComponentContextBuilderTestCase.java | 51 - .../container/js/builder/MockHandlerBuilder.java | 86 - .../js/builder/MockInterceptorBuilder.java | 74 - ...ModuleComponentConfigurationLoaderTestCase.java | 78 - .../js/integration/JSComponentContextTestCase.java | 91 - .../container/js/invocation/mock/MockHandler.java | 27 - .../js/invocation/mock/MockSyncInterceptor.java | 50 - .../container/js/mock/MockAssemblyFactory.java | 156 - .../container/js/mock/MockModuleFactory.java | 115 - .../container/js/rhino/RhinoInvokerTestCase.java | 184 - .../js/assembly/mock/HelloWorldImpl.componentType | 23 - .../container/js/assembly/mock/HelloWorldImpl.js | 4 - .../bigbank/account/services/AccountService.wsdl | 78 - .../services/AccountServiceImpl.componentType | 19 - .../account/services/account/AccountService.wsdl | 78 - .../account/AccountServiceImpl.componentType | 19 - .../AccountDataServiceImpl.componentType | 9 - .../stockquote/StockQuoteServiceImpl.componentType | 9 - .../services/stockquote/StockQuoteWebService.wsdl | 98 - .../tuscany/container/js/assembly/tests/sca.module | 54 - .../js/config/ModuleComponentLoaderTest1.module | 25 - .../container/js/rhino/RhinoInvokerTestCase.js | 22 - tags/java-stable-20060304/sca/core/LICENSE.txt | 202 - tags/java-stable-20060304/sca/core/pom.xml | 75 - .../core/addressing/AddressingConstants.java | 33 - .../tuscany/core/addressing/AddressingFactory.java | 37 - .../tuscany/core/addressing/EndpointReference.java | 120 - .../addressing/impl/AddressingFactoryImpl.java | 50 - .../addressing/impl/EndpointReferenceImpl.java | 182 - .../core/builder/BuilderConfigException.java | 26 - .../tuscany/core/builder/BuilderException.java | 41 - .../tuscany/core/builder/BuilderInitException.java | 39 - .../core/builder/ConfigurationException.java | 26 - .../core/builder/ContextCreationException.java | 41 - .../core/builder/HierarchicalWireBuilder.java | 29 - .../tuscany/core/builder/NoAccessorException.java | 39 - .../apache/tuscany/core/builder/ObjectFactory.java | 19 - .../tuscany/core/builder/RuntimeConfiguration.java | 69 - .../core/builder/RuntimeConfigurationBuilder.java | 24 - .../tuscany/core/builder/UnknownTypeException.java | 26 - .../apache/tuscany/core/builder/WireBuilder.java | 60 - .../tuscany/core/builder/impl/AssemblyVisitor.java | 62 - .../BaseExternalServiceRuntimeConfiguration.java | 106 - .../core/builder/impl/DefaultWireBuilder.java | 110 - .../impl/EntryPointRuntimeConfiguration.java | 104 - .../core/builder/impl/HierarchicalBuilder.java | 58 - .../core/builder/impl/ProxyObjectFactory.java | 42 - .../apache/tuscany/core/client/TuscanyRuntime.java | 204 - .../core/config/ComponentTypeIntrospector.java | 37 - .../core/config/ConfigurationException.java | 42 - .../core/config/ConfigurationLoadException.java | 47 - .../tuscany/core/config/ImplementationCache.java | 46 - .../core/config/InvalidRootElementException.java | 51 - .../core/config/JavaIntrospectionHelper.java | 349 - .../core/config/MissingResourceException.java | 43 - .../config/ModuleComponentConfigurationLoader.java | 74 - .../impl/Java5ComponentTypeIntrospector.java | 423 -- .../ModuleComponentConfigurationLoaderImpl.java | 142 - .../tuscany/core/context/AbstractContext.java | 89 - .../tuscany/core/context/AggregateContext.java | 85 - .../tuscany/core/context/AutowireContext.java | 35 - .../core/context/AutowireResolutionException.java | 40 - .../tuscany/core/context/ConfigurationContext.java | 66 - .../org/apache/tuscany/core/context/Context.java | 106 - .../tuscany/core/context/ContextInitException.java | 43 - .../core/context/ContextRuntimeException.java | 39 - .../tuscany/core/context/CoreRuntimeException.java | 27 - .../core/context/DuplicateNameException.java | 39 - .../tuscany/core/context/EntryPointContext.java | 57 - .../apache/tuscany/core/context/EventContext.java | 66 - .../tuscany/core/context/EventException.java | 43 - .../core/context/ExternalServiceContext.java | 24 - .../tuscany/core/context/InstanceContext.java | 75 - .../tuscany/core/context/InvalidNameException.java | 43 - .../core/context/LifecycleEventListener.java | 32 - .../apache/tuscany/core/context/QualifiedName.java | 83 - .../tuscany/core/context/RuntimeEventListener.java | 36 - .../tuscany/core/context/ScopeAwareContext.java | 31 - .../apache/tuscany/core/context/ScopeContext.java | 72 - .../tuscany/core/context/ScopeIdentifier.java | 33 - .../core/context/ScopeInitializationException.java | 42 - .../core/context/ScopeRuntimeException.java | 43 - .../apache/tuscany/core/context/ScopeStrategy.java | 43 - .../core/context/ServiceNotFoundException.java | 42 - .../core/context/SimpleComponentContext.java | 36 - .../core/context/SystemAggregateContext.java | 36 - .../tuscany/core/context/TargetException.java | 42 - .../context/impl/AbstractAggregateContext.java | 652 -- .../core/context/impl/AggregateContextImpl.java | 222 - .../core/context/impl/EntryPointContextImpl.java | 112 - .../core/context/impl/EventContextImpl.java | 77 - .../context/impl/ExternalServiceContextImpl.java | 92 - .../core/context/scope/AbstractScopeContext.java | 158 - .../core/context/scope/AbstractScopeStrategy.java | 67 - .../core/context/scope/AggregateScopeContext.java | 184 - .../core/context/scope/DefaultScopeStrategy.java | 52 - .../context/scope/HttpSessionScopeContext.java | 254 - .../core/context/scope/ModuleScopeContext.java | 182 - .../core/context/scope/RequestScopeContext.java | 224 - .../core/context/scope/StatelessScopeContext.java | 145 - .../webapp/HTTPSessionExpirationListener.java | 62 - .../core/context/webapp/LazyHTTPSessionId.java | 56 - .../core/context/webapp/TuscanyRequestFilter.java | 107 - .../core/context/webapp/TuscanyWebAppRuntime.java | 59 - .../tuscany/core/injection/EventInvoker.java | 17 - .../core/injection/FactoryInitException.java | 27 - .../tuscany/core/injection/FieldInjector.java | 45 - .../core/injection/InjectionRuntimeException.java | 29 - .../apache/tuscany/core/injection/Injector.java | 17 - .../tuscany/core/injection/MethodEventInvoker.java | 39 - .../tuscany/core/injection/MethodInjector.java | 30 - .../tuscany/core/injection/NullEventInvoker.java | 14 - .../core/injection/ObjectCallbackException.java | 26 - .../core/injection/ObjectCreationException.java | 27 - .../tuscany/core/injection/PojoObjectFactory.java | 75 - .../core/injection/ReferenceTargetFactory.java | 133 - .../tuscany/core/injection/SDOObjectFactory.java | 37 - .../core/injection/SingletonObjectFactory.java | 29 - .../tuscany/core/invocation/Interceptor.java | 42 - .../core/invocation/InvocationConfiguration.java | 279 - .../core/invocation/InvocationException.java | 29 - .../invocation/InvocationRuntimeException.java | 44 - .../tuscany/core/invocation/MessageChannel.java | 33 - .../tuscany/core/invocation/MessageHandler.java | 34 - .../tuscany/core/invocation/MethodHashMap.java | 53 - .../core/invocation/ProxyConfiguration.java | 101 - .../tuscany/core/invocation/TargetInvoker.java | 44 - .../core/invocation/impl/InvokerInterceptor.java | 46 - .../core/invocation/impl/MessageChannelImpl.java | 68 - .../core/invocation/impl/MessageDispatcher.java | 46 - .../core/invocation/impl/NullProxyFactory.java | 57 - .../core/invocation/impl/OneWayInterceptor.java | 48 - .../impl/RequestResponseInterceptor.java | 73 - .../core/invocation/jdk/JDKInvocationHandler.java | 143 - .../core/invocation/jdk/JDKProxyFactory.java | 96 - .../invocation/jdk/JDKProxyFactoryFactory.java | 52 - .../invocation/spi/ProxyCreationException.java | 43 - .../core/invocation/spi/ProxyException.java | 40 - .../tuscany/core/invocation/spi/ProxyFactory.java | 79 - .../core/invocation/spi/ProxyFactoryFactory.java | 42 - .../spi/ProxyInitializationException.java | 43 - .../core/loader/SCDLModelLoaderRegistry.java | 51 - .../loader/impl/SCDLModelLoaderRegistryImpl.java | 49 - .../org/apache/tuscany/core/message/Message.java | 182 - .../tuscany/core/message/MessageFactory.java | 31 - .../core/message/impl/MessageFactoryImpl.java | 40 - .../tuscany/core/message/impl/MessageImpl.java | 249 - .../tuscany/core/runtime/RuntimeContext.java | 83 - .../tuscany/core/runtime/RuntimeContextImpl.java | 286 - .../tuscany/core/runtime/RuntimeMonitor.java | 32 - .../tuscany/core/runtime/RuntimeScopeStrategy.java | 46 - .../tuscany/core/system/annotation/Autowire.java | 21 - .../core/system/annotation/ParentContext.java | 33 - .../system/assembly/SystemAssemblyFactory.java | 38 - .../core/system/assembly/SystemBinding.java | 37 - .../core/system/assembly/SystemImplementation.java | 38 - .../assembly/impl/SystemAssemblyFactoryImpl.java | 41 - .../system/assembly/impl/SystemBindingImpl.java | 41 - .../assembly/impl/SystemImplementationImpl.java | 94 - .../builder/SystemComponentContextBuilder.java | 383 - .../system/builder/SystemEntryPointBuilder.java | 63 - .../builder/SystemExternalServiceBuilder.java | 77 - .../SystemComponentRuntimeConfiguration.java | 140 - .../SystemEntryPointRuntimeConfiguration.java | 92 - .../SystemExternalServiceRuntimeConfiguration.java | 97 - .../config/SystemObjectRuntimeConfiguration.java | 92 - .../system/context/SystemAggregateContextImpl.java | 666 -- .../system/context/SystemComponentContext.java | 198 - .../system/context/SystemEntryPointContext.java | 82 - .../context/SystemExternalServiceContext.java | 82 - .../core/system/context/SystemScopeStrategy.java | 56 - .../core/system/injection/AutowireFactory.java | 50 - .../core/system/loader/SystemSCDLModelLoader.java | 49 - .../apache/tuscany/core/webapp/ContextBinder.java | 39 - .../tuscany/core/webapp/TuscanyRequestFilter.java | 97 - .../core/webapp/TuscanyServletListener.java | 168 - ....tuscany.core.runtime.proxy.ServiceProxyFactory | 1 - .../core/src/main/resources/model/anyobject.xsd | 35 - .../src/main/resources/model/tuscany-system.xsd | 52 - .../org/apache/tuscany/core/Messages.properties | 25 - .../sca/core/src/main/resources/system.module | 26 - .../builder/impl/DefaultWireBuilderTestCase.java | 447 -- .../impl/NegativeDefaultWireBuilderTestCase.java | 71 - .../config/JavaIntrospectionHelperTestCase.java | 37 - ...ModuleComponentConfigurationLoaderTestCase.java | 68 - .../context/AbstractAggregateHierarchyTests.java | 107 - .../AggregateComponentContextRegisterTestCase.java | 130 - .../core/context/AggregateHierarchyTestCase.java | 96 - .../core/context/QualifiedNameTestCase.java | 52 - .../scope/DefaultScopeStrategyTestCase.java | 52 - .../org/apache/tuscany/core/injection/Bean1.java | 26 - .../core/injection/ReflectionHelperTestCase.java | 74 - .../apache/tuscany/core/injection/SuperBean.java | 27 - .../InvocationConfigurationErrorTestCase.java | 158 - .../InvocationConfigurationTestCase.java | 156 - .../core/invocation/InvocationErrorTestCase.java | 124 - .../jdk/JDKInvocationHandlerTestCase.java | 112 - .../invocation/jdk/JDKProxyFactoryTestCase.java | 66 - .../tuscany/core/invocation/mock/MockHandler.java | 25 - .../core/invocation/mock/MockScopeContext.java | 136 - .../core/invocation/mock/MockStaticInvoker.java | 70 - .../core/invocation/mock/MockSyncInterceptor.java | 45 - .../tuscany/core/invocation/mock/SimpleSource.java | 25 - .../core/invocation/mock/SimpleSourceImpl.java | 36 - .../tuscany/core/invocation/mock/SimpleTarget.java | 28 - .../core/invocation/mock/SimpleTargetImpl.java | 39 - .../tuscany/core/mock/MockConfigContext.java | 56 - .../org/apache/tuscany/core/mock/MockFactory.java | 329 - .../mock/component/GenericSystemComponent.java | 6 - .../mock/component/ModuleScopeSystemComponent.java | 28 - .../component/ModuleScopeSystemComponentImpl.java | 25 - .../tuscany/core/runtime/RuntimeBootTestCase.java | 96 - .../core/runtime/RuntimeContextImplTestCase.java | 305 - .../SystemComponentContextBuilderTestCase.java | 137 - .../core/system/builder/SystemComponentImpl.java | 165 - .../builder/impl/AssemblyVisitorTestCase.java | 123 - ...mAggregateComponentContextRegisterTestCase.java | 40 - .../SystemAggregateComponentContextTestCase.java | 127 - .../context/SystemAggregateHierarchyTestCase.java | 49 - .../system/context/SystemBootstrapTestCase.java | 130 - .../context/SystemObjectRegistrationTestCase.java | 59 - .../tuscany/core/system/context/TestBuilder.java | 36 - .../core/config/ModuleComponentLoaderTest1.module | 24 - .../sca/core/src/test/resources/system.fragment | 21 - tags/java-stable-20060304/sca/model/LICENSE.txt | 202 - tags/java-stable-20060304/sca/model/pom.xml | 101 - .../tuscany/model/ModelRuntimeException.java | 41 - .../apache/tuscany/model/assembly/Aggregate.java | 117 - .../tuscany/model/assembly/AggregatePart.java | 40 - .../tuscany/model/assembly/AssemblyFactory.java | 162 - .../model/assembly/AssemblyModelContext.java | 64 - .../model/assembly/AssemblyModelObject.java | 45 - .../model/assembly/AssemblyModelVisitor.java | 32 - .../org/apache/tuscany/model/assembly/Binding.java | 40 - .../apache/tuscany/model/assembly/Component.java | 80 - .../model/assembly/ComponentImplementation.java | 40 - .../tuscany/model/assembly/ComponentType.java | 66 - .../tuscany/model/assembly/ConfiguredPort.java | 57 - .../tuscany/model/assembly/ConfiguredProperty.java | 62 - .../model/assembly/ConfiguredReference.java | 44 - .../tuscany/model/assembly/ConfiguredService.java | 36 - .../apache/tuscany/model/assembly/EntryPoint.java | 64 - .../apache/tuscany/model/assembly/Extensible.java | 38 - .../tuscany/model/assembly/ExternalService.java | 59 - .../tuscany/model/assembly/ModelInitException.java | 43 - .../org/apache/tuscany/model/assembly/Module.java | 39 - .../tuscany/model/assembly/ModuleComponent.java | 47 - .../tuscany/model/assembly/ModuleFragment.java | 25 - .../tuscany/model/assembly/Multiplicity.java | 47 - .../tuscany/model/assembly/OverrideOption.java | 40 - .../org/apache/tuscany/model/assembly/Port.java | 47 - .../apache/tuscany/model/assembly/Property.java | 91 - .../apache/tuscany/model/assembly/Reference.java | 36 - .../model/assembly/RuntimeConfigurationHolder.java | 36 - .../org/apache/tuscany/model/assembly/Scope.java | 32 - .../org/apache/tuscany/model/assembly/Service.java | 24 - .../tuscany/model/assembly/ServiceContract.java | 62 - .../apache/tuscany/model/assembly/ServiceURI.java | 53 - .../tuscany/model/assembly/SimpleComponent.java | 25 - .../apache/tuscany/model/assembly/Subsystem.java | 38 - .../org/apache/tuscany/model/assembly/Wire.java | 48 - .../tuscany/model/assembly/impl/AggregateImpl.java | 305 - .../model/assembly/impl/AggregatePartImpl.java | 67 - .../model/assembly/impl/AssemblyFactoryImpl.java | 204 - .../assembly/impl/AssemblyModelContextImpl.java | 92 - .../assembly/impl/AssemblyModelObjectImpl.java | 132 - .../tuscany/model/assembly/impl/BindingImpl.java | 96 - .../tuscany/model/assembly/impl/ComponentImpl.java | 222 - .../assembly/impl/ComponentImplementationImpl.java | 108 - .../model/assembly/impl/ComponentTypeImpl.java | 152 - .../model/assembly/impl/ConfiguredPortImpl.java | 142 - .../assembly/impl/ConfiguredPropertyImpl.java | 123 - .../assembly/impl/ConfiguredReferenceImpl.java | 72 - .../model/assembly/impl/ConfiguredServiceImpl.java | 48 - .../model/assembly/impl/EntryPointImpl.java | 145 - .../model/assembly/impl/ExtensibleImpl.java | 92 - .../model/assembly/impl/ExternalServiceImpl.java | 135 - .../model/assembly/impl/ModuleComponentImpl.java | 65 - .../model/assembly/impl/ModuleFragmentImpl.java | 32 - .../tuscany/model/assembly/impl/ModuleImpl.java | 243 - .../tuscany/model/assembly/impl/PortImpl.java | 106 - .../tuscany/model/assembly/impl/PropertyImpl.java | 178 - .../tuscany/model/assembly/impl/ReferenceImpl.java | 50 - .../model/assembly/impl/ServiceContractImpl.java | 81 - .../tuscany/model/assembly/impl/ServiceImpl.java | 32 - .../model/assembly/impl/ServiceURIImpl.java | 198 - .../model/assembly/impl/SimpleComponentImpl.java | 32 - .../tuscany/model/assembly/impl/SubsystemImpl.java | 49 - .../tuscany/model/assembly/impl/WireImpl.java | 66 - .../model/assembly/loader/AssemblyModelLoader.java | 81 - .../tuscany/model/scdl/loader/SCDLModelLoader.java | 36 - .../loader/impl/AssemblyModelLoadException.java | 41 - .../loader/impl/SCDLAssemblyModelLoaderImpl.java | 198 - .../loader/impl/SCDLModelContentHandlerImpl.java | 708 -- .../model/scdl/loader/impl/SCDLXMLReader.java | 109 - .../model/types/java/JavaServiceContract.java | 27 - .../types/java/impl/JavaServiceContractImpl.java | 81 - .../model/types/wsdl/WSDLServiceContract.java | 52 - .../types/wsdl/impl/WSDLServiceContractImpl.java | 212 - .../tuscany/model/util/ModelContentHandler.java | 71 - .../tuscany/model/util/ModelTransformer.java | 51 - .../tuscany/model/util/ModelTransformerImpl.java | 125 - .../org/apache/tuscany/model/util/XMLNameUtil.java | 227 - .../model/src/main/resources/model/assembly.mdl | 6092 ---------------- .../model/src/main/resources/model/assembly.ppt | Bin 60416 -> 0 bytes .../src/main/resources/model/sca-binding-sca.xsd | 21 - .../resources/model/sca-binding-webservice.xsd | 22 - .../model/src/main/resources/model/sca-core.xsd | 225 - .../resources/model/sca-implementation-java.xsd | 22 - .../main/resources/model/sca-interface-java.xsd | 23 - .../main/resources/model/sca-interface-wsdl.xsd | 39 - .../sca/model/src/main/resources/model/sca.xsd | 19 - .../org/apache/tuscany/model/Messages.properties | 25 - .../assembly/tests/SCDLAssemblyLoaderTestCase.java | 69 - .../assembly/tests/SCDLXMLReaderTestCase.java | 67 - .../account/services/account/AccountReport.java | 32 - .../account/services/account/AccountService.java | 25 - .../account/services/account/AccountService.wsdl | 78 - .../services/account/AccountServiceImpl.java | 42 - .../account/services/account/AccountSummary.java | 46 - .../services/accountdata/AccountDataService.java | 26 - .../accountdata/AccountDataServiceImpl.java | 48 - .../services/accountdata/CheckingAccount.java | 39 - .../services/accountdata/SavingsAccount.java | 39 - .../account/services/accountdata/StockAccount.java | 48 - .../services/stockquote/StockQuoteService.java | 24 - .../services/stockquote/StockQuoteServiceImpl.java | 28 - .../services/stockquote/StockQuoteWebService.wsdl | 98 - .../apache/tuscany/model/assembly/tests/sca.module | 58 - .../tuscany/model/assembly/tests/sca.subsystem | 24 - tags/java-stable-20060304/sca/plugin/LICENSE.txt | 202 - tags/java-stable-20060304/sca/plugin/pom.xml | 42 - .../wsdl2java/plugin/WSDL2JavaGeneratorMojo.java | 101 - tags/java-stable-20060304/sca/pom.xml | 69 - tags/java-stable-20060304/sca/tomcat/LICENSE.txt | 202 - tags/java-stable-20060304/sca/tomcat/pom.xml | 106 - .../org/apache/tuscany/tomcat/ContainerLoader.java | 100 - .../tuscany/tomcat/TuscanyContextListener.java | 144 - .../org/apache/tuscany/tomcat/TuscanyHost.java | 162 - .../org/apache/tuscany/tomcat/TuscanyValve.java | 118 - .../listener/BootstrapConfigurationException.java | 41 - .../lifecycle/listener/RuntimeBootstrap.java | 113 - .../listener/TomcatServerLifecycleListener.java | 40 - .../listener/TomcatWebAppLifecycleListener.java | 249 - .../listener/WebAppLifecycleListener.java | 152 - .../apache/tuscany/tomcat/LocalStrings.properties | 20 - .../org/apache/tuscany/tomcat/Messages.properties | 39 - .../tomcat/integration/AbstractTomcatTest.java | 250 - .../tuscany/tomcat/integration/TestServlet.java | 50 - .../integration/TomcatIntegrationTestCase.java | 109 - .../integration/TomcatStandaloneTestCase.java | 63 - .../src/test/resources/app1/WEB-INF/axis2.xml | 167 - .../test/resources/app1/WEB-INF/classes/sca.module | 21 - .../tomcat/src/test/resources/app1/WEB-INF/web.xml | 6 - .../sca/tomcat/src/test/resources/app1/index.html | 3 - .../test/resources/app2/WEB-INF/classes/sca.module | 21 - .../tomcat/src/test/resources/app2/WEB-INF/web.xml | 29 - .../sca/tomcat/src/test/resources/app2/index.html | 3 - tags/java-stable-20060304/sca/tools/LICENSE.txt | 202 - tags/java-stable-20060304/sca/tools/pom.xml | 110 - .../wsdl2java/generate/JavaInterfaceGenerator.java | 142 - .../generate/SDODataBindingCodegenExtension.java | 48 - .../wsdl2java/generate/WSDL2JavaGenerator.java | 319 - tags/java-stable-20060304/sdo/impl/LICENSE.txt | 202 - tags/java-stable-20060304/sdo/impl/model/SDO.ecore | 962 --- .../sdo/impl/model/SDO.genmodel | 564 -- tags/java-stable-20060304/sdo/impl/model/SDO.mdl | 7670 -------------------- tags/java-stable-20060304/sdo/impl/pom.xml | 92 - .../org/apache/tuscany/sdo/AnyTypeDataObject.java | 34 - .../java/org/apache/tuscany/sdo/SDOFactory.java | 173 - .../java/org/apache/tuscany/sdo/SDOPackage.java | 1599 ---- .../org/apache/tuscany/sdo/SDOTypeVisitor.java | 46 - .../tuscany/sdo/SimpleAnyTypeDataObject.java | 32 - .../sdo/codegen/BytecodeInterfaceGenerator.java | 93 - .../tuscany/sdo/codegen/GenerationException.java | 39 - .../sdo/codegen/JavaInterfaceGenerator.java | 104 - .../sdo/codegen/NoJavaImplementationException.java | 58 - .../apache/tuscany/sdo/helper/CopyHelperImpl.java | 51 - .../apache/tuscany/sdo/helper/DataFactoryImpl.java | 58 - .../apache/tuscany/sdo/helper/DataHelperImpl.java | 303 - .../tuscany/sdo/helper/EqualityHelperImpl.java | 67 - .../tuscany/sdo/helper/HelperProviderImpl.java | 110 - .../apache/tuscany/sdo/helper/TypeHelperImpl.java | 94 - .../apache/tuscany/sdo/helper/XMLDocumentImpl.java | 349 - .../apache/tuscany/sdo/helper/XMLHelperImpl.java | 116 - .../apache/tuscany/sdo/helper/XSDHelperImpl.java | 273 - .../tuscany/sdo/impl/AnyTypeDataObjectImpl.java | 296 - .../org/apache/tuscany/sdo/impl/AttributeImpl.java | 163 - .../apache/tuscany/sdo/impl/ChangeSummaryImpl.java | 692 -- .../tuscany/sdo/impl/ChangeSummarySettingImpl.java | 110 - .../org/apache/tuscany/sdo/impl/ClassImpl.java | 192 - .../org/apache/tuscany/sdo/impl/DataGraphImpl.java | 816 --- .../apache/tuscany/sdo/impl/DataObjectImpl.java | 1705 ----- .../org/apache/tuscany/sdo/impl/DataTypeImpl.java | 177 - .../tuscany/sdo/impl/DynamicDataObjectImpl.java | 196 - .../sdo/impl/DynamicStoreDataObjectImpl.java | 88 - .../java/org/apache/tuscany/sdo/impl/EnumImpl.java | 169 - .../org/apache/tuscany/sdo/impl/ReferenceImpl.java | 129 - .../apache/tuscany/sdo/impl/SDOFactoryImpl.java | 325 - .../apache/tuscany/sdo/impl/SDOPackageImpl.java | 2133 ------ .../sdo/impl/SimpleAnyTypeDataObjectImpl.java | 330 - .../tuscany/sdo/impl/StoreDataObjectImpl.java | 311 - .../org/apache/tuscany/sdo/util/BasicSequence.java | 134 - .../sdo/util/DataGraphResourceFactoryImpl.java | 644 -- .../apache/tuscany/sdo/util/DataObjectUtil.java | 1727 ----- .../java/org/apache/tuscany/sdo/util/SDOUtil.java | 221 - .../impl/src/main/resources/META-INF/MANIFEST.MF | 19 - .../services/commonj.sdo.impl.HelperProvider | 1 - .../java/org/apache/tuscany/sdo/codegen/Bar1.java | 23 - .../java/org/apache/tuscany/sdo/codegen/Bar2.java | 23 - .../BytecodeInterfaceGeneratorTestCase.java | 164 - .../java/org/apache/tuscany/sdo/codegen/Foo.java | 23 - .../codegen/JavaInterfaceGeneratorTestCase.java | 126 - .../apache/tuscany/sdo/codegen/MockProperty.java | 75 - .../org/apache/tuscany/sdo/codegen/MockType.java | 93 - .../tuscany/sdo/test/ChangeSummaryTestCase.java | 90 - .../tuscany/sdo/test/DataTypeBaseTypeTestCase.java | 65 - .../apache/tuscany/sdo/test/MixedTypeTestCase.java | 86 - .../apache/tuscany/sdo/test/OpenTypeTestCase.java | 82 - .../tuscany/sdo/test/SimpleCopyTestCase.java | 68 - .../tuscany/sdo/test/SimpleDynamicTestCase.java | 81 - .../tuscany/sdo/test/SimpleEqualityTestCase.java | 60 - .../java/org/apache/tuscany/sdo/test/TestUtil.java | 168 - .../apache/tuscany/sdo/test/XSDHelperTestCase.java | 57 - .../sdo/impl/src/test/resources/datatype.xsd | 16 - .../sdo/impl/src/test/resources/mixed.xml | 9 - .../sdo/impl/src/test/resources/mixed.xsd | 23 - .../sdo/impl/src/test/resources/open.xml | 8 - .../sdo/impl/src/test/resources/open.xsd | 26 - .../sdo/impl/src/test/resources/quote.xml | 14 - .../sdo/impl/src/test/resources/shallowquote.xml | 11 - .../sdo/impl/src/test/resources/simple.xsd | 23 - .../src/test/resources/simplechangesummary.xml | 35 - tags/java-stable-20060304/sdo/plugin/pom.xml | 42 - .../apache/tuscany/sdo/plugin/GeneratorMojo.java | 162 - tags/java-stable-20060304/sdo/pom.xml | 48 - .../.settings/org.eclipse.core.resources.prefs | 4 - tags/java-stable-20060304/sdo/tools/LICENSE.txt | 202 - tags/java-stable-20060304/sdo/tools/pom.xml | 68 - .../apache/tuscany/sdo/generate/JavaGenerator.java | 535 -- .../tools/src/main/resources/META-INF/MANIFEST.MF | 13 - .../src/test/java/com/example/simple/Quote.java | 307 - .../java/com/example/simple/SimpleFactory.java | 46 - .../java/com/example/simple/impl/QuoteImpl.java | 712 -- .../com/example/simple/impl/SimpleFactoryImpl.java | 138 - .../com/example/simple/impl/SimplePackageImpl.java | 908 --- .../apache/tuscany/sdo/test/SimpleStaticTest.java | 64 - .../sdo/tools/src/test/resources/enum.xsd | 32 - .../sdo/tools/src/test/resources/simple.xsd | 23 - tags/java-stable-20060304/spec/pom.xml | 92 - tags/java-stable-20060304/spec/sca/LICENSE.txt | 202 - tags/java-stable-20060304/spec/sca/pom.xml | 43 - .../java/org/osoa/sca/CurrentModuleContext.java | 42 - .../src/main/java/org/osoa/sca/ModuleContext.java | 85 - .../osoa/sca/NoRegisteredCallbackException.java | 39 - .../src/main/java/org/osoa/sca/RequestContext.java | 47 - .../spec/sca/src/main/java/org/osoa/sca/SCA.java | 49 - .../main/java/org/osoa/sca/ServiceReference.java | 67 - .../java/org/osoa/sca/ServiceRuntimeException.java | 40 - .../org/osoa/sca/ServiceUnavailableException.java | 64 - .../java/org/osoa/sca/SessionEndedException.java | 39 - .../sca/src/main/java/org/osoa/sca/Version.java | 43 - .../sca/annotations/AllowsPassByReference.java | 32 - .../java/org/osoa/sca/annotations/Callback.java | 31 - .../osoa/sca/annotations/ComponentMetaData.java | 33 - .../org/osoa/sca/annotations/ComponentName.java | 33 - .../java/org/osoa/sca/annotations/Context.java | 34 - .../java/org/osoa/sca/annotations/Destroy.java | 33 - .../main/java/org/osoa/sca/annotations/Init.java | 39 - .../java/org/osoa/sca/annotations/Property.java | 43 - .../java/org/osoa/sca/annotations/Reference.java | 43 - .../java/org/osoa/sca/annotations/Remotable.java | 34 - .../main/java/org/osoa/sca/annotations/Scope.java | 42 - .../java/org/osoa/sca/annotations/Service.java | 41 - .../java/org/osoa/sca/annotations/Session.java | 49 - .../java/org/osoa/sca/annotations/SessionID.java | 33 - .../sca/src/main/resources/META-INF/MANIFEST.MF | 8 - .../src/main/resources/schemas/sca-binding-sca.xsd | 21 - .../resources/schemas/sca-binding-webservice.xsd | 22 - .../sca/src/main/resources/schemas/sca-core.xsd | 216 - .../resources/schemas/sca-implementation-java.xsd | 22 - .../main/resources/schemas/sca-interface-java.xsd | 23 - .../main/resources/schemas/sca-interface-wsdl.xsd | 23 - .../spec/sca/src/main/resources/schemas/sca.xsd | 17 - .../org/osoa/sca/annotations/CallbackTestCase.java | 57 - .../osoa/sca/annotations/usage/CallbackType.java | 32 - tags/java-stable-20060304/spec/sdo/LICENSE.txt | 202 - tags/java-stable-20060304/spec/sdo/pom.xml | 37 - .../src/main/java/commonj/sdo/ChangeSummary.java | 204 - .../sdo/src/main/java/commonj/sdo/DataGraph.java | 73 - .../sdo/src/main/java/commonj/sdo/DataObject.java | 1105 --- .../sdo/src/main/java/commonj/sdo/Property.java | 79 - .../sdo/src/main/java/commonj/sdo/Sequence.java | 131 - .../spec/sdo/src/main/java/commonj/sdo/Type.java | 143 - .../main/java/commonj/sdo/helper/CopyHelper.java | 82 - .../main/java/commonj/sdo/helper/DataFactory.java | 61 - .../main/java/commonj/sdo/helper/DataHelper.java | 184 - .../java/commonj/sdo/helper/EqualityHelper.java | 89 - .../main/java/commonj/sdo/helper/TypeHelper.java | 70 - .../main/java/commonj/sdo/helper/XMLDocument.java | 152 - .../main/java/commonj/sdo/helper/XMLHelper.java | 167 - .../main/java/commonj/sdo/helper/XSDHelper.java | 193 - .../commonj/sdo/impl/ExternalizableDelegator.java | 74 - .../main/java/commonj/sdo/impl/HelperProvider.java | 365 - .../sdo/impl/NoHelperProviderException.java | 54 - .../sdo/src/main/resources/META-INF/MANIFEST.MF | 10 - .../spec/sdo/src/main/resources/xml/datagraph.xsd | 77 - .../spec/sdo/src/main/resources/xml/sdoJava.xml | 45 - .../spec/sdo/src/main/resources/xml/sdoJava.xsd | 82 - .../spec/sdo/src/main/resources/xml/sdoModel.xml | 87 - .../spec/sdo/src/main/resources/xml/sdoModel.xsd | 217 - .../spec/sdo/src/main/resources/xml/sdoXML.xml | 32 - .../spec/sdo/src/main/resources/xml/sdoXML.xsd | 49 - .../commonj/sdo/impl/HelperProviderTestCase.java | 91 - .../src/test/java/test/DefaultHelperProvider.java | 58 - .../src/test/java/test/TCCL1HelperProvider.java | 58 - .../services/commonj.sdo.impl.HelperProvider | 3 - .../services/commonj.sdo.impl.HelperProvider | 1 - tags/java-stable-20060304/testing/tomcat/axis2.xml | 167 - .../testing/tomcat/bigbank/.classpath | 30 - .../testing/tomcat/bigbank/.project | 17 - .../samples/bigbank/TestBigBankTestCase.java | 110 - tags/java-stable-20060304/testing/tomcat/build.xml | 348 - .../testing/tomcat/context.xsl | 48 - .../testing/tomcat/helloworldaxis/.classpath | 13 - .../testing/tomcat/helloworldaxis/.project | 17 - .../helloworldaxis/TestHelloWorldAxisTestCase.java | 59 - .../testing/tomcat/helloworldweb/.classpath | 16 - .../testing/tomcat/helloworldweb/.project | 17 - .../testing/tomcat/helloworldweb/pom.xml | 77 - .../helloworldweb/TestHelloWorldWebTestCase.java | 100 - .../TestHelloWorldWebDasTestCase.java | 67 - .../testing/tomcat/helloworldws/pom.xml | 83 - .../helloworldws/TestHelloWorldWSTestCase.java | 64 - tags/java-stable-20060304/testing/tomcat/pom.xml | 113 - .../java-stable-20060304/testing/tomcat/server.xml | 369 - .../java-stable-20060304/testing/tomcat/server.xsl | 48 - 1258 files changed, 138053 deletions(-) delete mode 100644 tags/java-stable-20060304/BUILDING.txt delete mode 100644 tags/java-stable-20060304/LICENSE.txt delete mode 100644 tags/java-stable-20060304/das/pom.xml delete mode 100644 tags/java-stable-20060304/das/rdb/LICENSE.txt delete mode 100644 tags/java-stable-20060304/das/rdb/pom.xml delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/ApplyChangesCommand.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Command.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandFactory.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandGroup.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandGroupFactory.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Converter.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Key.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Pager.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Parameter.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/ResultSetShape.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/SDODataTypes.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Column.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Command.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Config.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ConfigFactory.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ConnectionProperties.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/KeyPair.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Parameter.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Relationship.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ResultDescriptor.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Table.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ColumnImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/CommandImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigFactoryImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigPackageImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConnectionPropertiesImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/KeyPairImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ParameterImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/RelationshipImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ResultDescriptorImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/TableImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/MappingWrapper.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/QualifiedColumn.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/RelationshipWrapper.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/TableWrapper.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/CudGenerator.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/DeleteGenerator.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/InsertGenerator.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/UpdateGenerator.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/DataObjectMaker.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/DefaultConverter.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/GraphBuilderMetadata.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/MultiTableRegistry.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultMetadata.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultSetProcessor.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultSetRow.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/RowObjects.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/SingleTableRegistry.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/TableData.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/TableRegistry.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EAttributeMaker.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EReferenceMaker.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ESchemaMaker.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ResultSetTypeMap.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ApplyChangesCommandImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeFactory.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeOperation.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeSummarizer.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Changes.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandFactoryImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandGroupFactoryImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandGroupImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ConnectionImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CreateOperation.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DatabaseObject.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteCommandImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteList.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteOperation.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/FactoryRegistry.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/InsertCommandImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/InsertList.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/OptimisticWriteCommandImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/PagerImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ParameterImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Parameters.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/QueryString.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ReadCommandImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/SDODataTypeHelper.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/SPCommandImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Statement.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateCommandImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateList.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateOperation.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/WriteCommandImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/merge/impl/GraphMerger.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DataObjectUtil.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DebugFormatter.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DebugUtil.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/resources/META-INF/MANIFEST.MF delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/resources/config.xsd delete mode 100644 tags/java-stable-20060304/das/rdb/src/main/resources/dasmodel4.mdl delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/BestPracticeTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CUDGeneration.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CommandGroupTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CompanyTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CompoundKeyTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ConverterTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CorrectedDefectTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CrudWithChangeHistory.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/DefectTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ExceptionTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GeneratedCommandTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GeneratedId.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GraphMergeTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/NameMappingTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/OCCTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/OperationOrderingTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/Paging.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/PartialUpdateTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/PassiveConnectionTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ReadDBSchemaTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/RecursiveTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/RelationshipTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ResultSetShapeTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/SerializationTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/SimplestCrud.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/StoredProcs.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/TopDown.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/TypeTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersByLastnameCommand.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersCommand.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersStaticTypesCommand.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersWithShapeCommand.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/SimpleReadCustomersWithShapeCommand.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/CompanyFactory.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/CompanyType.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/DatagraphRoot.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/DepartmentType.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/EmployeeType.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyFactoryImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyPackageImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyTypeImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/DatagraphRootImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/DepartmentTypeImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/EmployeeTypeImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/AnOrder.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/Customer.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/CustomerFactory.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/DataGraphRoot.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/AnOrderImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerFactoryImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerPackageImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/DataGraphRootImpl.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/BookData.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CityData.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyData.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyDeptData.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CustomerData.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepEmpData.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepartmentData.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/EmployeeData.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OrderData.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OrderDetailsData.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/PartData.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/StateData.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/TypesData.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DB2Setup.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DasTest.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DatabaseSetup.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DerbySetup.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/JavaStoredProcs.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/MySQLSetup.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/RelationshipData.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestData.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestDataWithExplicitColumns.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/IntegerToBooleanConverter.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/SillyDateStringConverter.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToIntegerConverter.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToLongConverter.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllCommonTests.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDB2.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDerby.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsMySQL.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/typed/SimplestStaticCrud.java delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/1xM_mapping_no_cud.xml delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/CompanyConfig.xml delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/CustOrdersConnectionProps.xml delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/CustomersOrdersConfig.xml delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/basicCompanyDepartmentMapping.xml delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/basicCompanyMapping.xml delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMapping.xml delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMappingWithCUD.xml delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMappingWithInvalidCUD.xml delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerOrderMapping.xml delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/basicStaticCustomer.xml delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/cityStates.xml delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/company.ecore delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/company.genmodel delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/company.xsd delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/companyMapping.xml delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/customer.ecore delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/customer.genmodel delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/customer.xsd delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/customerMapping.xml delete mode 100644 tags/java-stable-20060304/das/rdb/src/test/resources/customerOrderRelationshipMapping.xml delete mode 100644 tags/java-stable-20060304/pom.xml delete mode 100644 tags/java-stable-20060304/samples/bigbank/account/pom.xml delete mode 100644 tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/account/AccountServiceImpl.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataService.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataServiceImpl.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/CheckingAccount.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/SavingsAccount.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/StockAccount.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteService.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteServiceImpl.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/account/src/main/resources/sca.module delete mode 100644 tags/java-stable-20060304/samples/bigbank/account/src/main/resources/sca.subsystem delete mode 100644 tags/java-stable-20060304/samples/bigbank/account/src/main/resources/wsdl/AccountService.wsdl delete mode 100644 tags/java-stable-20060304/samples/bigbank/account/src/main/resources/wsdl/StockQuoteWebService.wsdl delete mode 100644 tags/java-stable-20060304/samples/bigbank/account/src/main/webapp/WEB-INF/axis2.xml delete mode 100644 tags/java-stable-20060304/samples/bigbank/account/src/main/webapp/WEB-INF/web.xml delete mode 100644 tags/java-stable-20060304/samples/bigbank/account/src/test/java/org/apache/tuscany/samples/bigbank/account/client/AccountClient.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/META-INF/MANIFEST.MF delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/pom.xml delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/readme.htm delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerClient.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponent.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponentImpl.componentType delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponentImpl.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/java/sca.module delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/Customer.jsp delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/WEB-INF/web.xml delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/log.ctrl delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/log1.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/logmirror.ctrl delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c10.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c101.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c111.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c121.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c130.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c141.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c150.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c161.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c171.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c180.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c191.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1a1.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1b1.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1c0.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1d1.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1e0.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1f1.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c20.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c200.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c211.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c221.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c230.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c241.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c251.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c260.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c271.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c281.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c290.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2a1.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2b1.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2c1.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2d0.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2e1.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2f0.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c300.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c31.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c311.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c41.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c51.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c60.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c71.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c81.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c90.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/ca1.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cb1.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cc0.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cd1.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/ce1.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cf0.dat delete mode 100644 tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/service.properties delete mode 100644 tags/java-stable-20060304/samples/bigbank/pom.xml delete mode 100644 tags/java-stable-20060304/samples/bigbank/webclient/pom.xml delete mode 100644 tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/account/AccountServiceComponentImpl.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/LoginService.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/ProfileService.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/ProfileServiceImpl.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/SimpleLoginServiceImpl.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/account/AccountStatusTag.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/LoginBarrierTag.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/ServiceTag.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/ui/LoginServlet.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/sca.module delete mode 100644 tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/sca.subsystem delete mode 100644 tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl delete mode 100644 tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/axis2.xml delete mode 100644 tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld delete mode 100644 tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/web.xml delete mode 100644 tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/login.html delete mode 100644 tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/summary.jsp delete mode 100644 tags/java-stable-20060304/samples/bigbank/webclient/src/test/java/org/apache/tuscany/samples/bigbank/webclient/client/TestAccountService.java delete mode 100644 tags/java-stable-20060304/samples/bigbank/webclient/src/test/java/org/apache/tuscany/samples/bigbank/webclient/client/TestLoginService.java delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/CompanyAppGbl.xml delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/db.lck delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/log/log.ctrl delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/log/log1.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/log/logmirror.ctrl delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c10.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c101.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c111.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c121.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c130.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c141.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c150.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c161.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c171.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c180.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c191.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1a1.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1b1.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1c0.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1d1.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1e0.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1f1.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c20.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c200.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c211.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c221.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c230.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c241.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c251.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c260.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c271.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c281.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c290.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2a1.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2b1.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2c1.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2d0.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2e1.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2f0.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c300.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c31.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c311.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c320.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c331.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c340.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c351.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c360.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c371.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c380.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c391.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3a0.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3b1.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3c0.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3d1.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3e0.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3f1.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c400.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c41.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c411.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c420.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c431.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c440.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c451.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c460.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c471.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c481.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c490.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c4a1.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c51.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c60.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c71.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c81.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c90.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/ca1.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/cb1.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/cc0.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/cd1.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/ce1.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/cf0.dat delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/dastest/service.properties delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/pom.xml delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/readme.htm delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/src/main/java/org/apache/tuscany/samples/companyweb/CompanyClient.java delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/src/main/resources/CompanyConfig.xml delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/src/main/webapp/Company.jsp delete mode 100644 tags/java-stable-20060304/samples/das/companyweb/src/main/webapp/WEB-INF/web.xml delete mode 100644 tags/java-stable-20060304/samples/das/pom.xml delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworld/pom.xml delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworld/readme.htm delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworld/src/main/java/org/apache/tuscany/samples/helloworld/HelloWorldClient.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworld/src/main/java/org/apache/tuscany/samples/helloworld/HelloWorldService.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworld/src/main/java/org/apache/tuscany/samples/helloworld/HelloWorldServiceComponentImpl.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworld/src/main/resources/sca.module delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworld/src/test/java/org/apache/tuscany/samples/helloworld/HelloWorldServiceComponentTestCase.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis/axiscmds.bat delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis/helloworld.wsdl delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis/orig-java-to-create-wsdl/org/apache/tuscany/samples/helloworldaxis/HelloWorldService.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis/orig-java-to-create-wsdl/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImpl.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis/pom.xml delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis/readme.htm delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldAxisClient.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImpl.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplService.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplServiceLocator.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloworldSoapBindingImpl.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloworldSoapBindingSkeleton.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloworldSoapBindingStub.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/deploy.wsdd delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/undeploy.wsdd delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis2/build.xml delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis2/pom.xml delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/GetGreetings.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/GetGreetingsResponse.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplCallbackHandler.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplMessageReceiver.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplSkeleton.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplStub.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/resources/helloworld.wsdl delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/resources/services.xml delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/test/java/META-INF/MANIFEST.MF delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/test/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplTest.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/pom.xml delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/readme.htm delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/src/main/webapp/WEB-INF/server-config.wsdd delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/src/main/webapp/WEB-INF/web.xml delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/src/webapp/WEB-INF/server-config.wsdd delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/src/webapp/WEB-INF/web.xml delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldjs/pom.xml delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldjs/readme.htm delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldjs/src/main/java/org/apache/tuscany/samples/helloworldjs/HelloWorldClient.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldjs/src/main/java/org/apache/tuscany/samples/helloworldjs/HelloWorldServiceComponent.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldjs/src/main/resources/org/apache/tuscany/samples/helloworldjs/HelloWorldServiceComponentImpl.componentType delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldjs/src/main/resources/org/apache/tuscany/samples/helloworldjs/HelloWorldServiceComponentImpl.js delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldjs/src/main/resources/sca.module delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldjs/src/test/java/org/apache/tuscany/samples/helloworldjs/HelloWorldServiceComponentTestCase.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldmc/pom.xml delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldmc/readme.htm delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/GreetingPortionProvider.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/GreetingPortionProviderImpl.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldClient.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldService.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldServiceComponentImpl.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/resources/sca.module delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldmc/src/test/java/org/apache/tuscany/samples/helloworldmc/HelloWorldServiceComponentTestCase.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldweb/pom.xml delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldweb/readme.htm delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldweb/src/main/java/org/apache/tuscany/samples/helloworldweb/HelloWorldServiceComponent.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldweb/src/main/java/org/apache/tuscany/samples/helloworldweb/HelloWorldServiceComponentImpl.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldweb/src/main/resources/sca.module delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldweb/src/main/webapp/HelloWorldWeb.jsp delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldweb/src/main/webapp/WEB-INF/web.xml delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldweb/src/test/java/org/apache/tuscany/samples/helloworldweb/HelloWorldServiceComponentTestCase.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldws/pom.xml delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldws/readme.htm delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/java/org/apache/tuscany/samples/helloworldws/HelloWorldService.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/java/org/apache/tuscany/samples/helloworldws/HelloWorldServiceComponentImpl.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/resources/sca.module delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/resources/wsdl/helloworld.wsdl delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/webapp/WEB-INF/axis2.xml delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/webapp/WEB-INF/web.xml delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldwsclient/pom.xml delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldwsclient/readme.htm delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldClient.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldService.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldServiceComponentImpl.java delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/axis2.xml delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/sca.module delete mode 100644 tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/wsdl/helloworld.wsdl delete mode 100644 tags/java-stable-20060304/samples/helloworld/pom.xml delete mode 100644 tags/java-stable-20060304/samples/pom.xml delete mode 100644 tags/java-stable-20060304/sca/binding.axis/LICENSE.txt delete mode 100644 tags/java-stable-20060304/sca/binding.axis/pom.xml delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/assembly/WebServiceAssemblyFactory.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/assembly/WebServiceBinding.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/assembly/impl/WebServiceAssemblyFactoryImpl.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/assembly/impl/WebServiceBindingImpl.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/ExternalWebServiceConfigurationBuilder.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/ExternalWebServiceWireBuilder.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/WebServiceEntryPointConfigurationBuilder.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/config/ExternalWebServiceRuntimeConfiguration.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/config/WebServiceEntryPointRuntimeConfiguration.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/engine/config/AxisEngineConfigurationFactory.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ExternalWebServiceClient.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ExternalWebServiceTargetInvoker.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/WebServiceEntryPointServlet.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/WebServiceOperationMetaData.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/WebServicePortMetaData.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/loader/WebServiceSCDLModelLoader.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/main/resources/org/apache/tuscany/binding/axis/Messages.properties delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/main/resources/org/apache/tuscany/binding/axis/engine/config/server-config.wsdd delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/main/resources/system.fragment delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/WebServiceAssemblyLoaderTestCase.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountReport.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountService.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountServiceImpl.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountSummary.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/accountdata/StockAccount.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountService.wsdl delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/sca.module delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/mediator/tests/DocLit.wsdl delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/mediator/tests/DocLitWrapped.wsdl delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/mediator/tests/RpcLit.wsdl delete mode 100644 tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/mediator/tests/sca.module delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/LICENSE.txt delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/pom.xml delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceAssemblyFactory.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceBinding.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceAssemblyFactoryImpl.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceBindingImpl.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceConfigurationBuilder.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceWireBuilder.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/WebServiceEntryPointConfigurationBuilder.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/ExternalWebServiceRuntimeConfiguration.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/WebServiceEntryPointRuntimeConfiguration.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/ExternalWebServiceClient.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/ExternalWebServiceTargetInvoker.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/WebServiceEntryPointInOutSyncMessageReceiver.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/WebServiceEntryPointServlet.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/WebServiceOperationMetaData.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/WebServicePortMetaData.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/loader/WebServiceSCDLModelLoader.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/util/AxiomHelper.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/main/resources/org/apache/tuscany/binding/axis2/engine/config/axis2.xml delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/main/resources/system.fragment delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/WebServiceAssemblyLoaderTestCase.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountReport.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountService.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountServiceImpl.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountSummary.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/StockAccount.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/util/AxiomHelperTestCase.java delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountService.wsdl delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/assembly/tests/sca.module delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/mediator/tests/DocLit.wsdl delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/mediator/tests/DocLitWrapped.wsdl delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/mediator/tests/RpcLit.wsdl delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/mediator/tests/sca.module delete mode 100644 tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/util/helloworld.wsdl delete mode 100644 tags/java-stable-20060304/sca/common/LICENSE.txt delete mode 100644 tags/java-stable-20060304/sca/common/pom.xml delete mode 100644 tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/TuscanyException.java delete mode 100644 tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/TuscanyRuntimeException.java delete mode 100644 tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/discovery/util/ServiceProviderRegistry.java delete mode 100644 tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/io/util/ClassLoaderObjectInputStream.java delete mode 100644 tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/io/util/FixedURLClassLoader.java delete mode 100644 tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/io/util/FixedURLInputStream.java delete mode 100644 tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/io/util/IOHelper.java delete mode 100644 tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/io/util/UTF8String.java delete mode 100644 tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/monitor/LogLevel.java delete mode 100644 tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/monitor/MonitorFactory.java delete mode 100644 tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/monitor/impl/InvalidLevelException.java delete mode 100644 tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/monitor/impl/JavaLoggingMonitorFactory.java delete mode 100644 tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/monitor/impl/NullMonitorFactory.java delete mode 100644 tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/resource/ResourceLoader.java delete mode 100644 tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/resource/impl/ResourceLoaderImpl.java delete mode 100644 tags/java-stable-20060304/sca/common/src/main/resources/META-INF/services/org.apache.tuscany.common.logging.LogProvider delete mode 100644 tags/java-stable-20060304/sca/common/src/main/resources/META-INF/services/org.apache.tuscany.common.resource.loader.ResourceLoaderProvider delete mode 100644 tags/java-stable-20060304/sca/common/src/main/resources/org/apache/tuscany/common/Messages.properties delete mode 100644 tags/java-stable-20060304/sca/common/src/test/java/org/apache/tuscany/common/monitor/impl/JavaLoggingTestCase.java delete mode 100644 tags/java-stable-20060304/sca/common/src/test/resources/org/apache/tuscany/common/monitor/impl/JavaLoggingTestCase$Monitor.properties delete mode 100644 tags/java-stable-20060304/sca/container.java/LICENSE.txt delete mode 100644 tags/java-stable-20060304/sca/container.java/pom.xml delete mode 100644 tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/assembly/JavaAssemblyFactory.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/assembly/JavaImplementation.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/assembly/impl/JavaAssemblyFactoryImpl.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/assembly/impl/JavaImplementationImpl.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/builder/JavaComponentContextBuilder.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/builder/JavaTargetWireBuilder.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/config/JavaComponentRuntimeConfiguration.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/context/JavaComponentContext.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/invocation/AbstractJavaComponentInvoker.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/invocation/ScopedJavaComponentInvoker.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/invocation/StaticJavaComponentTargetInvoker.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/loader/JavaSCDLModelLoader.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/main/resources/org/apache/tuscany/container/java/Messages.properties delete mode 100644 tags/java-stable-20060304/sca/container.java/src/main/resources/system.fragment delete mode 100644 tags/java-stable-20060304/sca/container.java/src/main/test/sca.module delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/impl/JavaImplementationTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/HelloWorldImpl.componentType delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/HelloWorldImpl.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/HelloWorldService.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/HelloWorldWithFieldProperties.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/NakedHelloWorld.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/NakedHelloWorldWithInterface.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/JavaAssemblyLoaderTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/account/AccountReport.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/account/AccountService.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/account/AccountService.wsdl delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/account/AccountServiceImpl.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/account/AccountSummary.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/accountdata/StockAccount.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/stockquote/StockQuoteServiceImpl.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/builder/JavaComponentContextBuilderTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/builder/JavaTargetWireBuilderTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/builder/MockHandlerBuilder.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/builder/MockInterceptorBuilder.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/config/ModuleComponentConfigurationLoaderTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/context/BadPojoTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/context/PojoLifecycleTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/context/PojoTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/JavaBuilderContextIntegrationTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/JavaIntegrationTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/JavaRuntimeBootstrapTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/binding/EntryPointToJavaTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/binding/JavaToExternalServiceTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/context/ScopeReferenceTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/MediationTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/ScopedPojoInvokerTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/StaticPojoInvokerTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/MockHandler.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/MockSyncInterceptor.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/SimpleSource.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/SimpleSourceImpl.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/SimpleTarget.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/SimpleTargetImpl.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockConfigContext.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockFactory.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockScopeContext.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBinding.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBindingBuilder.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBindingWireBuilder.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooClient.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooESTargetInvoker.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooEntryPointRuntimeConfiguration.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooExternalServiceRuntimeConfiguration.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/AbstractGenericComponent.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/BadContextPojo.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/BadNamePojo.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/DataObject.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/GenericComponent.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/HelloWorldClient.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/LocalComponentImpl.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponent.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponentImpl.componentType delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponentImpl.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeDestroyOnlyComponent.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeEagerInitComponent.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeEagerInitDestroyComponent.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeInitDestroyComponent.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeInitOnlyComponent.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RemotableService.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RemotableServiceImpl.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeComponent.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeComponentImpl.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeComponent.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeComponentImpl.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeDestroyOnlyComponent.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeInitDestroyComponent.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeInitOnlyComponent.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/StatelessComponent.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/StatelessComponentImpl.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/AggregateScopeTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicHttpSessionScopeTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicModuleScopeTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicRequestScopeTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicStatelessScopeTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/HttpSessionScopeLifecycleTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/ModuleScopeLifecycleTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/OrderException.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/OrderedEagerInitPojo.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/OrderedInitPojo.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/RequestScopeLifecycleTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/resources/org/apache/tuscany/container/java/assembly/tests/sca.module delete mode 100644 tags/java-stable-20060304/sca/container.java/src/test/resources/org/apache/tuscany/container/java/config/ModuleComponentLoaderTest1.module delete mode 100644 tags/java-stable-20060304/sca/container.js/LICENSE.txt delete mode 100644 tags/java-stable-20060304/sca/container.js/pom.xml delete mode 100644 tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/assembly/JavaScriptAssemblyFactory.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/assembly/JavaScriptImplementation.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/assembly/impl/JavaScriptAssemblyFactoryImpl.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/assembly/impl/JavaScriptImplementationImpl.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/builder/JavaScriptComponentContextBuilder.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/builder/JavaScriptTargetWireBuilder.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/config/JavaScriptComponentRuntimeConfiguration.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/context/JavaScriptComponentContext.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/loader/JavaScriptSCDLModelLoader.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/rhino/RhinoScript.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/rhino/RhinoTargetInvoker.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/main/resources/model/sca-implementation-js.xsd delete mode 100644 tags/java-stable-20060304/sca/container.js/src/main/resources/org/apache/tuscany/container/js/handler/JavaScriptComponentConfigurationHandler.componentType delete mode 100644 tags/java-stable-20060304/sca/container.js/src/main/resources/system.fragment delete mode 100644 tags/java-stable-20060304/sca/container.js/src/samples/java/org/apache/tuscany/container/js/sample/helloworld/HelloWorld.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/samples/java/org/apache/tuscany/container/js/sample/helloworld/HelloWorldImpl.componentType delete mode 100644 tags/java-stable-20060304/sca/container.js/src/samples/java/org/apache/tuscany/container/js/sample/helloworld/HelloWorldImpl.js delete mode 100644 tags/java-stable-20060304/sca/container.js/src/samples/java/org/apache/tuscany/container/js/sample/helloworld/Main.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/samples/java/sca.module delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/impl/JavaScriptImplementationTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/mock/HelloWorldService.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/JavaScriptAssemblyLoaderTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/account/AccountReport.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/account/AccountService.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/account/AccountSummary.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/StockAccount.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/stockquote/StockQuoteServiceImpl.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/builder/JSComponentContextBuilderTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/builder/MockHandlerBuilder.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/builder/MockInterceptorBuilder.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/config/ModuleComponentConfigurationLoaderTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/integration/JSComponentContextTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/invocation/mock/MockHandler.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/invocation/mock/MockSyncInterceptor.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/mock/MockAssemblyFactory.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/mock/MockModuleFactory.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/rhino/RhinoInvokerTestCase.java delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/mock/HelloWorldImpl.componentType delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/mock/HelloWorldImpl.js delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/AccountService.wsdl delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/AccountServiceImpl.componentType delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/account/AccountService.wsdl delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/account/AccountServiceImpl.componentType delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.componentType delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/stockquote/StockQuoteServiceImpl.componentType delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/sca.module delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/config/ModuleComponentLoaderTest1.module delete mode 100644 tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/rhino/RhinoInvokerTestCase.js delete mode 100644 tags/java-stable-20060304/sca/core/LICENSE.txt delete mode 100644 tags/java-stable-20060304/sca/core/pom.xml delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/addressing/AddressingConstants.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/addressing/AddressingFactory.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/addressing/EndpointReference.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/addressing/impl/AddressingFactoryImpl.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/addressing/impl/EndpointReferenceImpl.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/BuilderConfigException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/BuilderException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/BuilderInitException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/ConfigurationException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/ContextCreationException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/HierarchicalWireBuilder.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/NoAccessorException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/ObjectFactory.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/RuntimeConfiguration.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/RuntimeConfigurationBuilder.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/UnknownTypeException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/WireBuilder.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/AssemblyVisitor.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/BaseExternalServiceRuntimeConfiguration.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/DefaultWireBuilder.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/EntryPointRuntimeConfiguration.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/HierarchicalBuilder.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/ProxyObjectFactory.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/client/TuscanyRuntime.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/ComponentTypeIntrospector.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/ConfigurationException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/ConfigurationLoadException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/ImplementationCache.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/InvalidRootElementException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/JavaIntrospectionHelper.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/MissingResourceException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/ModuleComponentConfigurationLoader.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/impl/Java5ComponentTypeIntrospector.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/impl/ModuleComponentConfigurationLoaderImpl.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/AbstractContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/AggregateContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/AutowireContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/AutowireResolutionException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ConfigurationContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/Context.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ContextInitException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ContextRuntimeException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/CoreRuntimeException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/DuplicateNameException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/EntryPointContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/EventContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/EventException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ExternalServiceContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/InstanceContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/InvalidNameException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/LifecycleEventListener.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/QualifiedName.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/RuntimeEventListener.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeAwareContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeIdentifier.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeInitializationException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeRuntimeException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeStrategy.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ServiceNotFoundException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/SimpleComponentContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/SystemAggregateContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/TargetException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/impl/AbstractAggregateContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/impl/AggregateContextImpl.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/impl/EntryPointContextImpl.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/impl/EventContextImpl.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/impl/ExternalServiceContextImpl.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/AbstractScopeContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/AbstractScopeStrategy.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/AggregateScopeContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/DefaultScopeStrategy.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/HttpSessionScopeContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/ModuleScopeContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/RequestScopeContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/StatelessScopeContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/webapp/HTTPSessionExpirationListener.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/webapp/LazyHTTPSessionId.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/webapp/TuscanyRequestFilter.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/webapp/TuscanyWebAppRuntime.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/EventInvoker.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/FactoryInitException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/FieldInjector.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/InjectionRuntimeException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/Injector.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/MethodEventInvoker.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/MethodInjector.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/NullEventInvoker.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/ObjectCallbackException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/ObjectCreationException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/PojoObjectFactory.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/ReferenceTargetFactory.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/SDOObjectFactory.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/SingletonObjectFactory.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/Interceptor.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/InvocationConfiguration.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/InvocationException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/InvocationRuntimeException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/MessageChannel.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/MessageHandler.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/MethodHashMap.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/ProxyConfiguration.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/TargetInvoker.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/InvokerInterceptor.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/MessageChannelImpl.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/MessageDispatcher.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/NullProxyFactory.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/OneWayInterceptor.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/RequestResponseInterceptor.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/jdk/JDKInvocationHandler.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/jdk/JDKProxyFactory.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/jdk/JDKProxyFactoryFactory.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/spi/ProxyCreationException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/spi/ProxyException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/spi/ProxyFactory.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/spi/ProxyFactoryFactory.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/spi/ProxyInitializationException.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/loader/SCDLModelLoaderRegistry.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/loader/impl/SCDLModelLoaderRegistryImpl.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/message/Message.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/message/MessageFactory.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/message/impl/MessageFactoryImpl.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/message/impl/MessageImpl.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeContextImpl.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeMonitor.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeScopeStrategy.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/annotation/Autowire.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/annotation/ParentContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/SystemAssemblyFactory.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/SystemBinding.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/SystemImplementation.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/impl/SystemAssemblyFactoryImpl.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/impl/SystemBindingImpl.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/impl/SystemImplementationImpl.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/builder/SystemComponentContextBuilder.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/builder/SystemEntryPointBuilder.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/builder/SystemExternalServiceBuilder.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemComponentRuntimeConfiguration.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemEntryPointRuntimeConfiguration.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemExternalServiceRuntimeConfiguration.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemObjectRuntimeConfiguration.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemAggregateContextImpl.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemComponentContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemEntryPointContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemExternalServiceContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemScopeStrategy.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/injection/AutowireFactory.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/loader/SystemSCDLModelLoader.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/webapp/ContextBinder.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/webapp/TuscanyRequestFilter.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/webapp/TuscanyServletListener.java delete mode 100644 tags/java-stable-20060304/sca/core/src/main/resources/META-INF/services/org.apache.tuscany.core.runtime.proxy.ServiceProxyFactory delete mode 100644 tags/java-stable-20060304/sca/core/src/main/resources/model/anyobject.xsd delete mode 100644 tags/java-stable-20060304/sca/core/src/main/resources/model/tuscany-system.xsd delete mode 100644 tags/java-stable-20060304/sca/core/src/main/resources/org/apache/tuscany/core/Messages.properties delete mode 100644 tags/java-stable-20060304/sca/core/src/main/resources/system.module delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/builder/impl/DefaultWireBuilderTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/builder/impl/NegativeDefaultWireBuilderTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/config/JavaIntrospectionHelperTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/config/ModuleComponentConfigurationLoaderTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/context/AbstractAggregateHierarchyTests.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/context/AggregateComponentContextRegisterTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/context/AggregateHierarchyTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/context/QualifiedNameTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/context/scope/DefaultScopeStrategyTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/injection/Bean1.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/injection/ReflectionHelperTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/injection/SuperBean.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/InvocationConfigurationErrorTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/InvocationConfigurationTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/InvocationErrorTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/jdk/JDKInvocationHandlerTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/jdk/JDKProxyFactoryTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/MockHandler.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/MockScopeContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/MockStaticInvoker.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/MockSyncInterceptor.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/SimpleSource.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/SimpleSourceImpl.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/SimpleTarget.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/SimpleTargetImpl.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/mock/MockConfigContext.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/mock/MockFactory.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/mock/component/GenericSystemComponent.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/mock/component/ModuleScopeSystemComponent.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/mock/component/ModuleScopeSystemComponentImpl.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeBootTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeContextImplTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/builder/SystemComponentContextBuilderTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/builder/SystemComponentImpl.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/builder/impl/AssemblyVisitorTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/SystemAggregateComponentContextRegisterTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/SystemAggregateComponentContextTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/SystemAggregateHierarchyTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/SystemBootstrapTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/SystemObjectRegistrationTestCase.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/TestBuilder.java delete mode 100644 tags/java-stable-20060304/sca/core/src/test/resources/org/apache/tuscany/core/config/ModuleComponentLoaderTest1.module delete mode 100644 tags/java-stable-20060304/sca/core/src/test/resources/system.fragment delete mode 100644 tags/java-stable-20060304/sca/model/LICENSE.txt delete mode 100644 tags/java-stable-20060304/sca/model/pom.xml delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/ModelRuntimeException.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Aggregate.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/AggregatePart.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/AssemblyFactory.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/AssemblyModelContext.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/AssemblyModelObject.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/AssemblyModelVisitor.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Binding.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Component.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ComponentImplementation.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ComponentType.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredPort.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredProperty.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredReference.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredService.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/EntryPoint.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Extensible.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ExternalService.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModelInitException.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Module.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModuleComponent.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModuleFragment.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Multiplicity.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/OverrideOption.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Port.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Property.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Reference.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/RuntimeConfigurationHolder.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Scope.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Service.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceContract.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceURI.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/SimpleComponent.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Subsystem.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Wire.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AggregateImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AggregatePartImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyFactoryImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyModelContextImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyModelObjectImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/BindingImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentImplementationImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentTypeImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPortImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPropertyImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredReferenceImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredServiceImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/EntryPointImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExtensibleImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExternalServiceImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleComponentImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleFragmentImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/PortImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/PropertyImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ReferenceImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceContractImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceURIImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/SimpleComponentImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/SubsystemImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/WireImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/loader/AssemblyModelLoader.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/SCDLModelLoader.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/impl/AssemblyModelLoadException.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/impl/SCDLAssemblyModelLoaderImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/impl/SCDLModelContentHandlerImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/impl/SCDLXMLReader.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/types/java/JavaServiceContract.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/types/java/impl/JavaServiceContractImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/types/wsdl/WSDLServiceContract.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/types/wsdl/impl/WSDLServiceContractImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/util/ModelContentHandler.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/util/ModelTransformer.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/util/ModelTransformerImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/util/XMLNameUtil.java delete mode 100644 tags/java-stable-20060304/sca/model/src/main/resources/model/assembly.mdl delete mode 100644 tags/java-stable-20060304/sca/model/src/main/resources/model/assembly.ppt delete mode 100644 tags/java-stable-20060304/sca/model/src/main/resources/model/sca-binding-sca.xsd delete mode 100644 tags/java-stable-20060304/sca/model/src/main/resources/model/sca-binding-webservice.xsd delete mode 100644 tags/java-stable-20060304/sca/model/src/main/resources/model/sca-core.xsd delete mode 100644 tags/java-stable-20060304/sca/model/src/main/resources/model/sca-implementation-java.xsd delete mode 100644 tags/java-stable-20060304/sca/model/src/main/resources/model/sca-interface-java.xsd delete mode 100644 tags/java-stable-20060304/sca/model/src/main/resources/model/sca-interface-wsdl.xsd delete mode 100644 tags/java-stable-20060304/sca/model/src/main/resources/model/sca.xsd delete mode 100644 tags/java-stable-20060304/sca/model/src/main/resources/org/apache/tuscany/model/Messages.properties delete mode 100644 tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/SCDLAssemblyLoaderTestCase.java delete mode 100644 tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/SCDLXMLReaderTestCase.java delete mode 100644 tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/account/AccountReport.java delete mode 100644 tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/account/AccountService.java delete mode 100644 tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/account/AccountService.wsdl delete mode 100644 tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/account/AccountServiceImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/account/AccountSummary.java delete mode 100644 tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java delete mode 100644 tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java delete mode 100644 tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java delete mode 100644 tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/accountdata/StockAccount.java delete mode 100644 tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java delete mode 100644 tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/stockquote/StockQuoteServiceImpl.java delete mode 100644 tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl delete mode 100644 tags/java-stable-20060304/sca/model/src/test/resources/org/apache/tuscany/model/assembly/tests/sca.module delete mode 100644 tags/java-stable-20060304/sca/model/src/test/resources/org/apache/tuscany/model/assembly/tests/sca.subsystem delete mode 100644 tags/java-stable-20060304/sca/plugin/LICENSE.txt delete mode 100644 tags/java-stable-20060304/sca/plugin/pom.xml delete mode 100644 tags/java-stable-20060304/sca/plugin/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDL2JavaGeneratorMojo.java delete mode 100644 tags/java-stable-20060304/sca/pom.xml delete mode 100644 tags/java-stable-20060304/sca/tomcat/LICENSE.txt delete mode 100644 tags/java-stable-20060304/sca/tomcat/pom.xml delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/ContainerLoader.java delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/TuscanyContextListener.java delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/TuscanyHost.java delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/TuscanyValve.java delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/lifecycle/listener/BootstrapConfigurationException.java delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/lifecycle/listener/RuntimeBootstrap.java delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/lifecycle/listener/TomcatServerLifecycleListener.java delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/lifecycle/listener/TomcatWebAppLifecycleListener.java delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/lifecycle/listener/WebAppLifecycleListener.java delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/main/resources/org/apache/tuscany/tomcat/LocalStrings.properties delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/main/resources/org/apache/tuscany/tomcat/Messages.properties delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/test/java/org/apache/tuscany/tomcat/integration/AbstractTomcatTest.java delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/test/java/org/apache/tuscany/tomcat/integration/TestServlet.java delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/test/java/org/apache/tuscany/tomcat/integration/TomcatIntegrationTestCase.java delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/test/java/org/apache/tuscany/tomcat/integration/TomcatStandaloneTestCase.java delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/test/resources/app1/WEB-INF/axis2.xml delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/test/resources/app1/WEB-INF/classes/sca.module delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/test/resources/app1/WEB-INF/web.xml delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/test/resources/app1/index.html delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/test/resources/app2/WEB-INF/classes/sca.module delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/test/resources/app2/WEB-INF/web.xml delete mode 100644 tags/java-stable-20060304/sca/tomcat/src/test/resources/app2/index.html delete mode 100644 tags/java-stable-20060304/sca/tools/LICENSE.txt delete mode 100644 tags/java-stable-20060304/sca/tools/pom.xml delete mode 100644 tags/java-stable-20060304/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceGenerator.java delete mode 100644 tags/java-stable-20060304/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingCodegenExtension.java delete mode 100644 tags/java-stable-20060304/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGenerator.java delete mode 100644 tags/java-stable-20060304/sdo/impl/LICENSE.txt delete mode 100644 tags/java-stable-20060304/sdo/impl/model/SDO.ecore delete mode 100644 tags/java-stable-20060304/sdo/impl/model/SDO.genmodel delete mode 100644 tags/java-stable-20060304/sdo/impl/model/SDO.mdl delete mode 100644 tags/java-stable-20060304/sdo/impl/pom.xml delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/AnyTypeDataObject.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOFactory.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOPackage.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOTypeVisitor.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/SimpleAnyTypeDataObject.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/BytecodeInterfaceGenerator.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/GenerationException.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/JavaInterfaceGenerator.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/NoJavaImplementationException.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/CopyHelperImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/DataFactoryImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/DataHelperImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/EqualityHelperImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/HelperProviderImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/TypeHelperImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLDocumentImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLHelperImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XSDHelperImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/AnyTypeDataObjectImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/AttributeImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummaryImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummarySettingImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ClassImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataGraphImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataTypeImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicDataObjectImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicStoreDataObjectImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/EnumImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ReferenceImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SDOFactoryImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SDOPackageImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SimpleAnyTypeDataObjectImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/StoreDataObjectImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/BasicSequence.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataGraphResourceFactoryImpl.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataObjectUtil.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/SDOUtil.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/resources/META-INF/MANIFEST.MF delete mode 100644 tags/java-stable-20060304/sdo/impl/src/main/resources/META-INF/services/commonj.sdo.impl.HelperProvider delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Bar1.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Bar2.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/BytecodeInterfaceGeneratorTestCase.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Foo.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/JavaInterfaceGeneratorTestCase.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/MockProperty.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/MockType.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryTestCase.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DataTypeBaseTypeTestCase.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/MixedTypeTestCase.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/OpenTypeTestCase.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleCopyTestCase.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleDynamicTestCase.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleEqualityTestCase.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TestUtil.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XSDHelperTestCase.java delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/resources/datatype.xsd delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/resources/mixed.xml delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/resources/mixed.xsd delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/resources/open.xml delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/resources/open.xsd delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/resources/quote.xml delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/resources/shallowquote.xml delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/resources/simple.xsd delete mode 100644 tags/java-stable-20060304/sdo/impl/src/test/resources/simplechangesummary.xml delete mode 100644 tags/java-stable-20060304/sdo/plugin/pom.xml delete mode 100644 tags/java-stable-20060304/sdo/plugin/src/main/java/org/apache/tuscany/sdo/plugin/GeneratorMojo.java delete mode 100644 tags/java-stable-20060304/sdo/pom.xml delete mode 100644 tags/java-stable-20060304/sdo/tools/.settings/org.eclipse.core.resources.prefs delete mode 100644 tags/java-stable-20060304/sdo/tools/LICENSE.txt delete mode 100644 tags/java-stable-20060304/sdo/tools/pom.xml delete mode 100644 tags/java-stable-20060304/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java delete mode 100644 tags/java-stable-20060304/sdo/tools/src/main/resources/META-INF/MANIFEST.MF delete mode 100644 tags/java-stable-20060304/sdo/tools/src/test/java/com/example/simple/Quote.java delete mode 100644 tags/java-stable-20060304/sdo/tools/src/test/java/com/example/simple/SimpleFactory.java delete mode 100644 tags/java-stable-20060304/sdo/tools/src/test/java/com/example/simple/impl/QuoteImpl.java delete mode 100644 tags/java-stable-20060304/sdo/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java delete mode 100644 tags/java-stable-20060304/sdo/tools/src/test/java/com/example/simple/impl/SimplePackageImpl.java delete mode 100644 tags/java-stable-20060304/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTest.java delete mode 100644 tags/java-stable-20060304/sdo/tools/src/test/resources/enum.xsd delete mode 100644 tags/java-stable-20060304/sdo/tools/src/test/resources/simple.xsd delete mode 100644 tags/java-stable-20060304/spec/pom.xml delete mode 100644 tags/java-stable-20060304/spec/sca/LICENSE.txt delete mode 100644 tags/java-stable-20060304/spec/sca/pom.xml delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/CurrentModuleContext.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ModuleContext.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/NoRegisteredCallbackException.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/RequestContext.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/SCA.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceReference.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceRuntimeException.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceUnavailableException.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/SessionEndedException.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/Version.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/AllowsPassByReference.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Callback.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/ComponentMetaData.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/ComponentName.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Context.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Destroy.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Init.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Property.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Reference.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Remotable.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Scope.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Service.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Session.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/SessionID.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/resources/META-INF/MANIFEST.MF delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-binding-sca.xsd delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-binding-webservice.xsd delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-core.xsd delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-implementation-java.xsd delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-interface-java.xsd delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-interface-wsdl.xsd delete mode 100644 tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca.xsd delete mode 100644 tags/java-stable-20060304/spec/sca/src/test/java/org/osoa/sca/annotations/CallbackTestCase.java delete mode 100644 tags/java-stable-20060304/spec/sca/src/test/java/org/osoa/sca/annotations/usage/CallbackType.java delete mode 100644 tags/java-stable-20060304/spec/sdo/LICENSE.txt delete mode 100644 tags/java-stable-20060304/spec/sdo/pom.xml delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/ChangeSummary.java delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/DataGraph.java delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/DataObject.java delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/Property.java delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/Sequence.java delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/Type.java delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/CopyHelper.java delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/DataFactory.java delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/DataHelper.java delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/EqualityHelper.java delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/TypeHelper.java delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/XMLDocument.java delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/XMLHelper.java delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/XSDHelper.java delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/impl/ExternalizableDelegator.java delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/impl/HelperProvider.java delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/impl/NoHelperProviderException.java delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/resources/META-INF/MANIFEST.MF delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/resources/xml/datagraph.xsd delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoJava.xml delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoJava.xsd delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoModel.xml delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoModel.xsd delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoXML.xml delete mode 100644 tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoXML.xsd delete mode 100644 tags/java-stable-20060304/spec/sdo/src/test/java/commonj/sdo/impl/HelperProviderTestCase.java delete mode 100644 tags/java-stable-20060304/spec/sdo/src/test/java/test/DefaultHelperProvider.java delete mode 100644 tags/java-stable-20060304/spec/sdo/src/test/java/test/TCCL1HelperProvider.java delete mode 100644 tags/java-stable-20060304/spec/sdo/src/test/resources/default/META-INF/services/commonj.sdo.impl.HelperProvider delete mode 100644 tags/java-stable-20060304/spec/sdo/src/test/resources/tccl1/META-INF/services/commonj.sdo.impl.HelperProvider delete mode 100644 tags/java-stable-20060304/testing/tomcat/axis2.xml delete mode 100644 tags/java-stable-20060304/testing/tomcat/bigbank/.classpath delete mode 100644 tags/java-stable-20060304/testing/tomcat/bigbank/.project delete mode 100644 tags/java-stable-20060304/testing/tomcat/bigbank/src/test/java/org/apache/tuscany/samples/bigbank/TestBigBankTestCase.java delete mode 100644 tags/java-stable-20060304/testing/tomcat/build.xml delete mode 100644 tags/java-stable-20060304/testing/tomcat/context.xsl delete mode 100644 tags/java-stable-20060304/testing/tomcat/helloworldaxis/.classpath delete mode 100644 tags/java-stable-20060304/testing/tomcat/helloworldaxis/.project delete mode 100644 tags/java-stable-20060304/testing/tomcat/helloworldaxis/src/test/java/org/apache/tuscany/samples/helloworldaxis/TestHelloWorldAxisTestCase.java delete mode 100644 tags/java-stable-20060304/testing/tomcat/helloworldweb/.classpath delete mode 100644 tags/java-stable-20060304/testing/tomcat/helloworldweb/.project delete mode 100644 tags/java-stable-20060304/testing/tomcat/helloworldweb/pom.xml delete mode 100644 tags/java-stable-20060304/testing/tomcat/helloworldweb/src/test/java/org/apache/tuscany/samples/helloworldweb/TestHelloWorldWebTestCase.java delete mode 100644 tags/java-stable-20060304/testing/tomcat/helloworldwebdas/src/test/java/org/apache/tuscany/samples/helloworldwebdas/TestHelloWorldWebDasTestCase.java delete mode 100644 tags/java-stable-20060304/testing/tomcat/helloworldws/pom.xml delete mode 100644 tags/java-stable-20060304/testing/tomcat/helloworldws/src/test/java/org/apache/tuscany/samples/helloworldws/TestHelloWorldWSTestCase.java delete mode 100644 tags/java-stable-20060304/testing/tomcat/pom.xml delete mode 100644 tags/java-stable-20060304/testing/tomcat/server.xml delete mode 100644 tags/java-stable-20060304/testing/tomcat/server.xsl (limited to 'tags') diff --git a/tags/java-stable-20060304/BUILDING.txt b/tags/java-stable-20060304/BUILDING.txt deleted file mode 100644 index ef2368d05d..0000000000 --- a/tags/java-stable-20060304/BUILDING.txt +++ /dev/null @@ -1,41 +0,0 @@ -Building tuscany/java -===================== - -Initial setup -------------- - -0) Install J2SE 5.0 SDK (1.5.2_02 works) - -1) Install Maven: - -Download maven 2.0.2 (download from http://maven.apache.org/download.html). -Set the env variable MAVEN_HOME to point at your maven installation. -Add $MAVEN_HOME/bin to your path. - -2) Install required Sun jars that can't be re-hosted by maven repos: - -You need to download the following from Sun directly: - - jaf-1_0_2-upd2.zip - url: http://java.sun.com/products/javabeans/glasgow/jaf.html - jar: activation.jar - - javamail-1_3_3_01.zip (actual requirement is for 1.3.2, but 1.3.3 works) - url: http://java.sun.com/products/javamail/downloads/index.html - jar: mail.jar - -Use the following mvn command-lines to install these into your repo: - -mvn install:install-file -Dfile=activation.jar -DgroupId=javax.activation --DartifactId=activation -Dversion=1.0.2 -Dpackaging=jar -mvn install:install-file -Dfile=mail.jar -DgroupId=javax.mail --DartifactId=mail -Dversion=1.3.2 -Dpackaging=jar - -The -Dfile property wants the full path to each jar. - - -Building --------- - -1) cd tuscany/java -2) mvn diff --git a/tags/java-stable-20060304/LICENSE.txt b/tags/java-stable-20060304/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/tags/java-stable-20060304/LICENSE.txt +++ /dev/null @@ -1,202 +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/tags/java-stable-20060304/das/pom.xml b/tags/java-stable-20060304/das/pom.xml deleted file mode 100644 index c7bacfe142..0000000000 --- a/tags/java-stable-20060304/das/pom.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - org.apache.tuscany - tuscany-project - SNAPSHOT - - 4.0.0 - org.apache.tuscany.das - tuscany-das - pom - Tuscany DAS - SNAPSHOT - - - rdb - - - diff --git a/tags/java-stable-20060304/das/rdb/LICENSE.txt b/tags/java-stable-20060304/das/rdb/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/tags/java-stable-20060304/das/rdb/LICENSE.txt +++ /dev/null @@ -1,202 +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/tags/java-stable-20060304/das/rdb/pom.xml b/tags/java-stable-20060304/das/rdb/pom.xml deleted file mode 100644 index 6cbd9b1163..0000000000 --- a/tags/java-stable-20060304/das/rdb/pom.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - org.apache.tuscany.das - tuscany-das - SNAPSHOT - - 4.0.0 - tuscany-das-rdb - Tuscany DAS for Relational Databases - SNAPSHOT - - - - commonj - sdo-api - SNAPSHOT - compile - - - - org.apache.tuscany - tuscany-sdo-impl - SNAPSHOT - compile - - - - - junit - junit - 3.8.1 - test - - - org.apache.derby - derby - 10.1.2.1 - test - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - src/main/resources/META-INF/MANIFEST.MF - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*AllTestsDerby.java - - - - - - diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/ApplyChangesCommand.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/ApplyChangesCommand.java deleted file mode 100644 index 0c53492d15..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/ApplyChangesCommand.java +++ /dev/null @@ -1,186 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb; - -import java.io.IOException; -import java.io.InputStream; -import java.sql.Connection; - -import commonj.sdo.DataObject; -import commonj.sdo.Type; - -/** - * An ApplyChangesCommand is used to flush the changes associated with a - * modified graph of DataObjects to a database. - * - * - */ -public interface ApplyChangesCommand { - - /** - * Adds a user-provided update command. In the absence of a user-provided - * command, the DAS will generate one. However this alternative may make - * sense if the user requires a SQL statement different from what the DAS - * generates. - * - * @param type - * The DataObject type this command applys to - * @param cmd - * The Command used to UPDATE data objects of the specified type - */ - public void addUpdateCommand(Type type, Command cmd); - - /** - * Adds a user-provided create command. In the absence of a user-provided - * command, the DAS will generate one. However this alternative may make - * sense if the user requires a SQL statement different from what the DAS - * generates. - * - * @param type - * The DataObject type this command applys to - * @param cmd - * The Command used to INSERT data objects of the specified type - */ - public void addCreateCommand(Type type, Command cmd); - - /** - * Adds a user-provided delete command. In the absence of a user-provided - * command, the DAS will generate one. However this alternative may make - * sense if the user requires a SQL statement different from what the DAS - * generates. - * - * @param type - * The DataObject type this command applys to - * @param cmd - * The Command used to DELETE data objects of the specified type - */ - public void addDeleteCommand(Type type, Command cmd); - - /** - * The change history is scanned and modifications to the graph of data - * objects are flushed to the database. - * - * @param root - * the topmost containing data object - */ - public void execute(DataObject root); - - /** - * TODO - Need to remove this. COnfig now set via factory method - */ - public void setMapping(InputStream mappingModel) throws IOException; - - /** - * Provides the java.sql.Connection to be used for this executing this - * command. - * - * @param connection - * the java.sql.Connection - */ - public void setConnection(Connection connection); - - /** - * Provides the java.sql.Connection to be used for this executing this - * command. - * - * @param connection - * the java.sql.Connection - * @param manageTransactions - * true if the DAS should perform tx - * commit/rollback - */ - public void setConnection(Connection connection, boolean manageTransactions); - - /** - * Add relationship metadata necessary for processing query results. This is - * an alternative to providing the same information in a config file. - * - * @param parent - * a name identifying the relationship parent key (example: - * "CUSTOMER.ID") - * @param child - * a name identifying the relationship child key - * ("ORDER.CUSTOMER_ID") - */ - public void addRelationship(String parent, String child); - - /** - * Add relationship metadata necessary for processing query results. This is - * an alternative to providing the same information in a config file. - * - * @param parentKey - * the parent key for the relationship - * @param childKey - * the child key in the relationship - * @see Key - */ - public void addRelationship(Key parentKey, Key childKey); - - /** - * Add primary key metadata. This is an alternative to providing the same - * information in a config file. - * - * @param pk - * the string identifying a prmary key. (Example: "CUSTOMER.ID") - */ - public void addPrimaryKey(String columnName); - - /** - * Add primary key metadata. This is an alternative to providing the same - * information in a config file. - * - * @param key - * the primary key - * @see Key - */ - public void addPrimaryKey(Key key); - - /** - * Adds a column to be used in a optimistic concurrency control (OCC) - * strategy. The generated UPDATE statement will include a overqualified - * where clause using this column - * - * @param columnName - * the name of the column to be used for OCC - */ - public void addCollisionColumn(String columnName); - - /** - * Add metadata that indicate a column is a generated primary key. - * - * @param string - * the name of the generated primary key column. Example - * ("COMPANY.ID") - */ - public void addGeneratedPrimaryKey(String columnName); - - /** - * Associate a {@link Converter} with a column to be used by this command. - * This is an alternative to providing the same information in a config - * file. - * - * @param name - * the name of the column being assigned a converter (example: - * "CUSTOMER.LASTNAME") - * @param converterName - * the name of the converter instance being assigned (example: - * org.company.project.StringConverter) - * @see Converter - **/ - public void addConverter(String name, String converterName); - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Command.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Command.java deleted file mode 100644 index 0f5534f705..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Command.java +++ /dev/null @@ -1,283 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb; - -import java.sql.Connection; - -import org.apache.tuscany.das.rdb.impl.CommandFactoryImpl; - -import commonj.sdo.DataObject; -import commonj.sdo.Type; - -/** - * A Command is used to execute a read or write to a database - * - * - */ -public interface Command { - - public static CommandFactory FACTORY = new CommandFactoryImpl(); - - /** - * Performs the function defined by the command - */ - public void execute(); - - /** - * Performs the function defined by the command and return the results in - * the root DataObject - * - * @return the root DataObject - */ - public DataObject executeQuery(); - - /** - * Returns the parameter associated with "name" - * - * @param name - * the name of the parameter - * @return the associated parameter - */ - public Parameter getParameter(String name); - - /** - * Returns the Parameter at index - * - * @param index - * the index of the Parameter - * @return the associated Parameter - */ - public Parameter getParameter(int index); - - /** - * Sets the value of the named Parameter - * - * @param name - * the name of this Parameter - * @param value - * the value for the Parameter - */ - public void setParameterValue(String name, Object value); - - /** - * Sets the value of the associated Parameter - * - * @param index - * the index of the Parameter - * @param value - * the value for the Parameter - */ - public void setParameterValue(int index, Object value); - - /** - * Sets the "type" of the associated Parameter - * - * @param name - * the name of this Parameter - * @param type - * the SDODataTypes-defined "type" for the Parameter. - */ - public void setParameterType(String string, Type dataType); - - /** - * Sets the "type" of the associated Parameter - * - * @param index - * the index of the Parameter - * @param type - * the SDODataTypes-defined "type" for the Parameter. - */ - public void setParameterType(int index, Type dataType); - - /** - * Returns the value of the associated Parameter - * - * @param name - * the name of the Parameter - * @return the value of the Parameter - */ - public Object getParameterValue(String name); - - /** - * Returns the value of the associated Parameter - * - * @param index - * the index of the Parameter - * @return the value of the Parameter - */ - public Object getParameterValue(int index); - - /** - * Adds a Parameter to the command - * - * @param index - * the index of the parameter - * @param sdoType - * the commonj.sdo.Type of the Parameter - */ - public void addParameter(int index, Type sdoType); - - /** - * Adds a Parameter to the command - * - * @param name - * the index of the parameter - * @param sdoType - * the commonj.sdo.Type of the Parameter - */ - public void addParameter(String name, Type sdoType); - - /** - * Adds a Parameter to the command - * - * @param index - * the index of the parameter - * @param direction - * the direction of the Parameter. Either Parameter.IN, - * Parameter.OUT or Parameter.INOUT - * @param sdoType - * specifies the type as a commonj.sdo.Type from - * {@link SDODataTypes} - */ - public void addParameter(int index, int direction, Type sdoType); - - /** - * Adds a Parameter to the command - * - * @param name - * the name associated with the Parameter - * @param direction - * the direction of the Parameter. Either Parameter.IN, - * Parameter.OUT or Parameter.INOUT - * @param sdoType - * specifies the type as a commonj.sdo.Type from - * {@link SDODataTypes} - */ - public void addParameter(String name, int direction, Type sdoType); - - /** - * Specifies an object model for a graph of DataObjects returned by - * #executeQuery() - * - * @param schema - * the model as a commonj.sdo.Type - */ - public void setDataObjectModel(Type schema); - - /** - * Defines the structure of the ResultSet returned by the JDBC Driver when - * this command is executed. If the shape is not specified then the shape is - * taken from the ResultSetMetatadta instance provided by the JDBC Driver. - *

- * This method is prvided primarily to support platforms (such as Oracle) - * that do not provide complete support for ResultSetMetadata - * - * @param shape - * the specified result set shape - * @see ResultSetShape - */ - public void setResultSetShape(ResultSetShape shape); - - /** - * Provides the java.sql.Connection to be used for this executing this - * command. - * - * @param connection - * the java.sql.Connection - */ - public void setConnection(Connection connection); - - /** - * Provides the java.sql.Connection to be used for this executing this - * command. - * - * @param connection - * the java.sql.Connection - * @param manageTransactions - * true if the DAS should perform tx - * commit/rollback - */ - public void setConnection(Connection connection, boolean manageTransactions); - - /** - * Add relationship metadata necessary for processing query results. This is - * an alternative to providing the same information in a config file. - * - * @param parent - * a name identifying the relationship parent key (example: - * "CUSTOMER.ID") - * @param child - * a name identifying the relationship child key - * ("ORDER.CUSTOMER_ID") - */ - public void addRelationship(String parent, String child); - - /** - * Add relationship metadata necessary for processing query results. This is - * an alternative to providing the same information in a config file. - * - * @param parentKey - * the parent key for the relationship - * @param childKey - * the child key in the relationship - * @see Key - */ - public void addRelationship(Key parentKey, Key childKey); - - /** - * Add primary key metadata. This is an alternative to providing the same - * information in a config file. - * - * @param pk - * the string identifying a prmary key. (Example: "CUSTOMER.ID") - */ - public void addPrimaryKey(String pk); - - /** - * Add primary key metadata. This is an alternative to providing the same - * information in a config file. - * - * @param key - * the primary key - * @see Key - */ - public void addPrimaryKey(Key key); - - /** - * Associate a {@link Converter} with a column to be used by this command. - * This is an alternative to providing the same information in a config - * file. - * - * @param name - * the name of the column being assigned a converter (example: - * "CUSTOMER.LASTNAME") - * @param converterName - * the name of the converter instance being assigned (example: - * org.company.project.StringConverter) - * @see Converter - */ - public void addConverter(String name, String converterName); - - /** - * Cleans up and realeases all resources associated with this command. This - * should be called when the application is done with this command. - */ - public void close(); - - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandFactory.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandFactory.java deleted file mode 100644 index c68855ec2a..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandFactory.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb; - -import java.io.IOException; -import java.io.InputStream; - -/** - * A CommandFactory produces {@link Command} and {@link ApplyChangesCommand} - * instances. - * - * - */ -public interface CommandFactory { - - /** - * Creates a Command based on the provided SQL statement - * - * @param sql - * The SQL statement - * @return returns a Command instance - */ - public Command createCommand(String sql); - - /** - * Creates a Command based on the provided SQL statement and configuration - * - * @param sql - * The SQL statement - * @param mappingModel - * The congiguration as XML file stream - * @return returns a COmmand instance - */ - public Command createCommand(String sql, InputStream mappingModel); - - /** - * Creates an {@linkApplyChangesCommand} instance - * @return Returns the ApplyChangesCommand instance - */ - public ApplyChangesCommand createApplyChangesCommand(); - - /** - * Creates an {@linkApplyChangesCommand} instance with the provided configuration - * @param mappingModel The provided configuration as a stream over an xml file - * @return Returns an ApplyChangesCOmmand in stance - * @throws IOException - * TODO - Either remove this throws clause or add it to createCommand - */ - public ApplyChangesCommand createApplyChangesCommand( - InputStream mappingModel) throws IOException; - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandGroup.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandGroup.java deleted file mode 100644 index 5a39e0d390..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandGroup.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb; - -import java.sql.Connection; - -import org.apache.tuscany.das.rdb.impl.CommandGroupFactoryImpl; - -/** - * A CommandGroup represents a set of {@link Command} and single - * {@link ApplyChangesCommand} that are created from a common config file. - * - * - */ -public interface CommandGroup { - - public static CommandGroupFactory FACTORY = new CommandGroupFactoryImpl(); - - /** - * Return the ApplyChangesCommnad for this configured factory - * - * @return Returns an instance of ApplyChangesCommand - */ - public ApplyChangesCommand getApplyChangesCommand(); - - /** - * Gets the named command from this factory's inventory - * - * @param name - * The identifying name of the requested command - * @return Returns the identified command - */ - public Command getCommand(String name); - - /** - * Set the default connection for all command in the group - * - * @param connection - */ - public void setConnection(Connection connection); - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandGroupFactory.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandGroupFactory.java deleted file mode 100644 index dfcdd81823..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/CommandGroupFactory.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb; - -import java.io.InputStream; - -/** - * A CommandGroupFactory produces {@link CommandGroup} instances. - * - * - */ -public interface CommandGroupFactory { - - /** - * Creates a CommandGroup based on the provided config file stream - * - * @param configStream - * A stream over a DAS config file - * @return returns a CommandGroup instance - */ - public CommandGroup createCommandGroup(InputStream configStream); - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Converter.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Converter.java deleted file mode 100644 index 8110d2c5a5..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Converter.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb; - -/** - * A lightweight Tabele-column <--> DataObject-property converter framework. - * Converters allow a user to insert a transformation between a column value and - * is destination DataObject property value. For example, by default, a VARCHAR - * column will be represented as a String in its corresponding DataObject - * property. A user could insert a converter that transforms the the VARCHAR - * value to an Integer. If this is done then although the column returns - * character data, the DataObject property will be an Integer - * - * - */ -public interface Converter { - - /** - * Transform the columnData object to a new value and possibly new type. - * This should be the invers operation of #getColumnValue - * - * @param columnData - * The column value to transorm - * @return Returns the transformed value - */ - public Object getPropertyValue(Object columnData); - - /** - * Transform the columnData object to a new value and possibly new type. - * This should be the invers operation of #getPropertyValue - * - * @param propertyData - * The property value to transform - * @return Returns the transformed value - */ - public Object getColumnValue(Object propertyData); - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Key.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Key.java deleted file mode 100644 index 4622b2a8fb..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/Key.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb; - -import java.util.ArrayList; -import java.util.List; - -/** - * A key instance is used to describe a Table key definition. This is used - * primarily for compound keys since simple keys are described with a name. - * - * - */public class Key { - - private List columnNames = new ArrayList(); - - /** - * Contructor for a single column key - * @param columnName The single column fo rthe key - */ - public Key(String columnName) { - super(); - this.columnNames.add(columnName); - } - - /** - * Constructor for a compound key - * @param columns The array of column names that compose the key - */ - public Key(String[] columns) { - for (int i=0;i - * Explicit definition of type is required only for OUT parameters of stored - * procedures commands - * - * @param type - */ - public void setType(Type type); - - /** - * Set the index of the parameter. For example, if a SQL statement requires - * two parameters, the first one has an index of one. - * - * @param index - * The index of the parameter - */ - public void setIndex(int index); - - /** - * Sets the name of the parameter - * - * @param name - * the parameter name - */ - public void setName(String name); - - /** - * Sets the value of the parameter. All IN and IN_OUT parameters must be set - * beore a command can be executed. - * - * @param value - * The value for the parameter - */ - public void setValue(Object value); - - /** - * Parameters are typically IN and this is the default. A parameter's - * direction must be set when the parameter is OUT or IN_OUT. - * - * @param direction - * the parameters direction - */ - public void setDirection(int direction); - - /** - * TODO Not sure this method is needed. - * @param converter - */ - public void setConverter(Converter converter); - - /** - * @return the type of the paramater in terms of {@link SDODataTypes} - */ - public Type getType(); - - /** - * TODO Not sure this is is needed. - * @return - */ - public Converter getConverter(); - - /** - * @return the index of the parameter - */ - public int getIndex(); - - /** - * @return the name of the parameter - */ - public String getName(); - - /** - * @return the value of the parameter - */ - public Object getValue(); - - /** - * @return the direction of the parameter - */ - public int getDirection(); - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/ResultSetShape.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/ResultSetShape.java deleted file mode 100644 index 52d4487963..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/ResultSetShape.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb; - -import java.sql.ResultSetMetaData; -import java.sql.SQLException; - -import org.apache.tuscany.das.rdb.graphbuilder.impl.DefaultConverter; -import org.apache.tuscany.das.rdb.graphbuilder.schema.ResultSetTypeMap; - -import commonj.sdo.Type; - -/** - * Describes the structure of the result set returned from execution - * of a SELECT statement. This description is typcially not required since the - * shape can be retreived from the JDBC ResultSetMetadata. However, some platforms - * such as Oracle do not support fully suport ResultSetMedata. - *

- * There may also be a performance boost when using this interface. - * - * TODO - This is very preliminary. We need to go over this again and consider making is as close as possible to - * to the infromation returned from ResultSetMetadata. For example, we may want to use JDBC types - * here rather than SDODataTypes. Also, ResultSetMetadata doe not provide converters, so, maybe this - * interface should also not. - * - * - */ -public class ResultSetShape { - - private final String[] columns; - private final String[] tables; - private final Type[] types; - //TODO - Are converters really needed here? - private Converter[] converters; - - public ResultSetShape(String[] t, String[] c, Type[] dataTypes) { - this.columns = c; - this.tables = t; - this.types = dataTypes; - this.converters = new DefaultConverter[c.length]; - } - - public ResultSetShape(ResultSetMetaData metadata) throws SQLException { - columns = new String[metadata.getColumnCount()]; - tables = new String[metadata.getColumnCount()]; - types = new Type[metadata.getColumnCount()]; - converters = new DefaultConverter[metadata.getColumnCount()]; - - ResultSetTypeMap typeMap = ResultSetTypeMap.instance; - for (int i = 1; i <= metadata.getColumnCount(); i++) { - tables[i-1] = metadata.getTableName(i); - columns[i-1] = metadata.getColumnName(i); - types[i-1] = typeMap.getType(metadata.getColumnType(i), true); - } - } - - public int getColumnCount() { - return columns.length; - } - - public String getTableName(int i) { - return tables[i-1]; - } - - public String getColumnName(int i) { - return columns[i-1]; - } - - public Type getColumnType(int i) { - return types[i-1]; - } - - public void setConverter(int i, Converter converter) { - this.converters[i] = converter; - } - - public Converter getConverter(int i) { - return this.converters[i-1]; - } - - public void setConverterFactory(Converter converter) { - for ( int i=0; i < getColumnCount(); i++ ) { - this.converters[i] = converter; - } - - } - - public String toString() { - StringBuffer result = new StringBuffer(); - result.append(" column/table/type: "); - for (int i=0; i < columns.length; i++) { - result.append(columns[i]); - result.append('\t'); - result.append(tables[i]); - result.append('\t'); - if ( types[i] == null ) - result.append("null"); - else - result.append(types[i].getName()); - result.append('\t'); - result.append(converters[i]); - result.append('\n'); - } - - return result.toString(); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/SDODataTypes.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/SDODataTypes.java deleted file mode 100644 index 65184c88cb..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/SDODataTypes.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb; - -import commonj.sdo.Type; -import commonj.sdo.helper.TypeHelper; - -/** - * Defines SDO data types. This is used primalirly to type stored procedure OUT parameters. - * - * TODO - This maybe be obviated by the move to SDO2. We also need to settle the question - * of whether config information is in terms of database or data object types - * - * - */public class SDODataTypes { - - static TypeHelper helper = TypeHelper.INSTANCE; - - final public static Type BOOLEAN = helper.getType("commonj.sdo", "Boolean"); - final public static Type BYTE = helper.getType("commonj.sdo", "Byte"); - final public static Type BYTES = helper.getType("commonj.sdo", "ByteArray"); - final public static Type CHARACTER = helper.getType("commonj.sdo", "Char"); - final public static Type DATE = helper.getType("commonj.sdo", "Date"); - final public static Type DATETIME = helper.getType("commonj.sdo", "Date"); - final public static Type DAY = helper.getType("commonj.sdo", "Date"); - final public static Type DECIMAL = helper.getType("commonj.sdo", "Float"); - final public static Type DOUBLE =helper.getType("commonj.sdo", "Double"); - final public static Type DURATION = helper.getType("commonj.sdo", "Date"); - final public static Type FLOAT = helper.getType("commonj.sdo", "Float"); - final public static Type INT = helper.getType("commonj.sdo", "Int"); - final public static Type INTEGER = helper.getType("commonj.sdo", "Integer"); - final public static Type LONG = helper.getType("commonj.sdo", "Long"); - final public static Type MONTH = helper.getType("commonj.sdo", "Date"); - final public static Type MONTHDAY = helper.getType("commonj.sdo", "Date"); - final public static Type OBJECT = helper.getType("commonj.sdo", "Object"); - final public static Type SHORT = helper.getType("commonj.sdo", "Short"); - final public static Type STRING = helper.getType("commonj.sdo", "String"); - final public static Type STRINGS = helper.getType("commonj.sdo", "String"); - final public static Type TIME = helper.getType("commonj.sdo", "Date"); - final public static Type URI = helper.getType("commonj.sdo", "String"); - final public static Type YEAR = helper.getType("commonj.sdo", "Date"); - final public static Type YEARMONTH = helper.getType("commonj.sdo", "Date"); - final public static Type YEARMONTHDAY = helper.getType("commonj.sdo", "Date"); - final public static Type BOOLEANOBJECT = helper.getType("commonj.sdo", "BooleanObject"); - final public static Type BYTEOBJECT = helper.getType("commonj.sdo", "ByteObject"); - final public static Type CHARACTEROBJECT = helper.getType("commonj.sdo", "CharacterObject"); - final public static Type DOUBLEOBJECT = helper.getType("commonj.sdo", "DoubleObject"); - final public static Type FLOATOBJECT = helper.getType("commonj.sdo", "FloatObject"); - final public static Type INTEGEROBJECT = helper.getType("commonj.sdo", "IntObject"); - final public static Type LONGOBJECT = helper.getType("commonj.sdo", "LongObject"); - final public static Type SHORTOBJECT = helper.getType("commonj.sdo", "ShortObject"); - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Column.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Column.java deleted file mode 100644 index e004726fbe..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Column.java +++ /dev/null @@ -1,306 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config; - - -/** - * - * A representation of the model object 'Column'. - * - * - *

- * The following features are supported: - *

- *

- * - * @generated - */ -public interface Column -{ - /** - * Returns the value of the 'Collision' attribute. - * - *

- * If the meaning of the 'Collision' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Collision' attribute. - * @see #isSetCollision() - * @see #unsetCollision() - * @see #setCollision(boolean) - * @generated - */ - boolean isCollision(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#isCollision Collision}' attribute. - * - * - * @param value the new value of the 'Collision' attribute. - * @see #isSetCollision() - * @see #unsetCollision() - * @see #isCollision() - * @generated - */ - void setCollision(boolean value); - - /** - * Unsets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#isCollision Collision}' attribute. - * - * - * @see #isSetCollision() - * @see #isCollision() - * @see #setCollision(boolean) - * @generated - */ - void unsetCollision(); - - /** - * Returns whether the value of the '{@link org.apache.tuscany.das.rdb.config.Column#isCollision Collision}' attribute is set. - * - * - * @return whether the value of the 'Collision' attribute is set. - * @see #unsetCollision() - * @see #isCollision() - * @see #setCollision(boolean) - * @generated - */ - boolean isSetCollision(); - - /** - * Returns the value of the 'Column Type' attribute. - * - *

- * If the meaning of the 'Column Type' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Column Type' attribute. - * @see #setColumnType(String) - * @generated - */ - String getColumnType(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#getColumnType Column Type}' attribute. - * - * - * @param value the new value of the 'Column Type' attribute. - * @see #getColumnType() - * @generated - */ - void setColumnType(String value); - - /** - * Returns the value of the 'Converter Class Name' attribute. - * - *

- * If the meaning of the 'Converter Class Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Converter Class Name' attribute. - * @see #setConverterClassName(String) - * @generated - */ - String getConverterClassName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#getConverterClassName Converter Class Name}' attribute. - * - * - * @param value the new value of the 'Converter Class Name' attribute. - * @see #getConverterClassName() - * @generated - */ - void setConverterClassName(String value); - - /** - * Returns the value of the 'Generated' attribute. - * - *

- * If the meaning of the 'Generated' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Generated' attribute. - * @see #isSetGenerated() - * @see #unsetGenerated() - * @see #setGenerated(boolean) - * @generated - */ - boolean isGenerated(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#isGenerated Generated}' attribute. - * - * - * @param value the new value of the 'Generated' attribute. - * @see #isSetGenerated() - * @see #unsetGenerated() - * @see #isGenerated() - * @generated - */ - void setGenerated(boolean value); - - /** - * Unsets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#isGenerated Generated}' attribute. - * - * - * @see #isSetGenerated() - * @see #isGenerated() - * @see #setGenerated(boolean) - * @generated - */ - void unsetGenerated(); - - /** - * Returns whether the value of the '{@link org.apache.tuscany.das.rdb.config.Column#isGenerated Generated}' attribute is set. - * - * - * @return whether the value of the 'Generated' attribute is set. - * @see #unsetGenerated() - * @see #isGenerated() - * @see #setGenerated(boolean) - * @generated - */ - boolean isSetGenerated(); - - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'Primary Key' attribute. - * - *

- * If the meaning of the 'Primary Key' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Primary Key' attribute. - * @see #isSetPrimaryKey() - * @see #unsetPrimaryKey() - * @see #setPrimaryKey(boolean) - * @generated - */ - boolean isPrimaryKey(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#isPrimaryKey Primary Key}' attribute. - * - * - * @param value the new value of the 'Primary Key' attribute. - * @see #isSetPrimaryKey() - * @see #unsetPrimaryKey() - * @see #isPrimaryKey() - * @generated - */ - void setPrimaryKey(boolean value); - - /** - * Unsets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#isPrimaryKey Primary Key}' attribute. - * - * - * @see #isSetPrimaryKey() - * @see #isPrimaryKey() - * @see #setPrimaryKey(boolean) - * @generated - */ - void unsetPrimaryKey(); - - /** - * Returns whether the value of the '{@link org.apache.tuscany.das.rdb.config.Column#isPrimaryKey Primary Key}' attribute is set. - * - * - * @return whether the value of the 'Primary Key' attribute is set. - * @see #unsetPrimaryKey() - * @see #isPrimaryKey() - * @see #setPrimaryKey(boolean) - * @generated - */ - boolean isSetPrimaryKey(); - - /** - * Returns the value of the 'Property Name' attribute. - * - *

- * If the meaning of the 'Property Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Property Name' attribute. - * @see #setPropertyName(String) - * @generated - */ - String getPropertyName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#getPropertyName Property Name}' attribute. - * - * - * @param value the new value of the 'Property Name' attribute. - * @see #getPropertyName() - * @generated - */ - void setPropertyName(String value); - - /** - * Returns the value of the 'Table' attribute. - * - *

- * If the meaning of the 'Table' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Table' attribute. - * @see #setTable(String) - * @generated - */ - String getTable(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Column#getTable Table}' attribute. - * - * - * @param value the new value of the 'Table' attribute. - * @see #getTable() - * @generated - */ - void setTable(String value); - -} // Column diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Command.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Command.java deleted file mode 100644 index 3bce9e601e..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Command.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config; - -import java.util.List; - -/** - * - * A representation of the model object 'Command'. - * - * - *

- * The following features are supported: - *

- *

- * - * @generated - */ -public interface Command -{ - /** - * Returns the value of the 'Parameter' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.config.Parameter}. - * - *

- * If the meaning of the 'Parameter' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Parameter' containment reference list. - * @generated - */ - List getParameter(); - - /** - * Returns the value of the 'Result Descriptor' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.config.ResultDescriptor}. - * - *

- * If the meaning of the 'Result Descriptor' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Result Descriptor' containment reference list. - * @generated - */ - List getResultDescriptor(); - - /** - * Returns the value of the 'Config' attribute. - * - *

- * If the meaning of the 'Config' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Config' attribute. - * @see #setConfig(String) - * @generated - */ - String getConfig(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Command#getConfig Config}' attribute. - * - * - * @param value the new value of the 'Config' attribute. - * @see #getConfig() - * @generated - */ - void setConfig(String value); - - /** - * Returns the value of the 'Kind' attribute. - * - *

- * If the meaning of the 'Kind' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Kind' attribute. - * @see #setKind(String) - * @generated - */ - String getKind(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Command#getKind Kind}' attribute. - * - * - * @param value the new value of the 'Kind' attribute. - * @see #getKind() - * @generated - */ - void setKind(String value); - - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Command#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'SQL' attribute. - * - *

- * If the meaning of the 'SQL' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'SQL' attribute. - * @see #setSQL(String) - * @generated - */ - String getSQL(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Command#getSQL SQL}' attribute. - * - * - * @param value the new value of the 'SQL' attribute. - * @see #getSQL() - * @generated - */ - void setSQL(String value); - -} // Command diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Config.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Config.java deleted file mode 100644 index c00d946dac..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Config.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config; - -import java.util.List; - -/** - * - * A representation of the model object 'Config'. - * - * - *

- * The following features are supported: - *

- *

- * - * @generated - */ -public interface Config -{ - /** - * Returns the value of the 'Command' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.config.Command}. - * - *

- * If the meaning of the 'Command' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Command' containment reference list. - * @generated - */ - List getCommand(); - - /** - * Returns the value of the 'Connection Properties' containment reference. - * - *

- * If the meaning of the 'Connection Properties' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Connection Properties' containment reference. - * @see #setConnectionProperties(ConnectionProperties) - * @generated - */ - ConnectionProperties getConnectionProperties(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Config#getConnectionProperties Connection Properties}' containment reference. - * - * - * @param value the new value of the 'Connection Properties' containment reference. - * @see #getConnectionProperties() - * @generated - */ - void setConnectionProperties(ConnectionProperties value); - - /** - * Returns the value of the 'Table' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.config.Table}. - * - *

- * If the meaning of the 'Table' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Table' containment reference list. - * @generated - */ - List getTable(); - - /** - * Returns the value of the 'Relationship' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.config.Relationship}. - * - *

- * If the meaning of the 'Relationship' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Relationship' containment reference list. - * @generated - */ - List getRelationship(); - - /** - * Returns the value of the 'Uri' attribute. - * - *

- * If the meaning of the 'Uri' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Uri' attribute. - * @see #setUri(String) - * @generated - */ - String getUri(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Config#getUri Uri}' attribute. - * - * - * @param value the new value of the 'Uri' attribute. - * @see #getUri() - * @generated - */ - void setUri(String value); - -} // Config diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ConfigFactory.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ConfigFactory.java deleted file mode 100644 index f3c25814ac..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ConfigFactory.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config; - - -/** - * - * The Factory for the model. - * It provides a create method for each non-abstract class of the model. - * - * @generated - */ -public interface ConfigFactory -{ - /** - * The singleton instance of the factory. - * - * - * @generated - */ - ConfigFactory INSTANCE = org.apache.tuscany.das.rdb.config.impl.ConfigFactoryImpl.eINSTANCE; - - /** - * Returns a new object of class 'Column'. - * - * - * @return a new object of class 'Column'. - * @generated - */ - Column createColumn(); - - /** - * Returns a new object of class 'Command'. - * - * - * @return a new object of class 'Command'. - * @generated - */ - Command createCommand(); - - /** - * Returns a new object of class 'Config'. - * - * - * @return a new object of class 'Config'. - * @generated - */ - Config createConfig(); - - /** - * Returns a new object of class 'Connection Properties'. - * - * - * @return a new object of class 'Connection Properties'. - * @generated - */ - ConnectionProperties createConnectionProperties(); - - /** - * Returns a new object of class 'Key Pair'. - * - * - * @return a new object of class 'Key Pair'. - * @generated - */ - KeyPair createKeyPair(); - - /** - * Returns a new object of class 'Parameter'. - * - * - * @return a new object of class 'Parameter'. - * @generated - */ - Parameter createParameter(); - - /** - * Returns a new object of class 'Relationship'. - * - * - * @return a new object of class 'Relationship'. - * @generated - */ - Relationship createRelationship(); - - /** - * Returns a new object of class 'Result Descriptor'. - * - * - * @return a new object of class 'Result Descriptor'. - * @generated - */ - ResultDescriptor createResultDescriptor(); - - /** - * Returns a new object of class 'Table'. - * - * - * @return a new object of class 'Table'. - * @generated - */ - Table createTable(); - -} //ConfigFactory diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ConnectionProperties.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ConnectionProperties.java deleted file mode 100644 index 4b4008b446..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ConnectionProperties.java +++ /dev/null @@ -1,175 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config; - - -/** - * - * A representation of the model object 'Connection Properties'. - * - * - *

- * The following features are supported: - *

- *

- * - * @generated - */ -public interface ConnectionProperties -{ - /** - * Returns the value of the 'Config' attribute. - * - *

- * If the meaning of the 'Config' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Config' attribute. - * @see #setConfig(String) - * @generated - */ - String getConfig(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getConfig Config}' attribute. - * - * - * @param value the new value of the 'Config' attribute. - * @see #getConfig() - * @generated - */ - void setConfig(String value); - - /** - * Returns the value of the 'Data Source' attribute. - * - *

- * If the meaning of the 'Data Source' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Data Source' attribute. - * @see #setDataSource(String) - * @generated - */ - String getDataSource(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDataSource Data Source}' attribute. - * - * - * @param value the new value of the 'Data Source' attribute. - * @see #getDataSource() - * @generated - */ - void setDataSource(String value); - - /** - * Returns the value of the 'Driver Class Name' attribute. - * - *

- * If the meaning of the 'Driver Class Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Driver Class Name' attribute. - * @see #setDriverClassName(String) - * @generated - */ - String getDriverClassName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverClassName Driver Class Name}' attribute. - * - * - * @param value the new value of the 'Driver Class Name' attribute. - * @see #getDriverClassName() - * @generated - */ - void setDriverClassName(String value); - - /** - * Returns the value of the 'Driver Password' attribute. - * - *

- * If the meaning of the 'Driver Password' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Driver Password' attribute. - * @see #setDriverPassword(String) - * @generated - */ - String getDriverPassword(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverPassword Driver Password}' attribute. - * - * - * @param value the new value of the 'Driver Password' attribute. - * @see #getDriverPassword() - * @generated - */ - void setDriverPassword(String value); - - /** - * Returns the value of the 'Driver URL' attribute. - * - *

- * If the meaning of the 'Driver URL' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Driver URL' attribute. - * @see #setDriverURL(String) - * @generated - */ - String getDriverURL(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverURL Driver URL}' attribute. - * - * - * @param value the new value of the 'Driver URL' attribute. - * @see #getDriverURL() - * @generated - */ - void setDriverURL(String value); - - /** - * Returns the value of the 'Driver User Name' attribute. - * - *

- * If the meaning of the 'Driver User Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Driver User Name' attribute. - * @see #setDriverUserName(String) - * @generated - */ - String getDriverUserName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverUserName Driver User Name}' attribute. - * - * - * @param value the new value of the 'Driver User Name' attribute. - * @see #getDriverUserName() - * @generated - */ - void setDriverUserName(String value); - -} // ConnectionProperties diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/KeyPair.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/KeyPair.java deleted file mode 100644 index 7a1759ee90..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/KeyPair.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config; - - -/** - * - * A representation of the model object 'Key Pair'. - * - * - *

- * The following features are supported: - *

- *

- * - * @generated - */ -public interface KeyPair -{ - /** - * Returns the value of the 'Foreign Key Column' attribute. - * - *

- * If the meaning of the 'Foreign Key Column' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Foreign Key Column' attribute. - * @see #setForeignKeyColumn(String) - * @generated - */ - String getForeignKeyColumn(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.KeyPair#getForeignKeyColumn Foreign Key Column}' attribute. - * - * - * @param value the new value of the 'Foreign Key Column' attribute. - * @see #getForeignKeyColumn() - * @generated - */ - void setForeignKeyColumn(String value); - - /** - * Returns the value of the 'Primary Key Column' attribute. - * - *

- * If the meaning of the 'Primary Key Column' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Primary Key Column' attribute. - * @see #setPrimaryKeyColumn(String) - * @generated - */ - String getPrimaryKeyColumn(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.KeyPair#getPrimaryKeyColumn Primary Key Column}' attribute. - * - * - * @param value the new value of the 'Primary Key Column' attribute. - * @see #getPrimaryKeyColumn() - * @generated - */ - void setPrimaryKeyColumn(String value); - - /** - * Returns the value of the 'Relationship' attribute. - * - *

- * If the meaning of the 'Relationship' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Relationship' attribute. - * @see #setRelationship(String) - * @generated - */ - String getRelationship(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.KeyPair#getRelationship Relationship}' attribute. - * - * - * @param value the new value of the 'Relationship' attribute. - * @see #getRelationship() - * @generated - */ - void setRelationship(String value); - -} // KeyPair diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Parameter.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Parameter.java deleted file mode 100644 index 63872a7afd..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Parameter.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config; - - -/** - * - * A representation of the model object 'Parameter'. - * - * - *

- * The following features are supported: - *

- *

- * - * @generated - */ -public interface Parameter -{ - /** - * Returns the value of the 'Column Type' attribute. - * - *

- * If the meaning of the 'Column Type' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Column Type' attribute. - * @see #setColumnType(String) - * @generated - */ - String getColumnType(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Parameter#getColumnType Column Type}' attribute. - * - * - * @param value the new value of the 'Column Type' attribute. - * @see #getColumnType() - * @generated - */ - void setColumnType(String value); - - /** - * Returns the value of the 'Command' attribute. - * - *

- * If the meaning of the 'Command' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Command' attribute. - * @see #setCommand(String) - * @generated - */ - String getCommand(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Parameter#getCommand Command}' attribute. - * - * - * @param value the new value of the 'Command' attribute. - * @see #getCommand() - * @generated - */ - void setCommand(String value); - - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Parameter#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - -} // Parameter diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Relationship.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Relationship.java deleted file mode 100644 index d63348ade1..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Relationship.java +++ /dev/null @@ -1,193 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config; - -import java.util.List; - -/** - * - * A representation of the model object 'Relationship'. - * - * - *

- * The following features are supported: - *

- *

- * - * @generated - */ -public interface Relationship -{ - /** - * Returns the value of the 'Key Pair' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.config.KeyPair}. - * - *

- * If the meaning of the 'Key Pair' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Key Pair' containment reference list. - * @generated - */ - List getKeyPair(); - - /** - * Returns the value of the 'Config' attribute. - * - *

- * If the meaning of the 'Config' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Config' attribute. - * @see #setConfig(String) - * @generated - */ - String getConfig(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Relationship#getConfig Config}' attribute. - * - * - * @param value the new value of the 'Config' attribute. - * @see #getConfig() - * @generated - */ - void setConfig(String value); - - /** - * Returns the value of the 'Foreign Key Table' attribute. - * - *

- * If the meaning of the 'Foreign Key Table' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Foreign Key Table' attribute. - * @see #setForeignKeyTable(String) - * @generated - */ - String getForeignKeyTable(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Relationship#getForeignKeyTable Foreign Key Table}' attribute. - * - * - * @param value the new value of the 'Foreign Key Table' attribute. - * @see #getForeignKeyTable() - * @generated - */ - void setForeignKeyTable(String value); - - /** - * Returns the value of the 'Many' attribute. - * - *

- * If the meaning of the 'Many' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Many' attribute. - * @see #isSetMany() - * @see #unsetMany() - * @see #setMany(boolean) - * @generated - */ - boolean isMany(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Relationship#isMany Many}' attribute. - * - * - * @param value the new value of the 'Many' attribute. - * @see #isSetMany() - * @see #unsetMany() - * @see #isMany() - * @generated - */ - void setMany(boolean value); - - /** - * Unsets the value of the '{@link org.apache.tuscany.das.rdb.config.Relationship#isMany Many}' attribute. - * - * - * @see #isSetMany() - * @see #isMany() - * @see #setMany(boolean) - * @generated - */ - void unsetMany(); - - /** - * Returns whether the value of the '{@link org.apache.tuscany.das.rdb.config.Relationship#isMany Many}' attribute is set. - * - * - * @return whether the value of the 'Many' attribute is set. - * @see #unsetMany() - * @see #isMany() - * @see #setMany(boolean) - * @generated - */ - boolean isSetMany(); - - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Relationship#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'Primary Key Table' attribute. - * - *

- * If the meaning of the 'Primary Key Table' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Primary Key Table' attribute. - * @see #setPrimaryKeyTable(String) - * @generated - */ - String getPrimaryKeyTable(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Relationship#getPrimaryKeyTable Primary Key Table}' attribute. - * - * - * @param value the new value of the 'Primary Key Table' attribute. - * @see #getPrimaryKeyTable() - * @generated - */ - void setPrimaryKeyTable(String value); - -} // Relationship diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ResultDescriptor.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ResultDescriptor.java deleted file mode 100644 index 648c33bf7e..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/ResultDescriptor.java +++ /dev/null @@ -1,150 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config; - - -/** - * - * A representation of the model object 'Result Descriptor'. - * - * - *

- * The following features are supported: - *

- *

- * - * @generated - */ -public interface ResultDescriptor -{ - /** - * Returns the value of the 'Column Name' attribute. - * - *

- * If the meaning of the 'Column Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Column Name' attribute. - * @see #setColumnName(String) - * @generated - */ - String getColumnName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getColumnName Column Name}' attribute. - * - * - * @param value the new value of the 'Column Name' attribute. - * @see #getColumnName() - * @generated - */ - void setColumnName(String value); - - /** - * Returns the value of the 'Column Type' attribute. - * - *

- * If the meaning of the 'Column Type' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Column Type' attribute. - * @see #setColumnType(String) - * @generated - */ - String getColumnType(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getColumnType Column Type}' attribute. - * - * - * @param value the new value of the 'Column Type' attribute. - * @see #getColumnType() - * @generated - */ - void setColumnType(String value); - - /** - * Returns the value of the 'Command' attribute. - * - *

- * If the meaning of the 'Command' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Command' attribute. - * @see #setCommand(String) - * @generated - */ - String getCommand(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getCommand Command}' attribute. - * - * - * @param value the new value of the 'Command' attribute. - * @see #getCommand() - * @generated - */ - void setCommand(String value); - - /** - * Returns the value of the 'Converter' attribute. - * - *

- * If the meaning of the 'Converter' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Converter' attribute. - * @see #setConverter(String) - * @generated - */ - String getConverter(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getConverter Converter}' attribute. - * - * - * @param value the new value of the 'Converter' attribute. - * @see #getConverter() - * @generated - */ - void setConverter(String value); - - /** - * Returns the value of the 'Table Name' attribute. - * - *

- * If the meaning of the 'Table Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Table Name' attribute. - * @see #setTableName(String) - * @generated - */ - String getTableName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getTableName Table Name}' attribute. - * - * - * @param value the new value of the 'Table Name' attribute. - * @see #getTableName() - * @generated - */ - void setTableName(String value); - -} // ResultDescriptor diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Table.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Table.java deleted file mode 100644 index 8f0956f291..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/Table.java +++ /dev/null @@ -1,191 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config; - -import java.util.List; - -/** - * - * A representation of the model object 'Table'. - * - * - *

- * The following features are supported: - *

- *

- * - * @generated - */ -public interface Table -{ - /** - * Returns the value of the 'Column' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.config.Column}. - * - *

- * If the meaning of the 'Column' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Column' containment reference list. - * @generated - */ - List getColumn(); - - /** - * Returns the value of the 'Config' attribute. - * - *

- * If the meaning of the 'Config' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Config' attribute. - * @see #setConfig(String) - * @generated - */ - String getConfig(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Table#getConfig Config}' attribute. - * - * - * @param value the new value of the 'Config' attribute. - * @see #getConfig() - * @generated - */ - void setConfig(String value); - - /** - * Returns the value of the 'Create' attribute. - * - *

- * If the meaning of the 'Create' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Create' attribute. - * @see #setCreate(String) - * @generated - */ - String getCreate(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Table#getCreate Create}' attribute. - * - * - * @param value the new value of the 'Create' attribute. - * @see #getCreate() - * @generated - */ - void setCreate(String value); - - /** - * Returns the value of the 'Delete' attribute. - * - *

- * If the meaning of the 'Delete' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Delete' attribute. - * @see #setDelete(String) - * @generated - */ - String getDelete(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Table#getDelete Delete}' attribute. - * - * - * @param value the new value of the 'Delete' attribute. - * @see #getDelete() - * @generated - */ - void setDelete(String value); - - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Table#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'Property Name' attribute. - * - *

- * If the meaning of the 'Property Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Property Name' attribute. - * @see #setPropertyName(String) - * @generated - */ - String getPropertyName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Table#getPropertyName Property Name}' attribute. - * - * - * @param value the new value of the 'Property Name' attribute. - * @see #getPropertyName() - * @generated - */ - void setPropertyName(String value); - - /** - * Returns the value of the 'Update' attribute. - * - *

- * If the meaning of the 'Update' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Update' attribute. - * @see #setUpdate(String) - * @generated - */ - String getUpdate(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Table#getUpdate Update}' attribute. - * - * - * @param value the new value of the 'Update' attribute. - * @see #getUpdate() - * @generated - */ - void setUpdate(String value); - -} // Table diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ColumnImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ColumnImpl.java deleted file mode 100644 index 30be8870b3..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ColumnImpl.java +++ /dev/null @@ -1,675 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import org.apache.tuscany.das.rdb.config.Column; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -/** - * - * An implementation of the model object 'Column'. - * - *

- * The following features are implemented: - *

- *

- * - * @generated - */ -public class ColumnImpl extends DataObjectImpl implements Column -{ - /** - * The default value of the '{@link #isCollision() Collision}' attribute. - * - * - * @see #isCollision() - * @generated - * @ordered - */ - protected static final boolean COLLISION_EDEFAULT = false; - - /** - * The cached value of the '{@link #isCollision() Collision}' attribute. - * - * - * @see #isCollision() - * @generated - * @ordered - */ - protected boolean collision = COLLISION_EDEFAULT; - - /** - * This is true if the Collision attribute has been set. - * - * - * @generated - * @ordered - */ - protected boolean collisionESet = false; - - /** - * The default value of the '{@link #getColumnType() Column Type}' attribute. - * - * - * @see #getColumnType() - * @generated - * @ordered - */ - protected static final String COLUMN_TYPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getColumnType() Column Type}' attribute. - * - * - * @see #getColumnType() - * @generated - * @ordered - */ - protected String columnType = COLUMN_TYPE_EDEFAULT; - - /** - * The default value of the '{@link #getConverterClassName() Converter Class Name}' attribute. - * - * - * @see #getConverterClassName() - * @generated - * @ordered - */ - protected static final String CONVERTER_CLASS_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getConverterClassName() Converter Class Name}' attribute. - * - * - * @see #getConverterClassName() - * @generated - * @ordered - */ - protected String converterClassName = CONVERTER_CLASS_NAME_EDEFAULT; - - /** - * The default value of the '{@link #isGenerated() Generated}' attribute. - * - * - * @see #isGenerated() - * @generated - * @ordered - */ - protected static final boolean GENERATED_EDEFAULT = false; - - /** - * The cached value of the '{@link #isGenerated() Generated}' attribute. - * - * - * @see #isGenerated() - * @generated - * @ordered - */ - protected boolean generated = GENERATED_EDEFAULT; - - /** - * This is true if the Generated attribute has been set. - * - * - * @generated - * @ordered - */ - protected boolean generatedESet = false; - - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #isPrimaryKey() Primary Key}' attribute. - * - * - * @see #isPrimaryKey() - * @generated - * @ordered - */ - protected static final boolean PRIMARY_KEY_EDEFAULT = false; - - /** - * The cached value of the '{@link #isPrimaryKey() Primary Key}' attribute. - * - * - * @see #isPrimaryKey() - * @generated - * @ordered - */ - protected boolean primaryKey = PRIMARY_KEY_EDEFAULT; - - /** - * This is true if the Primary Key attribute has been set. - * - * - * @generated - * @ordered - */ - protected boolean primaryKeyESet = false; - - /** - * The default value of the '{@link #getPropertyName() Property Name}' attribute. - * - * - * @see #getPropertyName() - * @generated - * @ordered - */ - protected static final String PROPERTY_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getPropertyName() Property Name}' attribute. - * - * - * @see #getPropertyName() - * @generated - * @ordered - */ - protected String propertyName = PROPERTY_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getTable() Table}' attribute. - * - * - * @see #getTable() - * @generated - * @ordered - */ - protected static final String TABLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getTable() Table}' attribute. - * - * - * @see #getTable() - * @generated - * @ordered - */ - protected String table = TABLE_EDEFAULT; - - /** - * - * - * @generated - */ - protected ColumnImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return ConfigPackageImpl.Literals.COLUMN; - } - - /** - * - * - * @generated - */ - public boolean isCollision() - { - return collision; - } - - /** - * - * - * @generated - */ - public void setCollision(boolean newCollision) - { - boolean oldCollision = collision; - collision = newCollision; - boolean oldCollisionESet = collisionESet; - collisionESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COLUMN__COLLISION, oldCollision, collision, !oldCollisionESet)); - } - - /** - * - * - * @generated - */ - public void unsetCollision() - { - boolean oldCollision = collision; - boolean oldCollisionESet = collisionESet; - collision = COLLISION_EDEFAULT; - collisionESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, ConfigPackageImpl.COLUMN__COLLISION, oldCollision, COLLISION_EDEFAULT, oldCollisionESet)); - } - - /** - * - * - * @generated - */ - public boolean isSetCollision() - { - return collisionESet; - } - - /** - * - * - * @generated - */ - public String getColumnType() - { - return columnType; - } - - /** - * - * - * @generated - */ - public void setColumnType(String newColumnType) - { - String oldColumnType = columnType; - columnType = newColumnType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COLUMN__COLUMN_TYPE, oldColumnType, columnType)); - } - - /** - * - * - * @generated - */ - public String getConverterClassName() - { - return converterClassName; - } - - /** - * - * - * @generated - */ - public void setConverterClassName(String newConverterClassName) - { - String oldConverterClassName = converterClassName; - converterClassName = newConverterClassName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COLUMN__CONVERTER_CLASS_NAME, oldConverterClassName, converterClassName)); - } - - /** - * - * - * @generated - */ - public boolean isGenerated() - { - return generated; - } - - /** - * - * - * @generated - */ - public void setGenerated(boolean newGenerated) - { - boolean oldGenerated = generated; - generated = newGenerated; - boolean oldGeneratedESet = generatedESet; - generatedESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COLUMN__GENERATED, oldGenerated, generated, !oldGeneratedESet)); - } - - /** - * - * - * @generated - */ - public void unsetGenerated() - { - boolean oldGenerated = generated; - boolean oldGeneratedESet = generatedESet; - generated = GENERATED_EDEFAULT; - generatedESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, ConfigPackageImpl.COLUMN__GENERATED, oldGenerated, GENERATED_EDEFAULT, oldGeneratedESet)); - } - - /** - * - * - * @generated - */ - public boolean isSetGenerated() - { - return generatedESet; - } - - /** - * - * - * @generated - */ - public String getName() - { - return name; - } - - /** - * - * - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COLUMN__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - public boolean isPrimaryKey() - { - return primaryKey; - } - - /** - * - * - * @generated - */ - public void setPrimaryKey(boolean newPrimaryKey) - { - boolean oldPrimaryKey = primaryKey; - primaryKey = newPrimaryKey; - boolean oldPrimaryKeyESet = primaryKeyESet; - primaryKeyESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COLUMN__PRIMARY_KEY, oldPrimaryKey, primaryKey, !oldPrimaryKeyESet)); - } - - /** - * - * - * @generated - */ - public void unsetPrimaryKey() - { - boolean oldPrimaryKey = primaryKey; - boolean oldPrimaryKeyESet = primaryKeyESet; - primaryKey = PRIMARY_KEY_EDEFAULT; - primaryKeyESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, ConfigPackageImpl.COLUMN__PRIMARY_KEY, oldPrimaryKey, PRIMARY_KEY_EDEFAULT, oldPrimaryKeyESet)); - } - - /** - * - * - * @generated - */ - public boolean isSetPrimaryKey() - { - return primaryKeyESet; - } - - /** - * - * - * @generated - */ - public String getPropertyName() - { - return propertyName; - } - - /** - * - * - * @generated - */ - public void setPropertyName(String newPropertyName) - { - String oldPropertyName = propertyName; - propertyName = newPropertyName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COLUMN__PROPERTY_NAME, oldPropertyName, propertyName)); - } - - /** - * - * - * @generated - */ - public String getTable() - { - return table; - } - - /** - * - * - * @generated - */ - public void setTable(String newTable) - { - String oldTable = table; - table = newTable; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COLUMN__TABLE, oldTable, table)); - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ConfigPackageImpl.COLUMN__COLLISION: - return isCollision() ? Boolean.TRUE : Boolean.FALSE; - case ConfigPackageImpl.COLUMN__COLUMN_TYPE: - return getColumnType(); - case ConfigPackageImpl.COLUMN__CONVERTER_CLASS_NAME: - return getConverterClassName(); - case ConfigPackageImpl.COLUMN__GENERATED: - return isGenerated() ? Boolean.TRUE : Boolean.FALSE; - case ConfigPackageImpl.COLUMN__NAME: - return getName(); - case ConfigPackageImpl.COLUMN__PRIMARY_KEY: - return isPrimaryKey() ? Boolean.TRUE : Boolean.FALSE; - case ConfigPackageImpl.COLUMN__PROPERTY_NAME: - return getPropertyName(); - case ConfigPackageImpl.COLUMN__TABLE: - return getTable(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ConfigPackageImpl.COLUMN__COLLISION: - setCollision(((Boolean)newValue).booleanValue()); - return; - case ConfigPackageImpl.COLUMN__COLUMN_TYPE: - setColumnType((String)newValue); - return; - case ConfigPackageImpl.COLUMN__CONVERTER_CLASS_NAME: - setConverterClassName((String)newValue); - return; - case ConfigPackageImpl.COLUMN__GENERATED: - setGenerated(((Boolean)newValue).booleanValue()); - return; - case ConfigPackageImpl.COLUMN__NAME: - setName((String)newValue); - return; - case ConfigPackageImpl.COLUMN__PRIMARY_KEY: - setPrimaryKey(((Boolean)newValue).booleanValue()); - return; - case ConfigPackageImpl.COLUMN__PROPERTY_NAME: - setPropertyName((String)newValue); - return; - case ConfigPackageImpl.COLUMN__TABLE: - setTable((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.COLUMN__COLLISION: - unsetCollision(); - return; - case ConfigPackageImpl.COLUMN__COLUMN_TYPE: - setColumnType(COLUMN_TYPE_EDEFAULT); - return; - case ConfigPackageImpl.COLUMN__CONVERTER_CLASS_NAME: - setConverterClassName(CONVERTER_CLASS_NAME_EDEFAULT); - return; - case ConfigPackageImpl.COLUMN__GENERATED: - unsetGenerated(); - return; - case ConfigPackageImpl.COLUMN__NAME: - setName(NAME_EDEFAULT); - return; - case ConfigPackageImpl.COLUMN__PRIMARY_KEY: - unsetPrimaryKey(); - return; - case ConfigPackageImpl.COLUMN__PROPERTY_NAME: - setPropertyName(PROPERTY_NAME_EDEFAULT); - return; - case ConfigPackageImpl.COLUMN__TABLE: - setTable(TABLE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.COLUMN__COLLISION: - return isSetCollision(); - case ConfigPackageImpl.COLUMN__COLUMN_TYPE: - return COLUMN_TYPE_EDEFAULT == null ? columnType != null : !COLUMN_TYPE_EDEFAULT.equals(columnType); - case ConfigPackageImpl.COLUMN__CONVERTER_CLASS_NAME: - return CONVERTER_CLASS_NAME_EDEFAULT == null ? converterClassName != null : !CONVERTER_CLASS_NAME_EDEFAULT.equals(converterClassName); - case ConfigPackageImpl.COLUMN__GENERATED: - return isSetGenerated(); - case ConfigPackageImpl.COLUMN__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case ConfigPackageImpl.COLUMN__PRIMARY_KEY: - return isSetPrimaryKey(); - case ConfigPackageImpl.COLUMN__PROPERTY_NAME: - return PROPERTY_NAME_EDEFAULT == null ? propertyName != null : !PROPERTY_NAME_EDEFAULT.equals(propertyName); - case ConfigPackageImpl.COLUMN__TABLE: - return TABLE_EDEFAULT == null ? table != null : !TABLE_EDEFAULT.equals(table); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (collision: "); - if (collisionESet) result.append(collision); else result.append(""); - result.append(", columnType: "); - result.append(columnType); - result.append(", converterClassName: "); - result.append(converterClassName); - result.append(", generated: "); - if (generatedESet) result.append(generated); else result.append(""); - result.append(", name: "); - result.append(name); - result.append(", primaryKey: "); - if (primaryKeyESet) result.append(primaryKey); else result.append(""); - result.append(", propertyName: "); - result.append(propertyName); - result.append(", table: "); - result.append(table); - result.append(')'); - return result.toString(); - } - -} //ColumnImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/CommandImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/CommandImpl.java deleted file mode 100644 index 7750d34ded..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/CommandImpl.java +++ /dev/null @@ -1,444 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import java.util.Collection; -import java.util.List; - -import org.apache.tuscany.das.rdb.config.Command; -import org.apache.tuscany.das.rdb.config.Parameter; -import org.apache.tuscany.das.rdb.config.ResultDescriptor; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * - * An implementation of the model object 'Command'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.apache.tuscany.das.rdb.config.impl.CommandImpl#getParameter Parameter}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.CommandImpl#getResultDescriptor Result Descriptor}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.CommandImpl#getConfig Config}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.CommandImpl#getKind Kind}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.CommandImpl#getName Name}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.CommandImpl#getSQL SQL}
  • - *
- *

- * - * @generated - */ -public class CommandImpl extends DataObjectImpl implements Command -{ - /** - * The cached value of the '{@link #getParameter() Parameter}' containment reference list. - * - * - * @see #getParameter() - * @generated - * @ordered - */ - protected EList parameter = null; - - /** - * The cached value of the '{@link #getResultDescriptor() Result Descriptor}' containment reference list. - * - * - * @see #getResultDescriptor() - * @generated - * @ordered - */ - protected EList resultDescriptor = null; - - /** - * The default value of the '{@link #getConfig() Config}' attribute. - * - * - * @see #getConfig() - * @generated - * @ordered - */ - protected static final String CONFIG_EDEFAULT = null; - - /** - * The cached value of the '{@link #getConfig() Config}' attribute. - * - * - * @see #getConfig() - * @generated - * @ordered - */ - protected String config = CONFIG_EDEFAULT; - - /** - * The default value of the '{@link #getKind() Kind}' attribute. - * - * - * @see #getKind() - * @generated - * @ordered - */ - protected static final String KIND_EDEFAULT = null; - - /** - * The cached value of the '{@link #getKind() Kind}' attribute. - * - * - * @see #getKind() - * @generated - * @ordered - */ - protected String kind = KIND_EDEFAULT; - - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getSQL() SQL}' attribute. - * - * - * @see #getSQL() - * @generated - * @ordered - */ - protected static final String SQL_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSQL() SQL}' attribute. - * - * - * @see #getSQL() - * @generated - * @ordered - */ - protected String sQL = SQL_EDEFAULT; - - /** - * - * - * @generated - */ - protected CommandImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return ConfigPackageImpl.Literals.COMMAND; - } - - /** - * - * - * @generated - */ - public List getParameter() - { - if (parameter == null) - { - parameter = new EObjectContainmentEList(Parameter.class, this, ConfigPackageImpl.COMMAND__PARAMETER); - } - return parameter; - } - - /** - * - * - * @generated - */ - public List getResultDescriptor() - { - if (resultDescriptor == null) - { - resultDescriptor = new EObjectContainmentEList(ResultDescriptor.class, this, ConfigPackageImpl.COMMAND__RESULT_DESCRIPTOR); - } - return resultDescriptor; - } - - /** - * - * - * @generated - */ - public String getConfig() - { - return config; - } - - /** - * - * - * @generated - */ - public void setConfig(String newConfig) - { - String oldConfig = config; - config = newConfig; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COMMAND__CONFIG, oldConfig, config)); - } - - /** - * - * - * @generated - */ - public String getKind() - { - return kind; - } - - /** - * - * - * @generated - */ - public void setKind(String newKind) - { - String oldKind = kind; - kind = newKind; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COMMAND__KIND, oldKind, kind)); - } - - /** - * - * - * @generated - */ - public String getName() - { - return name; - } - - /** - * - * - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COMMAND__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - public String getSQL() - { - return sQL; - } - - /** - * - * - * @generated - */ - public void setSQL(String newSQL) - { - String oldSQL = sQL; - sQL = newSQL; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.COMMAND__SQL, oldSQL, sQL)); - } - - /** - * - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ConfigPackageImpl.COMMAND__PARAMETER: - return ((InternalEList)getParameter()).basicRemove(otherEnd, msgs); - case ConfigPackageImpl.COMMAND__RESULT_DESCRIPTOR: - return ((InternalEList)getResultDescriptor()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ConfigPackageImpl.COMMAND__PARAMETER: - return getParameter(); - case ConfigPackageImpl.COMMAND__RESULT_DESCRIPTOR: - return getResultDescriptor(); - case ConfigPackageImpl.COMMAND__CONFIG: - return getConfig(); - case ConfigPackageImpl.COMMAND__KIND: - return getKind(); - case ConfigPackageImpl.COMMAND__NAME: - return getName(); - case ConfigPackageImpl.COMMAND__SQL: - return getSQL(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ConfigPackageImpl.COMMAND__PARAMETER: - getParameter().clear(); - getParameter().addAll((Collection)newValue); - return; - case ConfigPackageImpl.COMMAND__RESULT_DESCRIPTOR: - getResultDescriptor().clear(); - getResultDescriptor().addAll((Collection)newValue); - return; - case ConfigPackageImpl.COMMAND__CONFIG: - setConfig((String)newValue); - return; - case ConfigPackageImpl.COMMAND__KIND: - setKind((String)newValue); - return; - case ConfigPackageImpl.COMMAND__NAME: - setName((String)newValue); - return; - case ConfigPackageImpl.COMMAND__SQL: - setSQL((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.COMMAND__PARAMETER: - getParameter().clear(); - return; - case ConfigPackageImpl.COMMAND__RESULT_DESCRIPTOR: - getResultDescriptor().clear(); - return; - case ConfigPackageImpl.COMMAND__CONFIG: - setConfig(CONFIG_EDEFAULT); - return; - case ConfigPackageImpl.COMMAND__KIND: - setKind(KIND_EDEFAULT); - return; - case ConfigPackageImpl.COMMAND__NAME: - setName(NAME_EDEFAULT); - return; - case ConfigPackageImpl.COMMAND__SQL: - setSQL(SQL_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.COMMAND__PARAMETER: - return parameter != null && !parameter.isEmpty(); - case ConfigPackageImpl.COMMAND__RESULT_DESCRIPTOR: - return resultDescriptor != null && !resultDescriptor.isEmpty(); - case ConfigPackageImpl.COMMAND__CONFIG: - return CONFIG_EDEFAULT == null ? config != null : !CONFIG_EDEFAULT.equals(config); - case ConfigPackageImpl.COMMAND__KIND: - return KIND_EDEFAULT == null ? kind != null : !KIND_EDEFAULT.equals(kind); - case ConfigPackageImpl.COMMAND__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case ConfigPackageImpl.COMMAND__SQL: - return SQL_EDEFAULT == null ? sQL != null : !SQL_EDEFAULT.equals(sQL); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (config: "); - result.append(config); - result.append(", kind: "); - result.append(kind); - result.append(", name: "); - result.append(name); - result.append(", sQL: "); - result.append(sQL); - result.append(')'); - return result.toString(); - } - -} //CommandImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigFactoryImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigFactoryImpl.java deleted file mode 100644 index 7f67ad8e76..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigFactoryImpl.java +++ /dev/null @@ -1,212 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import org.apache.tuscany.das.rdb.config.*; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.impl.EFactoryImpl; - -import org.eclipse.emf.ecore.plugin.EcorePlugin; - -/** - * - * An implementation of the model Factory. - * - * @generated - */ -public class ConfigFactoryImpl extends EFactoryImpl implements ConfigFactory -{ - /** - * The singleton instance of the factory. - * - * - * @generated - */ - public static final ConfigFactoryImpl eINSTANCE = init(); - - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static ConfigFactoryImpl init() - { - try - { - ConfigFactoryImpl theConfigFactory = (ConfigFactoryImpl)EPackage.Registry.INSTANCE.getEFactory("http:///org.apache.tuscany.das.rdb/config.xsd"); - if (theConfigFactory != null) - { - return theConfigFactory; - } - } - catch (Exception exception) - { - EcorePlugin.INSTANCE.log(exception); - } - return new ConfigFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public ConfigFactoryImpl() - { - super(); - } - - /** - * - * - * @generated - */ - public EObject create(EClass eClass) - { - switch (eClass.getClassifierID()) - { - case ConfigPackageImpl.COLUMN: return (EObject)createColumn(); - case ConfigPackageImpl.COMMAND: return (EObject)createCommand(); - case ConfigPackageImpl.CONFIG: return (EObject)createConfig(); - case ConfigPackageImpl.CONNECTION_PROPERTIES: return (EObject)createConnectionProperties(); - case ConfigPackageImpl.KEY_PAIR: return (EObject)createKeyPair(); - case ConfigPackageImpl.PARAMETER: return (EObject)createParameter(); - case ConfigPackageImpl.RELATIONSHIP: return (EObject)createRelationship(); - case ConfigPackageImpl.RESULT_DESCRIPTOR: return (EObject)createResultDescriptor(); - case ConfigPackageImpl.TABLE: return (EObject)createTable(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - public Column createColumn() - { - ColumnImpl column = new ColumnImpl(); - return column; - } - - /** - * - * - * @generated - */ - public Command createCommand() - { - CommandImpl command = new CommandImpl(); - return command; - } - - /** - * - * - * @generated - */ - public Config createConfig() - { - ConfigImpl config = new ConfigImpl(); - return config; - } - - /** - * - * - * @generated - */ - public ConnectionProperties createConnectionProperties() - { - ConnectionPropertiesImpl connectionProperties = new ConnectionPropertiesImpl(); - return connectionProperties; - } - - /** - * - * - * @generated - */ - public KeyPair createKeyPair() - { - KeyPairImpl keyPair = new KeyPairImpl(); - return keyPair; - } - - /** - * - * - * @generated - */ - public Parameter createParameter() - { - ParameterImpl parameter = new ParameterImpl(); - return parameter; - } - - /** - * - * - * @generated - */ - public Relationship createRelationship() - { - RelationshipImpl relationship = new RelationshipImpl(); - return relationship; - } - - /** - * - * - * @generated - */ - public ResultDescriptor createResultDescriptor() - { - ResultDescriptorImpl resultDescriptor = new ResultDescriptorImpl(); - return resultDescriptor; - } - - /** - * - * - * @generated - */ - public Table createTable() - { - TableImpl table = new TableImpl(); - return table; - } - - /** - * - * - * @generated - */ - public ConfigPackageImpl getConfigPackageImpl() - { - return (ConfigPackageImpl)getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - public static ConfigPackageImpl getPackage() - { - return ConfigPackageImpl.eINSTANCE; - } - -} //ConfigFactoryImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigImpl.java deleted file mode 100644 index 67e1e5f8a7..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigImpl.java +++ /dev/null @@ -1,387 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import java.util.Collection; -import java.util.List; - -import org.apache.tuscany.das.rdb.config.Command; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.ConnectionProperties; -import org.apache.tuscany.das.rdb.config.Relationship; -import org.apache.tuscany.das.rdb.config.Table; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * - * An implementation of the model object 'Config'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.apache.tuscany.das.rdb.config.impl.ConfigImpl#getCommand Command}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.ConfigImpl#getConnectionProperties Connection Properties}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.ConfigImpl#getTable Table}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.ConfigImpl#getRelationship Relationship}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.ConfigImpl#getUri Uri}
  • - *
- *

- * - * @generated - */ -public class ConfigImpl extends DataObjectImpl implements Config -{ - /** - * The cached value of the '{@link #getCommand() Command}' containment reference list. - * - * - * @see #getCommand() - * @generated - * @ordered - */ - protected EList command = null; - - /** - * The cached value of the '{@link #getConnectionProperties() Connection Properties}' containment reference. - * - * - * @see #getConnectionProperties() - * @generated - * @ordered - */ - protected ConnectionProperties connectionProperties = null; - - /** - * The cached value of the '{@link #getTable() Table}' containment reference list. - * - * - * @see #getTable() - * @generated - * @ordered - */ - protected EList table = null; - - /** - * The cached value of the '{@link #getRelationship() Relationship}' containment reference list. - * - * - * @see #getRelationship() - * @generated - * @ordered - */ - protected EList relationship = null; - - /** - * The default value of the '{@link #getUri() Uri}' attribute. - * - * - * @see #getUri() - * @generated - * @ordered - */ - protected static final String URI_EDEFAULT = null; - - /** - * The cached value of the '{@link #getUri() Uri}' attribute. - * - * - * @see #getUri() - * @generated - * @ordered - */ - protected String uri = URI_EDEFAULT; - - /** - * - * - * @generated - */ - protected ConfigImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return ConfigPackageImpl.Literals.CONFIG; - } - - /** - * - * - * @generated - */ - public List getCommand() - { - if (command == null) - { - command = new EObjectContainmentEList(Command.class, this, ConfigPackageImpl.CONFIG__COMMAND); - } - return command; - } - - /** - * - * - * @generated - */ - public ConnectionProperties getConnectionProperties() - { - return connectionProperties; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetConnectionProperties(ConnectionProperties newConnectionProperties, NotificationChain msgs) - { - ConnectionProperties oldConnectionProperties = connectionProperties; - connectionProperties = newConnectionProperties; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.CONFIG__CONNECTION_PROPERTIES, oldConnectionProperties, newConnectionProperties); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - public void setConnectionProperties(ConnectionProperties newConnectionProperties) - { - if (newConnectionProperties != connectionProperties) - { - NotificationChain msgs = null; - if (connectionProperties != null) - msgs = ((InternalEObject)connectionProperties).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ConfigPackageImpl.CONFIG__CONNECTION_PROPERTIES, null, msgs); - if (newConnectionProperties != null) - msgs = ((InternalEObject)newConnectionProperties).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ConfigPackageImpl.CONFIG__CONNECTION_PROPERTIES, null, msgs); - msgs = basicSetConnectionProperties(newConnectionProperties, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.CONFIG__CONNECTION_PROPERTIES, newConnectionProperties, newConnectionProperties)); - } - - /** - * - * - * @generated - */ - public List getTable() - { - if (table == null) - { - table = new EObjectContainmentEList(Table.class, this, ConfigPackageImpl.CONFIG__TABLE); - } - return table; - } - - /** - * - * - * @generated - */ - public List getRelationship() - { - if (relationship == null) - { - relationship = new EObjectContainmentEList(Relationship.class, this, ConfigPackageImpl.CONFIG__RELATIONSHIP); - } - return relationship; - } - - /** - * - * - * @generated - */ - public String getUri() - { - return uri; - } - - /** - * - * - * @generated - */ - public void setUri(String newUri) - { - String oldUri = uri; - uri = newUri; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.CONFIG__URI, oldUri, uri)); - } - - /** - * - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ConfigPackageImpl.CONFIG__COMMAND: - return ((InternalEList)getCommand()).basicRemove(otherEnd, msgs); - case ConfigPackageImpl.CONFIG__CONNECTION_PROPERTIES: - return basicSetConnectionProperties(null, msgs); - case ConfigPackageImpl.CONFIG__TABLE: - return ((InternalEList)getTable()).basicRemove(otherEnd, msgs); - case ConfigPackageImpl.CONFIG__RELATIONSHIP: - return ((InternalEList)getRelationship()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ConfigPackageImpl.CONFIG__COMMAND: - return getCommand(); - case ConfigPackageImpl.CONFIG__CONNECTION_PROPERTIES: - return getConnectionProperties(); - case ConfigPackageImpl.CONFIG__TABLE: - return getTable(); - case ConfigPackageImpl.CONFIG__RELATIONSHIP: - return getRelationship(); - case ConfigPackageImpl.CONFIG__URI: - return getUri(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ConfigPackageImpl.CONFIG__COMMAND: - getCommand().clear(); - getCommand().addAll((Collection)newValue); - return; - case ConfigPackageImpl.CONFIG__CONNECTION_PROPERTIES: - setConnectionProperties((ConnectionProperties)newValue); - return; - case ConfigPackageImpl.CONFIG__TABLE: - getTable().clear(); - getTable().addAll((Collection)newValue); - return; - case ConfigPackageImpl.CONFIG__RELATIONSHIP: - getRelationship().clear(); - getRelationship().addAll((Collection)newValue); - return; - case ConfigPackageImpl.CONFIG__URI: - setUri((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.CONFIG__COMMAND: - getCommand().clear(); - return; - case ConfigPackageImpl.CONFIG__CONNECTION_PROPERTIES: - setConnectionProperties((ConnectionProperties)null); - return; - case ConfigPackageImpl.CONFIG__TABLE: - getTable().clear(); - return; - case ConfigPackageImpl.CONFIG__RELATIONSHIP: - getRelationship().clear(); - return; - case ConfigPackageImpl.CONFIG__URI: - setUri(URI_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.CONFIG__COMMAND: - return command != null && !command.isEmpty(); - case ConfigPackageImpl.CONFIG__CONNECTION_PROPERTIES: - return connectionProperties != null; - case ConfigPackageImpl.CONFIG__TABLE: - return table != null && !table.isEmpty(); - case ConfigPackageImpl.CONFIG__RELATIONSHIP: - return relationship != null && !relationship.isEmpty(); - case ConfigPackageImpl.CONFIG__URI: - return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (uri: "); - result.append(uri); - result.append(')'); - return result.toString(); - } - -} //ConfigImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigPackageImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigPackageImpl.java deleted file mode 100644 index e018f00586..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConfigPackageImpl.java +++ /dev/null @@ -1,2808 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Command; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.ConfigFactory; -import org.apache.tuscany.das.rdb.config.ConnectionProperties; -import org.apache.tuscany.das.rdb.config.KeyPair; -import org.apache.tuscany.das.rdb.config.Parameter; -import org.apache.tuscany.das.rdb.config.Relationship; -import org.apache.tuscany.das.rdb.config.ResultDescriptor; -import org.apache.tuscany.das.rdb.config.Table; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EFactory; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - -import org.eclipse.emf.ecore.impl.EPackageImpl; - -import org.eclipse.emf.ecore.xml.type.XMLTypePackage; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @see org.apache.tuscany.das.rdb.config.ConfigFactory - * @generated - */ -public class ConfigPackageImpl extends EPackageImpl -{ - /** - * The package name. - * - * - * @generated - */ - public static final String eNAME = "config"; - - /** - * The package namespace URI. - * - * - * @generated - */ - public static final String eNS_URI = "http:///org.apache.tuscany.das.rdb/config.xsd"; - - /** - * The package namespace name. - * - * - * @generated - */ - public static final String eNS_PREFIX = "org.apache.tuscany.das.rdb.config"; - - /** - * The singleton instance of the package. - * - * - * @generated - */ - public static final ConfigPackageImpl eINSTANCE = org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl.init(); - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.config.impl.ColumnImpl Column}' class. - * - * - * @see org.apache.tuscany.das.rdb.config.impl.ColumnImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getColumn() - * @generated - */ - public static final int COLUMN = 0; - - /** - * The feature id for the 'Collision' attribute. - * - * - * @generated - * @ordered - */ - public static final int COLUMN__COLLISION = 0; - - /** - * The feature id for the 'Column Type' attribute. - * - * - * @generated - * @ordered - */ - public static final int COLUMN__COLUMN_TYPE = 1; - - /** - * The feature id for the 'Converter Class Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int COLUMN__CONVERTER_CLASS_NAME = 2; - - /** - * The feature id for the 'Generated' attribute. - * - * - * @generated - * @ordered - */ - public static final int COLUMN__GENERATED = 3; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int COLUMN__NAME = 4; - - /** - * The feature id for the 'Primary Key' attribute. - * - * - * @generated - * @ordered - */ - public static final int COLUMN__PRIMARY_KEY = 5; - - /** - * The feature id for the 'Property Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int COLUMN__PROPERTY_NAME = 6; - - /** - * The feature id for the 'Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int COLUMN__TABLE = 7; - - /** - * The number of structural features of the 'Column' class. - * - * - * @generated - * @ordered - */ - public static final int COLUMN_FEATURE_COUNT = 8; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.config.impl.CommandImpl Command}' class. - * - * - * @see org.apache.tuscany.das.rdb.config.impl.CommandImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getCommand() - * @generated - */ - public static final int COMMAND = 1; - - /** - * The feature id for the 'Parameter' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int COMMAND__PARAMETER = 0; - - /** - * The feature id for the 'Result Descriptor' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int COMMAND__RESULT_DESCRIPTOR = 1; - - /** - * The feature id for the 'Config' attribute. - * - * - * @generated - * @ordered - */ - public static final int COMMAND__CONFIG = 2; - - /** - * The feature id for the 'Kind' attribute. - * - * - * @generated - * @ordered - */ - public static final int COMMAND__KIND = 3; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int COMMAND__NAME = 4; - - /** - * The feature id for the 'SQL' attribute. - * - * - * @generated - * @ordered - */ - public static final int COMMAND__SQL = 5; - - /** - * The number of structural features of the 'Command' class. - * - * - * @generated - * @ordered - */ - public static final int COMMAND_FEATURE_COUNT = 6; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.config.impl.ConfigImpl Config}' class. - * - * - * @see org.apache.tuscany.das.rdb.config.impl.ConfigImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getConfig() - * @generated - */ - public static final int CONFIG = 2; - - /** - * The feature id for the 'Command' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int CONFIG__COMMAND = 0; - - /** - * The feature id for the 'Connection Properties' containment reference. - * - * - * @generated - * @ordered - */ - public static final int CONFIG__CONNECTION_PROPERTIES = 1; - - /** - * The feature id for the 'Table' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int CONFIG__TABLE = 2; - - /** - * The feature id for the 'Relationship' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int CONFIG__RELATIONSHIP = 3; - - /** - * The feature id for the 'Uri' attribute. - * - * - * @generated - * @ordered - */ - public static final int CONFIG__URI = 4; - - /** - * The number of structural features of the 'Config' class. - * - * - * @generated - * @ordered - */ - public static final int CONFIG_FEATURE_COUNT = 5; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.config.impl.ConnectionPropertiesImpl Connection Properties}' class. - * - * - * @see org.apache.tuscany.das.rdb.config.impl.ConnectionPropertiesImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getConnectionProperties() - * @generated - */ - public static final int CONNECTION_PROPERTIES = 3; - - /** - * The feature id for the 'Config' attribute. - * - * - * @generated - * @ordered - */ - public static final int CONNECTION_PROPERTIES__CONFIG = 0; - - /** - * The feature id for the 'Data Source' attribute. - * - * - * @generated - * @ordered - */ - public static final int CONNECTION_PROPERTIES__DATA_SOURCE = 1; - - /** - * The feature id for the 'Driver Class Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int CONNECTION_PROPERTIES__DRIVER_CLASS_NAME = 2; - - /** - * The feature id for the 'Driver Password' attribute. - * - * - * @generated - * @ordered - */ - public static final int CONNECTION_PROPERTIES__DRIVER_PASSWORD = 3; - - /** - * The feature id for the 'Driver URL' attribute. - * - * - * @generated - * @ordered - */ - public static final int CONNECTION_PROPERTIES__DRIVER_URL = 4; - - /** - * The feature id for the 'Driver User Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int CONNECTION_PROPERTIES__DRIVER_USER_NAME = 5; - - /** - * The number of structural features of the 'Connection Properties' class. - * - * - * @generated - * @ordered - */ - public static final int CONNECTION_PROPERTIES_FEATURE_COUNT = 6; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.config.impl.KeyPairImpl Key Pair}' class. - * - * - * @see org.apache.tuscany.das.rdb.config.impl.KeyPairImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getKeyPair() - * @generated - */ - public static final int KEY_PAIR = 4; - - /** - * The feature id for the 'Foreign Key Column' attribute. - * - * - * @generated - * @ordered - */ - public static final int KEY_PAIR__FOREIGN_KEY_COLUMN = 0; - - /** - * The feature id for the 'Primary Key Column' attribute. - * - * - * @generated - * @ordered - */ - public static final int KEY_PAIR__PRIMARY_KEY_COLUMN = 1; - - /** - * The feature id for the 'Relationship' attribute. - * - * - * @generated - * @ordered - */ - public static final int KEY_PAIR__RELATIONSHIP = 2; - - /** - * The number of structural features of the 'Key Pair' class. - * - * - * @generated - * @ordered - */ - public static final int KEY_PAIR_FEATURE_COUNT = 3; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.config.impl.ParameterImpl Parameter}' class. - * - * - * @see org.apache.tuscany.das.rdb.config.impl.ParameterImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getParameter() - * @generated - */ - public static final int PARAMETER = 5; - - /** - * The feature id for the 'Column Type' attribute. - * - * - * @generated - * @ordered - */ - public static final int PARAMETER__COLUMN_TYPE = 0; - - /** - * The feature id for the 'Command' attribute. - * - * - * @generated - * @ordered - */ - public static final int PARAMETER__COMMAND = 1; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int PARAMETER__NAME = 2; - - /** - * The number of structural features of the 'Parameter' class. - * - * - * @generated - * @ordered - */ - public static final int PARAMETER_FEATURE_COUNT = 3; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl Relationship}' class. - * - * - * @see org.apache.tuscany.das.rdb.config.impl.RelationshipImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getRelationship() - * @generated - */ - public static final int RELATIONSHIP = 6; - - /** - * The feature id for the 'Key Pair' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int RELATIONSHIP__KEY_PAIR = 0; - - /** - * The feature id for the 'Config' attribute. - * - * - * @generated - * @ordered - */ - public static final int RELATIONSHIP__CONFIG = 1; - - /** - * The feature id for the 'Foreign Key Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int RELATIONSHIP__FOREIGN_KEY_TABLE = 2; - - /** - * The feature id for the 'Many' attribute. - * - * - * @generated - * @ordered - */ - public static final int RELATIONSHIP__MANY = 3; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int RELATIONSHIP__NAME = 4; - - /** - * The feature id for the 'Primary Key Table' attribute. - * - * - * @generated - * @ordered - */ - public static final int RELATIONSHIP__PRIMARY_KEY_TABLE = 5; - - /** - * The number of structural features of the 'Relationship' class. - * - * - * @generated - * @ordered - */ - public static final int RELATIONSHIP_FEATURE_COUNT = 6; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl Result Descriptor}' class. - * - * - * @see org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getResultDescriptor() - * @generated - */ - public static final int RESULT_DESCRIPTOR = 7; - - /** - * The feature id for the 'Column Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int RESULT_DESCRIPTOR__COLUMN_NAME = 0; - - /** - * The feature id for the 'Column Type' attribute. - * - * - * @generated - * @ordered - */ - public static final int RESULT_DESCRIPTOR__COLUMN_TYPE = 1; - - /** - * The feature id for the 'Command' attribute. - * - * - * @generated - * @ordered - */ - public static final int RESULT_DESCRIPTOR__COMMAND = 2; - - /** - * The feature id for the 'Converter' attribute. - * - * - * @generated - * @ordered - */ - public static final int RESULT_DESCRIPTOR__CONVERTER = 3; - - /** - * The feature id for the 'Table Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int RESULT_DESCRIPTOR__TABLE_NAME = 4; - - /** - * The number of structural features of the 'Result Descriptor' class. - * - * - * @generated - * @ordered - */ - public static final int RESULT_DESCRIPTOR_FEATURE_COUNT = 5; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.config.impl.TableImpl Table}' class. - * - * - * @see org.apache.tuscany.das.rdb.config.impl.TableImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getTable() - * @generated - */ - public static final int TABLE = 8; - - /** - * The feature id for the 'Column' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int TABLE__COLUMN = 0; - - /** - * The feature id for the 'Config' attribute. - * - * - * @generated - * @ordered - */ - public static final int TABLE__CONFIG = 1; - - /** - * The feature id for the 'Create' attribute. - * - * - * @generated - * @ordered - */ - public static final int TABLE__CREATE = 2; - - /** - * The feature id for the 'Delete' attribute. - * - * - * @generated - * @ordered - */ - public static final int TABLE__DELETE = 3; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int TABLE__NAME = 4; - - /** - * The feature id for the 'Property Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int TABLE__PROPERTY_NAME = 5; - - /** - * The feature id for the 'Update' attribute. - * - * - * @generated - * @ordered - */ - public static final int TABLE__UPDATE = 6; - - /** - * The number of structural features of the 'Table' class. - * - * - * @generated - * @ordered - */ - public static final int TABLE_FEATURE_COUNT = 7; - - /** - * - * - * @generated - */ - private EClass columnEClass = null; - - /** - * - * - * @generated - */ - private EClass commandEClass = null; - - /** - * - * - * @generated - */ - private EClass configEClass = null; - - /** - * - * - * @generated - */ - private EClass connectionPropertiesEClass = null; - - /** - * - * - * @generated - */ - private EClass keyPairEClass = null; - - /** - * - * - * @generated - */ - private EClass parameterEClass = null; - - /** - * - * - * @generated - */ - private EClass relationshipEClass = null; - - /** - * - * - * @generated - */ - private EClass resultDescriptorEClass = null; - - /** - * - * - * @generated - */ - private EClass tableEClass = null; - - /** - * Creates an instance of the model Package, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - *

Note: the correct way to create the package is via the static - * factory method {@link #init init()}, which also performs - * initialization of the package, or returns the registered package, - * if one already exists. - * - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#eNS_URI - * @see #init() - * @generated - */ - private ConfigPackageImpl() - { - super(eNS_URI, ((EFactory)ConfigFactory.INSTANCE)); - } - - /** - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this - * model, and for any others upon which it depends. Simple - * dependencies are satisfied by calling this method on all - * dependent packages before doing anything else. This method drives - * initialization for interdependent packages directly, in parallel - * with this package, itself. - *

Of this package and its interdependencies, all packages which - * have not yet been registered by their URI values are first created - * and registered. The packages are then initialized in two steps: - * meta-model objects for all of the packages are created before any - * are initialized, since one package's meta-model objects may refer to - * those of another. - *

Invocation of this method will not affect any packages that have - * already been initialized. - * - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static ConfigPackageImpl init() - { - if (isInited) return (ConfigPackageImpl)EPackage.Registry.INSTANCE.getEPackage(ConfigPackageImpl.eNS_URI); - - // Obtain or create and register package - ConfigPackageImpl theConfigPackageImpl = (ConfigPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof ConfigPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new ConfigPackageImpl()); - - isInited = true; - - // Initialize simple dependencies - XMLTypePackage.eINSTANCE.eClass(); - - // Create package meta-data objects - theConfigPackageImpl.createPackageContents(); - - // Initialize created meta-data - theConfigPackageImpl.initializePackageContents(); - - // Mark meta-data to indicate it can't be changed - theConfigPackageImpl.freeze(); - - return theConfigPackageImpl; - } - - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.config.Column Column}'. - * - * - * @return the meta object for class 'Column'. - * @see org.apache.tuscany.das.rdb.config.Column - * @generated - */ - public EClass getColumn() - { - return columnEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Column#isCollision Collision}'. - * - * - * @return the meta object for the attribute 'Collision'. - * @see org.apache.tuscany.das.rdb.config.Column#isCollision() - * @see #getColumn() - * @generated - */ - public EAttribute getColumn_Collision() - { - return (EAttribute)columnEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Column#getColumnType Column Type}'. - * - * - * @return the meta object for the attribute 'Column Type'. - * @see org.apache.tuscany.das.rdb.config.Column#getColumnType() - * @see #getColumn() - * @generated - */ - public EAttribute getColumn_ColumnType() - { - return (EAttribute)columnEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Column#getConverterClassName Converter Class Name}'. - * - * - * @return the meta object for the attribute 'Converter Class Name'. - * @see org.apache.tuscany.das.rdb.config.Column#getConverterClassName() - * @see #getColumn() - * @generated - */ - public EAttribute getColumn_ConverterClassName() - { - return (EAttribute)columnEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Column#isGenerated Generated}'. - * - * - * @return the meta object for the attribute 'Generated'. - * @see org.apache.tuscany.das.rdb.config.Column#isGenerated() - * @see #getColumn() - * @generated - */ - public EAttribute getColumn_Generated() - { - return (EAttribute)columnEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Column#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.apache.tuscany.das.rdb.config.Column#getName() - * @see #getColumn() - * @generated - */ - public EAttribute getColumn_Name() - { - return (EAttribute)columnEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Column#isPrimaryKey Primary Key}'. - * - * - * @return the meta object for the attribute 'Primary Key'. - * @see org.apache.tuscany.das.rdb.config.Column#isPrimaryKey() - * @see #getColumn() - * @generated - */ - public EAttribute getColumn_PrimaryKey() - { - return (EAttribute)columnEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Column#getPropertyName Property Name}'. - * - * - * @return the meta object for the attribute 'Property Name'. - * @see org.apache.tuscany.das.rdb.config.Column#getPropertyName() - * @see #getColumn() - * @generated - */ - public EAttribute getColumn_PropertyName() - { - return (EAttribute)columnEClass.getEStructuralFeatures().get(6); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Column#getTable Table}'. - * - * - * @return the meta object for the attribute 'Table'. - * @see org.apache.tuscany.das.rdb.config.Column#getTable() - * @see #getColumn() - * @generated - */ - public EAttribute getColumn_Table() - { - return (EAttribute)columnEClass.getEStructuralFeatures().get(7); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.config.Command Command}'. - * - * - * @return the meta object for class 'Command'. - * @see org.apache.tuscany.das.rdb.config.Command - * @generated - */ - public EClass getCommand() - { - return commandEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.config.Command#getParameter Parameter}'. - * - * - * @return the meta object for the containment reference list 'Parameter'. - * @see org.apache.tuscany.das.rdb.config.Command#getParameter() - * @see #getCommand() - * @generated - */ - public EReference getCommand_Parameter() - { - return (EReference)commandEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.config.Command#getResultDescriptor Result Descriptor}'. - * - * - * @return the meta object for the containment reference list 'Result Descriptor'. - * @see org.apache.tuscany.das.rdb.config.Command#getResultDescriptor() - * @see #getCommand() - * @generated - */ - public EReference getCommand_ResultDescriptor() - { - return (EReference)commandEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Command#getConfig Config}'. - * - * - * @return the meta object for the attribute 'Config'. - * @see org.apache.tuscany.das.rdb.config.Command#getConfig() - * @see #getCommand() - * @generated - */ - public EAttribute getCommand_Config() - { - return (EAttribute)commandEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Command#getKind Kind}'. - * - * - * @return the meta object for the attribute 'Kind'. - * @see org.apache.tuscany.das.rdb.config.Command#getKind() - * @see #getCommand() - * @generated - */ - public EAttribute getCommand_Kind() - { - return (EAttribute)commandEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Command#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.apache.tuscany.das.rdb.config.Command#getName() - * @see #getCommand() - * @generated - */ - public EAttribute getCommand_Name() - { - return (EAttribute)commandEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Command#getSQL SQL}'. - * - * - * @return the meta object for the attribute 'SQL'. - * @see org.apache.tuscany.das.rdb.config.Command#getSQL() - * @see #getCommand() - * @generated - */ - public EAttribute getCommand_SQL() - { - return (EAttribute)commandEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.config.Config Config}'. - * - * - * @return the meta object for class 'Config'. - * @see org.apache.tuscany.das.rdb.config.Config - * @generated - */ - public EClass getConfig() - { - return configEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.config.Config#getCommand Command}'. - * - * - * @return the meta object for the containment reference list 'Command'. - * @see org.apache.tuscany.das.rdb.config.Config#getCommand() - * @see #getConfig() - * @generated - */ - public EReference getConfig_Command() - { - return (EReference)configEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference '{@link org.apache.tuscany.das.rdb.config.Config#getConnectionProperties Connection Properties}'. - * - * - * @return the meta object for the containment reference 'Connection Properties'. - * @see org.apache.tuscany.das.rdb.config.Config#getConnectionProperties() - * @see #getConfig() - * @generated - */ - public EReference getConfig_ConnectionProperties() - { - return (EReference)configEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.config.Config#getTable Table}'. - * - * - * @return the meta object for the containment reference list 'Table'. - * @see org.apache.tuscany.das.rdb.config.Config#getTable() - * @see #getConfig() - * @generated - */ - public EReference getConfig_Table() - { - return (EReference)configEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.config.Config#getRelationship Relationship}'. - * - * - * @return the meta object for the containment reference list 'Relationship'. - * @see org.apache.tuscany.das.rdb.config.Config#getRelationship() - * @see #getConfig() - * @generated - */ - public EReference getConfig_Relationship() - { - return (EReference)configEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Config#getUri Uri}'. - * - * - * @return the meta object for the attribute 'Uri'. - * @see org.apache.tuscany.das.rdb.config.Config#getUri() - * @see #getConfig() - * @generated - */ - public EAttribute getConfig_Uri() - { - return (EAttribute)configEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties Connection Properties}'. - * - * - * @return the meta object for class 'Connection Properties'. - * @see org.apache.tuscany.das.rdb.config.ConnectionProperties - * @generated - */ - public EClass getConnectionProperties() - { - return connectionPropertiesEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getConfig Config}'. - * - * - * @return the meta object for the attribute 'Config'. - * @see org.apache.tuscany.das.rdb.config.ConnectionProperties#getConfig() - * @see #getConnectionProperties() - * @generated - */ - public EAttribute getConnectionProperties_Config() - { - return (EAttribute)connectionPropertiesEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDataSource Data Source}'. - * - * - * @return the meta object for the attribute 'Data Source'. - * @see org.apache.tuscany.das.rdb.config.ConnectionProperties#getDataSource() - * @see #getConnectionProperties() - * @generated - */ - public EAttribute getConnectionProperties_DataSource() - { - return (EAttribute)connectionPropertiesEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverClassName Driver Class Name}'. - * - * - * @return the meta object for the attribute 'Driver Class Name'. - * @see org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverClassName() - * @see #getConnectionProperties() - * @generated - */ - public EAttribute getConnectionProperties_DriverClassName() - { - return (EAttribute)connectionPropertiesEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverPassword Driver Password}'. - * - * - * @return the meta object for the attribute 'Driver Password'. - * @see org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverPassword() - * @see #getConnectionProperties() - * @generated - */ - public EAttribute getConnectionProperties_DriverPassword() - { - return (EAttribute)connectionPropertiesEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverURL Driver URL}'. - * - * - * @return the meta object for the attribute 'Driver URL'. - * @see org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverURL() - * @see #getConnectionProperties() - * @generated - */ - public EAttribute getConnectionProperties_DriverURL() - { - return (EAttribute)connectionPropertiesEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverUserName Driver User Name}'. - * - * - * @return the meta object for the attribute 'Driver User Name'. - * @see org.apache.tuscany.das.rdb.config.ConnectionProperties#getDriverUserName() - * @see #getConnectionProperties() - * @generated - */ - public EAttribute getConnectionProperties_DriverUserName() - { - return (EAttribute)connectionPropertiesEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.config.KeyPair Key Pair}'. - * - * - * @return the meta object for class 'Key Pair'. - * @see org.apache.tuscany.das.rdb.config.KeyPair - * @generated - */ - public EClass getKeyPair() - { - return keyPairEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.KeyPair#getForeignKeyColumn Foreign Key Column}'. - * - * - * @return the meta object for the attribute 'Foreign Key Column'. - * @see org.apache.tuscany.das.rdb.config.KeyPair#getForeignKeyColumn() - * @see #getKeyPair() - * @generated - */ - public EAttribute getKeyPair_ForeignKeyColumn() - { - return (EAttribute)keyPairEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.KeyPair#getPrimaryKeyColumn Primary Key Column}'. - * - * - * @return the meta object for the attribute 'Primary Key Column'. - * @see org.apache.tuscany.das.rdb.config.KeyPair#getPrimaryKeyColumn() - * @see #getKeyPair() - * @generated - */ - public EAttribute getKeyPair_PrimaryKeyColumn() - { - return (EAttribute)keyPairEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.KeyPair#getRelationship Relationship}'. - * - * - * @return the meta object for the attribute 'Relationship'. - * @see org.apache.tuscany.das.rdb.config.KeyPair#getRelationship() - * @see #getKeyPair() - * @generated - */ - public EAttribute getKeyPair_Relationship() - { - return (EAttribute)keyPairEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.config.Parameter Parameter}'. - * - * - * @return the meta object for class 'Parameter'. - * @see org.apache.tuscany.das.rdb.config.Parameter - * @generated - */ - public EClass getParameter() - { - return parameterEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Parameter#getColumnType Column Type}'. - * - * - * @return the meta object for the attribute 'Column Type'. - * @see org.apache.tuscany.das.rdb.config.Parameter#getColumnType() - * @see #getParameter() - * @generated - */ - public EAttribute getParameter_ColumnType() - { - return (EAttribute)parameterEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Parameter#getCommand Command}'. - * - * - * @return the meta object for the attribute 'Command'. - * @see org.apache.tuscany.das.rdb.config.Parameter#getCommand() - * @see #getParameter() - * @generated - */ - public EAttribute getParameter_Command() - { - return (EAttribute)parameterEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Parameter#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.apache.tuscany.das.rdb.config.Parameter#getName() - * @see #getParameter() - * @generated - */ - public EAttribute getParameter_Name() - { - return (EAttribute)parameterEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.config.Relationship Relationship}'. - * - * - * @return the meta object for class 'Relationship'. - * @see org.apache.tuscany.das.rdb.config.Relationship - * @generated - */ - public EClass getRelationship() - { - return relationshipEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.config.Relationship#getKeyPair Key Pair}'. - * - * - * @return the meta object for the containment reference list 'Key Pair'. - * @see org.apache.tuscany.das.rdb.config.Relationship#getKeyPair() - * @see #getRelationship() - * @generated - */ - public EReference getRelationship_KeyPair() - { - return (EReference)relationshipEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Relationship#getConfig Config}'. - * - * - * @return the meta object for the attribute 'Config'. - * @see org.apache.tuscany.das.rdb.config.Relationship#getConfig() - * @see #getRelationship() - * @generated - */ - public EAttribute getRelationship_Config() - { - return (EAttribute)relationshipEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Relationship#getForeignKeyTable Foreign Key Table}'. - * - * - * @return the meta object for the attribute 'Foreign Key Table'. - * @see org.apache.tuscany.das.rdb.config.Relationship#getForeignKeyTable() - * @see #getRelationship() - * @generated - */ - public EAttribute getRelationship_ForeignKeyTable() - { - return (EAttribute)relationshipEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Relationship#isMany Many}'. - * - * - * @return the meta object for the attribute 'Many'. - * @see org.apache.tuscany.das.rdb.config.Relationship#isMany() - * @see #getRelationship() - * @generated - */ - public EAttribute getRelationship_Many() - { - return (EAttribute)relationshipEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Relationship#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.apache.tuscany.das.rdb.config.Relationship#getName() - * @see #getRelationship() - * @generated - */ - public EAttribute getRelationship_Name() - { - return (EAttribute)relationshipEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Relationship#getPrimaryKeyTable Primary Key Table}'. - * - * - * @return the meta object for the attribute 'Primary Key Table'. - * @see org.apache.tuscany.das.rdb.config.Relationship#getPrimaryKeyTable() - * @see #getRelationship() - * @generated - */ - public EAttribute getRelationship_PrimaryKeyTable() - { - return (EAttribute)relationshipEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor Result Descriptor}'. - * - * - * @return the meta object for class 'Result Descriptor'. - * @see org.apache.tuscany.das.rdb.config.ResultDescriptor - * @generated - */ - public EClass getResultDescriptor() - { - return resultDescriptorEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getColumnName Column Name}'. - * - * - * @return the meta object for the attribute 'Column Name'. - * @see org.apache.tuscany.das.rdb.config.ResultDescriptor#getColumnName() - * @see #getResultDescriptor() - * @generated - */ - public EAttribute getResultDescriptor_ColumnName() - { - return (EAttribute)resultDescriptorEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getColumnType Column Type}'. - * - * - * @return the meta object for the attribute 'Column Type'. - * @see org.apache.tuscany.das.rdb.config.ResultDescriptor#getColumnType() - * @see #getResultDescriptor() - * @generated - */ - public EAttribute getResultDescriptor_ColumnType() - { - return (EAttribute)resultDescriptorEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getCommand Command}'. - * - * - * @return the meta object for the attribute 'Command'. - * @see org.apache.tuscany.das.rdb.config.ResultDescriptor#getCommand() - * @see #getResultDescriptor() - * @generated - */ - public EAttribute getResultDescriptor_Command() - { - return (EAttribute)resultDescriptorEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getConverter Converter}'. - * - * - * @return the meta object for the attribute 'Converter'. - * @see org.apache.tuscany.das.rdb.config.ResultDescriptor#getConverter() - * @see #getResultDescriptor() - * @generated - */ - public EAttribute getResultDescriptor_Converter() - { - return (EAttribute)resultDescriptorEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getTableName Table Name}'. - * - * - * @return the meta object for the attribute 'Table Name'. - * @see org.apache.tuscany.das.rdb.config.ResultDescriptor#getTableName() - * @see #getResultDescriptor() - * @generated - */ - public EAttribute getResultDescriptor_TableName() - { - return (EAttribute)resultDescriptorEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.config.Table Table}'. - * - * - * @return the meta object for class 'Table'. - * @see org.apache.tuscany.das.rdb.config.Table - * @generated - */ - public EClass getTable() - { - return tableEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.config.Table#getColumn Column}'. - * - * - * @return the meta object for the containment reference list 'Column'. - * @see org.apache.tuscany.das.rdb.config.Table#getColumn() - * @see #getTable() - * @generated - */ - public EReference getTable_Column() - { - return (EReference)tableEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Table#getConfig Config}'. - * - * - * @return the meta object for the attribute 'Config'. - * @see org.apache.tuscany.das.rdb.config.Table#getConfig() - * @see #getTable() - * @generated - */ - public EAttribute getTable_Config() - { - return (EAttribute)tableEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Table#getCreate Create}'. - * - * - * @return the meta object for the attribute 'Create'. - * @see org.apache.tuscany.das.rdb.config.Table#getCreate() - * @see #getTable() - * @generated - */ - public EAttribute getTable_Create() - { - return (EAttribute)tableEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Table#getDelete Delete}'. - * - * - * @return the meta object for the attribute 'Delete'. - * @see org.apache.tuscany.das.rdb.config.Table#getDelete() - * @see #getTable() - * @generated - */ - public EAttribute getTable_Delete() - { - return (EAttribute)tableEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Table#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.apache.tuscany.das.rdb.config.Table#getName() - * @see #getTable() - * @generated - */ - public EAttribute getTable_Name() - { - return (EAttribute)tableEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Table#getPropertyName Property Name}'. - * - * - * @return the meta object for the attribute 'Property Name'. - * @see org.apache.tuscany.das.rdb.config.Table#getPropertyName() - * @see #getTable() - * @generated - */ - public EAttribute getTable_PropertyName() - { - return (EAttribute)tableEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.config.Table#getUpdate Update}'. - * - * - * @return the meta object for the attribute 'Update'. - * @see org.apache.tuscany.das.rdb.config.Table#getUpdate() - * @see #getTable() - * @generated - */ - public EAttribute getTable_Update() - { - return (EAttribute)tableEClass.getEStructuralFeatures().get(6); - } - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - public ConfigFactory getConfigFactory() - { - return (ConfigFactory)getEFactoryInstance(); - } - - /** - * - * - * @generated - */ - private boolean isCreated = false; - - /** - * Creates the meta-model objects for the package. This method is - * guarded to have no affect on any invocation but its first. - * - * - * @generated - */ - public void createPackageContents() - { - if (isCreated) return; - isCreated = true; - - // Create classes and their features - columnEClass = createEClass(COLUMN); - createEAttribute(columnEClass, COLUMN__COLLISION); - createEAttribute(columnEClass, COLUMN__COLUMN_TYPE); - createEAttribute(columnEClass, COLUMN__CONVERTER_CLASS_NAME); - createEAttribute(columnEClass, COLUMN__GENERATED); - createEAttribute(columnEClass, COLUMN__NAME); - createEAttribute(columnEClass, COLUMN__PRIMARY_KEY); - createEAttribute(columnEClass, COLUMN__PROPERTY_NAME); - createEAttribute(columnEClass, COLUMN__TABLE); - - commandEClass = createEClass(COMMAND); - createEReference(commandEClass, COMMAND__PARAMETER); - createEReference(commandEClass, COMMAND__RESULT_DESCRIPTOR); - createEAttribute(commandEClass, COMMAND__CONFIG); - createEAttribute(commandEClass, COMMAND__KIND); - createEAttribute(commandEClass, COMMAND__NAME); - createEAttribute(commandEClass, COMMAND__SQL); - - configEClass = createEClass(CONFIG); - createEReference(configEClass, CONFIG__COMMAND); - createEReference(configEClass, CONFIG__CONNECTION_PROPERTIES); - createEReference(configEClass, CONFIG__TABLE); - createEReference(configEClass, CONFIG__RELATIONSHIP); - createEAttribute(configEClass, CONFIG__URI); - - connectionPropertiesEClass = createEClass(CONNECTION_PROPERTIES); - createEAttribute(connectionPropertiesEClass, CONNECTION_PROPERTIES__CONFIG); - createEAttribute(connectionPropertiesEClass, CONNECTION_PROPERTIES__DATA_SOURCE); - createEAttribute(connectionPropertiesEClass, CONNECTION_PROPERTIES__DRIVER_CLASS_NAME); - createEAttribute(connectionPropertiesEClass, CONNECTION_PROPERTIES__DRIVER_PASSWORD); - createEAttribute(connectionPropertiesEClass, CONNECTION_PROPERTIES__DRIVER_URL); - createEAttribute(connectionPropertiesEClass, CONNECTION_PROPERTIES__DRIVER_USER_NAME); - - keyPairEClass = createEClass(KEY_PAIR); - createEAttribute(keyPairEClass, KEY_PAIR__FOREIGN_KEY_COLUMN); - createEAttribute(keyPairEClass, KEY_PAIR__PRIMARY_KEY_COLUMN); - createEAttribute(keyPairEClass, KEY_PAIR__RELATIONSHIP); - - parameterEClass = createEClass(PARAMETER); - createEAttribute(parameterEClass, PARAMETER__COLUMN_TYPE); - createEAttribute(parameterEClass, PARAMETER__COMMAND); - createEAttribute(parameterEClass, PARAMETER__NAME); - - relationshipEClass = createEClass(RELATIONSHIP); - createEReference(relationshipEClass, RELATIONSHIP__KEY_PAIR); - createEAttribute(relationshipEClass, RELATIONSHIP__CONFIG); - createEAttribute(relationshipEClass, RELATIONSHIP__FOREIGN_KEY_TABLE); - createEAttribute(relationshipEClass, RELATIONSHIP__MANY); - createEAttribute(relationshipEClass, RELATIONSHIP__NAME); - createEAttribute(relationshipEClass, RELATIONSHIP__PRIMARY_KEY_TABLE); - - resultDescriptorEClass = createEClass(RESULT_DESCRIPTOR); - createEAttribute(resultDescriptorEClass, RESULT_DESCRIPTOR__COLUMN_NAME); - createEAttribute(resultDescriptorEClass, RESULT_DESCRIPTOR__COLUMN_TYPE); - createEAttribute(resultDescriptorEClass, RESULT_DESCRIPTOR__COMMAND); - createEAttribute(resultDescriptorEClass, RESULT_DESCRIPTOR__CONVERTER); - createEAttribute(resultDescriptorEClass, RESULT_DESCRIPTOR__TABLE_NAME); - - tableEClass = createEClass(TABLE); - createEReference(tableEClass, TABLE__COLUMN); - createEAttribute(tableEClass, TABLE__CONFIG); - createEAttribute(tableEClass, TABLE__CREATE); - createEAttribute(tableEClass, TABLE__DELETE); - createEAttribute(tableEClass, TABLE__NAME); - createEAttribute(tableEClass, TABLE__PROPERTY_NAME); - createEAttribute(tableEClass, TABLE__UPDATE); - } - - /** - * - * - * @generated - */ - private boolean isInitialized = false; - - /** - * Complete the initialization of the package and its meta-model. This - * method is guarded to have no affect on any invocation but its first. - * - * - * @generated - */ - public void initializePackageContents() - { - if (isInitialized) return; - isInitialized = true; - - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - - // Obtain other dependent packages - XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); - - // Add supertypes to classes - - // Initialize classes and features; add operations and parameters - initEClass(columnEClass, Column.class, "Column", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getColumn_Collision(), theXMLTypePackage.getBoolean(), "collision", null, 0, 1, Column.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getColumn_ColumnType(), theXMLTypePackage.getString(), "columnType", null, 0, 1, Column.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getColumn_ConverterClassName(), theXMLTypePackage.getString(), "converterClassName", null, 0, 1, Column.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getColumn_Generated(), theXMLTypePackage.getBoolean(), "generated", null, 0, 1, Column.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getColumn_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, Column.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getColumn_PrimaryKey(), theXMLTypePackage.getBoolean(), "primaryKey", null, 0, 1, Column.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getColumn_PropertyName(), theXMLTypePackage.getString(), "propertyName", null, 0, 1, Column.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getColumn_Table(), theXMLTypePackage.getAnyURI(), "table", null, 0, 1, Column.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(commandEClass, Command.class, "Command", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getCommand_Parameter(), this.getParameter(), null, "parameter", null, 0, -1, Command.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getCommand_ResultDescriptor(), this.getResultDescriptor(), null, "resultDescriptor", null, 0, -1, Command.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCommand_Config(), theXMLTypePackage.getAnyURI(), "config", null, 0, 1, Command.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCommand_Kind(), theXMLTypePackage.getString(), "kind", null, 0, 1, Command.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCommand_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, Command.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCommand_SQL(), theXMLTypePackage.getString(), "sQL", null, 0, 1, Command.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(configEClass, Config.class, "Config", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getConfig_Command(), this.getCommand(), null, "command", null, 0, -1, Config.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getConfig_ConnectionProperties(), this.getConnectionProperties(), null, "connectionProperties", null, 0, 1, Config.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getConfig_Table(), this.getTable(), null, "table", null, 0, -1, Config.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getConfig_Relationship(), this.getRelationship(), null, "relationship", null, 0, -1, Config.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getConfig_Uri(), theXMLTypePackage.getString(), "uri", null, 0, 1, Config.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(connectionPropertiesEClass, ConnectionProperties.class, "ConnectionProperties", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getConnectionProperties_Config(), theXMLTypePackage.getAnyURI(), "config", null, 0, 1, ConnectionProperties.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getConnectionProperties_DataSource(), theXMLTypePackage.getString(), "dataSource", null, 0, 1, ConnectionProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getConnectionProperties_DriverClassName(), theXMLTypePackage.getString(), "driverClassName", null, 0, 1, ConnectionProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getConnectionProperties_DriverPassword(), theXMLTypePackage.getString(), "driverPassword", null, 0, 1, ConnectionProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getConnectionProperties_DriverURL(), theXMLTypePackage.getString(), "driverURL", null, 0, 1, ConnectionProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getConnectionProperties_DriverUserName(), theXMLTypePackage.getString(), "driverUserName", null, 0, 1, ConnectionProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(keyPairEClass, KeyPair.class, "KeyPair", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getKeyPair_ForeignKeyColumn(), theXMLTypePackage.getString(), "foreignKeyColumn", null, 0, 1, KeyPair.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getKeyPair_PrimaryKeyColumn(), theXMLTypePackage.getString(), "primaryKeyColumn", null, 0, 1, KeyPair.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getKeyPair_Relationship(), theXMLTypePackage.getAnyURI(), "relationship", null, 0, 1, KeyPair.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(parameterEClass, Parameter.class, "Parameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getParameter_ColumnType(), theXMLTypePackage.getString(), "columnType", null, 0, 1, Parameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getParameter_Command(), theXMLTypePackage.getAnyURI(), "command", null, 0, 1, Parameter.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getParameter_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, Parameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(relationshipEClass, Relationship.class, "Relationship", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getRelationship_KeyPair(), this.getKeyPair(), null, "keyPair", null, 0, -1, Relationship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getRelationship_Config(), theXMLTypePackage.getAnyURI(), "config", null, 0, 1, Relationship.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getRelationship_ForeignKeyTable(), theXMLTypePackage.getString(), "foreignKeyTable", null, 0, 1, Relationship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getRelationship_Many(), theXMLTypePackage.getBoolean(), "many", null, 0, 1, Relationship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getRelationship_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, Relationship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getRelationship_PrimaryKeyTable(), theXMLTypePackage.getString(), "primaryKeyTable", null, 0, 1, Relationship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(resultDescriptorEClass, ResultDescriptor.class, "ResultDescriptor", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getResultDescriptor_ColumnName(), theXMLTypePackage.getString(), "columnName", null, 0, 1, ResultDescriptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getResultDescriptor_ColumnType(), theXMLTypePackage.getString(), "columnType", null, 0, 1, ResultDescriptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getResultDescriptor_Command(), theXMLTypePackage.getAnyURI(), "command", null, 0, 1, ResultDescriptor.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getResultDescriptor_Converter(), theXMLTypePackage.getString(), "converter", null, 0, 1, ResultDescriptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getResultDescriptor_TableName(), theXMLTypePackage.getString(), "tableName", null, 0, 1, ResultDescriptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(tableEClass, Table.class, "Table", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getTable_Column(), this.getColumn(), null, "column", null, 0, -1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getTable_Config(), theXMLTypePackage.getAnyURI(), "config", null, 0, 1, Table.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getTable_Create(), theXMLTypePackage.getString(), "create", null, 0, 1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getTable_Delete(), theXMLTypePackage.getString(), "delete", null, 0, 1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getTable_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getTable_PropertyName(), theXMLTypePackage.getString(), "propertyName", null, 0, 1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getTable_Update(), theXMLTypePackage.getString(), "update", null, 0, 1, Table.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - // Create resource - createResource(eNS_URI); - - // Create annotations - // http:///org/eclipse/emf/ecore/util/ExtendedMetaData - createExtendedMetaDataAnnotations(); - } - - /** - * Initializes the annotations for http:///org/eclipse/emf/ecore/util/ExtendedMetaData. - * - * - * @generated - */ - protected void createExtendedMetaDataAnnotations() - { - String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; - addAnnotation - (columnEClass, - source, - new String[] - { - "name", "Column", - "kind", "empty" - }); - addAnnotation - (getColumn_Collision(), - source, - new String[] - { - "kind", "attribute", - "name", "collision" - }); - addAnnotation - (getColumn_ColumnType(), - source, - new String[] - { - "kind", "attribute", - "name", "columnType" - }); - addAnnotation - (getColumn_ConverterClassName(), - source, - new String[] - { - "kind", "attribute", - "name", "converterClassName" - }); - addAnnotation - (getColumn_Generated(), - source, - new String[] - { - "kind", "attribute", - "name", "generated" - }); - addAnnotation - (getColumn_Name(), - source, - new String[] - { - "kind", "attribute", - "name", "name" - }); - addAnnotation - (getColumn_PrimaryKey(), - source, - new String[] - { - "kind", "attribute", - "name", "primaryKey" - }); - addAnnotation - (getColumn_PropertyName(), - source, - new String[] - { - "kind", "attribute", - "name", "propertyName" - }); - addAnnotation - (getColumn_Table(), - source, - new String[] - { - "kind", "attribute", - "name", "Table" - }); - addAnnotation - (commandEClass, - source, - new String[] - { - "name", "Command", - "kind", "elementOnly" - }); - addAnnotation - (getCommand_Parameter(), - source, - new String[] - { - "kind", "element", - "name", "Parameter" - }); - addAnnotation - (getCommand_ResultDescriptor(), - source, - new String[] - { - "kind", "element", - "name", "ResultDescriptor" - }); - addAnnotation - (getCommand_Config(), - source, - new String[] - { - "kind", "attribute", - "name", "Config" - }); - addAnnotation - (getCommand_Kind(), - source, - new String[] - { - "kind", "attribute", - "name", "kind" - }); - addAnnotation - (getCommand_Name(), - source, - new String[] - { - "kind", "attribute", - "name", "name" - }); - addAnnotation - (getCommand_SQL(), - source, - new String[] - { - "kind", "attribute", - "name", "SQL" - }); - addAnnotation - (configEClass, - source, - new String[] - { - "name", "Config", - "kind", "elementOnly" - }); - addAnnotation - (getConfig_Command(), - source, - new String[] - { - "kind", "element", - "name", "Command" - }); - addAnnotation - (getConfig_ConnectionProperties(), - source, - new String[] - { - "kind", "element", - "name", "ConnectionProperties" - }); - addAnnotation - (getConfig_Table(), - source, - new String[] - { - "kind", "element", - "name", "Table" - }); - addAnnotation - (getConfig_Relationship(), - source, - new String[] - { - "kind", "element", - "name", "Relationship" - }); - addAnnotation - (getConfig_Uri(), - source, - new String[] - { - "kind", "attribute", - "name", "uri" - }); - addAnnotation - (connectionPropertiesEClass, - source, - new String[] - { - "name", "ConnectionProperties", - "kind", "empty" - }); - addAnnotation - (getConnectionProperties_Config(), - source, - new String[] - { - "kind", "attribute", - "name", "Config" - }); - addAnnotation - (getConnectionProperties_DataSource(), - source, - new String[] - { - "kind", "attribute", - "name", "dataSource" - }); - addAnnotation - (getConnectionProperties_DriverClassName(), - source, - new String[] - { - "kind", "attribute", - "name", "driverClassName" - }); - addAnnotation - (getConnectionProperties_DriverPassword(), - source, - new String[] - { - "kind", "attribute", - "name", "driverPassword" - }); - addAnnotation - (getConnectionProperties_DriverURL(), - source, - new String[] - { - "kind", "attribute", - "name", "driverURL" - }); - addAnnotation - (getConnectionProperties_DriverUserName(), - source, - new String[] - { - "kind", "attribute", - "name", "driverUserName" - }); - addAnnotation - (keyPairEClass, - source, - new String[] - { - "name", "KeyPair", - "kind", "empty" - }); - addAnnotation - (getKeyPair_ForeignKeyColumn(), - source, - new String[] - { - "kind", "attribute", - "name", "foreignKeyColumn" - }); - addAnnotation - (getKeyPair_PrimaryKeyColumn(), - source, - new String[] - { - "kind", "attribute", - "name", "primaryKeyColumn" - }); - addAnnotation - (getKeyPair_Relationship(), - source, - new String[] - { - "kind", "attribute", - "name", "Relationship" - }); - addAnnotation - (parameterEClass, - source, - new String[] - { - "name", "Parameter", - "kind", "empty" - }); - addAnnotation - (getParameter_ColumnType(), - source, - new String[] - { - "kind", "attribute", - "name", "columnType" - }); - addAnnotation - (getParameter_Command(), - source, - new String[] - { - "kind", "attribute", - "name", "Command" - }); - addAnnotation - (getParameter_Name(), - source, - new String[] - { - "kind", "attribute", - "name", "name" - }); - addAnnotation - (relationshipEClass, - source, - new String[] - { - "name", "Relationship", - "kind", "elementOnly" - }); - addAnnotation - (getRelationship_KeyPair(), - source, - new String[] - { - "kind", "element", - "name", "KeyPair" - }); - addAnnotation - (getRelationship_Config(), - source, - new String[] - { - "kind", "attribute", - "name", "Config" - }); - addAnnotation - (getRelationship_ForeignKeyTable(), - source, - new String[] - { - "kind", "attribute", - "name", "foreignKeyTable" - }); - addAnnotation - (getRelationship_Many(), - source, - new String[] - { - "kind", "attribute", - "name", "many" - }); - addAnnotation - (getRelationship_Name(), - source, - new String[] - { - "kind", "attribute", - "name", "name" - }); - addAnnotation - (getRelationship_PrimaryKeyTable(), - source, - new String[] - { - "kind", "attribute", - "name", "primaryKeyTable" - }); - addAnnotation - (resultDescriptorEClass, - source, - new String[] - { - "name", "ResultDescriptor", - "kind", "empty" - }); - addAnnotation - (getResultDescriptor_ColumnName(), - source, - new String[] - { - "kind", "attribute", - "name", "columnName" - }); - addAnnotation - (getResultDescriptor_ColumnType(), - source, - new String[] - { - "kind", "attribute", - "name", "columnType" - }); - addAnnotation - (getResultDescriptor_Command(), - source, - new String[] - { - "kind", "attribute", - "name", "Command" - }); - addAnnotation - (getResultDescriptor_Converter(), - source, - new String[] - { - "kind", "attribute", - "name", "converter" - }); - addAnnotation - (getResultDescriptor_TableName(), - source, - new String[] - { - "kind", "attribute", - "name", "tableName" - }); - addAnnotation - (tableEClass, - source, - new String[] - { - "name", "Table", - "kind", "elementOnly" - }); - addAnnotation - (getTable_Column(), - source, - new String[] - { - "kind", "element", - "name", "Column" - }); - addAnnotation - (getTable_Config(), - source, - new String[] - { - "kind", "attribute", - "name", "Config" - }); - addAnnotation - (getTable_Create(), - source, - new String[] - { - "kind", "attribute", - "name", "create" - }); - addAnnotation - (getTable_Delete(), - source, - new String[] - { - "kind", "attribute", - "name", "delete" - }); - addAnnotation - (getTable_Name(), - source, - new String[] - { - "kind", "attribute", - "name", "name" - }); - addAnnotation - (getTable_PropertyName(), - source, - new String[] - { - "kind", "attribute", - "name", "propertyName" - }); - addAnnotation - (getTable_Update(), - source, - new String[] - { - "kind", "attribute", - "name", "update" - }); - } - - /** - * - * Defines literals for the meta objects that represent - *

    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @generated - */ - public interface Literals - { - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.config.impl.ColumnImpl Column}' class. - * - * - * @see org.apache.tuscany.das.rdb.config.impl.ColumnImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getColumn() - * @generated - */ - public static final EClass COLUMN = eINSTANCE.getColumn(); - - /** - * The meta object literal for the 'Collision' attribute feature. - * - * - * @generated - */ - public static final EAttribute COLUMN__COLLISION = eINSTANCE.getColumn_Collision(); - - /** - * The meta object literal for the 'Column Type' attribute feature. - * - * - * @generated - */ - public static final EAttribute COLUMN__COLUMN_TYPE = eINSTANCE.getColumn_ColumnType(); - - /** - * The meta object literal for the 'Converter Class Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute COLUMN__CONVERTER_CLASS_NAME = eINSTANCE.getColumn_ConverterClassName(); - - /** - * The meta object literal for the 'Generated' attribute feature. - * - * - * @generated - */ - public static final EAttribute COLUMN__GENERATED = eINSTANCE.getColumn_Generated(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute COLUMN__NAME = eINSTANCE.getColumn_Name(); - - /** - * The meta object literal for the 'Primary Key' attribute feature. - * - * - * @generated - */ - public static final EAttribute COLUMN__PRIMARY_KEY = eINSTANCE.getColumn_PrimaryKey(); - - /** - * The meta object literal for the 'Property Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute COLUMN__PROPERTY_NAME = eINSTANCE.getColumn_PropertyName(); - - /** - * The meta object literal for the 'Table' attribute feature. - * - * - * @generated - */ - public static final EAttribute COLUMN__TABLE = eINSTANCE.getColumn_Table(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.config.impl.CommandImpl Command}' class. - * - * - * @see org.apache.tuscany.das.rdb.config.impl.CommandImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getCommand() - * @generated - */ - public static final EClass COMMAND = eINSTANCE.getCommand(); - - /** - * The meta object literal for the 'Parameter' containment reference list feature. - * - * - * @generated - */ - public static final EReference COMMAND__PARAMETER = eINSTANCE.getCommand_Parameter(); - - /** - * The meta object literal for the 'Result Descriptor' containment reference list feature. - * - * - * @generated - */ - public static final EReference COMMAND__RESULT_DESCRIPTOR = eINSTANCE.getCommand_ResultDescriptor(); - - /** - * The meta object literal for the 'Config' attribute feature. - * - * - * @generated - */ - public static final EAttribute COMMAND__CONFIG = eINSTANCE.getCommand_Config(); - - /** - * The meta object literal for the 'Kind' attribute feature. - * - * - * @generated - */ - public static final EAttribute COMMAND__KIND = eINSTANCE.getCommand_Kind(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute COMMAND__NAME = eINSTANCE.getCommand_Name(); - - /** - * The meta object literal for the 'SQL' attribute feature. - * - * - * @generated - */ - public static final EAttribute COMMAND__SQL = eINSTANCE.getCommand_SQL(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.config.impl.ConfigImpl Config}' class. - * - * - * @see org.apache.tuscany.das.rdb.config.impl.ConfigImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getConfig() - * @generated - */ - public static final EClass CONFIG = eINSTANCE.getConfig(); - - /** - * The meta object literal for the 'Command' containment reference list feature. - * - * - * @generated - */ - public static final EReference CONFIG__COMMAND = eINSTANCE.getConfig_Command(); - - /** - * The meta object literal for the 'Connection Properties' containment reference feature. - * - * - * @generated - */ - public static final EReference CONFIG__CONNECTION_PROPERTIES = eINSTANCE.getConfig_ConnectionProperties(); - - /** - * The meta object literal for the 'Table' containment reference list feature. - * - * - * @generated - */ - public static final EReference CONFIG__TABLE = eINSTANCE.getConfig_Table(); - - /** - * The meta object literal for the 'Relationship' containment reference list feature. - * - * - * @generated - */ - public static final EReference CONFIG__RELATIONSHIP = eINSTANCE.getConfig_Relationship(); - - /** - * The meta object literal for the 'Uri' attribute feature. - * - * - * @generated - */ - public static final EAttribute CONFIG__URI = eINSTANCE.getConfig_Uri(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.config.impl.ConnectionPropertiesImpl Connection Properties}' class. - * - * - * @see org.apache.tuscany.das.rdb.config.impl.ConnectionPropertiesImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getConnectionProperties() - * @generated - */ - public static final EClass CONNECTION_PROPERTIES = eINSTANCE.getConnectionProperties(); - - /** - * The meta object literal for the 'Config' attribute feature. - * - * - * @generated - */ - public static final EAttribute CONNECTION_PROPERTIES__CONFIG = eINSTANCE.getConnectionProperties_Config(); - - /** - * The meta object literal for the 'Data Source' attribute feature. - * - * - * @generated - */ - public static final EAttribute CONNECTION_PROPERTIES__DATA_SOURCE = eINSTANCE.getConnectionProperties_DataSource(); - - /** - * The meta object literal for the 'Driver Class Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute CONNECTION_PROPERTIES__DRIVER_CLASS_NAME = eINSTANCE.getConnectionProperties_DriverClassName(); - - /** - * The meta object literal for the 'Driver Password' attribute feature. - * - * - * @generated - */ - public static final EAttribute CONNECTION_PROPERTIES__DRIVER_PASSWORD = eINSTANCE.getConnectionProperties_DriverPassword(); - - /** - * The meta object literal for the 'Driver URL' attribute feature. - * - * - * @generated - */ - public static final EAttribute CONNECTION_PROPERTIES__DRIVER_URL = eINSTANCE.getConnectionProperties_DriverURL(); - - /** - * The meta object literal for the 'Driver User Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute CONNECTION_PROPERTIES__DRIVER_USER_NAME = eINSTANCE.getConnectionProperties_DriverUserName(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.config.impl.KeyPairImpl Key Pair}' class. - * - * - * @see org.apache.tuscany.das.rdb.config.impl.KeyPairImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getKeyPair() - * @generated - */ - public static final EClass KEY_PAIR = eINSTANCE.getKeyPair(); - - /** - * The meta object literal for the 'Foreign Key Column' attribute feature. - * - * - * @generated - */ - public static final EAttribute KEY_PAIR__FOREIGN_KEY_COLUMN = eINSTANCE.getKeyPair_ForeignKeyColumn(); - - /** - * The meta object literal for the 'Primary Key Column' attribute feature. - * - * - * @generated - */ - public static final EAttribute KEY_PAIR__PRIMARY_KEY_COLUMN = eINSTANCE.getKeyPair_PrimaryKeyColumn(); - - /** - * The meta object literal for the 'Relationship' attribute feature. - * - * - * @generated - */ - public static final EAttribute KEY_PAIR__RELATIONSHIP = eINSTANCE.getKeyPair_Relationship(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.config.impl.ParameterImpl Parameter}' class. - * - * - * @see org.apache.tuscany.das.rdb.config.impl.ParameterImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getParameter() - * @generated - */ - public static final EClass PARAMETER = eINSTANCE.getParameter(); - - /** - * The meta object literal for the 'Column Type' attribute feature. - * - * - * @generated - */ - public static final EAttribute PARAMETER__COLUMN_TYPE = eINSTANCE.getParameter_ColumnType(); - - /** - * The meta object literal for the 'Command' attribute feature. - * - * - * @generated - */ - public static final EAttribute PARAMETER__COMMAND = eINSTANCE.getParameter_Command(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute PARAMETER__NAME = eINSTANCE.getParameter_Name(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl Relationship}' class. - * - * - * @see org.apache.tuscany.das.rdb.config.impl.RelationshipImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getRelationship() - * @generated - */ - public static final EClass RELATIONSHIP = eINSTANCE.getRelationship(); - - /** - * The meta object literal for the 'Key Pair' containment reference list feature. - * - * - * @generated - */ - public static final EReference RELATIONSHIP__KEY_PAIR = eINSTANCE.getRelationship_KeyPair(); - - /** - * The meta object literal for the 'Config' attribute feature. - * - * - * @generated - */ - public static final EAttribute RELATIONSHIP__CONFIG = eINSTANCE.getRelationship_Config(); - - /** - * The meta object literal for the 'Foreign Key Table' attribute feature. - * - * - * @generated - */ - public static final EAttribute RELATIONSHIP__FOREIGN_KEY_TABLE = eINSTANCE.getRelationship_ForeignKeyTable(); - - /** - * The meta object literal for the 'Many' attribute feature. - * - * - * @generated - */ - public static final EAttribute RELATIONSHIP__MANY = eINSTANCE.getRelationship_Many(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute RELATIONSHIP__NAME = eINSTANCE.getRelationship_Name(); - - /** - * The meta object literal for the 'Primary Key Table' attribute feature. - * - * - * @generated - */ - public static final EAttribute RELATIONSHIP__PRIMARY_KEY_TABLE = eINSTANCE.getRelationship_PrimaryKeyTable(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl Result Descriptor}' class. - * - * - * @see org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getResultDescriptor() - * @generated - */ - public static final EClass RESULT_DESCRIPTOR = eINSTANCE.getResultDescriptor(); - - /** - * The meta object literal for the 'Column Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute RESULT_DESCRIPTOR__COLUMN_NAME = eINSTANCE.getResultDescriptor_ColumnName(); - - /** - * The meta object literal for the 'Column Type' attribute feature. - * - * - * @generated - */ - public static final EAttribute RESULT_DESCRIPTOR__COLUMN_TYPE = eINSTANCE.getResultDescriptor_ColumnType(); - - /** - * The meta object literal for the 'Command' attribute feature. - * - * - * @generated - */ - public static final EAttribute RESULT_DESCRIPTOR__COMMAND = eINSTANCE.getResultDescriptor_Command(); - - /** - * The meta object literal for the 'Converter' attribute feature. - * - * - * @generated - */ - public static final EAttribute RESULT_DESCRIPTOR__CONVERTER = eINSTANCE.getResultDescriptor_Converter(); - - /** - * The meta object literal for the 'Table Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute RESULT_DESCRIPTOR__TABLE_NAME = eINSTANCE.getResultDescriptor_TableName(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.config.impl.TableImpl Table}' class. - * - * - * @see org.apache.tuscany.das.rdb.config.impl.TableImpl - * @see org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl#getTable() - * @generated - */ - public static final EClass TABLE = eINSTANCE.getTable(); - - /** - * The meta object literal for the 'Column' containment reference list feature. - * - * - * @generated - */ - public static final EReference TABLE__COLUMN = eINSTANCE.getTable_Column(); - - /** - * The meta object literal for the 'Config' attribute feature. - * - * - * @generated - */ - public static final EAttribute TABLE__CONFIG = eINSTANCE.getTable_Config(); - - /** - * The meta object literal for the 'Create' attribute feature. - * - * - * @generated - */ - public static final EAttribute TABLE__CREATE = eINSTANCE.getTable_Create(); - - /** - * The meta object literal for the 'Delete' attribute feature. - * - * - * @generated - */ - public static final EAttribute TABLE__DELETE = eINSTANCE.getTable_Delete(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute TABLE__NAME = eINSTANCE.getTable_Name(); - - /** - * The meta object literal for the 'Property Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute TABLE__PROPERTY_NAME = eINSTANCE.getTable_PropertyName(); - - /** - * The meta object literal for the 'Update' attribute feature. - * - * - * @generated - */ - public static final EAttribute TABLE__UPDATE = eINSTANCE.getTable_Update(); - - } - -} //ConfigPackageImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConnectionPropertiesImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConnectionPropertiesImpl.java deleted file mode 100644 index c961732dca..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ConnectionPropertiesImpl.java +++ /dev/null @@ -1,455 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import org.apache.tuscany.das.rdb.config.ConnectionProperties; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -/** - * - * An implementation of the model object 'Connection Properties'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.apache.tuscany.das.rdb.config.impl.ConnectionPropertiesImpl#getConfig Config}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.ConnectionPropertiesImpl#getDataSource Data Source}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.ConnectionPropertiesImpl#getDriverClassName Driver Class Name}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.ConnectionPropertiesImpl#getDriverPassword Driver Password}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.ConnectionPropertiesImpl#getDriverURL Driver URL}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.ConnectionPropertiesImpl#getDriverUserName Driver User Name}
  • - *
- *

- * - * @generated - */ -public class ConnectionPropertiesImpl extends DataObjectImpl implements ConnectionProperties -{ - /** - * The default value of the '{@link #getConfig() Config}' attribute. - * - * - * @see #getConfig() - * @generated - * @ordered - */ - protected static final String CONFIG_EDEFAULT = null; - - /** - * The cached value of the '{@link #getConfig() Config}' attribute. - * - * - * @see #getConfig() - * @generated - * @ordered - */ - protected String config = CONFIG_EDEFAULT; - - /** - * The default value of the '{@link #getDataSource() Data Source}' attribute. - * - * - * @see #getDataSource() - * @generated - * @ordered - */ - protected static final String DATA_SOURCE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDataSource() Data Source}' attribute. - * - * - * @see #getDataSource() - * @generated - * @ordered - */ - protected String dataSource = DATA_SOURCE_EDEFAULT; - - /** - * The default value of the '{@link #getDriverClassName() Driver Class Name}' attribute. - * - * - * @see #getDriverClassName() - * @generated - * @ordered - */ - protected static final String DRIVER_CLASS_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDriverClassName() Driver Class Name}' attribute. - * - * - * @see #getDriverClassName() - * @generated - * @ordered - */ - protected String driverClassName = DRIVER_CLASS_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getDriverPassword() Driver Password}' attribute. - * - * - * @see #getDriverPassword() - * @generated - * @ordered - */ - protected static final String DRIVER_PASSWORD_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDriverPassword() Driver Password}' attribute. - * - * - * @see #getDriverPassword() - * @generated - * @ordered - */ - protected String driverPassword = DRIVER_PASSWORD_EDEFAULT; - - /** - * The default value of the '{@link #getDriverURL() Driver URL}' attribute. - * - * - * @see #getDriverURL() - * @generated - * @ordered - */ - protected static final String DRIVER_URL_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDriverURL() Driver URL}' attribute. - * - * - * @see #getDriverURL() - * @generated - * @ordered - */ - protected String driverURL = DRIVER_URL_EDEFAULT; - - /** - * The default value of the '{@link #getDriverUserName() Driver User Name}' attribute. - * - * - * @see #getDriverUserName() - * @generated - * @ordered - */ - protected static final String DRIVER_USER_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDriverUserName() Driver User Name}' attribute. - * - * - * @see #getDriverUserName() - * @generated - * @ordered - */ - protected String driverUserName = DRIVER_USER_NAME_EDEFAULT; - - /** - * - * - * @generated - */ - protected ConnectionPropertiesImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return ConfigPackageImpl.Literals.CONNECTION_PROPERTIES; - } - - /** - * - * - * @generated - */ - public String getConfig() - { - return config; - } - - /** - * - * - * @generated - */ - public void setConfig(String newConfig) - { - String oldConfig = config; - config = newConfig; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.CONNECTION_PROPERTIES__CONFIG, oldConfig, config)); - } - - /** - * - * - * @generated - */ - public String getDataSource() - { - return dataSource; - } - - /** - * - * - * @generated - */ - public void setDataSource(String newDataSource) - { - String oldDataSource = dataSource; - dataSource = newDataSource; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.CONNECTION_PROPERTIES__DATA_SOURCE, oldDataSource, dataSource)); - } - - /** - * - * - * @generated - */ - public String getDriverClassName() - { - return driverClassName; - } - - /** - * - * - * @generated - */ - public void setDriverClassName(String newDriverClassName) - { - String oldDriverClassName = driverClassName; - driverClassName = newDriverClassName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_CLASS_NAME, oldDriverClassName, driverClassName)); - } - - /** - * - * - * @generated - */ - public String getDriverPassword() - { - return driverPassword; - } - - /** - * - * - * @generated - */ - public void setDriverPassword(String newDriverPassword) - { - String oldDriverPassword = driverPassword; - driverPassword = newDriverPassword; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_PASSWORD, oldDriverPassword, driverPassword)); - } - - /** - * - * - * @generated - */ - public String getDriverURL() - { - return driverURL; - } - - /** - * - * - * @generated - */ - public void setDriverURL(String newDriverURL) - { - String oldDriverURL = driverURL; - driverURL = newDriverURL; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_URL, oldDriverURL, driverURL)); - } - - /** - * - * - * @generated - */ - public String getDriverUserName() - { - return driverUserName; - } - - /** - * - * - * @generated - */ - public void setDriverUserName(String newDriverUserName) - { - String oldDriverUserName = driverUserName; - driverUserName = newDriverUserName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_USER_NAME, oldDriverUserName, driverUserName)); - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ConfigPackageImpl.CONNECTION_PROPERTIES__CONFIG: - return getConfig(); - case ConfigPackageImpl.CONNECTION_PROPERTIES__DATA_SOURCE: - return getDataSource(); - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_CLASS_NAME: - return getDriverClassName(); - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_PASSWORD: - return getDriverPassword(); - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_URL: - return getDriverURL(); - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_USER_NAME: - return getDriverUserName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ConfigPackageImpl.CONNECTION_PROPERTIES__CONFIG: - setConfig((String)newValue); - return; - case ConfigPackageImpl.CONNECTION_PROPERTIES__DATA_SOURCE: - setDataSource((String)newValue); - return; - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_CLASS_NAME: - setDriverClassName((String)newValue); - return; - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_PASSWORD: - setDriverPassword((String)newValue); - return; - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_URL: - setDriverURL((String)newValue); - return; - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_USER_NAME: - setDriverUserName((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.CONNECTION_PROPERTIES__CONFIG: - setConfig(CONFIG_EDEFAULT); - return; - case ConfigPackageImpl.CONNECTION_PROPERTIES__DATA_SOURCE: - setDataSource(DATA_SOURCE_EDEFAULT); - return; - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_CLASS_NAME: - setDriverClassName(DRIVER_CLASS_NAME_EDEFAULT); - return; - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_PASSWORD: - setDriverPassword(DRIVER_PASSWORD_EDEFAULT); - return; - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_URL: - setDriverURL(DRIVER_URL_EDEFAULT); - return; - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_USER_NAME: - setDriverUserName(DRIVER_USER_NAME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.CONNECTION_PROPERTIES__CONFIG: - return CONFIG_EDEFAULT == null ? config != null : !CONFIG_EDEFAULT.equals(config); - case ConfigPackageImpl.CONNECTION_PROPERTIES__DATA_SOURCE: - return DATA_SOURCE_EDEFAULT == null ? dataSource != null : !DATA_SOURCE_EDEFAULT.equals(dataSource); - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_CLASS_NAME: - return DRIVER_CLASS_NAME_EDEFAULT == null ? driverClassName != null : !DRIVER_CLASS_NAME_EDEFAULT.equals(driverClassName); - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_PASSWORD: - return DRIVER_PASSWORD_EDEFAULT == null ? driverPassword != null : !DRIVER_PASSWORD_EDEFAULT.equals(driverPassword); - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_URL: - return DRIVER_URL_EDEFAULT == null ? driverURL != null : !DRIVER_URL_EDEFAULT.equals(driverURL); - case ConfigPackageImpl.CONNECTION_PROPERTIES__DRIVER_USER_NAME: - return DRIVER_USER_NAME_EDEFAULT == null ? driverUserName != null : !DRIVER_USER_NAME_EDEFAULT.equals(driverUserName); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (config: "); - result.append(config); - result.append(", dataSource: "); - result.append(dataSource); - result.append(", driverClassName: "); - result.append(driverClassName); - result.append(", driverPassword: "); - result.append(driverPassword); - result.append(", driverURL: "); - result.append(driverURL); - result.append(", driverUserName: "); - result.append(driverUserName); - result.append(')'); - return result.toString(); - } - -} //ConnectionPropertiesImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/KeyPairImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/KeyPairImpl.java deleted file mode 100644 index f12c7a3ec1..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/KeyPairImpl.java +++ /dev/null @@ -1,287 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import org.apache.tuscany.das.rdb.config.KeyPair; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -/** - * - * An implementation of the model object 'Key Pair'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.apache.tuscany.das.rdb.config.impl.KeyPairImpl#getForeignKeyColumn Foreign Key Column}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.KeyPairImpl#getPrimaryKeyColumn Primary Key Column}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.KeyPairImpl#getRelationship Relationship}
  • - *
- *

- * - * @generated - */ -public class KeyPairImpl extends DataObjectImpl implements KeyPair -{ - /** - * The default value of the '{@link #getForeignKeyColumn() Foreign Key Column}' attribute. - * - * - * @see #getForeignKeyColumn() - * @generated - * @ordered - */ - protected static final String FOREIGN_KEY_COLUMN_EDEFAULT = null; - - /** - * The cached value of the '{@link #getForeignKeyColumn() Foreign Key Column}' attribute. - * - * - * @see #getForeignKeyColumn() - * @generated - * @ordered - */ - protected String foreignKeyColumn = FOREIGN_KEY_COLUMN_EDEFAULT; - - /** - * The default value of the '{@link #getPrimaryKeyColumn() Primary Key Column}' attribute. - * - * - * @see #getPrimaryKeyColumn() - * @generated - * @ordered - */ - protected static final String PRIMARY_KEY_COLUMN_EDEFAULT = null; - - /** - * The cached value of the '{@link #getPrimaryKeyColumn() Primary Key Column}' attribute. - * - * - * @see #getPrimaryKeyColumn() - * @generated - * @ordered - */ - protected String primaryKeyColumn = PRIMARY_KEY_COLUMN_EDEFAULT; - - /** - * The default value of the '{@link #getRelationship() Relationship}' attribute. - * - * - * @see #getRelationship() - * @generated - * @ordered - */ - protected static final String RELATIONSHIP_EDEFAULT = null; - - /** - * The cached value of the '{@link #getRelationship() Relationship}' attribute. - * - * - * @see #getRelationship() - * @generated - * @ordered - */ - protected String relationship = RELATIONSHIP_EDEFAULT; - - /** - * - * - * @generated - */ - protected KeyPairImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return ConfigPackageImpl.Literals.KEY_PAIR; - } - - /** - * - * - * @generated - */ - public String getForeignKeyColumn() - { - return foreignKeyColumn; - } - - /** - * - * - * @generated - */ - public void setForeignKeyColumn(String newForeignKeyColumn) - { - String oldForeignKeyColumn = foreignKeyColumn; - foreignKeyColumn = newForeignKeyColumn; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.KEY_PAIR__FOREIGN_KEY_COLUMN, oldForeignKeyColumn, foreignKeyColumn)); - } - - /** - * - * - * @generated - */ - public String getPrimaryKeyColumn() - { - return primaryKeyColumn; - } - - /** - * - * - * @generated - */ - public void setPrimaryKeyColumn(String newPrimaryKeyColumn) - { - String oldPrimaryKeyColumn = primaryKeyColumn; - primaryKeyColumn = newPrimaryKeyColumn; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.KEY_PAIR__PRIMARY_KEY_COLUMN, oldPrimaryKeyColumn, primaryKeyColumn)); - } - - /** - * - * - * @generated - */ - public String getRelationship() - { - return relationship; - } - - /** - * - * - * @generated - */ - public void setRelationship(String newRelationship) - { - String oldRelationship = relationship; - relationship = newRelationship; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.KEY_PAIR__RELATIONSHIP, oldRelationship, relationship)); - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ConfigPackageImpl.KEY_PAIR__FOREIGN_KEY_COLUMN: - return getForeignKeyColumn(); - case ConfigPackageImpl.KEY_PAIR__PRIMARY_KEY_COLUMN: - return getPrimaryKeyColumn(); - case ConfigPackageImpl.KEY_PAIR__RELATIONSHIP: - return getRelationship(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ConfigPackageImpl.KEY_PAIR__FOREIGN_KEY_COLUMN: - setForeignKeyColumn((String)newValue); - return; - case ConfigPackageImpl.KEY_PAIR__PRIMARY_KEY_COLUMN: - setPrimaryKeyColumn((String)newValue); - return; - case ConfigPackageImpl.KEY_PAIR__RELATIONSHIP: - setRelationship((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.KEY_PAIR__FOREIGN_KEY_COLUMN: - setForeignKeyColumn(FOREIGN_KEY_COLUMN_EDEFAULT); - return; - case ConfigPackageImpl.KEY_PAIR__PRIMARY_KEY_COLUMN: - setPrimaryKeyColumn(PRIMARY_KEY_COLUMN_EDEFAULT); - return; - case ConfigPackageImpl.KEY_PAIR__RELATIONSHIP: - setRelationship(RELATIONSHIP_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.KEY_PAIR__FOREIGN_KEY_COLUMN: - return FOREIGN_KEY_COLUMN_EDEFAULT == null ? foreignKeyColumn != null : !FOREIGN_KEY_COLUMN_EDEFAULT.equals(foreignKeyColumn); - case ConfigPackageImpl.KEY_PAIR__PRIMARY_KEY_COLUMN: - return PRIMARY_KEY_COLUMN_EDEFAULT == null ? primaryKeyColumn != null : !PRIMARY_KEY_COLUMN_EDEFAULT.equals(primaryKeyColumn); - case ConfigPackageImpl.KEY_PAIR__RELATIONSHIP: - return RELATIONSHIP_EDEFAULT == null ? relationship != null : !RELATIONSHIP_EDEFAULT.equals(relationship); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (foreignKeyColumn: "); - result.append(foreignKeyColumn); - result.append(", primaryKeyColumn: "); - result.append(primaryKeyColumn); - result.append(", relationship: "); - result.append(relationship); - result.append(')'); - return result.toString(); - } - -} //KeyPairImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ParameterImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ParameterImpl.java deleted file mode 100644 index ef4b7e58a5..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ParameterImpl.java +++ /dev/null @@ -1,287 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import org.apache.tuscany.das.rdb.config.Parameter; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -/** - * - * An implementation of the model object 'Parameter'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.apache.tuscany.das.rdb.config.impl.ParameterImpl#getColumnType Column Type}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.ParameterImpl#getCommand Command}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.ParameterImpl#getName Name}
  • - *
- *

- * - * @generated - */ -public class ParameterImpl extends DataObjectImpl implements Parameter -{ - /** - * The default value of the '{@link #getColumnType() Column Type}' attribute. - * - * - * @see #getColumnType() - * @generated - * @ordered - */ - protected static final String COLUMN_TYPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getColumnType() Column Type}' attribute. - * - * - * @see #getColumnType() - * @generated - * @ordered - */ - protected String columnType = COLUMN_TYPE_EDEFAULT; - - /** - * The default value of the '{@link #getCommand() Command}' attribute. - * - * - * @see #getCommand() - * @generated - * @ordered - */ - protected static final String COMMAND_EDEFAULT = null; - - /** - * The cached value of the '{@link #getCommand() Command}' attribute. - * - * - * @see #getCommand() - * @generated - * @ordered - */ - protected String command = COMMAND_EDEFAULT; - - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * - * - * @generated - */ - protected ParameterImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return ConfigPackageImpl.Literals.PARAMETER; - } - - /** - * - * - * @generated - */ - public String getColumnType() - { - return columnType; - } - - /** - * - * - * @generated - */ - public void setColumnType(String newColumnType) - { - String oldColumnType = columnType; - columnType = newColumnType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.PARAMETER__COLUMN_TYPE, oldColumnType, columnType)); - } - - /** - * - * - * @generated - */ - public String getCommand() - { - return command; - } - - /** - * - * - * @generated - */ - public void setCommand(String newCommand) - { - String oldCommand = command; - command = newCommand; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.PARAMETER__COMMAND, oldCommand, command)); - } - - /** - * - * - * @generated - */ - public String getName() - { - return name; - } - - /** - * - * - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.PARAMETER__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ConfigPackageImpl.PARAMETER__COLUMN_TYPE: - return getColumnType(); - case ConfigPackageImpl.PARAMETER__COMMAND: - return getCommand(); - case ConfigPackageImpl.PARAMETER__NAME: - return getName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ConfigPackageImpl.PARAMETER__COLUMN_TYPE: - setColumnType((String)newValue); - return; - case ConfigPackageImpl.PARAMETER__COMMAND: - setCommand((String)newValue); - return; - case ConfigPackageImpl.PARAMETER__NAME: - setName((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.PARAMETER__COLUMN_TYPE: - setColumnType(COLUMN_TYPE_EDEFAULT); - return; - case ConfigPackageImpl.PARAMETER__COMMAND: - setCommand(COMMAND_EDEFAULT); - return; - case ConfigPackageImpl.PARAMETER__NAME: - setName(NAME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.PARAMETER__COLUMN_TYPE: - return COLUMN_TYPE_EDEFAULT == null ? columnType != null : !COLUMN_TYPE_EDEFAULT.equals(columnType); - case ConfigPackageImpl.PARAMETER__COMMAND: - return COMMAND_EDEFAULT == null ? command != null : !COMMAND_EDEFAULT.equals(command); - case ConfigPackageImpl.PARAMETER__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (columnType: "); - result.append(columnType); - result.append(", command: "); - result.append(command); - result.append(", name: "); - result.append(name); - result.append(')'); - return result.toString(); - } - -} //ParameterImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/RelationshipImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/RelationshipImpl.java deleted file mode 100644 index 002edf508c..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/RelationshipImpl.java +++ /dev/null @@ -1,497 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import java.util.Collection; -import java.util.List; - -import org.apache.tuscany.das.rdb.config.KeyPair; -import org.apache.tuscany.das.rdb.config.Relationship; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * - * An implementation of the model object 'Relationship'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#getKeyPair Key Pair}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#getConfig Config}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#getForeignKeyTable Foreign Key Table}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#isMany Many}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#getName Name}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#getPrimaryKeyTable Primary Key Table}
  • - *
- *

- * - * @generated - */ -public class RelationshipImpl extends DataObjectImpl implements Relationship -{ - /** - * The cached value of the '{@link #getKeyPair() Key Pair}' containment reference list. - * - * - * @see #getKeyPair() - * @generated - * @ordered - */ - protected EList keyPair = null; - - /** - * The default value of the '{@link #getConfig() Config}' attribute. - * - * - * @see #getConfig() - * @generated - * @ordered - */ - protected static final String CONFIG_EDEFAULT = null; - - /** - * The cached value of the '{@link #getConfig() Config}' attribute. - * - * - * @see #getConfig() - * @generated - * @ordered - */ - protected String config = CONFIG_EDEFAULT; - - /** - * The default value of the '{@link #getForeignKeyTable() Foreign Key Table}' attribute. - * - * - * @see #getForeignKeyTable() - * @generated - * @ordered - */ - protected static final String FOREIGN_KEY_TABLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getForeignKeyTable() Foreign Key Table}' attribute. - * - * - * @see #getForeignKeyTable() - * @generated - * @ordered - */ - protected String foreignKeyTable = FOREIGN_KEY_TABLE_EDEFAULT; - - /** - * The default value of the '{@link #isMany() Many}' attribute. - * - * - * @see #isMany() - * @generated - * @ordered - */ - protected static final boolean MANY_EDEFAULT = false; - - /** - * The cached value of the '{@link #isMany() Many}' attribute. - * - * - * @see #isMany() - * @generated - * @ordered - */ - protected boolean many = MANY_EDEFAULT; - - /** - * This is true if the Many attribute has been set. - * - * - * @generated - * @ordered - */ - protected boolean manyESet = false; - - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getPrimaryKeyTable() Primary Key Table}' attribute. - * - * - * @see #getPrimaryKeyTable() - * @generated - * @ordered - */ - protected static final String PRIMARY_KEY_TABLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getPrimaryKeyTable() Primary Key Table}' attribute. - * - * - * @see #getPrimaryKeyTable() - * @generated - * @ordered - */ - protected String primaryKeyTable = PRIMARY_KEY_TABLE_EDEFAULT; - - /** - * - * - * @generated - */ - protected RelationshipImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return ConfigPackageImpl.Literals.RELATIONSHIP; - } - - /** - * - * - * @generated - */ - public List getKeyPair() - { - if (keyPair == null) - { - keyPair = new EObjectContainmentEList(KeyPair.class, this, ConfigPackageImpl.RELATIONSHIP__KEY_PAIR); - } - return keyPair; - } - - /** - * - * - * @generated - */ - public String getConfig() - { - return config; - } - - /** - * - * - * @generated - */ - public void setConfig(String newConfig) - { - String oldConfig = config; - config = newConfig; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RELATIONSHIP__CONFIG, oldConfig, config)); - } - - /** - * - * - * @generated - */ - public String getForeignKeyTable() - { - return foreignKeyTable; - } - - /** - * - * - * @generated - */ - public void setForeignKeyTable(String newForeignKeyTable) - { - String oldForeignKeyTable = foreignKeyTable; - foreignKeyTable = newForeignKeyTable; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RELATIONSHIP__FOREIGN_KEY_TABLE, oldForeignKeyTable, foreignKeyTable)); - } - - /** - * - * - * @generated - */ - public boolean isMany() - { - return many; - } - - /** - * - * - * @generated - */ - public void setMany(boolean newMany) - { - boolean oldMany = many; - many = newMany; - boolean oldManyESet = manyESet; - manyESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RELATIONSHIP__MANY, oldMany, many, !oldManyESet)); - } - - /** - * - * - * @generated - */ - public void unsetMany() - { - boolean oldMany = many; - boolean oldManyESet = manyESet; - many = MANY_EDEFAULT; - manyESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, ConfigPackageImpl.RELATIONSHIP__MANY, oldMany, MANY_EDEFAULT, oldManyESet)); - } - - /** - * - * - * @generated - */ - public boolean isSetMany() - { - return manyESet; - } - - /** - * - * - * @generated - */ - public String getName() - { - return name; - } - - /** - * - * - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RELATIONSHIP__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - public String getPrimaryKeyTable() - { - return primaryKeyTable; - } - - /** - * - * - * @generated - */ - public void setPrimaryKeyTable(String newPrimaryKeyTable) - { - String oldPrimaryKeyTable = primaryKeyTable; - primaryKeyTable = newPrimaryKeyTable; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RELATIONSHIP__PRIMARY_KEY_TABLE, oldPrimaryKeyTable, primaryKeyTable)); - } - - /** - * - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ConfigPackageImpl.RELATIONSHIP__KEY_PAIR: - return ((InternalEList)getKeyPair()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ConfigPackageImpl.RELATIONSHIP__KEY_PAIR: - return getKeyPair(); - case ConfigPackageImpl.RELATIONSHIP__CONFIG: - return getConfig(); - case ConfigPackageImpl.RELATIONSHIP__FOREIGN_KEY_TABLE: - return getForeignKeyTable(); - case ConfigPackageImpl.RELATIONSHIP__MANY: - return isMany() ? Boolean.TRUE : Boolean.FALSE; - case ConfigPackageImpl.RELATIONSHIP__NAME: - return getName(); - case ConfigPackageImpl.RELATIONSHIP__PRIMARY_KEY_TABLE: - return getPrimaryKeyTable(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ConfigPackageImpl.RELATIONSHIP__KEY_PAIR: - getKeyPair().clear(); - getKeyPair().addAll((Collection)newValue); - return; - case ConfigPackageImpl.RELATIONSHIP__CONFIG: - setConfig((String)newValue); - return; - case ConfigPackageImpl.RELATIONSHIP__FOREIGN_KEY_TABLE: - setForeignKeyTable((String)newValue); - return; - case ConfigPackageImpl.RELATIONSHIP__MANY: - setMany(((Boolean)newValue).booleanValue()); - return; - case ConfigPackageImpl.RELATIONSHIP__NAME: - setName((String)newValue); - return; - case ConfigPackageImpl.RELATIONSHIP__PRIMARY_KEY_TABLE: - setPrimaryKeyTable((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.RELATIONSHIP__KEY_PAIR: - getKeyPair().clear(); - return; - case ConfigPackageImpl.RELATIONSHIP__CONFIG: - setConfig(CONFIG_EDEFAULT); - return; - case ConfigPackageImpl.RELATIONSHIP__FOREIGN_KEY_TABLE: - setForeignKeyTable(FOREIGN_KEY_TABLE_EDEFAULT); - return; - case ConfigPackageImpl.RELATIONSHIP__MANY: - unsetMany(); - return; - case ConfigPackageImpl.RELATIONSHIP__NAME: - setName(NAME_EDEFAULT); - return; - case ConfigPackageImpl.RELATIONSHIP__PRIMARY_KEY_TABLE: - setPrimaryKeyTable(PRIMARY_KEY_TABLE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.RELATIONSHIP__KEY_PAIR: - return keyPair != null && !keyPair.isEmpty(); - case ConfigPackageImpl.RELATIONSHIP__CONFIG: - return CONFIG_EDEFAULT == null ? config != null : !CONFIG_EDEFAULT.equals(config); - case ConfigPackageImpl.RELATIONSHIP__FOREIGN_KEY_TABLE: - return FOREIGN_KEY_TABLE_EDEFAULT == null ? foreignKeyTable != null : !FOREIGN_KEY_TABLE_EDEFAULT.equals(foreignKeyTable); - case ConfigPackageImpl.RELATIONSHIP__MANY: - return isSetMany(); - case ConfigPackageImpl.RELATIONSHIP__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case ConfigPackageImpl.RELATIONSHIP__PRIMARY_KEY_TABLE: - return PRIMARY_KEY_TABLE_EDEFAULT == null ? primaryKeyTable != null : !PRIMARY_KEY_TABLE_EDEFAULT.equals(primaryKeyTable); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (config: "); - result.append(config); - result.append(", foreignKeyTable: "); - result.append(foreignKeyTable); - result.append(", many: "); - if (manyESet) result.append(many); else result.append(""); - result.append(", name: "); - result.append(name); - result.append(", primaryKeyTable: "); - result.append(primaryKeyTable); - result.append(')'); - return result.toString(); - } - -} //RelationshipImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ResultDescriptorImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ResultDescriptorImpl.java deleted file mode 100644 index f6b6e1c8f8..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ResultDescriptorImpl.java +++ /dev/null @@ -1,399 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import org.apache.tuscany.das.rdb.config.ResultDescriptor; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -/** - * - * An implementation of the model object 'Result Descriptor'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl#getColumnName Column Name}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl#getColumnType Column Type}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl#getCommand Command}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl#getConverter Converter}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl#getTableName Table Name}
  • - *
- *

- * - * @generated - */ -public class ResultDescriptorImpl extends DataObjectImpl implements ResultDescriptor -{ - /** - * The default value of the '{@link #getColumnName() Column Name}' attribute. - * - * - * @see #getColumnName() - * @generated - * @ordered - */ - protected static final String COLUMN_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getColumnName() Column Name}' attribute. - * - * - * @see #getColumnName() - * @generated - * @ordered - */ - protected String columnName = COLUMN_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getColumnType() Column Type}' attribute. - * - * - * @see #getColumnType() - * @generated - * @ordered - */ - protected static final String COLUMN_TYPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getColumnType() Column Type}' attribute. - * - * - * @see #getColumnType() - * @generated - * @ordered - */ - protected String columnType = COLUMN_TYPE_EDEFAULT; - - /** - * The default value of the '{@link #getCommand() Command}' attribute. - * - * - * @see #getCommand() - * @generated - * @ordered - */ - protected static final String COMMAND_EDEFAULT = null; - - /** - * The cached value of the '{@link #getCommand() Command}' attribute. - * - * - * @see #getCommand() - * @generated - * @ordered - */ - protected String command = COMMAND_EDEFAULT; - - /** - * The default value of the '{@link #getConverter() Converter}' attribute. - * - * - * @see #getConverter() - * @generated - * @ordered - */ - protected static final String CONVERTER_EDEFAULT = null; - - /** - * The cached value of the '{@link #getConverter() Converter}' attribute. - * - * - * @see #getConverter() - * @generated - * @ordered - */ - protected String converter = CONVERTER_EDEFAULT; - - /** - * The default value of the '{@link #getTableName() Table Name}' attribute. - * - * - * @see #getTableName() - * @generated - * @ordered - */ - protected static final String TABLE_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getTableName() Table Name}' attribute. - * - * - * @see #getTableName() - * @generated - * @ordered - */ - protected String tableName = TABLE_NAME_EDEFAULT; - - /** - * - * - * @generated - */ - protected ResultDescriptorImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return ConfigPackageImpl.Literals.RESULT_DESCRIPTOR; - } - - /** - * - * - * @generated - */ - public String getColumnName() - { - return columnName; - } - - /** - * - * - * @generated - */ - public void setColumnName(String newColumnName) - { - String oldColumnName = columnName; - columnName = newColumnName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_NAME, oldColumnName, columnName)); - } - - /** - * - * - * @generated - */ - public String getColumnType() - { - return columnType; - } - - /** - * - * - * @generated - */ - public void setColumnType(String newColumnType) - { - String oldColumnType = columnType; - columnType = newColumnType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_TYPE, oldColumnType, columnType)); - } - - /** - * - * - * @generated - */ - public String getCommand() - { - return command; - } - - /** - * - * - * @generated - */ - public void setCommand(String newCommand) - { - String oldCommand = command; - command = newCommand; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RESULT_DESCRIPTOR__COMMAND, oldCommand, command)); - } - - /** - * - * - * @generated - */ - public String getConverter() - { - return converter; - } - - /** - * - * - * @generated - */ - public void setConverter(String newConverter) - { - String oldConverter = converter; - converter = newConverter; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RESULT_DESCRIPTOR__CONVERTER, oldConverter, converter)); - } - - /** - * - * - * @generated - */ - public String getTableName() - { - return tableName; - } - - /** - * - * - * @generated - */ - public void setTableName(String newTableName) - { - String oldTableName = tableName; - tableName = newTableName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RESULT_DESCRIPTOR__TABLE_NAME, oldTableName, tableName)); - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_NAME: - return getColumnName(); - case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_TYPE: - return getColumnType(); - case ConfigPackageImpl.RESULT_DESCRIPTOR__COMMAND: - return getCommand(); - case ConfigPackageImpl.RESULT_DESCRIPTOR__CONVERTER: - return getConverter(); - case ConfigPackageImpl.RESULT_DESCRIPTOR__TABLE_NAME: - return getTableName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_NAME: - setColumnName((String)newValue); - return; - case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_TYPE: - setColumnType((String)newValue); - return; - case ConfigPackageImpl.RESULT_DESCRIPTOR__COMMAND: - setCommand((String)newValue); - return; - case ConfigPackageImpl.RESULT_DESCRIPTOR__CONVERTER: - setConverter((String)newValue); - return; - case ConfigPackageImpl.RESULT_DESCRIPTOR__TABLE_NAME: - setTableName((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_NAME: - setColumnName(COLUMN_NAME_EDEFAULT); - return; - case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_TYPE: - setColumnType(COLUMN_TYPE_EDEFAULT); - return; - case ConfigPackageImpl.RESULT_DESCRIPTOR__COMMAND: - setCommand(COMMAND_EDEFAULT); - return; - case ConfigPackageImpl.RESULT_DESCRIPTOR__CONVERTER: - setConverter(CONVERTER_EDEFAULT); - return; - case ConfigPackageImpl.RESULT_DESCRIPTOR__TABLE_NAME: - setTableName(TABLE_NAME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_NAME: - return COLUMN_NAME_EDEFAULT == null ? columnName != null : !COLUMN_NAME_EDEFAULT.equals(columnName); - case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_TYPE: - return COLUMN_TYPE_EDEFAULT == null ? columnType != null : !COLUMN_TYPE_EDEFAULT.equals(columnType); - case ConfigPackageImpl.RESULT_DESCRIPTOR__COMMAND: - return COMMAND_EDEFAULT == null ? command != null : !COMMAND_EDEFAULT.equals(command); - case ConfigPackageImpl.RESULT_DESCRIPTOR__CONVERTER: - return CONVERTER_EDEFAULT == null ? converter != null : !CONVERTER_EDEFAULT.equals(converter); - case ConfigPackageImpl.RESULT_DESCRIPTOR__TABLE_NAME: - return TABLE_NAME_EDEFAULT == null ? tableName != null : !TABLE_NAME_EDEFAULT.equals(tableName); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (columnName: "); - result.append(columnName); - result.append(", columnType: "); - result.append(columnType); - result.append(", command: "); - result.append(command); - result.append(", converter: "); - result.append(converter); - result.append(", tableName: "); - result.append(tableName); - result.append(')'); - return result.toString(); - } - -} //ResultDescriptorImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/TableImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/TableImpl.java deleted file mode 100644 index b63816c350..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/TableImpl.java +++ /dev/null @@ -1,517 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.config.impl; - -import java.util.Collection; -import java.util.List; - -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Table; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * - * An implementation of the model object 'Table'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getColumn Column}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getConfig Config}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getCreate Create}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getDelete Delete}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getName Name}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getPropertyName Property Name}
  • - *
  • {@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getUpdate Update}
  • - *
- *

- * - * @generated - */ -public class TableImpl extends DataObjectImpl implements Table -{ - /** - * The cached value of the '{@link #getColumn() Column}' containment reference list. - * - * - * @see #getColumn() - * @generated - * @ordered - */ - protected EList column = null; - - /** - * The default value of the '{@link #getConfig() Config}' attribute. - * - * - * @see #getConfig() - * @generated - * @ordered - */ - protected static final String CONFIG_EDEFAULT = null; - - /** - * The cached value of the '{@link #getConfig() Config}' attribute. - * - * - * @see #getConfig() - * @generated - * @ordered - */ - protected String config = CONFIG_EDEFAULT; - - /** - * The default value of the '{@link #getCreate() Create}' attribute. - * - * - * @see #getCreate() - * @generated - * @ordered - */ - protected static final String CREATE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getCreate() Create}' attribute. - * - * - * @see #getCreate() - * @generated - * @ordered - */ - protected String create = CREATE_EDEFAULT; - - /** - * The default value of the '{@link #getDelete() Delete}' attribute. - * - * - * @see #getDelete() - * @generated - * @ordered - */ - protected static final String DELETE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDelete() Delete}' attribute. - * - * - * @see #getDelete() - * @generated - * @ordered - */ - protected String delete = DELETE_EDEFAULT; - - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getPropertyName() Property Name}' attribute. - * - * - * @see #getPropertyName() - * @generated - * @ordered - */ - protected static final String PROPERTY_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getPropertyName() Property Name}' attribute. - * - * - * @see #getPropertyName() - * @generated - * @ordered - */ - protected String propertyName = PROPERTY_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getUpdate() Update}' attribute. - * - * - * @see #getUpdate() - * @generated - * @ordered - */ - protected static final String UPDATE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getUpdate() Update}' attribute. - * - * - * @see #getUpdate() - * @generated - * @ordered - */ - protected String update = UPDATE_EDEFAULT; - - /** - * - * - * @generated - */ - protected TableImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return ConfigPackageImpl.Literals.TABLE; - } - - /** - * - * - * @generated - */ - public List getColumn() - { - if (column == null) - { - column = new EObjectContainmentEList(Column.class, this, ConfigPackageImpl.TABLE__COLUMN); - } - return column; - } - - /** - * - * - * @generated - */ - public String getConfig() - { - return config; - } - - /** - * - * - * @generated - */ - public void setConfig(String newConfig) - { - String oldConfig = config; - config = newConfig; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.TABLE__CONFIG, oldConfig, config)); - } - - /** - * - * - * @generated - */ - public String getCreate() - { - return create; - } - - /** - * - * - * @generated - */ - public void setCreate(String newCreate) - { - String oldCreate = create; - create = newCreate; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.TABLE__CREATE, oldCreate, create)); - } - - /** - * - * - * @generated - */ - public String getDelete() - { - return delete; - } - - /** - * - * - * @generated - */ - public void setDelete(String newDelete) - { - String oldDelete = delete; - delete = newDelete; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.TABLE__DELETE, oldDelete, delete)); - } - - /** - * - * - * @generated - */ - public String getName() - { - return name; - } - - /** - * - * - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.TABLE__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - public String getPropertyName() - { - return propertyName; - } - - /** - * - * - * @generated - */ - public void setPropertyName(String newPropertyName) - { - String oldPropertyName = propertyName; - propertyName = newPropertyName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.TABLE__PROPERTY_NAME, oldPropertyName, propertyName)); - } - - /** - * - * - * @generated - */ - public String getUpdate() - { - return update; - } - - /** - * - * - * @generated - */ - public void setUpdate(String newUpdate) - { - String oldUpdate = update; - update = newUpdate; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.TABLE__UPDATE, oldUpdate, update)); - } - - /** - * - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ConfigPackageImpl.TABLE__COLUMN: - return ((InternalEList)getColumn()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ConfigPackageImpl.TABLE__COLUMN: - return getColumn(); - case ConfigPackageImpl.TABLE__CONFIG: - return getConfig(); - case ConfigPackageImpl.TABLE__CREATE: - return getCreate(); - case ConfigPackageImpl.TABLE__DELETE: - return getDelete(); - case ConfigPackageImpl.TABLE__NAME: - return getName(); - case ConfigPackageImpl.TABLE__PROPERTY_NAME: - return getPropertyName(); - case ConfigPackageImpl.TABLE__UPDATE: - return getUpdate(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ConfigPackageImpl.TABLE__COLUMN: - getColumn().clear(); - getColumn().addAll((Collection)newValue); - return; - case ConfigPackageImpl.TABLE__CONFIG: - setConfig((String)newValue); - return; - case ConfigPackageImpl.TABLE__CREATE: - setCreate((String)newValue); - return; - case ConfigPackageImpl.TABLE__DELETE: - setDelete((String)newValue); - return; - case ConfigPackageImpl.TABLE__NAME: - setName((String)newValue); - return; - case ConfigPackageImpl.TABLE__PROPERTY_NAME: - setPropertyName((String)newValue); - return; - case ConfigPackageImpl.TABLE__UPDATE: - setUpdate((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.TABLE__COLUMN: - getColumn().clear(); - return; - case ConfigPackageImpl.TABLE__CONFIG: - setConfig(CONFIG_EDEFAULT); - return; - case ConfigPackageImpl.TABLE__CREATE: - setCreate(CREATE_EDEFAULT); - return; - case ConfigPackageImpl.TABLE__DELETE: - setDelete(DELETE_EDEFAULT); - return; - case ConfigPackageImpl.TABLE__NAME: - setName(NAME_EDEFAULT); - return; - case ConfigPackageImpl.TABLE__PROPERTY_NAME: - setPropertyName(PROPERTY_NAME_EDEFAULT); - return; - case ConfigPackageImpl.TABLE__UPDATE: - setUpdate(UPDATE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ConfigPackageImpl.TABLE__COLUMN: - return column != null && !column.isEmpty(); - case ConfigPackageImpl.TABLE__CONFIG: - return CONFIG_EDEFAULT == null ? config != null : !CONFIG_EDEFAULT.equals(config); - case ConfigPackageImpl.TABLE__CREATE: - return CREATE_EDEFAULT == null ? create != null : !CREATE_EDEFAULT.equals(create); - case ConfigPackageImpl.TABLE__DELETE: - return DELETE_EDEFAULT == null ? delete != null : !DELETE_EDEFAULT.equals(delete); - case ConfigPackageImpl.TABLE__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case ConfigPackageImpl.TABLE__PROPERTY_NAME: - return PROPERTY_NAME_EDEFAULT == null ? propertyName != null : !PROPERTY_NAME_EDEFAULT.equals(propertyName); - case ConfigPackageImpl.TABLE__UPDATE: - return UPDATE_EDEFAULT == null ? update != null : !UPDATE_EDEFAULT.equals(update); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (config: "); - result.append(config); - result.append(", create: "); - result.append(create); - result.append(", delete: "); - result.append(delete); - result.append(", name: "); - result.append(name); - result.append(", propertyName: "); - result.append(propertyName); - result.append(", update: "); - result.append(update); - result.append(')'); - return result.toString(); - } - -} //TableImpl diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/MappingWrapper.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/MappingWrapper.java deleted file mode 100644 index 92499bd000..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/MappingWrapper.java +++ /dev/null @@ -1,381 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.config.wrapper; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.Key; -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.ConfigFactory; -import org.apache.tuscany.das.rdb.config.KeyPair; -import org.apache.tuscany.das.rdb.config.Relationship; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.impl.ConfigFactoryImpl; -import org.apache.tuscany.das.rdb.util.DebugUtil; - - -public class MappingWrapper { - - private static final ConfigFactory factory = ConfigFactoryImpl.eINSTANCE; - - private static final boolean debug = false; - - private Config config; - - public MappingWrapper() { - // Empty Constructor - } - - public MappingWrapper(Config mapping) { - this.config = mapping; - } - - public Config getConfig() { - return this.config; - } - - - public Table getTable(String name) { - if (config == null) - return null; - DebugUtil.debugln(getClass(), debug, "Looking for table " + name); - Iterator i = config.getTable().iterator(); - while (i.hasNext()) { - Table t = (Table) i.next(); - if (name.equals(t.getName())) - return t; - } - - return null; - } - - public Table getTableByPropertyName(String name) { - if (config == null) - return null; - DebugUtil.debugln(getClass(), debug, "Looking for table by property: " - + name); - Iterator i = config.getTable().iterator(); - while (i.hasNext()) { - Table t = (Table) i.next(); - TableWrapper wrapper = new TableWrapper(t); - if (name.equals(wrapper.getPropertyName())) - return t; - } - - throw new RuntimeException("Table with property name " + name - + " not found."); - - } - - public void addRelationship(String parentName, String childName) { - - if (config == null) - config = factory.createConfig(); - - QualifiedColumn parent = new QualifiedColumn(parentName); - QualifiedColumn child = new QualifiedColumn(childName); - - Relationship r = factory.createRelationship(); - r.setName(child.getTableName()); - r.setPrimaryKeyTable(parent.getTableName()); - r.setForeignKeyTable(child.getTableName()); - DebugUtil.debugln(getClass(), debug, "Created relationship from " - + r.getPrimaryKeyTable() + " to " + r.getForeignKeyTable() + " named " - + r.getName()); - - KeyPair pair = factory.createKeyPair(); - pair.setPrimaryKeyColumn(parent.getColumnName()); - pair.setForeignKeyColumn(child.getColumnName()); - - r.getKeyPair().add(pair); - r.setMany(true); - - config.getRelationship().add(r); - - } - - - public void addRelationship(Key parentKey, Key childKey) { - - if (config == null) - config = factory.createConfig(); - - QualifiedColumn parent = new QualifiedColumn((String) parentKey.getColumNames().get(0)); - QualifiedColumn child = new QualifiedColumn((String) childKey.getColumNames().get(0)); - - Relationship r = factory.createRelationship(); - r.setName(child.getTableName()); - r.setPrimaryKeyTable(parent.getTableName()); - r.setForeignKeyTable(child.getTableName()); - DebugUtil.debugln(getClass(), debug, "Created relationship from " - + r.getPrimaryKeyTable() + " to " + r.getForeignKeyTable() + " named " - + r.getName()); - - - Iterator i = parentKey.getColumNames().iterator(); - Iterator j = childKey.getColumNames().iterator(); - while ( i.hasNext() && j.hasNext()) { - parent = new QualifiedColumn((String) i.next()); - child = new QualifiedColumn((String) j.next()); - KeyPair pair = factory.createKeyPair(); - pair.setPrimaryKeyColumn(parent.getColumnName()); - pair.setForeignKeyColumn(child.getColumnName()); - - r.getKeyPair().add(pair); - } - r.setMany(true); - config.getRelationship().add(r); - - } - - public void addPrimaryKey(String columnName) { - Key k = new Key(columnName); - addPrimaryKey(k, false); - } - - public void addPrimaryKey(Key key) { - addPrimaryKey(key, false); - } - - public void addGeneratedPrimaryKey(String columnName) { - Key key = new Key(columnName); - addPrimaryKey(key, true); - } - - private void addPrimaryKey(Key key, boolean generated) { - if (config == null) - config = factory.createConfig(); - - Iterator i = key.getColumNames().iterator(); - while (i.hasNext()) { - String columnName = (String) i.next(); - - QualifiedColumn pkColumn = new QualifiedColumn(columnName); - Table t = findOrCreateTable(pkColumn.getTableName()); - Column c = findOrCreateColumn(t, pkColumn.getColumnName()); - c.setPrimaryKey(true); - if ( generated ) - c.setGenerated(true); - - t.getColumn().add(c); - } - } - - - - public String getTablePropertyName(String tableName) { - Table t = getTable(tableName); - if (t == null) - return tableName; - String propertyName = t.getPropertyName(); - - if (propertyName == null) - return tableName; - - return propertyName; - } - - public Column getColumn(Table t, String name) { - if (t == null) - return null; - Iterator i = t.getColumn().iterator(); - while (i.hasNext()) { - Column c = (Column) i.next(); - if (c.getName().equals(name)) { - return c; - } - } - DebugUtil.debugln(getClass(), debug, "WARNING: Could not find column " - + name + " in table " + t.getName()); - return null; - } - - public String getColumnPropertyName(String tableName, String columnName) { - Table t = getTable(tableName); - Column c = getColumn(t, columnName); - if (c == null) - return columnName; - - String propertyName = c.getPropertyName(); - if (propertyName == null) - return c.getName(); - - return propertyName; - } - - public void addCollisionColumn(String columnName) { - - if (config == null) - config = factory.createConfig(); - - QualifiedColumn occColumn = new QualifiedColumn(columnName); - Table t = findOrCreateTable(occColumn.getTableName()); - Column c = findOrCreateColumn(t, occColumn.getColumnName()); - c.setCollision(true); - - config.getTable().add(t); - } - - private Table findOrCreateTable(String tableName) { - Table table = getTable(tableName); - if (table == null) { - table = ConfigFactoryImpl.eINSTANCE.createTable(); - table.setName(tableName); - config.getTable().add(table); - } - return table; - - } - - private Column findOrCreateColumn(Table t, String name) { - Iterator i = t.getColumn().iterator(); - while (i.hasNext()) { - Column c = (Column) i.next(); - if (name.equals(c.getName())) - return c; - } - - Column c = ConfigFactoryImpl.eINSTANCE.createColumn(); - c.setName(name); - t.getColumn().add(c); - return c; - } - - public boolean hasRecursiveRelationships() { - if (config != null) { - Iterator i = getConfig().getRelationship().iterator(); - while (i.hasNext()) { - Relationship r = (Relationship) i.next(); - if (r.getPrimaryKeyTable().equals(r.getForeignKeyTable())) - return true; - } - } - return false; - } - - public Collection getRelationshipsByChildTable(String name) { - ArrayList results = new ArrayList(); - if (config != null) { - Iterator i = getConfig().getRelationship().iterator(); - while (i.hasNext()) { - Relationship r = (Relationship) i.next(); - if (name.equals(r.getForeignKeyTable())) - results.add(r); - } - } - return results; - } - - // TODO optimize - public ArrayList getInsertOrder() { - DebugUtil.debugln(getClass(), debug, "Getting insert order"); - ArrayList inserts = new ArrayList(); - HashMap parentToChild = new HashMap(); - - ArrayList parents = new ArrayList(); - ArrayList children = new ArrayList(); - if (config != null) { - Iterator i = getConfig().getRelationship().iterator(); - while (i.hasNext()) { - Relationship r = (Relationship) i.next(); - parents.add(r.getPrimaryKeyTable()); - children.add(r.getForeignKeyTable()); - parentToChild.put(r.getPrimaryKeyTable(), r.getForeignKeyTable()); - } - - while (parents.size() > 0) { - String parent = (String) parents.get(0); - if (!children.contains(parent)) { - if (!inserts.contains(parent)) - inserts.add(parent); - - String child = (String) parentToChild.get(parent); - if (!inserts.contains(child)) - inserts.add(child); - - parents.remove(parent); - children.remove(child); - } else { - parents.add(parents.remove(0)); - } - } - inserts.addAll(children); - - } - - DebugUtil.debugln(getClass(), debug, inserts); - return inserts; - } - - public ArrayList getDeleteOrder() { - ArrayList deleteOrder = new ArrayList(); - deleteOrder.addAll(getInsertOrder()); - Collections.reverse(deleteOrder); - return deleteOrder; - } - - public void addConverter(String name, String converter) { - if (config == null) - config = factory.createConfig(); - - QualifiedColumn column = new QualifiedColumn(name); - Table t = findOrCreateTable(column.getTableName()); - Column c = findOrCreateColumn(t, column.getColumnName()); - c.setConverterClassName(converter); - - } - - public String getConverter(String tableName, String columnName) { - Table t = getTable(tableName); - Column c = getColumn(t, columnName); - if (c != null) - return c.getConverterClassName(); - return null; - } - - public HashMap getConverters(Table table) { - HashMap converters = new HashMap(); - - Iterator columns = table.getColumn().iterator(); - while ( columns.hasNext() ) { - Column c = (Column) columns.next(); - if ( c.getConverterClassName() != null ) { - String property = c.getPropertyName(); - if ( property == null ) - property = c.getName(); - converters.put(property, c.getConverterClassName()); - } - } - return converters; - } - - public Relationship getRelationshipByName(String name) { - Iterator i = config.getRelationship().iterator(); - while ( i.hasNext() ) { - Relationship r = (Relationship) i.next(); - if ( name.equals (r.getName())) - return r; - } - throw new RuntimeException("Could not find relationship " + name + " in the configuration"); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/QualifiedColumn.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/QualifiedColumn.java deleted file mode 100644 index 6babe0c349..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/QualifiedColumn.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.config.wrapper; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - -public class QualifiedColumn { - - private final String tableName; - private final String columnName; - private static boolean debug = false; - - public QualifiedColumn(String name) { - tableName = name.substring(0, name.indexOf('.')); - columnName = name.substring(name.indexOf('.') + 1); - DebugUtil.debugln(getClass(), debug, tableName); - DebugUtil.debugln(getClass(), debug, columnName); - } - - public String getTableName() { - return this.tableName; - } - - public String getColumnName() { - return this.columnName; - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/RelationshipWrapper.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/RelationshipWrapper.java deleted file mode 100644 index 14403367d8..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/RelationshipWrapper.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.config.wrapper; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.config.KeyPair; -import org.apache.tuscany.das.rdb.config.Relationship; - -public class RelationshipWrapper { - - private Relationship relationship; - - public RelationshipWrapper(Relationship r) { - this.relationship = r; - } - - public Collection getForeignKeys() { - ArrayList keys = new ArrayList(); - Iterator i = this.relationship.getKeyPair().iterator(); - while ( i.hasNext()) { - KeyPair pair = (KeyPair) i.next(); - keys.add(pair.getForeignKeyColumn()); - } - return keys; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/TableWrapper.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/TableWrapper.java deleted file mode 100644 index 2c2d1dc677..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/TableWrapper.java +++ /dev/null @@ -1,124 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* 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. -*/ -package org.apache.tuscany.das.rdb.config.wrapper; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Table; - -public class TableWrapper { - - private Table table; - - public TableWrapper(Table table) { - this.table = table; - } - - public String getPropertyName() { - return table.getPropertyName() == null ? table.getName() : table - .getPropertyName(); - } - - public Collection getPrimaryKeyNames() { - ArrayList pkNames = new ArrayList(); - Iterator i = table.getColumn().iterator(); - while (i.hasNext()) { - Column c = (Column) i.next(); - if (c.isPrimaryKey()) - pkNames.add(c.getName()); - } - return pkNames; - } - - public Collection getPrimaryKeyProperties() { - - ArrayList keyProperties = new ArrayList(); - Iterator columns = table.getColumn().iterator(); - while (columns.hasNext()) { - Column c = (Column) columns.next(); - if (c.isPrimaryKey()) { - keyProperties.add(getColumnPropertyName(c)); - } - } - - return keyProperties; - } - - private String getColumnPropertyName(Column c) { - if (c.getPropertyName() != null) - return c.getPropertyName(); - else - return c.getName(); - } - - public boolean isGeneratedColumnProperty(String name) { - Column c = getColumnByPropertyName(name); - return c == null ? false : c.isGenerated(); - } - - // public Object getColumnNameByProperty(String propertyName) { - // Iterator i = table.getColumn().iterator(); - // while (i.hasNext()) { - // Column c = (Column) i.next(); - // if (propertyName.equals(c.getPropertyName())) - // return c.getName(); - // } - // return propertyName; - // } - - public String getConverter(String propertyName) { - Column c = getColumnByPropertyName(propertyName); - return (c == null) ? null : c.getConverterClassName(); - } - - public Column getColumnByPropertyName(String propertyName) { - Iterator columns = table.getColumn().iterator(); - while (columns.hasNext()) { - Column c = (Column) columns.next(); - String property = c.getPropertyName(); - if (property == null) - property = c.getName(); - if (propertyName.equals(property)) - return c; - } - - return null; - } - - public Column getCollisionColumn() { - Iterator columns = table.getColumn().iterator(); - while (columns.hasNext()) { - Column c = (Column) columns.next(); - if ( c.isCollision() ) - return c; - } - - return null; - - } - - public String getCollisionColumnPropertyName() { - Column c = getCollisionColumn(); - if ( c.getPropertyName() != null ) - return c.getPropertyName(); - else - return c.getName(); - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/CudGenerator.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/CudGenerator.java deleted file mode 100644 index 31ab7b2801..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/CudGenerator.java +++ /dev/null @@ -1,64 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* 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. -*/ -package org.apache.tuscany.das.rdb.generator.impl; - -import java.util.Collection; - -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.impl.DeleteCommandImpl; -import org.apache.tuscany.das.rdb.impl.InsertCommandImpl; -import org.apache.tuscany.das.rdb.impl.WriteCommandImpl; - -import commonj.sdo.DataObject; - -public class CudGenerator { - - private static final UpdateGenerator updateGenerator = UpdateGenerator.instance; - - private static final InsertGenerator insertGenerator = InsertGenerator.instance; - - private static final DeleteGenerator deleteGenerator = DeleteGenerator.instance; - - public DeleteCommandImpl getDeleteCommand(Table t) { - return deleteGenerator.getDeleteCommand(t); - } - - public Collection getDeleteParameters(Table table) { - return deleteGenerator.getDeleteParameters(table); - } - - public Collection getCreateParameters(MappingWrapper mapping, DataObject changedObject, Table table) { - return insertGenerator.getInsertParameters(mapping, changedObject, table); - } - - public InsertCommandImpl getInsertCommand(MappingWrapper mapping, DataObject changedObject, - Table table) { - return insertGenerator.getInsertCommand(mapping, changedObject, table); - } - - public WriteCommandImpl getUpdateCommand(MappingWrapper mapping, - DataObject changedObject, Table table) { - return updateGenerator.getUpdateCommand(mapping, changedObject, table); - } - - public Collection getUpdateParameters(DataObject changedObject, Table table) { - return updateGenerator.getUpdateParameters(changedObject, table); - } - -} - diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/DeleteGenerator.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/DeleteGenerator.java deleted file mode 100644 index c2d312b56d..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/DeleteGenerator.java +++ /dev/null @@ -1,98 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* 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. -*/ -package org.apache.tuscany.das.rdb.generator.impl; - -import java.util.Collection; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.Converter; -import org.apache.tuscany.das.rdb.Parameter; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.wrapper.TableWrapper; -import org.apache.tuscany.das.rdb.impl.DeleteCommandImpl; -import org.apache.tuscany.das.rdb.impl.ParameterImpl; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -public class DeleteGenerator { - - public static final DeleteGenerator instance = new DeleteGenerator(); - - private static final boolean debug = false; - - public DeleteGenerator() { - super(); - } - - public String getDeleteStatement(Table t) { - TableWrapper table = new TableWrapper(t); - - StringBuffer statement = new StringBuffer(); - statement.append("delete from "); - statement.append(t.getName()); - statement.append(" where "); - - Iterator names = table.getPrimaryKeyNames().iterator(); - Iterator properties = table.getPrimaryKeyProperties().iterator(); - while (names.hasNext() && properties.hasNext()) { - String name = (String) names.next(); - statement.append(name); - statement.append(" = ?"); - if (names.hasNext() && properties.hasNext()) - statement.append(" and "); - } - - DebugUtil.debugln(getClass(), debug, statement.toString()); - return statement.toString(); - } - - public Collection getDeleteParameters(Table table) { - TableWrapper wrapper = new TableWrapper(table); - return wrapper.getPrimaryKeyProperties(); - } - - public DeleteCommandImpl getDeleteCommand(Table t) { - DeleteCommandImpl deleteCommand = new DeleteCommandImpl(getDeleteStatement(t)); - - Iterator i = getDeleteParameters(t).iterator(); - for(int idx=1; i.hasNext(); idx++) { - String property = (String) i.next(); - Parameter p = new ParameterImpl(); - p.setName(property); - p.setType(SDODataTypes.OBJECT); - p.setConverter(getConverter(t, property)); - p.setIndex(idx); - deleteCommand.addParameter(p); - } - return deleteCommand; - } - - private Converter getConverter(Table t, String name) { - TableWrapper tw = new TableWrapper(t); - String converter = tw.getConverter(name); - if ( converter != null ) { - try { - return (Converter) Class.forName(converter).newInstance(); - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - return null; - } - -} - diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/InsertGenerator.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/InsertGenerator.java deleted file mode 100644 index 9e324e2dd3..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/InsertGenerator.java +++ /dev/null @@ -1,164 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* 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. -*/ -package org.apache.tuscany.das.rdb.generator.impl; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import org.apache.tuscany.das.rdb.Converter; -import org.apache.tuscany.das.rdb.Parameter; -import org.apache.tuscany.das.rdb.config.Relationship; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.config.wrapper.RelationshipWrapper; -import org.apache.tuscany.das.rdb.config.wrapper.TableWrapper; -import org.apache.tuscany.das.rdb.impl.InsertCommandImpl; -import org.apache.tuscany.das.rdb.impl.ParameterImpl; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.Property; - -public class InsertGenerator { - - public static final InsertGenerator instance = new InsertGenerator(); - - private static final boolean debug = false; - - public InsertGenerator() { - super(); - } - - public InsertCommandImpl getInsertCommand(MappingWrapper config, - DataObject changedObject, Table t) { - ArrayList parameters = new ArrayList(); - TableWrapper table = new TableWrapper(t); - StringBuffer statement = new StringBuffer("insert into "); - statement.append(t.getName()); - - Iterator i = getAttributeProperties(changedObject, config).iterator(); - - ArrayList attributes = new ArrayList(); - while (i.hasNext()) { - Property attr = (Property) i.next(); - if (!table.isGeneratedColumnProperty(attr.getName())) { - attributes.add(attr.getName()); - parameters.add(changedObject.getType().getProperty( - attr.getName())); - } - } - - statement.append("("); - Iterator attrs = attributes.iterator(); - while (attrs.hasNext()) { - String name = (String) attrs.next(); - statement.append(""); - statement.append(name); - if (attrs.hasNext()) - statement.append(", "); - else - statement.append(")"); - } - - statement.append(" values ("); - for (int idx = 1; idx <= attributes.size(); idx++) { - statement.append('?'); - if (idx < attributes.size()) - statement.append(", "); - else - statement.append(")"); - } - - InsertCommandImpl cmd = new InsertCommandImpl(statement.toString()); - Iterator params = parameters.iterator(); - for (int idx = 1; params.hasNext(); idx++) { - Property property = (Property) params.next(); - Parameter p = new ParameterImpl(); - p.setName(property.getName()); - p.setType(property.getType()); - p.setConverter(getConverter(table, property.getName())); - p.setIndex(idx); - cmd.addParameter(p); - - } - DebugUtil.debugln(getClass(), debug, statement.toString()); - return cmd; - - } - - private Converter getConverter(TableWrapper tw, String name) { - String converter = tw.getConverter(name); - if ( converter != null ) { - try { - return (Converter) Class.forName(converter).newInstance(); - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - return null; - } - - private List getAttributeProperties(DataObject obj, MappingWrapper config) { - ArrayList fields = new ArrayList(); - Iterator i = obj.getType().getProperties().iterator(); - while (i.hasNext()) { - Property p = (Property) i.next(); - if (p.getType().isDataType()) { - if (obj.isSet(p)) - fields.add(p); - } else { - if (!p.isMany() && obj.isSet(p)) { - Relationship relationship = config.getRelationshipByName(p - .getOpposite().getName()); - - RelationshipWrapper r = new RelationshipWrapper( - relationship); - Iterator keys = r.getForeignKeys().iterator(); - while (keys.hasNext()) { - String key = (String) keys.next(); - Property keyProp = obj.getType().getProperty(key); - fields.add(keyProp); - } - - } - } - } - - return fields; - - } - - public Collection getInsertParameters(MappingWrapper config, - DataObject changedObject, Table table) { - ArrayList parameters = new ArrayList(); - TableWrapper wrapper = new TableWrapper(table); - - Iterator i = getAttributeProperties(changedObject, config).iterator(); - - while (i.hasNext()) { - Property attr = (Property) i.next(); - if (!wrapper.isGeneratedColumnProperty(attr.getName())) - parameters.add(changedObject.getType().getProperty( - attr.getName())); - } - - return parameters; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/UpdateGenerator.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/UpdateGenerator.java deleted file mode 100644 index f22b352f51..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/UpdateGenerator.java +++ /dev/null @@ -1,206 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* 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. -*/ -package org.apache.tuscany.das.rdb.generator.impl; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import org.apache.tuscany.das.rdb.Converter; -import org.apache.tuscany.das.rdb.Parameter; -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.config.wrapper.RelationshipWrapper; -import org.apache.tuscany.das.rdb.config.wrapper.TableWrapper; -import org.apache.tuscany.das.rdb.impl.OptimisticWriteCommandImpl; -import org.apache.tuscany.das.rdb.impl.ParameterImpl; -import org.apache.tuscany.das.rdb.impl.UpdateCommandImpl; -import org.apache.tuscany.das.rdb.impl.WriteCommandImpl; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.ChangeSummary; -import commonj.sdo.DataObject; -import commonj.sdo.Property; -import commonj.sdo.Type; - -public class UpdateGenerator { - - private boolean debug = false; - - public static UpdateGenerator instance = new UpdateGenerator(); - - public UpdateGenerator() { - super(); - } - - public WriteCommandImpl getUpdateCommand(MappingWrapper mapping, DataObject changedObject, Table table) { - ArrayList parameters = new ArrayList(); - Type type = changedObject.getType(); - TableWrapper t = new TableWrapper(table); - StringBuffer statement = new StringBuffer("update "); - statement.append(table.getName()); - statement.append(" set "); - - - ChangeSummary summary = changedObject.getDataGraph().getChangeSummary(); - Iterator i = getChangedFields(mapping, summary, changedObject).iterator(); - - while (i.hasNext()) { - Property attr = (Property) i.next(); - Column c = t.getColumnByPropertyName(attr.getName()); - if ((c != null) && (c.isCollision() || c.isPrimaryKey())) { - // get rid of comma if OCC or PK is last field - if (!i.hasNext()) { - statement - .delete(statement.length() - 2, statement.length()); - } - } else { - parameters.add(attr); - statement.append(c == null ? attr.getName() : c.getName()); - statement.append(" = ?"); - if (i.hasNext()) - statement.append(", "); - } - } - - statement.append(" where "); - - Iterator names = t.getPrimaryKeyNames().iterator(); - Iterator properties = t.getPrimaryKeyProperties().iterator(); - while (names.hasNext() && properties.hasNext()) { - String name = (String) names.next(); - String property = (String) properties.next(); - statement.append(name); - statement.append(" = ?"); - if (names.hasNext() && properties.hasNext()) - statement.append(" and "); - parameters.add(type.getProperty(property)); - } - - if (t.getCollisionColumn() != null) { - statement.append(" and "); - statement.append(t.getCollisionColumn().getName()); - statement.append(" = ?"); - parameters.add(type.getProperty(t.getCollisionColumnPropertyName())); - } - - - WriteCommandImpl updateCommand; - if ( t.getCollisionColumn() != null ) - updateCommand = new OptimisticWriteCommandImpl(statement.toString()); - else - updateCommand = new UpdateCommandImpl(statement.toString()); - - Iterator params = parameters.iterator(); - for (int idx = 1; params.hasNext(); idx++ ) { - Property p = (Property)params.next(); - Parameter param = new ParameterImpl(); - param.setName(p.getName()); - param.setType(p.getType()); - param.setConverter(getConverter(t, p.getName())); - param.setIndex(idx); - updateCommand.addParameter(param); - } - DebugUtil.debugln(getClass(), debug, statement.toString()); - return updateCommand; - } - - private List getAttributeProperties(DataObject obj) { - ArrayList fields = new ArrayList(); - Iterator i = obj.getType().getProperties().iterator(); - while ( i.hasNext() ) { - Property p = (Property) i.next(); - if ( p.getType().isDataType()) - fields.add(p); - } - return fields; - } - - - private List getChangedFields(MappingWrapper mapping, ChangeSummary summary, DataObject obj) { - ArrayList changes = new ArrayList(); - Iterator i = summary.getOldValues(obj).iterator(); - while (i.hasNext()) { - ChangeSummary.Setting setting = (ChangeSummary.Setting) i.next(); - if (setting.getProperty().getType().isDataType()) { - changes.add(setting.getProperty()); - } else { - Property ref = setting.getProperty(); - if ( !ref.isMany() ) { - RelationshipWrapper r = new RelationshipWrapper(mapping.getRelationshipByName(ref.getOpposite().getName())); - Iterator keys = r.getForeignKeys().iterator(); - while ( keys.hasNext()) { - String key = (String) keys.next(); - Property p = obj.getType().getProperty(key); - changes.add(p); - } - } - - } - } - return changes; - } - - - private Converter getConverter(TableWrapper tw, String name) { - String converter = tw.getConverter(name); - if ( converter != null ) { - try { - return (Converter) Class.forName(converter).newInstance(); - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - return null; - } - - public Collection getUpdateParameters(DataObject changedObject, Table table) { - Type type = changedObject.getType(); - TableWrapper wrapper = new TableWrapper(table); - Collection pkNames = wrapper.getPrimaryKeyProperties(); - ArrayList parameters = new ArrayList(); - ArrayList pkParams = new ArrayList(); - - Iterator i = getAttributeProperties(changedObject).iterator(); - while (i.hasNext()) { - Property attr = (Property) i.next(); - String field = attr.getName(); - - Parameter p = getParameter(wrapper, type.getProperty(field)); - if (pkNames.contains(field)) { - pkParams.add(p); - } else { - parameters.add(p); - } - } - parameters.addAll(pkParams); - return parameters; - - } - - private Parameter getParameter(TableWrapper wrapper, Property property) { - Parameter param = new ParameterImpl(); - param.setName(property.getName()); - param.setType(property.getType()); - param.setConverter(getConverter(wrapper, property.getName())); - - return param; - } -} - diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/DataObjectMaker.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/DataObjectMaker.java deleted file mode 100644 index 2d58c0f269..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/DataObjectMaker.java +++ /dev/null @@ -1,120 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.Property; -import commonj.sdo.Type; -import commonj.sdo.helper.DataFactory; - -public class DataObjectMaker { - - private final DataObject rootObject; - - private boolean debug = false; - - public DataObjectMaker(DataObject root) { - this.rootObject = root; - } - - /** - * @param tableData - * @return - */ - public DataObject createAndAddDataObject(TableData tableData, - ResultMetadata resultMetadata) { - // Get a Type from the package and create a standalone DataObject - - DebugUtil.debugln(getClass(), this.debug, "Looking for Type for " - + tableData.getTableName()); - - Type tableClass = findTableTypeByPropertyName(tableData.getTableName()); - - if (tableClass == null) - throw new RuntimeException("An SDO Type with name " - + tableData.getTableName() + " was not found"); - - DataObject obj = DataFactory.INSTANCE.create(tableClass); - - // Now, check to see if the root data object has a containment reference - // to this EClass. If so, add it to the graph. If not, it will be taken - // care - // of when we process relationships - - Iterator i = this.rootObject.getType().getProperties().iterator(); - while (i.hasNext()) { - Property p = (Property) i.next(); - - if (p.isContainment() && p.getType().equals(tableClass)) { - if (p.isMany()) - rootObject.getList(p).add(obj); - // TODO This was a performance optimization for EMF in SDO 1.1, - // check to see if there is - // something equivalent in SDO 2.0 - // ((InternalEList) this.dataGraph.eGet(ref)).addUnique(obj); - else - this.rootObject.set(p, obj); - } - - } - - Iterator columnNames = resultMetadata.getColumnNames( - tableData.getTableName()).iterator(); - while (columnNames.hasNext()) { - String columnName = (String) columnNames.next(); - DataObject dataObject = (DataObject) obj; - Property p = findProperty(dataObject.getType(), columnName); - Object value = tableData.getColumnData(columnName); - - dataObject.set(p, value); - } - - return obj; - } - - // temporary, ignoring case - private Property findProperty(Type type, String columnName) { - Iterator properties = type.getProperties().iterator(); - while (properties.hasNext()) { - Property p = (Property) properties.next(); - if (columnName.equalsIgnoreCase(p.getName())) - return p; - } - return null; - } - - private Type findTableTypeByPropertyName(String tableName) { - Iterator i = rootObject.getType().getProperties().iterator(); - while (i.hasNext()) { - Property p = (Property) i.next(); - // System.out.println(p.getType().getName()); - if (tableName.equals(p.getType().getName())) - return p.getType(); - } - - return null; - } - - private Type findTableTypeByRootReference(String refName) { - return rootObject.getProperty(refName).getType(); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/DefaultConverter.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/DefaultConverter.java deleted file mode 100644 index 54c536d95c..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/DefaultConverter.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.sql.Blob; -import java.sql.SQLException; - -import org.apache.tuscany.das.rdb.Converter; - - -public class DefaultConverter implements Converter { - - public DefaultConverter() { - super(); - } - - public Object getColumnValue(Object data) { - return data; - } - - public Object getPropertyValue(Object data) { -// if (type.isInstance(data)) -// return data; -// -// if ( data == null ) -// return null; -// -// String name = type.getInstanceClass().getName(); -// if (name == "java.lang.Byte" || name == "byte") { -// return new Byte(data.toString()); -// } -// -// else if (name == "java.lang.Double" || name == "double") { -// return new Double(data.toString()); -// } -// -// else if (name == "java.lang.Float" || name == "float") { -// return new Float(data.toString()); -// } -// -// else if (name == "java.lang.Integer" || name == "int") { -// return new Integer(data.toString()); -// } -// -// else if (name == "java.lang.Long" || name == "long") { -// return new Long(data.toString()); -// } -// -// else if (name == "java.lang.Short" || name == "short") { -// return new Short(data.toString()); -// } -// -// else if (name == "java.lang.String") { -// return String.valueOf(data.toString()); -// } - - if ( data instanceof Blob ) { - Blob b = (Blob) data; - try { - return b.getBytes(1, (int)b.length()); - } catch (SQLException e) { - throw new RuntimeException(e); - } - } else { - return data; - } - - - -// else { -// -// throw new IllegalArgumentException("The database value of type " -// + data.getClass().getName() + " must be converted to type " -// + type.getInstanceClass().getName()); -// } - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/GraphBuilderMetadata.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/GraphBuilderMetadata.java deleted file mode 100644 index e869c31bee..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/GraphBuilderMetadata.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.ResultSetShape; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.graphbuilder.schema.ESchemaMaker; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.Type; - - -/** - */ -public class GraphBuilderMetadata { - - private Config mappingModel; - private final Collection resultSets = new ArrayList(); - private boolean debug = false; - private Type schema; - - - public GraphBuilderMetadata(Collection results, Type schema, Config model, ResultSetShape shape) throws SQLException { - this.mappingModel = model; - this.schema = schema; - - Iterator i = results.iterator(); - while (i.hasNext()) { - ResultSet rs = (ResultSet) i.next(); - ResultMetadata resultMetadata = new ResultMetadata(rs, mappingModel, shape); - resultSets.add(resultMetadata); - } - - DebugUtil.debugln(getClass(), debug, "Mapping model: " + mappingModel); - } - - - public Collection getResultMetadata() { - return this.resultSets; - } - - - public boolean hasMappingModel() { - return mappingModel == null ? false : true; - } - - - /** - * @return - */ - - public Collection getRelationships() { - if (!hasMappingModel()) { - DebugUtil.debugln(getClass(), debug, "No relationships to return"); - return Collections.EMPTY_LIST; - } - - return mappingModel.getRelationship(); - } - - - /** - * @return - */ - public Type getSchema() { - if ( this.schema == null ) { - ESchemaMaker schemaMaker = new ESchemaMaker(this); - return schemaMaker.createESchema(); - } else { - return this.schema; - } - } - - public Config getMapping() { - return this.mappingModel; - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/MultiTableRegistry.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/MultiTableRegistry.java deleted file mode 100644 index 142aee5c60..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/MultiTableRegistry.java +++ /dev/null @@ -1,105 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.DataObject; - - - -/** - * - * Used to store and look up table objects based on primary key - * This could be a lot more efficient if we could use LinkedHashMap from JDK 1.4 - */ -public class MultiTableRegistry implements TableRegistry { - - private HashMap tableNameMap; - private HashMap tableValueMap; - private boolean debug = false; - - - public MultiTableRegistry() { - tableNameMap = new HashMap(); - tableValueMap = new HashMap(); - } - - - - /** - * Get the table with the specified name and primary key - * @param tableName - * @param primaryKey - * @return EDataObject - */ - public DataObject get(String tableName, List primaryKey) { - if ( debug ) { - DebugUtil.debugln(getClass(), debug, "Looking for table " + tableName + " with PK " + primaryKey); - DebugUtil.debugln(getClass(), debug, ("\tReturning " + getPkMap(tableName).get(primaryKey))); - } - return (DataObject) getPkMap(tableName).get(primaryKey); - } - - /** - * Add the table with the specified name and primary key - * @param tableName - * @param primaryKey - * @param value - */ - public void put(String tableName, List primaryKey, DataObject value) { - if ( getPkMap(tableName).put(primaryKey, value) == null ) - getCreateValueList(tableName).add(value); - } - - /** - * Get the HashMap that contains the primary key to table object - * mappings. - * @param tableName - * @return HashMap - */ - private HashMap getPkMap(String tableName) { - HashMap pkMap = (HashMap)tableNameMap.get(tableName); - if ( pkMap == null ) { - pkMap = new HashMap(); - tableNameMap.put(tableName, pkMap); - } - return pkMap; - } - - private List getCreateValueList(String tableName) { - List values = (List) tableValueMap.get(tableName); - if ( values == null ) { - values = new ArrayList(); - tableValueMap.put(tableName, values); - } - return values; - } - - - - public boolean contains(String tableName, List primaryKey) { - return get(tableName,primaryKey) == null ? false : true; - - } - - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultMetadata.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultMetadata.java deleted file mode 100644 index 42ac10eef6..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultMetadata.java +++ /dev/null @@ -1,277 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.Converter; -import org.apache.tuscany.das.rdb.ResultSetShape; -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.config.wrapper.TableWrapper; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.Type; - -public class ResultMetadata { - - private HashMap tableToColumnMap = new HashMap(); - - private ArrayList tablePropertyNames = new ArrayList(); - - private ArrayList columnPropertyNames = new ArrayList(); - - private final ResultSet resultSet; - - private final ResultSetShape resultSetShape; - - private final MappingWrapper mappingWrapper; - - private Converter[] converters; - - private static boolean debug = false; - - public ResultMetadata(ResultSet rs, Config model, ResultSetShape shape) - throws SQLException { - debug("Creating new ResultMetadata with mapping model " + model); - this.resultSet = rs; - this.mappingWrapper = new MappingWrapper(model); - - if (shape == null) - this.resultSetShape = new ResultSetShape(rs.getMetaData()); - else - this.resultSetShape = shape; - - this.converters = new Converter[resultSetShape.getColumnCount()]; - - for (int i = 1; i <= resultSetShape.getColumnCount(); i++) { - String tableName = resultSetShape.getTableName(i); - - String tableProperty = mappingWrapper - .getTablePropertyName(tableName); - String columnProperty = mappingWrapper.getColumnPropertyName( - tableName, resultSetShape.getColumnName(i)); - String converter = mappingWrapper.getConverter(tableName, - resultSetShape.getColumnName(i)); - if (converter != null) { - try { - Converter convInstance = (Converter) Class.forName( - converter).newInstance(); - converters[i - 1] = convInstance; - } catch (Exception ex) { - throw new RuntimeException(ex); - } - - } else { - // TODO make static - converters[i - 1] = new DefaultConverter(); - } - DebugUtil.debugln(getClass(), debug, "Adding table/column: " - + tableProperty + "/" + columnProperty); - tablePropertyNames.add(tableProperty); - columnPropertyNames.add(columnProperty); - - Collection columns = (Collection) tableToColumnMap - .get(tableProperty); - if (columns == null) - columns = new ArrayList(); - columns.add(columnProperty); - tableToColumnMap.put(tableProperty, columns); - } - - // Add any tables defined in the model but not included in the ResultSet - // to the list of propertyNames - if (model != null) { - Iterator tablesFromModel = model.getTable().iterator(); - while (tablesFromModel.hasNext()) { - TableWrapper t = new TableWrapper((Table) tablesFromModel - .next()); - if (tableToColumnMap.get(t.getPropertyName()) == null) - tableToColumnMap.put(t.getPropertyName(), - Collections.EMPTY_LIST); - } - } - - if (debug) { - DebugUtil.debugln(getClass(), debug, toString()); - DebugUtil - .debugln(getClass(), debug, this.resultSetShape.toString()); - } - - } - - private void debug(Object string) { - if (debug) - DebugUtil.debugln(getClass(), debug, string); - } - - public Collection getColumnNames() { - return columnPropertyNames; - } - - public String getColumnPropertyName(int i) { - return (String) columnPropertyNames.get(i - 1); - } - - public String getDatabaseColumnName(int i) { - return resultSetShape.getColumnName(i); - } - - public String getTableName(String columnName) { - return (String) tablePropertyNames.get(columnPropertyNames - .indexOf(columnName)); - } - - public int getTableSize(String tableName) { - return ((Collection) tableToColumnMap.get(tableName)).size(); - } - - public Type getDataType(String columnName) { - return resultSetShape.getColumnType(columnPropertyNames - .indexOf(columnName)); - } - - public String getTablePropertyName(int i) { - return (String) tablePropertyNames.get(i - 1); - } - - public Collection getAllTablePropertyNames() { - return tableToColumnMap.keySet(); - } - - public String toString() { - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (Table Names: "); - Iterator i = tablePropertyNames.iterator(); - while (i.hasNext()) { - String tableName = (String) i.next(); - result.append(' '); - result.append(tableName); - result.append(','); - } - - result.append(" columnNames: "); - - i = columnPropertyNames.iterator(); - while (i.hasNext()) { - String columnName = (String) i.next(); - result.append(' '); - result.append(columnName); - result.append(','); - } - - result.append(" mappingModel: "); - result.append(this.mappingWrapper.getConfig()); - - result.append(" resultSet: "); - result.append(resultSet); - - result.append(" resultSetSize: "); - result.append(resultSetShape.getColumnCount()); - result.append(')'); - return result.toString(); - - } - - /** - * @return - */ - public int getNumberOfTables() { - return tableToColumnMap.keySet().size(); - } - - /** - * Return whether the column at the given position is part of a primary key. - * If we don't have this information, we assume every column is a primary - * key. This results in uniqueness checks using all columns in a table. - * - * @param i - * @return - */ - public boolean isPKColumn(int i) { - if (debug) { - DebugUtil.debugln(getClass(), debug, "Checking to see if " - + getColumnPropertyName(i) + " is a PK column in " - + getTablePropertyName(i)); - } - if (!hasMappingModel()) { - if (debug) - DebugUtil - .debugln(getClass(), debug, - "No mapping model exists, all columns will be considered PK columns"); - return true; - } else { - Table t = mappingWrapper.getTable(getTablePropertyName(i)); - if (t == null) - return true; - Column c = mappingWrapper.getColumn(t, getDatabaseColumnName(i)); - - if (c == null) - return false; - - if (c.isPrimaryKey()) - return true; - } - return false; - } - - public boolean hasMappingModel() { - return mappingWrapper.getConfig() == null ? false : true; - } - - /** - * @param i - * @return - */ - public Type getDataType(int i) { - return resultSetShape.getColumnType(i); - } - - /** - * @param tableName - * @return - */ - public Collection getColumnNames(String tableName) { - return (Collection) tableToColumnMap.get(tableName); - } - - public ResultSet getResultSet() { - return this.resultSet; - } - - public int getResultSetSize() { - return resultSetShape.getColumnCount(); - } - - public boolean isRecursive() { - return mappingWrapper.hasRecursiveRelationships(); - } - - public Converter getConverter(int i) { - return converters[i - 1]; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultSetProcessor.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultSetProcessor.java deleted file mode 100644 index 8ccc0aee12..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultSetProcessor.java +++ /dev/null @@ -1,137 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.DataObject; - -/** - * - * A ResultSetProcessor is used to transform the data in a ResultSet into a set - * of inter-related EDataObjects. - */ -public class ResultSetProcessor { - - private TableRegistry registry; - - private GraphBuilderMetadata metadata; - - private boolean debug = false; - - private final DataObjectMaker doMaker; - - public ResultSetProcessor(DataObject g, GraphBuilderMetadata gbmd) { - - this.metadata = gbmd; - if (metadata.getRelationships().size() == 0) - registry = new SingleTableRegistry(); - else - registry = new MultiTableRegistry(); - - doMaker = new DataObjectMaker(g); - - debug(metadata); - - } - - private void debug(Object output) { - DebugUtil.debugln(getClass(), debug, output); - } - - /** - * Process the ResultSet. For each row in the ResultSet, a - * - * @link ResultSetRow object will be created to represent the row as a set - * of EDataObjects. Then, the relevant relationships will be - * constructed between each object in the - * @link ResultSetRow. - * - * @param rs - * The ResultSet - */ - public void processResults(int start, int end) throws SQLException { - - Iterator i = metadata.getResultMetadata().iterator(); - while ( i.hasNext()) { - ResultMetadata resultMetadata = (ResultMetadata)i.next(); - ResultSet results = resultMetadata.getResultSet(); - - processResultSet(results, resultMetadata, start, end); - - //TODO These statements HAVE to be closed or we will have major problems - //results.getStatement().close(); - results.close(); - } - - } - - - private void processResultSet(ResultSet rs, ResultMetadata rsMetadata, - int start, int end) throws SQLException { - - if ( rs.getType() == ResultSet.TYPE_FORWARD_ONLY) { - while (rs.next() && start < end) { - ResultSetRow rsr = new ResultSetRow(rs, rsMetadata); - addRowToGraph(rsr, rsMetadata); - ++start; - } - } else { - while (rs.absolute(start) && start < end) { - ResultSetRow rsr = new ResultSetRow(rs, rsMetadata); - addRowToGraph(rsr, rsMetadata); - ++start; - } - } - } - - /** - * @param row - * @param resultMetadata - */ - private void addRowToGraph(ResultSetRow row, ResultMetadata resultMetadata) { - RowObjects tableObjects = new RowObjects(metadata, registry); - Iterator tables = row.getAllTableData().iterator(); - while (tables.hasNext()) { - TableData rawDataFromRow = (TableData) tables.next(); - - if ( (resultMetadata.hasMappingModel()) && (!rawDataFromRow.hasValidPrimaryKey() ) ) - continue; - - String tableName = rawDataFromRow.getTableName(); - DataObject tableObject = registry.get(tableName, rawDataFromRow - .getPrimaryKeyValues()); - if (tableObject == null) { - tableObject = doMaker.createAndAddDataObject(rawDataFromRow, resultMetadata); - - debug("Putting table " + tableName + " with PK " + rawDataFromRow.getPrimaryKeyValues() + " into registry"); - - registry.put(tableName, rawDataFromRow.getPrimaryKeyValues(), - tableObject); - } - tableObjects.put(tableName, tableObject); - } - - tableObjects.processRelationships(); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultSetRow.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultSetRow.java deleted file mode 100644 index f68f48fc06..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultSetRow.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - - -/** - * - * A ResultSetRow is used to transform a single row of a ResultSet into a set of - * EDataObjects. - */ -public class ResultSetRow { - - private final ResultMetadata metadata; - - private HashMap tableMap = new HashMap(); - - private ArrayList allTableData; - - private boolean debug = false; - - /** - * Method ResultSetRow. - * - * @param rs - * A ResultSet positioned on the desired row - * @param ePackage - * The package used to create EDataObjects - */ - public ResultSetRow(ResultSet rs, ResultMetadata m) throws SQLException { - this.metadata = m; - if (m.isRecursive()) - processRecursiveRow(rs); - else - processRow(rs); - } - - /** - * Processes a single row in the ResultSet Method processRow. - * - * @param rs - */ - private void processRow(ResultSet rs) throws SQLException { - - DebugUtil.debugln(getClass(), debug, ""); - for (int i = 1; i <= metadata.getResultSetSize(); i++) { - Object data = getObject(rs, i); - - TableData table = getRawData(metadata.getTablePropertyName(i)); - DebugUtil.debugln(getClass(), debug, "Adding column: " - + metadata.getColumnPropertyName(i) + "\tValue: " + data - + "\tTable: " + metadata.getTablePropertyName(i)); - table.addData(metadata.getColumnPropertyName(i), metadata - .isPKColumn(i), data); - } - - } - - public void processRecursiveRow(ResultSet rs) throws SQLException { - this.allTableData = new ArrayList(); - int i = 1; - DebugUtil.debugln(getClass(), debug, ""); - while (i <= metadata.getResultSetSize()) { - DebugUtil.debugln(getClass(), debug, ""); - TableData table = new TableData(metadata.getTablePropertyName(i)); - this.allTableData.add(table); - - while ( (i <= metadata.getResultSetSize()) && (metadata.isPKColumn(i))) { - Object data = getObject(rs, i); - DebugUtil.debugln(getClass(), debug, "Adding column: " - + metadata.getColumnPropertyName(i) + "\tValue: " + data - + "\tTable: " + metadata.getTablePropertyName(i)); - table.addData(metadata.getColumnPropertyName(i), true, data); - i++; - } - - while ( (i <= metadata.getResultSetSize()) && - (!metadata.isPKColumn(i))) { - Object data = getObject(rs, i); - DebugUtil.debugln(getClass(), debug, "Adding column: " - + metadata.getColumnPropertyName(i) + "\tValue: " + data - + "\tTable: " + metadata.getTablePropertyName(i)); - table.addData(metadata.getColumnPropertyName(i), false, data); - i++; - } - } - } - - /** - * @param rs - * @param metadata - * @param i - * @return - */ - private Object getObject(ResultSet rs, int i) - throws SQLException { - - Object data = rs.getObject(i); - - if (rs.wasNull()) - return null; - else - return metadata.getConverter(i).getPropertyValue(data); - } - - /** - * Returns a HashMap that holds data for the specified table - * - * @param tableName - * The name of the table - * @return HashMap - */ - public TableData getTable(String tableName) { - return (TableData) tableMap.get(tableName); - } - - /** - * Returns a HashMap that holds data for the specified table If the HashMap - * doesn't exist, it will be created. This is used internally to build the - * ResultSetRow, whereas getTable is used externally to retrieve existing - * table data. - * - * @param tableName - * The name of the table - * @return HashMap - */ - private TableData getRawData(String tableName) { - - TableData table = (TableData) tableMap.get(tableName); - - if (table == null) { - table = new TableData(tableName); - tableMap.put(tableName, table); - } - - return table; - } - - public ArrayList getAllTableData() { - if ( this.allTableData == null ) { - this.allTableData = new ArrayList(); - this.allTableData.addAll(tableMap.values()); - } - DebugUtil.debugln(getClass(), debug, allTableData); - - return this.allTableData; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/RowObjects.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/RowObjects.java deleted file mode 100644 index f0df0ab7c3..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/RowObjects.java +++ /dev/null @@ -1,140 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* 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. -*/ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.config.KeyPair; -import org.apache.tuscany.das.rdb.config.Relationship; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.Property; - - -public class RowObjects { - - private HashMap objectsByTableName; - - private ArrayList tableObjects; - - private static final boolean debug = false; - - private final GraphBuilderMetadata metadata; - - private final TableRegistry registry; - - public RowObjects(GraphBuilderMetadata metadata, TableRegistry registry) { - objectsByTableName = new HashMap(); - tableObjects = new ArrayList(); - this.metadata = metadata; - this.registry = registry; - } - - public void put(String key, DataObject value) { - objectsByTableName.put(key, value); - tableObjects.add(value); - } - - public DataObject get(String tablePropertyName) { - return (DataObject) objectsByTableName.get(tablePropertyName); - } - - void processRelationships() { - MappingWrapper wrapper = new MappingWrapper(metadata.getMapping()); - if (wrapper.hasRecursiveRelationships()) { - processRecursiveRelationships(wrapper); - return; - } - - Iterator i = metadata.getRelationships().iterator(); - while (i.hasNext()) { - Relationship r = (Relationship) i.next(); - - - DataObject parentTable = get(wrapper - .getTablePropertyName(r.getPrimaryKeyTable())); - DataObject childTable = get(wrapper - .getTablePropertyName(r.getForeignKeyTable())); - - DebugUtil.debugln(getClass(), debug, "Parent table: " + parentTable); - DebugUtil.debugln(getClass(), debug, "Child table: " + childTable); - - if ((parentTable == null) || (childTable == null)) - continue; - - Property p = parentTable.getType().getProperty(r.getName()); - setOrAdd(parentTable, childTable, p); - - } - } - - - - private void processRecursiveRelationships(MappingWrapper wrapper) { - Iterator i = tableObjects.iterator(); - while (i.hasNext()) { - DataObject table = (DataObject) i.next(); - - Iterator relationships = wrapper.getRelationshipsByChildTable(table.getType().getName()).iterator(); - while ( relationships.hasNext() ) { - Relationship r = (Relationship) relationships.next(); - - DataObject parentTable = findParentTable(table, r, wrapper); - - if (parentTable == null) - continue; - - Property p = parentTable.getType().getProperty(r.getName()); - setOrAdd(parentTable, table, p); - } - - } - } - - private void setOrAdd(DataObject parent, DataObject child, Property p) { - if (p.isMany()) { - parent.getList(p).add(child); - } else { - parent.set(p, child); - } - } - - private DataObject findParentTable(DataObject childTable, - Relationship r, MappingWrapper wrapper) { - - ArrayList fkValue = new ArrayList(); - Iterator keyPairs = r.getKeyPair().iterator(); - while (keyPairs.hasNext()) { - KeyPair pair = (KeyPair) keyPairs.next(); - String childProperty = wrapper.getColumnPropertyName(r.getPrimaryKeyTable(), pair.getForeignKeyColumn()); - - Property p = childTable.getType().getProperty(childProperty); - fkValue.add(childTable.get(p)); - } - - DebugUtil.debugln(getClass(), debug, "Trying to find parent of " + r.getForeignKeyTable() + " with FK " - + fkValue); - DataObject parentTable = registry.get(r.getPrimaryKeyTable(), fkValue); - DebugUtil.debugln(getClass(), debug, "Parent table from registry: " + parentTable); - return parentTable; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/SingleTableRegistry.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/SingleTableRegistry.java deleted file mode 100644 index f00ef2770d..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/SingleTableRegistry.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.util.List; - -import commonj.sdo.DataObject; - -/** - */ -public class SingleTableRegistry implements TableRegistry { - - //private HashMap values = new HashMap(); - - public SingleTableRegistry() { - // Empty Constructor - } - - /* (non-Javadoc) - * @see com.ibm.ws.sdo.mediator.jdbc.graphbuilder.impl.TableRegistry#get(java.lang.String, java.util.List) - */ - public DataObject get(String tableName, List primaryKey) { - return null; - } - - /* (non-Javadoc) - * @see com.ibm.ws.sdo.mediator.jdbc.graphbuilder.impl.TableRegistry#put(java.lang.String, java.util.List, java.lang.Object) - */ - public void put(String tableName, List primaryKey, DataObject value) { - // do nothing - - } - - public boolean contains(String name, List list) { - return false; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/TableData.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/TableData.java deleted file mode 100644 index 48b6dc0187..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/TableData.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - - -/** - * - */ -public class TableData { - - private HashMap columnData = new HashMap(); - private ArrayList primaryKey = new ArrayList(); - private final String name; - private boolean hasValidPrimaryKey = true; - private static final boolean debug = false; - - public TableData(String tableName) { - DebugUtil.debugln(getClass(), debug, "Creating TableData for table " + tableName); - this.name = tableName; - } - - - public void addData(String columnName, boolean isPrimaryKeyColumn, Object data) { - DebugUtil.debugln(getClass(), debug, "Adding column " + columnName + " with value " + data); - columnData.put(columnName, data); - if ( isPrimaryKeyColumn ) { - if ( data == null ) { - DebugUtil.debugln(getClass(), debug, "Column " + columnName + " is a primary key column and is null"); - hasValidPrimaryKey = false; - } - primaryKey.add(data); - } - } - - public Object getColumnData(String columnName) { - return columnData.get(columnName); - } - - public String getTableName() { - return this.name; - } - - - /** - * @return - */ - public List getPrimaryKeyValues() { - return primaryKey; - } - - - public boolean hasValidPrimaryKey() { - return hasValidPrimaryKey; - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/TableRegistry.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/TableRegistry.java deleted file mode 100644 index 4b5a3677ae..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/TableRegistry.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.impl; - -import java.util.List; - -import commonj.sdo.DataObject; - -/** - */ -public interface TableRegistry { - /** - * Get the table with the specified name and primary key - * @param tableName - * @param primaryKey - * @return EDataObject - */ - public DataObject get(String tableName, List primaryKey); - - /** - * Add the table with the specified name and primary key - * @param tableName - * @param primaryKey - * @param value - */ - public void put(String tableName, List primaryKey, DataObject value); - - public boolean contains(String name, List list); -} \ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EAttributeMaker.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EAttributeMaker.java deleted file mode 100644 index bb26ac51c3..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EAttributeMaker.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.schema; - -import org.apache.tuscany.sdo.SDOFactory; -import org.apache.tuscany.sdo.impl.AttributeImpl; -import org.apache.tuscany.sdo.impl.DataTypeImpl; - -import commonj.sdo.Type; - - -/** - * - * A helper used to create new EAttributes - */ -public class EAttributeMaker { - - private static EAttributeMaker maker; - - protected EAttributeMaker() { - // Empty Constructor - } - - /** - * Return an EAttributeMaker singleton - * @return EAttributeMaker - */ - public static EAttributeMaker singleton() { - if (maker == null) - maker = new EAttributeMaker(); - return maker; - } - - /** - * Create a new EAttribute with the specified name and type - * @param name The name of the new EAttribute - * @param type The type of the new EAttribute - * @return EAttribute - */ - public AttributeImpl createEAttribute(String name, Type type) { - - AttributeImpl attr = (AttributeImpl) getFactory().createAttribute(); - attr.setName(name); - attr.setEType((DataTypeImpl)type); - attr.setUnique(false); - - return attr; - } - - private SDOFactory getFactory() { - return SDOFactory.eINSTANCE; - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EReferenceMaker.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EReferenceMaker.java deleted file mode 100644 index 480f5d1bdd..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EReferenceMaker.java +++ /dev/null @@ -1,131 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* 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. -*/ -package org.apache.tuscany.das.rdb.graphbuilder.schema; - -import org.apache.tuscany.das.rdb.config.Relationship; -import org.apache.tuscany.sdo.SDOFactory; -import org.apache.tuscany.sdo.impl.ClassImpl; -import org.apache.tuscany.sdo.impl.ReferenceImpl; - -import commonj.sdo.Type; - -/** - * A helper used to create EReferences - */ -public class EReferenceMaker { - - public EReferenceMaker() { - // Empty Constructor - } - - /** - * Create an EReference with the specified name, type, lower bound, upper bound - * and containment. - * @param name - * @param type - * @param lowerBound - * @param upperBound - * @param containment - * @return EReference - */ - public ReferenceImpl createReference(String name, Type type, int lowerBound, int upperBound, boolean containment, boolean changeable) { - ReferenceImpl ref = (ReferenceImpl) getFactory().createReference(); - ref.setName(name); - ref.setEType((ClassImpl)type); - ref.setLowerBound(lowerBound); - ref.setUpperBound(upperBound); - ref.setContainment(containment); - ref.setResolveProxies(false); - ref.setChangeable(changeable); - - return ref; - } - - public ReferenceImpl createReference(String name, Type type, int lowerBound, int upperBound, boolean containment) { - return createReference(name, type, lowerBound, upperBound, containment, true); - } - /** - * Create a one to many reference with the specified name, type, and containment - * @param name - * @param type - * @param containment - * @return - */ - public ReferenceImpl createOneToManyReference(String name, Type type, boolean containment) { - return createReference(name, type, 0, -1, containment); - } - - /** - * Create a one to many reference with the specified name and type - * @param name - * @param type - * @return EReference - */ - public ReferenceImpl createOneToManyReference(String name, Type type) { - return createOneToManyReference(name, type, false); - } - - /** - * Create a one to one reference with the specified name and type - * @param name - * @param type - * @return EReference - */ - public ReferenceImpl createOneToOneReference(String name, Type type) { - ReferenceImpl ref = createReference(name, type,0,1,false); - return ref; - } - - /** - * Create a many to one reference with the specified name and type - * @param name - * @param type - * @return EReference - */ - public ReferenceImpl createManyToOneReference(String name, Type type) { - return createReference(name,type,0,1,false); - } - - private SDOFactory getFactory() { - return SDOFactory.eINSTANCE; - } - - - /** - * @param r - * @param parent - * @param child - * @return - */ - public ReferenceImpl createReference(Relationship r, Type parent, Type child) { - if ( !r.isMany() ) { - ReferenceImpl ref = createOneToOneReference(r.getName(), child); - ReferenceImpl opp = createOneToOneReference(r.getName() + "_opposite", parent); - ref.setEOpposite(opp); - opp.setEOpposite(ref); - return ref; - } else { - ReferenceImpl ref = createOneToManyReference(r.getName(), child); - ReferenceImpl opp = createManyToOneReference(r.getName() + "_opposite", parent); - ref.setEOpposite(opp); - opp.setEOpposite(ref); - return ref; - } - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ESchemaMaker.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ESchemaMaker.java deleted file mode 100644 index 5b1a300736..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ESchemaMaker.java +++ /dev/null @@ -1,261 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.schema; - -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.config.Relationship; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.graphbuilder.impl.GraphBuilderMetadata; -import org.apache.tuscany.das.rdb.graphbuilder.impl.ResultMetadata; -import org.apache.tuscany.das.rdb.util.DebugUtil; -import org.apache.tuscany.sdo.SDOFactory; -import org.apache.tuscany.sdo.impl.AttributeImpl; -import org.apache.tuscany.sdo.impl.ClassImpl; -import org.apache.tuscany.sdo.impl.DynamicDataObjectImpl; -import org.apache.tuscany.sdo.impl.ReferenceImpl; -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.apache.tuscany.sdo.util.SDOUtil; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EcoreFactory; -import org.eclipse.emf.ecore.impl.EFactoryImpl; - -import commonj.sdo.Type; -import commonj.sdo.helper.TypeHelper; - -/** - * - * An ESchemaMaker is used to create an EMF Schema from an instance of JDBC - * Mediator Metadata. - * - */ -public class ESchemaMaker { - - private final GraphBuilderMetadata metadata; - - private EPackage dataGraphPackage; - - private final String nsPrefix; - - private final String pkgName; - - private boolean debug = false; - - /** - * Constructor for ESchemaMaker. Creates an EMF Schema based on the metadata - * passed in. - * - * @param metadata - */ - public ESchemaMaker(GraphBuilderMetadata metadata) { - this(metadata, null, null); - } - - /** - * Constructor for ESshemaMaker. Creates an EMF Schema based on the supplied - * metadata, namespace prefix, and package name - * - * @param metadata - * the metadata - * @param nsPrefix - * the namespace prefix - this affects the generated - * Factory/Package name - defaults to datagraph - * @param pkgName - * the package name - determines package name for generated code - - * defaults to datagraph - */ - public ESchemaMaker(GraphBuilderMetadata metadata, String nsPrefix, - String pkgName) { - if (nsPrefix == null) - nsPrefix = "datagraph"; - if (pkgName == null) - pkgName = "datagraph"; - - this.metadata = metadata; - this.nsPrefix = nsPrefix; - this.pkgName = pkgName; - - TypeHelper helper = TypeHelper.INSTANCE; - } - - /** - * Creates an EMF Schema by using the - * - * @link TableMaker and - * @link RelationshipMaker to transform - * @link Metadata elements into EMF Schema elements. - */ - - public Type createESchema() { - TypeHelper.INSTANCE.getType("commonj.sdo", "Integer"); - DataObjectUtil.initRuntime(); - SDOUtil.createDataGraph(); - - ClassImpl rootClass = (ClassImpl) SDOFactory.eINSTANCE.createClass(); - Type rootType = (Type) rootClass; - - rootClass.setName("DataGraphRoot"); - getEPackage().getEClassifiers().add(rootClass); - - EReferenceMaker refMaker = new EReferenceMaker(); - - Iterator iter = metadata.getResultMetadata().iterator(); - while (iter.hasNext()) { - - ResultMetadata resultMetadata = (ResultMetadata) iter.next(); - - Iterator names = resultMetadata.getAllTablePropertyNames() - .iterator(); - while (names.hasNext()) { - String tableName = (String) names.next(); - if (rootClass.getEStructuralFeature(tableName) == null) { - Type clazz = createType(tableName); - getEPackage().getEClassifiers().add(clazz); - ReferenceImpl ref = refMaker.createOneToManyReference( - tableName, clazz, true); - rootClass.getEStructuralFeatures().add(ref); - } - } - - for (int i = 1; i <= resultMetadata.getColumnNames().size(); i++) { - - ReferenceImpl ref = (ReferenceImpl) rootType - .getProperty(resultMetadata.getTablePropertyName(i)); - - if (ref == null) - throw new RuntimeException("Could not find table " - + resultMetadata.getTablePropertyName(i) - + " in the SDO model"); - EClass clazz = ref.getEReferenceType(); - String columnName = resultMetadata.getColumnPropertyName(i); - - if (clazz.getEStructuralFeature(columnName) == null) { - Type atype = (Type) resultMetadata.getDataType(i); - - // EDataType type = (EDataType) atype.getEClassifier(); - - AttributeImpl attr = getAttributeMaker().createEAttribute( - columnName, atype); - - DebugUtil.debugln(getClass(), debug, "Adding column " - + columnName + " to " - + resultMetadata.getTablePropertyName(i)); - clazz.getEStructuralFeatures().add(attr); - } - } - } - - if (metadata.hasMappingModel()) { - MappingWrapper wrapper = new MappingWrapper(metadata.getMapping()); - Iterator i = metadata.getRelationships().iterator(); - while (i.hasNext()) { - Relationship r = (Relationship) i.next(); - - EClass parent = (EClass) getEPackage().getEClassifier( - wrapper.getTablePropertyName(r.getPrimaryKeyTable())); - EClass child = (EClass) getEPackage().getEClassifier( - wrapper.getTablePropertyName(r.getForeignKeyTable())); - if (parent == null) { - throw new RuntimeException("The parent table (" - + r.getPrimaryKeyTable() + ") in relationship " - + r.getName() - + " was not found in the mapping information."); - } else if (child == null) { - throw new RuntimeException("The child table (" - + r.getForeignKeyTable() + ") in relationship " - + r.getName() - + " was not found in the mapping information."); - } - - ReferenceImpl ref = refMaker.createReference(r, (Type)parent, (Type)child); - - DebugUtil.debugln(getClass(), debug, "Adding reference: " - + ref.getName() + " to " + parent.getName()); - if (parent.getEStructuralFeature(ref.getName()) == null) - parent.getEStructuralFeatures().add(ref); - - if (child.getEStructuralFeature(ref.getEOpposite().getName()) == null) - child.getEStructuralFeatures().add(ref.getEOpposite()); - - } - - } - - // EcoreUtil.freeze(rootObject.getEPackage()); - - return (Type) rootClass; - } - - /** - * Create an EClass with the specified name - * - * @param name - * @return EClass - */ - protected Type createType(String name) { - ClassImpl ecl = (ClassImpl) SDOFactory.eINSTANCE.createClass(); - ecl.setName(name); - - return ecl; - } - - /** - * Get an EAttributeMaker singleton - * - * @return EAttributeMaker - */ - private EAttributeMaker getAttributeMaker() { - return EAttributeMaker.singleton(); - } - - - /** - * @return the EPackage for this schema - */ - public EPackage getEPackage() { - if (this.dataGraphPackage == null) - this.dataGraphPackage = createEPackage(); - return this.dataGraphPackage; - } - - /** - * Create the EPackage for this schema Uses the packageName and nsPrefix - * values set in the constructors The EPackage overrides the default - * EFactory so that DataObjects will be created using MapDataObjectImpl. - * - * @return the new EPackage - */ - protected EPackage createEPackage() { - - EPackage pkg = EcoreFactory.eINSTANCE.createEPackage(); - pkg.setName(pkgName); - pkg.setNsPrefix(nsPrefix); - pkg.setNsURI("datagraph.ecore"); - - pkg.setEFactoryInstance(new EFactoryImpl() { - public EObject basicCreate(EClass cls) { - EObject result = new DynamicDataObjectImpl(cls); - return result; - } - }); - - return pkg; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ResultSetTypeMap.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ResultSetTypeMap.java deleted file mode 100644 index 3fcccf6fca..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ResultSetTypeMap.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.graphbuilder.schema; - -import java.sql.Types; - -import org.apache.tuscany.sdo.SDOPackage; - -import commonj.sdo.Type; -import commonj.sdo.helper.TypeHelper; - -/** - */ -public class ResultSetTypeMap { - - public static ResultSetTypeMap instance = new ResultSetTypeMap(); - - /** - * Constructor for ResultSetTypeMap. - */ - protected ResultSetTypeMap() { - // Empty Constructor - } - - /** - * These mappings taken primarily from "JDBC API and Tutorial and Reference" by - * Fisher, Ellis and Bruce. - * - * @param type - * @param isNullable - * @return - */ - public Type getEDataType(int type, boolean isNullable) { - - TypeHelper helper = TypeHelper.INSTANCE; - SDOPackage.eINSTANCE.eClass(); - switch (type) { - - case Types.CHAR: - case Types.VARCHAR: - case Types.LONGVARCHAR: - return helper.getType("commonj.sdo", "String"); - - case Types.NUMERIC: - case Types.DECIMAL: - return helper.getType("commonj.sdo", "Decimal"); - - case Types.BIT: - case Types.BOOLEAN: - if (isNullable) - return helper.getType("commonj.sdo", "Boolean"); - else - return helper.getType("commonj.sdo", "boolean"); - - case Types.TINYINT: - case Types.SMALLINT: - case Types.INTEGER: - if (isNullable) { - return helper.getType("commonj.sdo", "IntObject"); - } else - return helper.getType("commonj.sdo", "Int"); - - case Types.BIGINT: - if (isNullable) - return helper.getType("commonj.sdo", "Long"); - else - return helper.getType("commonj.sdo", "long"); - - case Types.REAL: - if (isNullable) - return helper.getType("commonj.sdo", "Real"); - else - return helper.getType("commonj.sdo", "real"); - - case Types.FLOAT: - case Types.DOUBLE: - if (isNullable) - return helper.getType("commonj.sdo", "Double"); - else - return helper.getType("commonj.sdo", "double"); - - case Types.BINARY: - case Types.VARBINARY: - case Types.LONGVARBINARY: - return helper.getType("commonj.sdo", "ByteArray"); - - case Types.DATE: - case Types.TIME: - case Types.TIMESTAMP: - return helper.getType("commonj.sdo", "Date"); - - case Types.CLOB: - return helper.getType("commonj.sdo", "Clob"); - - case Types.BLOB: - return helper.getType("commonj.sdo", "Blob"); - - case Types.ARRAY: - return helper.getType("commonj.sdo", "Array"); - - case Types.DISTINCT: - case Types.STRUCT: - case Types.REF: - case Types.DATALINK: - case Types.JAVA_OBJECT: - return helper.getType("commonj.sdo", "Object"); - - default: - return helper.getType("commonj.sdo", "Object"); - } - - } - - - public Type getType(int columnType, boolean b) { - return getEDataType(columnType, b); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ApplyChangesCommandImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ApplyChangesCommandImpl.java deleted file mode 100644 index 6e92a5e6a2..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ApplyChangesCommandImpl.java +++ /dev/null @@ -1,176 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.sql.Connection; -import java.sql.DriverManager; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.Key; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.ConnectionProperties; -import org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.Type; -import commonj.sdo.helper.XMLDocument; -import commonj.sdo.helper.XMLHelper; - -/** - * - */ -public class ApplyChangesCommandImpl implements ApplyChangesCommand { - - private ConnectionImpl dasConnection; - - private static final boolean debug = false; - - private ChangeSummarizer summarizer = new ChangeSummarizer(); - - public ApplyChangesCommandImpl() { - // Empty Constructor - } - - // IOException is recoverable, needs to be thrown - public ApplyChangesCommandImpl(InputStream mappingModel) throws IOException { - setMapping(mappingModel); - } - - public ApplyChangesCommandImpl(Config mappingModel){ - summarizer.setMapping(mappingModel); -//TODO - Really need to refactor the Command framework. ReadCommand and ApplychangesCommand should -// be using the same approach to set connection and should probably share the same initialization. -// if (mappingModel.getConnectionProperties() != null) -// setConnection(mappingModel.getConnectionProperties()); - } - - public void setConnection(Connection connection) { - setConnection(new ConnectionImpl(connection)); - } - - public void setConnection(Connection connection, boolean manageTransaction) { - ConnectionImpl c = new ConnectionImpl(connection); - c.setManageTransactions(manageTransaction); - setConnection(c); - } - - public void setConnection(ConnectionImpl connection) { - dasConnection = connection; - summarizer.setConnection(connection); - } - - public void setConnection(ConnectionProperties c) { - try { - Connection connection = null; - Class.forName(c.getDriverClassName()); - if (c.getDriverUserName() == null) - connection = DriverManager.getConnection(c.getDriverURL()); - else - connection = DriverManager.getConnection(c.getDriverURL(), c.getDriverUserName(), c.getDriverPassword()); - connection.setAutoCommit(false); - setConnection(connection); - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - - public void addCreateCommand(Type type, Command cmd) { - summarizer.addCreateCommand(type, cmd); - ((CommandImpl) cmd).setConnection(dasConnection); - } - - public void addUpdateCommand(Type type, Command cmd) { - // DebugUtil.debugln(getClass(), debug, "Adding update command for type - // " + type.getName()); - summarizer.addUpdateCommand(type, cmd); - ((CommandImpl) cmd).setConnection(dasConnection); - } - - public void addDeleteCommand(Type type, Command cmd) { - summarizer.addDeleteCommand(type, cmd); - ((CommandImpl) cmd).setConnection(dasConnection); - } - - public void execute(DataObject root) { - DebugUtil.debugln(getClass(), debug, "Executing ApplyChangesCmd"); - - if (dasConnection == null) - throw new RuntimeException("A connection must be provided"); - - if (!root.equals(root.getDataGraph().getRootObject())) - throw new RuntimeException("'root' argument must be the root of the datagraph"); - - Changes changes = summarizer.loadChanges(root); - - boolean success = false; - try { - changes.execute(); - success = true; - } finally { - if (success) - dasConnection.cleanUp(); - else - dasConnection.errorCleanUp(); - } - } - - public void setMapping(InputStream stream) throws IOException { - XMLHelper helper = XMLHelper.INSTANCE; - - ConfigPackageImpl impl = ConfigPackageImpl.eINSTANCE; - XMLDocument doc = helper.load(stream); - Config mapping = (Config) doc.getRootObject(); - - summarizer.setMapping(mapping); - if (mapping.getConnectionProperties() != null) - setConnection(mapping.getConnectionProperties()); - - } - - public void addRelationship(String parent, String child) { - summarizer.addRelationship(parent, child); - } - - public void addPrimaryKey(String columnName) { - summarizer.addPrimaryKey(columnName); - } - - public void addCollisionColumn(String columnName) { - summarizer.addCollisionColumn(columnName); - } - - public void addRelationship(Key parentKey, Key childKey) { - throw new RuntimeException("Not Implemented"); - } - - public void addPrimaryKey(Key key) { - summarizer.addPrimarykey(key); - } - - public void addGeneratedPrimaryKey(String columnName) { - summarizer.addGeneratedPrimaryKey(columnName); - } - - public void addConverter(String name, String converterName) { - summarizer.addConverter(name, converterName); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeFactory.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeFactory.java deleted file mode 100644 index 8e668c04ee..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeFactory.java +++ /dev/null @@ -1,172 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* 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. -*/ -package org.apache.tuscany.das.rdb.impl; - -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.config.wrapper.TableWrapper; -import org.apache.tuscany.das.rdb.generator.impl.CudGenerator; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.Property; -import commonj.sdo.Type; - -public class ChangeFactory { - - private final Type type; - - private InsertCommandImpl createCommand; - - private WriteCommandImpl updateCommand; - - private WriteCommandImpl deleteCommand; - - private static final boolean debug = false; - - private CudGenerator cudGenerator; - - private final MappingWrapper mapping; - - private final ConnectionImpl connection; - - public ChangeFactory(Type type, MappingWrapper mapping, ConnectionImpl connection) { - this.type = type; - this.mapping = mapping; - this.connection = connection; - } - - public Type getType() { - return this.type; - } - - public void setCreateCommand(InsertCommandImpl cmd) { - createCommand = cmd; - } - - public void setUpdateCommand(WriteCommandImpl cmd) { - DebugUtil.debugln(getClass(), debug, "Setting Update Command to " + cmd); - updateCommand = cmd; - } - - public void setDeleteCommand(WriteCommandImpl cmd) { - deleteCommand = cmd; - } - - private CudGenerator getCudGenerator() { - if (this.cudGenerator == null) - this.cudGenerator = new CudGenerator(); - return this.cudGenerator; - } - - ChangeOperation createUpdateOperation(DataObject changedObject, String propagatedID) { - return new UpdateOperation(getUpdateCommand(changedObject), changedObject, propagatedID); - } - ChangeOperation createUpdateOperation(DataObject changedObject) { - return createUpdateOperation(changedObject, null); - } - - ChangeOperation createDeleteOperation(DataObject changedObject) { - return new DeleteOperation(getDeleteCommand(changedObject), changedObject); - } - - ChangeOperation createInsertOperation(DataObject changedObject, String propagatedID) { - return new CreateOperation(getCreateCommand(changedObject), changedObject, propagatedID); - } - - ChangeOperation createInsertOperation(DataObject changedObject) { - return createInsertOperation(changedObject, null); - } - - - private InsertCommandImpl getCreateCommand(DataObject changedObject) { - - if ( createCommand == null ) { - Table table = mapping.getTable(changedObject.getType().getName()); - if (table == null ) - throw new RuntimeException("Table " + table + " was changed in the DataGraph but is not present in the Config"); - - String createStatement = table.getCreate(); - if ( createStatement == null ) { - createCommand = getCudGenerator().getInsertCommand(mapping, changedObject, table); - } else { - createCommand = new InsertCommandImpl(createStatement); - Iterator i = getCudGenerator().getCreateParameters(mapping, changedObject, table).iterator(); - while (i.hasNext()) { - Property p = (Property)i.next(); - createCommand.addParameter(p.getName(), p.getType()); - } - } - createCommand.setConnection(connection); - createCommand.mappingModel = mapping; - } - return createCommand; - } - - private WriteCommandImpl getDeleteCommand(DataObject changedObject) { - - if ( deleteCommand == null ) { - Table table = mapping.getTable(changedObject.getType().getName()); - if (table == null ) - throw new RuntimeException("Table " + table + " was changed in the DataGraph but is not present in the Config"); - String deleteStatement = table.getDelete(); - if ( deleteStatement == null ) { - deleteCommand = getCudGenerator().getDeleteCommand(table); - } else { - deleteCommand = new DeleteCommandImpl(deleteStatement); - Iterator i = getCudGenerator().getDeleteParameters(table).iterator(); - while (i.hasNext()) { - deleteCommand.addParameter((String)i.next(), SDODataTypes.OBJECT); - } - } - deleteCommand.setConnection(connection); - } - return deleteCommand; - } - - private WriteCommandImpl getUpdateCommand(DataObject changedObject) { - - if ( updateCommand == null ) { - Table table = mapping.getTableByPropertyName(changedObject.getType().getName()); - if (table == null ) - throw new RuntimeException("Table " + table + " was changed in the DataGraph but is not present in the Config"); - String updateStatement = table.getUpdate(); - if ( updateStatement == null ) { - updateCommand = getCudGenerator().getUpdateCommand(mapping, changedObject,table); - } else { - TableWrapper t = new TableWrapper(table); - if ( t.getCollisionColumn() != null ) - updateCommand = new OptimisticWriteCommandImpl(updateStatement); - else - updateCommand = new UpdateCommandImpl(updateStatement); - - - updateCommand.addParameters(getCudGenerator().getUpdateParameters(changedObject, table)); - - } - updateCommand.setConnection(connection); - updateCommand.mappingModel = mapping; - } - DebugUtil.debugln(getClass(), debug, "Returning updateCommand: " + updateCommand); - return updateCommand; - } - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeOperation.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeOperation.java deleted file mode 100644 index 0e8acac35b..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeOperation.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.Parameter; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.DataObject; - -/** - */ -public abstract class ChangeOperation { - - private final WriteCommandImpl writeCommand; - - protected DatabaseObject dObject; - - private static final boolean debug = false; - - protected String propagatedID = null; - - public ChangeOperation(WriteCommandImpl command) { - writeCommand = command; - } - - public ChangeOperation(WriteCommandImpl command, DataObject changedObject) { - writeCommand = command; - dObject = new DatabaseObject(command.getMappingModel(), changedObject); - } - - public void execute() { - DebugUtil.debugln(getClass(), debug, "Executing change operation"); - - Iterator i = writeCommand.getParameters().iterator(); - while (i.hasNext()) { - Parameter parm = (Parameter) i.next(); - DebugUtil.debugln(getClass(), debug, "setting " + parm.getName() + " to " + dObject.get(parm.getName())); - parm.setValue(dObject.get(parm.getName())); - } - - writeCommand.execute(); - //TODO - Added this instanceof hack. Brent to verify - if (( propagatedID != null ) && (writeCommand instanceof InsertCommandImpl)){ - DebugUtil.debugln(getClass(), debug, "Propagating key " + propagatedID); - int id = writeCommand.getGeneratedKey(); - dObject.setPropagatedID(propagatedID, id); - } - } - - public String getTableName() { - return dObject.getTableName(); - } - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeSummarizer.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeSummarizer.java deleted file mode 100644 index a30a146f53..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeSummarizer.java +++ /dev/null @@ -1,225 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* 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. -*/ -package org.apache.tuscany.das.rdb.impl; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.Key; -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.config.wrapper.QualifiedColumn; -import org.apache.tuscany.das.rdb.util.DebugUtil; -import org.apache.tuscany.sdo.impl.AttributeImpl; -import org.apache.tuscany.sdo.impl.ChangeSummaryImpl; -import org.apache.tuscany.sdo.impl.ChangeSummarySettingImpl; -import org.apache.tuscany.sdo.impl.ReferenceImpl; - -import commonj.sdo.ChangeSummary; -import commonj.sdo.DataObject; -import commonj.sdo.Type; - -public class ChangeSummarizer { - - private static final boolean debug = false; - - private Changes changes = new Changes(); - - private FactoryRegistry registry; - - private MappingWrapper mapping = new MappingWrapper(); - - private ConnectionImpl connection; - - private HashMap generatedKeys = new HashMap(); - - public ChangeSummarizer() { - // Empty Constructor - } - - public Changes loadChanges(DataObject root) { - ChangeSummary changeSummary = root.getDataGraph().getChangeSummary(); - if (changeSummary.isLogging()) - ((ChangeSummaryImpl) changeSummary).summarize(); - - List changedObjects = changeSummary.getChangedDataObjects(); - DebugUtil.debugln(getClass(), debug, - "List of changed objects contains " + changedObjects.size() - + " object(s)"); - - changes.setInsertOrder(mapping.getInsertOrder()); - changes.setDeleteOrder(mapping.getDeleteOrder()); - - Iterator i = changedObjects.iterator(); - while (i.hasNext()) { - DataObject o = (DataObject) i.next(); - - if (!(o.equals(root))) { - createChange(changeSummary, o); - } - } - - return changes; - } - - public void createChange(ChangeSummary changeSummary, - DataObject changedObject) { - - if (changeSummary.isCreated(changedObject)) { - DebugUtil.debugln(getClass(), debug, "Change is a create"); - if (!changeSummary.isDeleted(changedObject)) { - ChangeFactory factory = getRegistry().getFactory( - changedObject.getType()); - String propagatedID = (String) generatedKeys.get(changedObject - .getType().getName()); - changes.addInsert(factory.createInsertOperation(changedObject, - propagatedID)); - } - } else if (changeSummary.isDeleted(changedObject)) { - ChangeFactory factory = getRegistry().getFactory( - changedObject.getType()); - DebugUtil.debugln(getClass(), debug, "Change is a delete"); - changes.addDelete(factory.createDeleteOperation(changedObject)); - } else { - // bumpCollisionField(changedObject); - DebugUtil.debugln(getClass(), debug, "Change is a modify"); - List attrList = changeSummary.getOldValues(changedObject); - if (hasAttributeChange(attrList)) { - ChangeFactory factory = getRegistry().getFactory( - changedObject.getType()); - DebugUtil.debugln(getClass(), debug, "Attribute Change for " - + changedObject.getType().getName()); - String propagatedID = (String) generatedKeys.get(changedObject - .getType().getName()); - changes.addUpdate(factory.createUpdateOperation(changedObject, - propagatedID)); - } else { - // Reference change - List values = changeSummary.getOldValues(changedObject); - Iterator i = values.iterator(); - while (i.hasNext()) { - ChangeSummarySettingImpl setting = (ChangeSummarySettingImpl) i - .next(); - - if (setting.getFeature() instanceof ReferenceImpl) { - DebugUtil.debugln(getClass(), debug, - "Reference change for " - + changedObject.getType().getName()); - - ReferenceImpl ref = (ReferenceImpl) setting.getFeature(); - - DebugUtil.debugln(getClass(), debug, ref.getName()); - if (ref.getEOpposite().isMany()) { - ChangeFactory factory = getRegistry().getFactory( - changedObject.getType()); - changes.addUpdate(factory - .createUpdateOperation(changedObject)); - } - - } - } - } - } - - } - - private boolean hasAttributeChange(List theChanges) { - Iterator i = theChanges.iterator(); - while (i.hasNext()) { - ChangeSummarySettingImpl setting = (ChangeSummarySettingImpl) i.next(); - if (setting.getFeature() instanceof AttributeImpl) - return true; - } - return false; - } - - public void addCreateCommand(Type type, Command cmd) { - ChangeFactory cf = getRegistry().getFactory(type); - cf.setCreateCommand((InsertCommandImpl) cmd); - } - - public void addUpdateCommand(Type type, Command cmd) { - ChangeFactory cf = getRegistry().getFactory(type); - cf.setUpdateCommand((WriteCommandImpl) cmd); - } - - public void addDeleteCommand(Type type, Command cmd) { - ChangeFactory cf = getRegistry().getFactory(type); - cf.setDeleteCommand((WriteCommandImpl) cmd); - - } - - private FactoryRegistry getRegistry() { - if (this.registry == null) { - this.registry = new FactoryRegistry(mapping, connection); - } - return this.registry; - } - - public void setConnection(ConnectionImpl connection) { - this.connection = connection; - } - - public void setMapping(Config map) { - this.mapping = new MappingWrapper(map); - Iterator i = mapping.getConfig().getTable().iterator(); - while (i.hasNext()) { - Table t = (Table) i.next(); - Iterator columns = t.getColumn().iterator(); - while ( columns.hasNext()) { - Column c = (Column) columns.next(); - if ( c.isPrimaryKey() && c.isGenerated()) { - DebugUtil.debugln(getClass(), debug, "adding generated key " - + t.getName() + "." - + c.getName()); - generatedKeys.put(t.getName(), c.getName()); - } - } - } - } - - public void addRelationship(String parentName, String childName) { - mapping.addRelationship(parentName, childName); - } - - public void addPrimaryKey(String columnName) { - mapping.addPrimaryKey(columnName); - } - - public void addCollisionColumn(String columnName) { - mapping.addCollisionColumn(columnName); - } - - public void addPrimarykey(Key key) { - mapping.addPrimaryKey(key); - } - - public void addGeneratedPrimaryKey(String columnName) { - QualifiedColumn col = new QualifiedColumn(columnName); - generatedKeys.put(col.getTableName(), col.getColumnName()); - mapping.addGeneratedPrimaryKey(columnName); - } - - public void addConverter(String name, String converterName) { - mapping.addConverter(name, converterName); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Changes.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Changes.java deleted file mode 100644 index 364007d8cf..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Changes.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.util.ArrayList; -import java.util.Iterator; - -/** - * Mangages a set of graph-change operations. This simple implementaiton can be - * replaced with a version that provides R/I sorting - * - */ -public class Changes { - - private InsertList inserts = new InsertList(); - private UpdateList updates = new UpdateList(); - private DeleteList deletes = new DeleteList(); - -// private static final boolean debug = false; - - public void addInsert(ChangeOperation c) { - inserts.add(c); - } - - public void addUpdate(ChangeOperation c) { - updates.add(c); - } - - public void addDelete(ChangeOperation c) { - deletes.add(c); - } - - /** - * Execute all my change - */ - public void execute() { - - Iterator i = inserts.getSortedList().iterator(); - while ( i.hasNext() ) { - ChangeOperation c = (ChangeOperation) i.next(); - c.execute(); - } - - i = updates.getSortedList().iterator(); - while ( i.hasNext() ) { - ChangeOperation c = (ChangeOperation) i.next(); - c.execute(); - } - - - i = deletes.getSortedList().iterator(); - while (i.hasNext() ) { - ChangeOperation c = (ChangeOperation) i.next(); - c.execute(); - } - - } - - public void setInsertOrder(ArrayList insertOrder) { - inserts.setOrder(insertOrder); - } - - public void setDeleteOrder(ArrayList deleteOrder) { - deletes.setOrder(deleteOrder); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandFactoryImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandFactoryImpl.java deleted file mode 100644 index 6d719e6254..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandFactoryImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.CommandFactory; - - -public class CommandFactoryImpl implements CommandFactory { - - protected Map namedCommands = new HashMap(); - - public Command createCommand(String sql) { - return createCommand(sql, null); - } - - public Command createCommand(String sql, InputStream model) { - - sql = sql.trim(); //Remove leading white space - char firstChar = Character.toUpperCase(sql.charAt(0)); - switch (firstChar) { - case 'S': - return new ReadCommandImpl(sql, model); - case 'I': - return new InsertCommandImpl(sql); - case 'U': - return new UpdateCommandImpl(sql); - case 'D': - return new DeleteCommandImpl(sql); - case '{': - return new SPCommandImpl(sql); - default: - throw new Error("SQL => " + sql + " is not valid"); - } - - } - - public Command createReadCommand(String sql) { - return new ReadCommandImpl(sql); - } - - public Command createReadCommand(String sql, InputStream model) { - return new ReadCommandImpl(sql, model); - } - - public ApplyChangesCommand createApplyChangesCommand() { - return new ApplyChangesCommandImpl(); - } - - public ApplyChangesCommand createApplyChangesCommand( - InputStream mappingModel) throws IOException { - return new ApplyChangesCommandImpl(mappingModel); - } - - public Command getCommand (String name) { - return (Command) namedCommands.get(name); - } - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandGroupFactoryImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandGroupFactoryImpl.java deleted file mode 100644 index 766a63de7c..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandGroupFactoryImpl.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.apache.tuscany.das.rdb.impl; - -import java.io.InputStream; - -import org.apache.tuscany.das.rdb.CommandGroup; -import org.apache.tuscany.das.rdb.CommandGroupFactory; - -public class CommandGroupFactoryImpl implements CommandGroupFactory { - - - public CommandGroup createCommandGroup(InputStream configStream) { - return new CommandGroupImpl(configStream); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandGroupImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandGroupImpl.java deleted file mode 100644 index 35f77fb934..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandGroupImpl.java +++ /dev/null @@ -1,195 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import javax.naming.InitialContext; -import javax.naming.NamingException; -import javax.sql.DataSource; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.CommandGroup; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.ConnectionProperties; -import org.apache.tuscany.das.rdb.config.impl.ConfigPackageImpl; - -import commonj.sdo.helper.XMLHelper; - -/** - * An ConfiguredCommandFactory produces instances of Command and - * ApplyChangesCommand. This factory is initialized with a configuration that - * defines the commands it produces. - * - *

- * TODO - This is still underdevelopment and is likely to replace CommandFactory - * as the preferred mechanism to set commands at runtime. - * - * - */ -public class CommandGroupImpl implements CommandGroup { - - private Config config; - - private Connection connection; - - private Map commands = new HashMap(); - - public CommandGroupImpl(InputStream stream) { - super(); - setConfig(stream); - initialize(); - } - - private void initialize() { - - Iterator i = config.getCommand().iterator(); - while (i.hasNext()) { - org.apache.tuscany.das.rdb.config.Command commandConfig = (org.apache.tuscany.das.rdb.config.Command) i - .next(); - String kind = commandConfig.getKind(); - if (kind.equalsIgnoreCase("select")) - commands.put(commandConfig.getName(), new ReadCommandImpl(commandConfig.getSQL(), config)); - else if (kind.equalsIgnoreCase("update")) - commands.put(commandConfig.getName(), new UpdateCommandImpl(commandConfig.getSQL())); - else if (kind.equalsIgnoreCase("insert")) - commands.put(commandConfig.getName(), new InsertCommandImpl(commandConfig.getSQL())); - else if (kind.equalsIgnoreCase("delete")) - commands.put(commandConfig.getName(), new DeleteCommandImpl(commandConfig.getSQL())); - else - throw new Error("Invalid kind of command: " + kind); - - } - - } - - /* - * (non-Javadoc) - * - * @see org.apache.tuscany.das.rdb.CommandGroup#getApplyChangesCommand() - */ - public ApplyChangesCommand getApplyChangesCommand() { - ApplyChangesCommand cmd = new ApplyChangesCommandImpl(config); - cmd.setConnection(getConnection()); - return cmd; - } - - /* - * (non-Javadoc) - * - * @see org.apache.tuscany.das.rdb.CommandGroup#getCommand(java.lang.String) - */ - public Command getCommand(String name) { - if (!commands.containsKey(name)) - throw new RuntimeException("CommandGroup has no command named: " + name); - Command cmd = (Command) commands.get(name); - cmd.setConnection(getConnection()); - return cmd; - } - - // Private - - private void setConfig(InputStream stream) { - XMLHelper helper = XMLHelper.INSTANCE; - - ConfigPackageImpl impl = ConfigPackageImpl.eINSTANCE; - - try { - config = (Config) helper.load(stream).getRootObject(); - } catch (IOException e) { - throw new RuntimeException(e); - } - - } - - public void setConnection(Connection connection) { - this.connection = connection; - } - - public Connection getConnection() { - if (connection == null) - initializeConnection(); - return connection; - } - - private void initializeConnection() { - - ConnectionProperties cp = config.getConnectionProperties(); - if (cp == null) - throw new Error( - "No connection properties have been configured and no connection has been provided"); - - if (cp.getDataSource() != null) - initViaDataSource(cp); - else - initViaDriverManager(cp); - - } - - private void initViaDriverManager(ConnectionProperties cp) { - Connection connection = null; - - try { - Class.forName(cp.getDriverClassName()); - if (cp.getDriverUserName() == null) - connection = DriverManager.getConnection(cp.getDriverURL()); - else - connection = DriverManager.getConnection(cp.getDriverURL(), cp.getDriverUserName(), cp - .getDriverPassword()); - connection.setAutoCommit(false); - setConnection(connection); - } catch (Exception ex) { - throw new RuntimeException(ex); - } - - } - - //TODO - Refactor to eliminate common initialization code after connection is got - private void initViaDataSource(ConnectionProperties cp) { - - Connection connection = null; - - InitialContext ctx; - try { - ctx = new InitialContext(); - } catch (NamingException e) { - throw new Error(e); - } - try { - //TODO - I think we should rename this getDataSourceURL? - DataSource ds = (DataSource) ctx.lookup(cp.getDataSource()); - try { - connection = ds.getConnection(); - connection.setAutoCommit(false); - setConnection(connection); - } catch (SQLException e) { - throw new Error (e); - } - } catch (NamingException e) { - throw new Error(e); - } - - } -} \ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java deleted file mode 100644 index 5272a0b911..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java +++ /dev/null @@ -1,177 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.sql.Connection; -import java.util.List; - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.Key; -import org.apache.tuscany.das.rdb.Parameter; -import org.apache.tuscany.das.rdb.ResultSetShape; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; - -import commonj.sdo.DataObject; -import commonj.sdo.Type; -import commonj.sdo.helper.XSDHelper; - -public abstract class CommandImpl implements Command { - - protected Statement statement; - - protected Parameters parameters = new Parameters(); - - protected MappingWrapper mappingModel = new MappingWrapper(); - - protected static final boolean debug = false; - - protected ResultSetShape resultSetShape; - - public CommandImpl(String sqlString) { - statement = new Statement(sqlString); - - try { - URL url = getClass().getResource("/xml/sdoJava.xsd"); - if (url == null) - throw new RuntimeException( - "Could not find resource: xml/sdoJava.xsd"); - - InputStream inputStream = url.openStream(); - XSDHelper.INSTANCE.define(inputStream, url.toString()); - inputStream.close(); - } catch ( IOException ex ) { - throw new RuntimeException(ex); - } - - } - - public abstract void execute(); - - public abstract DataObject executeQuery(); - - public void setParameterValue(String name, Object value) { - parameters.setParameter(name, value); - } - - public void setParameterValue(int index, Object value) { - parameters.setParameter(index, value); - } - - public void setParameterType(String name, Type dataType) { - parameters.setParameterWithType(name, dataType); - } - - public void setParameterType(int index, Type dataType) { - parameters.setParameterWithType(index, dataType); - } - - public void addParameter(int index, Type sdoType) { - addParameter(index, Parameter.IN, sdoType); - } - - public void addParameter(int index, int direction, Type sdoType) { - parameters.findOrCreateParameterWithIndex(index, direction, sdoType); - } - - public void addParameter(String name, Type sdoType) { - addParameter(name, Parameter.IN, sdoType); - } - - public void addParameter(String name, int direction, Type sdoType) { - parameters.setParameterWithType(name, sdoType); - } - - public void addParameter(Parameter param) { - parameters.add(param); - } - - public Parameter getParameter(String name) { - return parameters.get(name); - } - - public Parameter getParameter(int index) { - return parameters.get(index); - - } - - public List getParameters() { - return parameters.parameterList(); - } - - public Object getParameterValue(String name) { - Parameter p = parameters.get(name); - if (p == null) - throw new RuntimeException("Parameter with name " + name - + " not found"); - - return p; - } - - public Object getParameterValue(int index) { - return parameters.parameterWithIndex(index).getValue(); - } - - public void setConnection(Connection connection) { - setConnection(new ConnectionImpl(connection)); - } - - public void setConnection(Connection connection, boolean manageTransaction) { - ConnectionImpl c = new ConnectionImpl(connection); - c.setManageTransactions(manageTransaction); - setConnection(c); - } - - public void setConnection(ConnectionImpl connection) { - statement.setConnection(connection); - } - - protected ConnectionImpl getConnection() { - return statement.getConnection(); - } - - public void addRelationship(String parentName, String childName) { - mappingModel.addRelationship(parentName, childName); - } - - public void addRelationship(Key parentKey, Key childKey) { - mappingModel.addRelationship(parentKey, childKey); - } - - public void addPrimaryKey(String pk) { - mappingModel.addPrimaryKey(pk); - } - - public void addPrimaryKey(Key pk) { - mappingModel.addPrimaryKey(pk); - } - - public void setResultSetShape(ResultSetShape shape) { - this.resultSetShape = shape; - } - - public void addConverter(String name, String converter) { - mappingModel.addConverter(name, converter); - } - - public void close() { - statement.close(); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ConnectionImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ConnectionImpl.java deleted file mode 100644 index 2da21bf930..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ConnectionImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.sql.CallableStatement; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - - -public class ConnectionImpl { - - private Connection connection; - private static final boolean debug = false; - - private boolean managingTransaction = true; - - public ConnectionImpl(Connection connection) { - this.connection = connection; - - try { - if (connection.getAutoCommit()) - throw new RuntimeException("AutoCommit must be off!"); - } catch (SQLException e) { - throw new RuntimeException(e); - } - - } - - public Connection getJDBCConnection() { - return connection; - } - - public void cleanUp() { - try { - if (managingTransaction) { - DebugUtil.debugln(getClass(), debug, "Committing Transaction"); - connection.commit(); - } - } catch (SQLException e) { - throw new RuntimeException(e); - } - } - - public void errorCleanUp() { - try { - if (managingTransaction) { - DebugUtil.debugln(getClass(), debug, "Rolling back Transaction"); - connection.rollback(); - } - } catch (SQLException e) { - throw new RuntimeException(e); - } - } - - public PreparedStatement prepareStatement(QueryString queryString) - throws SQLException { - DebugUtil.debugln(getClass(), debug, "Preparing Statement: " + queryString.getPreparedString()); - return connection.prepareStatement(queryString.getPreparedString(), java.sql.Statement.RETURN_GENERATED_KEYS); - } - - public PreparedStatement preparePagedStatement(QueryString queryString) throws SQLException { - DebugUtil.debugln(getClass(), debug, "Preparing Statement: " + queryString.getPreparedString()); - return connection.prepareStatement(queryString.getPreparedString(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); - } - - public void setManageTransactions(boolean manageTransactions) { - managingTransaction = manageTransactions; - - } - - public CallableStatement prepareCall(QueryString queryString) throws SQLException { - return connection.prepareCall(queryString.getPreparedString()); - } - - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CreateOperation.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CreateOperation.java deleted file mode 100644 index 87e6e063d7..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CreateOperation.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - - -import commonj.sdo.DataObject; - -public class CreateOperation extends ChangeOperation { - - public CreateOperation(WriteCommandImpl command, DataObject changedObject, String ID) { - super(command, changedObject); - this.propagatedID = ID; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DatabaseObject.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DatabaseObject.java deleted file mode 100644 index d3b00b2e7b..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DatabaseObject.java +++ /dev/null @@ -1,130 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* 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. -*/ -package org.apache.tuscany.das.rdb.impl; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.KeyPair; -import org.apache.tuscany.das.rdb.config.Relationship; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.Property; - -/** - * DatabaseObject wraps DataObject. If a field is an FK field, it will return - * the value from the parent. - * - * - */ -public class DatabaseObject { - - private final MappingWrapper mappingWrapper; - - private final DataObject dataObject; - - private Property parentReference; - - private static final boolean debug = false; - - private HashMap keyMappings = new HashMap(); - - public DatabaseObject(Config model, DataObject changedObject) { - this.mappingWrapper = new MappingWrapper(model); - this.dataObject = changedObject; - initialize(); - } - - // Initialize Key Mappings - private void initialize() { - if (mappingWrapper.getConfig() != null) { - List relationships = mappingWrapper.getConfig().getRelationship(); - Iterator i = relationships.iterator(); - while (i.hasNext()) { - Relationship r = (Relationship) i.next(); - DebugUtil.debugln(getClass(), debug, - "Initializing relationship: " + r.getName()); - if (r.getForeignKeyTable().equals(getTypeName())) { - List pairs = r.getKeyPair(); - Iterator iter = pairs.iterator(); - while (iter.hasNext()) { - KeyPair pair = (KeyPair) iter.next(); - keyMappings.put(pair.getForeignKeyColumn(), r); - } - } - } - } - } - - public Object get(String parameter) { - Relationship r = (Relationship) keyMappings.get(parameter); - if (r == null) - return dataObject.get(parameter); - - Property parentRef = getParentReference(r.getPrimaryKeyTable()); - DataObject parent = dataObject.getDataObject(parentRef); - String parentKey = getParentKey(r, parameter); - return parent.get(parentKey); - - } - - private String getParentKey(Relationship r, String parameter) { - List keyPairs = r.getKeyPair(); - Iterator i = keyPairs.iterator(); - while (i.hasNext()) { - KeyPair pair = (KeyPair) i.next(); - if (pair.getForeignKeyColumn().equals(parameter)) - return pair.getPrimaryKeyColumn(); - } - return null; - } - - public Property getParentReference(String parentName) { - if (this.parentReference == null) { - - Iterator i = dataObject.getType().getProperties().iterator(); - while (i.hasNext()) { - Property ref = (Property) i.next(); - if ((!ref.getType().isDataType()) && - (ref.getType().getName().equals(parentName))) { - this.parentReference = ref; - } - } - } - return this.parentReference; - } - - public String getTableName() { - if (mappingWrapper.getConfig() != null) - return mappingWrapper.getTableByPropertyName(getTypeName()) - .getName(); - else - return null; - } - - public String getTypeName() { - return dataObject.getType().getName(); - } - - public void setPropagatedID(String propagatedID, int id) { - dataObject.setInt(propagatedID, id); - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteCommandImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteCommandImpl.java deleted file mode 100644 index 3502784b6f..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteCommandImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -public class DeleteCommandImpl extends WriteCommandImpl { - - public DeleteCommandImpl(String sqlString) { - super(sqlString); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteList.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteList.java deleted file mode 100644 index 8650c6119c..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteList.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; - -/** - * DeleteList will sort delete operations so that child objects are deleted - * before their parents - * - * - */ -public class DeleteList { - - private HashMap opsByTableName = new HashMap(); - - private ArrayList order; - - private ArrayList deleteOperations = new ArrayList(); - - public DeleteList() { - super(); - } - - public void add(ChangeOperation op) { - if (( order == null ) || ( op.getTableName() == null ) ) { - deleteOperations.add(op); - } else { - String name = op.getTableName(); - ArrayList ops = (ArrayList) opsByTableName.get(name); - if (ops == null) - ops = new ArrayList(); - - ops.add(op); - opsByTableName.put(name, ops); - } - } - - public Collection getSortedList() { - if (( order != null ) && ( opsByTableName.keySet().size() > 0) ) { - Iterator i = this.order.iterator(); - while (i.hasNext()) { - String name = (String) i.next(); - deleteOperations.addAll((Collection) opsByTableName.get(name)); - } - } - - return deleteOperations; - } - - public void setOrder(ArrayList deleteOrder) { - this.order = deleteOrder; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteOperation.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteOperation.java deleted file mode 100644 index 100cc15d7b..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/DeleteOperation.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import org.apache.tuscany.das.rdb.util.DataObjectUtil; - -import commonj.sdo.DataObject; - -public class DeleteOperation extends ChangeOperation { - - - /** - * @param command - * @param changedObject - * Objects deleted from the graph have lost their "settings" and must - * be restored - */ - public DeleteOperation(WriteCommandImpl command, DataObject changedObject) { - super(command); - this.dObject = new DatabaseObject(command.getMappingModel(),DataObjectUtil.getRestoredCopy(changedObject)); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/FactoryRegistry.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/FactoryRegistry.java deleted file mode 100644 index ce09c748f4..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/FactoryRegistry.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.util.HashMap; - -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.Type; - -public class FactoryRegistry { - - private HashMap registry = new HashMap(); - private static final boolean debug = false; - private final MappingWrapper mapping; - private final ConnectionImpl connection; - - public FactoryRegistry(MappingWrapper mapping, ConnectionImpl connection) { - this.mapping = mapping; - this.connection = connection; - } - - public ChangeFactory getFactory(Type type) { - ChangeFactory factory = (ChangeFactory)registry.get(type); - if ( factory == null ) { - DebugUtil.debugln(getClass(), debug, "Creating new ChangeFactory for type " + type.getName()); - factory = new ChangeFactory(type, mapping, connection); - registry.put(type, factory); - } - return factory; - } - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/InsertCommandImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/InsertCommandImpl.java deleted file mode 100644 index 9c890c7106..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/InsertCommandImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.sql.SQLException; - -public class InsertCommandImpl extends WriteCommandImpl { - - private int generatedKey; - - private boolean hasGeneratedKey = false; - - public InsertCommandImpl(String sqlString) { - super(sqlString); - } - - protected boolean isInsert() { - return true; - } - - public int getGeneratedKey() { - - if (hasGeneratedKey) - return generatedKey; - - throw new RuntimeException("No generated key is available"); - } - - public Object getParameterValue(String name) { - - if (name.equals("generated_key")) - if (hasGeneratedKey) - return new Integer(generatedKey); - else - throw new RuntimeException("No generated key available"); - - return super.getParameterValue(name); - } - - protected void subtypeProcessing() throws SQLException { - loadGeneratedKey(); - } - - private void loadGeneratedKey() throws SQLException { - Integer key = statement.getGeneratedKey(); - if (key != null) { - hasGeneratedKey = true; - generatedKey = key.intValue(); - } - - } - - public String toString() { - - String superString = super.toString(); - StringBuffer buffer = new StringBuffer(superString); - - buffer.append("\nGenerating key: " + hasGeneratedKey); - if (hasGeneratedKey) - buffer.append("\nGenerated key: " + generatedKey); - - return buffer.toString(); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/InsertList.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/InsertList.java deleted file mode 100644 index ba86107247..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/InsertList.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - -/** - * InsertList will sort ChangeOperation objects so that parents are inserted - * before children - * - * - */ -public class InsertList { - - private HashMap opsByTableName = new HashMap(); - - private ArrayList insertOperations = new ArrayList(); - - private ArrayList order; - - private static final boolean debug = false; - - public void add(ChangeOperation op) { - DebugUtil.debugln(getClass(), debug, "Adding insert operation "); - if ((order.size() == 0) || (op.getTableName() == null)) { - insertOperations.add(op); - } else { - String name = op.getTableName(); - ArrayList ops = (ArrayList) opsByTableName.get(name); - if (ops == null) - ops = new ArrayList(); - - ops.add(op); - opsByTableName.put(name, ops); - } - } - - public Collection getSortedList() { - DebugUtil.debugln(getClass(), debug, "Getting sorted insert list"); - if ((order.size() > 0) && opsByTableName.keySet().size() > 0) { - Iterator i = this.order.iterator(); - while (i.hasNext()) { - String name = (String) i.next(); - DebugUtil.debugln(getClass(), debug, - "Adding operations for table " + name); - // TODO - KJW added null check ... Brent to verify. - if (opsByTableName.get(name) != null) - insertOperations.addAll((Collection) opsByTableName - .get(name)); - } - } - DebugUtil.debugln(getClass(), debug, "Returning " - + insertOperations.size() + " insert operations"); - return insertOperations; - } - - public void setOrder(ArrayList insertOrder) { - this.order = insertOrder; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/OptimisticWriteCommandImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/OptimisticWriteCommandImpl.java deleted file mode 100644 index ffdd1499ac..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/OptimisticWriteCommandImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.sql.SQLException; - -public class OptimisticWriteCommandImpl extends WriteCommandImpl { - - public OptimisticWriteCommandImpl(String sqlString) { - super(sqlString); - } - - public void execute() { - - boolean success = false; - try { - int rowsAffected = statement.executeUpdate(parameters); - success = true; - if ( rowsAffected == 0 ) - throw new RuntimeException("OCC Exception"); - } catch (SQLException e) { - throw new RuntimeException(e); - } finally { - if (success) - statement.getConnection().cleanUp(); - else - statement.getConnection().errorCleanUp(); - } - - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/PagerImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/PagerImpl.java deleted file mode 100644 index 32b17ef3e7..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/PagerImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.Pager; - -import commonj.sdo.DataObject; - -public class PagerImpl implements Pager { - - private final ReadCommandImpl command; - private final int size; - private int idx = 1; - - public PagerImpl(Command command, int size) { - this.command = (ReadCommandImpl)command; - this.command.enablePaging(); - this.size = size; - } - - public DataObject next() { - int start = idx; - int end = idx + size; - idx += size; - command.setStartRow(start); - command.setEndRow(end); - return command.executeQuery(); - } - - public DataObject getPage(int page) { - int end = (page * size) + 1; - int start = end - size; - idx = end; - command.setStartRow(start); - command.setEndRow(end); - return command.executeQuery(); - } - - public DataObject previous() { - int start = idx - (2 * size); - if ( start < 1 ) - start = 1; - int end = start + size; - idx = end; - command.setStartRow(start); - command.setEndRow(end); - return command.executeQuery(); - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ParameterImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ParameterImpl.java deleted file mode 100644 index 4528661b2c..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ParameterImpl.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import org.apache.tuscany.das.rdb.Converter; -import org.apache.tuscany.das.rdb.Parameter; - -import commonj.sdo.Type; - -public class ParameterImpl implements Parameter { - - private int index; - private Type type; - private String name; - private Object value; - private int direction = IN; - private Converter converter; - - public ParameterImpl() { - super(); - } - - public ParameterImpl(String name) { - this.name = name; - } - - public ParameterImpl(int index) { - this.index = index; - } - - public void setType(Type type) { - this.type = type; - } - - public void setIndex(int index) { - if ( index == 0 ) - throw new RuntimeException("Index of zero not allowed"); - this.index = index; - } - - public void setName(String name) { - this.name = name; - } - - public void setValue(Object value) { - this.value = value; - } - - public void setDirection(int direction) { - this.direction = direction; - } - - public Type getType() { - return this.type; - } - - public int getIndex() { - return this.index; - } - - public String getName() { - return this.name; - } - - public Object getValue() { - if ( getConverter() != null ) { - return getConverter().getColumnValue(this.value); - } else { - return this.value; - } - } - - public int getDirection() { - return this.direction; - } - - public void setConverter(Converter converter) { - this.converter = converter; - } - - public Converter getConverter() { - return this.converter; - } - - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("Index: " + getIndex()); - buffer.append("\nName: " + getName()); - buffer.append("\nValue: " + getValue()); - return buffer.toString(); - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Parameters.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Parameters.java deleted file mode 100644 index 4ea42f41b2..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Parameters.java +++ /dev/null @@ -1,150 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import org.apache.tuscany.das.rdb.Parameter; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.Type; - -public class Parameters { - - private ArrayList parameters = new ArrayList(); - - private ArrayList inParams = new ArrayList(); - - private ArrayList outParams = new ArrayList(); - - private HashMap parametersByName = new HashMap(); - - private static boolean debug = false; - - public Parameters() { - super(); - } - - public Parameter get(String name) { - return (Parameter) parametersByName.get(name); - } - - public Parameter get(int index) { - return (Parameter) parameters.get(index); - } - - public List outParams() { - return outParams; - } - - public List inParams() { - return inParams; - } - - private void addParameter(Parameter param) { - if (param.getDirection() == Parameter.IN) - inParams.add(param); - else if ((param.getDirection() == Parameter.OUT) - || (param.getDirection() == Parameter.IN_OUT)) - outParams.add(param); - - this.parameters.add(param); - parametersByName.put(param.getName(), param); - } - - public void add(Parameter param) { - addParameter(param); - } - - public Parameter findOrCreateParameterNamed(String name) { - Parameter param = get(name); - if (param == null) { - param = new ParameterImpl(name); - addParameter(param); - } - return param; - } - - public Parameter findOrCreateParameterWithIndex(int index, int direction, - Type sdoType) { - Iterator i = parameters.iterator(); - while (i.hasNext()) { - Parameter param = (Parameter) i.next(); - - if (param.getIndex() == index) - return param; - } - DebugUtil.debugln(getClass(), debug, - "Creating new parameter with index " + index); - Parameter newParam = new ParameterImpl(index); - newParam.setDirection(direction); - newParam.setType(sdoType); - addParameter(newParam); - return newParam; - } - - public List parameterList() { - return parameters; - } - - public Parameter findOrCreateParameterWithIndex(int index) { - return findOrCreateParameterWithIndex(index, Parameter.IN, - SDODataTypes.OBJECT); - } - - public void setParameter(int index, Object value) { - Parameter param = findOrCreateParameterWithIndex(index); - param.setValue(value); - } - - public void setParameter(String name, Object value) { - if (name == null) - throw new RuntimeException("Null parameter name not allowed"); - Parameter param = findOrCreateParameterNamed(name); - param.setValue(value); - } - - public void setParameterWithType(String name, Type sdoType) { - if (name == null) - throw new RuntimeException("Null parameter name not allowed"); - Parameter p = findOrCreateParameterNamed(name); - p.setType(sdoType); - } - - public void setParameterWithType(int index, Type sdoType) { - if (index == 0) - throw new RuntimeException("Null parameter index not allowed"); - Parameter p = findOrCreateParameterWithIndex(index); - p.setType(sdoType); - } - - public Parameter parameterWithIndex(int index) { - Iterator i = parameters.iterator(); - while (i.hasNext()) { - Parameter param = (Parameter) i.next(); - - if (param.getIndex() == index) - return param; - } - return null; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/QueryString.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/QueryString.java deleted file mode 100644 index 8304457a72..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/QueryString.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - - -public class QueryString { - - private final String unmodifiedQueryString; - private final String preparedString; - private HashMap parameters = new HashMap(); - private static final boolean debug = false; - - public QueryString(String originalString) { - this.unmodifiedQueryString = originalString; - this.preparedString = replaceNamesAndSetIndexes(originalString); - } - - public String getPreparedString() { - return this.preparedString; - } - - public String getUnmodifiedString() { - return this.unmodifiedQueryString; - } - - public int getParameterIndex(String name) { - DebugUtil.debugln(getClass(), debug, "Looking for parameter index for: " + name); - //System.out.println(toString()); - return ((Integer)parameters.get(name)).intValue(); - } - - private String replaceNamesAndSetIndexes(String query) { - DebugUtil.debugln(getClass(), debug, "Parameterizing query: " + query); - Pattern p = Pattern.compile(":[\\S&&[^,()]]*"); - Matcher m = p.matcher(query); - - int index = 1; - while (m.find()) { - parameters.put(m.group().substring(1), new Integer(index)); - query = m.replaceFirst("?"); - m = p.matcher(query); - index++; - } - - DebugUtil.debugln(getClass(), debug, "Parameterized query: " + query); - return query; - } - - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("\nOriginal SQL: "); - buffer.append(unmodifiedQueryString); - buffer.append("\nPrepared SQL: "); - buffer.append(preparedString); - buffer.append("\nParameters: "); - Iterator i = parameters.keySet().iterator(); - while ( i.hasNext() ) { - String key = (String)i.next(); - buffer.append("\n"); - buffer.append(key); - } - return buffer.toString(); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ReadCommandImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ReadCommandImpl.java deleted file mode 100644 index dd58c98e5b..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ReadCommandImpl.java +++ /dev/null @@ -1,204 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* 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. -*/ -package org.apache.tuscany.das.rdb.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.ConnectionProperties; -import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper; -import org.apache.tuscany.das.rdb.graphbuilder.impl.GraphBuilderMetadata; -import org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor; -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.apache.tuscany.sdo.util.SDOUtil; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; - -import commonj.sdo.ChangeSummary; -import commonj.sdo.DataGraph; -import commonj.sdo.DataObject; -import commonj.sdo.Type; -import commonj.sdo.helper.XMLHelper; - -public class ReadCommandImpl extends CommandImpl { - - private Type schema; - - private int startRow = 1; - - private int endRow = Integer.MAX_VALUE; - - public ReadCommandImpl(String sqlString) { - super(sqlString); - } - - public ReadCommandImpl(String sqlString, InputStream modelStream) { - this(sqlString); - if (modelStream != null) - setMappingModel(modelStream); - } - - public ReadCommandImpl(String sqlString, Config mapping) { - this(sqlString); - if (mapping != null) - setMappingModel(mapping); - } - - public void execute() { - throw new UnsupportedOperationException(); - } - - public DataObject executeQuery() { - - if (statement.getConnection() == null) - throw new RuntimeException( - "A DASConnection object must be specified before executing the query."); - - boolean success = false; - try { - ResultSet rs = statement.executeQuery(parameters); - success = true; - return buildGraph(rs); - } catch (SQLException e) { - throw new RuntimeException(e); - } finally { - if (success) - statement.getConnection().cleanUp(); - else - statement.getConnection().errorCleanUp(); - } - } - - protected DataObject buildGraph(ResultSet result) throws SQLException { - - List results = new ArrayList(); - results.add(result); - - // Before we use the mappingModel, do some checking/updating. If - // inferrable information - // isn't specified, add it in. - - - GraphBuilderMetadata gbmd = new GraphBuilderMetadata(results, - getSchema(), mappingModel.getConfig(), resultSetShape); - - DataGraph g = createEDataGraph(gbmd.getSchema()); - ChangeSummary summary = g.getChangeSummary(); - - ResultSetProcessor rsp = new ResultSetProcessor(g.getRootObject(), gbmd); - rsp.processResults(getStartRow(), getEndRow()); - - summary.beginLogging(); - - return g.getRootObject(); - } - - private Type getSchema() { - return (Type) schema; - } - - protected int getStartRow() { - return startRow; - } - - protected int getEndRow() { - return endRow; - } - - protected void setStartRow(int startRow) { - this.startRow = startRow; - } - - protected void setEndRow(int endRow) { - this.endRow = endRow; - } - - private DataGraph createEDataGraph(Type type) { - - DataGraph g = SDOUtil.createDataGraph(); - - // Create a ResourceSet to contain the DataGraph - ResourceSet resourceSet = DataObjectUtil.createResourceSet(); - - // Create a Resource to hold the schema - - Resource r = resourceSet.createResource(URI.createURI(type.getURI())); - r.getContents().add(g); - - // Create the root object - g.createRootObject(type); - - return g; - } - - private void setMappingModel(Config mapping) { - mappingModel = new MappingWrapper(mapping); - } - - public void setMappingModel(InputStream stream) { - - XMLHelper helper = XMLHelper.INSTANCE; - -// ExtendedMetaData metadata = ExtendedMetaData.INSTANCE; -// metadata.putPackage(null, ConfigPackageImpl.eINSTANCE); - - try { - Config config = (Config) helper.load(stream).getRootObject(); - mappingModel = new MappingWrapper(config); - } catch (IOException e) { - throw new RuntimeException(e); - } - - - if (mappingModel.getConfig().getConnectionProperties() != null) - setConnection(mappingModel.getConfig().getConnectionProperties()); - - } - - public void setConnection(ConnectionProperties c) { - try { - Connection connection = null; - Class.forName(c.getDriverClassName()); - if (c.getDriverUserName() == null) - connection = DriverManager.getConnection(c.getDriverURL()); - else - connection = DriverManager.getConnection(c.getDriverURL(), c - .getDriverUserName(), c.getDriverPassword()); - connection.setAutoCommit(false); - setConnection(connection); - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - - public void setDataObjectModel(Type schema) { - this.schema = schema; - } - - protected void enablePaging() { - statement.enablePaging(); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/SDODataTypeHelper.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/SDODataTypeHelper.java deleted file mode 100644 index 7afa3b8563..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/SDODataTypeHelper.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.sql.Types; - -import org.apache.tuscany.das.rdb.SDODataTypes; - -import commonj.sdo.Type; - -public class SDODataTypeHelper { - - static public int sqlTypeFor(Type sdoType) { - if ( sdoType == SDODataTypes.BOOLEAN) - return Types.BOOLEAN; - else if ( sdoType == SDODataTypes.STRING) - return Types.VARCHAR; - else if ( sdoType == SDODataTypes.BYTE) - return Types.TINYINT; - else if ( sdoType == SDODataTypes.BYTES) - return Types.BINARY; - else if ( sdoType == SDODataTypes.CHARACTER) - return Types.CHAR; - else if ( sdoType == SDODataTypes.DATE) - return Types.DATE; - else if ( sdoType == SDODataTypes.DATETIME) - return Types.DATE; - else if ( sdoType == SDODataTypes.DAY ) - return java.sql.Types.BINARY; - else if ( sdoType == SDODataTypes.DECIMAL ) - return java.sql.Types.DECIMAL; - else if ( sdoType == SDODataTypes.DOUBLE ) - return java.sql.Types.DOUBLE; - else if ( sdoType == SDODataTypes.DURATION ) - return java.sql.Types.VARCHAR; - else if ( sdoType == SDODataTypes.FLOAT ) - return java.sql.Types.REAL; - else if ( sdoType == SDODataTypes.INT ) - return java.sql.Types.INTEGER; - else if ( sdoType == SDODataTypes.INTEGER ) - return java.sql.Types.INTEGER; - else if ( sdoType == SDODataTypes.LONG ) - return java.sql.Types.BIGINT; - else if ( sdoType == SDODataTypes.MONTH ) - return java.sql.Types.VARCHAR; - else if ( sdoType == SDODataTypes.MONTHDAY ) - return java.sql.Types.VARCHAR; - else if ( sdoType == SDODataTypes.OBJECT ) - return java.sql.Types.JAVA_OBJECT; - else if ( sdoType == SDODataTypes.SHORT ) - return java.sql.Types.SMALLINT; - else if ( sdoType == SDODataTypes.STRING ) - return java.sql.Types.VARCHAR; - else if ( sdoType == SDODataTypes.STRINGS ) - return java.sql.Types.OTHER; - else if ( sdoType == SDODataTypes.TIME ) - return java.sql.Types.VARCHAR; - else if ( sdoType == SDODataTypes.URI ) - return java.sql.Types.VARCHAR; - else if ( sdoType == SDODataTypes.YEAR ) - return java.sql.Types.VARCHAR; - else if ( sdoType == SDODataTypes.YEARMONTH ) - return java.sql.Types.VARCHAR; - else if ( sdoType == SDODataTypes.YEARMONTHDAY ) - return java.sql.Types.VARCHAR; - else if ( sdoType == SDODataTypes.BOOLEANOBJECT ) - return java.sql.Types.BOOLEAN; - else if ( sdoType == SDODataTypes.BYTEOBJECT ) - return java.sql.Types.TINYINT; - else if ( sdoType == SDODataTypes.CHARACTEROBJECT ) - return java.sql.Types.CHAR; - else if ( sdoType == SDODataTypes.DOUBLEOBJECT ) - return java.sql.Types.DOUBLE; - else if ( sdoType == SDODataTypes.FLOATOBJECT ) - return java.sql.Types.REAL; - else if ( sdoType == SDODataTypes.INTEGEROBJECT ) - return java.sql.Types.INTEGER; - else if ( sdoType == SDODataTypes.LONGOBJECT ) - return java.sql.Types.BIGINT; - else if ( sdoType == SDODataTypes.SHORTOBJECT ) - return java.sql.Types.SMALLINT; - else - throw new RuntimeException("Not a valid SDO Type " + sdoType); - - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/SPCommandImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/SPCommandImpl.java deleted file mode 100644 index 8308ee4397..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/SPCommandImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.io.InputStream; -import java.sql.ResultSet; -import java.sql.SQLException; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - -import commonj.sdo.DataObject; - -public class SPCommandImpl extends ReadCommandImpl { - - public SPCommandImpl(String sqlString) { - super(sqlString); - } - - public SPCommandImpl(String sqlString, InputStream modelStream) { - super(sqlString, modelStream); - } - - public DataObject executeQuery() { - - boolean success = false; - try { - ResultSet rs = statement.executeCall(parameters); - success = true; - - return buildGraph(rs); - } catch (SQLException e) { - DebugUtil.debugln(getClass(), debug, e); - throw new RuntimeException(e); - } finally { - if (success) - statement.getConnection().cleanUp(); - else - statement.getConnection().errorCleanUp(); - } - } - - public void execute() { - - boolean success = false; - try { - statement.executeUpdateCall(parameters); - success = true; - } catch (SQLException e) { - throw new RuntimeException(e); - } finally { - if (success) - statement.getConnection().cleanUp(); - else - statement.getConnection().errorCleanUp(); - } - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Statement.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Statement.java deleted file mode 100644 index 6bc18dc229..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Statement.java +++ /dev/null @@ -1,206 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.sql.CallableStatement; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.Parameter; -import org.apache.tuscany.das.rdb.util.DebugUtil; - -//TODO - Can use some refactoring. Much code is duplicated in "execute" methods -public class Statement { - - protected final QueryString queryString; - - protected ConnectionImpl jdbcConnection; - - private static final boolean debug = false; - - private PreparedStatement preparedStatement; - - private boolean isPaging = false; - - public Statement(String sqlString) { - this.queryString = new QueryString(sqlString); - } - - public ResultSet executeQuery(Parameters parameters) throws SQLException { - - PreparedStatement ps = getPreparedStatement(); - ps = setParameters(ps, parameters); - ResultSet rs = ps.executeQuery(); - - return rs; - } - - public ResultSet executeCall(Parameters parameters) throws SQLException { - try { - CallableStatement cs = jdbcConnection.prepareCall(queryString); - - Iterator inParams = parameters.inParams().iterator(); - while (inParams.hasNext()) { - Parameter param = (Parameter) inParams.next(); - if (param.getIndex() == 0) - param.setIndex(queryString.getParameterIndex(param.getName())); - cs.setObject(param.getIndex(), param.getValue()); - } - - // register out parameters - Iterator outParams = parameters.outParams().iterator(); - while (outParams.hasNext()) { - Parameter param = (Parameter) outParams.next(); - if (param.getIndex() == 0) - param.setIndex(queryString.getParameterIndex(param.getName())); - DebugUtil.debugln(getClass(), debug, "Registering parameter " + param.getName()); - cs.registerOutParameter(param.getIndex(), SDODataTypeHelper.sqlTypeFor(param.getType())); - } - - // Using execute because Derby does not currenlty support - // executeQuery - // for SP - cs.execute(); - ResultSet results = cs.getResultSet(); - - Iterator i = parameters.outParams().iterator(); - while (i.hasNext()) { - Parameter param = (Parameter) i.next(); - param.setValue(cs.getObject(param.getIndex())); - } - - return results; - } catch (SQLException ex) { - ex.printStackTrace(); - throw ex; - } - - } - - public void executeUpdateCall(Parameters parameters) throws SQLException { - CallableStatement cs = jdbcConnection.prepareCall(queryString); - - Iterator inParams = parameters.inParams().iterator(); - while (inParams.hasNext()) { - Parameter param = (Parameter) inParams.next(); - if (param.getIndex() == 0) - param.setIndex(queryString.getParameterIndex(param.getName())); - cs.setObject(param.getIndex(), param.getValue()); - } - - // register out parameters - Iterator outParams = parameters.outParams().iterator(); - while (outParams.hasNext()) { - Parameter param = (Parameter) outParams.next(); - if (param.getIndex() == 0) - param.setIndex(queryString.getParameterIndex(param.getName())); - DebugUtil.debugln(getClass(), debug, "Registering parameter " + param.getName()); - cs.registerOutParameter(param.getIndex(), SDODataTypeHelper.sqlTypeFor(param.getType())); - } - - cs.execute(); - - Iterator out = parameters.outParams().iterator(); - while (out.hasNext()) { - Parameter param = (Parameter) out.next(); - param.setValue(cs.getObject(param.getIndex())); - } - - } - - /** - * TODO - We need to look at using specific ps.setXXX methods when a type - * has been specified and try setObject otherwise. - */ - public int executeUpdate(Parameters parameters) throws SQLException { - DebugUtil.debugln(getClass(), debug, "Executing statement " + queryString.getPreparedString()); - PreparedStatement ps = getPreparedStatement(); - Iterator i = parameters.inParams().iterator(); - while (i.hasNext()) { - Parameter param = (Parameter) i.next(); - if (param.getIndex() == 0) - param.setIndex(queryString.getParameterIndex(param.getName())); - Object value = param.getValue(); - DebugUtil.debugln(getClass(), debug, "Setting parameter " + param.getIndex() + " to " + value); - if (value == null) { - ps.setNull(param.getIndex(), SDODataTypeHelper.sqlTypeFor(param.getType())); - } else { - ps.setObject(param.getIndex(), value); - } - } - return ps.executeUpdate(); - } - - protected PreparedStatement setParameters(PreparedStatement ps, Parameters parameters) - throws SQLException { - Iterator i = parameters.inParams().iterator(); - while (i.hasNext()) { - Parameter param = (Parameter) i.next(); - if (param.getIndex() == 0) - param.setIndex(queryString.getParameterIndex(param.getName())); - ps.setObject(param.getIndex(), param.getValue()); - } - return ps; - } - - public void setConnection(ConnectionImpl jdbcConnection) { - this.jdbcConnection = jdbcConnection; - } - - public ConnectionImpl getConnection() { - return this.jdbcConnection; - } - - private PreparedStatement getPreparedStatement() throws SQLException { - DebugUtil.debugln(getClass(), debug, "Getting prepared statement"); - if (preparedStatement == null) - if (isPaging) - preparedStatement = jdbcConnection.preparePagedStatement(queryString); - else - preparedStatement = jdbcConnection.prepareStatement(queryString); - - return preparedStatement; - } - - public Integer getGeneratedKey() throws SQLException { - - ResultSet rs = getPreparedStatement().getGeneratedKeys(); - if (rs.next()) - return new Integer(rs.getInt(1)); - - return null; - } - - protected void enablePaging() { - isPaging = true; - } - - public void close() { - - if (this.preparedStatement != null) { - try { - preparedStatement.close(); - } catch (SQLException e) { - throw new RuntimeException(e); - } - } - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateCommandImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateCommandImpl.java deleted file mode 100644 index 7fffe97d5d..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateCommandImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -public class UpdateCommandImpl extends WriteCommandImpl { - - public UpdateCommandImpl(String sqlString) { - super(sqlString); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateList.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateList.java deleted file mode 100644 index 1ab2f16fca..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateList.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - -import java.util.ArrayList; -import java.util.Collection; - -/** - * Updates don't have to be sorted, so this class is a simple wrapper of ArrayList. - * - */ -public class UpdateList { - - private ArrayList updates = new ArrayList(); - - public UpdateList() { - super(); - } - - public void add(ChangeOperation c) { - updates .add(c); - } - - public Collection getSortedList() { - return updates; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateOperation.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateOperation.java deleted file mode 100644 index 94bb20be1d..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/UpdateOperation.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.impl; - - -import commonj.sdo.DataObject; - - -public class UpdateOperation extends ChangeOperation { - - public UpdateOperation(WriteCommandImpl command, DataObject changedObject, String id) { - super(command, changedObject); - this.propagatedID = id; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/WriteCommandImpl.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/WriteCommandImpl.java deleted file mode 100644 index c08ddda495..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/WriteCommandImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* 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. -*/ -package org.apache.tuscany.das.rdb.impl; - -import java.sql.SQLException; -import java.util.Collection; -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.Parameter; -import org.apache.tuscany.das.rdb.config.Config; - -import commonj.sdo.DataObject; -import commonj.sdo.Type; - -public abstract class WriteCommandImpl extends CommandImpl { - - - public WriteCommandImpl(String sqlString) { - super(sqlString); - } - - public void execute() { - - boolean success = false; - try { - statement.executeUpdate(parameters); - subtypeProcessing(); - success = true; - } catch (SQLException e) { - throw new RuntimeException(e); - } finally { - if (success) - statement.getConnection().cleanUp(); - else - statement.getConnection().errorCleanUp(); - } - - } - - public DataObject executeQuery() { - throw new UnsupportedOperationException(); - } - - public Config getMappingModel() { - return this.mappingModel.getConfig(); - } - - - /** - * Subclasses add specific bahavior - * Default is to do nothing - */ - protected void subtypeProcessing() throws SQLException { - if ( false ) - throw new SQLException(); - } - - public void setDataObjectModel(Type schema) { - // don't really care what the model is here - } - - public String toString() { - - StringBuffer buffer = new StringBuffer(); - buffer.append("\nSQL: " + statement.queryString.getUnmodifiedString()); - buffer.append("\nModified SQL: " + statement.queryString.getPreparedString()); - return buffer.toString(); - } - - public int getGeneratedKey() { - throw new RuntimeException("No generated key is available"); - } - - public void addParameters(Collection updateParameters) { - Iterator i = updateParameters.iterator(); - while ( i.hasNext()) { - Parameter p = (Parameter) i.next(); - addParameter(p); - } - } - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/merge/impl/GraphMerger.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/merge/impl/GraphMerger.java deleted file mode 100644 index 15943da067..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/merge/impl/GraphMerger.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.merge.impl; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.logging.Logger; - -import org.apache.tuscany.das.rdb.config.wrapper.QualifiedColumn; -import org.apache.tuscany.das.rdb.graphbuilder.impl.MultiTableRegistry; -import org.apache.tuscany.das.rdb.graphbuilder.impl.TableRegistry; -import org.apache.tuscany.sdo.impl.ChangeSummaryImpl; - -import commonj.sdo.ChangeSummary; -import commonj.sdo.DataObject; -import commonj.sdo.Property; - -public class GraphMerger { - - private HashMap keys = new HashMap(); - - private TableRegistry registry = new MultiTableRegistry(); - - private static Logger logger = Logger.getLogger("GraphMerger"); - - //TODO lots of cleanup/design - public GraphMerger() { - // Empty Constructor - } - - public DataObject merge(List graphs) { - DataObject primaryGraph = (DataObject) graphs.get(0); - - Iterator i = graphs.iterator(); - if (i.hasNext()) - i.next(); - while (i.hasNext()) { - primaryGraph = merge(primaryGraph, (DataObject) i.next()); - } - - return primaryGraph; - } - - public DataObject merge(DataObject primary, DataObject secondary) { - addGraphToRegistry(primary); - - ChangeSummary summary = primary - .getDataGraph().getChangeSummary(); - summary.endLogging(); - Iterator i = secondary.getType().getProperties().iterator(); - - while (i.hasNext()) { - Property p = (Property) i.next(); - - Iterator objects = secondary.getList(p.getName()).iterator(); - while (objects.hasNext()) { - DataObject object = (DataObject) objects.next(); - createObjectWithSubtree(primary, p, object); - } - } - ((ChangeSummaryImpl)summary).resumeLogging(); - return primary; - } - - private void createObjectWithSubtree(DataObject root, Property p, - DataObject object) { - Object pk = getPrimaryKey(object); - - if (!registry.contains(object.getType().getName(), Collections - .singletonList(pk))) { - // logger.info("creating " + object.getType().getName() + " with pk " + pk); - DataObject newObject = root.createDataObject(p.getName()); - - - - Iterator attrs = object.getType().getProperties().iterator(); - while (attrs.hasNext()) { - Property attr = (Property) attrs.next(); - if ( attr.getType().isDataType()) { - newObject.set(attr.getName(), object.get(attr)); - } - } - registry.put(object.getType().getName(), Collections - .singletonList(pk), newObject); - - Iterator refs = object.getType().getProperties().iterator(); - while (refs.hasNext()) { - Property ref = (Property) refs.next(); - if ( !ref.getType().isDataType()) { - List refObjects; - if (!ref.isMany()) { - refObjects = Collections.singletonList(object.get(ref)); - } else { - refObjects = (List) object.get(ref); - } - - Iterator iter = refObjects.iterator(); - while (iter.hasNext()) { - DataObject refObject = (DataObject) iter.next(); - createObjectWithSubtree(root, refObject - .getContainmentProperty(), refObject); - - refObject = (DataObject) registry.get(refObject.getType().getName(), Collections.singletonList(getPrimaryKey(refObject))); - if (ref.isMany()) { - newObject.getList( - newObject.getType().getProperty(ref.getName())) - .add(refObject); - } else - newObject.set(newObject.getType().getProperty( - ref.getName()), refObject); - } - } - - } - - } - - } - - private void addGraphToRegistry(DataObject graph1) { - Iterator i = graph1.getType().getProperties().iterator(); - while (i.hasNext()) { - Property p = (Property) i.next(); - Iterator objects = graph1.getList(p).iterator(); - while (objects.hasNext()) { - DataObject object = (DataObject) objects.next(); - Object pk = object.get(getPrimaryKeyName(object)); - logger.finest("Adding object with pk " + pk + " to registry"); - registry.put(object.getType().getName(), Collections - .singletonList(pk), object); - } - } - } - - private Object getPrimaryKey(DataObject object) { - String pkName = getPrimaryKeyName(object); - return object.get(pkName); - } - - private String getPrimaryKeyName(DataObject object) { - return (String) keys.get(object.getType().getName()); - } - - public void addPrimaryKey(String key) { - QualifiedColumn column = new QualifiedColumn(key); - logger.finest("Adding " + column.getTableName() + " " - + column.getColumnName() + " to keys"); - keys.put(column.getTableName(), column.getColumnName()); - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DataObjectUtil.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DataObjectUtil.java deleted file mode 100644 index 7f96f9aef4..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DataObjectUtil.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.util; - -import java.util.Iterator; -import java.util.List; - -import commonj.sdo.ChangeSummary; -import commonj.sdo.DataObject; -import commonj.sdo.Property; -import commonj.sdo.ChangeSummary.Setting; -import commonj.sdo.helper.DataFactory; - -/** - */ -public class DataObjectUtil { - - //Utilities - public static DataObject getRestoredCopy(DataObject changedDO) { - DataObject changedCopy = getCopy(changedDO); - restoreAttributeValues(changedCopy, changedDO); - return changedCopy; - } - - public static DataObject getCopy(DataObject original) { - - DataObject copy = DataFactory.INSTANCE.create(original.getType()); - - //Fill in values - Iterator i = original.getType().getProperties().iterator(); - while (i.hasNext()) { - Property feature = (Property) i.next(); - copy.set(feature, original.get(feature)); - } - return copy; - } - - /** - * @param changedCopy - * @return - */ - private static void restoreAttributeValues(DataObject changedCopy, DataObject changedDO) { - - ChangeSummary changeSummary = changedDO.getDataGraph().getChangeSummary(); - List changes = changeSummary.getOldValues(changedDO); - if ( changes == null ) - return; - - Iterator i = changes.iterator(); - while (i.hasNext()) { - Setting s = (Setting) i.next(); - if ( s.getProperty().getType().isDataType() ) - changedCopy.set(s.getProperty(), s.getValue()); - } - } - - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DebugFormatter.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DebugFormatter.java deleted file mode 100644 index ed2e1063d6..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DebugFormatter.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.util; - -import java.util.logging.Formatter; -import java.util.logging.LogRecord; - -public class DebugFormatter extends Formatter { - - public String format(LogRecord record) { - StringBuffer message = new StringBuffer(); - message.append("["); - message.append(record.getSourceClassName()); - message.append("] "); - message.append(record.getMessage()); - message.append("\n"); - return message.toString(); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DebugUtil.java b/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DebugUtil.java deleted file mode 100644 index 745fe8cb7e..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DebugUtil.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.util; - -import java.util.logging.ConsoleHandler; -import java.util.logging.Handler; -import java.util.logging.Level; -import java.util.logging.Logger; - -//TODO Restructure Logging -public class DebugUtil { - - private static StringBuffer buffer = new StringBuffer(); - private static final Logger logger = Logger.getAnonymousLogger(); - - static { - logger.setUseParentHandlers(false); - Handler h = new ConsoleHandler(); - h.setFormatter(new DebugFormatter()); - logger.addHandler(h); - } - public static void debugln(Class c, boolean flag, Object obj) { - - if ( flag ) { - logger.logp(Level.INFO, getClassName(c), null, obj.toString() ); - } - } - - public static void debug(Class c, boolean flag, Object obj) { - if ( flag ) { - System.out.print("[" + getClassName(c) + "] " + obj ); - } - } - - public static void buffer(boolean flag, Object obj) { - if ( flag ) - buffer.append(obj); - } - - public static void flushBuffer(Class c, boolean flag) { - if ( flag ) { - System.out.println("[" + getClassName(c) + "] " + buffer.toString()); - buffer = new StringBuffer(); - } - } - - private static String getClassName(Class c) { - String className = c.getName(); - return className.substring(className.lastIndexOf(".") + 1); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/main/resources/META-INF/MANIFEST.MF b/tags/java-stable-20060304/das/rdb/src/main/resources/META-INF/MANIFEST.MF deleted file mode 100644 index cb460db0f0..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/resources/META-INF/MANIFEST.MF +++ /dev/null @@ -1,8 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: rdbdas -Bundle-SymbolicName: rdbdas -Bundle-Version: 1.0.0 -Bundle-Localization: plugin -Require-Bundle: org.junit, - org.eclipse.emf.ecore.sdo diff --git a/tags/java-stable-20060304/das/rdb/src/main/resources/config.xsd b/tags/java-stable-20060304/das/rdb/src/main/resources/config.xsd deleted file mode 100644 index a7211727dc..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/resources/config.xsd +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/main/resources/dasmodel4.mdl b/tags/java-stable-20060304/das/rdb/src/main/resources/dasmodel4.mdl deleted file mode 100644 index 1de7601cab..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/main/resources/dasmodel4.mdl +++ /dev/null @@ -1,4645 +0,0 @@ - -(object Petal - version 42 - _written "Rose 4.5.8163.3" - charSet 0) - -(object Design "Logical View" - is_unit TRUE - is_loaded TRUE - defaults (object defaults - rightMargin 0.250000 - leftMargin 0.250000 - topMargin 0.250000 - bottomMargin 0.500000 - pageOverlap 0.250000 - clipIconLabels TRUE - autoResize TRUE - snapToGrid TRUE - gridX 31 - gridY 31 - defaultFont (object Font - size 10 - face "Arial" - bold FALSE - italics FALSE - underline FALSE - strike FALSE - color 0 - default_color TRUE) - showMessageNum 3 - showClassOfObject TRUE - notation "Unified") - root_usecase_package (object Class_Category "Use Case View" - quid "4362A29901BA" - exportControl "Public" - global TRUE - logical_models (list unit_reference_list) - logical_presentations (list unit_reference_list - (object UseCaseDiagram "Main" - quid "4362A2990259" - title "Main" - zoom 100 - max_height 28350 - max_width 21600 - origin_x 0 - origin_y 0 - items (list diagram_item_list)))) - root_category (object Class_Category "Logical View" - quid "4362A29901B9" - exportControl "Public" - global TRUE - subsystem "Component View" - quidu "4362A29901BB" - logical_models (list unit_reference_list - (object Class_Category "config" - attributes (list Attribute_Set - (object Attribute - tool "Ecore" - name "nsURI" - value "http:///org.apache.tuscany.das.rdb/config.xsd") - (object Attribute - tool "Ecore" - name "basePackage" - value "org.apache.tuscany.das.rdb")) - quid "4362A2A10169" - exportControl "Public" - logical_models (list unit_reference_list - (object Class "Config" - quid "4362A2DE0045" - class_attributes (list class_attribute_list - (object ClassAttribute "uri" - quid "4362A337006B" - type "String"))) - (object Class "Command" - quid "4362A2EC01FE" - class_attributes (list class_attribute_list - (object ClassAttribute "name" - quid "4362A3EC02EC" - type "String") - (object ClassAttribute "SQL" - quid "4362A3EF0246" - type "String") - (object ClassAttribute "kind" - quid "437903E60321" - type "String"))) - (object Class "ConnectionProperties" - quid "4362A2FD0085" - class_attributes (list class_attribute_list - (object ClassAttribute "dataSource" - quid "4362A35A035A" - type "String") - (object ClassAttribute "driverClassName" - quid "4362A36D0203" - type "String") - (object ClassAttribute "driverURL" - quid "4362A3740330" - type "String") - (object ClassAttribute "driverPassword" - quid "4362A384022E" - type "String") - (object ClassAttribute "driverUserName" - quid "4378E1B303C2" - type "String"))) - (object Class "Parameter" - quid "4362A3C902BA" - class_attributes (list class_attribute_list - (object ClassAttribute "name" - quid "4362A40600D7" - type "String") - (object ClassAttribute "columnType" - quid "4362A4090280" - type "String"))) - (object Class "Relationship" - quid "4362A42E03A5" - class_attributes (list class_attribute_list - (object ClassAttribute "name" - quid "4362A73A0216" - type "String") - (object ClassAttribute "primaryKeyTable" - quid "4362A73D0329" - type "String") - (object ClassAttribute "foreignKeyTable" - quid "4362A74002FB" - type "String") - (object ClassAttribute "many" - quid "4362A7430241" - type "boolean"))) - (object Class "Table" - quid "4362A43C0002" - class_attributes (list class_attribute_list - (object ClassAttribute "name" - quid "4362A7B2031D" - type "String") - (object ClassAttribute "propertyName" - quid "4362A7C203A2" - type "String") - (object ClassAttribute "create" - quid "4362A7D0024E" - type "String") - (object ClassAttribute "update" - quid "4362A7D30220" - type "String") - (object ClassAttribute "delete" - quid "4362A7E1031B" - type "String"))) - (object Class "KeyPair" - quid "4362A72E0010" - class_attributes (list class_attribute_list - (object ClassAttribute "primaryKeyColumn" - quid "4362A8E702A9" - type "String") - (object ClassAttribute "foreignKeyColumn" - quid "4362A8ED01AE" - type "String"))) - (object Class "Column" - quid "4362A75C016B" - class_attributes (list class_attribute_list - (object ClassAttribute "name" - quid "4362A8BD02E5" - type "String") - (object ClassAttribute "propertyName" - quid "4362A8C001C7" - type "String") - (object ClassAttribute "converterClassName" - quid "4362A8C303A2" - type "String") - (object ClassAttribute "columnType" - quid "4362A8C903A0" - type "String") - (object ClassAttribute "primaryKey" - quid "437907F200F9" - type "boolean") - (object ClassAttribute "generated" - quid "4379083900BF" - type "boolean") - (object ClassAttribute "collision" - quid "437908E5012B" - type "boolean"))) - (object Class "ResultDescriptor" - quid "437B57EF0008" - class_attributes (list class_attribute_list - (object ClassAttribute "columnName" - quid "437B5A6503BB" - type "String") - (object ClassAttribute "tableName" - quid "437B5A6B016B" - type "String") - (object ClassAttribute "columnType" - quid "437B5A6D033A" - type "String") - (object ClassAttribute "converter" - quid "437B5A6F0153" - type "String")) - language "Java") - (object Association "$UNNAMED$0" - quid "4362A3030323" - roles (list role_list - (object Role "$UNNAMED$1" - quid "4362A3040108" - supplier "Logical View::config::Config" - quidu "4362A2DE0045" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$2" - quid "4362A3040109" - supplier "Logical View::config::Command" - quidu "4362A2EC01FE" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$3" - quid "4362A308010D" - roles (list role_list - (object Role "$UNNAMED$4" - quid "4362A3090015" - supplier "Logical View::config::Config" - quidu "4362A2DE0045" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$5" - quid "4362A3090016" - supplier "Logical View::config::ConnectionProperties" - quidu "4362A2FD0085" - client_cardinality (value cardinality "0..1") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$6" - quid "4362A3D302FA" - roles (list role_list - (object Role "$UNNAMED$7" - quid "4362A3D40143" - supplier "Logical View::config::Command" - quidu "4362A2EC01FE" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$8" - quid "4362A3D40144" - supplier "Logical View::config::Parameter" - quidu "4362A3C902BA" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$9" - quid "4362A448026C" - roles (list role_list - (object Role "$UNNAMED$10" - quid "4362A4490105" - supplier "Logical View::config::Config" - quidu "4362A2DE0045" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$11" - quid "4362A4490106" - supplier "Logical View::config::Table" - quidu "4362A43C0002" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$12" - quid "4362A44B0298" - roles (list role_list - (object Role "$UNNAMED$13" - quid "4362A44C01AA" - supplier "Logical View::config::Config" - quidu "4362A2DE0045" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$14" - quid "4362A44C01AB" - supplier "Logical View::config::Relationship" - quidu "4362A42E03A5" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$15" - quid "4362A76302A1" - roles (list role_list - (object Role "$UNNAMED$16" - quid "4362A7640090" - supplier "Logical View::config::Table" - quidu "4362A43C0002" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$17" - quid "4362A7640091" - supplier "Logical View::config::Column" - quidu "4362A75C016B" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$18" - quid "4362A771032E" - roles (list role_list - (object Role "$UNNAMED$19" - quid "4362A7720108" - supplier "Logical View::config::Relationship" - quidu "4362A42E03A5" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$20" - quid "4362A7720109" - supplier "Logical View::config::KeyPair" - quidu "4362A72E0010" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$21" - quid "437B59A10066" - roles (list role_list - (object Role "$UNNAMED$22" - quid "437B59A30145" - supplier "Logical View::config::Command" - quidu "4362A2EC01FE" - Containment "By Value" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$23" - quid "437B59A30146" - supplier "Logical View::config::ResultDescriptor" - quidu "437B57EF0008" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE)))) - logical_presentations (list unit_reference_list - (object ClassDiagram "Main" - quid "4362A2A900AD" - title "Main" - zoom 100 - max_height 28350 - max_width 21600 - origin_x 0 - origin_y 0 - items (list diagram_item_list - (object ClassView "Class" "Logical View::config::KeyPair" @1 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (1054, 1333) - label (object ItemLabel - Parent_View @1 - location (809, 1227) - fill_color 13434879 - nlines 1 - max_width 490 - justify 0 - label "KeyPair") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4362A72E0010" - width 508 - height 236 - autoResize TRUE) - (object ClassView "Class" "Logical View::config::Column" @2 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (2015, 1519) - label (object ItemLabel - Parent_View @2 - location (1756, 1288) - fill_color 13434879 - nlines 1 - max_width 518 - justify 0 - label "Column") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4362A75C016B" - width 536 - height 486 - autoResize TRUE) - (object ClassView "Class" "Logical View::config::ConnectionProperties" @3 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (2542, 248) - label (object ItemLabel - Parent_View @3 - location (2317, 67) - fill_color 13434879 - nlines 1 - max_width 450 - justify 0 - label "ConnectionProperties") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4362A2FD0085" - width 468 - height 386 - autoResize TRUE) - (object ClassView "Class" "Logical View::config::Relationship" @4 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (1054, 744) - label (object ItemLabel - Parent_View @4 - location (829, 588) - fill_color 13434879 - nlines 1 - max_width 450 - justify 0 - label "Relationship") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4362A42E03A5" - width 468 - height 336 - autoResize TRUE) - (object AssociationViewNew "$UNNAMED$18" @5 - location (1081, 1063) - stereotype TRUE - line_color 3342489 - quidu "4362A771032E" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$19" @6 - Parent_View @5 - location (-97, -84) - stereotype TRUE - line_color 3342489 - quidu "4362A7720108" - client @5 - supplier @4 - line_style 3 - origin_attachment (1080, 1063) - terminal_attachment (1080, 912)) - (object RoleView "$UNNAMED$20" @7 - Parent_View @5 - location (-97, -84) - stereotype TRUE - line_color 3342489 - quidu "4362A7720109" - client @5 - supplier @1 - line_style 3 - origin_attachment (1080, 1063) - terminal_attachment (1080, 1215) - label (object SegLabel @8 - Parent_View @7 - location (1135, 1112) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.327273 - height 55 - orientation 0)))) - (object ClassView "Class" "Logical View::config::Table" @9 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (1984, 837) - label (object ItemLabel - Parent_View @9 - location (1784, 656) - fill_color 13434879 - nlines 1 - max_width 400 - justify 0 - label "Table") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4362A43C0002" - width 418 - height 386 - autoResize TRUE) - (object AssociationViewNew "$UNNAMED$15" @10 - location (1778, 1153) - stereotype TRUE - line_color 3342489 - quidu "4362A76302A1" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$16" @11 - Parent_View @10 - location (1003, 6) - stereotype TRUE - line_color 3342489 - quidu "4362A7640090" - client @10 - supplier @9 - line_style 3 - origin_attachment (1778, 1153) - terminal_attachment (1778, 1030)) - (object RoleView "$UNNAMED$17" @12 - Parent_View @10 - location (1003, 6) - stereotype TRUE - line_color 3342489 - quidu "4362A7640091" - client @10 - supplier @2 - line_style 3 - origin_attachment (1778, 1153) - terminal_attachment (1778, 1276) - label (object SegLabel @13 - Parent_View @12 - location (1832, 1166) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.109091 - height 54 - orientation 0)))) - (object ClassView "Class" "Logical View::config::Parameter" @14 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (186, 806) - label (object ItemLabel - Parent_View @14 - location (4, 700) - fill_color 13434879 - nlines 1 - max_width 364 - justify 0 - label "Parameter") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4362A3C902BA" - width 382 - height 236 - autoResize TRUE) - (object ClassView "Class" "Logical View::config::Config" @15 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (1054, 155) - label (object ItemLabel - Parent_View @15 - location (959, 74) - fill_color 13434879 - nlines 1 - max_width 190 - justify 0 - label "Config") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4362A2DE0045" - width 208 - height 186 - autoResize TRUE) - (object AssociationViewNew "$UNNAMED$3" @16 - location (1733, 184) - stereotype TRUE - line_color 3342489 - quidu "4362A308010D" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$4" @17 - Parent_View @16 - location (307, -498) - stereotype TRUE - line_color 3342489 - quidu "4362A3090015" - client @16 - supplier @15 - line_style 3 - origin_attachment (1733, 184) - terminal_attachment (1158, 184)) - (object RoleView "$UNNAMED$5" @18 - Parent_View @16 - location (307, -498) - stereotype TRUE - line_color 3342489 - quidu "4362A3090016" - client @16 - supplier @3 - line_style 3 - origin_attachment (1733, 184) - terminal_attachment (2308, 184) - label (object SegLabel @19 - Parent_View @18 - location (2194, 126) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..1" - pctDist 0.801805 - height 59 - orientation 0)))) - (object AssociationViewNew "$UNNAMED$12" @20 - location (1054, 411) - label (object SegLabel @21 - Parent_View @20 - location (1054, 352) - font (object Font - italics TRUE) - hidden TRUE - anchor 1 - anchor_loc 1 - nlines 1 - max_width 600 - justify 0 - label "" - pctDist 0.500000 - height 60 - orientation 0) - stereotype TRUE - line_color 3342489 - quidu "4362A44B0298" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$13" @22 - Parent_View @20 - location (-93, -395) - label (object SegLabel @23 - Parent_View @22 - location (1013, 281) - hidden TRUE - anchor 1 - anchor_loc 1 - nlines 1 - max_width 252 - justify 0 - label "" - pctDist 0.800000 - height 42 - orientation 0) - stereotype TRUE - line_color 3342489 - quidu "4362A44C01AA" - client @20 - supplier @15 - line_style 0) - (object RoleView "$UNNAMED$14" @24 - Parent_View @20 - location (-93, -395) - label (object SegLabel @25 - Parent_View @24 - location (1013, 509) - hidden TRUE - anchor 1 - anchor_loc 1 - nlines 1 - max_width 252 - justify 0 - label "" - pctDist 0.597561 - height 42 - orientation 1) - stereotype TRUE - line_color 3342489 - quidu "4362A44C01AB" - client @20 - supplier @4 - line_style 0 - label (object SegLabel @26 - Parent_View @24 - location (1011, 558) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.899471 - height 44 - orientation 1)))) - (object AssociationViewNew "$UNNAMED$9" @27 - location (1666, 248) - stereotype TRUE - line_color 3342489 - quidu "4362A448026C" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$10" @28 - Parent_View @27 - location (860, -558) - stereotype TRUE - line_color 3342489 - quidu "4362A4490105" - client @27 - supplier @15 - line_style 3 - origin_attachment (1667, 247) - terminal_attachment (1158, 247)) - (object RoleView "$UNNAMED$11" @29 - Parent_View @27 - location (860, -558) - stereotype TRUE - line_color 3342489 - quidu "4362A4490106" - client @27 - supplier @9 - vertices (list Points - (1667, 247) - (1972, 247) - (1972, 644)) - line_style 3 - origin_attachment (1667, 247) - terminal_attachment (1972, 644) - label (object SegLabel @30 - Parent_View @29 - location (2031, 380) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.625538 - height 59 - orientation 0)))) - (object ClassView "Class" "Logical View::config::Command" @31 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (186, 217) - label (object ItemLabel - Parent_View @31 - location (63, 86) - fill_color 13434879 - nlines 1 - max_width 246 - justify 0 - label "Command") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4362A2EC01FE" - width 264 - height 286 - autoResize TRUE) - (object AssociationViewNew "$UNNAMED$6" @32 - location (186, 523) - stereotype TRUE - line_color 3342489 - quidu "4362A3D302FA" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$7" @33 - Parent_View @32 - location (-279, -500) - stereotype TRUE - line_color 3342489 - quidu "4362A3D40143" - client @32 - supplier @31 - line_style 0) - (object RoleView "$UNNAMED$8" @34 - Parent_View @32 - location (-279, -500) - stereotype TRUE - line_color 3342489 - quidu "4362A3D40144" - client @32 - supplier @14 - line_style 0 - label (object SegLabel @35 - Parent_View @34 - location (241, 600) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.473684 - height 55 - orientation 0)))) - (object AssociationViewNew "$UNNAMED$0" @36 - location (634, 212) - stereotype TRUE - line_color 3342489 - quidu "4362A3030323" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$1" @37 - Parent_View @36 - location (200, -470) - stereotype TRUE - line_color 3342489 - quidu "4362A3040108" - client @36 - supplier @15 - line_style 3 - origin_attachment (634, 212) - terminal_attachment (950, 212)) - (object RoleView "$UNNAMED$2" @38 - Parent_View @36 - location (200, -470) - stereotype TRUE - line_color 3342489 - quidu "4362A3040109" - client @36 - supplier @31 - line_style 3 - origin_attachment (634, 212) - terminal_attachment (318, 212) - label (object SegLabel @39 - Parent_View @38 - location (371, 260) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.831858 - height 48 - orientation 0)))) - (object ClassView "Class" "Logical View::config::ResultDescriptor" @40 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (465, 1240) - label (object ItemLabel - Parent_View @40 - location (248, 1084) - fill_color 13434879 - nlines 1 - max_width 434 - justify 0 - label "ResultDescriptor") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "437B57EF0008" - width 452 - height 336 - annotation 8 - autoResize TRUE) - (object AssociationViewNew "$UNNAMED$21" @41 - location (484, 626) - stereotype TRUE - line_color 3342489 - quidu "437B59A10066" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$22" @42 - Parent_View @41 - location (50, -614) - stereotype TRUE - line_color 3342489 - quidu "437B59A30145" - client @41 - supplier @31 - vertices (list Points - (484, 626) - (484, 347) - (318, 347)) - line_style 3 - origin_attachment (484, 626) - terminal_attachment (318, 347)) - (object RoleView "$UNNAMED$23" @43 - Parent_View @41 - location (50, -614) - stereotype TRUE - line_color 3342489 - quidu "437B59A30146" - client @41 - supplier @40 - line_style 3 - origin_attachment (484, 626) - terminal_attachment (484, 1072) - label (object SegLabel @44 - Parent_View @43 - location (538, 1027) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.900000 - height 54 - orientation 0))))))))) - logical_presentations (list unit_reference_list - (object ClassDiagram "Main" - quid "4362A299025A" - title "Main" - zoom 100 - max_height 28350 - max_width 21600 - origin_x 0 - origin_y 0 - items (list diagram_item_list - (object CategoryView "Logical View::config" @45 - location (682, 589) - label (object ItemLabel - Parent_View @45 - location (538, 505) - fill_color 13434879 - nlines 2 - max_width 288 - justify 0 - label "config") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4362A2A10169" - width 300 - height 180))))) - root_subsystem (object SubSystem "Component View" - quid "4362A29901BB" - physical_models (list unit_reference_list) - physical_presentations (list unit_reference_list - (object Module_Diagram "Main" - quid "4362A2990258" - title "Main" - zoom 100 - max_height 28350 - max_width 21600 - origin_x 0 - origin_y 0 - items (list diagram_item_list)))) - process_structure (object Processes - quid "4362A29901BC" - ProcsNDevs (list - (object Process_Diagram "Deployment View" - quid "4362A29901BE" - title "Deployment View" - zoom 100 - max_height 28350 - max_width 21600 - origin_x 0 - origin_y 0 - items (list diagram_item_list)))) - properties (object Properties - attributes (list Attribute_Set - (object Attribute - tool "Ecore" - name "propertyId" - value "809135969") - (object Attribute - tool "Ecore" - name "default__Category" - value (list Attribute_Set - (object Attribute - tool "Ecore" - name "packageName" - value "") - (object Attribute - tool "Ecore" - name "nsPrefix" - value "") - (object Attribute - tool "Ecore" - name "nsURI" - value "") - (object Attribute - tool "Ecore" - name "basePackage" - value "") - (object Attribute - tool "Ecore" - name "prefix" - value "") - (object Attribute - tool "Ecore" - name "annotation" - value ""))) - (object Attribute - tool "Ecore" - name "default__Class" - value (list Attribute_Set - (object Attribute - tool "Ecore" - name "classifierName" - value "") - (object Attribute - tool "Ecore" - name "constraints" - value "") - (object Attribute - tool "Ecore" - name "xmlName" - value "") - (object Attribute - tool "Ecore" - name "xmlContentKind" - value ("ContentKind" 0)) - (object Attribute - tool "Ecore" - name "ContentKind" - value (list Attribute_Set - (object Attribute - tool "Ecore" - name "Unspecified" - value 0) - (object Attribute - tool "Ecore" - name "Empty" - value 1) - (object Attribute - tool "Ecore" - name "Simple" - value 2) - (object Attribute - tool "Ecore" - name "Mixed" - value 3) - (object Attribute - tool "Ecore" - name "ElementOnly" - value 4))) - (object Attribute - tool "Ecore" - name "annotation" - value ""))) - (object Attribute - tool "Ecore" - name "default__Operation" - value (list Attribute_Set - (object Attribute - tool "Ecore" - name "operationName" - value "") - (object Attribute - tool "Ecore" - name "isUnique" - value TRUE) - (object Attribute - tool "Ecore" - name "annotation" - value ""))) - (object Attribute - tool "Ecore" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "Ecore" - name "attributeName" - value "") - (object Attribute - tool "Ecore" - name "isTransient" - value FALSE) - (object Attribute - tool "Ecore" - name "isVolatile" - value FALSE) - (object Attribute - tool "Ecore" - name "isChangeable" - value TRUE) - (object Attribute - tool "Ecore" - name "isUnsettable" - value FALSE) - (object Attribute - tool "Ecore" - name "isUnique" - value TRUE) - (object Attribute - tool "Ecore" - name "isID" - value FALSE) - (object Attribute - tool "Ecore" - name "visibility" - value ("VisibilityKind" 0)) - (object Attribute - tool "Ecore" - name "VisibilityKind" - value (list Attribute_Set - (object Attribute - tool "Ecore" - name "Unspecified" - value 0) - (object Attribute - tool "Ecore" - name "None" - value 1) - (object Attribute - tool "Ecore" - name "Read-only" - value 2) - (object Attribute - tool "Ecore" - name "Read-write" - value 3) - (object Attribute - tool "Ecore" - name "Read-only unsettable" - value 4) - (object Attribute - tool "Ecore" - name "Read-write unsettable" - value 5))) - (object Attribute - tool "Ecore" - name "xmlName" - value "") - (object Attribute - tool "Ecore" - name "xmlNamespace" - value "") - (object Attribute - tool "Ecore" - name "xmlFeatureKind" - value ("FeatureKind" 0)) - (object Attribute - tool "Ecore" - name "FeatureKind" - value (list Attribute_Set - (object Attribute - tool "Ecore" - name "Unspecified" - value 0) - (object Attribute - tool "Ecore" - name "Simple" - value 1) - (object Attribute - tool "Ecore" - name "Attribute" - value 2) - (object Attribute - tool "Ecore" - name "Element" - value 4))) - (object Attribute - tool "Ecore" - name "annotation" - value ""))) - (object Attribute - tool "Ecore" - name "default__Role" - value (list Attribute_Set - (object Attribute - tool "Ecore" - name "referenceName" - value "") - (object Attribute - tool "Ecore" - name "isTransient" - value FALSE) - (object Attribute - tool "Ecore" - name "isVolatile" - value FALSE) - (object Attribute - tool "Ecore" - name "isChangeable" - value TRUE) - (object Attribute - tool "Ecore" - name "isUnsettable" - value FALSE) - (object Attribute - tool "Ecore" - name "isResolveProxies" - value TRUE) - (object Attribute - tool "Ecore" - name "visibility" - value ("VisibilityKind" 0)) - (object Attribute - tool "Ecore" - name "VisibilityKind" - value (list Attribute_Set - (object Attribute - tool "Ecore" - name "Unspecified" - value 0) - (object Attribute - tool "Ecore" - name "None" - value 1) - (object Attribute - tool "Ecore" - name "Read-only" - value 2) - (object Attribute - tool "Ecore" - name "Read-write" - value 3) - (object Attribute - tool "Ecore" - name "Read-only unsettable" - value 4) - (object Attribute - tool "Ecore" - name "Read-write unsettable" - value 5))) - (object Attribute - tool "Ecore" - name "xmlName" - value "") - (object Attribute - tool "Ecore" - name "xmlNamespace" - value "") - (object Attribute - tool "Ecore" - name "xmlFeatureKind" - value ("FeatureKind" 0)) - (object Attribute - tool "Ecore" - name "FeatureKind" - value (list Attribute_Set - (object Attribute - tool "Ecore" - name "Unspecified" - value 0) - (object Attribute - tool "Ecore" - name "Simple" - value 1) - (object Attribute - tool "Ecore" - name "Attribute" - value 2) - (object Attribute - tool "Ecore" - name "Element" - value 4))) - (object Attribute - tool "Ecore" - name "annotation" - value ""))) - (object Attribute - tool "DDL" - name "propertyId" - value "809135966") - (object Attribute - tool "DDL" - name "default__Project" - value (list Attribute_Set - (object Attribute - tool "DDL" - name "Directory" - value "AUTO GENERATE") - (object Attribute - tool "DDL" - name "DataBase" - value ("DataBaseSet" 800)) - (object Attribute - tool "DDL" - name "DataBaseSet" - value (list Attribute_Set - (object Attribute - tool "DDL" - name "ANSI" - value 800) - (object Attribute - tool "DDL" - name "Oracle" - value 801) - (object Attribute - tool "DDL" - name "SQLServer" - value 802) - (object Attribute - tool "DDL" - name "Sybase" - value 803) - (object Attribute - tool "DDL" - name "Watcom" - value 804))) - (object Attribute - tool "DDL" - name "PrimaryKeyColumnName" - value "Id") - (object Attribute - tool "DDL" - name "PrimaryKeyColumnType" - value "NUMBER(5)") - (object Attribute - tool "DDL" - name "ViewName" - value "V_") - (object Attribute - tool "DDL" - name "TableName" - value "T_") - (object Attribute - tool "DDL" - name "InheritSuffix" - value "_V") - (object Attribute - tool "DDL" - name "DropClause" - value FALSE) - (object Attribute - tool "DDL" - name "BaseViews" - value FALSE) - (object Attribute - tool "DDL" - name "DDLScriptFilename" - value "DDL1.SQL"))) - (object Attribute - tool "DDL" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "DDL" - name "ColumnType" - value "VARCHAR") - (object Attribute - tool "DDL" - name "Length" - value "") - (object Attribute - tool "DDL" - name "NullsOK" - value TRUE) - (object Attribute - tool "DDL" - name "PrimaryKey" - value FALSE) - (object Attribute - tool "DDL" - name "Unique" - value FALSE) - (object Attribute - tool "DDL" - name "CompositeUnique" - value FALSE) - (object Attribute - tool "DDL" - name "CheckConstraint" - value ""))) - (object Attribute - tool "DDL" - name "HiddenTool" - value FALSE) - (object Attribute - tool "framework" - name "HiddenTool" - value FALSE) - (object Attribute - tool "IDL" - name "propertyId" - value "809135966") - (object Attribute - tool "IDL" - name "default__Project" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "CreateMissingDirectories" - value TRUE) - (object Attribute - tool "IDL" - name "StopOnError" - value TRUE) - (object Attribute - tool "IDL" - name "Directory" - value "AUTO GENERATE") - (object Attribute - tool "IDL" - name "GeneratePreserveRegions" - value TRUE))) - (object Attribute - tool "IDL" - name "default__Class" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "ImplementationType" - value "") - (object Attribute - tool "IDL" - name "ConstValue" - value "") - (object Attribute - tool "IDL" - name "GenerateDefaultSpecifier" - value FALSE) - (object Attribute - tool "IDL" - name "DefaultSpecifier" - value "") - (object Attribute - tool "IDL" - name "IDLElement" - value TRUE) - (object Attribute - tool "IDL" - name "IDLSpecificationType" - value ("IDLSpecSet" 22)) - (object Attribute - tool "IDL" - name "IDLSpecSet" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "Interface" - value 22) - (object Attribute - tool "IDL" - name "Typedef" - value 54) - (object Attribute - tool "IDL" - name "Enumeration" - value 8) - (object Attribute - tool "IDL" - name "Const" - value 71) - (object Attribute - tool "IDL" - name "Exception" - value 61) - (object Attribute - tool "IDL" - name "Struct" - value 51) - (object Attribute - tool "IDL" - name "Union" - value 81))))) - (object Attribute - tool "IDL" - name "default__Module-Spec" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "Generate" - value TRUE) - (object Attribute - tool "IDL" - name "CmIdentification" - value (value Text " %X% %Q% %Z% %W%")) - (object Attribute - tool "IDL" - name "CopyrightNotice" - value (value Text "")) - (object Attribute - tool "IDL" - name "FileName" - value "AUTO GENERATE") - (object Attribute - tool "IDL" - name "GenerateIDLModule" - value FALSE) - (object Attribute - tool "IDL" - name "InclusionProtectionSymbol" - value "AUTO GENERATE") - (object Attribute - tool "IDL" - name "AdditionalIncludes" - value (value Text "")) - (object Attribute - tool "IDL" - name "IncludeBySimpleName" - value FALSE))) - (object Attribute - tool "IDL" - name "default__Module-Body" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "CmIdentification" - value (value Text " %X% %Q% %Z% %W%")) - (object Attribute - tool "IDL" - name "CopyrightNotice" - value (value Text "")) - (object Attribute - tool "IDL" - name "FileName" - value "AUTO GENERATE") - (object Attribute - tool "IDL" - name "AdditionalIncludes" - value (value Text "")) - (object Attribute - tool "IDL" - name "IncludeBySimpleName" - value FALSE))) - (object Attribute - tool "IDL" - name "default__Operation" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "OperationIsOneWay" - value FALSE) - (object Attribute - tool "IDL" - name "Context" - value "") - (object Attribute - tool "IDL" - name "Raises" - value ""))) - (object Attribute - tool "IDL" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "CaseSpecifier" - value "") - (object Attribute - tool "IDL" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "IDL" - name "DataMemberName" - value "$relationship") - (object Attribute - tool "IDL" - name "IsReadOnly" - value FALSE) - (object Attribute - tool "IDL" - name "IsConst" - value FALSE) - (object Attribute - tool "IDL" - name "ConstValue" - value ""))) - (object Attribute - tool "IDL" - name "default__Has" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "NameIfUnlabeled" - value "the_$supplier") - (object Attribute - tool "IDL" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "IDL" - name "DataMemberName" - value "$relationship") - (object Attribute - tool "IDL" - name "GenerateForwardReference" - value FALSE) - (object Attribute - tool "IDL" - name "IsReadOnly" - value FALSE) - (object Attribute - tool "IDL" - name "BoundedHasRelType" - value ("HasRelTypeSet" 47)) - (object Attribute - tool "IDL" - name "HasRelTypeSet" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "Array" - value 24) - (object Attribute - tool "IDL" - name "Sequence" - value 47))))) - (object Attribute - tool "IDL" - name "default__Role" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "NameIfUnlabeled" - value "the_$supplier") - (object Attribute - tool "IDL" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "IDL" - name "DataMemberName" - value "$relationship") - (object Attribute - tool "IDL" - name "GenerateForwardReference" - value FALSE) - (object Attribute - tool "IDL" - name "IsReadOnly" - value FALSE) - (object Attribute - tool "IDL" - name "BoundedRoleType" - value ("AssocTypeSet" 47)) - (object Attribute - tool "IDL" - name "AssocTypeSet" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "Array" - value 24) - (object Attribute - tool "IDL" - name "Sequence" - value 47))))) - (object Attribute - tool "IDL" - name "default__Uses" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "GenerateForwardReference" - value FALSE))) - (object Attribute - tool "IDL" - name "default__Subsystem" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "Directory" - value "AUTO GENERATE"))) - (object Attribute - tool "IDL" - name "HiddenTool" - value FALSE) - (object Attribute - tool "Java" - name "propertyId" - value "809135966") - (object Attribute - tool "Java" - name "default__Project" - value (list Attribute_Set - (object Attribute - tool "Java" - name "CreateMissingDirectories" - value TRUE) - (object Attribute - tool "Java" - name "StopOnError" - value FALSE) - (object Attribute - tool "Java" - name "Directory" - value "AUTO GENERATE") - (object Attribute - tool "Java" - name "UsePrefixes" - value FALSE) - (object Attribute - tool "Java" - name "InstanceVariablePrefix" - value "m_") - (object Attribute - tool "Java" - name "ClassVariablePrefix" - value "s_") - (object Attribute - tool "Java" - name "DefaultAttributeDataType" - value "int") - (object Attribute - tool "Java" - name "DefaultOperationReturnType" - value "void"))) - (object Attribute - tool "Java" - name "default__Class" - value (list Attribute_Set - (object Attribute - tool "Java" - name "Final" - value FALSE) - (object Attribute - tool "Java" - name "GenerateDefaultConstructor" - value TRUE) - (object Attribute - tool "Java" - name "ConstructorIs" - value ("Ctor_Set" 62)) - (object Attribute - tool "Java" - name "Ctor_Set" - value (list Attribute_Set - (object Attribute - tool "Java" - name "Public" - value 62) - (object Attribute - tool "Java" - name "Protected" - value 63) - (object Attribute - tool "Java" - name "Private" - value 64))) - (object Attribute - tool "Java" - name "GenerateFinalizer" - value FALSE) - (object Attribute - tool "Java" - name "GenerateStaticInitializer" - value FALSE) - (object Attribute - tool "Java" - name "GenerateInstanceInitializer" - value FALSE))) - (object Attribute - tool "Java" - name "default__Module-Spec" - value (list Attribute_Set - (object Attribute - tool "Java" - name "Generate" - value TRUE) - (object Attribute - tool "Java" - name "CmIdentification" - value (value Text "")) - (object Attribute - tool "Java" - name "CopyrightNotice" - value (value Text "")) - (object Attribute - tool "Java" - name "AdditionalImports" - value (value Text "")))) - (object Attribute - tool "Java" - name "default__Module-Body" - value (list Attribute_Set - (object Attribute - tool "Java" - name "Generate" - value TRUE) - (object Attribute - tool "Java" - name "CmIdentification" - value (value Text "")) - (object Attribute - tool "Java" - name "CopyrightNotice" - value (value Text "")) - (object Attribute - tool "Java" - name "AdditionalImports" - value (value Text "")))) - (object Attribute - tool "Java" - name "default__Operation" - value (list Attribute_Set - (object Attribute - tool "Java" - name "Abstract" - value FALSE) - (object Attribute - tool "Java" - name "Static" - value FALSE) - (object Attribute - tool "Java" - name "Final" - value FALSE) - (object Attribute - tool "Java" - name "Native" - value FALSE) - (object Attribute - tool "Java" - name "Synchronized" - value FALSE))) - (object Attribute - tool "Java" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "Java" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "Java" - name "Final" - value FALSE) - (object Attribute - tool "Java" - name "Transient" - value FALSE) - (object Attribute - tool "Java" - name "Volatile" - value FALSE))) - (object Attribute - tool "Java" - name "default__Role" - value (list Attribute_Set - (object Attribute - tool "Java" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "Java" - name "ContainerClass" - value "") - (object Attribute - tool "Java" - name "InitialValue" - value "") - (object Attribute - tool "Java" - name "Final" - value FALSE) - (object Attribute - tool "Java" - name "Transient" - value FALSE) - (object Attribute - tool "Java" - name "Volatile" - value FALSE))) - (object Attribute - tool "Java" - name "HiddenTool" - value FALSE) - (object Attribute - tool "Oracle8" - name "propertyId" - value "360000002") - (object Attribute - tool "Oracle8" - name "default__Project" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "DDLScriptFilename" - value "DDL1.SQL") - (object Attribute - tool "Oracle8" - name "DropClause" - value FALSE) - (object Attribute - tool "Oracle8" - name "PrimaryKeyColumnName" - value "_ID") - (object Attribute - tool "Oracle8" - name "PrimaryKeyColumnType" - value "NUMBER(5,0)") - (object Attribute - tool "Oracle8" - name "SchemaNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "SchemaNameSuffix" - value "") - (object Attribute - tool "Oracle8" - name "TableNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "TableNameSuffix" - value "") - (object Attribute - tool "Oracle8" - name "TypeNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "TypeNameSuffix" - value "") - (object Attribute - tool "Oracle8" - name "ViewNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "ViewNameSuffix" - value "") - (object Attribute - tool "Oracle8" - name "VarrayNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "VarrayNameSuffix" - value "") - (object Attribute - tool "Oracle8" - name "NestedTableNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "NestedTableNameSuffix" - value "") - (object Attribute - tool "Oracle8" - name "ObjectTableNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "ObjectTableNameSuffix" - value ""))) - (object Attribute - tool "Oracle8" - name "default__Module-Spec" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "IsSchema" - value FALSE))) - (object Attribute - tool "Oracle8" - name "default__Class" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "OID" - value "") - (object Attribute - tool "Oracle8" - name "WhereClause" - value "") - (object Attribute - tool "Oracle8" - name "CheckConstraint" - value "") - (object Attribute - tool "Oracle8" - name "CollectionTypeLength" - value "") - (object Attribute - tool "Oracle8" - name "CollectionTypePrecision" - value "") - (object Attribute - tool "Oracle8" - name "CollectionTypeScale" - value "") - (object Attribute - tool "Oracle8" - name "CollectionOfREFS" - value FALSE))) - (object Attribute - tool "Oracle8" - name "default__Operation" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "MethodKind" - value ("MethodKindSet" 1903)) - (object Attribute - tool "Oracle8" - name "OverloadID" - value "") - (object Attribute - tool "Oracle8" - name "OrderNumber" - value "") - (object Attribute - tool "Oracle8" - name "IsReadNoDataState" - value FALSE) - (object Attribute - tool "Oracle8" - name "IsReadNoProcessState" - value FALSE) - (object Attribute - tool "Oracle8" - name "IsWriteNoDataState" - value FALSE) - (object Attribute - tool "Oracle8" - name "IsWriteNoProcessState" - value FALSE) - (object Attribute - tool "Oracle8" - name "IsSelfish" - value FALSE) - (object Attribute - tool "Oracle8" - name "TriggerType" - value ("TriggerTypeSet" 1801)) - (object Attribute - tool "Oracle8" - name "TriggerEvent" - value ("TriggerEventSet" 1601)) - (object Attribute - tool "Oracle8" - name "TriggerText" - value "") - (object Attribute - tool "Oracle8" - name "TriggerReferencingNames" - value "") - (object Attribute - tool "Oracle8" - name "TriggerForEach" - value ("TriggerForEachSet" 1701)) - (object Attribute - tool "Oracle8" - name "TriggerWhenClause" - value "") - (object Attribute - tool "Oracle8" - name "MethodKindSet" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "MapMethod" - value 1901) - (object Attribute - tool "Oracle8" - name "OrderMethod" - value 1902) - (object Attribute - tool "Oracle8" - name "Function" - value 1903) - (object Attribute - tool "Oracle8" - name "Procedure" - value 1904) - (object Attribute - tool "Oracle8" - name "Operator" - value 1905) - (object Attribute - tool "Oracle8" - name "Constructor" - value 1906) - (object Attribute - tool "Oracle8" - name "Destructor" - value 1907) - (object Attribute - tool "Oracle8" - name "Trigger" - value 1908) - (object Attribute - tool "Oracle8" - name "Calculated" - value 1909))) - (object Attribute - tool "Oracle8" - name "TriggerTypeSet" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "AFTER" - value 1801) - (object Attribute - tool "Oracle8" - name "BEFORE" - value 1802) - (object Attribute - tool "Oracle8" - name "INSTEAD OF" - value 1803))) - (object Attribute - tool "Oracle8" - name "TriggerForEachSet" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "ROW" - value 1701) - (object Attribute - tool "Oracle8" - name "STATEMENT" - value 1702))) - (object Attribute - tool "Oracle8" - name "TriggerEventSet" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "INSERT" - value 1601) - (object Attribute - tool "Oracle8" - name "UPDATE" - value 1602) - (object Attribute - tool "Oracle8" - name "DELETE" - value 1603) - (object Attribute - tool "Oracle8" - name "INSERT OR UPDATE" - value 1604) - (object Attribute - tool "Oracle8" - name "INSERT OR DELETE" - value 1605) - (object Attribute - tool "Oracle8" - name "UPDATE OR DELETE" - value 1606) - (object Attribute - tool "Oracle8" - name "INSERT OR UPDATE OR DELETE" - value 1607))))) - (object Attribute - tool "Oracle8" - name "default__Role" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "OrderNumber" - value ""))) - (object Attribute - tool "Oracle8" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "OrderNumber" - value "") - (object Attribute - tool "Oracle8" - name "IsUnique" - value FALSE) - (object Attribute - tool "Oracle8" - name "NullsAllowed" - value TRUE) - (object Attribute - tool "Oracle8" - name "Length" - value "") - (object Attribute - tool "Oracle8" - name "Precision" - value "2") - (object Attribute - tool "Oracle8" - name "Scale" - value "6") - (object Attribute - tool "Oracle8" - name "IsIndex" - value FALSE) - (object Attribute - tool "Oracle8" - name "IsPrimaryKey" - value FALSE) - (object Attribute - tool "Oracle8" - name "CompositeUnique" - value FALSE) - (object Attribute - tool "Oracle8" - name "CheckConstraint" - value ""))) - (object Attribute - tool "Oracle8" - name "HiddenTool" - value FALSE) - (object Attribute - tool "Repository" - name "HiddenTool" - value FALSE) - (object Attribute - tool "cg" - name "propertyId" - value "809135966") - (object Attribute - tool "cg" - name "default__Project" - value (list Attribute_Set - (object Attribute - tool "cg" - name "UseMSVC" - value FALSE) - (object Attribute - tool "cg" - name "HeaderFileExtension" - value "h") - (object Attribute - tool "cg" - name "HeaderFileBackupExtension" - value "h~") - (object Attribute - tool "cg" - name "HeaderFileTemporaryExtension" - value "h#") - (object Attribute - tool "cg" - name "CodeFileExtension" - value "cpp") - (object Attribute - tool "cg" - name "CodeFileBackupExtension" - value "cp~") - (object Attribute - tool "cg" - name "CodeFileTemporaryExtension" - value "cp#") - (object Attribute - tool "cg" - name "CreateMissingDirectories" - value TRUE) - (object Attribute - tool "cg" - name "StopOnError" - value FALSE) - (object Attribute - tool "cg" - name "ErrorLimit" - value 30) - (object Attribute - tool "cg" - name "Directory" - value "$ROSECPP_SOURCE") - (object Attribute - tool "cg" - name "PathSeparator" - value "") - (object Attribute - tool "cg" - name "FileNameFormat" - value "128vx_b") - (object Attribute - tool "cg" - name "BooleanType" - value "int") - (object Attribute - tool "cg" - name "AllowTemplates" - value TRUE) - (object Attribute - tool "cg" - name "AllowExplicitInstantiations" - value TRUE) - (object Attribute - tool "cg" - name "AllowProtectedInheritance" - value TRUE) - (object Attribute - tool "cg" - name "CommentWidth" - value 60) - (object Attribute - tool "cg" - name "OneByValueContainer" - value "$targetClass") - (object Attribute - tool "cg" - name "OneByReferenceContainer" - value "$targetClass *") - (object Attribute - tool "cg" - name "OptionalByValueContainer" - value "OptionalByValue<$targetClass>") - (object Attribute - tool "cg" - name "OptionalByReferenceContainer" - value "$targetClass *") - (object Attribute - tool "cg" - name "FixedByValueContainer" - value "$targetClass[$limit]") - (object Attribute - tool "cg" - name "UnorderedFixedByValueContainer" - value "$targetClass[$limit]") - (object Attribute - tool "cg" - name "FixedByReferenceContainer" - value "$targetClass *[$limit]") - (object Attribute - tool "cg" - name "UnorderedFixedByReferenceContainer" - value "$targetClass *[$limit]") - (object Attribute - tool "cg" - name "BoundedByValueContainer" - value "BoundedListByValue<$targetClass,$limit>") - (object Attribute - tool "cg" - name "UnorderedBoundedByValueContainer" - value "BoundedSetByValue<$targetClass,$limit>") - (object Attribute - tool "cg" - name "BoundedByReferenceContainer" - value "BoundedListByReference<$targetClass,$limit>") - (object Attribute - tool "cg" - name "UnorderedBoundedByReferenceContainer" - value "BoundedSetByReference<$targetClass,$limit>") - (object Attribute - tool "cg" - name "UnboundedByValueContainer" - value "UnboundedListByValue<$targetClass>") - (object Attribute - tool "cg" - name "UnorderedUnboundedByValueContainer" - value "UnboundedSetByValue<$targetClass>") - (object Attribute - tool "cg" - name "UnboundedByReferenceContainer" - value "UnboundedListByReference<$targetClass>") - (object Attribute - tool "cg" - name "UnorderedUnboundedByReferenceContainer" - value "UnboundedSetByReference<$targetClass>") - (object Attribute - tool "cg" - name "QualifiedByValueContainer" - value "AssociationByValue<$qualtype, $qualcont>") - (object Attribute - tool "cg" - name "UnorderedQualifiedByValueContainer" - value "DictionaryByValue<$qualtype, $qualcont>") - (object Attribute - tool "cg" - name "QualifiedByReferenceContainer" - value "AssociationByReference<$qualtype, $qualcont>") - (object Attribute - tool "cg" - name "UnorderedQualifiedByReferenceContainer" - value "DictionaryByReference<$qualtype, $qualcont>") - (object Attribute - tool "cg" - name "GeneratePreserveRegions" - value TRUE))) - (object Attribute - tool "cg" - name "default__Class" - value (list Attribute_Set - (object Attribute - tool "cg" - name "CodeName" - value "") - (object Attribute - tool "cg" - name "ImplementationType" - value "") - (object Attribute - tool "cg" - name "ClassKey" - value "class") - (object Attribute - tool "cg" - name "GenerateEmptyRegions" - value ("GenerateEmptyRegionSet" 3)) - (object Attribute - tool "cg" - name "GenerateEmptyRegionSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "None" - value 0) - (object Attribute - tool "cg" - name "Preserved" - value 1) - (object Attribute - tool "cg" - name "Unpreserved" - value 2) - (object Attribute - tool "cg" - name "All" - value 3))) - (object Attribute - tool "cg" - name "PutBodiesInSpec" - value FALSE) - (object Attribute - tool "cg" - name "GenerateDefaultConstructor" - value ("GenerateSet" 199)) - (object Attribute - tool "cg" - name "DefaultConstructorVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "InlineDefaultConstructor" - value FALSE) - (object Attribute - tool "cg" - name "ExplicitDefaultConstructor" - value FALSE) - (object Attribute - tool "cg" - name "GenerateCopyConstructor" - value ("GenerateSet" 199)) - (object Attribute - tool "cg" - name "CopyConstructorVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "InlineCopyConstructor" - value FALSE) - (object Attribute - tool "cg" - name "ExplicitCopyConstructor" - value FALSE) - (object Attribute - tool "cg" - name "GenerateDestructor" - value TRUE) - (object Attribute - tool "cg" - name "DestructorVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "DestructorKind" - value ("ThreeKindSet" 200)) - (object Attribute - tool "cg" - name "InlineDestructor" - value FALSE) - (object Attribute - tool "cg" - name "GenerateAssignmentOperation" - value ("GenerateSet" 199)) - (object Attribute - tool "cg" - name "AssignmentVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "AssignmentKind" - value ("ThreeKindSet" 200)) - (object Attribute - tool "cg" - name "InlineAssignmentOperation" - value FALSE) - (object Attribute - tool "cg" - name "GenerateEqualityOperations" - value ("GenerateSet" 199)) - (object Attribute - tool "cg" - name "EqualityVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "EqualityKind" - value ("FriendKindSet" 200)) - (object Attribute - tool "cg" - name "InlineEqualityOperations" - value FALSE) - (object Attribute - tool "cg" - name "GenerateRelationalOperations" - value FALSE) - (object Attribute - tool "cg" - name "RelationalVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "RelationalKind" - value ("FriendKindSet" 200)) - (object Attribute - tool "cg" - name "InlineRelationalOperations" - value FALSE) - (object Attribute - tool "cg" - name "GenerateStorageMgmtOperations" - value FALSE) - (object Attribute - tool "cg" - name "StorageMgmtVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "InlineStorageMgmtOperations" - value FALSE) - (object Attribute - tool "cg" - name "GenerateSubscriptOperation" - value FALSE) - (object Attribute - tool "cg" - name "SubscriptVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "SubscriptKind" - value ("ThreeKindSet" 200)) - (object Attribute - tool "cg" - name "SubscriptResultType" - value "") - (object Attribute - tool "cg" - name "InlineSubscriptOperation" - value FALSE) - (object Attribute - tool "cg" - name "GenerateDereferenceOperation" - value FALSE) - (object Attribute - tool "cg" - name "DereferenceVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "DereferenceKind" - value ("ThreeKindSet" 200)) - (object Attribute - tool "cg" - name "DereferenceResultType" - value "") - (object Attribute - tool "cg" - name "InlineDereferenceOperation" - value FALSE) - (object Attribute - tool "cg" - name "GenerateIndirectionOperation" - value FALSE) - (object Attribute - tool "cg" - name "IndirectionVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "IndirectionKind" - value ("ThreeKindSet" 200)) - (object Attribute - tool "cg" - name "IndirectionResultType" - value "") - (object Attribute - tool "cg" - name "InlineIndirectionOperation" - value FALSE) - (object Attribute - tool "cg" - name "GenerateStreamOperations" - value FALSE) - (object Attribute - tool "cg" - name "StreamVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "InlineStreamOperations" - value FALSE) - (object Attribute - tool "cg" - name "ThreeKindSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202))) - (object Attribute - tool "cg" - name "KindSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202) - (object Attribute - tool "cg" - name "Static" - value 203))) - (object Attribute - tool "cg" - name "FriendKindSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202) - (object Attribute - tool "cg" - name "Friend" - value 204))) - (object Attribute - tool "cg" - name "GenerateSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "DeclareAndDefine" - value 199) - (object Attribute - tool "cg" - name "DeclareOnly" - value 205) - (object Attribute - tool "cg" - name "DoNotDeclare" - value 206))) - (object Attribute - tool "cg" - name "VisibilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Public" - value 45) - (object Attribute - tool "cg" - name "Protected" - value 44) - (object Attribute - tool "cg" - name "Private" - value 43) - (object Attribute - tool "cg" - name "Implementation" - value 14))) - (object Attribute - tool "cg" - name "ConstValue" - value "") - (object Attribute - tool "cg" - name "GenerateDefaultSpecifier" - value FALSE) - (object Attribute - tool "cg" - name "DefaultSpecifier" - value ""))) - (object Attribute - tool "cg" - name "default__Module-Spec" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Generate" - value TRUE) - (object Attribute - tool "cg" - name "GenerateEmptyRegions" - value ("GenerateEmptyRegionSet" 3)) - (object Attribute - tool "cg" - name "GenerateEmptyRegionSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "None" - value 0) - (object Attribute - tool "cg" - name "Preserved" - value 1) - (object Attribute - tool "cg" - name "Unpreserved" - value 2) - (object Attribute - tool "cg" - name "All" - value 3))) - (object Attribute - tool "cg" - name "CmIdentification" - value (value Text " %X% %Q% %Z% %W%")) - (object Attribute - tool "cg" - name "CopyrightNotice" - value (value Text "")) - (object Attribute - tool "cg" - name "FileName" - value "AUTO GENERATE") - (object Attribute - tool "cg" - name "AllowExtensionlessFileName" - value FALSE) - (object Attribute - tool "cg" - name "InclusionProtectionSymbol" - value "AUTO GENERATE") - (object Attribute - tool "cg" - name "IncludeFormat" - value (value Text -|// $package -|#include "$file" -| - )) - (object Attribute - tool "cg" - name "IncludeBySimpleName" - value FALSE) - (object Attribute - tool "cg" - name "IncludePrecompiledHeader" - value FALSE) - (object Attribute - tool "cg" - name "IncludeOrder" - value "AMIR") - (object Attribute - tool "cg" - name "AdditionalIncludes" - value (value Text "")) - (object Attribute - tool "cg" - name "InliningStyle" - value ("InliningStyleSet" 207)) - (object Attribute - tool "cg" - name "InliningStyleSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "InClassDeclaration" - value 208) - (object Attribute - tool "cg" - name "FollowingClassDeclaration" - value 207))) - (object Attribute - tool "cg" - name "TypesDefined" - value (value Text "")) - (object Attribute - tool "cg" - name "IncludeClosure" - value (value Text "")))) - (object Attribute - tool "cg" - name "default__Module-Body" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Generate" - value TRUE) - (object Attribute - tool "cg" - name "GenerateEmptyRegions" - value ("GenerateEmptyRegionSet" 3)) - (object Attribute - tool "cg" - name "GenerateEmptyRegionSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "None" - value 0) - (object Attribute - tool "cg" - name "Preserved" - value 1) - (object Attribute - tool "cg" - name "Unpreserved" - value 2) - (object Attribute - tool "cg" - name "All" - value 3))) - (object Attribute - tool "cg" - name "CmIdentification" - value (value Text " %X% %Q% %Z% %W%")) - (object Attribute - tool "cg" - name "CopyrightNotice" - value (value Text "")) - (object Attribute - tool "cg" - name "FileName" - value "AUTO GENERATE") - (object Attribute - tool "cg" - name "AllowExtensionlessFileName" - value FALSE) - (object Attribute - tool "cg" - name "IncludeFormat" - value (value Text -|// $package -|#include "$file" -| - )) - (object Attribute - tool "cg" - name "IncludeBySimpleName" - value FALSE) - (object Attribute - tool "cg" - name "IncludePrecompiledHeader" - value TRUE) - (object Attribute - tool "cg" - name "IncludeOrder" - value "AMIR") - (object Attribute - tool "cg" - name "AdditionalIncludes" - value (value Text "")) - (object Attribute - tool "cg" - name "InliningStyle" - value ("InliningStyleSet" 207)) - (object Attribute - tool "cg" - name "InliningStyleSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "InClassDeclaration" - value 208) - (object Attribute - tool "cg" - name "FollowingClassDeclaration" - value 207))) - (object Attribute - tool "cg" - name "TypesDefined" - value (value Text "")) - (object Attribute - tool "cg" - name "IncludeClosure" - value (value Text "")))) - (object Attribute - tool "cg" - name "default__Operation" - value (list Attribute_Set - (object Attribute - tool "cg" - name "CodeName" - value "") - (object Attribute - tool "cg" - name "OperationKind" - value ("OperationKindSet" 200)) - (object Attribute - tool "cg" - name "OperationKindSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202) - (object Attribute - tool "cg" - name "Static" - value 203) - (object Attribute - tool "cg" - name "Friend" - value 204))) - (object Attribute - tool "cg" - name "OperationIsConst" - value FALSE) - (object Attribute - tool "cg" - name "OperationIsExplicit" - value FALSE) - (object Attribute - tool "cg" - name "Inline" - value FALSE) - (object Attribute - tool "cg" - name "EntryCode" - value (value Text "")) - (object Attribute - tool "cg" - name "ExitCode" - value (value Text "")) - (object Attribute - tool "cg" - name "GenerateEmptyRegions" - value ("GenerateEmptyRegionSet" 3)) - (object Attribute - tool "cg" - name "GenerateEmptyRegionSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "None" - value 0) - (object Attribute - tool "cg" - name "Preserved" - value 1) - (object Attribute - tool "cg" - name "Unpreserved" - value 2) - (object Attribute - tool "cg" - name "All" - value 3))) - (object Attribute - tool "cg" - name "BodyAnnotations" - value "") - (object Attribute - tool "cg" - name "OperationIsOneWay" - value FALSE) - (object Attribute - tool "cg" - name "Context" - value "") - (object Attribute - tool "cg" - name "Raises" - value ""))) - (object Attribute - tool "cg" - name "default__Has" - value (list Attribute_Set - (object Attribute - tool "cg" - name "CodeName" - value "") - (object Attribute - tool "cg" - name "Ordered" - value TRUE) - (object Attribute - tool "cg" - name "NameIfUnlabeled" - value "the_$supplier") - (object Attribute - tool "cg" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "cg" - name "DataMemberName" - value "$relationship") - (object Attribute - tool "cg" - name "DataMemberVisibility" - value ("DataMemberVisibilitySet" 14)) - (object Attribute - tool "cg" - name "DataMemberVisibilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Public" - value 45) - (object Attribute - tool "cg" - name "Protected" - value 44) - (object Attribute - tool "cg" - name "Private" - value 43) - (object Attribute - tool "cg" - name "Implementation" - value 14) - (object Attribute - tool "cg" - name "AtRelationshipVisibility" - value 210))) - (object Attribute - tool "cg" - name "DataMemberMutability" - value ("DataMemberMutabilitySet" 0)) - (object Attribute - tool "cg" - name "DataMemberMutabilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Unrestricted" - value 0) - (object Attribute - tool "cg" - name "Mutable" - value 1) - (object Attribute - tool "cg" - name "Const" - value 2))) - (object Attribute - tool "cg" - name "DataMemberIsVolatile" - value FALSE) - (object Attribute - tool "cg" - name "DataMemberFieldSize" - value "") - (object Attribute - tool "cg" - name "InitialValue" - value (value Text "")) - (object Attribute - tool "cg" - name "GenerateGetOperation" - value TRUE) - (object Attribute - tool "cg" - name "GenerateSetOperation" - value TRUE) - (object Attribute - tool "cg" - name "GetName" - value "get_$relationship") - (object Attribute - tool "cg" - name "SetName" - value "set_$relationship") - (object Attribute - tool "cg" - name "GetSetKinds" - value ("GetSetKindsSet" 200)) - (object Attribute - tool "cg" - name "GetSetKindsSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202) - (object Attribute - tool "cg" - name "Static" - value 203) - (object Attribute - tool "cg" - name "Friend" - value 204))) - (object Attribute - tool "cg" - name "ContainerClass" - value "") - (object Attribute - tool "cg" - name "SelectorName" - value "") - (object Attribute - tool "cg" - name "SelectorType" - value "") - (object Attribute - tool "cg" - name "GetIsConst" - value TRUE) - (object Attribute - tool "cg" - name "GetResultIsConst" - value ("GetResultIsConstSet" 2)) - (object Attribute - tool "cg" - name "GetResultIsConstSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "False" - value 0) - (object Attribute - tool "cg" - name "True" - value 1) - (object Attribute - tool "cg" - name "Same_As_Function" - value 2))) - (object Attribute - tool "cg" - name "GetSetByReference" - value FALSE) - (object Attribute - tool "cg" - name "InlineGet" - value TRUE) - (object Attribute - tool "cg" - name "SetReturnsValue" - value FALSE) - (object Attribute - tool "cg" - name "InlineSet" - value TRUE) - (object Attribute - tool "cg" - name "ForwardReferenceOnly" - value FALSE) - (object Attribute - tool "cg" - name "GenerateForwardReference" - value FALSE) - (object Attribute - tool "cg" - name "IsReadOnly" - value FALSE) - (object Attribute - tool "cg" - name "BoundedHasRelType" - value ("HasRelTypeSet" 47)) - (object Attribute - tool "cg" - name "HasRelTypeSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Array" - value 24) - (object Attribute - tool "cg" - name "Sequence" - value 47))))) - (object Attribute - tool "cg" - name "default__Association" - value (list Attribute_Set - (object Attribute - tool "cg" - name "NameIfUnlabeled" - value "the_$targetClass"))) - (object Attribute - tool "cg" - name "default__Inherit" - value (list Attribute_Set - (object Attribute - tool "cg" - name "InstanceArguments" - value ""))) - (object Attribute - tool "cg" - name "default__Role" - value (list Attribute_Set - (object Attribute - tool "cg" - name "CodeName" - value "") - (object Attribute - tool "cg" - name "ForwardReferenceOnly" - value FALSE) - (object Attribute - tool "cg" - name "NameIfUnlabeled" - value "the_$targetClass") - (object Attribute - tool "cg" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "cg" - name "DataMemberName" - value "$target") - (object Attribute - tool "cg" - name "DataMemberVisibility" - value ("DataMemberVisibilitySet" 14)) - (object Attribute - tool "cg" - name "DataMemberVisibilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Public" - value 45) - (object Attribute - tool "cg" - name "Protected" - value 44) - (object Attribute - tool "cg" - name "Private" - value 43) - (object Attribute - tool "cg" - name "Implementation" - value 14) - (object Attribute - tool "cg" - name "AtRelationshipVisibility" - value 210))) - (object Attribute - tool "cg" - name "DataMemberMutability" - value ("DataMemberMutabilitySet" 0)) - (object Attribute - tool "cg" - name "DataMemberMutabilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Unrestricted" - value 0) - (object Attribute - tool "cg" - name "Mutable" - value 1) - (object Attribute - tool "cg" - name "Const" - value 2))) - (object Attribute - tool "cg" - name "DataMemberIsVolatile" - value FALSE) - (object Attribute - tool "cg" - name "DataMemberFieldSize" - value "") - (object Attribute - tool "cg" - name "InitialValue" - value (value Text "")) - (object Attribute - tool "cg" - name "ContainerClass" - value "") - (object Attribute - tool "cg" - name "ContainerGet" - value "$data.get($keys)") - (object Attribute - tool "cg" - name "ContainerSet" - value "$data.set($keys,$value)") - (object Attribute - tool "cg" - name "QualifiedContainer" - value "") - (object Attribute - tool "cg" - name "AssocClassContainer" - value "$supplier *") - (object Attribute - tool "cg" - name "AssocClassInitialValue" - value (value Text "")) - (object Attribute - tool "cg" - name "GetSetKinds" - value ("GetSetKindsSet" 200)) - (object Attribute - tool "cg" - name "GetSetKindsSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202) - (object Attribute - tool "cg" - name "Static" - value 203) - (object Attribute - tool "cg" - name "Friend" - value 204))) - (object Attribute - tool "cg" - name "GetSetByReference" - value FALSE) - (object Attribute - tool "cg" - name "GenerateGetOperation" - value TRUE) - (object Attribute - tool "cg" - name "GetName" - value "get_$target") - (object Attribute - tool "cg" - name "GetIsConst" - value TRUE) - (object Attribute - tool "cg" - name "GetResultIsConst" - value ("GetResultIsConstSet" 2)) - (object Attribute - tool "cg" - name "GetResultIsConstSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "False" - value 0) - (object Attribute - tool "cg" - name "True" - value 1) - (object Attribute - tool "cg" - name "Same_As_Function" - value 2))) - (object Attribute - tool "cg" - name "InlineGet" - value TRUE) - (object Attribute - tool "cg" - name "GenerateSetOperation" - value TRUE) - (object Attribute - tool "cg" - name "SetName" - value "set_$target") - (object Attribute - tool "cg" - name "SetReturnsValue" - value FALSE) - (object Attribute - tool "cg" - name "InlineSet" - value TRUE) - (object Attribute - tool "cg" - name "QualifiedGetSetByReference" - value ("QualifiedGetSetByReferenceSet" 2)) - (object Attribute - tool "cg" - name "QualifiedGetSetByReferenceSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "False" - value 0) - (object Attribute - tool "cg" - name "True" - value 1) - (object Attribute - tool "cg" - name "Same_As_GetSetByReference" - value 2))) - (object Attribute - tool "cg" - name "GenerateQualifiedGetOperation" - value TRUE) - (object Attribute - tool "cg" - name "QualifiedGetName" - value "get_$target") - (object Attribute - tool "cg" - name "QualifiedGetIsConst" - value TRUE) - (object Attribute - tool "cg" - name "QualifiedGetResultIsConst" - value ("GetResultIsConstSet" 2)) - (object Attribute - tool "cg" - name "InlineQualifiedGet" - value TRUE) - (object Attribute - tool "cg" - name "GenerateQualifiedSetOperation" - value TRUE) - (object Attribute - tool "cg" - name "QualifiedSetName" - value "set_$target") - (object Attribute - tool "cg" - name "QualifiedSetReturnsValue" - value FALSE) - (object Attribute - tool "cg" - name "InlineQualifiedSet" - value TRUE) - (object Attribute - tool "cg" - name "GenerateAssocClassDataMember" - value TRUE) - (object Attribute - tool "cg" - name "AssocClassDataMemberName" - value "$target") - (object Attribute - tool "cg" - name "AssocClassDataMemberVisibility" - value ("DataMemberVisibilitySet" 14)) - (object Attribute - tool "cg" - name "DataMemberVisibilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Public" - value 45) - (object Attribute - tool "cg" - name "Protected" - value 44) - (object Attribute - tool "cg" - name "Private" - value 43) - (object Attribute - tool "cg" - name "Implementation" - value 14) - (object Attribute - tool "cg" - name "AtRelationshipVisibility" - value 210))) - (object Attribute - tool "cg" - name "AssocClassDataMemberMutability" - value ("DataMemberMutabilitySet" 0)) - (object Attribute - tool "cg" - name "DataMemberMutabilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Unrestricted" - value 0) - (object Attribute - tool "cg" - name "Mutable" - value 1) - (object Attribute - tool "cg" - name "Const" - value 2))) - (object Attribute - tool "cg" - name "AssocClassDataMemberIsVolatile" - value FALSE) - (object Attribute - tool "cg" - name "AssocClassGetSetKinds" - value ("GetSetKindsSet" 200)) - (object Attribute - tool "cg" - name "GenerateAssocClassGetOperation" - value TRUE) - (object Attribute - tool "cg" - name "AssocClassGetName" - value "get_$target") - (object Attribute - tool "cg" - name "AssocClassGetIsConst" - value TRUE) - (object Attribute - tool "cg" - name "AssocClassGetResultIsConst" - value ("GetResultIsConstSet" 2)) - (object Attribute - tool "cg" - name "InlineAssocClassGet" - value TRUE) - (object Attribute - tool "cg" - name "GenerateAssocClassSetOperation" - value TRUE) - (object Attribute - tool "cg" - name "AssocClassSetName" - value "set_$target") - (object Attribute - tool "cg" - name "AssocClassSetReturnsValue" - value FALSE) - (object Attribute - tool "cg" - name "InlineAssocClassSet" - value TRUE) - (object Attribute - tool "cg" - name "AssocClassForwardReferenceOnly" - value TRUE) - (object Attribute - tool "cg" - name "GenerateForwardReference" - value FALSE) - (object Attribute - tool "cg" - name "IsReadOnly" - value FALSE) - (object Attribute - tool "cg" - name "BoundedRoleType" - value ("AssocTypeSet" 47)) - (object Attribute - tool "cg" - name "AssocTypeSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Array" - value 24) - (object Attribute - tool "cg" - name "Sequence" - value 47))))) - (object Attribute - tool "cg" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "cg" - name "CodeName" - value "") - (object Attribute - tool "cg" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "cg" - name "DataMemberName" - value "$attribute") - (object Attribute - tool "cg" - name "DataMemberVisibility" - value ("DataMemberVisibilitySet" 14)) - (object Attribute - tool "cg" - name "DataMemberVisibilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Public" - value 45) - (object Attribute - tool "cg" - name "Protected" - value 44) - (object Attribute - tool "cg" - name "Private" - value 43) - (object Attribute - tool "cg" - name "Implementation" - value 14) - (object Attribute - tool "cg" - name "AtAttributeVisibility" - value 211))) - (object Attribute - tool "cg" - name "DataMemberMutability" - value ("DataMemberMutabilitySet" 0)) - (object Attribute - tool "cg" - name "DataMemberMutabilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Unrestricted" - value 0) - (object Attribute - tool "cg" - name "Mutable" - value 1) - (object Attribute - tool "cg" - name "Const" - value 2))) - (object Attribute - tool "cg" - name "DataMemberIsVolatile" - value FALSE) - (object Attribute - tool "cg" - name "DataMemberFieldSize" - value "") - (object Attribute - tool "cg" - name "GenerateGetOperation" - value TRUE) - (object Attribute - tool "cg" - name "GenerateSetOperation" - value TRUE) - (object Attribute - tool "cg" - name "GetName" - value "get_$attribute") - (object Attribute - tool "cg" - name "SetName" - value "set_$attribute") - (object Attribute - tool "cg" - name "GetSetKinds" - value ("GetSetKindsSet" 200)) - (object Attribute - tool "cg" - name "GetSetKindsSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202) - (object Attribute - tool "cg" - name "Static" - value 203) - (object Attribute - tool "cg" - name "Friend" - value 204))) - (object Attribute - tool "cg" - name "GetIsConst" - value TRUE) - (object Attribute - tool "cg" - name "GetResultIsConst" - value ("GetResultIsConstSet" 2)) - (object Attribute - tool "cg" - name "GetResultIsConstSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "False" - value 0) - (object Attribute - tool "cg" - name "True" - value 1) - (object Attribute - tool "cg" - name "Same_As_Function" - value 2))) - (object Attribute - tool "cg" - name "GetSetByReference" - value FALSE) - (object Attribute - tool "cg" - name "InlineGet" - value TRUE) - (object Attribute - tool "cg" - name "SetReturnsValue" - value FALSE) - (object Attribute - tool "cg" - name "InlineSet" - value TRUE) - (object Attribute - tool "cg" - name "CaseSpecifier" - value "") - (object Attribute - tool "cg" - name "IsReadOnly" - value FALSE))) - (object Attribute - tool "cg" - name "default__Uses" - value (list Attribute_Set - (object Attribute - tool "cg" - name "ForwardReferenceOnly" - value FALSE) - (object Attribute - tool "cg" - name "BodyReferenceOnly" - value FALSE) - (object Attribute - tool "cg" - name "GenerateForwardReference" - value FALSE))) - (object Attribute - tool "cg" - name "default__Subsystem" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Directory" - value "AUTO GENERATE") - (object Attribute - tool "cg" - name "DirectoryIsOnSearchList" - value FALSE) - (object Attribute - tool "cg" - name "PrecompiledHeader" - value ""))) - (object Attribute - tool "cg" - name "default__Category" - value (list Attribute_Set - (object Attribute - tool "cg" - name "IsNamespace" - value FALSE) - (object Attribute - tool "cg" - name "Indent" - value 2) - (object Attribute - tool "cg" - name "CodeName" - value "") - (object Attribute - tool "cg" - name "GenerateEmptyRegions" - value ("GenerateEmptyRegionSet" 3)) - (object Attribute - tool "cg" - name "GenerateEmptyRegionSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "None" - value 0) - (object Attribute - tool "cg" - name "Preserved" - value 1) - (object Attribute - tool "cg" - name "Unpreserved" - value 2) - (object Attribute - tool "cg" - name "All" - value 3))))) - (object Attribute - tool "MSVC" - name "propertyId" - value "809135966") - (object Attribute - tool "MSVC" - name "default__Project" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Version" - value "5.0"))) - (object Attribute - tool "MSVC" - name "default__Class" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Type" - value ("MSVCClassTypeSet" 0)) - (object Attribute - tool "MSVC" - name "MSVCClassTypeSet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Normal" - value 0) - (object Attribute - tool "MSVC" - name "Interface_Part" - value 1) - (object Attribute - tool "MSVC" - name "Connection_Part" - value 2) - (object Attribute - tool "MSVC" - name "Class_Factory" - value 3))) - (object Attribute - tool "MSVC" - name "CObjectFunctionality" - value ("CObjectFunctionalitySet" 0)) - (object Attribute - tool "MSVC" - name "CObjectFunctionalitySet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "None" - value 0) - (object Attribute - tool "MSVC" - name "Dynamic" - value 1) - (object Attribute - tool "MSVC" - name "Dyncreate" - value 2) - (object Attribute - tool "MSVC" - name "Serial" - value 3))) - (object Attribute - tool "MSVC" - name "GenerateOverrideGroup" - value FALSE) - (object Attribute - tool "MSVC" - name "GenerateDataGroup" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_DATA_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateFieldGroup" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_FIELD_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateMessageGroup" - value FALSE) - (object Attribute - tool "MSVC" - name "GenerateMessageMap" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_MSG_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "MESSAGE_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "OLEFactory" - value ("OLEFactorySet" 0)) - (object Attribute - tool "MSVC" - name "OLEFactorySet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "None" - value 0) - (object Attribute - tool "MSVC" - name "Built_in" - value 1) - (object Attribute - tool "MSVC" - name "Simple" - value 2) - (object Attribute - tool "MSVC" - name "Licensed" - value 3))) - (object Attribute - tool "MSVC" - name "OLEName" - value "") - (object Attribute - tool "MSVC" - name "OLEClassID" - value "") - (object Attribute - tool "MSVC" - name "GenerateOLECtlType" - value FALSE) - (object Attribute - tool "MSVC" - name "OLECtlType" - value "") - (object Attribute - tool "MSVC" - name "GenerateOLETypeLib" - value FALSE) - (object Attribute - tool "MSVC" - name "OLETypeLibID" - value "") - (object Attribute - tool "MSVC" - name "OLETypeLibMajor" - value "") - (object Attribute - tool "MSVC" - name "OLETypeLibMinor" - value "") - (object Attribute - tool "MSVC" - name "GeneratePropPageIDs" - value FALSE) - (object Attribute - tool "MSVC" - name "OLEPropPageIDs" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateDispatchMap" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_DISPATCH_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "AFX_DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "StockProperties" - value (value Text "")) - (object Attribute - tool "MSVC" - name "StockFunctions" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DispatchDefValue" - value "") - (object Attribute - tool "MSVC" - name "GenerateDispIdEnum" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_DISP_ID_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateInterfaceMap" - value FALSE) - (object Attribute - tool "MSVC" - name "INTERFACE_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "InitInterface" - value "") - (object Attribute - tool "MSVC" - name "GenerateEventMap" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_EVENT_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "AFX_EVENT_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "EVENT_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "StockEvents" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateEventSinkMap" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_EVENTSINK_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "AFX_EVENTSINK_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "EVENTSINK_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "PropNotifySinks" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateConnectionMap" - value FALSE) - (object Attribute - tool "MSVC" - name "CONNECTION_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "ConnectionPointIID" - value "") - (object Attribute - tool "MSVC" - name "InheritanceType" - value "") - (object Attribute - tool "MSVC" - name "DeclSpec" - value "") - (object Attribute - tool "MSVC" - name "OLECommands" - value (value Text "")) - (object Attribute - tool "MSVC" - name "MFCDeclares" - value (value Text "")) - (object Attribute - tool "MSVC" - name "MFCImplements" - value (value Text "")) - (object Attribute - tool "MSVC" - name "ATL_Declares" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateCOMMap" - value FALSE) - (object Attribute - tool "MSVC" - name "COM_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateConnectionPointMap" - value FALSE) - (object Attribute - tool "MSVC" - name "CONNECTION_POINT_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateMsgMap" - value FALSE) - (object Attribute - tool "MSVC" - name "MSG_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GeneratePropertyMap" - value FALSE) - (object Attribute - tool "MSVC" - name "PROPERTY_MAP_Entries" - value (value Text "")))) - (object Attribute - tool "MSVC" - name "default__Operation" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Type" - value ("MSVCOperationTypeSet" 0)) - (object Attribute - tool "MSVC" - name "MSVCOperationTypeSet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Normal" - value 0) - (object Attribute - tool "MSVC" - name "Virtual_Override" - value 1) - (object Attribute - tool "MSVC" - name "Message_Handler" - value 2) - (object Attribute - tool "MSVC" - name "Dispatch_Handler" - value 3) - (object Attribute - tool "MSVC" - name "Event_Firing_Function" - value 4) - (object Attribute - tool "MSVC" - name "Event_Sink_Handler" - value 5) - (object Attribute - tool "MSVC" - name "Std_OLE_Method" - value 6) - (object Attribute - tool "MSVC" - name "Command_Parser" - value 7) - (object Attribute - tool "MSVC" - name "Property_Get_Function" - value 8) - (object Attribute - tool "MSVC" - name "Property_Set_Function" - value 9) - (object Attribute - tool "MSVC" - name "Property_Notify_Function" - value 10) - (object Attribute - tool "MSVC" - name "Macro_Generated_Function" - value 11))) - (object Attribute - tool "MSVC" - name "AFX_MSG_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "MESSAGE_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "AFX_DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "AFX_EVENT_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "EVENT_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "AFX_EVENTSINK_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "EVENTSINK_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "CallType" - value "") - (object Attribute - tool "MSVC" - name "DeclSpec" - value "") - (object Attribute - tool "MSVC" - name "BodyImage" - value (value Text "")))) - (object Attribute - tool "MSVC" - name "default__Role" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Type" - value ("MSVCAttributeTypeSet" 0)) - (object Attribute - tool "MSVC" - name "MSVCAttributeTypeSet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Normal" - value 0) - (object Attribute - tool "MSVC" - name "Member_Property" - value 1) - (object Attribute - tool "MSVC" - name "Get_Set_Property" - value 2) - (object Attribute - tool "MSVC" - name "Dialog_Data" - value 3) - (object Attribute - tool "MSVC" - name "Field_Data" - value 4) - (object Attribute - tool "MSVC" - name "Stock_Property" - value 5))) - (object Attribute - tool "MSVC" - name "AFX_DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DeclSpec" - value "") - (object Attribute - tool "MSVC" - name "PointerBase" - value "") - (object Attribute - tool "MSVC" - name "CallType" - value "") - (object Attribute - tool "MSVC" - name "StockPropertyImplementation" - value ""))) - (object Attribute - tool "MSVC" - name "default__Has" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Type" - value ("MSVCAttributeTypeSet" 0)) - (object Attribute - tool "MSVC" - name "MSVCAttributeTypeSet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Normal" - value 0) - (object Attribute - tool "MSVC" - name "Member_Property" - value 1) - (object Attribute - tool "MSVC" - name "Get_Set_Property" - value 2) - (object Attribute - tool "MSVC" - name "Dialog_Data" - value 3) - (object Attribute - tool "MSVC" - name "Field_Data" - value 4) - (object Attribute - tool "MSVC" - name "Stock_Property" - value 5))) - (object Attribute - tool "MSVC" - name "AFX_DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DeclSpec" - value "") - (object Attribute - tool "MSVC" - name "PointerBase" - value "") - (object Attribute - tool "MSVC" - name "CallType" - value "") - (object Attribute - tool "MSVC" - name "StockPropertyImplementation" - value ""))) - (object Attribute - tool "MSVC" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Type" - value ("MSVCAttributeTypeSet" 0)) - (object Attribute - tool "MSVC" - name "MSVCAttributeTypeSet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Normal" - value 0) - (object Attribute - tool "MSVC" - name "Member_Property" - value 1) - (object Attribute - tool "MSVC" - name "Get_Set_Property" - value 2) - (object Attribute - tool "MSVC" - name "Dialog_Data" - value 3) - (object Attribute - tool "MSVC" - name "Field_Data" - value 4) - (object Attribute - tool "MSVC" - name "Stock_Property" - value 5))) - (object Attribute - tool "MSVC" - name "AFX_DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DeclSpec" - value "") - (object Attribute - tool "MSVC" - name "PointerBase" - value "") - (object Attribute - tool "MSVC" - name "CallType" - value "") - (object Attribute - tool "MSVC" - name "StockPropertyImplementation" - value ""))) - (object Attribute - tool "MSVC" - name "default__Module-Spec" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "GenerateIncludesGroup" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_INCLUDES_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateInsertLocation" - value FALSE))) - (object Attribute - tool "MSVC" - name "default__Module-Body" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "GenerateIncludesGroup" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_INCLUDES_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateInsertLocation" - value FALSE))) - (object Attribute - tool "cg" - name "HiddenTool" - value FALSE) - (object Attribute - tool "SCC" - name "HiddenTool" - value FALSE) - (object Attribute - tool "TypeLibImporter" - name "HiddenTool" - value FALSE) - (object Attribute - tool "Visual Basic" - name "propertyId" - value "783606378") - (object Attribute - tool "Visual Basic" - name "default__Class" - value (list Attribute_Set - (object Attribute - tool "Visual Basic" - name "CreatableSet" - value (list Attribute_Set - (object Attribute - tool "Visual Basic" - name "Private" - value 221) - (object Attribute - tool "Visual Basic" - name "PublicNotCreatable" - value 213) - (object Attribute - tool "Visual Basic" - name "SingleUse" - value 214) - (object Attribute - tool "Visual Basic" - name "GlobalSingleUse" - value 215) - (object Attribute - tool "Visual Basic" - name "MultiUse" - value 219) - (object Attribute - tool "Visual Basic" - name "GlobalMultiUse" - value 220))) - (object Attribute - tool "Visual Basic" - name "OptionBase" - value "0") - (object Attribute - tool "Visual Basic" - name "OptionExplicit" - value TRUE) - (object Attribute - tool "Visual Basic" - name "OptionCompare" - value ("CompareSet" 202)) - (object Attribute - tool "Visual Basic" - name "Creatable" - value ("CreatableSet" 221)) - (object Attribute - tool "Visual Basic" - name "GenerateInitialization" - value FALSE) - (object Attribute - tool "Visual Basic" - name "GenerateTermination" - value FALSE) - (object Attribute - tool "Visual Basic" - name "CollectionClass" - value "Collection") - (object Attribute - tool "Visual Basic" - name "CompareSet" - value (list Attribute_Set - (object Attribute - tool "Visual Basic" - name "None" - value 202) - (object Attribute - tool "Visual Basic" - name "Binary" - value 203) - (object Attribute - tool "Visual Basic" - name "Text" - value 204))))) - (object Attribute - tool "Visual Basic" - name "default__Operation" - value (list Attribute_Set - (object Attribute - tool "Visual Basic" - name "OperationName" - value "$operation") - (object Attribute - tool "Visual Basic" - name "LibraryName" - value "") - (object Attribute - tool "Visual Basic" - name "AliasName" - value "") - (object Attribute - tool "Visual Basic" - name "IsStatic" - value FALSE) - (object Attribute - tool "Visual Basic" - name "EntryCode" - value (value Text "")) - (object Attribute - tool "Visual Basic" - name "ExitCode" - value (value Text "")))) - (object Attribute - tool "Visual Basic" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "Visual Basic" - name "IsConst" - value FALSE) - (object Attribute - tool "Visual Basic" - name "New" - value FALSE) - (object Attribute - tool "Visual Basic" - name "WithEvents" - value FALSE) - (object Attribute - tool "Visual Basic" - name "Subscript" - value "") - (object Attribute - tool "Visual Basic" - name "NameIfUnlabeled" - value "the$supplier") - (object Attribute - tool "Visual Basic" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "Visual Basic" - name "DataMemberName" - value "$relationship") - (object Attribute - tool "Visual Basic" - name "GenerateGetOperation" - value FALSE) - (object Attribute - tool "Visual Basic" - name "GenerateSetOperation" - value FALSE) - (object Attribute - tool "Visual Basic" - name "GenerateLetOperation" - value FALSE))) - (object Attribute - tool "Visual Basic" - name "default__Role" - value (list Attribute_Set - (object Attribute - tool "Visual Basic" - name "New" - value FALSE) - (object Attribute - tool "Visual Basic" - name "WithEvents" - value FALSE) - (object Attribute - tool "Visual Basic" - name "Subscript" - value "") - (object Attribute - tool "Visual Basic" - name "NameIfUnlabeled" - value "the$supplier") - (object Attribute - tool "Visual Basic" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "Visual Basic" - name "DataMemberName" - value "$relationship") - (object Attribute - tool "Visual Basic" - name "GenerateGetOperation" - value FALSE) - (object Attribute - tool "Visual Basic" - name "GenerateSetOperation" - value FALSE) - (object Attribute - tool "Visual Basic" - name "GenerateLetOperation" - value FALSE))) - (object Attribute - tool "Visual Basic" - name "default__Inherit" - value (list Attribute_Set - (object Attribute - tool "Visual Basic" - name "ImplementsDelegation" - value TRUE))) - (object Attribute - tool "Visual Basic" - name "default__Module-Spec" - value (list Attribute_Set - (object Attribute - tool "Visual Basic" - name "ProjectFile" - value ""))) - (object Attribute - tool "Visual Basic" - name "HiddenTool" - value FALSE) - (object Attribute - tool "VisualStudio" - name "HiddenTool" - value FALSE)) - quid "4362A29901BD")) diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/BestPracticeTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/BestPracticeTests.java deleted file mode 100644 index e7ef22d79f..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/BestPracticeTests.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -import java.util.List; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.CommandGroup; -import org.apache.tuscany.das.rdb.test.data.CompanyData; -import org.apache.tuscany.das.rdb.test.data.CompanyDeptData; -import org.apache.tuscany.das.rdb.test.data.DepEmpData; -import org.apache.tuscany.das.rdb.test.data.DepartmentData; -import org.apache.tuscany.das.rdb.test.data.EmployeeData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - -public class BestPracticeTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CompanyData(getAutoConnection()).refresh(); - new DepartmentData(getAutoConnection()).refresh(); - new EmployeeData(getAutoConnection()).refresh(); - new CompanyDeptData(getAutoConnection()).refresh(); - new DepEmpData(getAutoConnection()).refresh(); - - } - - //Read list of companies - public void testReadCompanies() throws Exception { - - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CompanyConfig.xml")); - Command read = commandGroup.getCommand("all companies"); - DataObject root = read.executeQuery(); - assertEquals(3, root.getList("COMPANY").size()); - - } - - //Read list of companies - public void testReadCompaniesWithDepartments() throws Exception { - - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CompanyConfig.xml")); - Command read = commandGroup.getCommand("all companies and departments"); - DataObject root = read.executeQuery(); - DataObject firstCompany = root.getDataObject("COMPANY[1]"); - List departments = firstCompany.getList("departments"); - assertEquals(0, departments.size()); - - } - - public void testddDepartmentToFirstCompany() throws Exception { - - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CompanyConfig.xml")); - Command read = commandGroup.getCommand("all companies and departments"); - DataObject root = read.executeQuery(); - DataObject firstCustomer = root.getDataObject("COMPANY[1]"); - int deptCount = firstCustomer.getList("departments").size(); - - DataObject newDepartment = root.createDataObject("DEPARTMENT"); - firstCustomer.getList("departments").add(newDepartment); - - ApplyChangesCommand apply = commandGroup.getApplyChangesCommand(); - apply.execute(root); - - //verify - root = read.executeQuery(); - firstCustomer = root.getDataObject("COMPANY[1]"); - assertEquals (deptCount + 1, firstCustomer.getList("departments").size()); - } - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CUDGeneration.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CUDGeneration.java deleted file mode 100644 index cfaed48db2..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CUDGeneration.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.data.OrderData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - -public class CUDGeneration extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CustomerData(getAutoConnection()).refresh(); - new OrderData(getAutoConnection()).refresh(); - } - - /** - * This tests provides invalid SQL and should fail on Apply.execute. If not - * then the engine is generating CUD and overlooking the provided - * statements. - */ - public void testCUDGeneration1() throws Exception { - - // Read customer with particular ID - Command select = Command.FACTORY - .createCommand("Select * from CUSTOMER where ID = 1"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - DataObject customer = (DataObject) root.get("CUSTOMER[1]"); - - // Modify customer - customer.set("LASTNAME", "Pavick"); - - // Build apply changes command - ApplyChangesCommand apply = Command.FACTORY - .createApplyChangesCommand(getConfig("basicCustomerMappingWithInvalidCUD.xml")); - apply.setConnection(getConnection()); - - // Flush changes - try { - apply.execute(root); - fail("Should fail with invalid SQL. Provided CUD not used!!"); - } catch (RuntimeException e) { - // Everything OK - } - - } - - public void testInsertCUDGeneration() throws Exception { - Command select = Command.FACTORY - .createCommand("Select * from CUSTOMER where ID = 1"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - DataObject customer = root.createDataObject("CUSTOMER"); - customer.setInt("ID", 720); - customer.set("LASTNAME", "foobar"); - customer.set("ADDRESS", "asdfasdf"); - - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.addPrimaryKey("CUSTOMER.ID"); - apply.setConnection(getConnection()); - apply.execute(root); - - select = Command.FACTORY - .createCommand("select * from CUSTOMER where ID = 720"); - select.setConnection(getConnection()); - root = select.executeQuery(); - - assertEquals(1, root.getList("CUSTOMER").size()); - } - - public void testReadModifyApply() throws Exception { - - // Build the select command to read a specific customer and related - // orders - Command select = Command.FACTORY - .createCommand( - "SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = :ID", - getConfig("1xM_mapping_no_cud.xml")); - - // Parameterize the command - select.setConnection(getConnection()); - select.setParameterValue("ID", new Integer(1)); - - // Get the graph - DataObject root = select.executeQuery(); - - // Modify a customer - DataObject customer = (DataObject) root.get("Customer[1]"); - customer.set("LASTNAME", "Pavick"); - - // Modify an order - DataObject order = (DataObject) customer.get("orders[1]"); - order.setString("PRODUCT", "Kitchen Sink 001"); - - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.setConnection(getConnection()); - apply.setMapping(getConfig("1xM_mapping_no_cud.xml")); - - // Flush changes - apply.execute(root); - - } - - /** - * Same as previous version but uses explicit model creation - */ - public void testReadModifyApply2() throws Exception { - - // Build the select command - Command select = Command.FACTORY - .createCommand("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = :ID"); - - // Set minimum metadata necessary to describe relationship - select.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - select.addPrimaryKey("CUSTOMER.ID"); - select.addPrimaryKey("ANORDER.ID"); - - // Parameterize the command - select.setConnection(getConnection()); - select.setParameterValue("ID", new Integer(1)); - - // Get the graph - DataObject root = select.executeQuery(); - - // Modify a customer - DataObject customer = (DataObject) root.get("CUSTOMER[1]"); - customer.set("LASTNAME", "Pavick"); - - // Modify an order - DataObject order = (DataObject) customer.getList("ANORDER").get(0); - order.setString("PRODUCT", "Kitchen Sink 001"); - - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.setConnection(getConnection()); - apply.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - apply.addPrimaryKey("CUSTOMER.ID"); - apply.addPrimaryKey("ANORDER.ID"); - // Flush changes - apply.execute(root); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CommandGroupTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CommandGroupTests.java deleted file mode 100644 index dcadd27d2f..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CommandGroupTests.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * This test - * - */ - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.CommandGroup; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.data.OrderData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - -/** - * - * This tests use of the XML Config file. Tests will utilize the - * customer-orders-orderdetails tables. The plan is for the config file to have - * a section that applies to all commands and another that applies to specific - * commands. - * - * The config file will be used to initialize a command factory that will then - * return named commands. - * - * There will be two read commands: - * - * 1) Return all customers 2) Return a specific customer (by ID) and related - * orders and order details - * - * A test will demonstrate the creation of the factory and then reuse of - * commands created from the same config data file - * - */ -public class CommandGroupTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CustomerData(getAutoConnection()).refresh(); - new OrderData(getAutoConnection()).refresh(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** - * Read - */ - public void testRead() throws Exception { - - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CustomersOrdersConfig.xml")); - commandGroup.setConnection(getConnection()); - - Command read = commandGroup.getCommand("all customers"); - DataObject root = read.executeQuery(); - - assertEquals(5, root.getList("CUSTOMER").size()); - - } - - /** - * Read an order using parm marker - */ - public void testReadWithParmmarker() throws Exception { - - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CustOrdersConnectionProps.xml")); - - Command read = commandGroup.getCommand("order by id with ?"); - read.setParameterValue(1, new Integer(1)); - DataObject root = read.executeQuery(); - - assertEquals("recombobulator", root.getString("ANORDER[1]/PRODUCT")); - - } - - /** - * Specify connection properties in config - */ - public void testReadWithConnectionProperties() throws Exception { - - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CustOrdersConnectionProps.xml")); - - Command read = commandGroup.getCommand("all customers"); - DataObject root = read.executeQuery(); - - assertEquals(5, root.getList("CUSTOMER").size()); - - } - - /** - * Specify connection properties in config. Add explicit update command - */ - public void testUpdate() throws Exception { - - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CustOrdersConnectionProps.xml")); - - Command read = commandGroup.getCommand("all customers"); - DataObject root = read.executeQuery(); - // Verify precondition - assertFalse(root.get("CUSTOMER[1]/LASTNAME").equals("Pavick")); - int id = root.getInt("CUSTOMER[1]/ID"); - - Command update = commandGroup.getCommand("update customer"); - update.setParameterValue("ID", new Integer(id)); - update.execute(); - - // Verify update - reuse select command - root = read.executeQuery(); - assertEquals("Pavick", root.get("CUSTOMER[1]/LASTNAME")); - - } - - /** - * Read all customers, select a specific customer. Then read that customer - * and related orders. Modify an order and flush changes back - */ - public void testRead2() throws Exception { - - // Create the group and set common connection - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CustomersOrdersConfig.xml")); - commandGroup.setConnection(getConnection()); - - // Read all customers and remember the first one - Command read = commandGroup.getCommand("all customers"); - DataObject root = read.executeQuery(); - Integer id = (Integer) root.get("CUSTOMER[1]/ID"); - - // Read the specific Customer from above and its related orders - Command custOrders = commandGroup.getCommand("customer and orders"); - custOrders.setParameterValue("ID", id); - root = custOrders.executeQuery(); - - // Modify the first order and flush this change back to the database - root.setString("CUSTOMER[1]/orders[1]/PRODUCT", "Defibrillator"); - Integer orderId = (Integer) root.get("CUSTOMER[1]/orders[1]/ID"); - ApplyChangesCommand flush = commandGroup.getApplyChangesCommand(); - flush.execute(root); - - // Verify - Command orderByID = commandGroup.getCommand("order by id"); - orderByID.setParameterValue("ID", orderId); - assertEquals("Defibrillator", root.getString("ANORDER[1]/PRODUCT")); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CompanyTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CompanyTests.java deleted file mode 100644 index 3abbbc1b4c..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CompanyTests.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.company.CompanyFactory; -import org.apache.tuscany.das.rdb.test.company.CompanyType; -import org.apache.tuscany.das.rdb.test.company.DatagraphRoot; -import org.apache.tuscany.das.rdb.test.company.DepartmentType; -import org.apache.tuscany.das.rdb.test.company.EmployeeType; -import org.apache.tuscany.das.rdb.test.data.CompanyData; -import org.apache.tuscany.das.rdb.test.data.CompanyDeptData; -import org.apache.tuscany.das.rdb.test.data.DepEmpData; -import org.apache.tuscany.das.rdb.test.data.DepartmentData; -import org.apache.tuscany.das.rdb.test.data.EmployeeData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.helper.TypeHelper; - -public class CompanyTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CompanyData(getAutoConnection()).refresh(); - new DepartmentData(getAutoConnection()).refresh(); - new EmployeeData(getAutoConnection()).refresh(); - new CompanyDeptData(getAutoConnection()).refresh(); - new DepEmpData(getAutoConnection()).refresh(); - - } - - public void testSimple() throws Exception { - - // Build the select command - Command selectCommand = Command.FACTORY.createCommand("select COMPANY.NAME, " - + "EMPLOYEE.NAME, EMPLOYEE.SN, EMPLOYEE.MANAGER, " - + "DEPARTMENT.NAME, DEPARTMENT.LOCATION, DEPARTMENT.NUMBER from COMPANY, DEPARTMENT, EMPLOYEE " - + "where COMPANY.ID=DEPARTMENT.COMPANYID and DEPARTMENT.ID=EMPLOYEE.DEPARTMENTID", getConfig("companyMapping.xml")); - - // Parameterize the command - selectCommand.setConnection(getConnection()); - - // Get the graph - DataObject root = selectCommand.executeQuery(); - - // Get a company - DataObject company = (DataObject) root.getList("CompanyType").get(0); - assertEquals("MegaCorp", company.get("NAME")); - - // Get a department - DataObject department = (DataObject) company.getList("departments").get(0); - assertEquals("Advanced Technologies", department.get("NAME")); - - DataObject employee = (DataObject) department.getList("employees").get(0); - assertEquals("John Jones", employee.get("NAME")); - } - - public void testSimpleStatic() throws Exception { - - SDOUtil.registerStaticTypes(CompanyFactory.class); - // Build the select command - Command selectCommand = Command.FACTORY.createCommand("select COMPANY.NAME, " - + "EMPLOYEE.NAME, EMPLOYEE.SN, EMPLOYEE.MANAGER, " - + "DEPARTMENT.NAME, DEPARTMENT.LOCATION, DEPARTMENT.NUMBER from COMPANY, DEPARTMENT, EMPLOYEE " - + "where COMPANY.ID=DEPARTMENT.COMPANYID and DEPARTMENT.ID=EMPLOYEE.DEPARTMENTID", getConfig("companyMapping.xml")); - - // Parameterize the command - selectCommand.setConnection(getConnection()); - selectCommand.setDataObjectModel(TypeHelper.INSTANCE.getType(DatagraphRoot.class)); - selectCommand.addConverter("DEPARTMENT.NUMBER", "org.apache.tuscany.das.rdb.test.mappings.StringToIntegerConverter"); - selectCommand.addConverter("EMPLOYEE.MANAGER", "org.apache.tuscany.das.rdb.test.mappings.IntegerToBooleanConverter"); - - // Get the graph - DatagraphRoot root = (DatagraphRoot) selectCommand.executeQuery(); - - - CompanyType company = (CompanyType) root.getCompanies().get(0); - - assertEquals("MegaCorp", company.getName()); - - // Get a department - DepartmentType department = (DepartmentType) company.getDepartments().get(0); - assertEquals("Advanced Technologies", department.getName()); - - EmployeeType employee = (EmployeeType) department.getEmployees().get(0); - - assertEquals("John Jones", employee.getName()); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CompoundKeyTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CompoundKeyTests.java deleted file mode 100644 index 80f08b2eed..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CompoundKeyTests.java +++ /dev/null @@ -1,113 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.Key; -import org.apache.tuscany.das.rdb.test.data.OrderDetailsData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - -/** - * Tests for Compound Keys - */ -public class CompoundKeyTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new OrderDetailsData(getAutoConnection()).refresh(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void testRead() throws Exception { - - Command getOrderDetails = Command.FACTORY - .createCommand("Select * from ORDERDETAILS where ORDERID = :ORDERID AND PRODUCTID = :PRODUCTID"); - getOrderDetails.setConnection(getConnection()); - - getOrderDetails.setParameterValue("ORDERID", new Integer(1)); - getOrderDetails.setParameterValue("PRODUCTID", new Integer(1)); - - DataObject root = getOrderDetails.executeQuery(); - - DataObject orderDetail = (DataObject) root.get("ORDERDETAILS[1]"); - assertEquals(1.1f, orderDetail.getFloat("PRICE"), 0.01); - - } - - public void testReadModifyWrite() throws Exception { - - Command getOrderDetails = Command.FACTORY - .createCommand("Select * from ORDERDETAILS where ORDERID = 1 AND PRODUCTID = 1"); - getOrderDetails.setConnection(getConnection()); - DataObject root = getOrderDetails.executeQuery(); - - DataObject orderDetails = (DataObject) root.get("ORDERDETAILS[1]"); - assertEquals(1.1f, orderDetails.getFloat("PRICE"), 0.01); - - // Modify - orderDetails.setFloat("PRICE", 0f); - - // Build apply changes command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.setConnection(getConnection()); - // programatically add the only part of the mapping model needed for - // this simple case - apply.addPrimaryKey(new Key(new String[] { "ORDERDETAILS.ORDERID", "ORDERDETAILS.PRODUCTID" })); - - // Write - apply.execute(root); - - // Verify - orderDetails = root.getDataObject("ORDERDETAILS[1]"); - assertEquals(0f, orderDetails.getFloat("PRICE"), 0.01); - - } - - public void testReadOrdersAndDetails() throws Exception { - - Command read = Command.FACTORY - .createCommand("SELECT * FROM ANORDER LEFT JOIN ORDERDETAILS ON ANORDER.ID = ORDERDETAILS.ORDERID ORDER BY ANORDER.ID"); - read.setConnection(getConnection()); - - Key pk = new Key("ANORDER.ID"); - read.addPrimaryKey(pk); - - - //TODO - When this is omitted, we fail with NPE. Need a better error message - Key detailsPk = new Key(new String[] { "ORDERDETAILS.ORDERID", "ORDERDETAILS.PRODUCTID" }); - read.addPrimaryKey(detailsPk); - - Key fk = new Key("ORDERDETAILS.ORDERID"); - - read.addRelationship(pk, fk); - - DataObject root = read.executeQuery(); - - DataObject firstOrder = root.getDataObject("ANORDER[1]"); - assertEquals(1, firstOrder.getInt("ID")); - assertEquals(2, firstOrder.getList("ORDERDETAILS").size()); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ConverterTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ConverterTests.java deleted file mode 100644 index f16ba34671..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ConverterTests.java +++ /dev/null @@ -1,118 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.ResultSetShape; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - - -import commonj.sdo.DataObject; -import commonj.sdo.Type; - -/** - * Tests the Converter framwork - */ -public class ConverterTests extends DasTest { - - - protected void setUp() throws Exception { - super.setUp(); - new CustomerData(getAutoConnection()).refresh(); - } - - - protected void tearDown() throws Exception { - super.tearDown(); - } - - private static DateFormat myformat = new SimpleDateFormat("yyyy.MM.dd"); - - private static Date kbday; - private static Date tbday; - - static { - try { - kbday = myformat.parse("1957.09.27"); - tbday = myformat.parse("1966.12.20"); - } catch (ParseException e) { - throw new RuntimeException(e); - } - } - - - - /** - * This tests the use of an arbitrary converter. The column converted is a VARCAHAR. - * ResultSetShape is used to specify that the property will be a SDODataTypes.DATE. - * - * So this example uses a converter that transforms a string column into a date property - * and conversely, a date property back to a string for the underlying column. - * - * The converter returns 1957.09.27 if the column value is "Williams" and 1966.12.20 - * if the value is "Pavick" - * - * On write, the converter returns "Pavick" if the property value is 1966.12.20 - * and "Williams" if the property value is 1957.09.27 - * - */ - public void testArbitraryConverter() throws Exception { - - //Create and initialize command to read customers - Command read = Command.FACTORY.createCommand("select * from CUSTOMER where ID = 1"); - read.setConnection(getConnection()); - - String[] columns = { "ID", "LASTNAME", "ADDRESS" }; - String[] tables = { "CUSTOMER", "CUSTOMER", "CUSTOMER" }; - Type[] types = { SDODataTypes.INTEGEROBJECT, SDODataTypes.DATE, SDODataTypes.STRING }; - ResultSetShape shape = new ResultSetShape(tables, columns, types); - read.setResultSetShape(shape); - - read.addConverter("CUSTOMER.LASTNAME", "org.apache.tuscany.das.rdb.test.mappings.SillyDateStringConverter"); - - //Read - DataObject root = read.executeQuery(); - - //Verify - assertEquals(kbday, root.getDate("CUSTOMER[1]/LASTNAME")); - - //Modify - root.setDate("CUSTOMER[1]/LASTNAME", tbday); - - ApplyChangesCommand write = Command.FACTORY.createApplyChangesCommand(); - write.addPrimaryKey("CUSTOMER.ID"); - write.setConnection(getConnection()); - write.addConverter("CUSTOMER.LASTNAME", "org.apache.tuscany.das.rdb.test.mappings.SillyDateStringConverter"); - write.execute(root); - - //Read - root = read.executeQuery(); - - //Verify - assertEquals(tbday, root.getDate("CUSTOMER[1]/LASTNAME")); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CorrectedDefectTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CorrectedDefectTests.java deleted file mode 100644 index d266daec7c..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CorrectedDefectTests.java +++ /dev/null @@ -1,258 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * These tests attempt to duplicate customer reported errors and then to verify - * any necessary fix. - * - */ - -import java.util.Iterator; -import java.util.Random; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.CommandGroup; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.test.data.CompanyData; -import org.apache.tuscany.das.rdb.test.data.CompanyDeptData; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.data.DepartmentData; -import org.apache.tuscany.das.rdb.test.data.OrderData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - -public class CorrectedDefectTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - new CustomerData(getAutoConnection()).refresh(); - new OrderData(getAutoConnection()).refresh(); - - new CompanyData(getAutoConnection()).refresh(); - new DepartmentData(getAutoConnection()).refresh(); - new CompanyDeptData(getAutoConnection()).refresh(); - - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** - * Dilton's bug for adding new child data object - */ - public void testAddNewOrder() throws Exception { - - // Read some customers and related orders - Command select = Command.FACTORY - .createCommand("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID"); - select.setConnection(getConnection()); - - // Set minimum metadata necessary to describe relationship - select.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - select.addPrimaryKey("CUSTOMER.ID"); - select.addPrimaryKey("ANORDER.ID"); - - DataObject root = select.executeQuery(); - - DataObject cust = root.getDataObject("CUSTOMER[1]"); - - // Save ID and Order Count - int custID = cust.getInt("ID"); - int custOrderCount = cust.getList("ANORDER").size(); -// int rootCount = root.getList("ANORDER").size(); - - // Create a new Order and add to customer1 - DataObject order = root.createDataObject("ANORDER"); - - order.set("ID", new Integer(99)); - order.set("PRODUCT", "The 99th product"); - order.set("QUANTITY", new Integer(99)); - cust.getList("ANORDER").add(order); - - assertEquals(custOrderCount + 1, cust.getList("ANORDER").size()); - // Build apply changes command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.setConnection(getConnection()); - - // Metadata - apply.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - apply.addPrimaryKey("CUSTOMER.ID"); - apply.addPrimaryKey("ANORDER.ID"); - - // Flush changes - apply.execute(root); - - // verify cust1 relationship updates - select = Command.FACTORY - .createCommand("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = :ID"); - select.setConnection(getConnection()); - select.setParameterValue("ID", new Integer(custID)); - - select.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - select.addPrimaryKey("CUSTOMER.ID"); - select.addPrimaryKey("ANORDER.ID"); - root = select.executeQuery(); - - assertEquals(custOrderCount + 1, root.getList("CUSTOMER[1]/ANORDER").size()); - - } - - public void testDiltonsInsertWorkaround() throws Exception { - - // String sql = "insert into conmgt.serverstatus (statusid, - // managedserverid, timestamp) values (316405209, 316405209, '2005-11-23 - // 19:29:52.636')"; - // String sql = "insert into conmgt.serverstatus (managedserverid, - // timestamp) values (316405209, '2005-11-23 19:29:52.636')"; - String sql = "insert into conmgt.serverstatus (managedserverid, timestamp) values (:serverid, :timestamp)"; - - Command insert = Command.FACTORY.createCommand(sql); - insert.setParameterValue("serverid", new Integer(316405209)); - insert.setParameterValue("timestamp", "2005-11-23 19:29:52.636"); - insert.setConnection(getConnection()); - insert.execute(); - - // Verify - Command select = Command.FACTORY.createCommand("Select * from conmgt.serverstatus"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("SERVERSTATUS").size()); - - } - - public void testWASDefect330118() throws Exception { - - // Create the group and set common connection - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CustomersOrdersConfig.xml")); - commandGroup.setConnection(getConnection()); - - // Read all customers and add one - Command read = commandGroup.getCommand("all customers"); - DataObject root = read.executeQuery(); - int numCustomers = root.getList("CUSTOMER").size(); - - DataObject newCust = root.createDataObject("CUSTOMER"); - newCust.set("ID", new Integer(100)); - newCust.set("ADDRESS", "5528 Wells Fargo Drive"); - newCust.set("LASTNAME", "Gerkin"); - - // Now delete this new customer - newCust.delete(); - - ApplyChangesCommand apply = commandGroup.getApplyChangesCommand(); - apply.execute(root); - - // Verify - root = read.executeQuery(); - assertEquals(numCustomers, root.getList("CUSTOMER").size()); - - } - - /** - * Should be able to explicitly set a parameter to null. But, should require - * that the parameter type is set. - */ - public void testDiltonsNullParameterBug1() throws Exception { - - Command insert = Command.FACTORY.createCommand("insert into CUSTOMER values (:ID, :LASTNAME, :ADDRESS)"); - insert.setConnection(getConnection()); - insert.setParameterValue("ID", new Integer(10)); - insert.setParameterValue("LASTNAME", null); - insert.setParameterType("LASTNAME", SDODataTypes.STRING); - insert.setParameterValue("ADDRESS", "5528 Wells Fargo Dr"); - insert.execute(); - - //Verify - Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 10"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("CUSTOMER").size()); - assertEquals("5528 Wells Fargo Dr", root.get("CUSTOMER[1]/ADDRESS")); - - } - - - /** - * Error by not setting a parameter - */ - public void testDiltonsNullParameterBug2() throws Exception { - - Command insert = Command.FACTORY.createCommand("insert into CUSTOMER values (:ID, :LASTNAME, :ADDRESS)"); - insert.setConnection(getConnection()); - insert.setParameterValue("ID", new Integer(10)); -// insert.setParameterValue("LASTNAME", null); - insert.setParameterValue("ADDRESS", "5528 Wells Fargo Dr"); - - try { - insert.execute(); - fail(); - } - catch (RuntimeException e) { - //Expected since "LASTNAME" parameter not set - } - } - - /** - * Set parameter to empty string - */ - public void testDiltonsNullParameterBug3() throws Exception { - - Command insert = Command.FACTORY.createCommand("insert into CUSTOMER values (:ID, :LASTNAME, :ADDRESS)"); - insert.setConnection(getConnection()); - insert.setParameterValue("ID", new Integer(10)); - insert.setParameterValue("LASTNAME", ""); - insert.setParameterValue("ADDRESS", "5528 Wells Fargo Dr"); - insert.execute(); - - //Verify - Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 10"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("CUSTOMER").size()); - assertEquals("5528 Wells Fargo Dr", root.get("CUSTOMER[1]/ADDRESS")); - - } - - public void testUpdateChildThatHasGeneratedKey() throws Exception { - - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CompanyConfig.xml")); - - //Read a specific company based on the known ID - Command readCust = commandGroup.getCommand("all companies and departments"); - DataObject root = readCust.executeQuery(); - DataObject lastCustomer = root.getDataObject("COMPANY[3]"); - Iterator i = lastCustomer.getList("departments").iterator(); - Random generator = new Random(); - int random = generator.nextInt(1000) + 1; - DataObject department; - while (i.hasNext()) { - department = (DataObject)i.next(); - System.out.println("Modifying department: " + department.getString("NAME")); - department.setString("NAME", "Dept-" + random); - random = random + 1; - } - - ApplyChangesCommand apply = commandGroup.getApplyChangesCommand(); - apply.execute(root); - - } - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CrudWithChangeHistory.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CrudWithChangeHistory.java deleted file mode 100644 index 387dab95b1..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CrudWithChangeHistory.java +++ /dev/null @@ -1,254 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * This provdes the simplest examples that make use of the change history. The assumptions are: - * - * Single type - * Change history utilized - * Dynamic DataObjects - * - * - */ - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - -public class CrudWithChangeHistory - extends DasTest -{ - - protected void setUp() - throws Exception - { - super.setUp(); - new CustomerData( getAutoConnection() ).refresh(); - } - - protected void tearDown() - throws Exception - { - super.tearDown(); - } - - /** - * Read and modify a customer. - * Provide needed Create/Update/Delete statements programatically - */ - public void testReadModifyApply() - throws Exception - { - - //Read customer 1 - Command select = Command.FACTORY.createCommand( "Select * from CUSTOMER where ID = 1" ); - select.setConnection( getConnection() ); - DataObject root = select.executeQuery(); - - DataObject customer = (DataObject) root.get( "CUSTOMER[1]" ); - - //Modify customer - customer.set( "LASTNAME", "Pavick" ); - - //Build apply changes command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.setConnection( getConnection() ); - - //Manually create and add update command - Command update = Command.FACTORY.createCommand( "update CUSTOMER set LASTNAME = :LASTNAME where ID = :ID" ); - update.addParameter( "LASTNAME", SDODataTypes.STRING ); - update.addParameter( "ID", SDODataTypes.INTEGER ); - apply.addUpdateCommand( customer.getType(), update ); - - //Flush changes - apply.execute( root ); - - //Verify changes - root = select.executeQuery(); - assertEquals( "Pavick", root.getString( "CUSTOMER[1]/LASTNAME" ) ); - - } - - /** - * Read and modify a customer. - * Provide needed Create/Update/Delete statements via xml file - */ - public void testReadModifyApply1() - throws Exception - { - - //Read customer 1 - Command select = Command.FACTORY.createCommand( "Select * from CUSTOMER where ID = 1" ); - select.setConnection( getConnection() ); - DataObject root = select.executeQuery(); - - DataObject customer = (DataObject) root.get( "CUSTOMER[1]" ); - - //Modify customer - customer.set( "LASTNAME", "Pavick" ); - - //Build apply changes command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("basicCustomerMappingWithCUD.xml")); - apply.setConnection( getConnection() ); - - //Flush changes - apply.execute( root ); - - //Verify changes - root = select.executeQuery(); - assertEquals( "Pavick", root.getString( "CUSTOMER[1]/LASTNAME" ) ); - - } - - /** - * Same as previous but: - * Utilizes generated CUD statements - * Key info provided programatically - */ - public void testReadModifyApply2() - throws Exception - { - - //Read customer with particular ID - Command select = Command.FACTORY.createCommand( "Select * from CUSTOMER where ID = 1" ); - select.setConnection( getConnection() ); - DataObject root = select.executeQuery(); - - DataObject customer = root.getDataObject( "CUSTOMER[1]" ); - - //Modify customer - customer.set( "LASTNAME", "Pavick" ); - - //Build apply changes command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.setConnection( getConnection() ); - //programatically add the only part of the mapping model needed for this simple case. - //The ID designation is needed to generate the CUD statements - apply.addPrimaryKey( "CUSTOMER.ID" ); - - //Flush changes - apply.execute( root ); - - //Verify the change - root = select.executeQuery(); - assertEquals( "Pavick", root.getDataObject( "CUSTOMER[1]" ).getString( "LASTNAME" ) ); - - } - - /** - * Builds on previous but: - * 1. Key info provided via XML file - */ - public void testReadModifyApply3() - throws Exception - { - - //Read customer with particular ID - Command select = Command.FACTORY.createCommand( "Select * from CUSTOMER where ID = 1" ); - select.setConnection( getConnection() ); - DataObject root = select.executeQuery(); - - DataObject customer = (DataObject) root.get( "CUSTOMER[1]" ); - - //Modify customer - customer.set( "LASTNAME", "Pavick" ); - - //Build apply changes command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("basicCustomerMapping.xml")); - apply.setConnection( getConnection() ); - - //Flush changes - apply.execute( root ); - - //Verify the change - root = select.executeQuery(); - assertEquals( "Pavick", root.getDataObject( "CUSTOMER[1]" ).getString( "LASTNAME" ) ); - - } - - /** - * Test ability to handle multiple changes to the graph including Creates/Updates/Deletes - * Employs generated CUD - */ - public void testReadModifyDeleteInsertApply() - throws Exception - { - - //Read some customers - Command select = Command.FACTORY.createCommand( "Select * from CUSTOMER where LASTNAME = 'Williams'" ); - select.setConnection( getConnection() ); - DataObject root = select.executeQuery(); - - DataObject cust1 = (DataObject) root.getList( "CUSTOMER" ).get( 0 ); - DataObject cust2 = (DataObject) root.getList( "CUSTOMER" ).get( 1 ); - DataObject cust3 = (DataObject) root.getList( "CUSTOMER" ).get( 2 ); - - //Modify a customer - cust1.set( "LASTNAME", "Pavick" ); - int cust1ID = cust1.getInt( "ID" ); - - //Save IDs before delete - int cust2ID = cust2.getInt( "ID" ); - int cust3ID = cust3.getInt( "ID" ); - //Delete a couple - cust2.delete(); - cust3.delete(); - - //Create a new customer - DataObject cust4 = root.createDataObject( "CUSTOMER" ); - cust4.set( "ID", new Integer( 100 ) ); - cust4.set( "ADDRESS", "5528 Wells Fargo Drive" ); - cust4.set( "LASTNAME", "Gerkin" ); - - //Build apply changes command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("basicCustomerMapping.xml")); - apply.setConnection( getConnection() ); - - //Flush changes - apply.execute( root ); - - //Verify deletes - select = Command.FACTORY.createCommand( "Select * from CUSTOMER where ID = :ID" ); - select.setConnection( getConnection() ); - select.setParameterValue( "ID", new Integer( cust2ID ) ); - root = select.executeQuery(); - assertTrue( root.getList( "CUSTOMER" ).isEmpty() ); - //reparameterize same command - select.setParameterValue( "ID", new Integer( cust3ID ) ); - root = select.executeQuery(); - assertTrue( root.getList( "CUSTOMER" ).isEmpty() ); - - //verify insert - select.setParameterValue( "ID", new Integer( 100 ) ); - root = select.executeQuery(); - assertEquals( 1, root.getList( "CUSTOMER" ).size() ); - assertEquals( "5528 Wells Fargo Drive", root.getString( "CUSTOMER[1]/ADDRESS" ) ); - assertEquals( "Gerkin", root.getString( "CUSTOMER[1]/LASTNAME" ) ); - - //verify update - select.setParameterValue( "ID", new Integer( cust1ID ) ); - root = select.executeQuery(); - assertEquals( "Pavick", root.getString( "CUSTOMER[1]/LASTNAME" ) ); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/DefectTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/DefectTests.java deleted file mode 100644 index 0835354c2f..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/DefectTests.java +++ /dev/null @@ -1,353 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * These tests attempt to duplicate customer reported errors and then to verify - * any necessary fix. - * - */ - -import java.util.Iterator; -import java.util.Random; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.CommandGroup; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.test.data.CompanyData; -import org.apache.tuscany.das.rdb.test.data.CompanyDeptData; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.data.DepEmpData; -import org.apache.tuscany.das.rdb.test.data.DepartmentData; -import org.apache.tuscany.das.rdb.test.data.EmployeeData; -import org.apache.tuscany.das.rdb.test.data.OrderData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - -public class DefectTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - new CustomerData(getAutoConnection()).refresh(); - new OrderData(getAutoConnection()).refresh(); - - new CompanyData(getAutoConnection()).refresh(); - new DepartmentData(getAutoConnection()).refresh(); - new EmployeeData(getAutoConnection()).refresh(); - new CompanyDeptData(getAutoConnection()).refresh(); - new DepEmpData(getAutoConnection()).refresh(); - - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** - * Read a specific customer - */ - public void testDiltonsInsert() throws Exception { - - // String sql = "insert into conmgt.serverstatus (statusid, - // managedserverid, timestamp) values (316405209, 316405209, '2005-11-23 - // 19:29:52.636')"; - String sql = "insert into conmgt.serverstatus (managedserverid, timestamp) values (316405209, '2005-11-23 19:29:52.636')"; - - Command insert = Command.FACTORY.createCommand(sql); - insert.setConnection(getConnection()); - insert.execute(); - - // Verify - Command select = Command.FACTORY - .createCommand("Select * from conmgt.serverstatus where statusid = 316405209"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("conmgt.serverstatus").size()); - - } - - /** - * Dilton's bug for adding new child data object - */ - public void testAddNewOrder() throws Exception { - - // Read some customers and related orders - Command select = Command.FACTORY - .createCommand("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID"); - select.setConnection(getConnection()); - - // Set minimum metadata necessary to describe relationship - select.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - select.addPrimaryKey("CUSTOMER.ID"); - select.addPrimaryKey("ANORDER.ID"); - - DataObject root = select.executeQuery(); - - DataObject cust = root.getDataObject("CUSTOMER[1]"); - - // Save ID and Order Count - int custID = cust.getInt("ID"); - int custOrderCount = cust.getList("ANORDER").size(); - int rootCount = root.getList("ANORDER").size(); - - // Create a new Order and add to customer1 - DataObject order = root.createDataObject("ANORDER"); - - order.set("ID", new Integer(99)); - order.set("PRODUCT", "The 99th product"); - order.set("QUANTITY", new Integer(99)); - cust.getList("ANORDER").add(order); - - assertEquals(custOrderCount + 1, cust.getList("ANORDER").size()); - // Build apply changes command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.setConnection(getConnection()); - - // Metadata - apply.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - apply.addPrimaryKey("CUSTOMER.ID"); - apply.addPrimaryKey("ANORDER.ID"); - - // Flush changes - apply.execute(root); - - // verify cust1 relationship updates - select = Command.FACTORY - .createCommand("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = :ID"); - select.setConnection(getConnection()); - select.setParameterValue("ID", new Integer(custID)); - - select.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - select.addPrimaryKey("CUSTOMER.ID"); - select.addPrimaryKey("ANORDER.ID"); - root = select.executeQuery(); - - assertEquals(custOrderCount + 1, root.getList("CUSTOMER[1]/ANORDER").size()); - - } - - public void testDiltonsInsertWorkaround() throws Exception { - - // String sql = "insert into conmgt.serverstatus (statusid, - // managedserverid, timestamp) values (316405209, 316405209, '2005-11-23 - // 19:29:52.636')"; - // String sql = "insert into conmgt.serverstatus (managedserverid, - // timestamp) values (316405209, '2005-11-23 19:29:52.636')"; - String sql = "insert into conmgt.serverstatus (managedserverid, timestamp) values (:serverid, :timestamp)"; - - Command insert = Command.FACTORY.createCommand(sql); - insert.setParameterValue("serverid", new Integer(316405209)); - insert.setParameterValue("timestamp", "2005-11-23 19:29:52.636"); - insert.setConnection(getConnection()); - insert.execute(); - - // Verify - Command select = Command.FACTORY.createCommand("Select * from conmgt.serverstatus"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("SERVERSTATUS").size()); - - } - - public void testWASDefect330118() throws Exception { - - // Create the group and set common connection - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CustomersOrdersConfig.xml")); - commandGroup.setConnection(getConnection()); - - // Read all customers and add one - Command read = commandGroup.getCommand("all customers"); - DataObject root = read.executeQuery(); - int numCustomers = root.getList("CUSTOMER").size(); - - DataObject newCust = root.createDataObject("CUSTOMER"); - newCust.set("ID", new Integer(100)); - newCust.set("ADDRESS", "5528 Wells Fargo Drive"); - newCust.set("LASTNAME", "Gerkin"); - - // Now delete this new customer - newCust.delete(); - - ApplyChangesCommand apply = commandGroup.getApplyChangesCommand(); - apply.execute(root); - - // Verify - root = read.executeQuery(); - assertEquals(numCustomers, root.getList("CUSTOMER").size()); - - } - - /** - * Yin Chen reports ... "In the class Statement, method: public int - * executeUpdate(Parameters parameters) - its tossing out RuntimeException - * when the value of the parameter is null. " - * - * His example build a update statement and sets one parameter value to be - * null. I will try to duplicate with an insert since that is simpler - * - */ - public void testYingChen12162005() throws Exception { - - Command insert = Command.FACTORY - .createCommand("insert into CUSTOMER values (:ID, :LASTNAME, :ADDRESS)"); - insert.setConnection(getConnection()); - insert.setParameterValue("ID", new Integer(10)); - insert.setParameterValue("LASTNAME", "Williams"); - insert.setParameterValue("ADDRESS", null); - insert.execute(); - - // Verify - Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 10"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("CUSTOMER").size()); - assertEquals("5528 Wells Fargo Dr", root.get("CUSTOMER[1]/ADDRESS")); - - } - - /** - * Try a workaround using CommandGroup - */ - public void testYingChen12162005Workaraound() throws Exception { - - // Create the group and set common connection - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CustomerConfig.xml")); - commandGroup.setConnection(getConnection()); - - Command insert = commandGroup.getCommand("insert customer"); - insert.setParameterValue("ID", new Integer(10)); - insert.setParameterValue("LASTNAME", "Williams"); - insert.setParameterValue("ADDRESS", null); - insert.execute(); - - // Verify - Command select = commandGroup.getCommand("read customer 10"); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("CUSTOMER").size()); - assertEquals("5528 Wells Fargo Dr", root.get("CUSTOMER[1]/ADDRESS")); - - } - - - - - /** - * Should be able to explicitly set a parameter to null. But, should require - * that the parameter type is set. - */ - public void testDiltonsNullParameterBug1() throws Exception { - - Command insert = Command.FACTORY.createCommand("insert into CUSTOMER values (:ID, :LASTNAME, :ADDRESS)"); - insert.setConnection(getConnection()); - insert.setParameterValue("ID", new Integer(10)); - insert.setParameterValue("LASTNAME", null); - insert.setParameterType("LASTNAME", SDODataTypes.STRING); - insert.setParameterValue("ADDRESS", "5528 Wells Fargo Dr"); - insert.execute(); - - //Verify - Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 10"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("CUSTOMER").size()); - assertEquals("5528 Wells Fargo Dr", root.get("CUSTOMER[1]/ADDRESS")); - - } - - - /** - * Error by not setting a parameter - */ - public void testDiltonsNullParameterBug2() throws Exception { - - Command insert = Command.FACTORY.createCommand("insert into CUSTOMER values (:ID, :LASTNAME, :ADDRESS)"); - insert.setConnection(getConnection()); - insert.setParameterValue("ID", new Integer(10)); -// insert.setParameterValue("LASTNAME", null); - insert.setParameterValue("ADDRESS", "5528 Wells Fargo Dr"); - - try { - insert.execute(); - fail(); - } - catch (RuntimeException e) { - //Expected since "LASTNAME" parameter not set - } - } - - /** - * Set parameter to empty string - */ - public void testDiltonsNullParameterBug3() throws Exception { - - Command insert = Command.FACTORY.createCommand("insert into CUSTOMER values (:ID, :LASTNAME, :ADDRESS)"); - insert.setConnection(getConnection()); - insert.setParameterValue("ID", new Integer(10)); - insert.setParameterValue("LASTNAME", ""); - insert.setParameterValue("ADDRESS", "5528 Wells Fargo Dr"); - insert.execute(); - - //Verify - Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 10"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertEquals(1, root.getList("CUSTOMER").size()); - assertEquals("5528 Wells Fargo Dr", root.get("CUSTOMER[1]/ADDRESS")); - - } - - public void testUpdateChildThatHasGeneratedKey() throws Exception { - - CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CompanyConfig.xml")); - - //Read a specific company based on the known ID - Command readCust = commandGroup.getCommand("all companies and departments"); - DataObject root = readCust.executeQuery(); - DataObject lastCustomer = root.getDataObject("COMPANY[3]"); - Iterator i = lastCustomer.getList("departments").iterator(); - Random generator = new Random(); - int random = generator.nextInt(1000) + 1; - DataObject department; - while (i.hasNext()) { - department = (DataObject)i.next(); - System.out.println("Modifying department: " + department.getString("NAME")); - department.setString("NAME", "Dept-" + random); - random = random + 1; - } - - ApplyChangesCommand apply = commandGroup.getApplyChangesCommand(); - apply.execute(root); - - } - - - - /** - * Test problem with Random - */ - public void testRandomNumber() throws Exception { - - Random generator = new Random(); - int number = generator.nextInt(1000) + 1; - assertTrue(number > 0 & number <= 1000); - - } - - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ExceptionTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ExceptionTests.java deleted file mode 100644 index 2fa60ec576..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ExceptionTests.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.company.CompanyFactory; -import org.apache.tuscany.das.rdb.test.customer.DataGraphRoot; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.data.OrderData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.helper.TypeHelper; - -public class ExceptionTests extends DasTest { - - public ExceptionTests() { - super(); - } - - protected void setUp() throws Exception { - super.setUp(); - - new CustomerData(getAutoConnection()).refresh(); - new OrderData(getAutoConnection()).refresh(); - - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void testMissingConnection() throws Exception { - Command readCustomers = Command.FACTORY - .createCommand("select * from CUSTOMER where ID = 1"); - try { - readCustomers.executeQuery(); - fail("RuntimeException should be thrown"); - } catch ( RuntimeException ex) { - assertEquals("A DASConnection object must be specified before executing the query.", ex.getMessage()); - } - - } - public void testMissingMapping() throws Exception { - Command readCustomers = Command.FACTORY - .createCommand("select * from CUSTOMER where ID = 1"); - readCustomers.setConnection(getConnection()); - SDOUtil.registerStaticTypes(CompanyFactory.class); - readCustomers.setDataObjectModel(TypeHelper.INSTANCE.getType(DataGraphRoot.class)); - - try { - readCustomers.executeQuery(); - fail("Exception should be thrown"); - } catch (RuntimeException ex) { - assertEquals("An SDO Type with name CUSTOMER was not found", ex - .getMessage()); - } - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GeneratedCommandTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GeneratedCommandTests.java deleted file mode 100644 index 3cc6b823c0..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GeneratedCommandTests.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -import java.util.List; - -import org.apache.tuscany.das.rdb.test.commands.ReadCustomersByLastnameCommand; -import org.apache.tuscany.das.rdb.test.commands.ReadCustomersCommand; -import org.apache.tuscany.das.rdb.test.commands.ReadCustomersStaticTypesCommand; -import org.apache.tuscany.das.rdb.test.commands.ReadCustomersWithShapeCommand; -import org.apache.tuscany.das.rdb.test.commands.SimpleReadCustomersWithShapeCommand; -import org.apache.tuscany.das.rdb.test.customer.Customer; -import org.apache.tuscany.das.rdb.test.customer.DataGraphRoot; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - -public class GeneratedCommandTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CustomerData(getAutoConnection()).refresh(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void testReadCustomers() throws Exception { - ReadCustomersCommand cmd = new ReadCustomersCommand(); - cmd.setConnection(getConnection()); - - DataObject root = cmd.executeQuery(); - assertEquals(5, root.getList("CUSTOMER").size()); - } - - public void testReadSomeCustomers() throws Exception { - ReadCustomersByLastnameCommand cmd = new ReadCustomersByLastnameCommand(); - cmd.setConnection(getConnection()); - cmd.setParameterValue("LASTNAME", "Williams"); - - DataObject root = cmd.executeQuery(); - assertEquals(4, root.getList("CUSTOMER").size()); - - } - - public void testReadCustomersStaticTypes() throws Exception { - ReadCustomersStaticTypesCommand cmd = new ReadCustomersStaticTypesCommand(); - cmd.setConnection(getConnection()); - cmd.setParameterValue("LASTNAME", "Williams"); - - DataGraphRoot root = (DataGraphRoot) cmd.executeQuery(); - - List customers = root.getCustomers(); - assertEquals(4, customers.size()); - - Customer cust1 = (Customer) customers.get(0); - assertEquals("Williams", cust1.getLastName()); - - } - - public void testSimpleReadCustomersWithShape() throws Exception { - SimpleReadCustomersWithShapeCommand cmd = new SimpleReadCustomersWithShapeCommand(); - cmd.setConnection(getConnection()); - DataObject root = cmd.executeQuery(); - assertEquals(5, root.getList("CUSTOMER").size()); - } - - public void testReadCustomersOrdersWithShape() throws Exception { - ReadCustomersWithShapeCommand cmd = new ReadCustomersWithShapeCommand(); - cmd.setConnection(getConnection()); - - DataObject root = cmd.executeQuery(); - assertEquals(5, root.getList("CUSTOMER").size()); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GeneratedId.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GeneratedId.java deleted file mode 100644 index 2fd91930c9..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GeneratedId.java +++ /dev/null @@ -1,305 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * Generated IDs - * - * - */ - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.data.CompanyData; -import org.apache.tuscany.das.rdb.test.data.DepartmentData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - -public class GeneratedId extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CompanyData(getAutoConnection()).refresh(); - new DepartmentData(getAutoConnection()).refresh(); - - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - // Test insert into row with generated ID - public void testInsert() throws Exception { - - Command insert = Command.FACTORY - .createCommand("insert into COMPANY (NAME) values (:NAME)"); - insert.setConnection(getConnection()); - insert.setParameterValue("NAME", "AAA Rental"); - insert.execute(); - - // Verify insert - // Verify - Command select = Command.FACTORY - .createCommand("Select ID, NAME from COMPANY"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - assertEquals(4, root.getList("COMPANY").size()); - assertTrue(root.getInt("COMPANY[1]/ID") > 0); - - } - - // Test back to back insertions with the same command - public void testInsert2() throws Exception { - - Command insert = Command.FACTORY - .createCommand("insert into COMPANY (NAME) values (:NAME)"); - insert.setConnection(getConnection()); - insert.setParameterValue("NAME", "AAA Rental"); - insert.execute(); - - // insert another using same command - insert.setParameterValue("NAME", "BBB Rental"); - insert.execute(); - - // Verify insert - // Verify - Command select = Command.FACTORY - .createCommand("Select ID, NAME from COMPANY"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - assertEquals(5, root.getList("COMPANY").size()); - - } - - // Test ability to retrieve and utilize the generated key - public void testInsert3() throws Exception { - - Command insert = Command.FACTORY - .createCommand("insert into COMPANY (NAME) values (:NAME)"); - insert.setConnection(getConnection()); - insert.setParameterValue("NAME", "AAA Rental"); - insert.execute(); - Integer key = (Integer) insert.getParameterValue("generated_key"); - - // Verify insert - Command select = Command.FACTORY - .createCommand("Select ID, NAME from COMPANY where ID = :ID"); - select.setConnection(getConnection()); - select.setParameterValue("ID", key); - DataObject root = select.executeQuery(); - assertEquals(key, root.get("COMPANY[1]/ID")); - - } - - // Test ability to propogate generated values back to owning data objects - public void testPropagateIds() throws Exception { - - Command select = Command.FACTORY.createCommand("Select * from COMPANY"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - // Create a new Company - DataObject company = root.createDataObject("COMPANY"); - company.setString("NAME", "Do-rite Pest Control"); - - // Create apply command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.setConnection(getConnection()); - - // Programatically set minimum metadata necessary - apply.addGeneratedPrimaryKey("COMPANY.ID"); - - // verify pre-condition (id is not there until after flush) - assertNull(company.get("ID")); - - // Flush changes - apply.execute(root); - - // Save the id - Integer id = (Integer) company.get("ID"); - - // Verify the change - select = Command.FACTORY - .createCommand("Select * from COMPANY where ID = :ID"); - select.setConnection(getConnection()); - select.setParameterValue("ID", id); - root = select.executeQuery(); - assertEquals("Do-rite Pest Control", root.getDataObject("COMPANY[1]") - .getString("NAME")); - - } - - /** - * Same as above but metadata provided by XML config file - */ - public void testPropagateIdsXML() throws Exception { - - Command select = Command.FACTORY.createCommand("Select * from COMPANY", getConfig("basicCompanyMapping.xml")); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - // Create a new Company - DataObject company = root.createDataObject("COMPANY"); - company.setString("NAME", "Do-rite Pest Control"); - - // Create apply command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("basicCompanyMapping.xml")); - apply.setConnection(getConnection()); - - // verify pre-condition (id is not there until after flush) - assertNull(company.get("ID")); - - // Flush changes - apply.execute(root); - - // Save the id - Integer id = (Integer) company.get("ID"); - - // Verify the change - select = Command.FACTORY - .createCommand("Select * from COMPANY where ID = :ID"); - select.setConnection(getConnection()); - select.setParameterValue("ID", id); - root = select.executeQuery(); - assertEquals("Do-rite Pest Control", root.getDataObject("COMPANY[1]") - .getString("NAME")); - - } - - /** - * Test ability to correctly flush heirarchy of objects that have generated - * keys - */ - public void testFlushCreateHeirarchy() throws Exception { - - String selectCompanys = "SELECT * FROM COMPANY LEFT JOIN DEPARTMENT ON COMPANY.ID = DEPARTMENT.COMPANYID"; - - Command select = Command.FACTORY.createCommand(selectCompanys, getConfig("basicCompanyDepartmentMapping.xml")); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - // Create a new Company - DataObject company = root.createDataObject("COMPANY"); - company.setString("NAME", "Do-rite Pest Control"); - - // Create a new Department - //Do not set ID or CompanyID since these are generated - //ID INT, NAME VARCHAR(30), LOCATION VARCHAR(30), NUMBER VARCHAR(10), COMPANYID INT, EOTM INT - DataObject department = root.createDataObject("DEPARTMENT"); - department.setString("NAME", "Do-rite Pest Control"); - department.setString("LOCATION", "The boonies"); - department.setString("NUMBER", "101"); - department.setInt("EOTM", 1); - - - // Associate the new department with the new company - company.getList("departments").add(department); - - // Create apply command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("basicCompanyDepartmentMapping.xml")); - apply.setConnection(getConnection()); - - // Flush changes - apply.execute(root); - - // Save the id - Integer id = (Integer) company.get("ID"); - - // Verify the change - String selectString = "SELECT * FROM COMPANY LEFT JOIN DEPARTMENT ON COMPANY.ID = DEPARTMENT.COMPANYID WHERE COMPANY.ID = :ID"; - - select = Command.FACTORY.createCommand(selectString); - select.setConnection(getConnection()); - select.setParameterValue("ID", id); - root = select.executeQuery(); - assertEquals("Do-rite Pest Control", root.getDataObject("COMPANY[1]") - .getString("NAME")); - - } - - /** - * Test ability to correctly flush heirarchy of objects that have generated - * keys even when a created object has legal but NULL property values - */ - public void testFlushCreateHeirarchy2() throws Exception { - - String selectCompanys = "SELECT * FROM COMPANY LEFT JOIN DEPARTMENT ON COMPANY.ID = DEPARTMENT.COMPANYID"; - - Command select = Command.FACTORY.createCommand(selectCompanys, getConfig("basicCompanyDepartmentMapping.xml")); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - // Create a new Company - DataObject company = root.createDataObject("COMPANY"); - company.setString("NAME", "Do-rite Pest Control"); - - // Create a new Department - //Do not set ID or CompanyID since these are generated - //ID INT, NAME VARCHAR(30), LOCATION VARCHAR(30), NUMBER VARCHAR(10), COMPANYID INT, EOTM INT - DataObject department = root.createDataObject("DEPARTMENT"); - department.setString("NAME", "Do-rite Pest Control"); - //Do not set this property to force storing NULL to DB -// department.setString("LOCATION", "The boonies"); - department.setString("NUMBER", "101"); - department.setInt("EOTM", 1); - - - // Associate the new department with the new company - company.getList("departments").add(department); - - // Create apply command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("basicCompanyDepartmentMapping.xml")); - apply.setConnection(getConnection()); - - // Flush changes - apply.execute(root); - - // Save the id - Integer id = (Integer) company.get("ID"); - - // Verify the change - String selectString = "SELECT * FROM COMPANY LEFT JOIN DEPARTMENT ON COMPANY.ID = DEPARTMENT.COMPANYID WHERE COMPANY.ID = :ID"; - - select = Command.FACTORY.createCommand(selectString); - select.setConnection(getConnection()); - select.setParameterValue("ID", id); - root = select.executeQuery(); - assertEquals("Do-rite Pest Control", root.getDataObject("COMPANY[1]").getString("NAME")); - - } - - - // Test that error is thrown when no key has been generated (as in a select) - public void testRead() throws Exception { - - Command select = Command.FACTORY.createCommand("Select * from COMPANY"); - select.setConnection(getConnection()); - select.executeQuery(); - - try { - select.getParameterValue("generated_id"); - fail("Should throw Error"); - } catch (RuntimeException e) { - // OK - } - } - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GraphMergeTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GraphMergeTests.java deleted file mode 100644 index 35b06cc30e..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/GraphMergeTests.java +++ /dev/null @@ -1,163 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -import java.util.ArrayList; - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.merge.impl.GraphMerger; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.data.OrderData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - - -import commonj.sdo.DataObject; - -public class GraphMergeTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CustomerData(getAutoConnection()).refresh(); - new OrderData(getAutoConnection()).refresh(); - - } - - - public void testSingleTableMerge() throws Exception { - - Command select = Command.FACTORY - .createCommand("Select ID, LASTNAME, ADDRESS from CUSTOMER where ID <= :ID"); - select.setConnection(getConnection()); - select.setParameterValue("ID", "3"); - DataObject graph1 = select.executeQuery(); - assertEquals(3, graph1.getList("CUSTOMER").size()); - - select.setParameterValue("ID", "5"); - DataObject graph2 = select.executeQuery(); - assertEquals(5, graph2.getList("CUSTOMER").size()); - - GraphMerger merger = new GraphMerger(); - merger.addPrimaryKey("CUSTOMER.ID"); - DataObject mergedGraph = merger.merge(graph1, graph2); - - assertEquals(5, mergedGraph.getList("CUSTOMER").size()); - } - - public void testSingleTableMergeThreeGraphs() throws Exception { - - Command select = Command.FACTORY - .createCommand("Select ID, LASTNAME, ADDRESS from CUSTOMER where ID <= :ID"); - select.setConnection(getConnection()); - select.setParameterValue("ID", "3"); - DataObject graph1 = select.executeQuery(); - assertEquals(3, graph1.getList("CUSTOMER").size()); - - select.setParameterValue("ID", "4"); - DataObject graph2 = select.executeQuery(); - assertEquals(4, graph2.getList("CUSTOMER").size()); - - select.setParameterValue("ID", "5"); - DataObject graph3 = select.executeQuery(); - assertEquals(5, graph3.getList("CUSTOMER").size()); - - GraphMerger merger = new GraphMerger(); - merger.addPrimaryKey("CUSTOMER.ID"); - ArrayList graphs = new ArrayList(); - graphs.add(graph1); - graphs.add(graph2); - graphs.add(graph3); - DataObject mergedGraph = merger.merge(graphs); - - assertEquals(5, mergedGraph.getList("CUSTOMER").size()); - - } - - public void testMultiTableMerge() throws Exception { - //Read some customers and related orders - Command select = Command.FACTORY.createCommand( - "SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = :ID "); - select.setConnection(getConnection()); - - //Set minimum metadata necessary to describe relationship - select.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - select.addPrimaryKey("CUSTOMER.ID"); - select.addPrimaryKey("ANORDER.ID"); - - select.setConnection(getConnection()); - select.setParameterValue("ID", new Integer(1)); - DataObject graph1 = select.executeQuery(); - - DataObject customer = (DataObject)graph1.getList("CUSTOMER").get(0); - assertEquals(2, customer.getList("ANORDER").size()); - - select.setParameterValue("ID", new Integer(2)); - DataObject graph2 = select.executeQuery(); - DataObject customer2 = (DataObject)graph2.getList("CUSTOMER").get(0); - assertEquals(1, graph2.getList("CUSTOMER").size()); - assertEquals(1, customer2.getList("ANORDER").size()); - assertEquals(2, customer2.getInt("ID")); - - GraphMerger merger = new GraphMerger(); - merger.addPrimaryKey("CUSTOMER.ID"); - merger.addPrimaryKey("ANORDER.ID"); - DataObject mergedGraph = merger.merge(graph1, graph2); - - assertEquals(3, mergedGraph.getList("ANORDER").size()); - assertEquals(2, mergedGraph.getList("CUSTOMER").size()); - - DataObject mergedCustomer = (DataObject) mergedGraph.getList("CUSTOMER").get(1); - assertEquals(2, mergedCustomer.getInt("ID")); - assertEquals(1, mergedCustomer.getList("ANORDER").size()); - DataObject mergedOrder = (DataObject) mergedCustomer.getList("ANORDER").get(0); - assertEquals(4, mergedOrder.getInt("ID")); - - - } - - public void testMultiTableAppendSingleTable() throws Exception { - //Read some customers and related orders - Command select = Command.FACTORY.createCommand( - "SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = :ID "); - select.setConnection(getConnection()); - - //Set minimum metadata necessary to describe relationship - select.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - select.addPrimaryKey("CUSTOMER.ID"); - select.addPrimaryKey("ANORDER.ID"); - - select.setConnection(getConnection()); - select.setParameterValue("ID", new Integer(1)); - DataObject graph1 = select.executeQuery(); - - DataObject customer = (DataObject)graph1.getList("CUSTOMER").get(0); - assertEquals(2, customer.getList("ANORDER").size()); - - Command select2 = Command.FACTORY.createCommand("select * from ANORDER"); - select2.setConnection(getConnection()); - DataObject graph2 = select2.executeQuery(); - assertEquals(4, graph2.getList("ANORDER").size()); - - GraphMerger merger = new GraphMerger(); - merger.addPrimaryKey("CUSTOMER.ID"); - merger.addPrimaryKey("ANORDER.ID"); - DataObject mergedGraph = merger.merge(graph1, graph2); - assertEquals(4, mergedGraph.getList("ANORDER").size()); - assertEquals(1, mergedGraph.getList("CUSTOMER").size()); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/NameMappingTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/NameMappingTests.java deleted file mode 100644 index 7b127e5768..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/NameMappingTests.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * - * - */ - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.data.OrderData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - - -public class NameMappingTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CustomerData(getAutoConnection()).refresh(); - new OrderData(getAutoConnection()).refresh(); - - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** - * Test ability to assign DataObject type and propertyaliases with xml file - */ - public void testRead() throws Exception { - - // Read a customer - Command select = Command.FACTORY.createCommand( - "SELECT * FROM CUSTOMER WHERE CUSTOMER.ID = 1", getConfig("customerMapping.xml")); - select.setConnection(getConnection()); - - DataObject root = select.executeQuery(); - DataObject customer = root.getDataObject("Customer[1]"); - assertEquals(1, customer.getInt("id")); - assertEquals("1212 foobar lane", customer.getString("address")); - assertEquals("Williams", customer.getString("lastname")); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/OCCTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/OCCTests.java deleted file mode 100644 index 09cf23e018..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/OCCTests.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.data.BookData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - - -import commonj.sdo.DataObject; - -public class OCCTests extends DasTest { - protected void setUp() throws Exception { - super.setUp(); - - new BookData(getAutoConnection()).refresh(); - } - - - public void testSimpleOCC() throws Exception { - - //Read a book instance - Command select = Command.FACTORY.createCommand("SELECT * FROM BOOK WHERE ID = 1"); - select.setConnection(getConnection()); - select.addPrimaryKey("BOOK.ID"); - DataObject root = select.executeQuery(); - DataObject book = root.getDataObject("BOOK[1]"); - //Change a field to mark the instance 'dirty' - book.setInt("QUANTITY", 2); - - // Explicitly change OCC column in database to force collision - Command update = Command.FACTORY - .createCommand("update BOOK set OCC = :OCC where ID = 1"); - update.setConnection(getConnection()); - update.setParameterValue("OCC", new Integer(100)); - update.execute(); - - //Try to flush the change - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.setConnection(getConnection()); - apply.addPrimaryKey("BOOK.ID"); - apply.addCollisionColumn("BOOK.OCC"); - - try { - apply.execute(root); - fail("An OCCException should be thrown"); - } catch (RuntimeException ex) { - if ( !ex.getMessage().equals("OCC Exception") ) - throw ex; - } - - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/OperationOrderingTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/OperationOrderingTests.java deleted file mode 100644 index 1207c769e5..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/OperationOrderingTests.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.data.CityData; -import org.apache.tuscany.das.rdb.test.data.StateData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - -public class OperationOrderingTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - CityData city = new CityData(getAutoConnection()); - StateData state = new StateData(getAutoConnection()); - - city.doDeletes(); - state.doDeletes(); - state.doInserts(); - city.doInserts(); - - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public OperationOrderingTests() { - super(); - } - - public void testInsert() throws Exception { - Command select = Command.FACTORY - .createCommand( - "Select * from STATES inner join CITIES on STATES.ID = CITIES.STATE_ID", - getConfig("cityStates.xml")); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - int numberOfStates = root.getList("STATES").size(); - int numberOfCities = root.getList("CITIES").size(); - - DataObject atlanta = root.createDataObject("CITIES"); - atlanta.setString("NAME", "Atlanta"); - atlanta.setInt("ID", 6); - - // Create a new Company - DataObject georgia = root.createDataObject("STATES"); - georgia.setInt("ID", 4); - georgia.setString("NAME", "GA"); - - georgia.getList("cities").add(atlanta); - - // Create apply command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("cityStates.xml")); - apply.setConnection(getConnection()); - - // Flush changes - apply.execute(root); - - select.setConnection(getConnection()); - root = select.executeQuery(); - assertEquals(numberOfCities + 1, root.getList("CITIES").size()); - assertEquals(numberOfStates + 1, root.getList("STATES").size()); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/Paging.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/Paging.java deleted file mode 100644 index 250e7673d7..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/Paging.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - - -import java.sql.SQLException; - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.Pager; -import org.apache.tuscany.das.rdb.impl.PagerImpl; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - - -import commonj.sdo.DataObject; - - - -public class Paging extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - new CustomerData(getAutoConnection()).refresh(); - } - - public void testPaging() throws SQLException { - - //Build command to read all customers - Command custCommand = Command.FACTORY.createCommand("select * from CUSTOMER order by ID"); - custCommand.setConnection(getConnection()); - - //Create a pager with the command - Pager pager = new PagerImpl(custCommand, 2); - - //Get and work with first page - DataObject root = pager.next(); - DataObject customer1 = root.getDataObject("CUSTOMER[1]"); - DataObject customer2 = root.getDataObject("CUSTOMER[2]"); - assertEquals(1, customer1.getInt("ID")); - assertEquals(2, customer2.getInt("ID")); - - //Get and work with the second page - root = pager.next(); - customer1 = root.getDataObject("CUSTOMER[1]"); - customer2 = root.getDataObject("CUSTOMER[2]"); - assertEquals(3, customer1.getInt("ID")); - assertEquals(4, customer2.getInt("ID")); - - // First page again - root = pager.previous(); - customer1 = root.getDataObject("CUSTOMER[1]"); - customer2 = root.getDataObject("CUSTOMER[2]"); - assertEquals(1, customer1.getInt("ID")); - assertEquals(2, customer2.getInt("ID")); - - } - - - public void testRandomPage() throws SQLException { - //Build the select command - Command select = Command.FACTORY - .createCommand("select * from CUSTOMER order by ID"); - - //Parameterize the command - select.setConnection(getConnection()); - - //Create a pager - Pager pager = new PagerImpl(select, 2); - - //Get the first page - DataObject root = pager.getPage(1); - DataObject customer1 = root.getDataObject("CUSTOMER[1]"); - DataObject customer2 = root.getDataObject("CUSTOMER[2]"); - assertEquals(1, customer1.getInt("ID")); - assertEquals(2, customer2.getInt("ID")); - - //Get the second page - root = pager.getPage(2); - customer1 = root.getDataObject("CUSTOMER[1]"); - customer2 = root.getDataObject("CUSTOMER[2]"); - assertEquals(3, customer1.getInt("ID")); - assertEquals(4, customer2.getInt("ID")); - - - // Get the first page again - root = pager.getPage(1); - customer1 = root.getDataObject("CUSTOMER[1]"); - customer2 = root.getDataObject("CUSTOMER[2]"); - assertEquals(1, customer1.getInt("ID")); - assertEquals(2, customer2.getInt("ID")); - } - - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/PartialUpdateTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/PartialUpdateTests.java deleted file mode 100644 index 67af74f8a2..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/PartialUpdateTests.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -import java.sql.SQLException; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - - -import commonj.sdo.DataObject; - -public class PartialUpdateTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - new CustomerData(getAutoConnection()).refresh(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public PartialUpdateTests() { - super(); - } - - public void testPartialUpdate() throws SQLException { - Command readCustomers = Command.FACTORY - .createCommand("select * from CUSTOMER where ID = 1"); - readCustomers.setConnection(getConnection()); - - // Read - DataObject root = readCustomers.executeQuery(); - - DataObject customer = root.getDataObject("CUSTOMER[1]"); - // Verify - assertEquals(1, customer.getInt("ID")); - - Command update = Command.FACTORY - .createCommand("update CUSTOMER set LASTNAME = 'modified' where ID = 1"); - update.setConnection(getConnection()); - update.execute(); - - customer.setString("ADDRESS", "main street"); - - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.addPrimaryKey("CUSTOMER.ID"); - apply.setConnection(getConnection()); - apply.execute(root); - - root = readCustomers.executeQuery(); - - // If partial update was not used, LASTNAME would not be 'modified' - customer = root.getDataObject("CUSTOMER[1]"); - assertEquals(1, customer.getInt("ID")); - assertEquals("modified", customer.getString("LASTNAME")); - assertEquals("main street", customer.getString("ADDRESS")); - } - - public void testPartialInsert() throws SQLException { - Command readCustomers = Command.FACTORY - .createCommand("select * from CUSTOMER where ID = 1"); - readCustomers.setConnection(getConnection()); - - // Read - DataObject root = readCustomers.executeQuery(); - - //Create a new customer - DataObject newCust = root.createDataObject("CUSTOMER"); - newCust.set("ID", new Integer(100)); - newCust.set("ADDRESS", "5528 Wells Fargo Drive"); - //Purposely do not set lastname to let it default to 'Garfugengheist' - //newCust.set("LASTNAME", "Gerkin" ); - - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.addPrimaryKey("CUSTOMER.ID"); - apply.setConnection(getConnection()); - apply.execute(root); - - Command readNewCust = Command.FACTORY.createCommand("select * from CUSTOMER where ID = 100"); - readNewCust.setConnection(getConnection()); - root = readNewCust.executeQuery(); - - // If partial insert was not used, LASTNAME would not be 'Garfugengheist' - newCust = root.getDataObject("CUSTOMER[1]"); - assertEquals(100, newCust.getInt("ID")); - assertEquals("Garfugengheist", newCust.getString("LASTNAME")); - assertEquals("5528 Wells Fargo Drive", newCust.getString("ADDRESS")); - - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/PassiveConnectionTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/PassiveConnectionTests.java deleted file mode 100644 index ec3479941a..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/PassiveConnectionTests.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * Test capability to participate in an extenrlly managed transaction. The client is managing the - * transaction boundary so the DAS will not issue commit/rollback - * - */ - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - - -import commonj.sdo.DataObject; - -public class PassiveConnectionTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - new CustomerData(getAutoConnection()).refresh(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** - * Read and modify a customer. Uses a "passive" connection - */ - public void testReadModifyApply() throws Exception { - - // Create and initialize a DAS connection and initialize for externally - // managed transaction boundaries - java.sql.Connection c = getConnection(); - - try { - - // Read customer 1 - Command select = Command.FACTORY - .createCommand("Select * from CUSTOMER where ID = 1"); - select.setConnection(c); - DataObject root = select.executeQuery(); - - DataObject customer = (DataObject) root.get("CUSTOMER[1]"); - - // Modify customer - customer.set("LASTNAME", "Pavick"); - - // Build apply changes command - ApplyChangesCommand apply = Command.FACTORY - .createApplyChangesCommand(); - apply.setConnection(c, false); - apply.addPrimaryKey("CUSTOMER.ID"); - - // Flush changes - apply.execute(root); - - // Verify changes - root = select.executeQuery(); - assertEquals("Pavick", root.getString("CUSTOMER[1]/LASTNAME")); - - // Since the DAS is not managing tx boundaries, I must - } catch (Exception e) { - c.rollback(); - } finally { - c.commit(); - } - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ReadDBSchemaTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ReadDBSchemaTests.java deleted file mode 100644 index 7a74372551..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ReadDBSchemaTests.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * Test the ability to query Database schema(metadata) information using regular DAS APIs - * This is speciic to DB2 - * - */ - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - - -public class ReadDBSchemaTests extends DasTest { - - - protected void setUp() throws Exception { - super.setUp(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - - - public void testReadTableInfo() throws Exception { - - Command select = Command.FACTORY.createCommand("SELECT * from SYSIBM.SYSTABLES WHERE TYPE = 'T'"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - DataObject table = (DataObject)root.get("SYSTABLES[1]"); - - assertEquals('T', table.getChar("TYPE")); - - } - - - - //Utilities - - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/RecursiveTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/RecursiveTests.java deleted file mode 100644 index 67713dcfd3..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/RecursiveTests.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -import java.util.Iterator; - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.ResultSetShape; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.impl.ReadCommandImpl; -import org.apache.tuscany.das.rdb.test.data.PartData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; -import commonj.sdo.Type; - -public class RecursiveTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - new PartData(getAutoConnection()).refresh(); - } - - public void testReadEngineParts() throws Exception { - - //Table definition - //CREATE TABLE PART (ID INT PRIMARY KEY NOT NULL, NAME VARCHAR(50), QUANTITY INT, PARENT_ID INT ); - - - String threeLevelPartsSQL = "SELECT P1.*, P2.*, P3.* FROM PART AS P1 LEFT JOIN PART AS P2 ON P1.ID = P2.PARENT_ID " - + "LEFT JOIN PART AS P3 on P2.ID = P3.PARENT_ID WHERE P1.ID = 1"; - Command select = Command.FACTORY.createCommand(threeLevelPartsSQL); - select.setConnection(getConnection()); - - String[] columns = {"ID", "NAME", "QUANTITY", "PARENT_ID", "ID", "NAME", "QUANTITY", "PARENT_ID", "ID", "NAME", "QUANTITY", "PARENT_ID"}; - String[] tables = {"PART", "PART", "PART", "PART", "PART", "PART", "PART", "PART", "PART", "PART", "PART", "PART"}; - Type[] types = {SDODataTypes.INTEGEROBJECT, SDODataTypes.STRING, SDODataTypes.INTEGEROBJECT, SDODataTypes.INTEGEROBJECT, SDODataTypes.INTEGEROBJECT, SDODataTypes.STRING, SDODataTypes.INTEGEROBJECT, SDODataTypes.INTEGEROBJECT, SDODataTypes.INTEGEROBJECT, SDODataTypes.STRING, SDODataTypes.INTEGEROBJECT, SDODataTypes.INTEGEROBJECT}; - ResultSetShape shape = new ResultSetShape(tables, columns, types); - - //Hack until we provide a nicer API - ((ReadCommandImpl)select).setResultSetShape(shape); - - // Need to set the key explicitly. The aggregate of columns not working - // because of null values - select.addPrimaryKey("PART.ID"); - select.addRelationship("PART.ID", "PART.PARENT_ID"); - DataObject root = select.executeQuery(); - - assertEquals(5, root.getList("PART").size()); - // printList(root.getList("PART")); - DataObject engine = root.getDataObject("PART.0"); - assertEquals("Engine", engine.getString("NAME")); - - assertEquals(3, engine.getList("PART").size()); - - DataObject piston = null; - Iterator i = engine.getList("PART").iterator(); - while ( i.hasNext() ) { - DataObject obj = (DataObject)i.next(); - if ( obj.getString("NAME").equals("Piston")) - piston = obj; - } - - assertEquals("Piston", piston.getString("NAME")); - assertEquals(1, piston.getList("PART").size()); - assertEquals("Piston Ring", piston.getDataObject("PART.0").getString("NAME")); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/RelationshipTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/RelationshipTests.java deleted file mode 100644 index ddcfbd0784..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/RelationshipTests.java +++ /dev/null @@ -1,195 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * - * - */ - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.data.OrderData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - - -public class RelationshipTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CustomerData(getAutoConnection()).refresh(); - new OrderData(getAutoConnection()).refresh(); - - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** - * Test ability to read a compound graph - */ - public void testRead() throws Exception { - - String statement = "SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID WHERE CUSTOMER.ID = 1"; - - // Read some customers and related orders - Command select = Command.FACTORY.createCommand(statement, getConfig("customerOrderRelationshipMapping.xml")); - select.setConnection(getConnection()); - - DataObject root = select.executeQuery(); - DataObject customer = root.getDataObject("CUSTOMER[1]"); - - assertEquals(2, customer.getList("orders").size()); - - } - - /** - * Test ability to extract and flush relationhip changes from the change - * history - */ - public void testRelationshipModification() throws Exception { - - // Read some customers and related orders - Command select = Command.FACTORY - .createCommand("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID"); - select.setConnection(getConnection()); - - // Set minimum metadata necessary to describe relationship - // Maybe something like this ... - select.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - select.addPrimaryKey("CUSTOMER.ID"); - select.addPrimaryKey("ANORDER.ID"); - - DataObject root = select.executeQuery(); - - DataObject cust1 = root.getDataObject("CUSTOMER[1]"); - DataObject cust2 = root.getDataObject("CUSTOMER[2]"); - - // Save IDs - Integer cust1ID = (Integer) cust1.get("ID"); - Integer cust2ID = (Integer) cust2.get("ID"); - // save order count - Integer cust1OrderCount = new Integer(cust1.getList("ANORDER").size()); - Integer cust2OrderCount = new Integer(cust2.getList("ANORDER").size()); - - // Move an order to cust1 from cust2 - DataObject order = (DataObject) cust2.getList("ANORDER").get(0); - cust1.getList("ANORDER").add(order); - - // Build apply changes command - ApplyChangesCommand apply = Command.FACTORY - .createApplyChangesCommand(); - apply.setConnection(getConnection()); - - // Manually create and add commands - Command update = Command.FACTORY - .createCommand("update ANORDER set CUSTOMER_ID = :CUSTOMER_ID where ID = :ID"); - update.addParameter("CUSTOMER_ID", SDODataTypes.INTEGER); - update.addParameter("ID", SDODataTypes.INTEGER); - update.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - update.addPrimaryKey("CUSTOMER.ID"); - update.addPrimaryKey("ANORDER.ID"); - apply.addUpdateCommand(order.getType(), update); - - // Flush changes - apply.execute(root); - - // verify cust1 relationship updates - select = Command.FACTORY - .createCommand("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = :ID"); - select.setConnection(getConnection()); - select.setParameterValue("ID", cust1ID); - - select.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - select.addPrimaryKey("CUSTOMER.ID"); - select.addPrimaryKey("ANORDER.ID"); - root = select.executeQuery(); - - assertEquals(cust1OrderCount.intValue() + 1, root.getList( - "CUSTOMER[1]/ANORDER").size()); - - // verify cust2 relationship updates - select.setParameterValue("ID", cust2ID); - root = select.executeQuery(); - - assertEquals(cust2OrderCount.intValue() - 1, root.getList( - "CUSTOMER[1]/ANORDER").size()); - - } - - /** - * Same as above except uses xml file for relationhip and key information. - * Employs CUD generation. - */ - public void testRelationshipModification2() throws Exception { - - // Read some customers and related orders - Command select = Command.FACTORY - .createCommand( - "SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID", getConfig("basicCustomerOrderMapping.xml")); - select.setConnection(getConnection()); - - DataObject root = select.executeQuery(); - - DataObject cust1 = root.getDataObject("CUSTOMER[1]"); - DataObject cust2 = root.getDataObject("CUSTOMER[2]"); - - // Save IDs - Integer cust1ID = (Integer) cust1.get("ID"); - Integer cust2ID = (Integer) cust2.get("ID"); - // save order count - Integer cust1OrderCount = new Integer(cust1.getList("orders").size()); - Integer cust2OrderCount = new Integer(cust2.getList("orders").size()); - - // Move an order to cust1 from cust2 - DataObject order = (DataObject) cust2.getList("orders").get(0); - cust1.getList("orders").add(order); - - // Build apply changes command - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("basicCustomerOrderMapping.xml")); - apply.setConnection(getConnection()); - - // Flush changes - apply.execute(root); - - // verify cust1 relationship updates - select = Command.FACTORY - .createCommand( - "SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = :ID", - getConfig("basicCustomerOrderMapping.xml")); - select.setConnection(getConnection()); - select.setParameterValue("ID", cust1ID); - - root = select.executeQuery(); - assertEquals(cust1OrderCount.intValue() + 1, root.getList( - "CUSTOMER[1]/orders").size()); - - // verify cust2 relationship updates - select.setParameterValue("ID", cust2ID); - root = select.executeQuery(); - assertEquals(cust2OrderCount.intValue() - 1, root.getList( - "CUSTOMER[1]/orders").size()); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ResultSetShapeTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ResultSetShapeTests.java deleted file mode 100644 index 34e531304e..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ResultSetShapeTests.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.ResultSetShape; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - - -import commonj.sdo.DataObject; -import commonj.sdo.Type; - -/** - * Test ability to specify format(shape) of the ResultSet. This is necessary - * when the JDBC driver in use does not provide adequate support for - * ResultSetMetadata. Also, we expect that specifying the result set shape will - * increase performance. - * - */ -public class ResultSetShapeTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - new CustomerData(getAutoConnection()).refresh(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** - * Read a specific customer - */ - public void testReadSingle() throws Exception { - - // Using literals in the select forces invalid resultset metadata - String sqlString = "Select 99, 'Roosevelt', '1600 Pennsylvania Avenue' from customer"; - String[] columns = { "ID", "LASTNAME", "ADDRESS" }; - String[] tables = { "CUSTOMER", "CUSTOMER", "CUSTOMER" }; - Type[] types = { SDODataTypes.LONG, SDODataTypes.STRING, - SDODataTypes.STRING }; - - ResultSetShape shape = new ResultSetShape(tables, columns, types); - - // Create and initialize command to read customers - Command readCustomers = Command.FACTORY.createCommand(sqlString); - readCustomers.addConverter("CUSTOMER.ID", "org.apache.tuscany.das.rdb.test.mappings.StringToLongConverter"); - // Specify result shape - readCustomers.setResultSetShape(shape); - - readCustomers.setConnection(getConnection()); - - // Read - DataObject root = readCustomers.executeQuery(); - - // Verify - assertEquals(5, root.getList("CUSTOMER").size()); - assertEquals(99, root.getInt("CUSTOMER[1]/ID")); - assertEquals("Roosevelt", root.getString("CUSTOMER[1]/LASTNAME")); - assertEquals("1600 Pennsylvania Avenue", root - .getString("CUSTOMER[1]/ADDRESS")); - - } - - /** - * Read a specific customer This duplicates the previous tests but does not - * provide the shape info. Since the select will not return valid metadata, - * this test is expected to fail - */ - public void testReadSingleVerifyShapeUse() throws Exception { - - // Using literals in the select forces invalid resultset metadata - String sqlString = "Select 99, 'Roosevelt', '1600 Pennsylvania Avenue' from customer"; - - // Create and initialize command to read customers - Command readCustomers = Command.FACTORY.createCommand(sqlString); - readCustomers.setConnection(getConnection()); - - // Read - DataObject root = readCustomers.executeQuery(); - - // Verify - try { - assertEquals(5, root.getList("CUSTOMER").size()); - fail("Should fail since there will be no feature named CUSTOMER"); - } catch (IllegalArgumentException e) { - // OK - } - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/SerializationTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/SerializationTests.java deleted file mode 100644 index 0089e6b569..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/SerializationTests.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * This class provides tests for all supported "types". The current plan is to - * use the Data type definitions provided in the SDO 2 specification. We must - * test the ability to use all of these types as well as different mapping from - * thse types to types used in the database. For example, a SDO Data Type - * "STRING", might be staored as a "TIMESTAMP" in DB2. - * - */ - -import org.apache.tuscany.das.rdb.test.data.TypesData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -public class SerializationTests extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - new TypesData(getAutoConnection()).refresh(); - } - - /** - * Read various types. - */ - - -public void testReadandSerialize() throws Exception { - /** Currently failing because of TUSCANY-22 - Command select = Command.FACTORY - .createCommand("Select * from TYPETEST where ID = 1"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - DataObject obj = root.getDataObject("TYPETEST[1]"); - - assertTrue(obj.isSet("ID")); - assertTrue(obj.isSet("ATIMESTAMP")); - assertTrue(obj.isSet("ADECIMAL")); - assertTrue(obj.isSet("AFLOAT")); - - //Java serilaization to file - FileOutputStream fos = null; - ObjectOutputStream out = null; - try { - fos = new FileOutputStream("serializedGraph.xml"); - out = new ObjectOutputStream(fos); - out.writeObject(root); - out.flush(); - } finally { - out.close(); - fos.close(); - } - - //Reconstruct the graph - FileInputStream fis = null; - ObjectInputStream in = null; - DataObject root2; - try { - fis = new FileInputStream("serializedGraph.xml"); - in = new ObjectInputStream(fis); - root2 = (DataObject) in.readObject(); - } finally { - in.close(); - fis.close(); - } - - assertEquals(1, root.getInt("TYPETEST[1]/ID")); - assertEquals(TypesData.getTimestamp(), (java.sql.Timestamp)root.get("TYPETEST[1]/ATIMESTAMP")); - assertEquals(1234567.89f, root2.getFloat("TYPETEST[1]/ADECIMAL"), .001); - assertEquals(1234567.89f, root2.getFloat("TYPETEST[1]/AFLOAT"), .001); - - */ - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/SimplestCrud.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/SimplestCrud.java deleted file mode 100644 index 44979cee4a..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/SimplestCrud.java +++ /dev/null @@ -1,256 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * These are the simplest possible uses of the JDBC DAS. In this mode, the - * programming model is not much more than JDBC - * - * The assumptions for these tests are: - * - * Single type - * Client explicitly Read/Create/Update/Delete commands - * No O/R mapping metadata - * SDO change history is not used - * Dynamic DataObjects - * No specified graph model - * - * - */ - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - -import commonj.sdo.DataObject; - - -public class SimplestCrud extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - new CustomerData(getAutoConnection()).refresh(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** - * Read a specific customer - */ - public void testReadSingle() throws Exception { - - //Create and initialize command to read customers - Command readCustomers = Command.FACTORY.createCommand("select * from CUSTOMER where ID = 1"); - readCustomers.setConnection(getConnection()); - - //Read - DataObject root = readCustomers.executeQuery(); - - //Verify - assertEquals(1, root.getInt("CUSTOMER[1]/ID")); - } - - /** - * Read a specific customer - */ - public void testReadSingle2() throws Exception { - - //Create and initialize command to read customers - Command readCustomers = Command.FACTORY.createCommand("select * from CUSTOMER where ID = 1"); - readCustomers.setConnection(getConnection()); - - //Read - DataObject root = readCustomers.executeQuery(); - - DataObject cust = root.getDataObject("CUSTOMER[1]"); - - int n = (cust.getType().getProperties()).size(); - for (int i=0; i 0); - - } - - public void testGetNamedCompany() throws Exception { - - Command read = Command.FACTORY.createCommand("{call GETNAMEDCOMPANY(?)}"); - - read.setConnection(getConnection()); - read.setParameterValue(1, "MegaCorp"); - DataObject root = read.executeQuery(); - - assertEquals("MegaCorp", root.getString("COMPANY[1]/NAME")); - - } - - public void testGetNamedCompanyByName() throws Exception { - Command read = Command.FACTORY - .createCommand("{call GETNAMEDCOMPANY(:NAME)}"); - - read.setConnection(getConnection()); - read.setParameterValue("NAME", "MegaCorp"); - DataObject root = read.executeQuery(); - - assertEquals("MegaCorp", root.getString("COMPANY[1]/NAME")); - } - - - // Retreive heirarchy using a stored proc ... new programming model - public void testGetCustomersAndOrder() throws Exception { - - Command read = Command.FACTORY.createCommand("{call getCustomerAndOrders(?)}"); - read.setConnection(getConnection()); - read.setParameterValue(1, new Integer(1)); - - //Set minimum metadata necessary to describe relationship - read.addRelationship("CUSTOMER.ID", "ANORDER.CUSTOMER_ID"); - read.addPrimaryKey("CUSTOMER.ID"); - read.addPrimaryKey("ANORDER.ID"); - - DataObject root = read.executeQuery(); - - DataObject customer = (DataObject) root.getList("CUSTOMER").get(0); - assertEquals(2, customer.getList("ANORDER").size()); - - } - - /** - * Call a stored proc requiring an in parameter and producing an out - * parameter and a resultset - * - * This stored proc takes a lastname argument and returns a graph of - * customers with that last name. The number of read customers is returned - * in the out parameter - */ -/* public void testGetNamedCustomers() throws Exception { - - Command read = Command.FACTORY.createCommand("{call GETNAMEDCUSTOMERS(?,?)}"); - read.setConnection(getConnection()); - read.setParameterValue(1, "Williams"); - read.addParameter(2, Parameter.OUT, SDODataTypes.INTEGER); - DataObject root = read.executeQuery(); - - Integer customersRead = (Integer) read.getParameterValue(2); - - assertEquals(4, customersRead.intValue()); - assertEquals(customersRead.intValue(), root.getList("CUSTOMER").size()); - - } - */ - //TODO - Resolve issue with programmatic creation of GETNAMEDCUSTOMERS on DB2 and - //re-enable this test - - - // Simplest possible SP write - public void testDelete() throws Exception { - -// JDBCDASCommand delete = JDBCDASCommand.FACTORY.createSPWriteCommand("{call DELETECUSTOMER(?)}"); - Command delete = Command.FACTORY.createCommand("{call DELETECUSTOMER(?)}"); - delete.setConnection(getConnection()); - delete.setParameterValue(1, new Integer(1)); - delete.execute(); - - // Verify DELETE - Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 1"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - assertTrue(root.getList("CUSTOMER").isEmpty()); - - } - -/* // For debug - public void testRawCall() throws Exception { - - Connection c = getConnection(); - CallableStatement cs = c.prepareCall("{call GETNAMEDCUSTOMERS(?,?)}"); - ParameterMetaData pm = cs.getParameterMetaData(); - int count = pm.getParameterCount(); - for (int i = 1; i <= count; i++) { - int mode = pm.getParameterMode(i); - if (mode == ParameterMetaData.parameterModeOut - || mode == ParameterMetaData.parameterModeInOut) - cs.registerOutParameter(i, pm.getParameterType(i)); - } - cs.setString(1, "Williams"); - // cs.registerOutParameter(2,java.sql.Types.INTEGER); - boolean isResultSet = cs.execute(); - System.out.println("Has a result set => " + isResultSet); - ResultSet rs = cs.getResultSet(); - - if (isResultSet) { - System.out.println("Results are: "); - while (rs.next()) { - System.out.println(rs.getObject(2)); - } - } - System.out.println("Count is =>" + cs.getObject(2)); - c.commit(); - } - - // For debug - public void testRawCall2() throws Exception { - - Connection c = getConnection(); - CallableStatement cs = c.prepareCall("{call getCustomerAndOrders(?)}"); - cs.setObject(1, new Integer(1)); - boolean isResultSet = cs.execute(); - System.out.println("call getCustomerAndOrders(?) has a result set => " - + isResultSet); - ResultSet rs = cs.getResultSet(); - - write(rs); - c.commit(); - } - - public void testGetAllOrders() throws Exception { - - System.out.println("all orders"); - Connection c = getConnection(); - PreparedStatement s = c.prepareStatement("select * from anorder"); - write (s.executeQuery()); - c.commit(); - - }*/ - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/TopDown.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/TopDown.java deleted file mode 100644 index 0cdc279136..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/TopDown.java +++ /dev/null @@ -1,139 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -import java.io.IOException; -import java.sql.SQLException; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.customer.AnOrder; -import org.apache.tuscany.das.rdb.test.customer.Customer; -import org.apache.tuscany.das.rdb.test.customer.CustomerFactory; -import org.apache.tuscany.das.rdb.test.customer.DataGraphRoot; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.data.OrderData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.helper.TypeHelper; - -public class TopDown extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - - new CustomerData(getAutoConnection()).refresh(); - new OrderData(getAutoConnection()).refresh(); - - } - - // Uses dynamic SDOs but user provides the model - public void testUserProvidedModelDynamic() throws SQLException, IOException { - - // Build the select command - Command select = Command.FACTORY - .createCommand( - "SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = :ID", - getConfig("1xM_mapping_no_cud.xml")); - - SDOUtil.registerStaticTypes(CustomerFactory.class); - -// Set the object model - select.setDataObjectModel(TypeHelper.INSTANCE.getType(DataGraphRoot.class)); - - - // Parameterize the command - select.setConnection(getConnection()); - select.setParameterValue("ID", new Integer(1)); - - // Get the graph - DataGraphRoot is from the typed package - DataGraphRoot root = (DataGraphRoot) select.executeQuery(); - - // Modify a customer - Customer customer = (Customer) root.getCustomers().get(0); - customer.setLastName("Pavick"); - - // Modify an order - AnOrder order = (AnOrder) customer.getOrders().get(0); - order.setProduct("Kitchen Sink 001"); - - ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(); - apply.setConnection(getConnection()); - apply.setMapping(getConfig("1xM_mapping_no_cud.xml")); - - // Flush changes - apply.execute((DataObject) root); - - /* - * JDBCDAS das = JDBCDAS.FACTORY.create(); // Build the select command - * CrudCommand select = CrudCommand.FACTORY.create( "select CUSTOMER.ID, - * CUSTOMER.LASTNAME, CUSTOMER.ADDRESS, ANORDER.ID, ANORDER.PRODUCT, - * ANORDER.QUANTITY, ANORDER.CUSTOMER_ID from CUSTOMER left outer join - * ANORDER on ANORDER.CUSTOMER_ID=CUSTOMER.ID where CUSTOMER.ID = :ID" , - * getMappingModel_1xM_uni_as_stream() , getGraphType()); // - * Parameterize the command select.setConnection(getConnection()); - * select.setParameter("ID", new Integer(1)); // Get the graph - * DataObject root = das.getRootDataObject(select); // Modify a customer - * DataObject customer = (DataObject) root.getList("CUSTOMER").get(0); - * customer.set("LASTNAME", "Pavick"); // Modify the first order - * DataObject order = (DataObject)customer.getList("orders").get(0); - * order.setString("PRODUCT", "Kitchen Sink 001"); // Build command for - * flush ApplyChangesCommand command = - * ApplyChangesCommand.FACTORY.create(getMappingModel_1xM_uni_as_stream()); - * command.setConnection(getConnection()); // Flush changes - * das.applyChanges(root, command); - */ - } - - /* - * //User provides the model and uses generated classes public void - * testUserProvidedModelStatic() throws SQLException, IOException { - * - * JDBCDAS das = JDBCDAS.FACTORY.create(); - * - * //Build the select command CrudCommand select = - * CrudCommand.FACTORY.create( "select CUSTOMER.ID, CUSTOMER.LASTNAME, - * CUSTOMER.ADDRESS, ANORDER.ID, ANORDER.PRODUCT, ANORDER.QUANTITY, - * ANORDER.CUSTOMER_ID from CUSTOMER left outer join ANORDER on - * ANORDER.CUSTOMER_ID=CUSTOMER.ID where CUSTOMER.ID = :ID" , - * getMappingModel_1xM_uni_as_stream() , getGraphType()); - * - * //Parameterize the command select.setConnection(getConnection()); - * select.setParameter("ID", new Integer(1)); - * - * //Get the graph DataObject root = das.getRootDataObject(getGraphType(), - * select); - * - * //Modify a customer DataGraphRoot dgRoot = (DataGraphRoot) root; // TODO - * Need to cast to Static customer and use "setLastName()" - * - * Customer customer = (Customer) dgRoot.getCustomers().get(0); - * customer.setLastName("Pavick"); - * - * //Modify the first order AnOrder order = customer.getOrders(); - * order.setProduct("Kitchen Sink 001"); - * - * //Build command for flush ApplyChangesCommand command = - * ApplyChangesCommand.FACTORY.create(getMappingModel_1xM_uni_as_stream()); - * command.setConnection(getConnection()); - * - * //Flush changes das.applyChanges(root, command); } - */ - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/TypeTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/TypeTests.java deleted file mode 100644 index fc94299ef6..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/TypeTests.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test; - -/* - * This class provides tests for all supported "types". The current plan is to use the Data - * type definitions provided in the SDO 2 specification. We must test the ability to use - * all of these types as well as different mapping from thse types to types used in the - * database. For example, a SDO Data Type "STRING", might be staored as a "TIMESTAMP" in DB2. - * - */ - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.data.TypesData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; - - -import commonj.sdo.DataObject; - - -public class TypeTests extends DasTest { - - - protected void setUp() throws Exception { - super.setUp(); - new TypesData(getAutoConnection()).refresh(); - } - - /** - * Read various types. - */ - public void testRead() throws Exception { - - //Read customer 1 - Command select = Command.FACTORY.createCommand("Select * from TYPETEST where ID = 1"); - select.setConnection(getConnection()); - DataObject root = select.executeQuery(); - - DataObject types = (DataObject)root.get("TYPETEST[1]"); - - java.sql.Timestamp ts = (java.sql.Timestamp)types.get("ATIMESTAMP"); - assertEquals(ts, TypesData.getTimestamp()); - - float decimal = types.getFloat("ADECIMAL"); - assertEquals(1234567.89f, decimal, .0001); - - } - - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersByLastnameCommand.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersByLastnameCommand.java deleted file mode 100644 index 09a6147118..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersByLastnameCommand.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.commands; - -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.ConfigFactory; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.impl.ConfigFactoryImpl; -import org.apache.tuscany.das.rdb.impl.ReadCommandImpl; - - -public class ReadCustomersByLastnameCommand extends ReadCommandImpl { - - private static final String sqlString = "select * from CUSTOMER where LASTNAME = :LASTNAME"; - private static final Config mapping; - - static { - ConfigFactory factory = ConfigFactoryImpl.eINSTANCE; - mapping = factory.createConfig(); - Table t = factory.createTable(); - Column id = factory.createColumn(); - id.setName("ID"); - id.setPrimaryKey(true); - Column lastname = factory.createColumn(); - lastname.setName("LASTNAME"); - Column address = factory.createColumn(); - address.setName("ADDRESS"); - - t.getColumn().add(id); - t.getColumn().add(lastname); - t.getColumn().add(address); - t.setName("CUSTOMER"); - mapping.getTable().add(t); - } - - public ReadCustomersByLastnameCommand() { - super(sqlString, mapping); - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersCommand.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersCommand.java deleted file mode 100644 index 615ef12dab..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersCommand.java +++ /dev/null @@ -1,55 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* 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. -*/ -package org.apache.tuscany.das.rdb.test.commands; - -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.ConfigFactory; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.impl.ConfigFactoryImpl; -import org.apache.tuscany.das.rdb.impl.ReadCommandImpl; - - -public class ReadCustomersCommand extends ReadCommandImpl { - - private static final String sqlString = "select * from CUSTOMER"; - private static final Config mapping; - - static { - ConfigFactory factory = ConfigFactoryImpl.eINSTANCE; - mapping = factory.createConfig(); - Table t = factory.createTable(); - Column id = factory.createColumn(); - id.setName("ID"); - id.setPrimaryKey(true); - Column lastname = factory.createColumn(); - lastname.setName("LASTNAME"); - Column address = factory.createColumn(); - address.setName("ADDRESS"); - - t.getColumn().add(id); - t.getColumn().add(lastname); - t.getColumn().add(address); - t.setName("CUSTOMER"); - mapping.getTable().add(t); - } - - public ReadCustomersCommand() { - super(sqlString, mapping); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersStaticTypesCommand.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersStaticTypesCommand.java deleted file mode 100644 index c8dcdebb68..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersStaticTypesCommand.java +++ /dev/null @@ -1,62 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* 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. -*/ -package org.apache.tuscany.das.rdb.test.commands; - -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.ConfigFactory; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.impl.ConfigFactoryImpl; -import org.apache.tuscany.das.rdb.impl.ReadCommandImpl; -import org.apache.tuscany.das.rdb.test.customer.DataGraphRoot; - -import commonj.sdo.helper.TypeHelper; - - -public class ReadCustomersStaticTypesCommand extends ReadCommandImpl { - - private static final String sqlString = "Select ID, LASTNAME, ADDRESS from CUSTOMER where LASTNAME = :LASTNAME"; - private static final Config mapping; - - static { - ConfigFactory factory = ConfigFactoryImpl.eINSTANCE; - mapping = factory.createConfig(); - Table t = factory.createTable(); - Column id = factory.createColumn(); - id.setName("ID"); - id.setPrimaryKey(true); - Column lastname = factory.createColumn(); - lastname.setName("LASTNAME"); - Column address = factory.createColumn(); - address.setName("ADDRESS"); - - t.getColumn().add(id); - t.getColumn().add(lastname); - t.getColumn().add(address); - t.setName("CUSTOMER"); - t.setPropertyName("Customer"); - mapping.getTable().add(t); - } - - public ReadCustomersStaticTypesCommand() { - super(sqlString, mapping); - setDataObjectModel(TypeHelper.INSTANCE.getType(DataGraphRoot.class)); - } - - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersWithShapeCommand.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersWithShapeCommand.java deleted file mode 100644 index 82d8cefbc2..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersWithShapeCommand.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.commands; - -import org.apache.tuscany.das.rdb.ResultSetShape; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.impl.ReadCommandImpl; - -import commonj.sdo.Type; - -public class ReadCustomersWithShapeCommand extends ReadCommandImpl { - - // This sql string ensures that we won't have resultset metadata - private static final String sqlString = "Select * from customer union select * from customer"; - - private static final String[] columns = {"ID", "LASTNAME", "ADDRESS"}; - private static final String[] tables = {"CUSTOMER", "CUSTOMER", "CUSTOMER"}; - private static final Type[] types = {SDODataTypes.INT, SDODataTypes.STRING, SDODataTypes.STRING}; - - public ReadCustomersWithShapeCommand() { - super(sqlString); - ResultSetShape shape = new ResultSetShape(tables, columns, types); - setResultSetShape(shape); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/SimpleReadCustomersWithShapeCommand.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/SimpleReadCustomersWithShapeCommand.java deleted file mode 100644 index 1f45ba317f..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/SimpleReadCustomersWithShapeCommand.java +++ /dev/null @@ -1,66 +0,0 @@ -/** -* -* Copyright 2005 The Apache Software Foundation or its licensors, as applicable. -* -* 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. -*/ -package org.apache.tuscany.das.rdb.test.commands; - -import org.apache.tuscany.das.rdb.ResultSetShape; -import org.apache.tuscany.das.rdb.SDODataTypes; -import org.apache.tuscany.das.rdb.config.Column; -import org.apache.tuscany.das.rdb.config.Config; -import org.apache.tuscany.das.rdb.config.ConfigFactory; -import org.apache.tuscany.das.rdb.config.Table; -import org.apache.tuscany.das.rdb.config.impl.ConfigFactoryImpl; -import org.apache.tuscany.das.rdb.impl.ReadCommandImpl; - -import commonj.sdo.Type; - -public class SimpleReadCustomersWithShapeCommand extends ReadCommandImpl { - - // This sql string ensures that we won't have resultset metadata - private static final String sqlString = "Select * from customer union select * from customer"; - - private static final String[] columns = {"ID", "LASTNAME", "ADDRESS"}; - private static final String[] tables = {"CUSTOMER", "CUSTOMER", "CUSTOMER"}; - private static final Type[] types = {SDODataTypes.INT, SDODataTypes.STRING, SDODataTypes.STRING}; - - private static final Config mapping; - - static { - ConfigFactory factory = ConfigFactoryImpl.eINSTANCE; - mapping = factory.createConfig(); - Table t = factory.createTable(); - Column id = factory.createColumn(); - id.setName("ID"); - id.setPrimaryKey(true); - Column lastname = factory.createColumn(); - lastname.setName("LASTNAME"); - Column address = factory.createColumn(); - address.setName("ADDRESS"); - - t.getColumn().add(id); - t.getColumn().add(lastname); - t.getColumn().add(address); - t.setName("CUSTOMER"); - mapping.getTable().add(t); - } - - public SimpleReadCustomersWithShapeCommand() { - super(sqlString, mapping); - ResultSetShape shape = new ResultSetShape(tables, columns, types); - setResultSetShape(shape); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/CompanyFactory.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/CompanyFactory.java deleted file mode 100644 index dcf1f1edd9..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/CompanyFactory.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company; - - -/** - * - * The Factory for the model. - * It provides a create method for each non-abstract class of the model. - * - * @generated - */ -public interface CompanyFactory -{ - /** - * The singleton instance of the factory. - * - * - * @generated - */ - CompanyFactory INSTANCE = org.apache.tuscany.das.rdb.test.company.impl.CompanyFactoryImpl.eINSTANCE; - - /** - * Returns a new object of class 'Type'. - * - * - * @return a new object of class 'Type'. - * @generated - */ - CompanyType createCompanyType(); - - /** - * Returns a new object of class 'Datagraph Root'. - * - * - * @return a new object of class 'Datagraph Root'. - * @generated - */ - DatagraphRoot createDatagraphRoot(); - - /** - * Returns a new object of class 'Department Type'. - * - * - * @return a new object of class 'Department Type'. - * @generated - */ - DepartmentType createDepartmentType(); - - /** - * Returns a new object of class 'Employee Type'. - * - * - * @return a new object of class 'Employee Type'. - * @generated - */ - EmployeeType createEmployeeType(); - -} //CompanyFactory diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/CompanyType.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/CompanyType.java deleted file mode 100644 index bc8e95c735..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/CompanyType.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company; - -import java.util.List; - -/** - * - * A representation of the model object 'Type'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.apache.tuscany.das.rdb.test.company.CompanyType#getDepartments Departments}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.company.CompanyType#getEmployeeOfTheMonth Employee Of The Month}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.company.CompanyType#getName Name}
  • - *
- *

- * - * @generated - */ -public interface CompanyType -{ - /** - * Returns the value of the 'Departments' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.test.company.DepartmentType}. - * - *

- * If the meaning of the 'Departments' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Departments' containment reference list. - * @generated - */ - List getDepartments(); - - /** - * Returns the value of the 'Employee Of The Month' attribute. - * - *

- * If the meaning of the 'Employee Of The Month' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Employee Of The Month' attribute. - * @see #setEmployeeOfTheMonth(String) - * @generated - */ - String getEmployeeOfTheMonth(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.company.CompanyType#getEmployeeOfTheMonth Employee Of The Month}' attribute. - * - * - * @param value the new value of the 'Employee Of The Month' attribute. - * @see #getEmployeeOfTheMonth() - * @generated - */ - void setEmployeeOfTheMonth(String value); - - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.company.CompanyType#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - -} // CompanyType diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/DatagraphRoot.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/DatagraphRoot.java deleted file mode 100644 index cdce989e1c..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/DatagraphRoot.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company; - -import java.util.List; - -/** - * - * A representation of the model object 'Datagraph Root'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.apache.tuscany.das.rdb.test.company.DatagraphRoot#getCompanies Companies}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.company.DatagraphRoot#getDepartments Departments}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.company.DatagraphRoot#getEmployees Employees}
  • - *
- *

- * - * @generated - */ -public interface DatagraphRoot -{ - /** - * Returns the value of the 'Companies' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.test.company.CompanyType}. - * - *

- * If the meaning of the 'Companies' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Companies' containment reference list. - * @generated - */ - List getCompanies(); - - /** - * Returns the value of the 'Departments' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.test.company.DepartmentType}. - * - *

- * If the meaning of the 'Departments' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Departments' containment reference list. - * @generated - */ - List getDepartments(); - - /** - * Returns the value of the 'Employees' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.test.company.EmployeeType}. - * - *

- * If the meaning of the 'Employees' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Employees' containment reference list. - * @generated - */ - List getEmployees(); - -} // DatagraphRoot diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/DepartmentType.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/DepartmentType.java deleted file mode 100644 index 0fa23d972b..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/DepartmentType.java +++ /dev/null @@ -1,143 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company; - -import java.util.List; - -/** - * - * A representation of the model object 'Department Type'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getEmployees Employees}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getLocation Location}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getName Name}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getNumber Number}
  • - *
- *

- * - * @generated - */ -public interface DepartmentType -{ - /** - * Returns the value of the 'Employees' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.test.company.EmployeeType}. - * - *

- * If the meaning of the 'Employees' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Employees' containment reference list. - * @generated - */ - List getEmployees(); - - /** - * Returns the value of the 'Location' attribute. - * - *

- * If the meaning of the 'Location' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Location' attribute. - * @see #setLocation(String) - * @generated - */ - String getLocation(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getLocation Location}' attribute. - * - * - * @param value the new value of the 'Location' attribute. - * @see #getLocation() - * @generated - */ - void setLocation(String value); - - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'Number' attribute. - * - *

- * If the meaning of the 'Number' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Number' attribute. - * @see #isSetNumber() - * @see #unsetNumber() - * @see #setNumber(int) - * @generated - */ - int getNumber(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getNumber Number}' attribute. - * - * - * @param value the new value of the 'Number' attribute. - * @see #isSetNumber() - * @see #unsetNumber() - * @see #getNumber() - * @generated - */ - void setNumber(int value); - - /** - * Unsets the value of the '{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getNumber Number}' attribute. - * - * - * @see #isSetNumber() - * @see #getNumber() - * @see #setNumber(int) - * @generated - */ - void unsetNumber(); - - /** - * Returns whether the value of the '{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getNumber Number}' attribute is set. - * - * - * @return whether the value of the 'Number' attribute is set. - * @see #unsetNumber() - * @see #getNumber() - * @see #setNumber(int) - * @generated - */ - boolean isSetNumber(); - -} // DepartmentType diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/EmployeeType.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/EmployeeType.java deleted file mode 100644 index ccc4dcb393..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/EmployeeType.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company; - - -/** - * - * A representation of the model object 'Employee Type'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.apache.tuscany.das.rdb.test.company.EmployeeType#isManager Manager}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.company.EmployeeType#getName Name}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.company.EmployeeType#getSN SN}
  • - *
- *

- * - * @generated - */ -public interface EmployeeType -{ - /** - * Returns the value of the 'Manager' attribute. - * - *

- * If the meaning of the 'Manager' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Manager' attribute. - * @see #isSetManager() - * @see #unsetManager() - * @see #setManager(boolean) - * @generated - */ - boolean isManager(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.company.EmployeeType#isManager Manager}' attribute. - * - * - * @param value the new value of the 'Manager' attribute. - * @see #isSetManager() - * @see #unsetManager() - * @see #isManager() - * @generated - */ - void setManager(boolean value); - - /** - * Unsets the value of the '{@link org.apache.tuscany.das.rdb.test.company.EmployeeType#isManager Manager}' attribute. - * - * - * @see #isSetManager() - * @see #isManager() - * @see #setManager(boolean) - * @generated - */ - void unsetManager(); - - /** - * Returns whether the value of the '{@link org.apache.tuscany.das.rdb.test.company.EmployeeType#isManager Manager}' attribute is set. - * - * - * @return whether the value of the 'Manager' attribute is set. - * @see #unsetManager() - * @see #isManager() - * @see #setManager(boolean) - * @generated - */ - boolean isSetManager(); - - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.company.EmployeeType#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'SN' attribute. - * - *

- * If the meaning of the 'SN' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'SN' attribute. - * @see #setSN(String) - * @generated - */ - String getSN(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.company.EmployeeType#getSN SN}' attribute. - * - * - * @param value the new value of the 'SN' attribute. - * @see #getSN() - * @generated - */ - void setSN(String value); - -} // EmployeeType diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyFactoryImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyFactoryImpl.java deleted file mode 100644 index 7ce6161e54..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyFactoryImpl.java +++ /dev/null @@ -1,164 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company.impl; - -import org.apache.tuscany.das.rdb.test.company.*; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.impl.EFactoryImpl; - -import org.eclipse.emf.ecore.plugin.EcorePlugin; - -/** - * - * An implementation of the model Factory. - * - * @generated - */ -public class CompanyFactoryImpl extends EFactoryImpl implements CompanyFactory -{ - /** - * The singleton instance of the factory. - * - * - * @generated - */ - public static final CompanyFactoryImpl eINSTANCE = init(); - - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static CompanyFactoryImpl init() - { - try - { - CompanyFactoryImpl theCompanyFactory = (CompanyFactoryImpl)EPackage.Registry.INSTANCE.getEFactory("org.apache.tuscany.das.rdb.test/company.xsd"); - if (theCompanyFactory != null) - { - return theCompanyFactory; - } - } - catch (Exception exception) - { - EcorePlugin.INSTANCE.log(exception); - } - return new CompanyFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public CompanyFactoryImpl() - { - super(); - } - - /** - * - * - * @generated - */ - public EObject create(EClass eClass) - { - switch (eClass.getClassifierID()) - { - case CompanyPackageImpl.COMPANY_TYPE: return (EObject)createCompanyType(); - case CompanyPackageImpl.DATAGRAPH_ROOT: return (EObject)createDatagraphRoot(); - case CompanyPackageImpl.DEPARTMENT_TYPE: return (EObject)createDepartmentType(); - case CompanyPackageImpl.DOCUMENT_ROOT: return (EObject)createDocumentRoot(); - case CompanyPackageImpl.EMPLOYEE_TYPE: return (EObject)createEmployeeType(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - public CompanyType createCompanyType() - { - CompanyTypeImpl companyType = new CompanyTypeImpl(); - return companyType; - } - - /** - * - * - * @generated - */ - public DatagraphRoot createDatagraphRoot() - { - DatagraphRootImpl datagraphRoot = new DatagraphRootImpl(); - return datagraphRoot; - } - - /** - * - * - * @generated - */ - public DepartmentType createDepartmentType() - { - DepartmentTypeImpl departmentType = new DepartmentTypeImpl(); - return departmentType; - } - - /** - * - * - * @generated - */ - public EObject createDocumentRoot() - { - EObject documentRoot = super.create(CompanyPackageImpl.Literals.DOCUMENT_ROOT); - return documentRoot; - } - - /** - * - * - * @generated - */ - public EmployeeType createEmployeeType() - { - EmployeeTypeImpl employeeType = new EmployeeTypeImpl(); - return employeeType; - } - - /** - * - * - * @generated - */ - public CompanyPackageImpl getCompanyPackageImpl() - { - return (CompanyPackageImpl)getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - public static CompanyPackageImpl getPackage() - { - return CompanyPackageImpl.eINSTANCE; - } - -} //CompanyFactoryImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyPackageImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyPackageImpl.java deleted file mode 100644 index 6e8e40b107..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyPackageImpl.java +++ /dev/null @@ -1,1248 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company.impl; - -import org.apache.tuscany.das.rdb.test.company.CompanyFactory; -import org.apache.tuscany.das.rdb.test.company.CompanyType; -import org.apache.tuscany.das.rdb.test.company.DatagraphRoot; -import org.apache.tuscany.das.rdb.test.company.DepartmentType; -import org.apache.tuscany.das.rdb.test.company.EmployeeType; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EFactory; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - -import org.eclipse.emf.ecore.impl.EPackageImpl; - -import org.eclipse.emf.ecore.xml.type.XMLTypePackage; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @see org.apache.tuscany.das.rdb.test.company.CompanyFactory - * @generated - */ -public class CompanyPackageImpl extends EPackageImpl -{ - /** - * The package name. - * - * - * @generated - */ - public static final String eNAME = "company"; - - /** - * The package namespace URI. - * - * - * @generated - */ - public static final String eNS_URI = "org.apache.tuscany.das.rdb.test/company.xsd"; - - /** - * The package namespace name. - * - * - * @generated - */ - public static final String eNS_PREFIX = "company"; - - /** - * The singleton instance of the package. - * - * - * @generated - */ - public static final CompanyPackageImpl eINSTANCE = org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl.init(); - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.test.company.impl.CompanyTypeImpl Type}' class. - * - * - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyTypeImpl - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#getCompanyType() - * @generated - */ - public static final int COMPANY_TYPE = 0; - - /** - * The feature id for the 'Departments' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int COMPANY_TYPE__DEPARTMENTS = 0; - - /** - * The feature id for the 'Employee Of The Month' attribute. - * - * - * @generated - * @ordered - */ - public static final int COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH = 1; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int COMPANY_TYPE__NAME = 2; - - /** - * The number of structural features of the 'Type' class. - * - * - * @generated - * @ordered - */ - public static final int COMPANY_TYPE_FEATURE_COUNT = 3; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.test.company.impl.DatagraphRootImpl Datagraph Root}' class. - * - * - * @see org.apache.tuscany.das.rdb.test.company.impl.DatagraphRootImpl - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#getDatagraphRoot() - * @generated - */ - public static final int DATAGRAPH_ROOT = 1; - - /** - * The feature id for the 'Companies' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int DATAGRAPH_ROOT__COMPANIES = 0; - - /** - * The feature id for the 'Departments' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int DATAGRAPH_ROOT__DEPARTMENTS = 1; - - /** - * The feature id for the 'Employees' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int DATAGRAPH_ROOT__EMPLOYEES = 2; - - /** - * The number of structural features of the 'Datagraph Root' class. - * - * - * @generated - * @ordered - */ - public static final int DATAGRAPH_ROOT_FEATURE_COUNT = 3; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.test.company.impl.DepartmentTypeImpl Department Type}' class. - * - * - * @see org.apache.tuscany.das.rdb.test.company.impl.DepartmentTypeImpl - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#getDepartmentType() - * @generated - */ - public static final int DEPARTMENT_TYPE = 2; - - /** - * The feature id for the 'Employees' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int DEPARTMENT_TYPE__EMPLOYEES = 0; - - /** - * The feature id for the 'Location' attribute. - * - * - * @generated - * @ordered - */ - public static final int DEPARTMENT_TYPE__LOCATION = 1; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int DEPARTMENT_TYPE__NAME = 2; - - /** - * The feature id for the 'Number' attribute. - * - * - * @generated - * @ordered - */ - public static final int DEPARTMENT_TYPE__NUMBER = 3; - - /** - * The number of structural features of the 'Department Type' class. - * - * - * @generated - * @ordered - */ - public static final int DEPARTMENT_TYPE_FEATURE_COUNT = 4; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.test.company.impl.DocumentRootImpl Document Root}' class. - * - * - * @see org.apache.tuscany.das.rdb.test.company.impl.DocumentRootImpl - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#getDocumentRoot() - * @generated - */ - public static final int DOCUMENT_ROOT = 3; - - /** - * The feature id for the 'Mixed' attribute list. - * - * - * @generated - * @ordered - */ - public static final int DOCUMENT_ROOT__MIXED = 0; - - /** - * The feature id for the 'XMLNS Prefix Map' map. - * - * - * @generated - * @ordered - */ - public static final int DOCUMENT_ROOT__XMLNS_PREFIX_MAP = 1; - - /** - * The feature id for the 'XSI Schema Location' map. - * - * - * @generated - * @ordered - */ - public static final int DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = 2; - - /** - * The feature id for the 'Company' containment reference. - * - * - * @generated - * @ordered - */ - public static final int DOCUMENT_ROOT__COMPANY = 3; - - /** - * The number of structural features of the 'Document Root' class. - * - * - * @generated - * @ordered - */ - public static final int DOCUMENT_ROOT_FEATURE_COUNT = 4; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.test.company.impl.EmployeeTypeImpl Employee Type}' class. - * - * - * @see org.apache.tuscany.das.rdb.test.company.impl.EmployeeTypeImpl - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#getEmployeeType() - * @generated - */ - public static final int EMPLOYEE_TYPE = 4; - - /** - * The feature id for the 'Manager' attribute. - * - * - * @generated - * @ordered - */ - public static final int EMPLOYEE_TYPE__MANAGER = 0; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int EMPLOYEE_TYPE__NAME = 1; - - /** - * The feature id for the 'SN' attribute. - * - * - * @generated - * @ordered - */ - public static final int EMPLOYEE_TYPE__SN = 2; - - /** - * The number of structural features of the 'Employee Type' class. - * - * - * @generated - * @ordered - */ - public static final int EMPLOYEE_TYPE_FEATURE_COUNT = 3; - - /** - * - * - * @generated - */ - private EClass companyTypeEClass = null; - - /** - * - * - * @generated - */ - private EClass datagraphRootEClass = null; - - /** - * - * - * @generated - */ - private EClass departmentTypeEClass = null; - - /** - * - * - * @generated - */ - private EClass documentRootEClass = null; - - /** - * - * - * @generated - */ - private EClass employeeTypeEClass = null; - - /** - * Creates an instance of the model Package, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - *

Note: the correct way to create the package is via the static - * factory method {@link #init init()}, which also performs - * initialization of the package, or returns the registered package, - * if one already exists. - * - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#eNS_URI - * @see #init() - * @generated - */ - private CompanyPackageImpl() - { - super(eNS_URI, ((EFactory)CompanyFactory.INSTANCE)); - } - - /** - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this - * model, and for any others upon which it depends. Simple - * dependencies are satisfied by calling this method on all - * dependent packages before doing anything else. This method drives - * initialization for interdependent packages directly, in parallel - * with this package, itself. - *

Of this package and its interdependencies, all packages which - * have not yet been registered by their URI values are first created - * and registered. The packages are then initialized in two steps: - * meta-model objects for all of the packages are created before any - * are initialized, since one package's meta-model objects may refer to - * those of another. - *

Invocation of this method will not affect any packages that have - * already been initialized. - * - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static CompanyPackageImpl init() - { - if (isInited) return (CompanyPackageImpl)EPackage.Registry.INSTANCE.getEPackage(CompanyPackageImpl.eNS_URI); - - // Obtain or create and register package - CompanyPackageImpl theCompanyPackageImpl = (CompanyPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof CompanyPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new CompanyPackageImpl()); - - isInited = true; - - // Initialize simple dependencies - XMLTypePackage.eINSTANCE.eClass(); - - // Create package meta-data objects - theCompanyPackageImpl.createPackageContents(); - - // Initialize created meta-data - theCompanyPackageImpl.initializePackageContents(); - - // Mark meta-data to indicate it can't be changed - theCompanyPackageImpl.freeze(); - - return theCompanyPackageImpl; - } - - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.test.company.CompanyType Type}'. - * - * - * @return the meta object for class 'Type'. - * @see org.apache.tuscany.das.rdb.test.company.CompanyType - * @generated - */ - public EClass getCompanyType() - { - return companyTypeEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.test.company.CompanyType#getDepartments Departments}'. - * - * - * @return the meta object for the containment reference list 'Departments'. - * @see org.apache.tuscany.das.rdb.test.company.CompanyType#getDepartments() - * @see #getCompanyType() - * @generated - */ - public EReference getCompanyType_Departments() - { - return (EReference)companyTypeEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.company.CompanyType#getEmployeeOfTheMonth Employee Of The Month}'. - * - * - * @return the meta object for the attribute 'Employee Of The Month'. - * @see org.apache.tuscany.das.rdb.test.company.CompanyType#getEmployeeOfTheMonth() - * @see #getCompanyType() - * @generated - */ - public EAttribute getCompanyType_EmployeeOfTheMonth() - { - return (EAttribute)companyTypeEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.company.CompanyType#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.apache.tuscany.das.rdb.test.company.CompanyType#getName() - * @see #getCompanyType() - * @generated - */ - public EAttribute getCompanyType_Name() - { - return (EAttribute)companyTypeEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.test.company.DatagraphRoot Datagraph Root}'. - * - * - * @return the meta object for class 'Datagraph Root'. - * @see org.apache.tuscany.das.rdb.test.company.DatagraphRoot - * @generated - */ - public EClass getDatagraphRoot() - { - return datagraphRootEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.test.company.DatagraphRoot#getCompanies Companies}'. - * - * - * @return the meta object for the containment reference list 'Companies'. - * @see org.apache.tuscany.das.rdb.test.company.DatagraphRoot#getCompanies() - * @see #getDatagraphRoot() - * @generated - */ - public EReference getDatagraphRoot_Companies() - { - return (EReference)datagraphRootEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.test.company.DatagraphRoot#getDepartments Departments}'. - * - * - * @return the meta object for the containment reference list 'Departments'. - * @see org.apache.tuscany.das.rdb.test.company.DatagraphRoot#getDepartments() - * @see #getDatagraphRoot() - * @generated - */ - public EReference getDatagraphRoot_Departments() - { - return (EReference)datagraphRootEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.test.company.DatagraphRoot#getEmployees Employees}'. - * - * - * @return the meta object for the containment reference list 'Employees'. - * @see org.apache.tuscany.das.rdb.test.company.DatagraphRoot#getEmployees() - * @see #getDatagraphRoot() - * @generated - */ - public EReference getDatagraphRoot_Employees() - { - return (EReference)datagraphRootEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.test.company.DepartmentType Department Type}'. - * - * - * @return the meta object for class 'Department Type'. - * @see org.apache.tuscany.das.rdb.test.company.DepartmentType - * @generated - */ - public EClass getDepartmentType() - { - return departmentTypeEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getEmployees Employees}'. - * - * - * @return the meta object for the containment reference list 'Employees'. - * @see org.apache.tuscany.das.rdb.test.company.DepartmentType#getEmployees() - * @see #getDepartmentType() - * @generated - */ - public EReference getDepartmentType_Employees() - { - return (EReference)departmentTypeEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getLocation Location}'. - * - * - * @return the meta object for the attribute 'Location'. - * @see org.apache.tuscany.das.rdb.test.company.DepartmentType#getLocation() - * @see #getDepartmentType() - * @generated - */ - public EAttribute getDepartmentType_Location() - { - return (EAttribute)departmentTypeEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.apache.tuscany.das.rdb.test.company.DepartmentType#getName() - * @see #getDepartmentType() - * @generated - */ - public EAttribute getDepartmentType_Name() - { - return (EAttribute)departmentTypeEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.company.DepartmentType#getNumber Number}'. - * - * - * @return the meta object for the attribute 'Number'. - * @see org.apache.tuscany.das.rdb.test.company.DepartmentType#getNumber() - * @see #getDepartmentType() - * @generated - */ - public EAttribute getDepartmentType_Number() - { - return (EAttribute)departmentTypeEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for class '{@link org.eclipse.emf.ecore.EObject Document Root}'. - * - * - * @return the meta object for class 'Document Root'. - * @see org.eclipse.emf.ecore.EObject - * @generated - */ - public EClass getDocumentRoot() - { - return documentRootEClass; - } - - /** - * Returns the meta object for the attribute list '{@link org.eclipse.emf.ecore.EObject#getMixed Mixed}'. - * - * - * @return the meta object for the attribute list 'Mixed'. - * @see org.eclipse.emf.ecore.EObject#getMixed() - * @see #getDocumentRoot() - * @generated - */ - public EAttribute getDocumentRoot_Mixed() - { - return (EAttribute)documentRootEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the map '{@link org.eclipse.emf.ecore.EObject#getXMLNSPrefixMap XMLNS Prefix Map}'. - * - * - * @return the meta object for the map 'XMLNS Prefix Map'. - * @see org.eclipse.emf.ecore.EObject#getXMLNSPrefixMap() - * @see #getDocumentRoot() - * @generated - */ - public EReference getDocumentRoot_XMLNSPrefixMap() - { - return (EReference)documentRootEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the map '{@link org.eclipse.emf.ecore.EObject#getXSISchemaLocation XSI Schema Location}'. - * - * - * @return the meta object for the map 'XSI Schema Location'. - * @see org.eclipse.emf.ecore.EObject#getXSISchemaLocation() - * @see #getDocumentRoot() - * @generated - */ - public EReference getDocumentRoot_XSISchemaLocation() - { - return (EReference)documentRootEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.emf.ecore.EObject#getCompany Company}'. - * - * - * @return the meta object for the containment reference 'Company'. - * @see org.eclipse.emf.ecore.EObject#getCompany() - * @see #getDocumentRoot() - * @generated - */ - public EReference getDocumentRoot_Company() - { - return (EReference)documentRootEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.test.company.EmployeeType Employee Type}'. - * - * - * @return the meta object for class 'Employee Type'. - * @see org.apache.tuscany.das.rdb.test.company.EmployeeType - * @generated - */ - public EClass getEmployeeType() - { - return employeeTypeEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.company.EmployeeType#isManager Manager}'. - * - * - * @return the meta object for the attribute 'Manager'. - * @see org.apache.tuscany.das.rdb.test.company.EmployeeType#isManager() - * @see #getEmployeeType() - * @generated - */ - public EAttribute getEmployeeType_Manager() - { - return (EAttribute)employeeTypeEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.company.EmployeeType#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.apache.tuscany.das.rdb.test.company.EmployeeType#getName() - * @see #getEmployeeType() - * @generated - */ - public EAttribute getEmployeeType_Name() - { - return (EAttribute)employeeTypeEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.company.EmployeeType#getSN SN}'. - * - * - * @return the meta object for the attribute 'SN'. - * @see org.apache.tuscany.das.rdb.test.company.EmployeeType#getSN() - * @see #getEmployeeType() - * @generated - */ - public EAttribute getEmployeeType_SN() - { - return (EAttribute)employeeTypeEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - public CompanyFactory getCompanyFactory() - { - return (CompanyFactory)getEFactoryInstance(); - } - - /** - * - * - * @generated - */ - private boolean isCreated = false; - - /** - * Creates the meta-model objects for the package. This method is - * guarded to have no affect on any invocation but its first. - * - * - * @generated - */ - public void createPackageContents() - { - if (isCreated) return; - isCreated = true; - - // Create classes and their features - companyTypeEClass = createEClass(COMPANY_TYPE); - createEReference(companyTypeEClass, COMPANY_TYPE__DEPARTMENTS); - createEAttribute(companyTypeEClass, COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH); - createEAttribute(companyTypeEClass, COMPANY_TYPE__NAME); - - datagraphRootEClass = createEClass(DATAGRAPH_ROOT); - createEReference(datagraphRootEClass, DATAGRAPH_ROOT__COMPANIES); - createEReference(datagraphRootEClass, DATAGRAPH_ROOT__DEPARTMENTS); - createEReference(datagraphRootEClass, DATAGRAPH_ROOT__EMPLOYEES); - - departmentTypeEClass = createEClass(DEPARTMENT_TYPE); - createEReference(departmentTypeEClass, DEPARTMENT_TYPE__EMPLOYEES); - createEAttribute(departmentTypeEClass, DEPARTMENT_TYPE__LOCATION); - createEAttribute(departmentTypeEClass, DEPARTMENT_TYPE__NAME); - createEAttribute(departmentTypeEClass, DEPARTMENT_TYPE__NUMBER); - - documentRootEClass = createEClass(DOCUMENT_ROOT); - createEAttribute(documentRootEClass, DOCUMENT_ROOT__MIXED); - createEReference(documentRootEClass, DOCUMENT_ROOT__XMLNS_PREFIX_MAP); - createEReference(documentRootEClass, DOCUMENT_ROOT__XSI_SCHEMA_LOCATION); - createEReference(documentRootEClass, DOCUMENT_ROOT__COMPANY); - - employeeTypeEClass = createEClass(EMPLOYEE_TYPE); - createEAttribute(employeeTypeEClass, EMPLOYEE_TYPE__MANAGER); - createEAttribute(employeeTypeEClass, EMPLOYEE_TYPE__NAME); - createEAttribute(employeeTypeEClass, EMPLOYEE_TYPE__SN); - } - - /** - * - * - * @generated - */ - private boolean isInitialized = false; - - /** - * Complete the initialization of the package and its meta-model. This - * method is guarded to have no affect on any invocation but its first. - * - * - * @generated - */ - public void initializePackageContents() - { - if (isInitialized) return; - isInitialized = true; - - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - - // Obtain other dependent packages - XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); - - // Add supertypes to classes - - // Initialize classes and features; add operations and parameters - initEClass(companyTypeEClass, CompanyType.class, "CompanyType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getCompanyType_Departments(), this.getDepartmentType(), null, "departments", null, 1, -1, CompanyType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCompanyType_EmployeeOfTheMonth(), theXMLTypePackage.getIDREF(), "employeeOfTheMonth", null, 0, 1, CompanyType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCompanyType_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, CompanyType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(datagraphRootEClass, DatagraphRoot.class, "DatagraphRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getDatagraphRoot_Companies(), this.getCompanyType(), null, "companies", null, 0, -1, DatagraphRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDatagraphRoot_Departments(), this.getDepartmentType(), null, "departments", null, 0, -1, DatagraphRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDatagraphRoot_Employees(), this.getEmployeeType(), null, "employees", null, 0, -1, DatagraphRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(departmentTypeEClass, DepartmentType.class, "DepartmentType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getDepartmentType_Employees(), this.getEmployeeType(), null, "employees", null, 1, -1, DepartmentType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getDepartmentType_Location(), theXMLTypePackage.getString(), "location", null, 0, 1, DepartmentType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getDepartmentType_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, DepartmentType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getDepartmentType_Number(), theXMLTypePackage.getInt(), "number", null, 0, 1, DepartmentType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(documentRootEClass, null, "DocumentRoot", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getDocumentRoot_Mixed(), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDocumentRoot_XMLNSPrefixMap(), ecorePackage.getEStringToStringMapEntry(), null, "xMLNSPrefixMap", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDocumentRoot_XSISchemaLocation(), ecorePackage.getEStringToStringMapEntry(), null, "xSISchemaLocation", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDocumentRoot_Company(), this.getCompanyType(), null, "company", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - - initEClass(employeeTypeEClass, EmployeeType.class, "EmployeeType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getEmployeeType_Manager(), theXMLTypePackage.getBoolean(), "manager", null, 0, 1, EmployeeType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getEmployeeType_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, EmployeeType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getEmployeeType_SN(), theXMLTypePackage.getID(), "sN", null, 0, 1, EmployeeType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - // Create resource - createResource(eNS_URI); - - // Create annotations - // http:///org/eclipse/emf/ecore/util/ExtendedMetaData - createExtendedMetaDataAnnotations(); - } - - /** - * Initializes the annotations for http:///org/eclipse/emf/ecore/util/ExtendedMetaData. - * - * - * @generated - */ - protected void createExtendedMetaDataAnnotations() - { - String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; - addAnnotation - (companyTypeEClass, - source, - new String[] - { - "name", "CompanyType", - "kind", "elementOnly" - }); - addAnnotation - (getCompanyType_Departments(), - source, - new String[] - { - "kind", "element", - "name", "departments" - }); - addAnnotation - (getCompanyType_EmployeeOfTheMonth(), - source, - new String[] - { - "kind", "attribute", - "name", "employeeOfTheMonth" - }); - addAnnotation - (getCompanyType_Name(), - source, - new String[] - { - "kind", "attribute", - "name", "name" - }); - addAnnotation - (datagraphRootEClass, - source, - new String[] - { - "name", "DatagraphRoot", - "kind", "elementOnly" - }); - addAnnotation - (getDatagraphRoot_Companies(), - source, - new String[] - { - "kind", "element", - "name", "companies" - }); - addAnnotation - (getDatagraphRoot_Departments(), - source, - new String[] - { - "kind", "element", - "name", "departments" - }); - addAnnotation - (getDatagraphRoot_Employees(), - source, - new String[] - { - "kind", "element", - "name", "employees" - }); - addAnnotation - (departmentTypeEClass, - source, - new String[] - { - "name", "DepartmentType", - "kind", "elementOnly" - }); - addAnnotation - (getDepartmentType_Employees(), - source, - new String[] - { - "kind", "element", - "name", "employees" - }); - addAnnotation - (getDepartmentType_Location(), - source, - new String[] - { - "kind", "attribute", - "name", "location" - }); - addAnnotation - (getDepartmentType_Name(), - source, - new String[] - { - "kind", "attribute", - "name", "name" - }); - addAnnotation - (getDepartmentType_Number(), - source, - new String[] - { - "kind", "attribute", - "name", "number" - }); - addAnnotation - (documentRootEClass, - source, - new String[] - { - "name", "", - "kind", "mixed" - }); - addAnnotation - (getDocumentRoot_Mixed(), - source, - new String[] - { - "kind", "elementWildcard", - "name", ":mixed" - }); - addAnnotation - (getDocumentRoot_XMLNSPrefixMap(), - source, - new String[] - { - "kind", "attribute", - "name", "xmlns:prefix" - }); - addAnnotation - (getDocumentRoot_XSISchemaLocation(), - source, - new String[] - { - "kind", "attribute", - "name", "xsi:schemaLocation" - }); - addAnnotation - (getDocumentRoot_Company(), - source, - new String[] - { - "kind", "element", - "name", "company", - "namespace", "##targetNamespace" - }); - addAnnotation - (employeeTypeEClass, - source, - new String[] - { - "name", "EmployeeType", - "kind", "empty" - }); - addAnnotation - (getEmployeeType_Manager(), - source, - new String[] - { - "kind", "attribute", - "name", "manager" - }); - addAnnotation - (getEmployeeType_Name(), - source, - new String[] - { - "kind", "attribute", - "name", "name" - }); - addAnnotation - (getEmployeeType_SN(), - source, - new String[] - { - "kind", "attribute", - "name", "SN" - }); - } - - /** - * - * Defines literals for the meta objects that represent - *

    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @generated - */ - public interface Literals - { - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.test.company.impl.CompanyTypeImpl Type}' class. - * - * - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyTypeImpl - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#getCompanyType() - * @generated - */ - public static final EClass COMPANY_TYPE = eINSTANCE.getCompanyType(); - - /** - * The meta object literal for the 'Departments' containment reference list feature. - * - * - * @generated - */ - public static final EReference COMPANY_TYPE__DEPARTMENTS = eINSTANCE.getCompanyType_Departments(); - - /** - * The meta object literal for the 'Employee Of The Month' attribute feature. - * - * - * @generated - */ - public static final EAttribute COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH = eINSTANCE.getCompanyType_EmployeeOfTheMonth(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute COMPANY_TYPE__NAME = eINSTANCE.getCompanyType_Name(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.test.company.impl.DatagraphRootImpl Datagraph Root}' class. - * - * - * @see org.apache.tuscany.das.rdb.test.company.impl.DatagraphRootImpl - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#getDatagraphRoot() - * @generated - */ - public static final EClass DATAGRAPH_ROOT = eINSTANCE.getDatagraphRoot(); - - /** - * The meta object literal for the 'Companies' containment reference list feature. - * - * - * @generated - */ - public static final EReference DATAGRAPH_ROOT__COMPANIES = eINSTANCE.getDatagraphRoot_Companies(); - - /** - * The meta object literal for the 'Departments' containment reference list feature. - * - * - * @generated - */ - public static final EReference DATAGRAPH_ROOT__DEPARTMENTS = eINSTANCE.getDatagraphRoot_Departments(); - - /** - * The meta object literal for the 'Employees' containment reference list feature. - * - * - * @generated - */ - public static final EReference DATAGRAPH_ROOT__EMPLOYEES = eINSTANCE.getDatagraphRoot_Employees(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.test.company.impl.DepartmentTypeImpl Department Type}' class. - * - * - * @see org.apache.tuscany.das.rdb.test.company.impl.DepartmentTypeImpl - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#getDepartmentType() - * @generated - */ - public static final EClass DEPARTMENT_TYPE = eINSTANCE.getDepartmentType(); - - /** - * The meta object literal for the 'Employees' containment reference list feature. - * - * - * @generated - */ - public static final EReference DEPARTMENT_TYPE__EMPLOYEES = eINSTANCE.getDepartmentType_Employees(); - - /** - * The meta object literal for the 'Location' attribute feature. - * - * - * @generated - */ - public static final EAttribute DEPARTMENT_TYPE__LOCATION = eINSTANCE.getDepartmentType_Location(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute DEPARTMENT_TYPE__NAME = eINSTANCE.getDepartmentType_Name(); - - /** - * The meta object literal for the 'Number' attribute feature. - * - * - * @generated - */ - public static final EAttribute DEPARTMENT_TYPE__NUMBER = eINSTANCE.getDepartmentType_Number(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.test.company.impl.DocumentRootImpl Document Root}' class. - * - * - * @see org.apache.tuscany.das.rdb.test.company.impl.DocumentRootImpl - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#getDocumentRoot() - * @generated - */ - public static final EClass DOCUMENT_ROOT = eINSTANCE.getDocumentRoot(); - - /** - * The meta object literal for the 'Mixed' attribute list feature. - * - * - * @generated - */ - public static final EAttribute DOCUMENT_ROOT__MIXED = eINSTANCE.getDocumentRoot_Mixed(); - - /** - * The meta object literal for the 'XMLNS Prefix Map' map feature. - * - * - * @generated - */ - public static final EReference DOCUMENT_ROOT__XMLNS_PREFIX_MAP = eINSTANCE.getDocumentRoot_XMLNSPrefixMap(); - - /** - * The meta object literal for the 'XSI Schema Location' map feature. - * - * - * @generated - */ - public static final EReference DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = eINSTANCE.getDocumentRoot_XSISchemaLocation(); - - /** - * The meta object literal for the 'Company' containment reference feature. - * - * - * @generated - */ - public static final EReference DOCUMENT_ROOT__COMPANY = eINSTANCE.getDocumentRoot_Company(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.test.company.impl.EmployeeTypeImpl Employee Type}' class. - * - * - * @see org.apache.tuscany.das.rdb.test.company.impl.EmployeeTypeImpl - * @see org.apache.tuscany.das.rdb.test.company.impl.CompanyPackageImpl#getEmployeeType() - * @generated - */ - public static final EClass EMPLOYEE_TYPE = eINSTANCE.getEmployeeType(); - - /** - * The meta object literal for the 'Manager' attribute feature. - * - * - * @generated - */ - public static final EAttribute EMPLOYEE_TYPE__MANAGER = eINSTANCE.getEmployeeType_Manager(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute EMPLOYEE_TYPE__NAME = eINSTANCE.getEmployeeType_Name(); - - /** - * The meta object literal for the 'SN' attribute feature. - * - * - * @generated - */ - public static final EAttribute EMPLOYEE_TYPE__SN = eINSTANCE.getEmployeeType_SN(); - - } - -} //CompanyPackageImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyTypeImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyTypeImpl.java deleted file mode 100644 index 6387e87dc8..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyTypeImpl.java +++ /dev/null @@ -1,293 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company.impl; - -import java.util.Collection; -import java.util.List; - -import org.apache.tuscany.das.rdb.test.company.CompanyType; -import org.apache.tuscany.das.rdb.test.company.DepartmentType; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * - * An implementation of the model object 'Type'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.apache.tuscany.das.rdb.test.company.impl.CompanyTypeImpl#getDepartments Departments}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.company.impl.CompanyTypeImpl#getEmployeeOfTheMonth Employee Of The Month}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.company.impl.CompanyTypeImpl#getName Name}
  • - *
- *

- * - * @generated - */ -public class CompanyTypeImpl extends DataObjectImpl implements CompanyType -{ - /** - * The cached value of the '{@link #getDepartments() Departments}' containment reference list. - * - * - * @see #getDepartments() - * @generated - * @ordered - */ - protected EList departments = null; - - /** - * The default value of the '{@link #getEmployeeOfTheMonth() Employee Of The Month}' attribute. - * - * - * @see #getEmployeeOfTheMonth() - * @generated - * @ordered - */ - protected static final String EMPLOYEE_OF_THE_MONTH_EDEFAULT = null; - - /** - * The cached value of the '{@link #getEmployeeOfTheMonth() Employee Of The Month}' attribute. - * - * - * @see #getEmployeeOfTheMonth() - * @generated - * @ordered - */ - protected String employeeOfTheMonth = EMPLOYEE_OF_THE_MONTH_EDEFAULT; - - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * - * - * @generated - */ - protected CompanyTypeImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return CompanyPackageImpl.Literals.COMPANY_TYPE; - } - - /** - * - * - * @generated - */ - public List getDepartments() - { - if (departments == null) - { - departments = new EObjectContainmentEList(DepartmentType.class, this, CompanyPackageImpl.COMPANY_TYPE__DEPARTMENTS); - } - return departments; - } - - /** - * - * - * @generated - */ - public String getEmployeeOfTheMonth() - { - return employeeOfTheMonth; - } - - /** - * - * - * @generated - */ - public void setEmployeeOfTheMonth(String newEmployeeOfTheMonth) - { - String oldEmployeeOfTheMonth = employeeOfTheMonth; - employeeOfTheMonth = newEmployeeOfTheMonth; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackageImpl.COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH, oldEmployeeOfTheMonth, employeeOfTheMonth)); - } - - /** - * - * - * @generated - */ - public String getName() - { - return name; - } - - /** - * - * - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackageImpl.COMPANY_TYPE__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case CompanyPackageImpl.COMPANY_TYPE__DEPARTMENTS: - return ((InternalEList)getDepartments()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case CompanyPackageImpl.COMPANY_TYPE__DEPARTMENTS: - return getDepartments(); - case CompanyPackageImpl.COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH: - return getEmployeeOfTheMonth(); - case CompanyPackageImpl.COMPANY_TYPE__NAME: - return getName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case CompanyPackageImpl.COMPANY_TYPE__DEPARTMENTS: - getDepartments().clear(); - getDepartments().addAll((Collection)newValue); - return; - case CompanyPackageImpl.COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH: - setEmployeeOfTheMonth((String)newValue); - return; - case CompanyPackageImpl.COMPANY_TYPE__NAME: - setName((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case CompanyPackageImpl.COMPANY_TYPE__DEPARTMENTS: - getDepartments().clear(); - return; - case CompanyPackageImpl.COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH: - setEmployeeOfTheMonth(EMPLOYEE_OF_THE_MONTH_EDEFAULT); - return; - case CompanyPackageImpl.COMPANY_TYPE__NAME: - setName(NAME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case CompanyPackageImpl.COMPANY_TYPE__DEPARTMENTS: - return departments != null && !departments.isEmpty(); - case CompanyPackageImpl.COMPANY_TYPE__EMPLOYEE_OF_THE_MONTH: - return EMPLOYEE_OF_THE_MONTH_EDEFAULT == null ? employeeOfTheMonth != null : !EMPLOYEE_OF_THE_MONTH_EDEFAULT.equals(employeeOfTheMonth); - case CompanyPackageImpl.COMPANY_TYPE__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (employeeOfTheMonth: "); - result.append(employeeOfTheMonth); - result.append(", name: "); - result.append(name); - result.append(')'); - return result.toString(); - } - -} //CompanyTypeImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/DatagraphRootImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/DatagraphRootImpl.java deleted file mode 100644 index 41e94ee4d3..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/DatagraphRootImpl.java +++ /dev/null @@ -1,242 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company.impl; - -import java.util.Collection; -import java.util.List; - -import org.apache.tuscany.das.rdb.test.company.CompanyType; -import org.apache.tuscany.das.rdb.test.company.DatagraphRoot; -import org.apache.tuscany.das.rdb.test.company.DepartmentType; -import org.apache.tuscany.das.rdb.test.company.EmployeeType; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * - * An implementation of the model object 'Datagraph Root'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.apache.tuscany.das.rdb.test.company.impl.DatagraphRootImpl#getCompanies Companies}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.company.impl.DatagraphRootImpl#getDepartments Departments}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.company.impl.DatagraphRootImpl#getEmployees Employees}
  • - *
- *

- * - * @generated - */ -public class DatagraphRootImpl extends DataObjectImpl implements DatagraphRoot -{ - /** - * The cached value of the '{@link #getCompanies() Companies}' containment reference list. - * - * - * @see #getCompanies() - * @generated - * @ordered - */ - protected EList companies = null; - - /** - * The cached value of the '{@link #getDepartments() Departments}' containment reference list. - * - * - * @see #getDepartments() - * @generated - * @ordered - */ - protected EList departments = null; - - /** - * The cached value of the '{@link #getEmployees() Employees}' containment reference list. - * - * - * @see #getEmployees() - * @generated - * @ordered - */ - protected EList employees = null; - - /** - * - * - * @generated - */ - protected DatagraphRootImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return CompanyPackageImpl.Literals.DATAGRAPH_ROOT; - } - - /** - * - * - * @generated - */ - public List getCompanies() - { - if (companies == null) - { - companies = new EObjectContainmentEList(CompanyType.class, this, CompanyPackageImpl.DATAGRAPH_ROOT__COMPANIES); - } - return companies; - } - - /** - * - * - * @generated - */ - public List getDepartments() - { - if (departments == null) - { - departments = new EObjectContainmentEList(DepartmentType.class, this, CompanyPackageImpl.DATAGRAPH_ROOT__DEPARTMENTS); - } - return departments; - } - - /** - * - * - * @generated - */ - public List getEmployees() - { - if (employees == null) - { - employees = new EObjectContainmentEList(EmployeeType.class, this, CompanyPackageImpl.DATAGRAPH_ROOT__EMPLOYEES); - } - return employees; - } - - /** - * - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case CompanyPackageImpl.DATAGRAPH_ROOT__COMPANIES: - return ((InternalEList)getCompanies()).basicRemove(otherEnd, msgs); - case CompanyPackageImpl.DATAGRAPH_ROOT__DEPARTMENTS: - return ((InternalEList)getDepartments()).basicRemove(otherEnd, msgs); - case CompanyPackageImpl.DATAGRAPH_ROOT__EMPLOYEES: - return ((InternalEList)getEmployees()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case CompanyPackageImpl.DATAGRAPH_ROOT__COMPANIES: - return getCompanies(); - case CompanyPackageImpl.DATAGRAPH_ROOT__DEPARTMENTS: - return getDepartments(); - case CompanyPackageImpl.DATAGRAPH_ROOT__EMPLOYEES: - return getEmployees(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case CompanyPackageImpl.DATAGRAPH_ROOT__COMPANIES: - getCompanies().clear(); - getCompanies().addAll((Collection)newValue); - return; - case CompanyPackageImpl.DATAGRAPH_ROOT__DEPARTMENTS: - getDepartments().clear(); - getDepartments().addAll((Collection)newValue); - return; - case CompanyPackageImpl.DATAGRAPH_ROOT__EMPLOYEES: - getEmployees().clear(); - getEmployees().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case CompanyPackageImpl.DATAGRAPH_ROOT__COMPANIES: - getCompanies().clear(); - return; - case CompanyPackageImpl.DATAGRAPH_ROOT__DEPARTMENTS: - getDepartments().clear(); - return; - case CompanyPackageImpl.DATAGRAPH_ROOT__EMPLOYEES: - getEmployees().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case CompanyPackageImpl.DATAGRAPH_ROOT__COMPANIES: - return companies != null && !companies.isEmpty(); - case CompanyPackageImpl.DATAGRAPH_ROOT__DEPARTMENTS: - return departments != null && !departments.isEmpty(); - case CompanyPackageImpl.DATAGRAPH_ROOT__EMPLOYEES: - return employees != null && !employees.isEmpty(); - } - return super.eIsSet(featureID); - } - -} //DatagraphRootImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/DepartmentTypeImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/DepartmentTypeImpl.java deleted file mode 100644 index aed8ff1325..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/DepartmentTypeImpl.java +++ /dev/null @@ -1,385 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company.impl; - -import java.util.Collection; -import java.util.List; - -import org.apache.tuscany.das.rdb.test.company.DepartmentType; -import org.apache.tuscany.das.rdb.test.company.EmployeeType; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * - * An implementation of the model object 'Department Type'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.apache.tuscany.das.rdb.test.company.impl.DepartmentTypeImpl#getEmployees Employees}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.company.impl.DepartmentTypeImpl#getLocation Location}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.company.impl.DepartmentTypeImpl#getName Name}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.company.impl.DepartmentTypeImpl#getNumber Number}
  • - *
- *

- * - * @generated - */ -public class DepartmentTypeImpl extends DataObjectImpl implements DepartmentType -{ - /** - * The cached value of the '{@link #getEmployees() Employees}' containment reference list. - * - * - * @see #getEmployees() - * @generated - * @ordered - */ - protected EList employees = null; - - /** - * The default value of the '{@link #getLocation() Location}' attribute. - * - * - * @see #getLocation() - * @generated - * @ordered - */ - protected static final String LOCATION_EDEFAULT = null; - - /** - * The cached value of the '{@link #getLocation() Location}' attribute. - * - * - * @see #getLocation() - * @generated - * @ordered - */ - protected String location = LOCATION_EDEFAULT; - - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getNumber() Number}' attribute. - * - * - * @see #getNumber() - * @generated - * @ordered - */ - protected static final int NUMBER_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getNumber() Number}' attribute. - * - * - * @see #getNumber() - * @generated - * @ordered - */ - protected int number = NUMBER_EDEFAULT; - - /** - * This is true if the Number attribute has been set. - * - * - * @generated - * @ordered - */ - protected boolean numberESet = false; - - /** - * - * - * @generated - */ - protected DepartmentTypeImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return CompanyPackageImpl.Literals.DEPARTMENT_TYPE; - } - - /** - * - * - * @generated - */ - public List getEmployees() - { - if (employees == null) - { - employees = new EObjectContainmentEList(EmployeeType.class, this, CompanyPackageImpl.DEPARTMENT_TYPE__EMPLOYEES); - } - return employees; - } - - /** - * - * - * @generated - */ - public String getLocation() - { - return location; - } - - /** - * - * - * @generated - */ - public void setLocation(String newLocation) - { - String oldLocation = location; - location = newLocation; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackageImpl.DEPARTMENT_TYPE__LOCATION, oldLocation, location)); - } - - /** - * - * - * @generated - */ - public String getName() - { - return name; - } - - /** - * - * - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackageImpl.DEPARTMENT_TYPE__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - public int getNumber() - { - return number; - } - - /** - * - * - * @generated - */ - public void setNumber(int newNumber) - { - int oldNumber = number; - number = newNumber; - boolean oldNumberESet = numberESet; - numberESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackageImpl.DEPARTMENT_TYPE__NUMBER, oldNumber, number, !oldNumberESet)); - } - - /** - * - * - * @generated - */ - public void unsetNumber() - { - int oldNumber = number; - boolean oldNumberESet = numberESet; - number = NUMBER_EDEFAULT; - numberESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, CompanyPackageImpl.DEPARTMENT_TYPE__NUMBER, oldNumber, NUMBER_EDEFAULT, oldNumberESet)); - } - - /** - * - * - * @generated - */ - public boolean isSetNumber() - { - return numberESet; - } - - /** - * - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case CompanyPackageImpl.DEPARTMENT_TYPE__EMPLOYEES: - return ((InternalEList)getEmployees()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case CompanyPackageImpl.DEPARTMENT_TYPE__EMPLOYEES: - return getEmployees(); - case CompanyPackageImpl.DEPARTMENT_TYPE__LOCATION: - return getLocation(); - case CompanyPackageImpl.DEPARTMENT_TYPE__NAME: - return getName(); - case CompanyPackageImpl.DEPARTMENT_TYPE__NUMBER: - return new Integer(getNumber()); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case CompanyPackageImpl.DEPARTMENT_TYPE__EMPLOYEES: - getEmployees().clear(); - getEmployees().addAll((Collection)newValue); - return; - case CompanyPackageImpl.DEPARTMENT_TYPE__LOCATION: - setLocation((String)newValue); - return; - case CompanyPackageImpl.DEPARTMENT_TYPE__NAME: - setName((String)newValue); - return; - case CompanyPackageImpl.DEPARTMENT_TYPE__NUMBER: - setNumber(((Integer)newValue).intValue()); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case CompanyPackageImpl.DEPARTMENT_TYPE__EMPLOYEES: - getEmployees().clear(); - return; - case CompanyPackageImpl.DEPARTMENT_TYPE__LOCATION: - setLocation(LOCATION_EDEFAULT); - return; - case CompanyPackageImpl.DEPARTMENT_TYPE__NAME: - setName(NAME_EDEFAULT); - return; - case CompanyPackageImpl.DEPARTMENT_TYPE__NUMBER: - unsetNumber(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case CompanyPackageImpl.DEPARTMENT_TYPE__EMPLOYEES: - return employees != null && !employees.isEmpty(); - case CompanyPackageImpl.DEPARTMENT_TYPE__LOCATION: - return LOCATION_EDEFAULT == null ? location != null : !LOCATION_EDEFAULT.equals(location); - case CompanyPackageImpl.DEPARTMENT_TYPE__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case CompanyPackageImpl.DEPARTMENT_TYPE__NUMBER: - return isSetNumber(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (location: "); - result.append(location); - result.append(", name: "); - result.append(name); - result.append(", number: "); - if (numberESet) result.append(number); else result.append(""); - result.append(')'); - return result.toString(); - } - -} //DepartmentTypeImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/EmployeeTypeImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/EmployeeTypeImpl.java deleted file mode 100644 index a329f6a575..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/EmployeeTypeImpl.java +++ /dev/null @@ -1,323 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.company.impl; - -import org.apache.tuscany.das.rdb.test.company.EmployeeType; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -/** - * - * An implementation of the model object 'Employee Type'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.apache.tuscany.das.rdb.test.company.impl.EmployeeTypeImpl#isManager Manager}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.company.impl.EmployeeTypeImpl#getName Name}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.company.impl.EmployeeTypeImpl#getSN SN}
  • - *
- *

- * - * @generated - */ -public class EmployeeTypeImpl extends DataObjectImpl implements EmployeeType -{ - /** - * The default value of the '{@link #isManager() Manager}' attribute. - * - * - * @see #isManager() - * @generated - * @ordered - */ - protected static final boolean MANAGER_EDEFAULT = false; - - /** - * The cached value of the '{@link #isManager() Manager}' attribute. - * - * - * @see #isManager() - * @generated - * @ordered - */ - protected boolean manager = MANAGER_EDEFAULT; - - /** - * This is true if the Manager attribute has been set. - * - * - * @generated - * @ordered - */ - protected boolean managerESet = false; - - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getSN() SN}' attribute. - * - * - * @see #getSN() - * @generated - * @ordered - */ - protected static final String SN_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSN() SN}' attribute. - * - * - * @see #getSN() - * @generated - * @ordered - */ - protected String sN = SN_EDEFAULT; - - /** - * - * - * @generated - */ - protected EmployeeTypeImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return CompanyPackageImpl.Literals.EMPLOYEE_TYPE; - } - - /** - * - * - * @generated - */ - public boolean isManager() - { - return manager; - } - - /** - * - * - * @generated - */ - public void setManager(boolean newManager) - { - boolean oldManager = manager; - manager = newManager; - boolean oldManagerESet = managerESet; - managerESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackageImpl.EMPLOYEE_TYPE__MANAGER, oldManager, manager, !oldManagerESet)); - } - - /** - * - * - * @generated - */ - public void unsetManager() - { - boolean oldManager = manager; - boolean oldManagerESet = managerESet; - manager = MANAGER_EDEFAULT; - managerESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, CompanyPackageImpl.EMPLOYEE_TYPE__MANAGER, oldManager, MANAGER_EDEFAULT, oldManagerESet)); - } - - /** - * - * - * @generated - */ - public boolean isSetManager() - { - return managerESet; - } - - /** - * - * - * @generated - */ - public String getName() - { - return name; - } - - /** - * - * - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackageImpl.EMPLOYEE_TYPE__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - public String getSN() - { - return sN; - } - - /** - * - * - * @generated - */ - public void setSN(String newSN) - { - String oldSN = sN; - sN = newSN; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackageImpl.EMPLOYEE_TYPE__SN, oldSN, sN)); - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case CompanyPackageImpl.EMPLOYEE_TYPE__MANAGER: - return isManager() ? Boolean.TRUE : Boolean.FALSE; - case CompanyPackageImpl.EMPLOYEE_TYPE__NAME: - return getName(); - case CompanyPackageImpl.EMPLOYEE_TYPE__SN: - return getSN(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case CompanyPackageImpl.EMPLOYEE_TYPE__MANAGER: - setManager(((Boolean)newValue).booleanValue()); - return; - case CompanyPackageImpl.EMPLOYEE_TYPE__NAME: - setName((String)newValue); - return; - case CompanyPackageImpl.EMPLOYEE_TYPE__SN: - setSN((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case CompanyPackageImpl.EMPLOYEE_TYPE__MANAGER: - unsetManager(); - return; - case CompanyPackageImpl.EMPLOYEE_TYPE__NAME: - setName(NAME_EDEFAULT); - return; - case CompanyPackageImpl.EMPLOYEE_TYPE__SN: - setSN(SN_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case CompanyPackageImpl.EMPLOYEE_TYPE__MANAGER: - return isSetManager(); - case CompanyPackageImpl.EMPLOYEE_TYPE__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case CompanyPackageImpl.EMPLOYEE_TYPE__SN: - return SN_EDEFAULT == null ? sN != null : !SN_EDEFAULT.equals(sN); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (manager: "); - if (managerESet) result.append(manager); else result.append(""); - result.append(", name: "); - result.append(name); - result.append(", sN: "); - result.append(sN); - result.append(')'); - return result.toString(); - } - -} //EmployeeTypeImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/AnOrder.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/AnOrder.java deleted file mode 100644 index e08af66db2..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/AnOrder.java +++ /dev/null @@ -1,206 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.customer; - - -/** - * - * A representation of the model object 'An Order'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getID ID}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getProduct Product}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getQuantity Quantity}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getCustomerID Customer ID}
  • - *
- *

- * - * @generated - */ -public interface AnOrder -{ - /** - * Returns the value of the 'ID' attribute. - * - *

- * If the meaning of the 'ID' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'ID' attribute. - * @see #isSetID() - * @see #unsetID() - * @see #setID(int) - * @generated - */ - int getID(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getID ID}' attribute. - * - * - * @param value the new value of the 'ID' attribute. - * @see #isSetID() - * @see #unsetID() - * @see #getID() - * @generated - */ - void setID(int value); - - /** - * Unsets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getID ID}' attribute. - * - * - * @see #isSetID() - * @see #getID() - * @see #setID(int) - * @generated - */ - void unsetID(); - - /** - * Returns whether the value of the '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getID ID}' attribute is set. - * - * - * @return whether the value of the 'ID' attribute is set. - * @see #unsetID() - * @see #getID() - * @see #setID(int) - * @generated - */ - boolean isSetID(); - - /** - * Returns the value of the 'Product' attribute. - * - *

- * If the meaning of the 'Product' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Product' attribute. - * @see #setProduct(String) - * @generated - */ - String getProduct(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getProduct Product}' attribute. - * - * - * @param value the new value of the 'Product' attribute. - * @see #getProduct() - * @generated - */ - void setProduct(String value); - - /** - * Returns the value of the 'Quantity' attribute. - * - *

- * If the meaning of the 'Quantity' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Quantity' attribute. - * @see #isSetQuantity() - * @see #unsetQuantity() - * @see #setQuantity(int) - * @generated - */ - int getQuantity(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getQuantity Quantity}' attribute. - * - * - * @param value the new value of the 'Quantity' attribute. - * @see #isSetQuantity() - * @see #unsetQuantity() - * @see #getQuantity() - * @generated - */ - void setQuantity(int value); - - /** - * Unsets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getQuantity Quantity}' attribute. - * - * - * @see #isSetQuantity() - * @see #getQuantity() - * @see #setQuantity(int) - * @generated - */ - void unsetQuantity(); - - /** - * Returns whether the value of the '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getQuantity Quantity}' attribute is set. - * - * - * @return whether the value of the 'Quantity' attribute is set. - * @see #unsetQuantity() - * @see #getQuantity() - * @see #setQuantity(int) - * @generated - */ - boolean isSetQuantity(); - - /** - * Returns the value of the 'Customer ID' attribute. - * - *

- * If the meaning of the 'Customer ID' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Customer ID' attribute. - * @see #isSetCustomerID() - * @see #unsetCustomerID() - * @see #setCustomerID(int) - * @generated - */ - int getCustomerID(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getCustomerID Customer ID}' attribute. - * - * - * @param value the new value of the 'Customer ID' attribute. - * @see #isSetCustomerID() - * @see #unsetCustomerID() - * @see #getCustomerID() - * @generated - */ - void setCustomerID(int value); - - /** - * Unsets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getCustomerID Customer ID}' attribute. - * - * - * @see #isSetCustomerID() - * @see #getCustomerID() - * @see #setCustomerID(int) - * @generated - */ - void unsetCustomerID(); - - /** - * Returns whether the value of the '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getCustomerID Customer ID}' attribute is set. - * - * - * @return whether the value of the 'Customer ID' attribute is set. - * @see #unsetCustomerID() - * @see #getCustomerID() - * @see #setCustomerID(int) - * @generated - */ - boolean isSetCustomerID(); - -} // AnOrder diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/Customer.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/Customer.java deleted file mode 100644 index d34e220d34..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/Customer.java +++ /dev/null @@ -1,143 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.customer; - -import java.util.List; - -/** - * - * A representation of the model object 'Customer'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.apache.tuscany.das.rdb.test.customer.Customer#getID ID}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.customer.Customer#getLastName Last Name}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.customer.Customer#getAddress Address}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.customer.Customer#getOrders Orders}
  • - *
- *

- * - * @generated - */ -public interface Customer -{ - /** - * Returns the value of the 'ID' attribute. - * - *

- * If the meaning of the 'ID' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'ID' attribute. - * @see #isSetID() - * @see #unsetID() - * @see #setID(int) - * @generated - */ - int getID(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.Customer#getID ID}' attribute. - * - * - * @param value the new value of the 'ID' attribute. - * @see #isSetID() - * @see #unsetID() - * @see #getID() - * @generated - */ - void setID(int value); - - /** - * Unsets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.Customer#getID ID}' attribute. - * - * - * @see #isSetID() - * @see #getID() - * @see #setID(int) - * @generated - */ - void unsetID(); - - /** - * Returns whether the value of the '{@link org.apache.tuscany.das.rdb.test.customer.Customer#getID ID}' attribute is set. - * - * - * @return whether the value of the 'ID' attribute is set. - * @see #unsetID() - * @see #getID() - * @see #setID(int) - * @generated - */ - boolean isSetID(); - - /** - * Returns the value of the 'Last Name' attribute. - * - *

- * If the meaning of the 'Last Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Last Name' attribute. - * @see #setLastName(String) - * @generated - */ - String getLastName(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.Customer#getLastName Last Name}' attribute. - * - * - * @param value the new value of the 'Last Name' attribute. - * @see #getLastName() - * @generated - */ - void setLastName(String value); - - /** - * Returns the value of the 'Address' attribute. - * - *

- * If the meaning of the 'Address' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Address' attribute. - * @see #setAddress(String) - * @generated - */ - String getAddress(); - - /** - * Sets the value of the '{@link org.apache.tuscany.das.rdb.test.customer.Customer#getAddress Address}' attribute. - * - * - * @param value the new value of the 'Address' attribute. - * @see #getAddress() - * @generated - */ - void setAddress(String value); - - /** - * Returns the value of the 'Orders' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.test.customer.AnOrder}. - * - *

- * If the meaning of the 'Orders' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Orders' containment reference list. - * @generated - */ - List getOrders(); - -} // Customer diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/CustomerFactory.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/CustomerFactory.java deleted file mode 100644 index d0e20b6a55..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/CustomerFactory.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.customer; - - -/** - * - * The Factory for the model. - * It provides a create method for each non-abstract class of the model. - * - * @generated - */ -public interface CustomerFactory -{ - /** - * The singleton instance of the factory. - * - * - * @generated - */ - CustomerFactory INSTANCE = org.apache.tuscany.das.rdb.test.customer.impl.CustomerFactoryImpl.eINSTANCE; - - /** - * Returns a new object of class 'An Order'. - * - * - * @return a new object of class 'An Order'. - * @generated - */ - AnOrder createAnOrder(); - - /** - * Returns a new object of class 'Customer'. - * - * - * @return a new object of class 'Customer'. - * @generated - */ - Customer createCustomer(); - - /** - * Returns a new object of class 'Data Graph Root'. - * - * - * @return a new object of class 'Data Graph Root'. - * @generated - */ - DataGraphRoot createDataGraphRoot(); - -} //CustomerFactory diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/DataGraphRoot.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/DataGraphRoot.java deleted file mode 100644 index 6229ee605b..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/DataGraphRoot.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.customer; - -import java.util.List; - -/** - * - * A representation of the model object 'Data Graph Root'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.apache.tuscany.das.rdb.test.customer.DataGraphRoot#getCustomers Customers}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.customer.DataGraphRoot#getOrders Orders}
  • - *
- *

- * - * @generated - */ -public interface DataGraphRoot -{ - /** - * Returns the value of the 'Customers' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.test.customer.Customer}. - * - *

- * If the meaning of the 'Customers' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Customers' containment reference list. - * @generated - */ - List getCustomers(); - - /** - * Returns the value of the 'Orders' containment reference list. - * The list contents are of type {@link org.apache.tuscany.das.rdb.test.customer.AnOrder}. - * - *

- * If the meaning of the 'Orders' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Orders' containment reference list. - * @generated - */ - List getOrders(); - -} // DataGraphRoot diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/AnOrderImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/AnOrderImpl.java deleted file mode 100644 index 94f2ee9e61..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/AnOrderImpl.java +++ /dev/null @@ -1,451 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.customer.impl; - -import org.apache.tuscany.das.rdb.test.customer.AnOrder; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -/** - * - * An implementation of the model object 'An Order'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.apache.tuscany.das.rdb.test.customer.impl.AnOrderImpl#getID ID}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.customer.impl.AnOrderImpl#getProduct Product}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.customer.impl.AnOrderImpl#getQuantity Quantity}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.customer.impl.AnOrderImpl#getCustomerID Customer ID}
  • - *
- *

- * - * @generated - */ -public class AnOrderImpl extends DataObjectImpl implements AnOrder -{ - /** - * The default value of the '{@link #getID() ID}' attribute. - * - * - * @see #getID() - * @generated - * @ordered - */ - protected static final int ID_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getID() ID}' attribute. - * - * - * @see #getID() - * @generated - * @ordered - */ - protected int iD = ID_EDEFAULT; - - /** - * This is true if the ID attribute has been set. - * - * - * @generated - * @ordered - */ - protected boolean iDESet = false; - - /** - * The default value of the '{@link #getProduct() Product}' attribute. - * - * - * @see #getProduct() - * @generated - * @ordered - */ - protected static final String PRODUCT_EDEFAULT = null; - - /** - * The cached value of the '{@link #getProduct() Product}' attribute. - * - * - * @see #getProduct() - * @generated - * @ordered - */ - protected String product = PRODUCT_EDEFAULT; - - /** - * The default value of the '{@link #getQuantity() Quantity}' attribute. - * - * - * @see #getQuantity() - * @generated - * @ordered - */ - protected static final int QUANTITY_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getQuantity() Quantity}' attribute. - * - * - * @see #getQuantity() - * @generated - * @ordered - */ - protected int quantity = QUANTITY_EDEFAULT; - - /** - * This is true if the Quantity attribute has been set. - * - * - * @generated - * @ordered - */ - protected boolean quantityESet = false; - - /** - * The default value of the '{@link #getCustomerID() Customer ID}' attribute. - * - * - * @see #getCustomerID() - * @generated - * @ordered - */ - protected static final int CUSTOMER_ID_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getCustomerID() Customer ID}' attribute. - * - * - * @see #getCustomerID() - * @generated - * @ordered - */ - protected int customerID = CUSTOMER_ID_EDEFAULT; - - /** - * This is true if the Customer ID attribute has been set. - * - * - * @generated - * @ordered - */ - protected boolean customerIDESet = false; - - /** - * - * - * @generated - */ - protected AnOrderImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return CustomerPackageImpl.Literals.AN_ORDER; - } - - /** - * - * - * @generated - */ - public int getID() - { - return iD; - } - - /** - * - * - * @generated - */ - public void setID(int newID) - { - int oldID = iD; - iD = newID; - boolean oldIDESet = iDESet; - iDESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CustomerPackageImpl.AN_ORDER__ID, oldID, iD, !oldIDESet)); - } - - /** - * - * - * @generated - */ - public void unsetID() - { - int oldID = iD; - boolean oldIDESet = iDESet; - iD = ID_EDEFAULT; - iDESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, CustomerPackageImpl.AN_ORDER__ID, oldID, ID_EDEFAULT, oldIDESet)); - } - - /** - * - * - * @generated - */ - public boolean isSetID() - { - return iDESet; - } - - /** - * - * - * @generated - */ - public String getProduct() - { - return product; - } - - /** - * - * - * @generated - */ - public void setProduct(String newProduct) - { - String oldProduct = product; - product = newProduct; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CustomerPackageImpl.AN_ORDER__PRODUCT, oldProduct, product)); - } - - /** - * - * - * @generated - */ - public int getQuantity() - { - return quantity; - } - - /** - * - * - * @generated - */ - public void setQuantity(int newQuantity) - { - int oldQuantity = quantity; - quantity = newQuantity; - boolean oldQuantityESet = quantityESet; - quantityESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CustomerPackageImpl.AN_ORDER__QUANTITY, oldQuantity, quantity, !oldQuantityESet)); - } - - /** - * - * - * @generated - */ - public void unsetQuantity() - { - int oldQuantity = quantity; - boolean oldQuantityESet = quantityESet; - quantity = QUANTITY_EDEFAULT; - quantityESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, CustomerPackageImpl.AN_ORDER__QUANTITY, oldQuantity, QUANTITY_EDEFAULT, oldQuantityESet)); - } - - /** - * - * - * @generated - */ - public boolean isSetQuantity() - { - return quantityESet; - } - - /** - * - * - * @generated - */ - public int getCustomerID() - { - return customerID; - } - - /** - * - * - * @generated - */ - public void setCustomerID(int newCustomerID) - { - int oldCustomerID = customerID; - customerID = newCustomerID; - boolean oldCustomerIDESet = customerIDESet; - customerIDESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CustomerPackageImpl.AN_ORDER__CUSTOMER_ID, oldCustomerID, customerID, !oldCustomerIDESet)); - } - - /** - * - * - * @generated - */ - public void unsetCustomerID() - { - int oldCustomerID = customerID; - boolean oldCustomerIDESet = customerIDESet; - customerID = CUSTOMER_ID_EDEFAULT; - customerIDESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, CustomerPackageImpl.AN_ORDER__CUSTOMER_ID, oldCustomerID, CUSTOMER_ID_EDEFAULT, oldCustomerIDESet)); - } - - /** - * - * - * @generated - */ - public boolean isSetCustomerID() - { - return customerIDESet; - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case CustomerPackageImpl.AN_ORDER__ID: - return new Integer(getID()); - case CustomerPackageImpl.AN_ORDER__PRODUCT: - return getProduct(); - case CustomerPackageImpl.AN_ORDER__QUANTITY: - return new Integer(getQuantity()); - case CustomerPackageImpl.AN_ORDER__CUSTOMER_ID: - return new Integer(getCustomerID()); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case CustomerPackageImpl.AN_ORDER__ID: - setID(((Integer)newValue).intValue()); - return; - case CustomerPackageImpl.AN_ORDER__PRODUCT: - setProduct((String)newValue); - return; - case CustomerPackageImpl.AN_ORDER__QUANTITY: - setQuantity(((Integer)newValue).intValue()); - return; - case CustomerPackageImpl.AN_ORDER__CUSTOMER_ID: - setCustomerID(((Integer)newValue).intValue()); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case CustomerPackageImpl.AN_ORDER__ID: - unsetID(); - return; - case CustomerPackageImpl.AN_ORDER__PRODUCT: - setProduct(PRODUCT_EDEFAULT); - return; - case CustomerPackageImpl.AN_ORDER__QUANTITY: - unsetQuantity(); - return; - case CustomerPackageImpl.AN_ORDER__CUSTOMER_ID: - unsetCustomerID(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case CustomerPackageImpl.AN_ORDER__ID: - return isSetID(); - case CustomerPackageImpl.AN_ORDER__PRODUCT: - return PRODUCT_EDEFAULT == null ? product != null : !PRODUCT_EDEFAULT.equals(product); - case CustomerPackageImpl.AN_ORDER__QUANTITY: - return isSetQuantity(); - case CustomerPackageImpl.AN_ORDER__CUSTOMER_ID: - return isSetCustomerID(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (iD: "); - if (iDESet) result.append(iD); else result.append(""); - result.append(", product: "); - result.append(product); - result.append(", quantity: "); - if (quantityESet) result.append(quantity); else result.append(""); - result.append(", customerID: "); - if (customerIDESet) result.append(customerID); else result.append(""); - result.append(')'); - return result.toString(); - } - -} //AnOrderImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerFactoryImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerFactoryImpl.java deleted file mode 100644 index e0264517cc..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerFactoryImpl.java +++ /dev/null @@ -1,140 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.customer.impl; - -import org.apache.tuscany.das.rdb.test.customer.*; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.impl.EFactoryImpl; - -import org.eclipse.emf.ecore.plugin.EcorePlugin; - -/** - * - * An implementation of the model Factory. - * - * @generated - */ -public class CustomerFactoryImpl extends EFactoryImpl implements CustomerFactory -{ - /** - * The singleton instance of the factory. - * - * - * @generated - */ - public static final CustomerFactoryImpl eINSTANCE = init(); - - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static CustomerFactoryImpl init() - { - try - { - CustomerFactoryImpl theCustomerFactory = (CustomerFactoryImpl)EPackage.Registry.INSTANCE.getEFactory("http:///org.apache.tuscany.das.rdb.test/customer.xsd"); - if (theCustomerFactory != null) - { - return theCustomerFactory; - } - } - catch (Exception exception) - { - EcorePlugin.INSTANCE.log(exception); - } - return new CustomerFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public CustomerFactoryImpl() - { - super(); - } - - /** - * - * - * @generated - */ - public EObject create(EClass eClass) - { - switch (eClass.getClassifierID()) - { - case CustomerPackageImpl.AN_ORDER: return (EObject)createAnOrder(); - case CustomerPackageImpl.CUSTOMER: return (EObject)createCustomer(); - case CustomerPackageImpl.DATA_GRAPH_ROOT: return (EObject)createDataGraphRoot(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - public AnOrder createAnOrder() - { - AnOrderImpl anOrder = new AnOrderImpl(); - return anOrder; - } - - /** - * - * - * @generated - */ - public Customer createCustomer() - { - CustomerImpl customer = new CustomerImpl(); - return customer; - } - - /** - * - * - * @generated - */ - public DataGraphRoot createDataGraphRoot() - { - DataGraphRootImpl dataGraphRoot = new DataGraphRootImpl(); - return dataGraphRoot; - } - - /** - * - * - * @generated - */ - public CustomerPackageImpl getCustomerPackageImpl() - { - return (CustomerPackageImpl)getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - public static CustomerPackageImpl getPackage() - { - return CustomerPackageImpl.eINSTANCE; - } - -} //CustomerFactoryImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerImpl.java deleted file mode 100644 index d41df59c94..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerImpl.java +++ /dev/null @@ -1,385 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.customer.impl; - -import java.util.Collection; -import java.util.List; - -import org.apache.tuscany.das.rdb.test.customer.AnOrder; -import org.apache.tuscany.das.rdb.test.customer.Customer; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * - * An implementation of the model object 'Customer'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.apache.tuscany.das.rdb.test.customer.impl.CustomerImpl#getID ID}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.customer.impl.CustomerImpl#getLastName Last Name}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.customer.impl.CustomerImpl#getAddress Address}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.customer.impl.CustomerImpl#getOrders Orders}
  • - *
- *

- * - * @generated - */ -public class CustomerImpl extends DataObjectImpl implements Customer -{ - /** - * The default value of the '{@link #getID() ID}' attribute. - * - * - * @see #getID() - * @generated - * @ordered - */ - protected static final int ID_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getID() ID}' attribute. - * - * - * @see #getID() - * @generated - * @ordered - */ - protected int iD = ID_EDEFAULT; - - /** - * This is true if the ID attribute has been set. - * - * - * @generated - * @ordered - */ - protected boolean iDESet = false; - - /** - * The default value of the '{@link #getLastName() Last Name}' attribute. - * - * - * @see #getLastName() - * @generated - * @ordered - */ - protected static final String LAST_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getLastName() Last Name}' attribute. - * - * - * @see #getLastName() - * @generated - * @ordered - */ - protected String lastName = LAST_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getAddress() Address}' attribute. - * - * - * @see #getAddress() - * @generated - * @ordered - */ - protected static final String ADDRESS_EDEFAULT = null; - - /** - * The cached value of the '{@link #getAddress() Address}' attribute. - * - * - * @see #getAddress() - * @generated - * @ordered - */ - protected String address = ADDRESS_EDEFAULT; - - /** - * The cached value of the '{@link #getOrders() Orders}' containment reference list. - * - * - * @see #getOrders() - * @generated - * @ordered - */ - protected EList orders = null; - - /** - * - * - * @generated - */ - protected CustomerImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return CustomerPackageImpl.Literals.CUSTOMER; - } - - /** - * - * - * @generated - */ - public int getID() - { - return iD; - } - - /** - * - * - * @generated - */ - public void setID(int newID) - { - int oldID = iD; - iD = newID; - boolean oldIDESet = iDESet; - iDESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CustomerPackageImpl.CUSTOMER__ID, oldID, iD, !oldIDESet)); - } - - /** - * - * - * @generated - */ - public void unsetID() - { - int oldID = iD; - boolean oldIDESet = iDESet; - iD = ID_EDEFAULT; - iDESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, CustomerPackageImpl.CUSTOMER__ID, oldID, ID_EDEFAULT, oldIDESet)); - } - - /** - * - * - * @generated - */ - public boolean isSetID() - { - return iDESet; - } - - /** - * - * - * @generated - */ - public String getLastName() - { - return lastName; - } - - /** - * - * - * @generated - */ - public void setLastName(String newLastName) - { - String oldLastName = lastName; - lastName = newLastName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CustomerPackageImpl.CUSTOMER__LAST_NAME, oldLastName, lastName)); - } - - /** - * - * - * @generated - */ - public String getAddress() - { - return address; - } - - /** - * - * - * @generated - */ - public void setAddress(String newAddress) - { - String oldAddress = address; - address = newAddress; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, CustomerPackageImpl.CUSTOMER__ADDRESS, oldAddress, address)); - } - - /** - * - * - * @generated - */ - public List getOrders() - { - if (orders == null) - { - orders = new EObjectContainmentEList(AnOrder.class, this, CustomerPackageImpl.CUSTOMER__ORDERS); - } - return orders; - } - - /** - * - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case CustomerPackageImpl.CUSTOMER__ORDERS: - return ((InternalEList)getOrders()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case CustomerPackageImpl.CUSTOMER__ID: - return new Integer(getID()); - case CustomerPackageImpl.CUSTOMER__LAST_NAME: - return getLastName(); - case CustomerPackageImpl.CUSTOMER__ADDRESS: - return getAddress(); - case CustomerPackageImpl.CUSTOMER__ORDERS: - return getOrders(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case CustomerPackageImpl.CUSTOMER__ID: - setID(((Integer)newValue).intValue()); - return; - case CustomerPackageImpl.CUSTOMER__LAST_NAME: - setLastName((String)newValue); - return; - case CustomerPackageImpl.CUSTOMER__ADDRESS: - setAddress((String)newValue); - return; - case CustomerPackageImpl.CUSTOMER__ORDERS: - getOrders().clear(); - getOrders().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case CustomerPackageImpl.CUSTOMER__ID: - unsetID(); - return; - case CustomerPackageImpl.CUSTOMER__LAST_NAME: - setLastName(LAST_NAME_EDEFAULT); - return; - case CustomerPackageImpl.CUSTOMER__ADDRESS: - setAddress(ADDRESS_EDEFAULT); - return; - case CustomerPackageImpl.CUSTOMER__ORDERS: - getOrders().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case CustomerPackageImpl.CUSTOMER__ID: - return isSetID(); - case CustomerPackageImpl.CUSTOMER__LAST_NAME: - return LAST_NAME_EDEFAULT == null ? lastName != null : !LAST_NAME_EDEFAULT.equals(lastName); - case CustomerPackageImpl.CUSTOMER__ADDRESS: - return ADDRESS_EDEFAULT == null ? address != null : !ADDRESS_EDEFAULT.equals(address); - case CustomerPackageImpl.CUSTOMER__ORDERS: - return orders != null && !orders.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (iD: "); - if (iDESet) result.append(iD); else result.append(""); - result.append(", lastName: "); - result.append(lastName); - result.append(", address: "); - result.append(address); - result.append(')'); - return result.toString(); - } - -} //CustomerImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerPackageImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerPackageImpl.java deleted file mode 100644 index c847afd6ce..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerPackageImpl.java +++ /dev/null @@ -1,837 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.customer.impl; - -import org.apache.tuscany.das.rdb.test.customer.AnOrder; -import org.apache.tuscany.das.rdb.test.customer.Customer; -import org.apache.tuscany.das.rdb.test.customer.CustomerFactory; -import org.apache.tuscany.das.rdb.test.customer.DataGraphRoot; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EFactory; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - -import org.eclipse.emf.ecore.impl.EPackageImpl; - -import org.eclipse.emf.ecore.xml.type.XMLTypePackage; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @see org.apache.tuscany.das.rdb.test.customer.CustomerFactory - * @generated - */ -public class CustomerPackageImpl extends EPackageImpl -{ - /** - * The package name. - * - * - * @generated - */ - public static final String eNAME = "customer"; - - /** - * The package namespace URI. - * - * - * @generated - */ - public static final String eNS_URI = "http:///org.apache.tuscany.das.rdb.test/customer.xsd"; - - /** - * The package namespace name. - * - * - * @generated - */ - public static final String eNS_PREFIX = "customer"; - - /** - * The singleton instance of the package. - * - * - * @generated - */ - public static final CustomerPackageImpl eINSTANCE = org.apache.tuscany.das.rdb.test.customer.impl.CustomerPackageImpl.init(); - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.test.customer.impl.AnOrderImpl An Order}' class. - * - * - * @see org.apache.tuscany.das.rdb.test.customer.impl.AnOrderImpl - * @see org.apache.tuscany.das.rdb.test.customer.impl.CustomerPackageImpl#getAnOrder() - * @generated - */ - public static final int AN_ORDER = 0; - - /** - * The feature id for the 'ID' attribute. - * - * - * @generated - * @ordered - */ - public static final int AN_ORDER__ID = 0; - - /** - * The feature id for the 'Product' attribute. - * - * - * @generated - * @ordered - */ - public static final int AN_ORDER__PRODUCT = 1; - - /** - * The feature id for the 'Quantity' attribute. - * - * - * @generated - * @ordered - */ - public static final int AN_ORDER__QUANTITY = 2; - - /** - * The feature id for the 'Customer ID' attribute. - * - * - * @generated - * @ordered - */ - public static final int AN_ORDER__CUSTOMER_ID = 3; - - /** - * The number of structural features of the 'An Order' class. - * - * - * @generated - * @ordered - */ - public static final int AN_ORDER_FEATURE_COUNT = 4; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.test.customer.impl.CustomerImpl Customer}' class. - * - * - * @see org.apache.tuscany.das.rdb.test.customer.impl.CustomerImpl - * @see org.apache.tuscany.das.rdb.test.customer.impl.CustomerPackageImpl#getCustomer() - * @generated - */ - public static final int CUSTOMER = 1; - - /** - * The feature id for the 'ID' attribute. - * - * - * @generated - * @ordered - */ - public static final int CUSTOMER__ID = 0; - - /** - * The feature id for the 'Last Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int CUSTOMER__LAST_NAME = 1; - - /** - * The feature id for the 'Address' attribute. - * - * - * @generated - * @ordered - */ - public static final int CUSTOMER__ADDRESS = 2; - - /** - * The feature id for the 'Orders' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int CUSTOMER__ORDERS = 3; - - /** - * The number of structural features of the 'Customer' class. - * - * - * @generated - * @ordered - */ - public static final int CUSTOMER_FEATURE_COUNT = 4; - - /** - * The meta object id for the '{@link org.apache.tuscany.das.rdb.test.customer.impl.DataGraphRootImpl Data Graph Root}' class. - * - * - * @see org.apache.tuscany.das.rdb.test.customer.impl.DataGraphRootImpl - * @see org.apache.tuscany.das.rdb.test.customer.impl.CustomerPackageImpl#getDataGraphRoot() - * @generated - */ - public static final int DATA_GRAPH_ROOT = 2; - - /** - * The feature id for the 'Customers' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int DATA_GRAPH_ROOT__CUSTOMERS = 0; - - /** - * The feature id for the 'Orders' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int DATA_GRAPH_ROOT__ORDERS = 1; - - /** - * The number of structural features of the 'Data Graph Root' class. - * - * - * @generated - * @ordered - */ - public static final int DATA_GRAPH_ROOT_FEATURE_COUNT = 2; - - /** - * - * - * @generated - */ - private EClass anOrderEClass = null; - - /** - * - * - * @generated - */ - private EClass customerEClass = null; - - /** - * - * - * @generated - */ - private EClass dataGraphRootEClass = null; - - /** - * Creates an instance of the model Package, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - *

Note: the correct way to create the package is via the static - * factory method {@link #init init()}, which also performs - * initialization of the package, or returns the registered package, - * if one already exists. - * - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.apache.tuscany.das.rdb.test.customer.impl.CustomerPackageImpl#eNS_URI - * @see #init() - * @generated - */ - private CustomerPackageImpl() - { - super(eNS_URI, ((EFactory)CustomerFactory.INSTANCE)); - } - - /** - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this - * model, and for any others upon which it depends. Simple - * dependencies are satisfied by calling this method on all - * dependent packages before doing anything else. This method drives - * initialization for interdependent packages directly, in parallel - * with this package, itself. - *

Of this package and its interdependencies, all packages which - * have not yet been registered by their URI values are first created - * and registered. The packages are then initialized in two steps: - * meta-model objects for all of the packages are created before any - * are initialized, since one package's meta-model objects may refer to - * those of another. - *

Invocation of this method will not affect any packages that have - * already been initialized. - * - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static CustomerPackageImpl init() - { - if (isInited) return (CustomerPackageImpl)EPackage.Registry.INSTANCE.getEPackage(CustomerPackageImpl.eNS_URI); - - // Obtain or create and register package - CustomerPackageImpl theCustomerPackageImpl = (CustomerPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof CustomerPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new CustomerPackageImpl()); - - isInited = true; - - // Initialize simple dependencies - XMLTypePackage.eINSTANCE.eClass(); - - // Create package meta-data objects - theCustomerPackageImpl.createPackageContents(); - - // Initialize created meta-data - theCustomerPackageImpl.initializePackageContents(); - - // Mark meta-data to indicate it can't be changed - theCustomerPackageImpl.freeze(); - - return theCustomerPackageImpl; - } - - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder An Order}'. - * - * - * @return the meta object for class 'An Order'. - * @see org.apache.tuscany.das.rdb.test.customer.AnOrder - * @generated - */ - public EClass getAnOrder() - { - return anOrderEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getID ID}'. - * - * - * @return the meta object for the attribute 'ID'. - * @see org.apache.tuscany.das.rdb.test.customer.AnOrder#getID() - * @see #getAnOrder() - * @generated - */ - public EAttribute getAnOrder_ID() - { - return (EAttribute)anOrderEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getProduct Product}'. - * - * - * @return the meta object for the attribute 'Product'. - * @see org.apache.tuscany.das.rdb.test.customer.AnOrder#getProduct() - * @see #getAnOrder() - * @generated - */ - public EAttribute getAnOrder_Product() - { - return (EAttribute)anOrderEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getQuantity Quantity}'. - * - * - * @return the meta object for the attribute 'Quantity'. - * @see org.apache.tuscany.das.rdb.test.customer.AnOrder#getQuantity() - * @see #getAnOrder() - * @generated - */ - public EAttribute getAnOrder_Quantity() - { - return (EAttribute)anOrderEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.customer.AnOrder#getCustomerID Customer ID}'. - * - * - * @return the meta object for the attribute 'Customer ID'. - * @see org.apache.tuscany.das.rdb.test.customer.AnOrder#getCustomerID() - * @see #getAnOrder() - * @generated - */ - public EAttribute getAnOrder_CustomerID() - { - return (EAttribute)anOrderEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.test.customer.Customer Customer}'. - * - * - * @return the meta object for class 'Customer'. - * @see org.apache.tuscany.das.rdb.test.customer.Customer - * @generated - */ - public EClass getCustomer() - { - return customerEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.customer.Customer#getID ID}'. - * - * - * @return the meta object for the attribute 'ID'. - * @see org.apache.tuscany.das.rdb.test.customer.Customer#getID() - * @see #getCustomer() - * @generated - */ - public EAttribute getCustomer_ID() - { - return (EAttribute)customerEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.customer.Customer#getLastName Last Name}'. - * - * - * @return the meta object for the attribute 'Last Name'. - * @see org.apache.tuscany.das.rdb.test.customer.Customer#getLastName() - * @see #getCustomer() - * @generated - */ - public EAttribute getCustomer_LastName() - { - return (EAttribute)customerEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link org.apache.tuscany.das.rdb.test.customer.Customer#getAddress Address}'. - * - * - * @return the meta object for the attribute 'Address'. - * @see org.apache.tuscany.das.rdb.test.customer.Customer#getAddress() - * @see #getCustomer() - * @generated - */ - public EAttribute getCustomer_Address() - { - return (EAttribute)customerEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.test.customer.Customer#getOrders Orders}'. - * - * - * @return the meta object for the containment reference list 'Orders'. - * @see org.apache.tuscany.das.rdb.test.customer.Customer#getOrders() - * @see #getCustomer() - * @generated - */ - public EReference getCustomer_Orders() - { - return (EReference)customerEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for class '{@link org.apache.tuscany.das.rdb.test.customer.DataGraphRoot Data Graph Root}'. - * - * - * @return the meta object for class 'Data Graph Root'. - * @see org.apache.tuscany.das.rdb.test.customer.DataGraphRoot - * @generated - */ - public EClass getDataGraphRoot() - { - return dataGraphRootEClass; - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.test.customer.DataGraphRoot#getCustomers Customers}'. - * - * - * @return the meta object for the containment reference list 'Customers'. - * @see org.apache.tuscany.das.rdb.test.customer.DataGraphRoot#getCustomers() - * @see #getDataGraphRoot() - * @generated - */ - public EReference getDataGraphRoot_Customers() - { - return (EReference)dataGraphRootEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the containment reference list '{@link org.apache.tuscany.das.rdb.test.customer.DataGraphRoot#getOrders Orders}'. - * - * - * @return the meta object for the containment reference list 'Orders'. - * @see org.apache.tuscany.das.rdb.test.customer.DataGraphRoot#getOrders() - * @see #getDataGraphRoot() - * @generated - */ - public EReference getDataGraphRoot_Orders() - { - return (EReference)dataGraphRootEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - public CustomerFactory getCustomerFactory() - { - return (CustomerFactory)getEFactoryInstance(); - } - - /** - * - * - * @generated - */ - private boolean isCreated = false; - - /** - * Creates the meta-model objects for the package. This method is - * guarded to have no affect on any invocation but its first. - * - * - * @generated - */ - public void createPackageContents() - { - if (isCreated) return; - isCreated = true; - - // Create classes and their features - anOrderEClass = createEClass(AN_ORDER); - createEAttribute(anOrderEClass, AN_ORDER__ID); - createEAttribute(anOrderEClass, AN_ORDER__PRODUCT); - createEAttribute(anOrderEClass, AN_ORDER__QUANTITY); - createEAttribute(anOrderEClass, AN_ORDER__CUSTOMER_ID); - - customerEClass = createEClass(CUSTOMER); - createEAttribute(customerEClass, CUSTOMER__ID); - createEAttribute(customerEClass, CUSTOMER__LAST_NAME); - createEAttribute(customerEClass, CUSTOMER__ADDRESS); - createEReference(customerEClass, CUSTOMER__ORDERS); - - dataGraphRootEClass = createEClass(DATA_GRAPH_ROOT); - createEReference(dataGraphRootEClass, DATA_GRAPH_ROOT__CUSTOMERS); - createEReference(dataGraphRootEClass, DATA_GRAPH_ROOT__ORDERS); - } - - /** - * - * - * @generated - */ - private boolean isInitialized = false; - - /** - * Complete the initialization of the package and its meta-model. This - * method is guarded to have no affect on any invocation but its first. - * - * - * @generated - */ - public void initializePackageContents() - { - if (isInitialized) return; - isInitialized = true; - - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - - // Obtain other dependent packages - XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); - - // Add supertypes to classes - - // Initialize classes and features; add operations and parameters - initEClass(anOrderEClass, AnOrder.class, "AnOrder", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getAnOrder_ID(), theXMLTypePackage.getInt(), "iD", null, 1, 1, AnOrder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getAnOrder_Product(), theXMLTypePackage.getString(), "product", null, 1, 1, AnOrder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getAnOrder_Quantity(), theXMLTypePackage.getInt(), "quantity", null, 1, 1, AnOrder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getAnOrder_CustomerID(), theXMLTypePackage.getInt(), "customerID", null, 1, 1, AnOrder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(customerEClass, Customer.class, "Customer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getCustomer_ID(), theXMLTypePackage.getInt(), "iD", null, 1, 1, Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCustomer_LastName(), theXMLTypePackage.getString(), "lastName", null, 1, 1, Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCustomer_Address(), theXMLTypePackage.getString(), "address", null, 1, 1, Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getCustomer_Orders(), this.getAnOrder(), null, "orders", null, 1, -1, Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(dataGraphRootEClass, DataGraphRoot.class, "DataGraphRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getDataGraphRoot_Customers(), this.getCustomer(), null, "customers", null, 0, -1, DataGraphRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDataGraphRoot_Orders(), this.getAnOrder(), null, "orders", null, 0, -1, DataGraphRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - // Create resource - createResource(eNS_URI); - - // Create annotations - // http:///org/eclipse/emf/ecore/util/ExtendedMetaData - createExtendedMetaDataAnnotations(); - } - - /** - * Initializes the annotations for http:///org/eclipse/emf/ecore/util/ExtendedMetaData. - * - * - * @generated - */ - protected void createExtendedMetaDataAnnotations() - { - String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; - addAnnotation - (anOrderEClass, - source, - new String[] - { - "name", "AnOrder", - "kind", "elementOnly" - }); - addAnnotation - (getAnOrder_ID(), - source, - new String[] - { - "kind", "element", - "name", "ID" - }); - addAnnotation - (getAnOrder_Product(), - source, - new String[] - { - "kind", "element", - "name", "Product" - }); - addAnnotation - (getAnOrder_Quantity(), - source, - new String[] - { - "kind", "element", - "name", "Quantity" - }); - addAnnotation - (getAnOrder_CustomerID(), - source, - new String[] - { - "kind", "element", - "name", "Customer_ID" - }); - addAnnotation - (customerEClass, - source, - new String[] - { - "name", "Customer", - "kind", "elementOnly" - }); - addAnnotation - (getCustomer_ID(), - source, - new String[] - { - "kind", "element", - "name", "ID" - }); - addAnnotation - (getCustomer_LastName(), - source, - new String[] - { - "kind", "element", - "name", "lastName" - }); - addAnnotation - (getCustomer_Address(), - source, - new String[] - { - "kind", "element", - "name", "address" - }); - addAnnotation - (getCustomer_Orders(), - source, - new String[] - { - "kind", "element", - "name", "orders" - }); - addAnnotation - (dataGraphRootEClass, - source, - new String[] - { - "name", "DataGraphRoot", - "kind", "elementOnly" - }); - addAnnotation - (getDataGraphRoot_Customers(), - source, - new String[] - { - "kind", "element", - "name", "customers" - }); - addAnnotation - (getDataGraphRoot_Orders(), - source, - new String[] - { - "kind", "element", - "name", "orders" - }); - } - - /** - * - * Defines literals for the meta objects that represent - *

    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @generated - */ - public interface Literals - { - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.test.customer.impl.AnOrderImpl An Order}' class. - * - * - * @see org.apache.tuscany.das.rdb.test.customer.impl.AnOrderImpl - * @see org.apache.tuscany.das.rdb.test.customer.impl.CustomerPackageImpl#getAnOrder() - * @generated - */ - public static final EClass AN_ORDER = eINSTANCE.getAnOrder(); - - /** - * The meta object literal for the 'ID' attribute feature. - * - * - * @generated - */ - public static final EAttribute AN_ORDER__ID = eINSTANCE.getAnOrder_ID(); - - /** - * The meta object literal for the 'Product' attribute feature. - * - * - * @generated - */ - public static final EAttribute AN_ORDER__PRODUCT = eINSTANCE.getAnOrder_Product(); - - /** - * The meta object literal for the 'Quantity' attribute feature. - * - * - * @generated - */ - public static final EAttribute AN_ORDER__QUANTITY = eINSTANCE.getAnOrder_Quantity(); - - /** - * The meta object literal for the 'Customer ID' attribute feature. - * - * - * @generated - */ - public static final EAttribute AN_ORDER__CUSTOMER_ID = eINSTANCE.getAnOrder_CustomerID(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.test.customer.impl.CustomerImpl Customer}' class. - * - * - * @see org.apache.tuscany.das.rdb.test.customer.impl.CustomerImpl - * @see org.apache.tuscany.das.rdb.test.customer.impl.CustomerPackageImpl#getCustomer() - * @generated - */ - public static final EClass CUSTOMER = eINSTANCE.getCustomer(); - - /** - * The meta object literal for the 'ID' attribute feature. - * - * - * @generated - */ - public static final EAttribute CUSTOMER__ID = eINSTANCE.getCustomer_ID(); - - /** - * The meta object literal for the 'Last Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute CUSTOMER__LAST_NAME = eINSTANCE.getCustomer_LastName(); - - /** - * The meta object literal for the 'Address' attribute feature. - * - * - * @generated - */ - public static final EAttribute CUSTOMER__ADDRESS = eINSTANCE.getCustomer_Address(); - - /** - * The meta object literal for the 'Orders' containment reference list feature. - * - * - * @generated - */ - public static final EReference CUSTOMER__ORDERS = eINSTANCE.getCustomer_Orders(); - - /** - * The meta object literal for the '{@link org.apache.tuscany.das.rdb.test.customer.impl.DataGraphRootImpl Data Graph Root}' class. - * - * - * @see org.apache.tuscany.das.rdb.test.customer.impl.DataGraphRootImpl - * @see org.apache.tuscany.das.rdb.test.customer.impl.CustomerPackageImpl#getDataGraphRoot() - * @generated - */ - public static final EClass DATA_GRAPH_ROOT = eINSTANCE.getDataGraphRoot(); - - /** - * The meta object literal for the 'Customers' containment reference list feature. - * - * - * @generated - */ - public static final EReference DATA_GRAPH_ROOT__CUSTOMERS = eINSTANCE.getDataGraphRoot_Customers(); - - /** - * The meta object literal for the 'Orders' containment reference list feature. - * - * - * @generated - */ - public static final EReference DATA_GRAPH_ROOT__ORDERS = eINSTANCE.getDataGraphRoot_Orders(); - - } - -} //CustomerPackageImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/DataGraphRootImpl.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/DataGraphRootImpl.java deleted file mode 100644 index 5031b58870..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/DataGraphRootImpl.java +++ /dev/null @@ -1,203 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.apache.tuscany.das.rdb.test.customer.impl; - -import java.util.Collection; -import java.util.List; - -import org.apache.tuscany.das.rdb.test.customer.AnOrder; -import org.apache.tuscany.das.rdb.test.customer.Customer; -import org.apache.tuscany.das.rdb.test.customer.DataGraphRoot; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * - * An implementation of the model object 'Data Graph Root'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.apache.tuscany.das.rdb.test.customer.impl.DataGraphRootImpl#getCustomers Customers}
  • - *
  • {@link org.apache.tuscany.das.rdb.test.customer.impl.DataGraphRootImpl#getOrders Orders}
  • - *
- *

- * - * @generated - */ -public class DataGraphRootImpl extends DataObjectImpl implements DataGraphRoot -{ - /** - * The cached value of the '{@link #getCustomers() Customers}' containment reference list. - * - * - * @see #getCustomers() - * @generated - * @ordered - */ - protected EList customers = null; - - /** - * The cached value of the '{@link #getOrders() Orders}' containment reference list. - * - * - * @see #getOrders() - * @generated - * @ordered - */ - protected EList orders = null; - - /** - * - * - * @generated - */ - protected DataGraphRootImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return CustomerPackageImpl.Literals.DATA_GRAPH_ROOT; - } - - /** - * - * - * @generated - */ - public List getCustomers() - { - if (customers == null) - { - customers = new EObjectContainmentEList(Customer.class, this, CustomerPackageImpl.DATA_GRAPH_ROOT__CUSTOMERS); - } - return customers; - } - - /** - * - * - * @generated - */ - public List getOrders() - { - if (orders == null) - { - orders = new EObjectContainmentEList(AnOrder.class, this, CustomerPackageImpl.DATA_GRAPH_ROOT__ORDERS); - } - return orders; - } - - /** - * - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case CustomerPackageImpl.DATA_GRAPH_ROOT__CUSTOMERS: - return ((InternalEList)getCustomers()).basicRemove(otherEnd, msgs); - case CustomerPackageImpl.DATA_GRAPH_ROOT__ORDERS: - return ((InternalEList)getOrders()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case CustomerPackageImpl.DATA_GRAPH_ROOT__CUSTOMERS: - return getCustomers(); - case CustomerPackageImpl.DATA_GRAPH_ROOT__ORDERS: - return getOrders(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case CustomerPackageImpl.DATA_GRAPH_ROOT__CUSTOMERS: - getCustomers().clear(); - getCustomers().addAll((Collection)newValue); - return; - case CustomerPackageImpl.DATA_GRAPH_ROOT__ORDERS: - getOrders().clear(); - getOrders().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case CustomerPackageImpl.DATA_GRAPH_ROOT__CUSTOMERS: - getCustomers().clear(); - return; - case CustomerPackageImpl.DATA_GRAPH_ROOT__ORDERS: - getOrders().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case CustomerPackageImpl.DATA_GRAPH_ROOT__CUSTOMERS: - return customers != null && !customers.isEmpty(); - case CustomerPackageImpl.DATA_GRAPH_ROOT__ORDERS: - return orders != null && !orders.isEmpty(); - } - return super.eIsSet(featureID); - } - -} //DataGraphRootImpl diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/BookData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/BookData.java deleted file mode 100644 index 4b55d417eb..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/BookData.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; -import java.sql.Types; - -import org.apache.tuscany.das.rdb.test.framework.TestDataWithExplicitColumns; - - -public class BookData extends TestDataWithExplicitColumns { - - //CREATE TABLE BOOK (ID INT PRIMARY KEY NOT NULL, NAME VARCHAR(50), AUTHOR VARCHAR(30), QUANTITY INT, OCC INTEGER) - - private static int[] bookTypes = {Types.INTEGER, Types.VARCHAR, Types.VARCHAR, Types.INTEGER, Types.INTEGER}; - - private static Object[][] bookData = { - { new Integer(1), "The Brothers Karamazov", "Fyodor Dostoevsky", new Integer(5), new Integer(17) }, - { new Integer(2), "Cat in the Hat", "Doctor Seuss", new Integer(10), new Integer(1) }}; - - private static String[] bookColumns = { "ID", "NAME", "AUTHOR", "QUANTITY", "OCC"}; - - public BookData(Connection connection) { - super(connection, bookData, bookColumns, bookTypes); - } - - public String getTableName() { - return "BOOK"; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CityData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CityData.java deleted file mode 100644 index 0ebbd6c5af..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CityData.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; -import java.sql.SQLException; - -import org.apache.tuscany.das.rdb.test.framework.TestData; - - -public class CityData extends TestData { - - private static Object[][] cityData = { - {new Integer(1), "Lizard Lick", "1"}, - {new Integer(2), "Morrisville", "1"}, - {new Integer(3), "Breckenridge", "2"}, - {new Integer(4), "Barstow", "3"}, - {new Integer(5), "Sacramento", "3"} - - }; - - public CityData(Connection c) { - super(c, cityData); - } - - public String getTableName() { - return "CITIES"; - } - - public void doDeletes() throws SQLException { - deleteRowsFromTable(); - - } - - public void doInserts() throws SQLException { - insertRows(); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyData.java deleted file mode 100644 index 9c49004ba5..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyData.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; -import java.sql.Types; - -import org.apache.tuscany.das.rdb.test.framework.TestDataWithExplicitColumns; - - -public class CompanyData extends TestDataWithExplicitColumns { - - //CREATE TABLE COMPANY (ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY ,NAME VARCHAR(30)) - - private static int[] columnTypes = {Types.VARCHAR}; - - private static Object[][] companyData = { { "ACME Publishing" }, - { "Do-rite plumbing" }, - { "MegaCorp" } }; - - private static String[] companyColumns = { "NAME" }; - - public CompanyData(Connection connection) { - super(connection, companyData, companyColumns, columnTypes); - } - - public String getTableName() { - return "COMPANY"; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyDeptData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyDeptData.java deleted file mode 100644 index 66d0c25369..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyDeptData.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; - -import org.apache.tuscany.das.rdb.test.framework.RelationshipData; - - -public class CompanyDeptData extends RelationshipData { - - public static Object[][] data = { - {"MegaCorp", "Advanced Technologies"} - }; - - public CompanyDeptData(Connection c) { - super(c, data); - } - - protected String getParentRetrievalStatement() { - return "select id from company where name = ?"; - } - - protected String getChildUpdateStatement() { - return "update department set companyid = ? where department.name = ?"; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CustomerData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CustomerData.java deleted file mode 100644 index 149bcfc71b..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CustomerData.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; - -import org.apache.tuscany.das.rdb.test.framework.TestData; - - -public class CustomerData extends TestData { - - private static Object[][] customerData = { - {new Integer(1), "Williams", "1212 foobar lane"}, - {new Integer(2), "Daniel", "156 Brentfield Loop"}, - {new Integer(3), "Williams", "456 penny lane"}, - {new Integer(4), "Williams", "5000 pineville"}, - {new Integer(5), "Williams", "100000 firefly lane"} - }; - - public CustomerData(Connection connection) { - super(connection, customerData); - } - - - public String getTableName() { - return "CUSTOMER"; - } - - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepEmpData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepEmpData.java deleted file mode 100644 index fbd9cf7cab..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepEmpData.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; - -import org.apache.tuscany.das.rdb.test.framework.RelationshipData; - - -public class DepEmpData extends RelationshipData { - - private static Object[][] data = { - {"Advanced Technologies", "John Jones"}, - {"Advanced Technologies", "Jane Doe"}, - {"Advanced Technologies", "Al Smith"} - }; - - - public DepEmpData(Connection c) { - super(c, data); - } - - protected String getParentRetrievalStatement() { - return "select department.id from department where department.name = ?"; - } - - protected String getChildUpdateStatement() { - return "update employee set employee.departmentid = ? where employee.name = ?"; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepartmentData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepartmentData.java deleted file mode 100644 index d3c10affdd..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepartmentData.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; -import java.sql.Types; - -import org.apache.tuscany.das.rdb.test.framework.TestDataWithExplicitColumns; - - -public class DepartmentData extends TestDataWithExplicitColumns { - - private static int[] columnTypes = {Types.VARCHAR, Types.VARCHAR, Types.VARCHAR}; - - private static Object[][] deptData = { { "Advanced Technologies", "NY", "123" } }; - - private static String[] deptColumns = { "NAME", "LOCATION", "NUMBER" }; - - public DepartmentData(Connection connection) { - super(connection, deptData, deptColumns, columnTypes); - } - - public String getTableName() { - return "DEPARTMENT"; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/EmployeeData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/EmployeeData.java deleted file mode 100644 index 82dcbe4cb3..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/EmployeeData.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; -import java.sql.Types; - -import org.apache.tuscany.das.rdb.test.framework.TestDataWithExplicitColumns; - - -public class EmployeeData extends TestDataWithExplicitColumns { - - private static int[] columnTypes = {Types.VARCHAR, Types.VARCHAR, Types.SMALLINT}; - - private static Object[][] employeeData = { { "John Jones", "E0001", new Boolean(false) }, - { "Mary Smith", "E0002", new Boolean(true)}, - { "Jane Doe", "E0003", new Boolean(false)}, - { "Al Smith", "E0004", new Boolean(true) } }; - - private static String[] employeeColumns = { "NAME", "SN", "MANAGER" }; - - public EmployeeData(Connection connection) { - super(connection, employeeData, employeeColumns, columnTypes); - } - - public String getTableName() { - return "EMPLOYEE"; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OrderData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OrderData.java deleted file mode 100644 index e6a52204f8..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OrderData.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; - -import org.apache.tuscany.das.rdb.test.framework.TestData; - - -public class OrderData extends TestData { - - - public static Object[][] orderData = { - {new Integer(1), "recombobulator", new Integer(47), new Integer(1)}, - {new Integer(2), "wrench", new Integer(17), new Integer(3)}, - {new Integer(3), "pliers", new Integer(500), new Integer(1)}, - {new Integer(4), "Tooth Paste", new Integer(12), new Integer(2)} - }; - - public OrderData(Connection c) { - super(c, orderData); - } - - public String getTableName() { - return "ANORDER"; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OrderDetailsData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OrderDetailsData.java deleted file mode 100644 index 9193f7c6d5..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OrderDetailsData.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; - -import org.apache.tuscany.das.rdb.test.framework.TestData; - - -public class OrderDetailsData extends TestData { - - //CREATE TABLE ORDERDETAILS (ORDERID INT NOT NULL, PRODUCTID INT NOT NULL, PRICE FLOAT, PRIMARY KEY (ORDERID, PRODUCTID)) - - public static Object[][] orderDetailsData = { - {new Integer(1), new Integer(1), new Float(1.1)}, - {new Integer(1), new Integer(2), new Float(1.2)}, - {new Integer(2), new Integer(1), new Float(2.1)}, - {new Integer(2), new Integer(2), new Float(2.2)} - }; - - public OrderDetailsData(Connection c) { - super(c, orderDetailsData); - } - - public String getTableName() { - return "ORDERDETAILS"; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/PartData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/PartData.java deleted file mode 100644 index dd78b1be35..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/PartData.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; -import java.sql.Types; - -import org.apache.tuscany.das.rdb.test.framework.TestDataWithExplicitColumns; - - -public class PartData extends TestDataWithExplicitColumns { - - - //CREATE TABLE PART (ID INT PRIMARY KEY NOT NULL, NAME VARCHAR(50), QUANTITY INT, PARENT_ID INT ) - - private static String[] partColumns = { "ID" , "NAME", "QUANTITY", "PARENT_ID"}; - - private static int[] columnTypes = {Types.INTEGER, Types.VARCHAR, Types.INTEGER, Types.INTEGER}; - - private static Object[][] partData = { - {new Integer(1), "Engine", new Integer(1), null}, - {new Integer(2), "Block", new Integer(1), new Integer(1)}, - {new Integer(3), "Cam Shaft", new Integer(2), new Integer(1)}, - {new Integer(4), "Piston", new Integer(8), new Integer(1)}, - {new Integer(5), "Piston Ring", new Integer(2), new Integer(4)} - }; - - public PartData(Connection connection) { - super(connection, partData, partColumns, columnTypes); - } - - public String getTableName() { - return "PART"; - } - -} - - diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/StateData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/StateData.java deleted file mode 100644 index 0c6d41d096..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/StateData.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; -import java.sql.SQLException; - -import org.apache.tuscany.das.rdb.test.framework.TestData; - - -public class StateData extends TestData { - - public StateData(Connection c) { - super(c, stateData); - } - - public String getTableName() { - return "STATES"; - } - - private static Object[][] stateData = { - {new Integer(1), "NC"}, - {new Integer(2), "CO"}, - {new Integer(3), "CA"} - }; - - public void doDeletes() throws SQLException { - deleteRowsFromTable(); - } - - public void doInserts() throws SQLException { - insertRows(); - - } - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/TypesData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/TypesData.java deleted file mode 100644 index 1097b07cc5..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/TypesData.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.data; - -import java.sql.Connection; -import java.sql.Timestamp; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - -import org.apache.tuscany.das.rdb.test.framework.TestData; - - -public class TypesData extends TestData { - - private static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:ss:mm.SSS"); - private static Timestamp timestamp = getTimestamp(); - - private static Object[][] customerData = { - {new Integer(1), timestamp, new Float(1234567.89), new Float(1234567.89)} - }; - - public TypesData(Connection connection) { - super(connection, customerData); - } - - public String getTableName() { - return "TYPETEST"; - } - - - //Utilities - private static Date getDate() { - - try { - return dateFormat.parse("1966-12-20 00:00:00.0"); - } catch (ParseException e) { - throw new RuntimeException(e); - } - - } - - public static Timestamp getTimestamp() { - - return new Timestamp(getDate().getTime()); - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DB2Setup.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DB2Setup.java deleted file mode 100644 index 75df028490..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DB2Setup.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.framework; - -import junit.framework.Test; - -public class DB2Setup extends DatabaseSetup { - - public DB2Setup(Test test) { - super(test); - } - - protected void initConnectionProtocol() { - - platformName = "DB2"; - driverName = "com.ibm.db2.jcc.DB2Driver"; - databaseURL = "jdbc:db2:DASTEST"; - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DasTest.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DasTest.java deleted file mode 100644 index c4e75d20a8..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DasTest.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.framework; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.ResultSetMetaData; -import java.sql.SQLException; -import java.util.Iterator; -import java.util.List; - -import junit.framework.TestCase; - -import commonj.sdo.DataObject; -import commonj.sdo.Property; - -/** - * - */ -public class DasTest extends TestCase { - - public static Connection connection = null; - private boolean usingDefaultSetup = false; - - /** - * Tears down the fixture, for example, close a network connection. This - * method is called after a test is executed. - */ - protected void tearDown() throws Exception { -// if (usingDefaultSetup) -// connection = null; - } - - protected Connection getAutoConnection() throws SQLException { - - Connection c = primGetConnection(); - c.setAutoCommit(true); - return connection; - - } - - protected Connection getConnection() throws SQLException { - - Connection c = primGetConnection(); - c.setAutoCommit(false); - return connection; - } - - /** - * This provides the default connection for runing single test cases on a - * chosen platform. - */ - private Connection primGetConnection() { - if (connection == null) - defaultSetup(); - return connection; - } - - - - /** - * This is a bit of a hack since it counts on constructor initialization of the - * DatabaseSet up class and also calls its setUp method directly. This is a misuse - * of this JUnit TestSetup subclass . - * - * TODO - refactor to avoid this hackiness ... could move this logic to its own - * class that is then invoked by DatabaseSetUp - */ - private void defaultSetup() { - - usingDefaultSetup = true; - -// DatabaseSetup setUp = new DB2Setup(this); - DatabaseSetup setUp = new DerbySetup(this); - try { - setUp.setUp(); - } catch (Exception e) { - throw new RuntimeException(e); - } - - } - - - //Utilities - protected InputStream getConfig(String fileName) throws FileNotFoundException { - return Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName); - } - - protected void write(String label, ResultSet rs) throws IOException, SQLException { - - ResultSetMetaData md = rs.getMetaData(); - int count = md.getColumnCount(); - System.out.println("Contents of ResultSet from " + label); - for (int i = 1; i <= count; i++) { - System.out.print("\t"); - System.out.println (md.getColumnLabel(i)); - } - System.out.println(""); - while (rs.next()) { - for (int i = 1; i <= count; i++) { - System.out.print("\t"); - System.out.print(rs.getString(i)); - } - System.out.println("\t"); - } - System.out.println("done"); - } - - - protected void printList(List data) { - Iterator i = data.iterator(); - while ( i.hasNext()) { - System.out.println(); - DataObject obj = (DataObject) i.next(); - Iterator props = obj.getType().getProperties().iterator(); - while ( props.hasNext()) { - Property p = (Property) props.next(); - if ( p.isMany() ) { - System.out.print("[ " + p.getName() + " ] "); - Iterator children = obj.getList(p).iterator(); - while ( children.hasNext()) { - DataObject child = (DataObject) children.next(); - System.out.print("[ " + child.get("ID") + " ]"); - } - System.out.println(); - } else if ( !p.getType().isDataType()) { - DataObject child = obj.getDataObject(p); - if ( child != null ) - System.out.println("[ " + p.getName() + " ] " + "[ " + child.get("ID") + " ]"); - } else { - System.out.println("[ " + p.getName() + " ] " + obj.get(p)); - } - } - } - } - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DatabaseSetup.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DatabaseSetup.java deleted file mode 100644 index f0bd99c5e1..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DatabaseSetup.java +++ /dev/null @@ -1,245 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.framework; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; -import java.sql.Statement; - -import junit.extensions.TestSetup; -import junit.framework.Test; - -public class DatabaseSetup extends TestSetup { - - protected String platformName = "Not initialized"; - - protected String driverName = "Not initialized"; - - protected String databaseURL = "Not initialized"; - - private Connection connection; - - protected Statement s; - - public DatabaseSetup(Test test) { - super(test); - initConnectionProtocol(); - initConnection(); - DasTest.connection = connection; - } - - protected void initConnectionProtocol() { - // Subclasses provide implementation - } - - private void initConnection() { - - try { - - Class.forName(driverName).newInstance(); - connection = DriverManager.getConnection(databaseURL); - connection.setAutoCommit(false); - - } catch (Exception e) { - if (e instanceof SQLException) - ((SQLException) e).getNextException().printStackTrace(); - throw new RuntimeException(e); - } - - } - - protected void setUp() throws Exception { - - System.out.println("Setting up for " + platformName + " run"); - - s = connection.createStatement(); - - try { - dropTables(); - dropProcedures(); - createTables(); - createProcedures(); - connection.commit(); - } catch (SQLException e) { - connection.rollback(); - } - - } - - protected void tearDown() throws Exception { - - System.out.println("Ending " + platformName + " run"); - connection.close(); - - } - - private void dropTables() { - - System.out.println("Dropping tables"); - - String[] statements = { - - "DROP TABLE CUSTOMER", "DROP TABLE ANORDER", "DROP TABLE ORDERDETAILS", "DROP TABLE ITEM", "DROP TABLE COMPANY", - "DROP TABLE EMPLOYEE", "DROP TABLE DEPARTMENT", "DROP TABLE BOOK", "DROP TABLE PART", "DROP TABLE TYPETEST", - "DROP TABLE CITIES", "DROP TABLE STATES", "DROP TABLE conmgt.SERVERSTATUS" - - }; - - for (int i = 0; i < statements.length; i++) { - try { - s.execute(statements[i]); - } catch (SQLException e) { - //If the table does not exist then ignore the exception on drop - if (!e.getMessage().contains("does not exist")) - throw new RuntimeException(e); - } - } - } - - protected void dropProcedures() { - - System.out.println("Dropping procedures"); - - String[] statements = { - - "DROP PROCEDURE GETALLCOMPANIES", "DROP PROCEDURE DELETECUSTOMER", "DROP PROCEDURE GETNAMEDCOMPANY", - "DROP PROCEDURE GETCUSTOMERANDORDERS", - // "DROP PROCEDURE GETNAMEDCUSTOMERS" - - }; - - for (int i = 0; i < statements.length; i++) { - try { - s.execute(statements[i]); - } catch (SQLException e) { - //If the proc does not exist then ignore the exception on drop - if (!e.getMessage().contains("does not exist")) - throw new RuntimeException(e); - } - } - } - - private void createTables() { - - System.out.println("Creating tables"); - - try { - - s.execute(getCreateCustomer()); - s.execute(getCreateAnOrder()); - s.execute(getCreateOrderDetails()); - s.execute(getCreateItem()); - s.execute(getCreateCompany()); - s.execute(getCreateEmployee()); - s.execute(getCreateDepartment()); - s.execute(getCreateBook()); - s.execute(getCreatePart()); - s.execute(getCreateTypeTest()); - s.execute(getCreateStates()); - s.execute(getCreateCities()); - s.execute(getCreateServerStatus()); - - } catch (SQLException e) { - throw new RuntimeException(e); - } - } - - protected void createProcedures() { - - System.out.println("Creating procedures"); - try { - - s - .execute("CREATE PROCEDURE GETALLCOMPANIES() PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'org.apache.tuscany.das.rdb.test.framework.JavaStoredProcs.getAllCompanies'"); - s - .execute("CREATE PROCEDURE DELETECUSTOMER(theId int) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA EXTERNAL NAME 'org.apache.tuscany.das.rdb.test.framework.JavaStoredProcs.deleteCustomer'"); - s - .execute("CREATE PROCEDURE GETNAMEDCOMPANY(theName VARCHAR(100)) PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'org.apache.tuscany.das.rdb.test.framework.JavaStoredProcs.getNamedCompany'"); - s - .execute("CREATE PROCEDURE GETCUSTOMERANDORDERS(theID INTEGER) PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'org.apache.tuscany.das.rdb.test.framework.JavaStoredProcs.getCustomerAndOrders'"); - // TODO s.execute("CREATE PROCEDURE GETNAMEDCUSTOMERS(theName - // VARCHAR(100), OUT theCount INTEGER) PARAMETER STYLE JAVA LANGUAGE - // JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME - // 'tests.framework.JavaStoredProcs.getNamedCustomers'"); - // This is failing on DB2 with SQLCODE: 42723. Need to investigate - } catch (SQLException e) { - throw new RuntimeException(e); - } - } - - // - // This section povides methods that return strings for table creation. - // Platform-specific sublcasses - // can override these as necessary - // - - protected String getCreateCustomer() { - return "CREATE TABLE CUSTOMER (ID INT PRIMARY KEY NOT NULL, LASTNAME VARCHAR(30) DEFAULT 'Garfugengheist', ADDRESS VARCHAR(30))"; - } - - protected String getCreateAnOrder() { - return "CREATE TABLE ANORDER (ID INT PRIMARY KEY NOT NULL, PRODUCT VARCHAR(30), QUANTITY INT, CUSTOMER_ID INT)"; - } - - protected String getCreateOrderDetails() { - return "CREATE TABLE ORDERDETAILS (ORDERID INT NOT NULL, PRODUCTID INT NOT NULL, PRICE FLOAT, PRIMARY KEY (ORDERID, PRODUCTID))"; - } - - protected String getCreateItem() { - return "CREATE TABLE ITEM (ID INT PRIMARY KEY NOT NULL, NAME VARCHAR(30))"; - } - - protected String getCreateCompany() { - return "CREATE TABLE COMPANY (ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY ,NAME VARCHAR(30))"; - } - - protected String getCreateEmployee() { - return "CREATE TABLE EMPLOYEE (ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY, NAME VARCHAR(30), SN VARCHAR(10), MANAGER SMALLINT, DEPARTMENTID INT)"; - } - - protected String getCreateDepartment() { - return "CREATE TABLE DEPARTMENT (ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY, NAME VARCHAR(30), LOCATION VARCHAR(30), NUMBER VARCHAR(10), COMPANYID INT, EOTM INT)"; - } - - protected String getCreateBook() { - return "CREATE TABLE BOOK (ID INT PRIMARY KEY NOT NULL, NAME VARCHAR(50), AUTHOR VARCHAR(30), QUANTITY INT, OCC INTEGER)"; - } - - protected String getCreatePart() { - return "CREATE TABLE PART (ID INT PRIMARY KEY NOT NULL, NAME VARCHAR(50), QUANTITY INT, PARENT_ID INT )"; - } - - protected String getCreateTypeTest() { - return "CREATE TABLE TYPETEST (ID INT PRIMARY KEY NOT NULL, ATIMESTAMP TIMESTAMP, ADECIMAL DECIMAL(9,2), AFLOAT FLOAT)"; - } - - protected String getCreateStates() { - return "CREATE TABLE STATES (ID INT PRIMARY KEY NOT NULL, NAME VARCHAR(2))"; - } - - protected String getCreateCities() { - return "CREATE TABLE CITIES (ID INT PRIMARY KEY NOT NULL, NAME VARCHAR(50), STATE_ID INT, CONSTRAINT FK1 FOREIGN KEY (STATE_ID) REFERENCES STATES (ID) ON DELETE NO ACTION ON UPDATE NO ACTION)"; - } - - protected String getCreateServerStatus() { - - return "CREATE TABLE CONMGT.SERVERSTATUS (STATUSID INTEGER PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 ,INCREMENT BY 1), MANAGEDSERVERID INTEGER NOT NULL, TIMESTAMP TIMESTAMP NOT NULL)"; - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DerbySetup.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DerbySetup.java deleted file mode 100644 index 082b1ec50a..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DerbySetup.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.framework; - -import java.util.Properties; - -import junit.framework.Test; - -public class DerbySetup extends DatabaseSetup { - - public DerbySetup(Test test) { - super(test); - } - - protected void initConnectionProtocol() { - - //Set the derby property to explicitly specify the database location relative - //from current directory to "target" - Properties p = System.getProperties(); - p.put("derby.system.home", "target"); - - platformName = "Derby"; - driverName = "org.apache.derby.jdbc.EmbeddedDriver"; - databaseURL = "jdbc:derby:dastest; create = true"; - - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/JavaStoredProcs.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/JavaStoredProcs.java deleted file mode 100644 index b993893a85..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/JavaStoredProcs.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.framework; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; - -/** - * Stored Procedures for DB2 and Derby SP tests - * - */ -public class JavaStoredProcs { - - public static void getAllCompanies(ResultSet[] results) throws SQLException { - - Connection conn = DriverManager - .getConnection("jdbc:default:connection"); - PreparedStatement ps = conn.prepareStatement("SELECT * FROM COMPANY"); - results[0] = ps.executeQuery(); - } - - public static void deleteCustomer(int theId) throws SQLException { - - Connection conn = DriverManager - .getConnection("jdbc:default:connection"); - PreparedStatement ps = conn.prepareStatement("DELETE FROM CUSTOMER WHERE ID = ?"); - ps.setInt(1, theId); - ps.execute(); - - } - - public static void getNamedCompany(String theName, ResultSet[] results) throws SQLException { - - Connection conn = DriverManager - .getConnection("jdbc:default:connection"); - PreparedStatement ps = conn.prepareStatement("SELECT * FROM COMPANY WHERE NAME = ?"); - ps.setString(1, theName); - results[0] = ps.executeQuery(); - } - - public static void getCustomerAndOrders(int theId, ResultSet[] results) throws SQLException { - - Connection conn = DriverManager - .getConnection("jdbc:default:connection"); - PreparedStatement ps = - conn.prepareStatement("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID WHERE CUSTOMER.ID = ?"); - ps.setInt(1, theId); - results[0] = ps.executeQuery(); - } - - public static void getNamedCustomers(String theName, int[] outCount, ResultSet[] results) throws SQLException { - - Connection conn = DriverManager - .getConnection("jdbc:default:connection"); - PreparedStatement ps = - conn.prepareStatement("SELECT * FROM CUSTOMER WHERE LASTNAME = ?"); - ps.setString(1, theName); - results[0] = ps.executeQuery(); - - ps = conn.prepareStatement("SELECT COUNT(*) FROM CUSTOMER WHERE LASTNAME = ?"); - ps.setString(1, theName); - - ResultSet rs = ps.executeQuery(); - rs.next(); - outCount[0] = rs.getInt(1); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/MySQLSetup.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/MySQLSetup.java deleted file mode 100644 index b3616882f4..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/MySQLSetup.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.framework; - -import java.sql.SQLException; - - -import junit.framework.Test; - -public class MySQLSetup extends DatabaseSetup { - - public MySQLSetup(Test test) { - super(test); - } - - protected void initConnectionProtocol() { - - platformName = "MySQL"; - driverName = "com.mysql.jdbc.Driver"; - databaseURL = "jdbc:mysql:///dastest?user=dastester&password=dastester"; - - } - - - protected void createProcedures () { - - String createGetAllCompanies = - "CREATE PROCEDURE `dastest`.`GETALLCOMPANIES` () "+ - " SELECT * FROM COMPANY "; - - - String createDeleteCustomer = - "CREATE PROCEDURE `dastest`.`DELETECUSTOMER` (theId INT) " + - " DELETE FROM CUSTOMER WHERE ID = theId "; - - - String createGetNamedCustomers = - "CREATE PROCEDURE `dastest`.`GETNAMEDCUSTOMERS`(IN thename VARCHAR(30), OUT theCount INTEGER ) " + - " BEGIN " + - " SELECT * FROM CUSTOMER AS CUSTOMER WHERE LASTNAME = theName; " + - " SET theCount = (SELECT COUNT(*) FROM CUSTOMER WHERE LASTNAME = theName); " + - " END "; - - String createGetCustomerAndOrders = - " CREATE PROCEDURE `dastest`.`GETCUSTOMERANDORDERS` (theId INT) " + - " SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID WHERE CUSTOMER.ID = theId "; - - - String createGetNamedCompany = - " CREATE PROCEDURE `dastest`.`GETNAMEDCOMPANY` (theName VARCHAR(100)) " + - " SELECT * FROM COMPANY WHERE NAME = theName"; - - System.out.println("Creating procedures"); - try { - - s.execute(createGetAllCompanies); - s.execute(createDeleteCustomer); - s.execute(createGetNamedCompany); - s.execute(createGetCustomerAndOrders); -// s.execute(createGetNamedCustomers); -//TODO - add this back after DB2 problem is resolved - } catch (SQLException e) { - throw new RuntimeException(e); - } - } - - - //Overrides for table creation - protected String getCreateCompany() { - return "CREATE TABLE COMPANY (ID INT PRIMARY KEY NOT NULL AUTO_INCREMENT, NAME VARCHAR(30))"; - } - protected String getCreateEmployee() { - return "CREATE TABLE EMPLOYEE (ID INT PRIMARY KEY NOT NULL AUTO_INCREMENT, NAME VARCHAR(30), SN VARCHAR(10), MANAGER SMALLINT, DEPARTMENTID INT)"; - } - protected String getCreateDepartment() { - return "CREATE TABLE DEPARTMENT (ID INT PRIMARY KEY NOT NULL AUTO_INCREMENT, NAME VARCHAR(30), LOCATION VARCHAR(30), NUMBER VARCHAR(10), COMPANYID INT, EOTM INT)"; - } - protected String getCreateTypeTest() { - return "CREATE TABLE TYPETEST (ID INT PRIMARY KEY NOT NULL, ATIMESTAMP DATETIME, ADECIMAL DECIMAL(9,2), AFLOAT FLOAT)"; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/RelationshipData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/RelationshipData.java deleted file mode 100644 index 330320656e..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/RelationshipData.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.framework; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; - -public abstract class RelationshipData { - protected Object[][] data; - private int currentRow = -1; - protected Connection connection; - - - public RelationshipData(Connection c, Object[][] inputData) { - this.connection = c; - this.data = inputData; - } - - public int size() { - return data[0].length; - } - - public int numberOfRows() { - return data.length; - } - - public boolean next() { - ++currentRow; - if ( currentRow < numberOfRows() ) - return true; - else - return false; - } - - - public void refresh() throws SQLException { - updateRelationships(); - } - - protected abstract String getParentRetrievalStatement(); - protected abstract String getChildUpdateStatement(); - - - protected void updateRelationships() throws SQLException { - // { MegaCorp, Advanced Technologies } - // select company.id from company where company.name = ? - PreparedStatement retrieveParent = connection.prepareStatement(getParentRetrievalStatement()); - // update department set department.companyid = ? where department.name = ? - PreparedStatement updateChild = connection.prepareStatement(getChildUpdateStatement()); - - while ( next() ) { - retrieveParent.setObject(1, data[currentRow][0]); - retrieveParent.execute(); - ResultSet rs = retrieveParent.getResultSet(); - rs.next(); - Object parentID = rs.getObject(1); - retrieveParent.clearParameters(); - - updateChild.setObject(1, parentID); - updateChild.setObject(2, data[currentRow][1]); - updateChild.execute(); - updateChild.clearParameters(); - } - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestData.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestData.java deleted file mode 100644 index 686433bfc8..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestData.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.framework; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; - -public abstract class TestData { - - protected Object[][] data; - private int currentRow = -1; - protected Connection connection; - - - public TestData(Connection c, Object[][] customerData) { - this.connection = c; - this.data = customerData; - } - - public int size() { - return data[0].length; - } - - public int numberOfRows() { - return data.length; - } - - public boolean next() { - ++currentRow; - if ( currentRow < numberOfRows() ) - return true; - else - return false; - } - - public abstract String getTableName(); - - - public Object getObject(int i) { - return data[currentRow][i-1]; - } - - public void refresh() throws SQLException { - deleteRowsFromTable(); - insertRows(); - } - - protected void deleteRowsFromTable() throws SQLException { - PreparedStatement ps = connection.prepareStatement("delete from " + getTableName()); - ps.execute(); - } - - protected void insertRows() throws SQLException { - StringBuffer sql = new StringBuffer(); - sql.append("insert into "); - sql.append(getTableName()); - sql.append(" values ("); - for ( int i=1; i < size(); i++) { - sql.append("?,"); - } - sql.append("?)"); - PreparedStatement ps = connection.prepareStatement(sql.toString()); - - while ( next() ) { - for ( int i=1; i <= size(); i++ ) { - ps.setObject(i, getObject(i)); - } - ps.execute(); - ps.clearParameters(); - } - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestDataWithExplicitColumns.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestDataWithExplicitColumns.java deleted file mode 100644 index 8ded99af9b..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestDataWithExplicitColumns.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.framework; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; - -import org.apache.tuscany.das.rdb.util.DebugUtil; - - -public abstract class TestDataWithExplicitColumns extends TestData { - - protected String[] columns; - protected int[] sqlTypes; - - private static boolean debug = false; - - public TestDataWithExplicitColumns(Connection c, Object[][] data, - String[] columns, int[] sqlTypes) { - super(c, data); - this.columns = columns; - this.sqlTypes = sqlTypes; - } - - private String getColumn(int i) { - return columns[i - 1]; - } - - private int getSqlType(int i) { - return (sqlTypes[i - 1]); - } - - // Create an insert statement of the following form ... - // "INSERT INTO table_name (column1, column2,...) VALUES (value1, value2,....)" - // This is necessary for tables with a generated column since the PK value is not provided - protected void insertRows() throws SQLException { - StringBuffer sql = new StringBuffer(); - sql.append("insert into "); - sql.append(getTableName()); - - sql.append(" ("); - for (int i = 1; i <= size(); i++) { - sql.append(getColumn(i)); - if ( i < size() ) - sql.append(','); - } - sql.append(" )"); - - sql.append(" values ("); - for (int i = 1; i < size(); i++) { - sql.append("?,"); - } - sql.append("?)"); - - DebugUtil.debugln(getClass(), debug, sql.toString()); - PreparedStatement ps = connection.prepareStatement(sql.toString()); - - while (next()) { - for (int i = 1; i <= size(); i++) { - ps.setObject(i, getObject(i), getSqlType(i)); - } - ps.execute(); - ps.clearParameters(); - } - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/IntegerToBooleanConverter.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/IntegerToBooleanConverter.java deleted file mode 100644 index e25d2c4c95..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/IntegerToBooleanConverter.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.mappings; - -import org.apache.tuscany.das.rdb.Converter; - -public class IntegerToBooleanConverter implements Converter { - - public IntegerToBooleanConverter() { - super(); - } - - public Object getPropertyValue(Object columnData) { - Integer value = (Integer) columnData; - return value.intValue() == 0 ? Boolean.FALSE : Boolean.TRUE; - } - - public Object getColumnValue(Object propertyData) { - Boolean value = (Boolean) propertyData; - if ( value.booleanValue()) - return new Integer(1); - else - return new Integer(0); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/SillyDateStringConverter.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/SillyDateStringConverter.java deleted file mode 100644 index 7c164bd675..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/SillyDateStringConverter.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.mappings; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - -import org.apache.tuscany.das.rdb.Converter; - - -public class SillyDateStringConverter implements Converter { - - public SillyDateStringConverter() { - super(); - } - - private static DateFormat myformat = new SimpleDateFormat("yyyy.MM.dd"); - - private static Date kbday; - - private static Date tbday; - - static { - try { - kbday = myformat.parse("1957.09.27"); - tbday = myformat.parse("1966.12.20"); - } catch (ParseException e) { - throw new RuntimeException(e); - } - } - - public Object getPropertyValue(Object columnData) { - - if (columnData.equals("Williams")) - return kbday; - - if (columnData.equals("Pavick")) - return tbday; - - throw new IllegalArgumentException(); - - } - - public Object getColumnValue(Object propertyData) { - - if (propertyData.equals(kbday)) - return "Williams"; - - if (propertyData.equals(tbday)) - return "Pavick"; - - throw new IllegalArgumentException(); - - } - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToIntegerConverter.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToIntegerConverter.java deleted file mode 100644 index 8ff57aef6d..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToIntegerConverter.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.mappings; - -import org.apache.tuscany.das.rdb.Converter; - -public class StringToIntegerConverter implements Converter { - - public StringToIntegerConverter() { - super(); - } - - public Object getPropertyValue(Object columnData) { - // System.out.println("Converting object.. " + columnData); - - return new Integer(columnData.toString()); - } - - public Object getColumnValue(Object columnData) { - return columnData.toString(); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToLongConverter.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToLongConverter.java deleted file mode 100644 index 74a5e2917f..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToLongConverter.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.mappings; - -import org.apache.tuscany.das.rdb.Converter; - -public class StringToLongConverter implements Converter { - - public StringToLongConverter() { - super(); - } - - public Object getPropertyValue(Object columnData) { - return new Long(columnData.toString()); - } - - public Object getColumnValue(Object columnData) { - return columnData.toString(); - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllCommonTests.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllCommonTests.java deleted file mode 100644 index ce6034c4c5..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllCommonTests.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.suites; - -import org.apache.tuscany.das.rdb.test.BestPracticeTests; -import org.apache.tuscany.das.rdb.test.CUDGeneration; -import org.apache.tuscany.das.rdb.test.CompanyTests; -import org.apache.tuscany.das.rdb.test.CompoundKeyTests; -import org.apache.tuscany.das.rdb.test.ConverterTests; -import org.apache.tuscany.das.rdb.test.CorrectedDefectTests; -import org.apache.tuscany.das.rdb.test.CrudWithChangeHistory; -import org.apache.tuscany.das.rdb.test.ExceptionTests; -import org.apache.tuscany.das.rdb.test.GeneratedCommandTests; -import org.apache.tuscany.das.rdb.test.GeneratedId; -import org.apache.tuscany.das.rdb.test.GraphMergeTests; -import org.apache.tuscany.das.rdb.test.NameMappingTests; -import org.apache.tuscany.das.rdb.test.OCCTests; -import org.apache.tuscany.das.rdb.test.OperationOrderingTests; -import org.apache.tuscany.das.rdb.test.Paging; -import org.apache.tuscany.das.rdb.test.PartialUpdateTests; -import org.apache.tuscany.das.rdb.test.PassiveConnectionTests; -import org.apache.tuscany.das.rdb.test.RecursiveTests; -import org.apache.tuscany.das.rdb.test.RelationshipTests; -import org.apache.tuscany.das.rdb.test.ResultSetShapeTests; -import org.apache.tuscany.das.rdb.test.SerializationTests; -import org.apache.tuscany.das.rdb.test.SimplestCrud; -import org.apache.tuscany.das.rdb.test.StoredProcs; -import org.apache.tuscany.das.rdb.test.TopDown; -import org.apache.tuscany.das.rdb.test.TypeTests; -import org.apache.tuscany.das.rdb.test.CommandGroupTests; -import org.apache.tuscany.das.rdb.test.typed.SimplestStaticCrud; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class AllCommonTests { - - public static Test suite() { - TestSuite suite = new TestSuite("All platform-common DAS tests"); - //$JUnit-BEGIN$ - - suite.addTest(new TestSuite (SimplestCrud.class)); - suite.addTest(new TestSuite (CrudWithChangeHistory.class)); - suite.addTest(new TestSuite (SimplestStaticCrud.class)); - suite.addTest(new TestSuite (Paging.class)); - suite.addTest(new TestSuite (GeneratedId.class)); - - suite.addTest(new TestSuite (StoredProcs.class)); - suite.addTest(new TestSuite (CUDGeneration.class)); - suite.addTest(new TestSuite (TopDown.class)); - suite.addTest(new TestSuite (OCCTests.class)); - suite.addTest(new TestSuite (RecursiveTests.class)); - - suite.addTest(new TestSuite (GraphMergeTests.class)); - suite.addTest(new TestSuite (CompoundKeyTests.class)); - suite.addTest(new TestSuite (RelationshipTests.class)); - suite.addTest(new TestSuite (NameMappingTests.class)); - suite.addTest(new TestSuite (GeneratedCommandTests.class)); - - suite.addTest(new TestSuite (CompanyTests.class)); - suite.addTest(new TestSuite (ResultSetShapeTests.class)); - suite.addTest(new TestSuite (TypeTests.class)); - suite.addTest(new TestSuite (OperationOrderingTests.class)); - suite.addTest(new TestSuite (ConverterTests.class)); - - suite.addTest(new TestSuite (PartialUpdateTests.class)); - suite.addTest(new TestSuite (ExceptionTests.class)); - suite.addTest(new TestSuite (PassiveConnectionTests.class)); - suite.addTest(new TestSuite (SerializationTests.class)); - - suite.addTest(new TestSuite (CommandGroupTests.class)); - suite.addTest(new TestSuite (BestPracticeTests.class)); - suite.addTest(new TestSuite (CorrectedDefectTests.class)); - - //$JUnit-END$ - return suite; - } - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDB2.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDB2.java deleted file mode 100644 index a5fcb5eba0..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDB2.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.suites; - -import org.apache.tuscany.das.rdb.test.ReadDBSchemaTests; -import org.apache.tuscany.das.rdb.test.framework.DB2Setup; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class AllTestsDB2 { - - - public static Test suite() { - - TestSuite suite = new TestSuite(); - suite.addTest(AllCommonTests.suite()); - suite.addTest(new TestSuite (ReadDBSchemaTests.class)); - - TestSuite suite2 = new TestSuite("All DAS tests on DB2"); - suite2.addTest(new DB2Setup(suite)); - return suite2; - - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDerby.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDerby.java deleted file mode 100644 index 8af82f0114..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDerby.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.suites; - -import org.apache.tuscany.das.rdb.test.framework.DerbySetup; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class AllTestsDerby extends TestSuite { - - - public static Test suite() { - - TestSuite suite = new TestSuite("All DAS tests on Derby"); - suite.addTest(new DerbySetup(AllCommonTests.suite())); - return suite; - - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsMySQL.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsMySQL.java deleted file mode 100644 index 2b862eba8c..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsMySQL.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.suites; - -import org.apache.tuscany.das.rdb.test.framework.MySQLSetup; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class AllTestsMySQL { - - - public static Test suite() { - - TestSuite suite = new TestSuite("All DAS tests on MySQL"); - suite.addTest(new MySQLSetup(AllCommonTests.suite())); - return suite; - - } -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/typed/SimplestStaticCrud.java b/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/typed/SimplestStaticCrud.java deleted file mode 100644 index f8baca2cb8..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/typed/SimplestStaticCrud.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.das.rdb.test.typed; - -import java.io.InputStream; -import java.util.Collection; - -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.test.customer.CustomerFactory; -import org.apache.tuscany.das.rdb.test.customer.DataGraphRoot; -import org.apache.tuscany.das.rdb.test.data.CustomerData; -import org.apache.tuscany.das.rdb.test.framework.DasTest; -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.helper.TypeHelper; - - -/** - */ -public class SimplestStaticCrud extends DasTest { - - protected void setUp() throws Exception { - super.setUp(); - new CustomerData(getAutoConnection()).refresh(); - } - - public void testRead() throws Exception { - SDOUtil.registerStaticTypes(CustomerFactory.class); - InputStream mapping = getClass().getClassLoader().getResourceAsStream("basicStaticCustomer.xml"); - Command select = Command.FACTORY.createCommand("Select ID, LASTNAME, ADDRESS from CUSTOMER where LASTNAME = :LASTNAME",mapping); - select.setConnection(getConnection()); - select.setParameterValue("LASTNAME", "Williams"); - TypeHelper helper = TypeHelper.INSTANCE; - - select.setDataObjectModel(helper.getType(DataGraphRoot.class)); - - DataGraphRoot root = (DataGraphRoot) select.executeQuery(); - - Collection customers = root.getCustomers(); - assertEquals(4, customers.size()); - } - - -} diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/1xM_mapping_no_cud.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/1xM_mapping_no_cud.xml deleted file mode 100644 index 26d64e85d7..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/1xM_mapping_no_cud.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -
- - - - -
- - - - - -
- diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/CompanyConfig.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/CompanyConfig.xml deleted file mode 100644 index af9b994aaa..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/CompanyConfig.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - - -
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/CustOrdersConnectionProps.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/CustOrdersConnectionProps.xml deleted file mode 100644 index a103f7a9d4..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/CustOrdersConnectionProps.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - -
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/CustomersOrdersConfig.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/CustomersOrdersConfig.xml deleted file mode 100644 index 635b30d926..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/CustomersOrdersConfig.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - -
- - - -
- - - - - -
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCompanyDepartmentMapping.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/basicCompanyDepartmentMapping.xml deleted file mode 100644 index 4ddc1eb4fb..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCompanyDepartmentMapping.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - -
- - - - - - - -
- - - - - -
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCompanyMapping.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/basicCompanyMapping.xml deleted file mode 100644 index cf1429ff8f..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCompanyMapping.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - -
-
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMapping.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMapping.xml deleted file mode 100644 index 6ccfda6510..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMapping.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - -
- -
diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMappingWithCUD.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMappingWithCUD.xml deleted file mode 100644 index 760ce866f7..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMappingWithCUD.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - -
- -
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMappingWithInvalidCUD.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMappingWithInvalidCUD.xml deleted file mode 100644 index 8acf38db90..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerMappingWithInvalidCUD.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - -
- -
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerOrderMapping.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerOrderMapping.xml deleted file mode 100644 index 3881fb192b..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/basicCustomerOrderMapping.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - -
- - - -
- - - - - -
- diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/basicStaticCustomer.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/basicStaticCustomer.xml deleted file mode 100644 index 0de6d79af0..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/basicStaticCustomer.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - -
- -
diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/cityStates.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/cityStates.xml deleted file mode 100644 index 4a9108c835..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/cityStates.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - -
- - - - - - - -
- - - - - - -
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/company.ecore b/tags/java-stable-20060304/das/rdb/src/test/resources/company.ecore deleted file mode 100644 index 888acdf1c3..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/company.ecore +++ /dev/null @@ -1,130 +0,0 @@ - - - - -
-
- - - -
-
- - - - -
-
- - - - -
-
- - - - - -
-
- - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - - -
-
- - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
-
- - - - - -
-
- - - -
-
- - - - -
-
- - - - -
-
- - - - diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/company.genmodel b/tags/java-stable-20060304/das/rdb/src/test/resources/company.genmodel deleted file mode 100644 index 0b89c2c0c8..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/company.genmodel +++ /dev/null @@ -1,38 +0,0 @@ - - - company.xsd - http://www.eclipse.org/emf/2003/SDO - EMF_COMMONJ_SDO=org.eclipse.emf.commonj.sdo - EMF_ECORE_SDO=org.eclipse.emf.ecore.sdo - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/company.xsd b/tags/java-stable-20060304/das/rdb/src/test/resources/company.xsd deleted file mode 100644 index 44bc2bd3aa..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/company.xsd +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/companyMapping.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/companyMapping.xml deleted file mode 100644 index 1b30cb3a91..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/companyMapping.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - -
- - - -
- - -
- - - - - - - - - -
diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/customer.ecore b/tags/java-stable-20060304/das/rdb/src/test/resources/customer.ecore deleted file mode 100644 index 74786d8af4..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/customer.ecore +++ /dev/null @@ -1,96 +0,0 @@ - - - - -
-
- - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - - -
-
- - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - - -
-
- - - -
-
- - - - -
-
- - - - diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/customer.genmodel b/tags/java-stable-20060304/das/rdb/src/test/resources/customer.genmodel deleted file mode 100644 index 8c1cd53e57..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/customer.genmodel +++ /dev/null @@ -1,32 +0,0 @@ - - - customer.xsd - http://www.eclipse.org/emf/2003/SDO - EMF_COMMONJ_SDO=org.eclipse.emf.commonj.sdo - EMF_ECORE_SDO=org.eclipse.emf.ecore.sdo - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/customer.xsd b/tags/java-stable-20060304/das/rdb/src/test/resources/customer.xsd deleted file mode 100644 index c4a5bc2635..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/customer.xsd +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/customerMapping.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/customerMapping.xml deleted file mode 100644 index 35d05137a8..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/customerMapping.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - -
- -
\ No newline at end of file diff --git a/tags/java-stable-20060304/das/rdb/src/test/resources/customerOrderRelationshipMapping.xml b/tags/java-stable-20060304/das/rdb/src/test/resources/customerOrderRelationshipMapping.xml deleted file mode 100644 index ee739f1345..0000000000 --- a/tags/java-stable-20060304/das/rdb/src/test/resources/customerOrderRelationshipMapping.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - -
- - -
- - - - - -
- diff --git a/tags/java-stable-20060304/pom.xml b/tags/java-stable-20060304/pom.xml deleted file mode 100644 index dac7b2bc5c..0000000000 --- a/tags/java-stable-20060304/pom.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - - 4.0.0 - org.apache.tuscany - tuscany-project - SNAPSHOT - pom - Tuscany Project - http://incubator.apache.org/tuscany/ - - Tuscany is an open source project implementing a Service Component Architecture. - - 2005 - - Apache Software Foundation - http://www.apache.org/ - - - - 2.0 - - - - jira - http://issues.apache.org/jira/browse/TUSCANY - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - ibiblio - ibiblio - http://www.ibiblio.org/maven2 - - - - - spec - sdo - das - sca - samples - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - - - - - - src/main/java - - **/*.componentType - - - - src/main/resources - - - - - - src/test/java - - **/*.componentType - - - - src/test/resources - - - install - - - - - - maven-javadoc-plugin - - - maven-jxr-plugin - - - - diff --git a/tags/java-stable-20060304/samples/bigbank/account/pom.xml b/tags/java-stable-20060304/samples/bigbank/account/pom.xml deleted file mode 100644 index d1a385145f..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/account/pom.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - org.apache.tuscany.samples.bigbank - bigbank-samples - SNAPSHOT - - 4.0.0 - account - war - Tuscany sample BigBank account - BigBank sample - account module - SNAPSHOT - - - - org.apache.tuscany - tuscany-core - ${pom.version} - provided - - - - - - - org.apache.tuscany - tuscany-sdo-plugin - - - - ${basedir}/src/main/resources/wsdl/AccountService.wsdl - true - true - true - true - - - generate - - - - - - org.apache.tuscany - tuscany-sca-plugin - - - - ${basedir}/src/main/resources/wsdl/AccountService.wsdl - org.apache.tuscany.samples.bigbank.account.services.account - - - generate - - - - - - - - diff --git a/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/account/AccountServiceImpl.java b/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/account/AccountServiceImpl.java deleted file mode 100644 index 4552615227..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/account/AccountServiceImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank.account.services.account; - -import java.util.List; - -import org.apache.tuscany.samples.bigbank.account.AccountFactory; -import org.apache.tuscany.samples.bigbank.account.AccountReport; -import org.apache.tuscany.samples.bigbank.account.AccountSummary; -import org.apache.tuscany.samples.bigbank.account.services.accountdata.AccountDataService; -import org.apache.tuscany.samples.bigbank.account.services.accountdata.CheckingAccount; -import org.apache.tuscany.samples.bigbank.account.services.accountdata.SavingsAccount; -import org.apache.tuscany.samples.bigbank.account.services.accountdata.StockAccount; -import org.apache.tuscany.samples.bigbank.account.services.stockquote.StockQuoteService; -import org.apache.tuscany.sdo.util.SDOUtil; -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Service; - -@Service(interfaces=AccountService.class) -public class AccountServiceImpl implements AccountService { - - static { - SDOUtil.registerStaticTypes(AccountFactory.class); - } - - @Property - private String currency = "USD"; - - @Reference - private AccountDataService accountDataService; - @Reference - private StockQuoteService stockQuoteService; - - public AccountServiceImpl() { - } - - public AccountReport getAccountReport(String customerID) { - - AccountFactory accountFactory=new AccountFactory(); - - AccountReport accountReport = accountFactory.createAccountReport(); - List accountSummaries = accountReport.getAccountSummaries(); - - CheckingAccount checkingAccount = accountDataService.getCheckingAccount(customerID); - AccountSummary checkingAccountSummary = accountFactory.createAccountSummary(); - checkingAccountSummary.setAccountNumber(checkingAccount.getAccountNumber()); - checkingAccountSummary.setAccountType("checking"); - checkingAccountSummary.setBalance(fromUSDollarToCurrency(checkingAccount.getBalance())); - accountSummaries.add(checkingAccountSummary); - - SavingsAccount savingsAccount = accountDataService.getSavingsAccount(customerID); - AccountSummary savingsAccountSummary = accountFactory.createAccountSummary(); - savingsAccountSummary.setAccountNumber(savingsAccount.getAccountNumber()); - savingsAccountSummary.setAccountType("savings"); - savingsAccountSummary.setBalance(fromUSDollarToCurrency(savingsAccount.getBalance())); - accountSummaries.add(savingsAccountSummary); - - StockAccount stockAccount = accountDataService.getStockAccount(customerID); - AccountSummary stockAccountSummary = accountFactory.createAccountSummary(); - stockAccountSummary.setAccountNumber(stockAccount.getAccountNumber()); - stockAccountSummary.setAccountType("stock"); - float balance = (stockQuoteService.getQuote(stockAccount.getSymbol())) * stockAccount.getQuantity(); - stockAccountSummary.setBalance(fromUSDollarToCurrency(balance)); - accountSummaries.add(stockAccountSummary); - - return accountReport; - } - - private float fromUSDollarToCurrency(float value) { - - if (currency.equals("USD")) return value; - else if (currency.equals("EURO")) return value * 0.8f; - else - return 0.0f; - } -} diff --git a/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataService.java b/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataService.java deleted file mode 100644 index b0d07ed3e7..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataService.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank.account.services.accountdata; - -public interface AccountDataService { - - CheckingAccount getCheckingAccount(String customerID); - - SavingsAccount getSavingsAccount(String customerID); - - StockAccount getStockAccount(String customerID); -} diff --git a/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataServiceImpl.java b/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataServiceImpl.java deleted file mode 100644 index 963277ee76..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataServiceImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank.account.services.accountdata; - -import org.osoa.sca.annotations.Service; - -@Service(AccountDataService.class) -public class AccountDataServiceImpl implements AccountDataService { - - public CheckingAccount getCheckingAccount(String customerID) { - - CheckingAccount checkingAccount = new CheckingAccount(); - checkingAccount.setAccountNumber(customerID + "_" + "CHA12345"); - checkingAccount.setBalance(1500.0f); - - return checkingAccount; - } - - public SavingsAccount getSavingsAccount(String customerID) { - - SavingsAccount savingsAccount = new SavingsAccount(); - savingsAccount.setAccountNumber(customerID + "_" + "SAA12345"); - savingsAccount.setBalance(1500.0f); - - return savingsAccount; - } - - public StockAccount getStockAccount(String customerID) { - - StockAccount stockAccount = new StockAccount(); - stockAccount.setAccountNumber(customerID + "_" + "STA12345"); - stockAccount.setSymbol("IBM"); - stockAccount.setQuantity(100); - - return stockAccount; - } -} diff --git a/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/CheckingAccount.java b/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/CheckingAccount.java deleted file mode 100644 index b3dd6185e1..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/CheckingAccount.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank.account.services.accountdata; - -public class CheckingAccount { - - private String accountNumber; - private float balance; - - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - - public float getBalance() { - return balance; - } - - public void setBalance(float balance) { - this.balance = balance; - } -} diff --git a/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/SavingsAccount.java b/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/SavingsAccount.java deleted file mode 100644 index 0b7f2e0fd5..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/SavingsAccount.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank.account.services.accountdata; - -public class SavingsAccount { - - private String accountNumber; - private float balance; - - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - - public float getBalance() { - return balance; - } - - public void setBalance(float balance) { - this.balance = balance; - } -} diff --git a/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/StockAccount.java b/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/StockAccount.java deleted file mode 100644 index f6b90259b3..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/StockAccount.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank.account.services.accountdata; - -public class StockAccount { - - private String accountNumber; - private String symbol; - private int quantity; - - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - - public int getQuantity() { - return quantity; - } - - public void setQuantity(int quantity) { - this.quantity = quantity; - } - - public String getSymbol() { - return symbol; - } - - public void setSymbol(String symbol) { - this.symbol = symbol; - } -} diff --git a/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteService.java b/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteService.java deleted file mode 100644 index 80ac8d58be..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteService.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank.account.services.stockquote; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface StockQuoteService { - - public float getQuote(String symbol); -} - - \ No newline at end of file diff --git a/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteServiceImpl.java b/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteServiceImpl.java deleted file mode 100644 index ff4878b10c..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteServiceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank.account.services.stockquote; - -/* Dummy'd up StockQuoteService, override webservice for now */ - -public class StockQuoteServiceImpl implements StockQuoteService { - - public float getQuote(String symbol) { - // Just hardcode for now - return 83.00f; - } - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/sca.module b/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/sca.module deleted file mode 100644 index b13d844609..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/sca.module +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - AccountServiceComponent/AccountService - - - - - - EURO - - - AccountDataServiceComponent - StockQuoteService - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/sca.subsystem b/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/sca.subsystem deleted file mode 100644 index b15fa2bc5c..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/sca.subsystem +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - diff --git a/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/wsdl/AccountService.wsdl b/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/wsdl/AccountService.wsdl deleted file mode 100644 index 5d087530dd..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/wsdl/AccountService.wsdl +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/wsdl/StockQuoteWebService.wsdl b/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/wsdl/StockQuoteWebService.wsdl deleted file mode 100644 index 9678d9d6ea..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/wsdl/StockQuoteWebService.wsdl +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/bigbank/account/src/main/webapp/WEB-INF/axis2.xml b/tags/java-stable-20060304/samples/bigbank/account/src/main/webapp/WEB-INF/axis2.xml deleted file mode 100644 index a38cf9864a..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/account/src/main/webapp/WEB-INF/axis2.xml +++ /dev/null @@ -1,167 +0,0 @@ - - - - - false - false - false - - - - - admin - axis2 - - . - - 127.0.0.1 - 5555 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6060 - - - - - - - - - - - - - - - - - HTTP/1.1 - chunked - - - HTTP/1.1 - chunked - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/bigbank/account/src/main/webapp/WEB-INF/web.xml b/tags/java-stable-20060304/samples/bigbank/account/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 46bed8f4fe..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/account/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Tuscany Bigbank Account sample - - diff --git a/tags/java-stable-20060304/samples/bigbank/account/src/test/java/org/apache/tuscany/samples/bigbank/account/client/AccountClient.java b/tags/java-stable-20060304/samples/bigbank/account/src/test/java/org/apache/tuscany/samples/bigbank/account/client/AccountClient.java deleted file mode 100644 index b9bf5351c0..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/account/src/test/java/org/apache/tuscany/samples/bigbank/account/client/AccountClient.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank.account.client; - -import java.util.Iterator; - -import org.apache.tuscany.core.client.TuscanyRuntime; -import org.apache.tuscany.samples.bigbank.account.AccountReport; -import org.apache.tuscany.samples.bigbank.account.AccountSummary; -import org.apache.tuscany.samples.bigbank.account.services.account.AccountService; -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; -import org.osoa.sca.SCA; - -public class AccountClient extends SCA { - - public void start() { - } - - public void stop() { - } - - public static void main(String[] args) throws Exception { - TuscanyRuntime tuscany = new TuscanyRuntime("bigbank.account.testclient", null); - tuscany.start(); - ModuleContext moduleContext = CurrentModuleContext.getContext(); - - AccountService accountService = (AccountService) moduleContext.locateService("AccountServiceComponent"); - - AccountReport accountReport = accountService.getAccountReport("12345"); - - for (Iterator i = accountReport.getAccountSummaries().iterator(); i.hasNext();) { - AccountSummary accountSummary = (AccountSummary) i.next(); - - System.out.println(accountSummary.getAccountNumber()); - System.out.println(accountSummary.getAccountType()); - System.out.println(accountSummary.getBalance()); - } - - } - -} diff --git a/tags/java-stable-20060304/samples/bigbank/customers/META-INF/MANIFEST.MF b/tags/java-stable-20060304/samples/bigbank/customers/META-INF/MANIFEST.MF deleted file mode 100644 index ac6c17f07e..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/customers/META-INF/MANIFEST.MF +++ /dev/null @@ -1,7 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: sample -Bundle-SymbolicName: sample -Bundle-Version: 1.0.0 -Bundle-Localization: plugin -Require-Bundle: org.eclipse.emf.ecore.sdo diff --git a/tags/java-stable-20060304/samples/bigbank/customers/pom.xml b/tags/java-stable-20060304/samples/bigbank/customers/pom.xml deleted file mode 100644 index a96cfa328f..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/customers/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - org.apache.tuscany.samples.bigbank - bigbank-samples - SNAPSHOT - - 4.0.0 - customers - war - Tuscany sample BigBank customer - DAS example with JSP - SNAPSHOT - - - - org.apache.tuscany.das - tuscany-das-rdb - ${pom.version} - provided - - - org.osoa - sca-api - ${pom.version} - provided - - - diff --git a/tags/java-stable-20060304/samples/bigbank/customers/readme.htm b/tags/java-stable-20060304/samples/bigbank/customers/readme.htm deleted file mode 100644 index b4c4a8cbad..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/customers/readme.htm +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - Tuscany Customers - - - -

Tuscany Customer Sample

- -

Overview

- -

This sample employs the Tuscany runtime in collaboration with the RDB DAS to demonstrate a simple read of a customer -record from a relational database in the context of a web application. The user provides a customer -ID and the application responds with the corresponding customer record

- - -

Setup

Run the Maven 'acceptance' task as described in the Tomcat - Setup.  Running this task will configure and start a Tomcat server and deploy the sample application along with a -canned Derby database for use by the example. Instructions will be posted soon for manually deploying the -sample to an existing Tomcat install.
- - -
    - -
- -

Running

- -As mentioned above, running the Maven acceptance task deploys and runs the sample as part of the Tuscany acceptance testing. After the task has completed -you can manually run the sample by pointing a browser to: http://localhost:8080/tuscany-samples-customerWEB/. -A page is displayed that prompts the user for a customer id. Submit an integer from 1 to 3. - -

Results

- -

Submitting an integer from 1 to 3 will result in the display of the corresponding employee record
- -

Code Overview

- -The following illustrates the structure of the sample application components: - - - - - - - - - - - - -
main
- - +---java
- - ¦   ¦   - sca.module
- - ¦   ¦
- - ¦   +---org
- - ¦       - - +---apache
- - ¦           - +---tuscany
- - ¦              - +---samples
- - ¦                   - - +---customers
- ¦                           - CustomerClient.java
- ¦                           - CustomerServiceComponent.java
- ¦                           - CustomerServiceComponentImpl.java
- - ¦
- - +---webapp
- -     ¦   - Customer.jsp
- -     ¦
- -     +---customerdb
- -     ¦     - - - -     ¦   
- - -     ¦
- -     +---WEB-INF
-              web.xml - - -


- -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sca.module Defines the SCA module and component. Defines for the CustomerServiceComponent.
CustomerClient.java Wraps the get customer service to provide a clean "getCustomer()" API.
CustomerServiceComponent.java Defines the interface of the service.
Customer.jsp Handles Web form input. Instantiates a CustomerClient instance and calls getCustomer()
customerdb The canned Derby database with Customer records
web.xml Standard J2EE web application web.xml
- - - - diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerClient.java b/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerClient.java deleted file mode 100644 index 54603c94d6..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerClient.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.customers; - -import commonj.sdo.DataObject; -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; - -/** - * - */ -public class CustomerClient { - - public final DataObject getCustomer(String id) throws Exception { - - ModuleContext moduleContext = CurrentModuleContext.getContext(); - assert moduleContext != null : "CurrentModuleContext.getContext() returned null!"; - - CustomerServiceComponent customerService = (CustomerServiceComponent) moduleContext - .locateService("CustomerServiceComponent"); - assert null != customerService : "SCA locate of CustomerServiceComponent returned null."; - DataObject value = customerService.getCustomer(id); - - return value; - } - -} diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponent.java b/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponent.java deleted file mode 100644 index 431b10b0e1..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponent.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.customers; - -import commonj.sdo.DataObject; - -/** - * - */ - -public interface CustomerServiceComponent { - - public DataObject getCustomer(String id); - -} diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponentImpl.componentType b/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponentImpl.componentType deleted file mode 100644 index 09535eb86b..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponentImpl.componentType +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponentImpl.java b/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponentImpl.java deleted file mode 100644 index d78a5429c1..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponentImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.customers; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.util.List; - -import commonj.sdo.DataObject; -import org.osoa.sca.annotations.Service; - -import org.apache.tuscany.das.rdb.Command; - -/** - * - */ -@Service(CustomerServiceComponent.class) -public class CustomerServiceComponentImpl implements CustomerServiceComponent { - - private static final String driverName = "org.apache.derby.jdbc.EmbeddedDriver"; - - private static final String databaseURL = "jdbc:derby:../webapps/tuscany-samples-customerWEB/customerdb"; - - /* - * (non-Javadoc) - * - * @see org.apache.tuscany.samples.helloworldweb.HelloWorldServiceComponent#getGreetings() - */ - public DataObject getCustomer(String id) { - // Create and initialize command to read customers - Command readCustomers = Command.FACTORY - .createCommand("select * from CUSTOMER where ID = :ID"); - readCustomers.setConnection(getConnection()); - readCustomers.setParameterValue("ID", new Integer(id)); - - // Read - DataObject root = readCustomers.executeQuery(); - - readCustomers.close(); - - List customers = root.getList("CUSTOMER"); - if (customers.size() > 0) - return (DataObject) customers.get(0); - else - return null; - - } - - private Connection getConnection() { - try { - - Class.forName(driverName).newInstance(); - Connection connection = DriverManager.getConnection(databaseURL); - connection.setAutoCommit(false); - return connection; - } catch (Exception ex) { - throw new RuntimeException(ex); - } - - } - -} diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/sca.module b/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/sca.module deleted file mode 100644 index 64ff9341f2..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/sca.module +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/Customer.jsp b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/Customer.jsp deleted file mode 100644 index 8906a54f99..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/Customer.jsp +++ /dev/null @@ -1,94 +0,0 @@ - -<%-- - * Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - --%> - - - - <%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1" session="true" autoFlush="true" - isThreadSafe="true" isErrorPage="false" - import="org.apache.tuscany.samples.customers.CustomerClient" - import="java.io.PrintWriter" - import="java.io.StringWriter" - import="java.util.Iterator" - import="commonj.sdo.*" - %> - - - Tuscany HelloWorld WEB Example - <% - String id = request.getParameter("id"); - %> - - - -

Tuscany CustomerDB WEB Example

- -

 

- -
ID - please:    ">
-
-
-
- -<% - try { - if (null != id) { -%> -
- -

- - <% DataObject obj = (new CustomerClient()).getCustomer(id); - if ( obj == null ) {%> - -

Customer <%= id%> not found

-<%} else {%> - - - - <%Iterator iter = obj.getType().getProperties().iterator(); - while (iter.hasNext()) { - Property p = (Property) iter.next();%> - - <% - } - %> -
IDFirst NameLast Name
<%= obj.get(p)%>
-<% - } - } -} catch (Exception e) { - e.printStackTrace(); - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - - e.printStackTrace(pw); - pw.flush(); - -%> -Whoops!
-
-    Exception "<%=e.getClass().getName()%>" Exception message: "<%=e.getMessage()%>"
- <%=sw.toString() %> -
-<% - - }%> - - \ No newline at end of file diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/WEB-INF/web.xml b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 9c377a7f05..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - Tuscany sample Customers WEB - - - wsdl - text/xml - - - - xsd - text/xml - - - - Customer.jsp - - - diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/log.ctrl b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/log.ctrl deleted file mode 100644 index 07b131b33d..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/log.ctrl and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/log1.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/log1.dat deleted file mode 100644 index a2b39d02ad..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/log1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/logmirror.ctrl b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/logmirror.ctrl deleted file mode 100644 index 07b131b33d..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/logmirror.ctrl and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c10.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c10.dat deleted file mode 100644 index ec5247397b..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c10.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c101.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c101.dat deleted file mode 100644 index 56f1d60c9b..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c101.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c111.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c111.dat deleted file mode 100644 index d3b8b6f5e1..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c111.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c121.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c121.dat deleted file mode 100644 index 3a207dc135..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c121.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c130.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c130.dat deleted file mode 100644 index 62e5dfb863..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c130.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c141.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c141.dat deleted file mode 100644 index f695f44cd9..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c141.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c150.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c150.dat deleted file mode 100644 index 2c1e232161..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c150.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c161.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c161.dat deleted file mode 100644 index 9983bb5ba4..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c161.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c171.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c171.dat deleted file mode 100644 index 25800bbf47..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c171.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c180.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c180.dat deleted file mode 100644 index 8f4b0f0b5d..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c180.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c191.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c191.dat deleted file mode 100644 index b2d149a0f3..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c191.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1a1.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1a1.dat deleted file mode 100644 index 9a15a565ca..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1a1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1b1.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1b1.dat deleted file mode 100644 index 468738fdf3..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1b1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1c0.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1c0.dat deleted file mode 100644 index 359525a31a..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1c0.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1d1.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1d1.dat deleted file mode 100644 index 9f257df932..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1d1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1e0.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1e0.dat deleted file mode 100644 index e43e52fb7f..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1e0.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1f1.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1f1.dat deleted file mode 100644 index 7e6ee3b1e0..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1f1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c20.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c20.dat deleted file mode 100644 index 1acd3470bd..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c20.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c200.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c200.dat deleted file mode 100644 index cae919d022..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c200.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c211.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c211.dat deleted file mode 100644 index c7e311b00e..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c211.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c221.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c221.dat deleted file mode 100644 index 28e89367ce..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c221.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c230.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c230.dat deleted file mode 100644 index 505d1595c5..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c230.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c241.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c241.dat deleted file mode 100644 index e1de638de2..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c241.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c251.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c251.dat deleted file mode 100644 index d3d6adf4fb..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c251.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c260.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c260.dat deleted file mode 100644 index 8d7333df7d..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c260.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c271.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c271.dat deleted file mode 100644 index af722f7d73..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c271.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c281.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c281.dat deleted file mode 100644 index 3972983c2e..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c281.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c290.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c290.dat deleted file mode 100644 index 31577b8124..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c290.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2a1.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2a1.dat deleted file mode 100644 index 0f700d13a7..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2a1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2b1.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2b1.dat deleted file mode 100644 index 1d6382fb3d..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2b1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2c1.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2c1.dat deleted file mode 100644 index 3bc60d886b..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2c1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2d0.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2d0.dat deleted file mode 100644 index c542d3c91c..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2d0.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2e1.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2e1.dat deleted file mode 100644 index 16abd20b5f..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2e1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2f0.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2f0.dat deleted file mode 100644 index eb26be5932..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2f0.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c300.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c300.dat deleted file mode 100644 index f3a3c65388..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c300.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c31.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c31.dat deleted file mode 100644 index 73d5c7fae4..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c31.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c311.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c311.dat deleted file mode 100644 index f6a7e4f417..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c311.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c41.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c41.dat deleted file mode 100644 index eb58d83e26..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c41.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c51.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c51.dat deleted file mode 100644 index 7d0eec8334..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c51.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c60.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c60.dat deleted file mode 100644 index 5e3d16c18a..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c60.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c71.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c71.dat deleted file mode 100644 index 9ca2ca97d1..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c71.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c81.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c81.dat deleted file mode 100644 index 434cd610e1..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c81.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c90.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c90.dat deleted file mode 100644 index a7d7c228fa..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c90.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/ca1.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/ca1.dat deleted file mode 100644 index bd89820d88..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/ca1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cb1.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cb1.dat deleted file mode 100644 index 3fcb1cc026..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cb1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cc0.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cc0.dat deleted file mode 100644 index 5126021a83..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cc0.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cd1.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cd1.dat deleted file mode 100644 index 2e135b64ab..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cd1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/ce1.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/ce1.dat deleted file mode 100644 index 076423c10a..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/ce1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cf0.dat b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cf0.dat deleted file mode 100644 index b2ab11309b..0000000000 Binary files a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cf0.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/service.properties b/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/service.properties deleted file mode 100644 index 6a0ce30db7..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/service.properties +++ /dev/null @@ -1,22 +0,0 @@ -#C:\ossoa\trunk\samples\customers\src\webapp\customerdb -# ******************************************************************** -# *** Please do NOT edit this file. *** -# *** CHANGING THE CONTENT OF THIS FILE MAY CAUSE DATA CORRUPTION. *** -# ******************************************************************** -#Tue Nov 01 17:28:38 EST 2005 -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 diff --git a/tags/java-stable-20060304/samples/bigbank/pom.xml b/tags/java-stable-20060304/samples/bigbank/pom.xml deleted file mode 100644 index 0ec1824e0c..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - org.apache.tuscany.samples - tuscany-samples - SNAPSHOT - - 4.0.0 - org.apache.tuscany.samples.bigbank - bigbank-samples - pom - Tuscany BigBank Samples - SNAPSHOT - - - customers - account - webclient - - diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/pom.xml b/tags/java-stable-20060304/samples/bigbank/webclient/pom.xml deleted file mode 100644 index 7503f83246..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/webclient/pom.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - org.apache.tuscany.samples.bigbank - bigbank-samples - SNAPSHOT - - 4.0.0 - webclient - war - Tuscany sample BigBank webclient - BigBank sample - webclient module - SNAPSHOT - - - - org.apache.tuscany - tuscany-core - ${pom.version} - provided - - - - tomcat - servlet-api - 5.0.18 - provided - - - tomcat - jsp-api - 5.0.18 - provided - - - - - - - org.apache.tuscany - tuscany-sdo-plugin - - - - ${basedir}/src/main/resources/wsdl/AccountService.wsdl - true - true - true - true - - - generate - - - - - - org.apache.tuscany - tuscany-sca-plugin - - - - ${basedir}/src/main/resources/wsdl/AccountService.wsdl - org.apache.tuscany.samples.bigbank.account.services.account - - generate - - - - - - - - diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/account/AccountServiceComponentImpl.java b/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/account/AccountServiceComponentImpl.java deleted file mode 100644 index 3a9e7a4e60..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/account/AccountServiceComponentImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank.webclient.services.account; - -import org.apache.tuscany.samples.bigbank.account.AccountFactory; -import org.apache.tuscany.samples.bigbank.account.AccountReport; -import org.apache.tuscany.samples.bigbank.account.services.account.AccountService; -import org.apache.tuscany.sdo.util.SDOUtil; -import org.osoa.sca.ServiceUnavailableException; -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Service; - -/** - */ -@Service(AccountService.class) -public class AccountServiceComponentImpl implements AccountService { - - static { - SDOUtil.registerStaticTypes(AccountFactory.class); - } - - @Reference - public AccountService accountService; - - /** - * - */ - public AccountServiceComponentImpl() { - super(); - } - - /** - * @see org.apache.tuscany.samples.bigbank.webclient.services.account.AccountService#getAccountReport(java.lang.String) - */ - public AccountReport getAccountReport(String customerID) { - try { - return accountService.getAccountReport(customerID); - } catch (Exception e) { - throw new ServiceUnavailableException(e); - } - } - -} diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/LoginService.java b/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/LoginService.java deleted file mode 100644 index 7bb660082d..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/LoginService.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank.webclient.services.profile; - -public interface LoginService { - - public static final int SUCCESS = 1; - public static final int INVALID_LOGIN = -1; - public static final int INVALID_PASSWORD = -2; - - public int login(String userName, String password); -} - diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/ProfileService.java b/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/ProfileService.java deleted file mode 100644 index affbfe9700..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/ProfileService.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank.webclient.services.profile; - -public interface ProfileService { - - public String getFirstName(); - - public void setFirstName(String pName); - - public String getLastName(); - - public void setLastName(String pName); - - public boolean isLoggedIn(); - - public void setLoggedIn(boolean pStatus); - - public String getId(); - - public void setId(String pId); -} diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/ProfileServiceImpl.java b/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/ProfileServiceImpl.java deleted file mode 100644 index 7d572154c6..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/ProfileServiceImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank.webclient.services.profile; - -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -@Service(ProfileService.class) -@Scope("session") -public class ProfileServiceImpl implements ProfileService { - - @Property - private String firstName; - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - private String lastName; - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - private boolean loggedIn; - - public boolean isLoggedIn() { - return loggedIn; - } - - public void setLoggedIn(boolean status) { - loggedIn = status; - } - - private String id; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } -} - diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/SimpleLoginServiceImpl.java b/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/SimpleLoginServiceImpl.java deleted file mode 100644 index 2689dc7020..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/SimpleLoginServiceImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank.webclient.services.profile; - -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Service; - -@Service(LoginService.class) -public class SimpleLoginServiceImpl implements LoginService { - - @Reference - public ProfileService profileService; - - public int login(String userName, String password) { - - if (!"test".equals(userName)) { - return INVALID_LOGIN; - } - - if (!"password".equals(password)) { - return INVALID_PASSWORD; - } - - profileService.setLoggedIn(true); - profileService.setFirstName("John"); - profileService.setLastName("Doe"); - profileService.setId("12345"); - - return SUCCESS; - } -} diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/account/AccountStatusTag.java b/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/account/AccountStatusTag.java deleted file mode 100644 index ecdb0c49b4..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/account/AccountStatusTag.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank.webclient.tags.account; - -import java.util.Iterator; -import java.util.List; - -import javax.servlet.jsp.JspException; -import javax.servlet.jsp.tagext.TagSupport; - -import org.apache.tuscany.samples.bigbank.account.services.account.AccountService; -import org.apache.tuscany.samples.bigbank.webclient.services.profile.ProfileService; -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; - -/** - * Retrieves and iterates over account summary information for the current - * profile by accessing the remotable account service component - */ - -public class AccountStatusTag extends TagSupport { - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public AccountStatusTag() { - super(); - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - private String mAccountService; - - public String getAccountService() { - return mAccountService; - } - - public void setAccountService(String pAccountService) { - mAccountService = pAccountService; - } - - private String mProfileService; - - public String getProfileService() { - return mProfileService; - } - - public void setProfileService(String pProfileService) { - mProfileService = pProfileService; - } - - private String mId; - - public String getId() { - return mId; - } - - public void setId(String pId) { - mId = pId; - } - - private Iterator mIterator; - - public int doStartTag() throws JspException { - ModuleContext moduleContext = CurrentModuleContext.getContext(); - ProfileService profile = (ProfileService) moduleContext - .locateService(mProfileService); - if (profile == null) { - throw new JspException("Profile [" + mProfileService - + "] not found in current module context"); - } - - AccountService service = (AccountService) moduleContext - .locateService(mAccountService); - if (service == null) { - throw new JspException("Service [" + mAccountService - + "] not found in current module context"); - } - List summaries; - try { - summaries = service.getAccountReport(profile.getId()).getAccountSummaries(); - } catch (Exception e) { - throw new JspException(e); - } - mIterator = summaries.iterator(); - if (mIterator.hasNext()) { - pageContext.setAttribute(mId, mIterator.next()); - return EVAL_BODY_INCLUDE; - } else { - return SKIP_BODY; - } - } - - public int doAfterBody() { - if (mIterator.hasNext()) { - pageContext.setAttribute(mId, mIterator.next()); - return EVAL_BODY_AGAIN; - } else { - return SKIP_BODY; - } - } - - public void release() { - super.release(); - mId = null; - mIterator = null; - } -} \ No newline at end of file diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/LoginBarrierTag.java b/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/LoginBarrierTag.java deleted file mode 100644 index 31fa27fa6f..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/LoginBarrierTag.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank.webclient.tags.sca; - -import java.io.IOException; -import javax.servlet.ServletException; -import javax.servlet.jsp.JspException; -import javax.servlet.jsp.tagext.TagSupport; - -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; - -import org.apache.tuscany.samples.bigbank.webclient.services.profile.ProfileService; - -public class LoginBarrierTag extends TagSupport { - - public LoginBarrierTag() { - super(); - } - - private String mProfile; - - public String getProfile() { - return mProfile; - } - - public void setProfile(String pProfile) { - mProfile = pProfile; - } - - private String mUrl; - - public String getUrl() { - return mUrl; - } - - public void setUrl(String pUrl) { - mUrl = pUrl; - } - - public int doStartTag() throws JspException { - if (mProfile == null || mProfile.length() < 1) { - throw new JspException("Invalid profile location specified"); - } - - ModuleContext moduleContext = CurrentModuleContext.getContext(); - ProfileService profile = (ProfileService) moduleContext.locateService(mProfile); - if (profile == null) { - throw new JspException("Profile [" + mProfile + "] not found in current module context"); - } - if (profile.isLoggedIn()) { - return EVAL_BODY_INCLUDE; - } else { - try { - pageContext.forward(mUrl); - return SKIP_BODY; - } catch (ServletException e) { - throw new JspException("Unable to forward to [" + mUrl + "]"); - } catch (IOException e) { - throw new JspException("Unable to forward to [" + mUrl + "]"); - } - } - } - - public int doEndTag() throws JspException { - return EVAL_PAGE; - } - - public void release() { - super.release(); - } - -} diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/ServiceTag.java b/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/ServiceTag.java deleted file mode 100644 index df5697c11f..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/ServiceTag.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank.webclient.tags.sca; - -import javax.servlet.jsp.JspException; -import javax.servlet.jsp.tagext.TagSupport; - -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; - - -/** - * Places an SCA service in the JSP page context, making it available to other - * tags corresponding to its id value. - */ - -public class ServiceTag extends TagSupport { - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public ServiceTag() { - super(); - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - private String mName; - - /** - * Returns the name of the SCA service to import into the page context. - */ - public String getName() { - return mName; - } - - /** - * Sets name of the SCA service to import into the page context. - */ - public void setName(String pName) { - mName = pName; - } - - private String mId; - - /** - * Returns the id of the service in the page context - */ - public String getId() { - return mId; - } - - /** - * Sets the id of the service for the page context - */ - - public void setId(String pId) { - mId = pId; - } - - public int doStartTag() throws JspException { - ModuleContext moduleContext = CurrentModuleContext.getContext(); - Object service = moduleContext.locateService(mName); - if (service == null) { - throw new JspException("Service [" + mName + "] not found in current module context"); - } - if (mId == null) { - // if the Id name was not specified, default to the basic name of the - // service - mId = mName; - } - pageContext.setAttribute(mId, service); - return EVAL_BODY_INCLUDE; - } - - public int doEndTag() throws JspException { - return EVAL_PAGE; - } - - public void release() { - super.release(); - } -} \ No newline at end of file diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/ui/LoginServlet.java b/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/ui/LoginServlet.java deleted file mode 100644 index 78bedbe4f7..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/ui/LoginServlet.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank.webclient.ui; - -import java.io.IOException; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.tuscany.samples.bigbank.webclient.services.profile.LoginService; -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; - - -public class LoginServlet extends HttpServlet { - - private ServletContext mContext; - - public void init(ServletConfig pCfg) throws ServletException { - mContext = pCfg.getServletContext(); - } - - public void doPost(HttpServletRequest pReq, HttpServletResponse pResp) throws ServletException { - - ModuleContext moduleContext = CurrentModuleContext.getContext(); - LoginService loginMgr = (LoginService) - moduleContext.locateService("LoginServiceComponent"); - - if (loginMgr == null) { - throw new ServletException("LoginManager not found"); - } - - String login = pReq.getParameter("login"); - String password = pReq.getParameter("password"); - try { - if (login == null || password == null) { - pResp.sendRedirect("summary.jsp"); - } - int resp = loginMgr.login(login, password); - if (resp == LoginService.SUCCESS) { - mContext.getRequestDispatcher("/summary.jsp").forward(pReq, pResp); - } else { - mContext.getRequestDispatcher("/login.html").forward(pReq, pResp); - } - } catch (IOException e) { - throw new ServletException(e); - } - } -} diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/sca.module b/tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/sca.module deleted file mode 100644 index 6b4b17c6a7..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/sca.module +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - ProfileServiceComponent - - - - - - - Anonymous - - - - - - - AccountService - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/sca.subsystem b/tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/sca.subsystem deleted file mode 100644 index 1c12f340c8..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/sca.subsystem +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - bigbank.accountsunbsystem/AccountModuleComponent/AccountService - - - - - diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl b/tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl deleted file mode 100644 index 5d087530dd..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/axis2.xml b/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/axis2.xml deleted file mode 100644 index a38cf9864a..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/axis2.xml +++ /dev/null @@ -1,167 +0,0 @@ - - - - - false - false - false - - - - - admin - axis2 - - . - - 127.0.0.1 - 5555 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6060 - - - - - - - - - - - - - - - - - HTTP/1.1 - chunked - - - HTTP/1.1 - chunked - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld b/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld deleted file mode 100644 index c8a4451691..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld +++ /dev/null @@ -1,79 +0,0 @@ - - - - 1.0 - 2.0 - BigBank Tags - Tag library containing BigBank tags - - service - org.apache.tuscany.samples.bigbank.webclient.tags.sca.ServiceTag - JSP - Places a reference to an SCA Service in the page context - - id - true - false - - - name - true - false - - - - login - org.apache.tuscany.samples.bigbank.webclient.tags.sca.LoginBarrierTag - JSP - Redirects if user is not logged in - - profile - true - false - - - url - true - false - - - - - accountStatus - org.apache.tuscany.samples.bigbank.webclient.tags.account.AccountStatusTag - JSP - Accesses and iterates the account service - - id - true - false - - - accountService - true - false - - - profileService - true - false - - - - diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/web.xml b/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 859fb927af..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Tuscany Bigbank Web UI sample - - login.html - - - - LoginServlet - org.apache.tuscany.samples.bigbank.webclient.ui.LoginServlet - 1 - - - - LoginServlet - /loginAction/* - - - diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/login.html b/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/login.html deleted file mode 100644 index 72b180a29c..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/login.html +++ /dev/null @@ -1,24 +0,0 @@ - -Welcome to Big Bank - - -
- - - - -
Please login in to access your account
- - - - - - - - - - -
Login
Password
-
- - diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/summary.jsp b/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/summary.jsp deleted file mode 100644 index be56e2547c..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/summary.jsp +++ /dev/null @@ -1,48 +0,0 @@ -<%-- - Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable. - - 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. - --%> -<%@ taglib uri="/WEB-INF/bigbank-tags.tld" prefix="sca" %> - - - - - BigBank Account Summary - - - - Account Information for - - -
- - - - - - - - - - - - -
AccountBalance
- - - -
- - - diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/test/java/org/apache/tuscany/samples/bigbank/webclient/client/TestAccountService.java b/tags/java-stable-20060304/samples/bigbank/webclient/src/test/java/org/apache/tuscany/samples/bigbank/webclient/client/TestAccountService.java deleted file mode 100644 index de18ee0db2..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/webclient/src/test/java/org/apache/tuscany/samples/bigbank/webclient/client/TestAccountService.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank.webclient.client; - -import java.util.List; - -import org.apache.tuscany.core.client.TuscanyRuntime; -import org.apache.tuscany.samples.bigbank.account.AccountReport; -import org.apache.tuscany.samples.bigbank.account.services.account.AccountService; -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; -import org.osoa.sca.SCA; - - -public class TestAccountService extends SCA { - - public void start() { - } - - public void stop() { - } - - public static void main(String[] args) throws Exception { - TuscanyRuntime tuscany = new TuscanyRuntime("bigbank.webclient.testclient", null); - tuscany.start(); - ModuleContext moduleContext = CurrentModuleContext.getContext(); - - AccountService accountService = (AccountService) moduleContext.locateService("AccountServiceComponent"); - - AccountReport report = accountService.getAccountReport("12345"); - List summaries = report.getAccountSummaries(); - - System.out.println("retrieved " + summaries.size() + " summaries"); - - tuscany.stop(); - } -} diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/test/java/org/apache/tuscany/samples/bigbank/webclient/client/TestLoginService.java b/tags/java-stable-20060304/samples/bigbank/webclient/src/test/java/org/apache/tuscany/samples/bigbank/webclient/client/TestLoginService.java deleted file mode 100644 index ac16890127..0000000000 --- a/tags/java-stable-20060304/samples/bigbank/webclient/src/test/java/org/apache/tuscany/samples/bigbank/webclient/client/TestLoginService.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank.webclient.client; - -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; -import org.osoa.sca.SCA; - -import org.apache.tuscany.core.client.TuscanyRuntime; -import org.apache.tuscany.samples.bigbank.webclient.services.profile.LoginService; - - -public class TestLoginService extends SCA { - - public void start() { - } - - public void stop() { - } - - public static void main(String[] args) throws Exception { - - - TuscanyRuntime tuscany = new TuscanyRuntime("bigbank.webclient.testclient", null); - tuscany.start(); - ModuleContext moduleContext = CurrentModuleContext.getContext(); - LoginService loginService = (LoginService) - moduleContext.locateService("LoginServiceComponent"); - - if (loginService.login("test", "password") == LoginService.SUCCESS) - System.out.println("Success"); - else - System.out.println("Failure"); - } -} diff --git a/tags/java-stable-20060304/samples/das/companyweb/CompanyAppGbl.xml b/tags/java-stable-20060304/samples/das/companyweb/CompanyAppGbl.xml deleted file mode 100644 index 45d34aaac9..0000000000 --- a/tags/java-stable-20060304/samples/das/companyweb/CompanyAppGbl.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/db.lck b/tags/java-stable-20060304/samples/das/companyweb/dastest/db.lck deleted file mode 100644 index 9f6b4b3d4b..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/db.lck and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/log/log.ctrl b/tags/java-stable-20060304/samples/das/companyweb/dastest/log/log.ctrl deleted file mode 100644 index edbd775299..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/log/log.ctrl and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/log/log1.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/log/log1.dat deleted file mode 100644 index 7e85ac8e8f..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/log/log1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/log/logmirror.ctrl b/tags/java-stable-20060304/samples/das/companyweb/dastest/log/logmirror.ctrl deleted file mode 100644 index edbd775299..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/log/logmirror.ctrl and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c10.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c10.dat deleted file mode 100644 index 5d8ecaa10f..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c10.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c101.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c101.dat deleted file mode 100644 index 0f79fa7574..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c101.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c111.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c111.dat deleted file mode 100644 index 39d49e3d19..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c111.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c121.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c121.dat deleted file mode 100644 index 2a4311779b..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c121.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c130.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c130.dat deleted file mode 100644 index 64e3c18d62..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c130.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c141.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c141.dat deleted file mode 100644 index 0632d04164..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c141.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c150.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c150.dat deleted file mode 100644 index d7541026f6..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c150.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c161.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c161.dat deleted file mode 100644 index 6673bf1873..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c161.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c171.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c171.dat deleted file mode 100644 index c2a753cc5d..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c171.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c180.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c180.dat deleted file mode 100644 index cb9391aed1..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c180.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c191.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c191.dat deleted file mode 100644 index d3cf1d6364..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c191.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1a1.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1a1.dat deleted file mode 100644 index a7a2d536e9..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1a1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1b1.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1b1.dat deleted file mode 100644 index 19097e69e7..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1b1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1c0.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1c0.dat deleted file mode 100644 index 359525a31a..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1c0.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1d1.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1d1.dat deleted file mode 100644 index 9f257df932..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1d1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1e0.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1e0.dat deleted file mode 100644 index e43e52fb7f..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1e0.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1f1.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1f1.dat deleted file mode 100644 index 7e6ee3b1e0..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c1f1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c20.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c20.dat deleted file mode 100644 index 1be6390f06..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c20.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c200.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c200.dat deleted file mode 100644 index b15d56855c..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c200.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c211.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c211.dat deleted file mode 100644 index 84b0022312..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c211.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c221.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c221.dat deleted file mode 100644 index 63106a9523..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c221.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c230.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c230.dat deleted file mode 100644 index 9975f27c1f..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c230.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c241.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c241.dat deleted file mode 100644 index 835c645a16..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c241.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c251.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c251.dat deleted file mode 100644 index d3d6adf4fb..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c251.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c260.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c260.dat deleted file mode 100644 index 8d7333df7d..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c260.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c271.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c271.dat deleted file mode 100644 index af722f7d73..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c271.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c281.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c281.dat deleted file mode 100644 index 3972983c2e..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c281.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c290.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c290.dat deleted file mode 100644 index 31577b8124..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c290.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2a1.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2a1.dat deleted file mode 100644 index 0f700d13a7..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2a1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2b1.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2b1.dat deleted file mode 100644 index 1d6382fb3d..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2b1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2c1.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2c1.dat deleted file mode 100644 index 3bc60d886b..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2c1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2d0.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2d0.dat deleted file mode 100644 index c542d3c91c..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2d0.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2e1.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2e1.dat deleted file mode 100644 index 16abd20b5f..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2e1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2f0.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2f0.dat deleted file mode 100644 index eb26be5932..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c2f0.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c300.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c300.dat deleted file mode 100644 index 1214f1df4b..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c300.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c31.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c31.dat deleted file mode 100644 index 18c16f1123..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c31.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c311.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c311.dat deleted file mode 100644 index 926cbf25b5..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c311.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c320.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c320.dat deleted file mode 100644 index 07e7bc023c..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c320.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c331.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c331.dat deleted file mode 100644 index fd827f9dc2..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c331.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c340.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c340.dat deleted file mode 100644 index ca70319886..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c340.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c351.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c351.dat deleted file mode 100644 index 8fbe2a527c..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c351.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c360.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c360.dat deleted file mode 100644 index dcf9c746e1..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c360.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c371.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c371.dat deleted file mode 100644 index 6f21a840ea..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c371.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c380.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c380.dat deleted file mode 100644 index b512e8065f..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c380.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c391.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c391.dat deleted file mode 100644 index 27006e95a1..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c391.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3a0.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3a0.dat deleted file mode 100644 index 565dca97ac..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3a0.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3b1.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3b1.dat deleted file mode 100644 index 36894c9818..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3b1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3c0.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3c0.dat deleted file mode 100644 index d0c538aede..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3c0.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3d1.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3d1.dat deleted file mode 100644 index 65bcec5527..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3d1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3e0.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3e0.dat deleted file mode 100644 index bdab359420..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3e0.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3f1.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3f1.dat deleted file mode 100644 index dc2d278b57..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c3f1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c400.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c400.dat deleted file mode 100644 index 3072709cec..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c400.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c41.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c41.dat deleted file mode 100644 index 61086690f2..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c41.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c411.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c411.dat deleted file mode 100644 index ca551d8249..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c411.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c420.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c420.dat deleted file mode 100644 index f04de0840e..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c420.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c431.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c431.dat deleted file mode 100644 index 398b1672cc..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c431.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c440.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c440.dat deleted file mode 100644 index af259d0872..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c440.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c451.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c451.dat deleted file mode 100644 index 772a18c658..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c451.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c460.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c460.dat deleted file mode 100644 index 505428362d..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c460.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c471.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c471.dat deleted file mode 100644 index 484d0df42d..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c471.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c481.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c481.dat deleted file mode 100644 index faac073076..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c481.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c490.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c490.dat deleted file mode 100644 index 7585319d21..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c490.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c4a1.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c4a1.dat deleted file mode 100644 index 4fe8b786e3..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c4a1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c51.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c51.dat deleted file mode 100644 index 7fc7937b15..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c51.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c60.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c60.dat deleted file mode 100644 index d1fb08c946..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c60.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c71.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c71.dat deleted file mode 100644 index d4c2090a3b..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c71.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c81.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c81.dat deleted file mode 100644 index 38b6ea6520..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c81.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c90.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c90.dat deleted file mode 100644 index a607a5969c..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/c90.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/ca1.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/ca1.dat deleted file mode 100644 index 19b4c9e340..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/ca1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/cb1.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/cb1.dat deleted file mode 100644 index 73dc986572..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/cb1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/cc0.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/cc0.dat deleted file mode 100644 index d1eef3bb56..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/cc0.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/cd1.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/cd1.dat deleted file mode 100644 index c7e6db3ef7..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/cd1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/ce1.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/ce1.dat deleted file mode 100644 index 8fd3bf17a8..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/ce1.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/cf0.dat b/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/cf0.dat deleted file mode 100644 index 332b3d9a8a..0000000000 Binary files a/tags/java-stable-20060304/samples/das/companyweb/dastest/seg0/cf0.dat and /dev/null differ diff --git a/tags/java-stable-20060304/samples/das/companyweb/dastest/service.properties b/tags/java-stable-20060304/samples/das/companyweb/dastest/service.properties deleted file mode 100644 index 8cfe3b09a5..0000000000 --- a/tags/java-stable-20060304/samples/das/companyweb/dastest/service.properties +++ /dev/null @@ -1,22 +0,0 @@ -#C:\apacheSVN\java\target\dastest -# ******************************************************************** -# *** Please do NOT edit this file. *** -# *** CHANGING THE CONTENT OF THIS FILE MAY CAUSE DATA CORRUPTION. *** -# ******************************************************************** -#Fri Feb 17 08:55:29 MST 2006 -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 diff --git a/tags/java-stable-20060304/samples/das/companyweb/pom.xml b/tags/java-stable-20060304/samples/das/companyweb/pom.xml deleted file mode 100644 index 942ccccb21..0000000000 --- a/tags/java-stable-20060304/samples/das/companyweb/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - org.apache.tuscany.samples.das - das-samples - SNAPSHOT - - - 4.0.0 - companyWeb - war - Tuscany DAS sample Company WEB - Sample use of RDB DAS with JSP - SNAPSHOT - - - - - org.apache.tuscany.das - tuscany-das-rdb - ${pom.version} - provided - - - - diff --git a/tags/java-stable-20060304/samples/das/companyweb/readme.htm b/tags/java-stable-20060304/samples/das/companyweb/readme.htm deleted file mode 100644 index f9bfd4c946..0000000000 --- a/tags/java-stable-20060304/samples/das/companyweb/readme.htm +++ /dev/null @@ -1,567 +0,0 @@ - - - - - - - - -Tuscany RDB DAS Sample - - - - - - - - - - -
- -

Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.

- -

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.

- -

Tuscany RDB DAS Sample

- -

 

- -

This stand-alone sample demonstrates usage of the SDO RDB -Data Access Service in the context of a simple web application.

- -

 

- -

The application starts with a canned database of Companies -and their related Departments.  Through -the web page interface, a user can:

- -

 

- -
    -
  1. Display - all Companies in the database
  2. -
  3. Display - all Companies and related Departments
  4. -
  5. Add a - new Department to a Company
  6. -
  7. Delete - all Departments from a Company
  8. -
  9. Change - the names of Departments in a Company
  10. -
- -

 

- -

So, this simple application covers all CRUD operations as -well as the some relationship manipulation (adding a Department associates that -Department with the Company).  The sample -runs on Tomcat 5.5 and uses Derby -database.  Access to the database is via -a DataSource.

- -

Set Up

- -
    -
  1. Download - and install the most recent stable version of Tomcat 5.5.  You can find it here: http://tomcat.apache.org/download-55.cgi
  2. -
  3. Down - load the most recent official release of Derby - from here: http://db.apache.org/derby/index.html.  The only file you’ll need from this - download is derby.jar
  4. -
  5. Stop - Tomcat
  6. -
  7. Move the - following files (details in appendix) to {Tomcat_Home}/common/lib:
  8. -
      -
    1. tuscany-das-rdb-SNAPSHOT.jar
    2. -
    3. sdo-api-SNAPSHOT.jar
    4. -
    5. tuscany-sdo-impl-SNAPSHOT.jar
    6. -
    7. xsd{latest version}.jar
    8. -
    9. ecore-{latest - version}..jar
    10. -
    11. ecore-change-{latest - version}..jar
    12. -
    13. ecore-xmi-{latest version}.jar
    14. -
    15. common-{latest - version}.jar
    16. -
    17. derby.jar
    18. -
    -
  9. Add - the following files to {Tomcat_Home}/work
  10. -
      -
    1. companyWeb-SNAPSHOT.war
    2. -
    3. CompanyAppGbl.xml
    4. -
    -
  11. Install - the canned Derby database by copying - the dastest directory to {Tomcat_Home}/Databases.  The “dastest” - directory is found at /java/samples/das/companyweb.  So, just copy this directory, create a - “Databases” directory from {Tomcat Home} and drop in the “dastest” folder with all it contents.
  12. -
  13. Define - a DataSource by adding a datasource definition - to {Tomcat_Home}/conf/server.xml.
  14. -
      -
    1. Find - the end-of-section marker </GlobalNamingResources> - and add the following lines just above it:
    2. -
    -
- -

 

- -
        <!-- Global Datasource for Derby dastest database -->
         <Resource name="jdbc/dastest"
              type="javax.sql.DataSource"  auth="Container"
              description="Derby database for DAS Company sample"
              maxActive="100" maxIdle="30" maxWait="10000"
              username="" password="" 
              driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
              url="jdbc:derby:Databases/dastest"/>
                       
- -
    -
  1.   Start tomcat and
  2. -
      -
    1. go - to the manager console http://localhost:8080/manager/html
    2. -
    3. Scroll - down to the “deploy” section and enter the following:
    4. -
    -
- -

 

- -
Context Path (optional):      /CompanyApp
XML Configuration file URL:   work/CompanyAppGbl.xml
WAR or Directory URL:         work/CompanyApp.war
 
- -
    -
      -
    1. Hit - the “deploy” button
    2. -
    -
- -

 

- -
    -
  1. Get to - the sample application by clicking the named application in the “path” - column of the application sectiom of the manager - console.  Alternatively, you can - point your browser to http://localhost:8080/CompanyApp/
  2. -
- -

 

- -

Sample Architecture

- -

This is a simple, single-page, web application.  The main components of this application are:

- -
    -
  • The - RDB Data Access Service (DAS)
  • -
  • SDO
  • -
  • CompanyClient.java
  • -
  • Company.jsp
  • -
  • The - canned Derby database
  • -
- -

 

- -

 

- -

The CompanyClient -uses the DAS directly and provides -high-level services to the jsp such as:

- -

public -final List getCompanies()

- -

This is a good place to look for how you might use the DAS -in your own application.

- -

 

- -

The Company.jsp -responds to client interaction by invoking services of the CompanyClient.  It receives data from the CompanyClient -as SDO data graphs and manipulates SDOs directly to -display data.

- -

 

- -

The canned Derby -database comes preloaded with Companies and related Departments.  The database instance is a simple file -folder.

- -

 

- -

The DAS accepts -directives (commands) from the CompanyClient and -reads and writes to the derby database instance appropriately.

- -

 

- -

Appendix

- -

 

- -

The following specifies where you can find the dependency -jars you need to run this sample.  These -jars are available only after you -have successfully downloaded and build Tuscany/java.  Instructions for building can be found here:

- -

https://svn.apache.org/repos/asf/incubator/tuscany/java/BUILDING.txt

- -

 

- -

Dendendency jar locations:

- -
    -
  • tuscany-das-rdb-SNAPSHOT.jar – /java/das/rdb/target
  • -
  • sdo-api-SNAPSHOT.jar – /java/spec/sdo/target
  • -
  • tuscany-sdo-impl-SNAPSHOT.jar – /java/sdo/impl/target
  • -
  • xsd{latest version}.jar – - {user}/.m2/repository/org/eclipse/xsd
  • -
  • ecore-{latest version}.jar – - {user}/.m2/repository/org/eclipse/emf/ecore
  • -
  • ecore-change-{latest version}.jar – - {user}/.m2/repository/org/eclipse/emf/ecore-change
  • -
  • ecore-xmi-{latest version}.jar jar - – {user}/.m2/repository/org/eclipse/emf/ecore-xmi
  • -
  • common-{latest - version}.jar jar – - {user}/.m2/repository/org/eclipse/emf/common
  • -
  • derby.jar
  • -
- -

 

- -

Conventions:

- -
    -
  • {user} refers the directory where Maven2 is installed on - your machine.  On my machine, - “{user}” is “C:\Documents and Settings\Administrator”
  • -
  • {Tomcat_Home} refers to the directory that Tomcat is - installed on your machine.  On my - machine, this is “C:\Program Files\Apache Software Foundation\Tomcat 5.5”
  • -
  • {latest version} means the tag associated with the - latest version available in the maven2 repository.  For example the version of ecore-{latest version}.jar that I used for testing - this sample is “ecore-2.2.0-I200602160000.jar”
  • -
- -
- - - - diff --git a/tags/java-stable-20060304/samples/das/companyweb/src/main/java/org/apache/tuscany/samples/companyweb/CompanyClient.java b/tags/java-stable-20060304/samples/das/companyweb/src/main/java/org/apache/tuscany/samples/companyweb/CompanyClient.java deleted file mode 100644 index 32711609e1..0000000000 --- a/tags/java-stable-20060304/samples/das/companyweb/src/main/java/org/apache/tuscany/samples/companyweb/CompanyClient.java +++ /dev/null @@ -1,133 +0,0 @@ -package org.apache.tuscany.samples.das.companyweb; - -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import org.apache.tuscany.das.rdb.ApplyChangesCommand; -import org.apache.tuscany.das.rdb.Command; -import org.apache.tuscany.das.rdb.CommandGroup; - -import commonj.sdo.DataObject; - -public class CompanyClient { - - private Random generator = new Random(); - - private CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CompanyConfig.xml")); - - public final List getCompanies() { - - Command read = commandGroup.getCommand("all companies"); - DataObject root = read.executeQuery(); - return root.getList("COMPANY"); - - } - - public final List getCompaniesWithDepartments() { - - Command read = commandGroup.getCommand("all companies and departments"); - DataObject root = read.executeQuery(); - return root.getList("COMPANY"); - } - - public final List getDepartmentsForCompany(int id) { - Command read = commandGroup.getCommand("all departments for company"); - read.setParameterValue("ID", new Integer(id)); - DataObject root = read.executeQuery(); - return root.getList("COMPANY"); - } - - public final void addDepartmentToFirstCompany() { - Command read = commandGroup.getCommand("all companies and departments"); - DataObject root = read.executeQuery(); - DataObject firstCustomer = root.getDataObject("COMPANY[1]"); - - DataObject newDepartment = root.createDataObject("DEPARTMENT"); - newDepartment.setString("NAME", "Default Name"); - firstCustomer.getList("departments").add(newDepartment); - - ApplyChangesCommand apply = commandGroup.getApplyChangesCommand(); - apply.execute(root); - - } - - public final void deleteDepartmentsFromFirstCompany() { - - // This section gets the ID of the first Company just so I can - // demonstrate a parameterized command next - Command readAll = commandGroup.getCommand("all companies and departments"); - DataObject root = readAll.executeQuery(); - int idOfFirstCustomer = root.getInt("COMPANY[1]/ID"); - System.out.println("ID of first company is: " + idOfFirstCustomer); - - // Read a specific company based on the known ID - Command readCust = commandGroup.getCommand("company by id with departments"); - readCust.setParameterValue("ID", new Integer(idOfFirstCustomer)); - root = readCust.executeQuery(); - - // Delete all the comany's departments from the graph - DataObject firstCustomer = root.getDataObject("COMPANY[1]"); - - // Shallow copy of list for deleting. This is required to avoid the - // dreaded - // ConcurrentModificationException since #delete operation also removes - // from the original list - List allDepartments = new ArrayList(firstCustomer.getList("departments")); - - Iterator i = allDepartments.iterator(); - DataObject department; - while (i.hasNext()) { - department = (DataObject) i.next(); - System.out.println("Deleting department named: " + department.getString("NAME")); - department.delete(); - } - - ApplyChangesCommand apply = commandGroup.getApplyChangesCommand(); - apply.execute(root); - - } - - public final void changeFirstCompanysDepartmentNames() { - - // This section gets the ID of the first Company just so I can - // demonstrate a parameterized command next - Command readAll = commandGroup.getCommand("all companies and departments"); - DataObject root = readAll.executeQuery(); - int idOfFirstCustomer = root.getInt("COMPANY[1]/ID"); - System.out.println("ID of first company is: " + idOfFirstCustomer); - - // Read a specific company based on the known ID - Command readCust = commandGroup.getCommand("company by id with departments"); - readCust.setParameterValue("ID", new Integer(idOfFirstCustomer)); - root = readCust.executeQuery(); - - // Modify all the comany's department names - DataObject firstCustomer = root.getDataObject("COMPANY[1]"); - Iterator i = firstCustomer.getList("departments").iterator(); - DataObject department; - while (i.hasNext()) { - department = (DataObject) i.next(); - System.out.println("Modifying department: " + department.getString("NAME")); - department.setString("NAME", getRandomDepartmentName()); - } - - ApplyChangesCommand apply = commandGroup.getApplyChangesCommand(); - apply.execute(root); - - } - - // Utilities - - private String getRandomDepartmentName() { - int number = generator.nextInt(1000) + 1; - return "Dept-" + number; - } - - private InputStream getConfig(String fileName) { - return getClass().getClassLoader().getResourceAsStream(fileName); - } - -} diff --git a/tags/java-stable-20060304/samples/das/companyweb/src/main/resources/CompanyConfig.xml b/tags/java-stable-20060304/samples/das/companyweb/src/main/resources/CompanyConfig.xml deleted file mode 100644 index dc28804336..0000000000 --- a/tags/java-stable-20060304/samples/das/companyweb/src/main/resources/CompanyConfig.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - -
- -
- - - -
- - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/samples/das/companyweb/src/main/webapp/Company.jsp b/tags/java-stable-20060304/samples/das/companyweb/src/main/webapp/Company.jsp deleted file mode 100644 index c064f0a4fe..0000000000 --- a/tags/java-stable-20060304/samples/das/companyweb/src/main/webapp/Company.jsp +++ /dev/null @@ -1,151 +0,0 @@ - - -<%-- - * Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - --%> - - - -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - - pageEncoding="ISO-8859-1" - - import="org.apache.tuscany.samples.das.companyweb.CompanyClient" - import="commonj.sdo.*" -%> - - -Company Test - - - -

Tuscany DAS Companies WEB Example

- - -
- - - - - -
- - -<%if(request.getParameter("doFill") != null){%> - - - - - - - - - - - <% - java.util.Iterator i = (new CompanyClient()).getCompaniesWithDepartments().iterator(); - while (i.hasNext()) { - DataObject company = (DataObject)i.next(); - %> - - - - - <% - } - %> - - -
IDName
<%=company.getInt("ID")%><%=company.getString("NAME")%>
-<%}%> - - - -<% -if(request.getParameter("doAddDepartment") != null){ - - (new CompanyClient()).addDepartmentToFirstCompany(); - -} -%> - - -<% -if(request.getParameter("doDeleteDepartments") != null){ - - (new CompanyClient()).deleteDepartmentsFromFirstCompany(); -} -%> - - -<% -if(request.getParameter("doChangeDepartmentNames") != null){ - - (new CompanyClient()).changeFirstCompanysDepartmentNames(); -} -%> - - - -<%if(request.getParameter("doFill") == null) {%> - - - - - - - - - - - - - <% - java.util.Iterator i = (new CompanyClient()).getCompaniesWithDepartments().iterator(); - while (i.hasNext()) { - DataObject company = (DataObject)i.next(); - %> - - - - - - - - <% - java.util.Iterator j = company.getList("departments").iterator(); - while (j.hasNext()) { - DataObject department = (DataObject)j.next(); - %> - - - - - <% - } - %> - <% - } - %> - - -
IDNameDepartment_IDDepartment_Name
<%=company.getInt("ID")%><%=company.getString("NAME")%>
<%=department.getInt("ID")%><%=department.getString("NAME")%>
-<%}%> - - - -
- - diff --git a/tags/java-stable-20060304/samples/das/companyweb/src/main/webapp/WEB-INF/web.xml b/tags/java-stable-20060304/samples/das/companyweb/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 2908daece9..0000000000 --- a/tags/java-stable-20060304/samples/das/companyweb/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - Tuscany DAS sample Company WEB - - - Company.jsp - - - diff --git a/tags/java-stable-20060304/samples/das/pom.xml b/tags/java-stable-20060304/samples/das/pom.xml deleted file mode 100644 index 8acaa78bd9..0000000000 --- a/tags/java-stable-20060304/samples/das/pom.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - org.apache.tuscany.samples - tuscany-samples - SNAPSHOT - - 4.0.0 - org.apache.tuscany.samples.das - das-samples - pom - Tuscany DAS Samples - SNAPSHOT - - - companyweb - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworld/pom.xml b/tags/java-stable-20060304/samples/helloworld/helloworld/pom.xml deleted file mode 100644 index 8894f87edd..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworld/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - org.apache.tuscany.samples.helloworld - helloworld-samples - SNAPSHOT - - 4.0.0 - helloworld - jar - Tuscany sample HelloWorld - Sample classic helloworld - SNAPSHOT - - - - org.apache.tuscany - tuscany-core - ${pom.version} - compile - - - org.apache.tuscany - tuscany-container-java - ${pom.version} - compile - - - org.apache.tuscany - tuscany-container-js - ${pom.version} - compile - - - - junit - junit - 3.8.1 - test - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworld/readme.htm b/tags/java-stable-20060304/samples/helloworld/helloworld/readme.htm deleted file mode 100644 index de8fb48140..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworld/readme.htm +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - Tuscany HelloWorld - - - -

Tuscany Hello World Sample

- -

Overview

- -

The Tuscany helloworld sample shows using the Tuscany SCA - runtime in a J2SE environment  loading a component that - implements the classic introductory hello world example.

- - -

Setup

The jars for a J2SE setup  not requiring web -services are required including the sample's own jar helloworld-SNAPSHOT.jar. - - -
    -
- -

Running

- -Using JDK 1.5 java command with the previous jars run the class org.apache.tuscany.samples.helloworld.HelloWorldClient -
- -

Results

- -

The sample when run should simply display to the standard - output:
- - Hello World

- - -

Code Overview

- -The source files are physically organized as shown below: -
sca.module
org
+-apache
+-tuscany
+-samples
+-helloworld
HelloWorldClient.java
- HelloWorldService.java
HelloWorldServiceComponentImpl.java


- -

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sca.moduleDefines the SCA module and component. Defines for the - HelloWorldServiceComponent component  the Java class that - implements that component
HelloWorldService.javaDefines the Java interface implemented by the component.
HelloWorldServiceComponentImpl.javaImplements the SCA component. Uses the SCA service - annotation tag on the class to show what SCA interface is being - implemented.
HelloWorldClient.javaCreates a Tuscany runtime and starts it. -  Obtains the module context which was defined by the - sca.module file. From the module context locates the - HelloWorldServiceComponent and then calls  the getGreetings - method to invoke the component.
- -
- - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworld/src/main/java/org/apache/tuscany/samples/helloworld/HelloWorldClient.java b/tags/java-stable-20060304/samples/helloworld/helloworld/src/main/java/org/apache/tuscany/samples/helloworld/HelloWorldClient.java deleted file mode 100644 index 0dca894fde..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworld/src/main/java/org/apache/tuscany/samples/helloworld/HelloWorldClient.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworld; - -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; - -import org.apache.tuscany.core.client.TuscanyRuntime; - -/** - * This client program shows how to create an SCA runtime, start it, locate a simple HelloWorld service component - * and invoke it. - */ -public class HelloWorldClient { - - public static final void main(String[] args) throws Exception { - - // Obtain Tuscany runtime - TuscanyRuntime tuscany = new TuscanyRuntime("hello", null); - - // Start the runtime - tuscany.start(); - - // Obtain SCA module context. - ModuleContext moduleContext = CurrentModuleContext.getContext(); - - // Locate the HelloWorld service component and invoke it - HelloWorldService helloworldService = (HelloWorldService) moduleContext.locateService("HelloWorldServiceComponent"); - - String value = helloworldService.getGreetings("World"); - - System.out.println(value); - - // Stop the runtime - tuscany.stop(); - } -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworld/src/main/java/org/apache/tuscany/samples/helloworld/HelloWorldService.java b/tags/java-stable-20060304/samples/helloworld/helloworld/src/main/java/org/apache/tuscany/samples/helloworld/HelloWorldService.java deleted file mode 100644 index 312b46ed41..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworld/src/main/java/org/apache/tuscany/samples/helloworld/HelloWorldService.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworld; - -/** - * This is the business interface of the HelloWorld service component. - */ -public interface HelloWorldService { - - public String getGreetings(String name); - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworld/src/main/java/org/apache/tuscany/samples/helloworld/HelloWorldServiceComponentImpl.java b/tags/java-stable-20060304/samples/helloworld/helloworld/src/main/java/org/apache/tuscany/samples/helloworld/HelloWorldServiceComponentImpl.java deleted file mode 100644 index 6aa0fa611e..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworld/src/main/java/org/apache/tuscany/samples/helloworld/HelloWorldServiceComponentImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworld; - -import org.osoa.sca.annotations.Service; - -/** - * This class implements the HelloWorld service component. - */ -@Service(HelloWorldService.class) -public class HelloWorldServiceComponentImpl implements HelloWorldService { - - /* - * @see org.apache.tuscany.samples.helloworld.HelloWorldServiceComponent#getGreetings() - */ - public String getGreetings(String name) { - return "Hello " + name; - } - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworld/src/main/resources/sca.module b/tags/java-stable-20060304/samples/helloworld/helloworld/src/main/resources/sca.module deleted file mode 100644 index f5f26e5994..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworld/src/main/resources/sca.module +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworld/src/test/java/org/apache/tuscany/samples/helloworld/HelloWorldServiceComponentTestCase.java b/tags/java-stable-20060304/samples/helloworld/helloworld/src/test/java/org/apache/tuscany/samples/helloworld/HelloWorldServiceComponentTestCase.java deleted file mode 100644 index 2681ce02bc..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworld/src/test/java/org/apache/tuscany/samples/helloworld/HelloWorldServiceComponentTestCase.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworld; - -import junit.framework.TestCase; - -import org.apache.tuscany.core.client.TuscanyRuntime; -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; - -/** - * - */ -public class HelloWorldServiceComponentTestCase extends TestCase { - public boolean verbose = true; - - public void testGeetings() throws Exception { - - if (verbose) - System.out.println("starting test.."); - System.out.flush(); - - - TuscanyRuntime tuscany = new TuscanyRuntime("test", null); - tuscany.start(); - ModuleContext moduleContext = CurrentModuleContext.getContext(); - - assertNotNull(moduleContext); - System.out.println("module context name '" - + moduleContext.getName() + "'"); - System.out.println("module context uri '" + moduleContext.getURI() - + "'"); - HelloWorldService helloworldService = (HelloWorldService) moduleContext.locateService("HelloWorldServiceComponent"); - - assertNotNull(helloworldService); - - - String value = helloworldService - .getGreetings("World"); - - if (verbose) - System.out.println("Value = '" + value + "'"); - - assertEquals("Hello World", value); - - tuscany.stop(); - - } - - public final static void main(String[] args) throws Exception { - HelloWorldServiceComponentTestCase hwc = new HelloWorldServiceComponentTestCase(); - hwc.setVerbose(true); - hwc.testGeetings(); - - } - - public boolean isVerbose() { - return verbose; - } - - public void setVerbose(boolean verbose) { - this.verbose = verbose; - } - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/axiscmds.bat b/tags/java-stable-20060304/samples/helloworld/helloworldaxis/axiscmds.bat deleted file mode 100644 index 554d9f4d07..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/axiscmds.bat +++ /dev/null @@ -1,2 +0,0 @@ -wsdl2java -s -S true -o wsdl2javaOut helloworld.wsdl -java2wsdl -o helloworld.wsdl -l http://localhost:8080/axis/services/helloworld -y WRAPPED org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImpl diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/helloworld.wsdl b/tags/java-stable-20060304/samples/helloworld/helloworldaxis/helloworld.wsdl deleted file mode 100644 index 6f18227b06..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/helloworld.wsdl +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/orig-java-to-create-wsdl/org/apache/tuscany/samples/helloworldaxis/HelloWorldService.java b/tags/java-stable-20060304/samples/helloworld/helloworldaxis/orig-java-to-create-wsdl/org/apache/tuscany/samples/helloworldaxis/HelloWorldService.java deleted file mode 100644 index e5ac65c462..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/orig-java-to-create-wsdl/org/apache/tuscany/samples/helloworldaxis/HelloWorldService.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldaxis; - -/** - * - */ - -public interface HelloWorldService{ - public static final String DEFAULT_NAME= "World"; - public String getGreetings(String name); - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/orig-java-to-create-wsdl/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImpl.java b/tags/java-stable-20060304/samples/helloworld/helloworldaxis/orig-java-to-create-wsdl/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImpl.java deleted file mode 100644 index 7ed491112f..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/orig-java-to-create-wsdl/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldaxis; - - -/** - * - */ -public class HelloWorldServiceImpl implements HelloWorldService { - public final static String greetings = "Hello "; - - /* - * (non-Javadoc) - * - * @see org.apache.tuscany.samples.helloworld.HelloWorldServiceComponent#getGreetings() - */ - public String getGreetings(String name) { - return greetings + name ; - } - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/pom.xml b/tags/java-stable-20060304/samples/helloworld/helloworldaxis/pom.xml deleted file mode 100644 index 831c7b269e..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - org.apache.tuscany.samples.helloworld - helloworld-samples - SNAPSHOT - - 4.0.0 - helloworldaxis - jar - Tuscany sample HelloWorld Axis - Sample classic helloworld Axis to test with Tuscany SCA - SNAPSHOT - - - - org.apache.tuscany - tuscany-core - ${pom.version} - compile - - - org.apache.tuscany - tuscany-container-java - ${pom.version} - compile - - - org.apache.tuscany - tuscany-binding-axis - ${pom.version} - compile - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/readme.htm b/tags/java-stable-20060304/samples/helloworld/helloworldaxis/readme.htm deleted file mode 100644 index 4969bbf20e..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/readme.htm +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - Tuscany Hello World Axis - - - -

Tuscany Hello World Axis

- -

Overview

- -

The Tuscany hello world axis sample is not an SCA application. -  This sample is a simple Apache Axis service. Starting from - a Java source using Axis's - java2wsdl to create a document literal WSDL.  And then using - that WSDL in wsdl2java to create all the Axis service and client - artifacts. Details on this can be found reviewing the Axis - documentation.

- -

The original Java code to generate is simply:

- - - - - - - - - - - - -
-

package org.apache.tuscany.samples.helloworldaxis;
- -
- - /**
- -  *
- -  */
- -
- - public interface HelloWorldService{
- -     public static final String DEFAULT_NAME= - "World";
- -     public String getGreetings(String name);
- -
- - }
- -

- -
- -

- -

The purpose for it's inclusion in the samples is to - demonstrate the interoperability of  Tuscany's web service - binding with another SOAP implementation.

- -

Setup

- -The following jars are required from the Maven repository in -the classpath to run the sample client -
helloworldaxis-SNAPSHOT.jar
axis-1.2.1.jar
axis-jaxrpc-1.2.1.jar -
axis-saaj-1.2.1.jar
axis-wsdl4j-1.5.1.jar
commons-discovery-0.2.jar
commons-logging-1.0.4.jar

-
- -See helloworldws and  helloworldaxissvc samples for the server side service -setup instructions.
- -

Running.

Using JDK 1.5 java command with the previous jars run the class -org.apache.tuscany.samples.helloworldaxis.HelloWorldAxisClient
Optional arguments:
 
- -
  Run against sample Tuscany SCA service: (default no arguments) -
     http://localhost:8080/helloworldws-SNAPSHOT/services/HelloWorldService - World
  Run against sample Axis Service:
     - http://localhost:8080/helloworldaxissvc-SNAPSHOT/services/helloworld World
- -

Results

- -

The sample when run should simply display to the standard - output:
- - Hello World

- - -

Code Overview

- -More detailed information about Axis web services can be found on the -Apache Axis website.
- - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldAxisClient.java b/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldAxisClient.java deleted file mode 100644 index 735f6804b5..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldAxisClient.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldaxis; - -import java.net.URL; -import javax.xml.rpc.ServiceException; - -public class HelloWorldAxisClient { - - final static String urlstrAxisService = "http://localhost:8080/tuscany-samples-helloworldaxissvc/services/helloworld"; - final static String urlstrTuscanyService = "http://localhost:8080/tuscany-samples-helloworldws-service/services/HelloWorldService"; - - public String getGreetings(String urlstr, String name) throws Exception { - URL url = new URL(urlstr); - - HelloWorldServiceImpl helloworld = (new HelloWorldServiceImplServiceLocator()) - .gethelloworld(url); - - return helloworld.getGreetings(name); - } - - /** - * @param args either <name> or <service url> <name> - * @throws ServiceException - */ - public static void main(String[] args) throws Exception { - - String urlstr = args.length > 1 ? args[0] - : urlstrTuscanyService; - - String name = args.length < 1 ? "World" : (args.length > 1 ? args[1] - : args[0]); - - System.out.println((new HelloWorldAxisClient()).getGreetings(urlstr, - name)); - - } - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImpl.java b/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImpl.java deleted file mode 100644 index 3ad4376c6c..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImpl.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldaxis; - -public interface HelloWorldServiceImpl extends java.rmi.Remote { - public java.lang.String getGreetings(java.lang.String in0) throws java.rmi.RemoteException; -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplService.java b/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplService.java deleted file mode 100644 index fd84ab2449..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplService.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldaxis; - -public interface HelloWorldServiceImplService extends javax.xml.rpc.Service { - public java.lang.String gethelloworldAddress(); - - public org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImpl gethelloworld() throws javax.xml.rpc.ServiceException; - - public org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImpl gethelloworld(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplServiceLocator.java b/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplServiceLocator.java deleted file mode 100644 index 9d4be5e7e6..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplServiceLocator.java +++ /dev/null @@ -1,148 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldaxis; - -public class HelloWorldServiceImplServiceLocator extends org.apache.axis.client.Service implements org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImplService { - - public HelloWorldServiceImplServiceLocator() { - } - - - public HelloWorldServiceImplServiceLocator(org.apache.axis.EngineConfiguration config) { - super(config); - } - - public HelloWorldServiceImplServiceLocator(java.lang.String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException { - super(wsdlLoc, sName); - } - - // Use to get a proxy class for helloworld - private java.lang.String helloworld_address = "http://localhost:8080/axis/services/helloworld"; - - public java.lang.String gethelloworldAddress() { - return helloworld_address; - } - - // The WSDD service name defaults to the port name. - private java.lang.String helloworldWSDDServiceName = "helloworld"; - - public java.lang.String gethelloworldWSDDServiceName() { - return helloworldWSDDServiceName; - } - - public void sethelloworldWSDDServiceName(java.lang.String name) { - helloworldWSDDServiceName = name; - } - - public org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImpl gethelloworld() throws javax.xml.rpc.ServiceException { - java.net.URL endpoint; - try { - endpoint = new java.net.URL(helloworld_address); - } - catch (java.net.MalformedURLException e) { - throw new javax.xml.rpc.ServiceException(e); - } - return gethelloworld(endpoint); - } - - public org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImpl gethelloworld(java.net.URL portAddress) throws javax.xml.rpc.ServiceException { - try { - org.apache.tuscany.samples.helloworldaxis.HelloworldSoapBindingStub _stub = new org.apache.tuscany.samples.helloworldaxis.HelloworldSoapBindingStub(portAddress, this); - _stub.setPortName(gethelloworldWSDDServiceName()); - return _stub; - } - catch (org.apache.axis.AxisFault e) { - return null; - } - } - - public void sethelloworldEndpointAddress(java.lang.String address) { - helloworld_address = address; - } - - /** - * For the given interface, get the stub implementation. - * If this service has no port for the given interface, - * then ServiceException is thrown. - */ - public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { - try { - if (org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImpl.class.isAssignableFrom(serviceEndpointInterface)) { - org.apache.tuscany.samples.helloworldaxis.HelloworldSoapBindingStub _stub = new org.apache.tuscany.samples.helloworldaxis.HelloworldSoapBindingStub(new java.net.URL(helloworld_address), this); - _stub.setPortName(gethelloworldWSDDServiceName()); - return _stub; - } - } - catch (java.lang.Throwable t) { - throw new javax.xml.rpc.ServiceException(t); - } - throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName())); - } - - /** - * For the given interface, get the stub implementation. - * If this service has no port for the given interface, - * then ServiceException is thrown. - */ - public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { - if (portName == null) { - return getPort(serviceEndpointInterface); - } - java.lang.String inputPortName = portName.getLocalPart(); - if ("helloworld".equals(inputPortName)) { - return gethelloworld(); - } else { - java.rmi.Remote _stub = getPort(serviceEndpointInterface); - ((org.apache.axis.client.Stub) _stub).setPortName(portName); - return _stub; - } - } - - public javax.xml.namespace.QName getServiceName() { - return new javax.xml.namespace.QName("http://helloworldaxis.samples.tuscany.apache.org", "HelloWorldServiceImplService"); - } - - private java.util.HashSet ports = null; - - public java.util.Iterator getPorts() { - if (ports == null) { - ports = new java.util.HashSet(); - ports.add(new javax.xml.namespace.QName("http://helloworldaxis.samples.tuscany.apache.org", "helloworld")); - } - return ports.iterator(); - } - - /** - * Set the endpoint address for the specified port name. - */ - public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException { - - if ("helloworld".equals(portName)) { - sethelloworldEndpointAddress(address); - } else { // Unknown Port Name - throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName); - } - } - - /** - * Set the endpoint address for the specified port name. - */ - public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException { - setEndpointAddress(portName.getLocalPart(), address); - } - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloworldSoapBindingImpl.java b/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloworldSoapBindingImpl.java deleted file mode 100644 index f3b00e2ea5..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloworldSoapBindingImpl.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldaxis; - -public class HelloworldSoapBindingImpl implements org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImpl { - public java.lang.String getGreetings(java.lang.String in0) throws java.rmi.RemoteException { - return "Hello " + in0; - } - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloworldSoapBindingSkeleton.java b/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloworldSoapBindingSkeleton.java deleted file mode 100644 index 276cf5cf0e..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloworldSoapBindingSkeleton.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldaxis; - -public class HelloworldSoapBindingSkeleton implements org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImpl, org.apache.axis.wsdl.Skeleton { - private org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImpl impl; - private static java.util.Map _myOperations = new java.util.Hashtable(); - private static java.util.Collection _myOperationsList = new java.util.ArrayList(); - - /** - * Returns List of OperationDesc objects with this name - */ - public static java.util.List getOperationDescByName(java.lang.String methodName) { - return (java.util.List) _myOperations.get(methodName); - } - - /** - * Returns Collection of OperationDescs - */ - public static java.util.Collection getOperationDescs() { - return _myOperationsList; - } - - static { - org.apache.axis.description.OperationDesc _oper; - org.apache.axis.description.FaultDesc _fault; - org.apache.axis.description.ParameterDesc [] _params; - _params = new org.apache.axis.description.ParameterDesc []{ - new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://helloworldaxis.samples.tuscany.apache.org", "in0"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false), - }; - _oper = new org.apache.axis.description.OperationDesc("getGreetings", _params, new javax.xml.namespace.QName("http://helloworldaxis.samples.tuscany.apache.org", "getGreetingsReturn")); - _oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - _oper.setElementQName(new javax.xml.namespace.QName("http://helloworldaxis.samples.tuscany.apache.org", "getGreetings")); - _oper.setSoapAction(""); - _myOperationsList.add(_oper); - if (_myOperations.get("getGreetings") == null) { - _myOperations.put("getGreetings", new java.util.ArrayList()); - } - ((java.util.List) _myOperations.get("getGreetings")).add(_oper); - } - - public HelloworldSoapBindingSkeleton() { - this.impl = new org.apache.tuscany.samples.helloworldaxis.HelloworldSoapBindingImpl(); - } - - public HelloworldSoapBindingSkeleton(org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImpl impl) { - this.impl = impl; - } - - public java.lang.String getGreetings(java.lang.String in0) throws java.rmi.RemoteException { - java.lang.String ret = impl.getGreetings(in0); - return ret; - } - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloworldSoapBindingStub.java b/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloworldSoapBindingStub.java deleted file mode 100644 index 7fd9622c7e..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloworldSoapBindingStub.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldaxis; - -public class HelloworldSoapBindingStub extends org.apache.axis.client.Stub implements org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImpl { - private java.util.Vector cachedSerClasses = new java.util.Vector(); - private java.util.Vector cachedSerQNames = new java.util.Vector(); - private java.util.Vector cachedSerFactories = new java.util.Vector(); - private java.util.Vector cachedDeserFactories = new java.util.Vector(); - - static org.apache.axis.description.OperationDesc [] _operations; - - static { - _operations = new org.apache.axis.description.OperationDesc[1]; - _initOperationDesc1(); - } - - private static void _initOperationDesc1() { - org.apache.axis.description.OperationDesc oper; - org.apache.axis.description.ParameterDesc param; - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("getGreetings"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://helloworldaxis.samples.tuscany.apache.org", "in0"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - oper.setReturnClass(java.lang.String.class); - oper.setReturnQName(new javax.xml.namespace.QName("http://helloworldaxis.samples.tuscany.apache.org", "getGreetingsReturn")); - oper.setStyle(org.apache.axis.constants.Style.WRAPPED); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - _operations[0] = oper; - - } - - public HelloworldSoapBindingStub() throws org.apache.axis.AxisFault { - this(null); - } - - public HelloworldSoapBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { - this(service); - super.cachedEndpoint = endpointURL; - } - - public HelloworldSoapBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { - if (service == null) { - super.service = new org.apache.axis.client.Service(); - } else { - super.service = service; - } - ((org.apache.axis.client.Service) super.service).setTypeMappingVersion("1.2"); - } - - protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { - try { - org.apache.axis.client.Call _call = super._createCall(); - if (super.maintainSessionSet) { - _call.setMaintainSession(super.maintainSession); - } - if (super.cachedUsername != null) { - _call.setUsername(super.cachedUsername); - } - if (super.cachedPassword != null) { - _call.setPassword(super.cachedPassword); - } - if (super.cachedEndpoint != null) { - _call.setTargetEndpointAddress(super.cachedEndpoint); - } - if (super.cachedTimeout != null) { - _call.setTimeout(super.cachedTimeout); - } - if (super.cachedPortName != null) { - _call.setPortName(super.cachedPortName); - } - java.util.Enumeration keys = super.cachedProperties.keys(); - while (keys.hasMoreElements()) { - java.lang.String key = (java.lang.String) keys.nextElement(); - _call.setProperty(key, super.cachedProperties.get(key)); - } - return _call; - } - catch (java.lang.Throwable _t) { - throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); - } - } - - public java.lang.String getGreetings(java.lang.String in0) throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[0]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://helloworldaxis.samples.tuscany.apache.org", "getGreetings")); - - setRequestHeaders(_call); - setAttachments(_call); - try { - java.lang.Object _resp = _call.invoke(new java.lang.Object[]{in0}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) _resp; - } else { - extractAttachments(_call); - try { - return (java.lang.String) _resp; - } catch (java.lang.Exception _exception) { - return (java.lang.String) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.String.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; - } - } - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/deploy.wsdd b/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/deploy.wsdd deleted file mode 100644 index dd837f016b..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/deploy.wsdd +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/undeploy.wsdd b/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/undeploy.wsdd deleted file mode 100644 index eeecfa17c4..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis/src/main/java/org/apache/tuscany/samples/helloworldaxis/undeploy.wsdd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/build.xml b/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/build.xml deleted file mode 100644 index 2d9badbf87..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/build.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/pom.xml b/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/pom.xml deleted file mode 100644 index cdb6171241..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/pom.xml +++ /dev/null @@ -1,205 +0,0 @@ - - - - - org.apache.tuscany.samples.helloworld - helloworld-samples - SNAPSHOT - - 4.0.0 - helloworldaxis2 - jar - Tuscany sample HelloWorld Axis2 - - Sample classic helloworld Axis2 to test with Tuscany SCA - - SNAPSHOT - - - - - axis2 - axis2-core - 0.94 - - - axis2 - axis2-adb - 0.94 - - - axis2 - axis2-doom - 0.94 - - - geronimo-spec - geronimo-spec-activation - 1.0.2-rc4 - - - geronimo-spec - geronimo-spec-javamail - 1.3.1-rc5 - - - geronimo-spec - geronimo-spec-jms - 1.1-rc4 - - - - axis2 - addressing - 0.94 - mar - - - - commons-logging - commons-logging - 1.0.4 - - - commons-httpclient - commons-httpclient - 3.0 - - - commons-codec - commons-codec - 1.3 - - - log4j - log4j - 1.2.12 - - - woodstox - wstx-asl - 2.8.2 - - - stax - stax-api - 1.0 - - - axis - axis-wsdl4j - 1.2 - - - ws-commons - ws-policy - SNAPSHOT - - - - - xml-apis - xml-apis - 1.3.02 - - - jaxen - jaxen - 1.1-beta-7 - - - backport-util-concurrent - backport-util-concurrent - 2.0_01_pd - - - - - annogen - annogen - 0.1.0 - - - xmlbeans - xbean - 2.1.0 - - - - junit - junit - 3.8.1 - test - - - - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/GetGreetings.java b/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/GetGreetings.java deleted file mode 100644 index a7c332f9e7..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/GetGreetings.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * GetGreetings.java This file was auto-generated from WSDL by the Apache Axis2 - * version: #axisVersion# #today# - */ -package org.apache.tuscany.samples.helloworldaxis; - -/** - * GetGreetings bean class - */ -public class GetGreetings implements org.apache.axis2.databinding.ADBBean { - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://helloworldaxis.samples.tuscany.apache.org", - "getGreetings", "ns1"); - - /** field for In0 */ - private java.lang.String localIn0; - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getIn0() { - return localIn0; - } - - /** - * Auto generated setter method - * - * @param param In0 - */ - public void setIn0(java.lang.String param) { - this.localIn0 = param; - } - - /** - * databinding method to get an XML representation of this object - */ - public javax.xml.stream.XMLStreamReader getPullParser( - javax.xml.namespace.QName qName) { - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - elementList.add(new javax.xml.namespace.QName( - "http://helloworldaxis.samples.tuscany.apache.org", "in0")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString( - localIn0)); - - return org.apache.axis2.databinding.utils.ADBPullParser.createPullParser(qName, - elementList.toArray(), attribList.toArray()); - } - - /** - * static method to create the object Note - This is not complete - */ - public static GetGreetings parse(javax.xml.stream.XMLStreamReader reader) - throws java.lang.Exception { - GetGreetings object = new GetGreetings(); - - try { - int event = reader.getEventType(); - int count = 0; - int argumentCount = 1; - boolean done = false; - - //event better be a START_ELEMENT. if not we should go up to the start element here - while (!reader.isStartElement()) { - event = reader.next(); - } - - while (!done) { - if (javax.xml.stream.XMLStreamConstants.START_ELEMENT == event) { - if ("in0".equals(reader.getLocalName())) { - String content = reader.getElementText(); - object.setIn0(org.apache.axis2.databinding.utils.ConverterUtil.convertTostring( - content)); - count++; - } - } - - if (argumentCount == count) { - done = true; - } - - if (!done) { - event = reader.next(); - } - } - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/GetGreetingsResponse.java b/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/GetGreetingsResponse.java deleted file mode 100644 index 8cee6c1e93..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/GetGreetingsResponse.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * GetGreetingsResponse.java This file was auto-generated from WSDL by the - * Apache Axis2 version: #axisVersion# #today# - */ -package org.apache.tuscany.samples.helloworldaxis; - -/** - * GetGreetingsResponse bean class - */ -public class GetGreetingsResponse - implements org.apache.axis2.databinding.ADBBean { - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://helloworldaxis.samples.tuscany.apache.org", - "getGreetingsResponse", "ns1"); - - /** field for GetGreetingsReturn */ - private java.lang.String localGetGreetingsReturn; - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getGetGreetingsReturn() { - return localGetGreetingsReturn; - } - - /** - * Auto generated setter method - * - * @param param GetGreetingsReturn - */ - public void setGetGreetingsReturn(java.lang.String param) { - this.localGetGreetingsReturn = param; - } - - /** - * databinding method to get an XML representation of this object - */ - public javax.xml.stream.XMLStreamReader getPullParser( - javax.xml.namespace.QName qName) { - java.util.ArrayList elementList = new java.util.ArrayList(); - java.util.ArrayList attribList = new java.util.ArrayList(); - - elementList.add(new javax.xml.namespace.QName( - "http://helloworldaxis.samples.tuscany.apache.org", - "getGreetingsReturn")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString( - localGetGreetingsReturn)); - - return org.apache.axis2.databinding.utils.ADBPullParser.createPullParser(qName, - elementList.toArray(), attribList.toArray()); - } - - /** - * static method to create the object Note - This is not complete - */ - public static GetGreetingsResponse parse( - javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - GetGreetingsResponse object = new GetGreetingsResponse(); - - try { - int event = reader.getEventType(); - int count = 0; - int argumentCount = 1; - boolean done = false; - - //event better be a START_ELEMENT. if not we should go up to the start element here - while (!reader.isStartElement()) { - event = reader.next(); - } - - while (!done) { - if (javax.xml.stream.XMLStreamConstants.START_ELEMENT == event) { - if ("getGreetingsReturn".equals(reader.getLocalName())) { - String content = reader.getElementText(); - object.setGetGreetingsReturn(org.apache.axis2.databinding.utils.ConverterUtil.convertTostring( - content)); - count++; - } - } - - if (argumentCount == count) { - done = true; - } - - if (!done) { - event = reader.next(); - } - } - } catch (javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplCallbackHandler.java b/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplCallbackHandler.java deleted file mode 100644 index ee30587946..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplCallbackHandler.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * HelloWorldServiceImplCallbackHandler.java This file was auto-generated from - * WSDL by the Apache Axis2 version: 0.94-SNAPSHOT Jan 10, 2006 (10:21:58 LKT) - */ -package org.apache.tuscany.samples.helloworldaxis; - -/** - * HelloWorldServiceImplCallbackHandler Callback class - */ -public abstract class HelloWorldServiceImplCallbackHandler { - private Object clientData; - - /** - * User can pass in any object that needs to be accessed once the - * NonBlocking Web service call is finished and appropreate method of - * this CallBack is called. - * - * @param clientData Object mechanism by which the user can pass in user - * data that will be avilable at the time this callback is called. - */ - public HelloWorldServiceImplCallbackHandler(Object clientData) { - this.clientData = clientData; - } - - /** - * auto generated Axis2 call back method for getGreetings method - */ - public void receiveResultgetGreetings( - org.apache.tuscany.samples.helloworldaxis.GetGreetingsResponse param9) { - //Fill here with the code to handle the response - } - - /** - * auto generated Axis2 Error handler - */ - public void receiveErrorgetGreetings(java.lang.Exception e) { - //Fill here with the code to handle the exception - } -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplMessageReceiver.java b/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplMessageReceiver.java deleted file mode 100644 index 90e9af80b2..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplMessageReceiver.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * HelloWorldServiceImplMessageReceiver.java This file was auto-generated from - * WSDL by the Apache Axis2 version: 0.94-SNAPSHOT Jan 10, 2006 (10:21:58 LKT) - */ -package org.apache.tuscany.samples.helloworldaxis; - -/** - * HelloWorldServiceImplMessageReceiver message receiver - */ -public class HelloWorldServiceImplMessageReceiver - extends org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver { - public void invokeBusinessLogic( - org.apache.axis2.context.MessageContext msgContext, - org.apache.axis2.context.MessageContext newMsgContext) - throws org.apache.axis2.AxisFault { - try { - // get the implementation class for the Web Service - Object obj = getTheImplementationObject(msgContext); - - //Inject the Message Context if it is asked for - org.apache.axis2.engine.DependencyManager.configureBusinessLogicProvider(obj, - msgContext, newMsgContext); - - HelloWorldServiceImplSkeleton skel = (HelloWorldServiceImplSkeleton) obj; - - //Out Envelop - org.apache.axis2.soap.SOAPEnvelope envelope = null; - - //Find the axisOperation that has been set by the Dispatch phase. - org.apache.axis2.description.AxisOperation op = msgContext.getOperationContext() - .getAxisOperation(); - - if (op == null) { - throw new org.apache.axis2.AxisFault( - "Operation is not located, if this is doclit style the SOAP-ACTION should specified via the SOAP Action to use the RawXMLProvider"); - } - - String methodName; - - if ((op.getName() != null) & - ((methodName = op.getName().getLocalPart()) != null)) { - if ("getGreetings".equals(methodName)) { - org.apache.tuscany.samples.helloworldaxis.GetGreetingsResponse param5 = - null; - - //doc style - param5 = skel.getGreetings((org.apache.tuscany.samples.helloworldaxis.GetGreetings) fromOM( - msgContext.getEnvelope().getBody() - .getFirstElement(), - org.apache.tuscany.samples.helloworldaxis.GetGreetings.class)); - - envelope = toEnvelope(getSOAPFactory(msgContext), param5); - } - - newMsgContext.setEnvelope(envelope); - } - } catch (Exception e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - } - - // - private org.apache.axis2.om.OMElement toOM( - org.apache.tuscany.samples.helloworldaxis.GetGreetings param) { - if (param instanceof org.apache.axis2.databinding.ADBBean) { - org.apache.axis2.om.impl.llom.builder.StAXOMBuilder builder = new org.apache.axis2.om.impl.llom.builder.StAXOMBuilder(org.apache.axis2.om.OMAbstractFactory.getOMFactory(), - param.getPullParser( - org.apache.tuscany.samples.helloworldaxis.GetGreetings.MY_QNAME)); - org.apache.axis2.om.OMElement documentElement = builder.getDocumentElement(); - ((org.apache.axis2.om.impl.OMNodeEx) documentElement).setParent(null); // remove the parent link - - return documentElement; - } else { - //todo finish this onece the bean serializer has the necessary methods - return null; - } - } - - private org.apache.axis2.soap.SOAPEnvelope toEnvelope( - org.apache.axis2.soap.SOAPFactory factory, - org.apache.tuscany.samples.helloworldaxis.GetGreetings param) { - if (param instanceof org.apache.axis2.databinding.ADBBean) { - org.apache.axis2.databinding.ADBSOAPModelBuilder builder = new org.apache.axis2.databinding.ADBSOAPModelBuilder(param.getPullParser( - org.apache.tuscany.samples.helloworldaxis.GetGreetings.MY_QNAME), - factory); - - return builder.getEnvelope(); - } else { - //todo finish this onece the bean serializer has the necessary methods - return null; - } - } - - private org.apache.axis2.om.OMElement toOM( - org.apache.tuscany.samples.helloworldaxis.GetGreetingsResponse param) { - if (param instanceof org.apache.axis2.databinding.ADBBean) { - org.apache.axis2.om.impl.llom.builder.StAXOMBuilder builder = new org.apache.axis2.om.impl.llom.builder.StAXOMBuilder(org.apache.axis2.om.OMAbstractFactory.getOMFactory(), - param.getPullParser( - org.apache.tuscany.samples.helloworldaxis.GetGreetingsResponse.MY_QNAME)); - org.apache.axis2.om.OMElement documentElement = builder.getDocumentElement(); - ((org.apache.axis2.om.impl.OMNodeEx) documentElement).setParent(null); // remove the parent link - - return documentElement; - } else { - //todo finish this onece the bean serializer has the necessary methods - return null; - } - } - - private org.apache.axis2.soap.SOAPEnvelope toEnvelope( - org.apache.axis2.soap.SOAPFactory factory, - org.apache.tuscany.samples.helloworldaxis.GetGreetingsResponse param) { - if (param instanceof org.apache.axis2.databinding.ADBBean) { - org.apache.axis2.databinding.ADBSOAPModelBuilder builder = new org.apache.axis2.databinding.ADBSOAPModelBuilder(param.getPullParser( - org.apache.tuscany.samples.helloworldaxis.GetGreetingsResponse.MY_QNAME), - factory); - - return builder.getEnvelope(); - } else { - //todo finish this onece the bean serializer has the necessary methods - return null; - } - } - - private java.lang.Object fromOM(org.apache.axis2.om.OMElement param, - java.lang.Class type) { - Object obj; - - try { - java.lang.reflect.Method parseMethod = type.getMethod("parse", - new Class[] { javax.xml.stream.XMLStreamReader.class }); - obj = null; - - if (parseMethod != null) { - obj = parseMethod.invoke(null, - new Object[] { param.getXMLStreamReaderWithoutCaching() }); - } else { - //oops! we don't know how to deal with this. Perhaps the reflective one is a good choice here - } - } catch (Exception e) { - throw new RuntimeException(e); - } - - return obj; - } -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplSkeleton.java b/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplSkeleton.java deleted file mode 100644 index 7796e08873..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplSkeleton.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * HelloWorldServiceImplSkeleton.java This file was auto-generated from WSDL by - * the Apache Axis2 version: 0.94-SNAPSHOT Jan 10, 2006 (10:21:58 LKT) - */ -package org.apache.tuscany.samples.helloworldaxis; - -/** - * HelloWorldServiceImplSkeleton java skeleton for the axisService - */ -public class HelloWorldServiceImplSkeleton -{ - /** - * Auto generated method signature - * - * @param greetings - */ - public org.apache.tuscany.samples.helloworldaxis.GetGreetingsResponse getGreetings( - org.apache.tuscany.samples.helloworldaxis.GetGreetings greetings ) - { - GetGreetingsResponse response = new GetGreetingsResponse(); - response.setGetGreetingsReturn( "Greeting: " + greetings.getIn0() ); - return response; - } -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplStub.java b/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplStub.java deleted file mode 100644 index 440a5aa36f..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplStub.java +++ /dev/null @@ -1,269 +0,0 @@ -/** - * HelloWorldServiceImplStub.java This file was auto-generated from WSDL by the - * Apache Axis2 version: 0.94-SNAPSHOT Jan 10, 2006 (10:21:58 LKT) - */ -package org.apache.tuscany.samples.helloworldaxis; - -/* - * HelloWorldServiceImplStub java implementation - */ -public class HelloWorldServiceImplStub - extends org.apache.axis2.client.Stub -{ - //default axis home being null forces the system to pick up the mars from the axis2 library - public static final String AXIS2_HOME = null; - - protected static org.apache.axis2.description.AxisOperation[] _operations; - - static - { - //creating the Service - _service = new org.apache.axis2.description.AxisService( "HelloWorldServiceImpl" ); - - //creating the operations - org.apache.axis2.description.AxisOperation __operation; - _operations = new org.apache.axis2.description.OutInAxisOperation[1]; - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - __operation.setName( new javax.xml.namespace.QName( "http://helloworldaxis.samples.tuscany.apache.org", - "getGreetings" ) ); - _operations[0] = __operation; - _service.addOperation( __operation ); - } - - public HelloWorldServiceImplStub( org.apache.axis2.context.ConfigurationContext configurationContext, - String targetEndpoint ) - throws java.lang.Exception - { - _serviceClient = new org.apache.axis2.client.ServiceClient( configurationContext, _service ); - _serviceClient.getOptions().setTo( new org.apache.axis2.addressing.EndpointReference( targetEndpoint ) ); - } - - /** - * Default Constructor - */ - public HelloWorldServiceImplStub() - throws java.lang.Exception - { - this( "http://localhost:8080/axis2/services/HelloWorldServiceImplService" ); - } - - /** - * Constructor taking the traget endpoint - */ - public HelloWorldServiceImplStub( String targetEndpoint ) - throws java.lang.Exception - { - this( new org.apache.axis2.context.ConfigurationContextFactory() - .createConfigurationContextFromFileSystem( AXIS2_HOME ), targetEndpoint ); - } - - /** - * Auto generated method signature - * - * @param param10 - * - * @see org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImpl#getGreetings - */ - public org.apache.tuscany.samples.helloworldaxis.GetGreetingsResponse getGreetings( - org.apache.tuscany.samples.helloworldaxis.GetGreetings param10 ) - throws java.rmi.RemoteException - { - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient( _operations[0] - .getName() ); - _operationClient.getOptions().setSoapAction( "" ); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault( true ); - - // create SOAP envelope with that payload - org.apache.axis2.soap.SOAPEnvelope env = null; - - //Style is Doc. - env = toEnvelope( getFactory( _options.getSoapVersionURI() ), param10 ); - - // create message context with that soap envelope - org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); - _messageContext.setEnvelope( env ); - - // add the message contxt to the operation client - _operationClient.addMessageContext( _messageContext ); - - //set the options hierarchy - _options.setParent( _operationClient.getOptions() ); - _operationClient.setOptions( _options ); - - //execute the operation client - _operationClient.execute( true ); - - org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient - .getMessageContext( org.apache.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE ); - org.apache.axis2.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - java.lang.Object object = fromOM( getElement( _returnEnv, "doc" ), - org.apache.tuscany.samples.helloworldaxis.GetGreetingsResponse.class ); - - return (org.apache.tuscany.samples.helloworldaxis.GetGreetingsResponse) object; - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @param param10 - * - * @see org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImpl#startgetGreetings - */ - public void startgetGreetings( - org.apache.tuscany.samples.helloworldaxis.GetGreetings param10, - final org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImplCallbackHandler callback ) - throws java.rmi.RemoteException - { - org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient( _operations[0] - .getName() ); - _operationClient.getOptions().setSoapAction( "" ); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault( true ); - - // create SOAP envelope with that payload - org.apache.axis2.soap.SOAPEnvelope env; - - //Style is Doc. - env = toEnvelope( getFactory( _options.getSoapVersionURI() ), param10 ); - - // create message context with that soap envelope - org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); - _messageContext.setEnvelope( env ); - - // add the message contxt to the operation client - _operationClient.addMessageContext( _messageContext ); - - //set the options hierarchy - _options.setParent( _operationClient.getOptions() ); - _operationClient.setOptions( _options ); - - _operationClient.setCallback( new org.apache.axis2.client.async.Callback() - { - public void onComplete( org.apache.axis2.client.async.AsyncResult result ) - { - java.lang.Object object = fromOM( getElement( result.getResponseEnvelope(), "doc" ), - org.apache.tuscany.samples.helloworldaxis.GetGreetingsResponse.class ); - callback - .receiveResultgetGreetings( (org.apache.tuscany.samples.helloworldaxis.GetGreetingsResponse) object ); - } - - public void onError( java.lang.Exception e ) - { - callback.receiveErrorgetGreetings( e ); - } - } ); - - //execute the operation client - _operationClient.execute( true ); - } - - //http://localhost:8080/axis2/services/HelloWorldServiceImplService - private org.apache.axis2.om.OMElement toOM( org.apache.tuscany.samples.helloworldaxis.GetGreetings param ) - { - if ( param instanceof org.apache.axis2.databinding.ADBBean ) - { - org.apache.axis2.om.impl.llom.builder.StAXOMBuilder builder = new org.apache.axis2.om.impl.llom.builder.StAXOMBuilder( - org.apache.axis2.om.OMAbstractFactory - .getOMFactory(), - param - .getPullParser( org.apache.tuscany.samples.helloworldaxis.GetGreetings.MY_QNAME ) ); - org.apache.axis2.om.OMElement documentElement = builder.getDocumentElement(); - ( (org.apache.axis2.om.impl.OMNodeEx) documentElement ).setParent( null ); // remove the parent link - - return documentElement; - } - else - { - //todo finish this onece the bean serializer has the necessary methods - return null; - } - } - - private org.apache.axis2.soap.SOAPEnvelope toEnvelope( org.apache.axis2.soap.SOAPFactory factory, - org.apache.tuscany.samples.helloworldaxis.GetGreetings param ) - { - if ( param instanceof org.apache.axis2.databinding.ADBBean ) - { - org.apache.axis2.databinding.ADBSOAPModelBuilder builder = new org.apache.axis2.databinding.ADBSOAPModelBuilder( - param - .getPullParser( org.apache.tuscany.samples.helloworldaxis.GetGreetings.MY_QNAME ), - factory ); - - return builder.getEnvelope(); - } - else - { - //todo finish this onece the bean serializer has the necessary methods - return null; - } - } - - private org.apache.axis2.om.OMElement toOM( org.apache.tuscany.samples.helloworldaxis.GetGreetingsResponse param ) - { - if ( param instanceof org.apache.axis2.databinding.ADBBean ) - { - org.apache.axis2.om.impl.llom.builder.StAXOMBuilder builder = new org.apache.axis2.om.impl.llom.builder.StAXOMBuilder( - org.apache.axis2.om.OMAbstractFactory - .getOMFactory(), - param - .getPullParser( org.apache.tuscany.samples.helloworldaxis.GetGreetingsResponse.MY_QNAME ) ); - org.apache.axis2.om.OMElement documentElement = builder.getDocumentElement(); - ( (org.apache.axis2.om.impl.OMNodeEx) documentElement ).setParent( null ); // remove the parent link - - return documentElement; - } - else - { - //todo finish this onece the bean serializer has the necessary methods - return null; - } - } - - private org.apache.axis2.soap.SOAPEnvelope toEnvelope( - org.apache.axis2.soap.SOAPFactory factory, - org.apache.tuscany.samples.helloworldaxis.GetGreetingsResponse param ) - { - if ( param instanceof org.apache.axis2.databinding.ADBBean ) - { - org.apache.axis2.databinding.ADBSOAPModelBuilder builder = new org.apache.axis2.databinding.ADBSOAPModelBuilder( - param - .getPullParser( org.apache.tuscany.samples.helloworldaxis.GetGreetingsResponse.MY_QNAME ), - factory ); - - return builder.getEnvelope(); - } - else - { - //todo finish this onece the bean serializer has the necessary methods - return null; - } - } - - private java.lang.Object fromOM( org.apache.axis2.om.OMElement param, java.lang.Class type ) - { - Object obj; - - try - { - java.lang.reflect.Method parseMethod = type - .getMethod( "parse", new Class[] { javax.xml.stream.XMLStreamReader.class } ); - obj = null; - - if ( parseMethod != null ) - { - obj = parseMethod.invoke( null, new Object[] { param.getXMLStreamReaderWithoutCaching() } ); - } - else - { - //oops! we don't know how to deal with this. Perhaps the reflective one is a good choice here - } - } - catch ( Exception e ) - { - throw new RuntimeException( e ); - } - - return obj; - } -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/resources/helloworld.wsdl b/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/resources/helloworld.wsdl deleted file mode 100644 index 79bd6e45a0..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/resources/helloworld.wsdl +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/resources/services.xml b/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/resources/services.xml deleted file mode 100644 index 18d83e759e..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/main/resources/services.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImplSkeleton - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/test/java/META-INF/MANIFEST.MF b/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/test/java/META-INF/MANIFEST.MF deleted file mode 100644 index 5e9495128c..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/test/java/META-INF/MANIFEST.MF +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -Class-Path: - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/test/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplTest.java b/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/test/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplTest.java deleted file mode 100644 index 149c3d2390..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxis2/src/test/java/org/apache/tuscany/samples/helloworldaxis/HelloWorldServiceImplTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * HelloWorldServiceImplTest.java This file was auto-generated from WSDL by the - * Apache Axis2 version: 0.94-SNAPSHOT Jan 10, 2006 (10:21:58 LKT) - */ -package org.apache.tuscany.samples.helloworldaxis; - - -/* - * HelloWorldServiceImplTest Junit test case -*/ -public class HelloWorldServiceImplTest extends junit.framework.TestCase { - -//FIXME we don't want to run this test as part of the main build, AXIS2 is not necessarily set up to run it - /** - * Auto generated test method - */ - public void testgetGreetings() throws java.lang.Exception { -// org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImplStub stub = -// new org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImplStub("http://localhost:8080/axis2/services/HelloWorldServiceImplService"); //the default implementation should point to the right endpoint -// -// org.apache.tuscany.samples.helloworldaxis.GetGreetings param14 = (org.apache.tuscany.samples.helloworldaxis.GetGreetings) getTestObject(org.apache.tuscany.samples.helloworldaxis.GetGreetings.class); -// param14.setIn0("Hello, World!"); -// -// // todo Fill in the param14 here -// assertNotNull(stub.getGreetings(param14)); - } - - /** - * Auto generated test method - */ - public void testStartgetGreetings() throws java.lang.Exception { -// org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImplStub stub = -// new org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImplStub("http://localhost:8080/axis2/services/HelloWorldServiceImplService"); -// org.apache.tuscany.samples.helloworldaxis.GetGreetings param14 = (org.apache.tuscany.samples.helloworldaxis.GetGreetings) getTestObject(org.apache.tuscany.samples.helloworldaxis.GetGreetings.class); -// param14.setIn0("Hello, World!"); -// -// // todo Fill in the param14 here -// stub.startgetGreetings(param14, new tempCallbackN1000C()); - } - - //Create an ADBBean and provide it as the test object - public org.apache.axis2.databinding.ADBBean getTestObject( - java.lang.Class type) throws Exception { - return (org.apache.axis2.databinding.ADBBean) type.newInstance(); - } - - private class tempCallbackN1000C - extends org.apache.tuscany.samples.helloworldaxis.HelloWorldServiceImplCallbackHandler { - public tempCallbackN1000C() { - super(null); - } - - public void receiveResultgetGreetings( - org.apache.axis2.client.async.AsyncResult result) { - assertNotNull(result.getResponseEnvelope().getBody() - .getFirstElement()); - } - - public void receiveErrorgetGreetings(java.lang.Exception e) { - fail(); - } - } -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/pom.xml b/tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/pom.xml deleted file mode 100644 index 6a1f53146f..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/pom.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - org.apache.tuscany.samples.helloworld - helloworld-samples - SNAPSHOT - - 4.0.0 - helloworldaxissvc - war - Tuscany sample HelloWorld Axis Service - Sample classic helloworld Axis to test with Tuscany SCA - SNAPSHOT - - - - org.apache.tuscany.samples.helloworld - helloworldaxis - ${pom.version} - compile - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/readme.htm b/tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/readme.htm deleted file mode 100644 index dba269fad2..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/readme.htm +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - Tuscany Hello World Axis Service Sample - - -

Tuscany Hello World Axis Service Sample

- -

Overview

- -

The Tuscany hello world Axis service sample uses the code -generated in the hello world Axis sample. This -project just includes a standard J2EE web.xml and uses Maven's war -plugin to build a J2EE war that can be deployed into a web server. - Note that  the configuring of the web application -server for Tuscany makes the Axis services available to all deployed web -applications, so it's not required to add Axis jars specifically to -this web application.

- - -

Setup

Set up your server as described in the Tomcat Setup.  If you are not configuring with the acceptance test the server, you will need to add helloworldws-SNAPSHOT.war to your tomcat's webapp directory.

Review Axis documentation on configuring and deploying web services. -
    - -
- -

Running

- -This service can be invoked by either the Tuscany SCA helloworldwsclient sample or hello -world Axis sample's client  sample. -

Understanding the code

- -Review Axis documentation on developing web services. -
- - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/src/main/webapp/WEB-INF/server-config.wsdd b/tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/src/main/webapp/WEB-INF/server-config.wsdd deleted file mode 100644 index da9ce10bb2..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/src/main/webapp/WEB-INF/server-config.wsdd +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/src/main/webapp/WEB-INF/web.xml b/tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 2a66793fc1..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - Tuscany sample Apache-Axis HelloWorld - - - org.apache.axis.transport.http.AxisHTTPSessionListener - - - - AxisServlet - Apache-Axis Servlet - - org.apache.axis.transport.http.AxisServlet - - - - - AdminServlet - Axis Admin Servlet - - org.apache.axis.transport.http.AdminServlet - - 100 - - - - SOAPMonitorService - SOAPMonitorService - - org.apache.axis.monitor.SOAPMonitorService - - - SOAPMonitorPort - 5001 - - 100 - - - - AxisServlet - /servlet/AxisServlet - - - - AxisServlet - *.jws - - - - AxisServlet - /services/* - - - - SOAPMonitorService - /SOAPMonitor - - - - AdminServlet - /servlet/AdminServlet - - - - - 5 - - - - wsdl - text/xml - - - - xsd - text/xml - - - - HelloWorldWeb.jsp - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/src/webapp/WEB-INF/server-config.wsdd b/tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/src/webapp/WEB-INF/server-config.wsdd deleted file mode 100644 index da9ce10bb2..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/src/webapp/WEB-INF/server-config.wsdd +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/src/webapp/WEB-INF/web.xml b/tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/src/webapp/WEB-INF/web.xml deleted file mode 100644 index 2a66793fc1..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldaxissvc/src/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - Tuscany sample Apache-Axis HelloWorld - - - org.apache.axis.transport.http.AxisHTTPSessionListener - - - - AxisServlet - Apache-Axis Servlet - - org.apache.axis.transport.http.AxisServlet - - - - - AdminServlet - Axis Admin Servlet - - org.apache.axis.transport.http.AdminServlet - - 100 - - - - SOAPMonitorService - SOAPMonitorService - - org.apache.axis.monitor.SOAPMonitorService - - - SOAPMonitorPort - 5001 - - 100 - - - - AxisServlet - /servlet/AxisServlet - - - - AxisServlet - *.jws - - - - AxisServlet - /services/* - - - - SOAPMonitorService - /SOAPMonitor - - - - AdminServlet - /servlet/AdminServlet - - - - - 5 - - - - wsdl - text/xml - - - - xsd - text/xml - - - - HelloWorldWeb.jsp - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldjs/pom.xml b/tags/java-stable-20060304/samples/helloworld/helloworldjs/pom.xml deleted file mode 100644 index 724274c25d..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldjs/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - org.apache.tuscany.samples.helloworld - helloworld-samples - SNAPSHOT - - 4.0.0 - helloworldjs - jar - Tuscany sample HelloWorld - JavaScript - Sample classic helloworld - SNAPSHOT - - - - org.apache.tuscany - tuscany-core - ${pom.version} - compile - - - org.apache.tuscany - tuscany-container-js - ${pom.version} - compile - - - - rhino - js - 1.6R2 - test - - - - junit - junit - 3.8.1 - test - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldjs/readme.htm b/tags/java-stable-20060304/samples/helloworld/helloworldjs/readme.htm deleted file mode 100644 index 0480aea82c..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldjs/readme.htm +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - Tuscany HelloWorld - - - -

Tuscany Hello World Sample - JavaScript

- -

Overview

- -

The Tuscany helloworld sample shows using the Tuscany SCA - runtime in a J2SE environment  loading a JavaScript component that - implements the classic introductory hello world example.

- - -

Setup

The jars for a J2SE setup  not requiring web -services are required including the sample's own jar helloworldjs-SNAPSHOT.jar. - - -
    -
- -

Running

- -Using JDK 1.5 java command with the previous jars run the class org.apache.tuscany.samples.helloworldjs.HelloWorldClient -
- -

Results

- -

The sample when run should simply display to the standard - output:
- - jsHello World

- - -

Code Overview

- -The source files are physically organized as shown below: -
sca.module
org
+-apache
+-tuscany
+-samples
+-helloworldjs
HelloWorldClient.java
HelloWorldService.java
HelloWorldServiceComponentImpl.js
HelloWorldServiceComponentImpl.componentType


- -

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sca.moduleDefines the SCA module and component. Defines for the - HelloWorldServiceComponent component  the Java class that - implements that component
HelloWorldService.javaDefines the Java interface implemented by the component.
HelloWorldServiceComponentImpl.jsJavaScript implementation of the SCA component.
HelloWorldServiceComponentImpl.componentTypeThe SCA componentType side file defining the service interface implemented by the JavaScript component.
HelloWorldClient.javaCreates a Tuscany runtime and starts it. -  Obtains the module context which was defined by the - sca.module file. From the module context locates the - HelloWorldServiceComponent and then calls  the getGreetings - method to invoke the component.
- -
- - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldjs/src/main/java/org/apache/tuscany/samples/helloworldjs/HelloWorldClient.java b/tags/java-stable-20060304/samples/helloworld/helloworldjs/src/main/java/org/apache/tuscany/samples/helloworldjs/HelloWorldClient.java deleted file mode 100644 index b4ea3e6abb..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldjs/src/main/java/org/apache/tuscany/samples/helloworldjs/HelloWorldClient.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldjs; - -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; - -import org.apache.tuscany.core.client.TuscanyRuntime; - -/** - * This client program shows how to create an SCA runtime, start it, locate a simple HelloWorld service component - * and invoke it. - */ -public class HelloWorldClient { - - public static final void main(String[] args) throws Exception { - - // Obtain Tuscany runtime - TuscanyRuntime tuscany = new TuscanyRuntime("hello", null); - - // Start the runtime - tuscany.start(); - - // Obtain SCA module context. - ModuleContext moduleContext = CurrentModuleContext.getContext(); - - // Locate the HelloWorld service component and invoke it - HelloWorldServiceComponent helloworldService = (HelloWorldServiceComponent) moduleContext.locateService("HelloWorldServiceComponent"); - - String value = helloworldService.getGreetings("World"); - - System.out.println(value); - - // Stop the runtime - tuscany.stop(); - } -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldjs/src/main/java/org/apache/tuscany/samples/helloworldjs/HelloWorldServiceComponent.java b/tags/java-stable-20060304/samples/helloworld/helloworldjs/src/main/java/org/apache/tuscany/samples/helloworldjs/HelloWorldServiceComponent.java deleted file mode 100644 index 4de4948561..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldjs/src/main/java/org/apache/tuscany/samples/helloworldjs/HelloWorldServiceComponent.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldjs; - -/** - * This is the business interface of the HelloWorld service component. - */ -public interface HelloWorldServiceComponent { - - public String getGreetings(String name); - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldjs/src/main/resources/org/apache/tuscany/samples/helloworldjs/HelloWorldServiceComponentImpl.componentType b/tags/java-stable-20060304/samples/helloworld/helloworldjs/src/main/resources/org/apache/tuscany/samples/helloworldjs/HelloWorldServiceComponentImpl.componentType deleted file mode 100644 index dab815733e..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldjs/src/main/resources/org/apache/tuscany/samples/helloworldjs/HelloWorldServiceComponentImpl.componentType +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldjs/src/main/resources/org/apache/tuscany/samples/helloworldjs/HelloWorldServiceComponentImpl.js b/tags/java-stable-20060304/samples/helloworld/helloworldjs/src/main/resources/org/apache/tuscany/samples/helloworldjs/HelloWorldServiceComponentImpl.js deleted file mode 100644 index b3104f78a5..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldjs/src/main/resources/org/apache/tuscany/samples/helloworldjs/HelloWorldServiceComponentImpl.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ - -function getGreetings(name) { - return "jsHello " + name; -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldjs/src/main/resources/sca.module b/tags/java-stable-20060304/samples/helloworld/helloworldjs/src/main/resources/sca.module deleted file mode 100644 index 1ec0f7ed94..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldjs/src/main/resources/sca.module +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldjs/src/test/java/org/apache/tuscany/samples/helloworldjs/HelloWorldServiceComponentTestCase.java b/tags/java-stable-20060304/samples/helloworld/helloworldjs/src/test/java/org/apache/tuscany/samples/helloworldjs/HelloWorldServiceComponentTestCase.java deleted file mode 100644 index 6a61e7e13a..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldjs/src/test/java/org/apache/tuscany/samples/helloworldjs/HelloWorldServiceComponentTestCase.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldjs; - -import junit.framework.TestCase; - -import org.apache.tuscany.core.client.TuscanyRuntime; -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; - -/** - * - */ -public class HelloWorldServiceComponentTestCase extends TestCase { - public boolean verbose = true; - - public void testGeetings() throws Exception { - - if (verbose) - System.out.println("starting test.."); - System.out.flush(); - - - TuscanyRuntime tuscany = new TuscanyRuntime("test", null); - tuscany.start(); - ModuleContext moduleContext = CurrentModuleContext.getContext(); - - assertNotNull(moduleContext); - System.out.println("module context name '" - + moduleContext.getName() + "'"); - System.out.println("module context uri '" + moduleContext.getURI() - + "'"); - HelloWorldServiceComponent helloworldService = (HelloWorldServiceComponent) moduleContext - .locateService("HelloWorldServiceComponent"); - - assertNotNull(helloworldService); - - - String value = helloworldService - .getGreetings("World"); - - if (verbose) - System.out.println("Value = '" + value + "'"); - - assertEquals("jsHello World", value); - - tuscany.stop(); - - } - - public final static void main(String[] args) throws Exception { - HelloWorldServiceComponentTestCase hwc = new HelloWorldServiceComponentTestCase(); - hwc.setVerbose(true); - hwc.testGeetings(); - - } - - public boolean isVerbose() { - return verbose; - } - - public void setVerbose(boolean verbose) { - this.verbose = verbose; - } - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldmc/pom.xml b/tags/java-stable-20060304/samples/helloworld/helloworldmc/pom.xml deleted file mode 100644 index 99d58e9a8a..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldmc/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - org.apache.tuscany.samples.helloworld - helloworld-samples - SNAPSHOT - - 4.0.0 - helloworldmc - jar - Tuscany sample multi-component HelloWorld - Sample helloworld with multiple components - SNAPSHOT - - - - org.apache.tuscany - tuscany-core - ${pom.version} - compile - - - org.apache.tuscany - tuscany-container-java - ${pom.version} - compile - - - org.apache.tuscany - tuscany-container-js - ${pom.version} - compile - - - - junit - junit - 3.8.1 - test - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldmc/readme.htm b/tags/java-stable-20060304/samples/helloworld/helloworldmc/readme.htm deleted file mode 100644 index f37ae9dda8..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldmc/readme.htm +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - Tuscany Hello World Multi-Component Sample - - - - -

Tuscany Hello World Multi-Component Sample

- -

Overview

- -

The Tuscany hello world multi-component sample shows using the Tuscany SCA - runtime in a J2SE environment  loading a component that - implements the classic introductory hello world example. This sample - shows the wiring of  multiple components in a single SCA module.

- - -

Setup

The jars for a J2SE setup  not requiring web -services are required including the sample's own jar helloworldmc-SNAPSHOT.jar. - -

Running

-Using JDK 1.5 java command with the previous jars run the class -org.apache.tuscany.samples.helloworldmc.HelloWorldServiceComponentImpl
- -

Results

- -

The sample when run should simply display to the standard - output:
- - Hello SCA World

- - -

Code Overview

- -The source files are physically organized as shown below:
- - - - - - - - - - - - -
-
main
+---java
¦ sca.module
¦
+---org
+---apache
- +---tuscany
+---samples
+---helloworldmc
GreetingPortionProvider.java
- GreetingPortionProviderImpl.java
HelloWorldService.java
- HelloWorldServiceComponentImpl.java

- -
- -
- -

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sca.moduleDefines the SCA module and  the - HelloWorldServiceComponent,  - GreetingPrefixComponent - and GreetingSuffixComponent - components  Wires the HelloWorldServiceComponent - to reference the GreetingPrefixComponent - and GreetingSuffixComponent. -  Customizes the GreetingPrefixComponent - and GreetingSuffixComponent - components with the greetings.     
GreetingPortionProvider.javaDefines the Java interface implemented by the - component. GreetingPrefixComponent - and GreetingSuffixComponent
GreetingPortionProviderImpl.javaImplements the SCA components GreetingPrefixComponent - and GreetingSuffixComponent - . Uses the SCA service - annotation tag on the class to show what SCA interface is being - implemented. Uses the SCA defined Property - Java annotation on the greetingPortion Java - field to customize the component in the sca.module file.
HelloWorldService.javaDefines the Java interface implemented by the - component. HelloWorldServiceComponent
HelloWorldServiceComponentImpl.java 
- -
Implements the HelloWorldServiceComponent - component. Shows two Java fields being used to reference the - and GreetingPrefixComponentGreetingSuffixComponent - components.
- -
- - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/GreetingPortionProvider.java b/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/GreetingPortionProvider.java deleted file mode 100644 index d023b3023b..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/GreetingPortionProvider.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldmc; - -public interface GreetingPortionProvider { - - public String getGreetingPortion(); -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/GreetingPortionProviderImpl.java b/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/GreetingPortionProviderImpl.java deleted file mode 100644 index a881a17dae..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/GreetingPortionProviderImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldmc; - -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Service; - -@Service(GreetingPortionProvider.class) -public class GreetingPortionProviderImpl implements GreetingPortionProvider { - - @Property - public String greetingPortion; - - public String getGreetingPortion() { - return greetingPortion; - } - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldClient.java b/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldClient.java deleted file mode 100644 index 36d7e3eb03..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldClient.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldmc; - -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; - -import org.apache.tuscany.core.client.TuscanyRuntime; - -/** - * This client program shows how to create an SCA runtime, start it, locate a simple HelloWorld service component - * and invoke it. - */ -public class HelloWorldClient { - - public static final void main(String[] args) throws Exception { - - // Obtain Tuscany runtime - TuscanyRuntime tuscany = new TuscanyRuntime("hello", null); - - // Start the runtime - tuscany.start(); - - // Obtain SCA module context. - ModuleContext moduleContext = CurrentModuleContext.getContext(); - - // Locate the HelloWorld service component and invoke it - HelloWorldService helloworldService = (HelloWorldService) moduleContext.locateService("HelloWorldServiceComponent"); - - String value = helloworldService.getGreetings(); - - System.out.println(value); - - // Stop the runtime - tuscany.stop(); - } -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldService.java b/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldService.java deleted file mode 100644 index 3d455aca68..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldService.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldmc; - -/** - * This is the business interface of the HelloWorld service component. - */ -public interface HelloWorldService { - - public String getGreetings(); - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldServiceComponentImpl.java b/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldServiceComponentImpl.java deleted file mode 100644 index 664c6343d3..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/java/org/apache/tuscany/samples/helloworldmc/HelloWorldServiceComponentImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldmc; - -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Service; - -/** - * This class implements the HelloWorld service component. - */ -@Service(HelloWorldService.class) -public class HelloWorldServiceComponentImpl implements HelloWorldService { - - @Property - public String greetingMiddle; - - @Reference - public GreetingPortionProvider greetingPrefix; - - @Reference - public GreetingPortionProvider greetingSuffix; - - /** - * @return - */ - public String getGreetings() { - String middle; - if (greetingMiddle == null) - middle = ""; - else - middle = greetingMiddle; - - return greetingPrefix.getGreetingPortion() + " " + middle + " " + greetingSuffix.getGreetingPortion(); - } - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/resources/sca.module b/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/resources/sca.module deleted file mode 100644 index 13892eff7b..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/main/resources/sca.module +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - GreetingPrefixComponent - GreetingSuffixComponent - - - SCA - - - - - - - Hello - - - - - - - World - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/test/java/org/apache/tuscany/samples/helloworldmc/HelloWorldServiceComponentTestCase.java b/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/test/java/org/apache/tuscany/samples/helloworldmc/HelloWorldServiceComponentTestCase.java deleted file mode 100644 index a53973b9ed..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldmc/src/test/java/org/apache/tuscany/samples/helloworldmc/HelloWorldServiceComponentTestCase.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldmc; - -import junit.framework.TestCase; -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; - -import org.apache.tuscany.core.client.TuscanyRuntime; - -public class HelloWorldServiceComponentTestCase extends TestCase { - public boolean verbose = true; - - public void testGeetings() throws Exception { - - if (verbose) - System.out.println("starting test.."); - System.out.flush(); - - TuscanyRuntime tuscany = new TuscanyRuntime("test", null); - tuscany.start(); - ModuleContext moduleContext = CurrentModuleContext.getContext(); - - assertNotNull(moduleContext); - System.out.println("module context name '" - + moduleContext.getName() + "'"); - System.out.println("module context uri '" + moduleContext.getURI() - + "'"); - HelloWorldService helloworldService = - (HelloWorldService) moduleContext.locateService - ("HelloWorldServiceComponent"); - - assertNotNull(helloworldService); - - String value = helloworldService.getGreetings(); - - if (verbose) - System.out.println("Value = '" + value + "'"); - - assertEquals("Hello SCA World", value); - - tuscany.stop(); - } - - public final static void main(String[] args) throws Exception { - HelloWorldServiceComponentTestCase hwc = - new HelloWorldServiceComponentTestCase(); - hwc.setVerbose(true); - hwc.testGeetings(); - } - - public boolean isVerbose() { - return verbose; - } - - public void setVerbose(boolean verbose) { - this.verbose = verbose; - } - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldweb/pom.xml b/tags/java-stable-20060304/samples/helloworld/helloworldweb/pom.xml deleted file mode 100644 index 7eb7c0ec0f..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldweb/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - org.apache.tuscany.samples.helloworld - helloworld-samples - SNAPSHOT - - 4.0.0 - helloworldWeb - war - Tuscany sample HelloWorld WEB - Sample classic helloworld with JSP - SNAPSHOT - - - - org.apache.tuscany - tuscany-core - ${pom.version} - provided - - - org.apache.tuscany - tuscany-container-java - ${pom.version} - provided - - - - junit - junit - 3.8.1 - test - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldweb/readme.htm b/tags/java-stable-20060304/samples/helloworld/helloworldweb/readme.htm deleted file mode 100644 index 158d379e16..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldweb/readme.htm +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - Tuscany Hello World Web Sample - - - -

Tuscany Hello World Web Sample

- -

Overview

- -

The Tuscany hello world web sample shows using the Tuscany SCA - runtime in a Tomcat environment being accessed from a JSP - page that - implements the classic introductory hello world example.

- - -

Setup

Set up your server as described in the Tomcat - Setup.  If you are not configuring with the acceptance test the server, you will need to add helloworldWeb-SNAPSHOT.war to your tomcat's webapp directory.
- -

Running

- -Once you've started your web server, use your browse to view the -following URL: http://localhost:8080/helloworldWeb-SNAPSHOT/ -
- -You should see a form you can supply your name and a submit button. - Once you submit the form the JSP page calls a Java class that -gets the CurrentModuleContext and locates the SCA component to execute -the greeting service.  Note, unlike the a J2SE in a Tomcat environment the Tuscany runtime is automatically -initialized and running. -

Results

- -

The page should be updated with the greeting displayed below - the form.
- -

- -

Code Overview

- -The source files are physically organized as shown below:
- - - - - - -
-
+---main
¦ +---java
¦ ¦ sca.module
¦ ¦ -
¦ +---org
¦ +---apache
¦ +---tuscany -
¦ +---samples
¦ +---helloworldweb -
¦ HelloWorldService.java
¦ - HelloWorldServiceComponentImpl.java
¦
+---webapp
¦ HelloWorldWeb.jsp -
¦
+---WEB-INF
web.xml
-
-
-
- -

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sca.moduleDefines the SCA module and component. Defines for the - HelloWorldServiceComponent component and the Java class that - implements that component
HelloWorldService.javaDefines the Java interface implemented by the component.
HelloWorldServiceComponentImpl.javaImplements the SCA component. Uses the SCA service - annotation tag on the class to show what SCA interface is being - implemented.
HelloWorldWeb.jspHandles Web form input.. Obtains the module context which was defined by the - sca.module file. From the module context locates the - HelloWorldServiceComponent and then calls  the getGreetings - method to invoke the component. and formats  returned results.
web.xmlStandard J2EE web application's web.xml
- -
- - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldweb/src/main/java/org/apache/tuscany/samples/helloworldweb/HelloWorldServiceComponent.java b/tags/java-stable-20060304/samples/helloworld/helloworldweb/src/main/java/org/apache/tuscany/samples/helloworldweb/HelloWorldServiceComponent.java deleted file mode 100644 index 4775291e27..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldweb/src/main/java/org/apache/tuscany/samples/helloworldweb/HelloWorldServiceComponent.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldweb; - -/** - * This is the business interface of the HelloWorld service component. - */ -public interface HelloWorldServiceComponent { - - public String getGreetings(String name); - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldweb/src/main/java/org/apache/tuscany/samples/helloworldweb/HelloWorldServiceComponentImpl.java b/tags/java-stable-20060304/samples/helloworld/helloworldweb/src/main/java/org/apache/tuscany/samples/helloworldweb/HelloWorldServiceComponentImpl.java deleted file mode 100644 index 1441f9ff36..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldweb/src/main/java/org/apache/tuscany/samples/helloworldweb/HelloWorldServiceComponentImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldweb; - -import org.osoa.sca.annotations.Service; - -/** - * This class implements the HelloWorld service component. - */ -@Service(HelloWorldServiceComponent.class) -public class HelloWorldServiceComponentImpl implements HelloWorldServiceComponent { - - /* - * @see org.apache.tuscany.samples.helloworld.HelloWorldServiceComponent#getGreetings() - */ - public String getGreetings(String name) { - return "Hello " + name; - } - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldweb/src/main/resources/sca.module b/tags/java-stable-20060304/samples/helloworld/helloworldweb/src/main/resources/sca.module deleted file mode 100644 index aa045e4a80..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldweb/src/main/resources/sca.module +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldweb/src/main/webapp/HelloWorldWeb.jsp b/tags/java-stable-20060304/samples/helloworld/helloworldweb/src/main/webapp/HelloWorldWeb.jsp deleted file mode 100644 index 9a54d0cbf9..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldweb/src/main/webapp/HelloWorldWeb.jsp +++ /dev/null @@ -1,79 +0,0 @@ - -<%-- - * Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - --%> - - - - <%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1" session="true" autoFlush="true" - isThreadSafe="true" isErrorPage="false" - import="org.apache.tuscany.samples.helloworldweb.HelloWorldServiceComponent" - import="java.io.PrintWriter" - import="java.io.StringWriter" - import="org.osoa.sca.CurrentModuleContext" - import="org.osoa.sca.ModuleContext" - %> - - - Tuscany HelloWorld WEB Example - <% - String name = request.getParameter("name"); - %> - - - -

Tuscany HelloWorld WEB Example

- -

 

- -
Name - please:    ">
-
-
-
- -<% - try { - if (null != name) { - ModuleContext moduleContext = CurrentModuleContext.getContext(); - HelloWorldServiceComponent helloworldService = (HelloWorldServiceComponent) moduleContext.locateService("HelloWorldServiceComponent"); - String value = helloworldService.getGreetings(name); -%> -
- -

<%=value%> - <%} -}catch(Exception e){ - e.printStackTrace(); - StringWriter sw= new StringWriter(); - PrintWriter pw= new PrintWriter(sw); - - e.printStackTrace(pw); - pw.flush(); - -%> - Whoops!
-

-    Exception "<%=e.getClass().getName()%>" Exception message: "<%=e.getMessage()%>"
- <%=sw.toString() %> -
-<% - - }%> - - \ No newline at end of file diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldweb/src/main/webapp/WEB-INF/web.xml b/tags/java-stable-20060304/samples/helloworld/helloworldweb/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 9765b182dc..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldweb/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - Tuscany sample HelloWorld WEB - - - HelloWorldWeb.jsp - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldweb/src/test/java/org/apache/tuscany/samples/helloworldweb/HelloWorldServiceComponentTestCase.java b/tags/java-stable-20060304/samples/helloworld/helloworldweb/src/test/java/org/apache/tuscany/samples/helloworldweb/HelloWorldServiceComponentTestCase.java deleted file mode 100644 index 72c7cedb49..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldweb/src/test/java/org/apache/tuscany/samples/helloworldweb/HelloWorldServiceComponentTestCase.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldweb; - -import junit.framework.TestCase; - -import org.apache.tuscany.core.client.TuscanyRuntime; -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; - -/** - * - */ -public class HelloWorldServiceComponentTestCase extends TestCase { - public boolean verbose = false; - - public void testGeetings() throws Exception { - // todo should use SCA ;-) - final boolean viaSCA = false; - TuscanyRuntime tuscany; - ModuleContext moduleContext = null; - if (verbose) - System.out.println("starting test.."); - System.out.flush(); - HelloWorldServiceComponent helloworldService = null; - - if (viaSCA) { - tuscany = new TuscanyRuntime("test", null); - tuscany.start(); - moduleContext = CurrentModuleContext.getContext(); - - assertNotNull(moduleContext); - System.out.println("module context name '" - + moduleContext.getName() + "'"); - System.out.println("module context uri '" + moduleContext.getURI() - + "'"); - helloworldService = (HelloWorldServiceComponent) moduleContext - .locateService("HelloWorldServiceComponent"); - - assertNotNull(helloworldService); - } else - helloworldService = new HelloWorldServiceComponentImpl(); - - String value = helloworldService - .getGreetings("World"); - - if (verbose) - System.out.println("Value = '" + value + "'"); - assertEquals("Hello World", value); - if (viaSCA) - tuscany.stop(); - - } - - public final static void main(String[] args) throws Exception { - HelloWorldServiceComponentTestCase hwc = new HelloWorldServiceComponentTestCase(); - hwc.setVerbose(true); - hwc.testGeetings(); - - } - - public boolean isVerbose() { - return verbose; - } - - public void setVerbose(boolean verbose) { - this.verbose = verbose; - } - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldws/pom.xml b/tags/java-stable-20060304/samples/helloworld/helloworldws/pom.xml deleted file mode 100644 index bd63c96676..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldws/pom.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - org.apache.tuscany.samples.helloworld - helloworld-samples - SNAPSHOT - - 4.0.0 - helloworldws - war - Tuscany sample HelloWorld WS Service - Sample classic helloworld SCA Service - SNAPSHOT - - - - - - - - - SCA API - - org.osoa - sca-api - ${pom.version} - provided - - - - org.apache.tuscany - tuscany-core - ${pom.version} - provided - - - org.apache.tuscany - tuscany-container-java - ${pom.version} - provided - - - org.apache.tuscany - tuscany-binding-axis2 - ${pom.version} - provided - - - org.apache.tuscany - tuscany-tomcat - ${pom.version} - provided - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldws/readme.htm b/tags/java-stable-20060304/samples/helloworld/helloworldws/readme.htm deleted file mode 100644 index 2fce89cf02..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldws/readme.htm +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - - - - Tuscany Hello World Web Sample - - - - -

Tuscany Hello World WS Sample

- - -

Overview

- - -

The Tuscany hello world ws sample shows using the Tuscany SCA - runtime in a Tomcat environment providing a web service..

- - -

Setup

- - -Set up your server as described in the Tomcat Setup.  If -you are not configuring with the acceptance test the server, you will need to add helloworldws-SNAPSHOT.war -to your Tomcat's webapp directory. - - -

Running

- -This service can be invoked by either the Tuscany SCA helloworldwsclient -sample or hello - world Axis sample's client  sample.
- -

Code Overview

- - -The source files are physically organized as shown below:
- - - - - - - - - - - - - -
+---main
- ¦   +---java
- ¦   ¦   ¦   sca.module
- ¦   ¦   ¦
- ¦   ¦   +---org
- ¦   ¦       +---apache
- ¦   ¦           +---tuscany -
- ¦   ¦               - +---samples
- ¦   - ¦                   - +---helloworldws
- ¦   - ¦                           - HelloWorldService.java
- ¦   - ¦                           - HelloWorldServiceComponentImpl.java
- ¦   ¦
- ¦   +---resources
- ¦       ¦   tuscany-model.config
- ¦       ¦
- ¦       +---wsdl
- ¦               - helloworld.wsdl
- ¦
- ¦
- +---webapp
-     +---WEB-INF
-             web.xml
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sca.moduleDefines the SCA module, entryPoint - and component. Defines for the - HelloWorldServiceComponent component and the Java class that - implements the component For the entryPoint it defines WSDL for the - service, the Java interface provided by the service, and wires the - service to the HelloWorldServiceComponent
HelloWorldService.javaDefines the Java interface implemented by the component.
HelloWorldServiceComponentImpl.javaImplements the SCA component. Uses the SCA service - annotation tag on the class to show what SCA interface is being - implemented.  Also uses the SCA Java annotation "Remotable" to - indicate that a component implemented by this class can be - referenced out side of the SCA module it resides in.
tuscany-model.configMaps the SCA Entry point WSDL to the physical WSDL file location.
helloworld.wsdlWSDL for the service.
web.xmlStandard J2EE web application's web.xml
- - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/java/org/apache/tuscany/samples/helloworldws/HelloWorldService.java b/tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/java/org/apache/tuscany/samples/helloworldws/HelloWorldService.java deleted file mode 100644 index 535e7ae5dc..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/java/org/apache/tuscany/samples/helloworldws/HelloWorldService.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldws; - -/** - * This is the business interface of the HelloWorld service component. - */ -public interface HelloWorldService { - - public String getGreetings(String name); - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/java/org/apache/tuscany/samples/helloworldws/HelloWorldServiceComponentImpl.java b/tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/java/org/apache/tuscany/samples/helloworldws/HelloWorldServiceComponentImpl.java deleted file mode 100644 index cbbdce7619..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/java/org/apache/tuscany/samples/helloworldws/HelloWorldServiceComponentImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldws; - -import org.osoa.sca.annotations.Service; - -/** - * This class implements the HelloWorld service component. - */ -@Service(HelloWorldService.class) -public class HelloWorldServiceComponentImpl implements HelloWorldService { - - /* - * @see org.apache.tuscany.samples.helloworld.HelloWorldServiceComponent#getGreetings() - */ - public String getGreetings(String name) { - return "Hello " + name; - } - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/resources/sca.module b/tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/resources/sca.module deleted file mode 100644 index 95b0126553..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/resources/sca.module +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - HelloWorldServiceComponent/HelloWorldService - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/resources/wsdl/helloworld.wsdl b/tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/resources/wsdl/helloworld.wsdl deleted file mode 100644 index b1189031e7..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/resources/wsdl/helloworld.wsdl +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/webapp/WEB-INF/axis2.xml b/tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/webapp/WEB-INF/axis2.xml deleted file mode 100644 index d42457fdf6..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/webapp/WEB-INF/axis2.xml +++ /dev/null @@ -1,167 +0,0 @@ - - - - - false - false - false - - - - - admin - axis2 - - . - - 127.0.0.1 - 5555 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6060 - - - - - - - - - - - - - - - - - HTTP/1.1 - chunked - - - HTTP/1.1 - chunked - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/webapp/WEB-INF/web.xml b/tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index e537b650e4..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldws/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - Tuscany sample HelloWorld WS - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/pom.xml b/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/pom.xml deleted file mode 100644 index 4953fa5b02..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - org.apache.tuscany.samples.helloworld - helloworld-samples - SNAPSHOT - - 4.0.0 - helloworldwsclient - jar - Tuscany sample HelloWorld Webservice SCA Client - Sample classic helloworldws client - SNAPSHOT - - - - org.apache.tuscany - tuscany-core - ${pom.version} - compile - - - org.apache.tuscany - tuscany-container-java - ${pom.version} - compile - - - org.apache.tuscany - tuscany-binding-axis2 - ${pom.version} - compile - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/readme.htm b/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/readme.htm deleted file mode 100644 index 03e1323cee..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/readme.htm +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - - - Tuscany Hello World Web Sample - - - -

Tuscany Hello World WS Client Sample

- -

Overview

- -

The Tuscany hello world WS client sample shows using the Tuscany SCA - runtime in a J2SE environment invoking a web service.

- -

Setup

- -The jars for a J2SE setup  including those necessary  -for web services are required including the sample's own jar helloworldwsclient-SNAPSHOT.jar. - -

Running

-Using JDK 1.5 java command with the previous mentioned jars run the -class org.apache.tuscany.samples.helloworldwsclient.HelloWorldClient - -

Results

- -

The sample when run should simply display to the standard - output:
- - Hello World

- -

Code Overview

- -The source files are physically organized as shown below:
- - - - - - - - - - - - -
main
- - +---java
- - ¦   ¦   - sca.module
- - ¦   ¦
- - ¦   +---org
- - ¦       - +---apache
- - ¦           - +---tuscany
- - ¦               - +---samples
- - ¦                   - +---helloworldwsclient
- ¦                           - HelloWorldClient.java
- ¦                           - HelloWorldService.java
- ¦                           - HelloWorldServiceComponentImpl.java
- - ¦
- - +---resources
- -     ¦   - tuscany-model.config
- -     ¦
- -     +---wsdl
- -             - helloworld.wsdl
- -
- -
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sca.moduleDefines the SCA module, - externalService - and component. Defines for the - HelloWorldServiceComponent component and the Java class that - implements the component For the externalService it defines WSDL for - the - service, the Java interface provided by the service. - The the HelloWorldServiceComponent is via a - referenced wired to the externalService
HelloWorldClient.javaCreates a Tuscany runtime and starts it. -  Obtains the module context which was defined by the - sca.module file. From the module context locates the - HelloWorldServiceComponent and then calls  the getGreetings - method to invoke the component.
HelloWorldService.javaDefines the Java interface - implemented by the component.
HelloWorldServiceComponentImpl.javaIt does not directly implement the service; instead it - has an SCA reference that is wired in the sca.module to an - externalService that will provide the service. The service providing the implementation is the helloworldws sample.
- -
tuscany-model.configMaps the SCA Entry point WSDL to the physical WSDL file - location.
helloworld.wsdlWSDL for the service.
- - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldClient.java b/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldClient.java deleted file mode 100644 index beece1cae4..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldClient.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldwsclient; - -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; - -import org.apache.tuscany.core.client.TuscanyRuntime; - -/** - * This client program shows how to create an SCA runtime, start it, locate a simple HelloWorld service component - * and invoke it. - */ -public class HelloWorldClient { - - public static final void main(String[] args) throws Exception { - - // Obtain Tuscany runtime - TuscanyRuntime tuscany = new TuscanyRuntime("hello", null); - - // Start the runtime - tuscany.start(); - - // Obtain SCA module context. - ModuleContext moduleContext = CurrentModuleContext.getContext(); - - // Locate the HelloWorld service component and invoke it - HelloWorldService helloworldService = (HelloWorldService) moduleContext.locateService("HelloWorldServiceComponent"); - - String value = helloworldService.getGreetings("World"); - - System.out.println(value); - - // Stop the runtime - tuscany.stop(); - } -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldService.java b/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldService.java deleted file mode 100644 index 00e0af3a9d..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldService.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldwsclient; - -/** - * This is the business interface of the HelloWorld service component. - */ -public interface HelloWorldService { - - public String getGreetings(String name); - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldServiceComponentImpl.java b/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldServiceComponentImpl.java deleted file mode 100644 index 62702b50bb..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldServiceComponentImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldwsclient; - -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; -import org.osoa.sca.annotations.Reference; - -/** - * This class implements the HelloWorld service component. - */ -@Service(HelloWorldService.class) -//FIXME workaround for JIRA TUSCANY-41 -@Scope("MODULE") -public class HelloWorldServiceComponentImpl implements HelloWorldService { - - @Reference - public HelloWorldService hellowWorldService = null; // Injected by the SCA container. - - /** - * @see org.apache.tuscany.samples.helloworldwsclient.HelloWorldService#getGreetings(java.lang.String) - */ - public String getGreetings(final String name) { - assert null != hellowWorldService : "helloWorldService was not set by the SCA runtime!"; - - return hellowWorldService.getGreetings(name); - } - -} diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/axis2.xml b/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/axis2.xml deleted file mode 100644 index a38cf9864a..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/axis2.xml +++ /dev/null @@ -1,167 +0,0 @@ - - - - - false - false - false - - - - - admin - axis2 - - . - - 127.0.0.1 - 5555 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6060 - - - - - - - - - - - - - - - - - HTTP/1.1 - chunked - - - HTTP/1.1 - chunked - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/sca.module b/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/sca.module deleted file mode 100644 index 9642b2157d..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/sca.module +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - HelloWorldService - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/wsdl/helloworld.wsdl b/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/wsdl/helloworld.wsdl deleted file mode 100644 index 75b732e3a5..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/wsdl/helloworld.wsdl +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/samples/helloworld/pom.xml b/tags/java-stable-20060304/samples/helloworld/pom.xml deleted file mode 100644 index f9cefafaca..0000000000 --- a/tags/java-stable-20060304/samples/helloworld/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - org.apache.tuscany.samples - tuscany-samples - SNAPSHOT - - 4.0.0 - org.apache.tuscany.samples.helloworld - helloworld-samples - pom - Tuscany HelloWorld Samples - SNAPSHOT - - - helloworld - - helloworldjs - helloworldmc - helloworldweb - helloworldws - helloworldwsclient - - diff --git a/tags/java-stable-20060304/samples/pom.xml b/tags/java-stable-20060304/samples/pom.xml deleted file mode 100644 index e77e18d1ab..0000000000 --- a/tags/java-stable-20060304/samples/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - org.apache.tuscany - tuscany-project - SNAPSHOT - - 4.0.0 - org.apache.tuscany.samples - tuscany-samples - pom - Tuscany Samples - SNAPSHOT - - - helloworld - bigbank - das - - diff --git a/tags/java-stable-20060304/sca/binding.axis/LICENSE.txt b/tags/java-stable-20060304/sca/binding.axis/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/LICENSE.txt +++ /dev/null @@ -1,202 +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/tags/java-stable-20060304/sca/binding.axis/pom.xml b/tags/java-stable-20060304/sca/binding.axis/pom.xml deleted file mode 100644 index 64e3dcb19c..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/pom.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - org.apache.tuscany - tuscany-sca - SNAPSHOT - - 4.0.0 - tuscany-binding-axis - Tuscany Axis Binding - Implementation of the SCA Web Services binding using Axis. - SNAPSHOT - - - - org.apache.tuscany - tuscany-core - ${pom.version} - compile - - - - axis - axis - 1.2.1 - compile - - - axis - axis-jaxrpc - 1.2.1 - compile - - - axis - axis-saaj - 1.2.1 - compile - - - - tomcat - servlet-api - 5.0.18 - provided - - - - junit - junit - 3.8.1 - test - - - diff --git a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/assembly/WebServiceAssemblyFactory.java b/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/assembly/WebServiceAssemblyFactory.java deleted file mode 100644 index 5d8f286944..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/assembly/WebServiceAssemblyFactory.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.assembly; - -import org.apache.tuscany.model.assembly.AssemblyFactory; - -/** - * The Factory for the model. - */ -public interface WebServiceAssemblyFactory extends AssemblyFactory { - - /** - * Returns a new WebServiceBinding. - */ - WebServiceBinding createWebServiceBinding(); - -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/assembly/WebServiceBinding.java b/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/assembly/WebServiceBinding.java deleted file mode 100644 index 3c223ffa8e..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/assembly/WebServiceBinding.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.assembly; - -import javax.wsdl.Definition; -import javax.wsdl.Port; - -import org.apache.tuscany.model.assembly.Binding; - -/** - * Represents a Web service binding. - */ -public interface WebServiceBinding extends Binding { - - /** - * Returns the WSDL port defining this binding. - */ - Port getWSDLPort(); - - /** - * Returns the WSDL definition containing the WSDL port. - * @return - */ - Definition getWSDLDefinition(); - - /** - * Sets the WSDL port defining this binding. - */ - void setWSDLPort(Port value); - - /** - * Sets the WSDL definition containing the WSDL port. - * @param definition - */ - void setWSDLDefinition(Definition definition); - -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/assembly/impl/WebServiceAssemblyFactoryImpl.java b/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/assembly/impl/WebServiceAssemblyFactoryImpl.java deleted file mode 100644 index 4a3154f2c1..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/assembly/impl/WebServiceAssemblyFactoryImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.assembly.impl; - -import org.apache.tuscany.binding.axis.assembly.WebServiceAssemblyFactory; -import org.apache.tuscany.binding.axis.assembly.WebServiceBinding; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; - -/** - * An implementation of the model Factory. - */ -public class WebServiceAssemblyFactoryImpl extends AssemblyFactoryImpl implements WebServiceAssemblyFactory { - - /** - * Creates an instance of the factory. - */ - public WebServiceAssemblyFactoryImpl() { - super(); - } - - /** - * @see org.apache.tuscany.binding.axis.assembly.WebServiceAssemblyFactory#createWebServiceBinding() - */ - public WebServiceBinding createWebServiceBinding() { - return new WebServiceBindingImpl(); - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/assembly/impl/WebServiceBindingImpl.java b/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/assembly/impl/WebServiceBindingImpl.java deleted file mode 100644 index 37ed0191e6..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/assembly/impl/WebServiceBindingImpl.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.assembly.impl; - -import java.util.Collection; -import java.util.List; - -import javax.wsdl.Definition; -import javax.wsdl.Port; -import javax.wsdl.Service; - -import org.apache.tuscany.binding.axis.assembly.WebServiceBinding; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.impl.BindingImpl; - -/** - * An implementation of WebServiceBinding. - */ -public class WebServiceBindingImpl extends BindingImpl implements WebServiceBinding { - - private Definition definition; - private Port port; - private String portURI; - - /** - * Constructor - */ - protected WebServiceBindingImpl() { - } - - /** - * @see org.apache.tuscany.binding.axis.assembly.WebServiceBinding#getWSDLPort() - */ - public Port getWSDLPort() { - return port; - } - - /** - * @see org.apache.tuscany.binding.axis.assembly.WebServiceBinding#setWSDLPort(javax.wsdl.Port) - */ - public void setWSDLPort(Port value) { - checkNotFrozen(); - this.port=value; - } - - /** - * @see org.apache.tuscany.binding.axis.assembly.WebServiceBinding#getWSDLDefinition() - */ - public Definition getWSDLDefinition() { - return definition; - } - - /** - * @see org.apache.tuscany.binding.axis.assembly.WebServiceBinding#setWSDLDefinition(javax.wsdl.Definition) - */ - public void setWSDLDefinition(Definition definition) { - checkNotFrozen(); - this.definition=definition; - } - - /** - * @param portURI The portURI to set. - */ - public void setPortURI(String portURI) { - this.portURI = portURI; - } - - /** - * @see org.apache.tuscany.model.assembly.impl.BindingImpl#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) - */ - public void initialize(AssemblyModelContext modelContext) { - if (isInitialized()) - return; - super.initialize(modelContext); - - // Get the WSDL port namespace and name - if (port==null && portURI!=null) { - int h=portURI.indexOf('#'); - String portNamespace=portURI.substring(0,h); - String portName=portURI.substring(h+1); - - // Load the WSDL definitions for the given namespace - List definitions=modelContext.getAssemblyLoader().loadDefinitions(portNamespace); - if (definitions==null) - throw new IllegalArgumentException("Cannot find WSDL definition for "+portNamespace); - for (Definition definition: definitions) { - - // Find the port with the given name - for (Service service : (Collection)definition.getServices().values()) { - Port port=service.getPort(portName); - if (port!=null) { - this.definition=definition; - this.port=port; - return; - } - } - } - throw new IllegalArgumentException("Cannot find WSDL port "+portURI); - } - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/ExternalWebServiceConfigurationBuilder.java b/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/ExternalWebServiceConfigurationBuilder.java deleted file mode 100644 index c9c87e1e11..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/ExternalWebServiceConfigurationBuilder.java +++ /dev/null @@ -1,150 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.builder; - -import java.lang.reflect.Method; -import java.util.Collection; -import java.util.Map; -import java.util.Set; - -import org.apache.tuscany.binding.axis.assembly.WebServiceBinding; -import org.apache.tuscany.binding.axis.config.ExternalWebServiceRuntimeConfiguration; -import org.apache.tuscany.binding.axis.handler.ExternalWebServiceClient; -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.config.JavaIntrospectionHelper; -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.injection.SingletonObjectFactory; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.MethodHashMap; -import org.apache.tuscany.core.invocation.ProxyConfiguration; -import org.apache.tuscany.core.invocation.impl.InvokerInterceptor; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.invocation.spi.ProxyFactoryFactory; -import org.apache.tuscany.core.message.MessageFactory; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.ExternalService; -import org.apache.tuscany.model.assembly.Service; -import org.apache.tuscany.model.assembly.ServiceContract; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -/** - * Creates a RuntimeConfigurationBuilder for an external service configured with the {@link WebServiceBinding} - * - * @version $Rev$ $Date$ - */ -@Scope("MODULE") -public class ExternalWebServiceConfigurationBuilder implements RuntimeConfigurationBuilder { - - private RuntimeContext runtimeContext; - - private ProxyFactoryFactory proxyFactoryFactory; - - private MessageFactory messageFactory; - - private RuntimeConfigurationBuilder policyBuilder; - - public ExternalWebServiceConfigurationBuilder() { - } - - @Init(eager = true) - public void init() { - runtimeContext.addBuilder(this); - } - - /** - * @param runtimeContext The runtimeContext to set. - */ - @Autowire - public void setRuntimeContext(RuntimeContext runtimeContext) { - this.runtimeContext = runtimeContext; - } - - /** - * Sets the factory used to construct proxies implmementing the business interface required by a reference - */ - @Autowire - public void setProxyFactoryFactory(ProxyFactoryFactory factory) { - this.proxyFactoryFactory = factory; - } - - /** - * Sets the factory used to construct invocation messages - * - * @param msgFactory - */ - @Autowire - public void setMessageFactory(MessageFactory msgFactory) { - this.messageFactory = msgFactory; - } - - /** - * Sets a builder responsible for creating source-side and target-side invocation chains for a reference. The - * reference builder may be hierarchical, containing other child reference builders that operate on specific - * metadata used to construct and invocation chain. - * - * @see org.apache.tuscany.core.builder.impl.HierarchicalBuilder - */ - public void setPolicyBuilder(RuntimeConfigurationBuilder builder) { - policyBuilder = builder; - } - - public void build(AssemblyModelObject object, Context context) throws BuilderException { - if (!(object instanceof ExternalService)) { - return; - } - ExternalService externalService = (ExternalService) object; - if (externalService.getBindings().size() < 1 || !(externalService.getBindings().get(0) instanceof WebServiceBinding)) { - return; - } - - WebServiceBinding wsBinding=(WebServiceBinding)externalService.getBindings().get(0); - - ExternalWebServiceClient externalWebServiceClient=new ExternalWebServiceClient(externalService, wsBinding); - ExternalWebServiceRuntimeConfiguration config = new ExternalWebServiceRuntimeConfiguration(externalService.getName(), new SingletonObjectFactory(externalWebServiceClient)); - - ConfiguredService configuredService = externalService.getConfiguredService(); - Service service = configuredService.getService(); - ServiceContract serviceContract = service.getServiceContract(); - Map iConfigMap = new MethodHashMap(); - ProxyFactory proxyFactory = proxyFactoryFactory.createProxyFactory(); - Set javaMethods = JavaIntrospectionHelper.getAllUniqueMethods(serviceContract.getInterface()); - for (Method method : javaMethods) { - InvocationConfiguration iConfig = new InvocationConfiguration(method); - iConfigMap.put(method, iConfig); - } - QualifiedName qName = new QualifiedName(externalService.getName() + QualifiedName.NAME_SEPARATOR + service.getName()); - ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, serviceContract.getInterface().getClassLoader(), messageFactory); - proxyFactory.setBusinessInterface(serviceContract.getInterface()); - proxyFactory.setProxyConfiguration(pConfiguration); - config.addTargetProxyFactory(service.getName(), proxyFactory); - configuredService.setProxyFactory(proxyFactory); - if (policyBuilder != null) { - // invoke the reference builder to handle additional policy metadata - policyBuilder.build(configuredService, context); - } - // add tail interceptor - for (InvocationConfiguration iConfig : (Collection) iConfigMap.values()) { - iConfig.addTargetInterceptor(new InvokerInterceptor()); - } - - externalService.getConfiguredService().setRuntimeConfiguration(config); - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/ExternalWebServiceWireBuilder.java b/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/ExternalWebServiceWireBuilder.java deleted file mode 100644 index e006b0e4ff..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/ExternalWebServiceWireBuilder.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.apache.tuscany.binding.axis.builder; - -import org.apache.tuscany.binding.axis.config.ExternalWebServiceRuntimeConfiguration; -import org.apache.tuscany.binding.axis.handler.ExternalWebServiceTargetInvoker; -import org.apache.tuscany.core.builder.BuilderConfigException; -import org.apache.tuscany.core.builder.WireBuilder; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -@Scope("MODULE") -public class ExternalWebServiceWireBuilder implements WireBuilder { - - private RuntimeContext runtimeContext; - - /** - * Constructs a new ExternalWebServiceWireBuilder. - */ - public ExternalWebServiceWireBuilder() { - super(); - } - - @Autowire - public void setRuntimeContext(RuntimeContext context) { - runtimeContext = context; - } - - @Init(eager=true) - public void init() { - runtimeContext.addBuilder(this); - } - - public void connect(ProxyFactory sourceFactory, ProxyFactory targetFactory, Class targetType, boolean downScope, ScopeContext targetScopeContext) throws BuilderConfigException { - if (!(ExternalWebServiceRuntimeConfiguration.class.isAssignableFrom(targetType))) { - return; - } - for (InvocationConfiguration sourceInvocationConfig : sourceFactory.getProxyConfiguration().getInvocationConfigurations().values()) { - - ExternalWebServiceTargetInvoker invoker = new ExternalWebServiceTargetInvoker(sourceFactory.getProxyConfiguration().getTargetName(), sourceInvocationConfig.getMethod(), targetScopeContext); - - // if (downScope) { - // // the source scope is shorter than the target, so the invoker can cache the target instance - // invoker.setCacheable(true); - // } else { - // invoker.setCacheable(false); - // } - sourceInvocationConfig.setTargetInvoker(invoker); - } - - } - - public void completeTargetChain(ProxyFactory targetFactory, Class targetType, ScopeContext targetScopeContext) - throws BuilderConfigException { - //TODO implement - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/WebServiceEntryPointConfigurationBuilder.java b/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/WebServiceEntryPointConfigurationBuilder.java deleted file mode 100644 index ac4b8b16eb..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/WebServiceEntryPointConfigurationBuilder.java +++ /dev/null @@ -1,170 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.builder; - -import java.lang.reflect.Method; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import org.apache.tuscany.binding.axis.assembly.WebServiceBinding; -import org.apache.tuscany.binding.axis.config.WebServiceEntryPointRuntimeConfiguration; -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.builder.impl.EntryPointRuntimeConfiguration; -import org.apache.tuscany.core.config.JavaIntrospectionHelper; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.invocation.Interceptor; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.InvocationRuntimeException; -import org.apache.tuscany.core.invocation.ProxyConfiguration; -import org.apache.tuscany.core.invocation.TargetInvoker; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.invocation.spi.ProxyFactoryFactory; -import org.apache.tuscany.core.message.Message; -import org.apache.tuscany.core.message.MessageFactory; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.Service; -import org.apache.tuscany.model.assembly.ServiceContract; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -/** - * Creates a RuntimeConfigurationBuilder for an entry point configured with the {@link WebServiceBinding} - * - * @version $Rev$ $Date$ - */ -@Scope("MODULE") -public class WebServiceEntryPointConfigurationBuilder implements RuntimeConfigurationBuilder { - - private RuntimeContext runtimeContext; - - private ProxyFactoryFactory proxyFactoryFactory; - - private MessageFactory messageFactory; - - private RuntimeConfigurationBuilder policyBuilder; - - public WebServiceEntryPointConfigurationBuilder() { - } - - @Init(eager = true) - public void init() { - runtimeContext.addBuilder(this); - } - - /** - * @param runtimeContext The runtimeContext to set. - */ - @Autowire - public void setRuntimeContext(RuntimeContext runtimeContext) { - this.runtimeContext = runtimeContext; - } - - /** - * Sets the factory used to construct proxies implmementing the business interface required by a reference - */ - @Autowire - public void setProxyFactoryFactory(ProxyFactoryFactory factory) { - this.proxyFactoryFactory = factory; - } - - /** - * Sets the factory used to construct invocation messages - * - * @param msgFactory - */ - @Autowire - public void setMessageFactory(MessageFactory msgFactory) { - this.messageFactory = msgFactory; - } - - /** - * Sets a builder responsible for creating source-side and target-side invocation chains for a reference. The - * reference builder may be hierarchical, containing other child reference builders that operate on specific - * metadata used to construct and invocation chain. - * - * @see org.apache.tuscany.core.builder.impl.HierarchicalBuilder - */ - public void setPolicyBuilder(RuntimeConfigurationBuilder builder) { - policyBuilder = builder; - } - - public void build(AssemblyModelObject object, AggregateContext parentContext) throws BuilderException { - if (!(object instanceof EntryPoint)) { - return; - } - EntryPoint entryPoint = (EntryPoint) object; - if (entryPoint.getBindings().size() < 1 || !(entryPoint.getBindings().get(0) instanceof WebServiceBinding)) { - return; - } - - EntryPointRuntimeConfiguration config = new WebServiceEntryPointRuntimeConfiguration(entryPoint.getName(), entryPoint.getConfiguredService().getService().getName(), messageFactory); - - ConfiguredService configuredService = entryPoint.getConfiguredService(); - Service service = configuredService.getService(); - ServiceContract serviceContract = service.getServiceContract(); - Map iConfigMap = new HashMap(); - ProxyFactory proxyFactory = proxyFactoryFactory.createProxyFactory(); - Set javaMethods = JavaIntrospectionHelper.getAllUniqueMethods(serviceContract.getInterface()); - for (Method method : javaMethods) { - InvocationConfiguration iConfig = new InvocationConfiguration(method); - iConfigMap.put(method, iConfig); - } - QualifiedName qName = new QualifiedName(entryPoint.getConfiguredReference().getTargetConfiguredServices().get(0).getAggregatePart().getName() + QualifiedName.NAME_SEPARATOR + service.getName()); - ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, serviceContract.getInterface().getClassLoader(), messageFactory); - proxyFactory.setBusinessInterface(serviceContract.getInterface()); - proxyFactory.setProxyConfiguration(pConfiguration); - config.addSourceProxyFactory(service.getName(), proxyFactory); - configuredService.setProxyFactory(proxyFactory); - if (policyBuilder != null) { - // invoke the reference builder to handle additional policy metadata - policyBuilder.build(configuredService, parentContext); - } - // add tail interceptor - for (InvocationConfiguration iConfig : (Collection) iConfigMap.values()) { - iConfig.addTargetInterceptor(new EntryPointInvokerInterceptor()); - } - entryPoint.getConfiguredReference().setRuntimeConfiguration(config); - } - - //FIXME same as the InvokerInterceptor except that it doesn't throw an exception in setNext - // For some reason another InvokerInterceptor is added after this one, need Jim to look into it - // and figure out why. - public class EntryPointInvokerInterceptor implements Interceptor { - - public EntryPointInvokerInterceptor() { - } - - public Message invoke(Message msg) throws InvocationRuntimeException { - TargetInvoker invoker = msg.getTargetInvoker(); - if (invoker == null) { - throw new InvocationRuntimeException("No target invoker specified on message"); - } - return invoker.invoke(msg); - } - - public void setNext(Interceptor next) { - } - - } - - -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/config/ExternalWebServiceRuntimeConfiguration.java b/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/config/ExternalWebServiceRuntimeConfiguration.java deleted file mode 100644 index c3145137dd..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/config/ExternalWebServiceRuntimeConfiguration.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.config; - -import org.apache.tuscany.core.builder.ObjectFactory; -import org.apache.tuscany.core.builder.impl.BaseExternalServiceRuntimeConfiguration; - -/** - * Creates instances of {@link org.apache.tuscany.core.context.ExternalServiceContext} configured with the appropriate - * invocation chains and bindings. This implementation serves as a marker for - * {@link org.apache.tuscany.binding.axis.builder.ExternalWebServiceWireBuilder} - * - * @version $Rev$ $Date$ - */ -public class ExternalWebServiceRuntimeConfiguration extends BaseExternalServiceRuntimeConfiguration { - - public ExternalWebServiceRuntimeConfiguration(String name, ObjectFactory objectFactory) { - super(name, objectFactory); - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/config/WebServiceEntryPointRuntimeConfiguration.java b/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/config/WebServiceEntryPointRuntimeConfiguration.java deleted file mode 100644 index 37fbd325e5..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/config/WebServiceEntryPointRuntimeConfiguration.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.config; - -import org.apache.tuscany.core.builder.impl.EntryPointRuntimeConfiguration; -import org.apache.tuscany.core.message.MessageFactory; - -/** - * Creates instances of {@link org.apache.tuscany.core.context.EntryPointContext} configured with the appropriate - * invocation chains and bindings. This implementation serves as a marker for - * {@link org.apache.tuscany.binding.axis.builder.WebServiceEntryPointWireBuilder} - * - * @version $Rev$ $Date$ - */ -public class WebServiceEntryPointRuntimeConfiguration extends EntryPointRuntimeConfiguration { - - public WebServiceEntryPointRuntimeConfiguration(String name, String serviceName, MessageFactory messageFactory) { - super(name, serviceName, messageFactory); - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/engine/config/AxisEngineConfigurationFactory.java b/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/engine/config/AxisEngineConfigurationFactory.java deleted file mode 100644 index a14f3de037..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/engine/config/AxisEngineConfigurationFactory.java +++ /dev/null @@ -1,265 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.engine.config; - -import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.Method; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import javax.servlet.ServletConfig; -import javax.wsdl.Definition; -import javax.wsdl.Operation; -import javax.wsdl.Port; -import javax.wsdl.PortType; -import javax.xml.namespace.QName; -import javax.xml.rpc.Service; -import javax.xml.rpc.ServiceException; -import javax.xml.rpc.ServiceFactory; - -import org.apache.axis.EngineConfiguration; -import org.apache.axis.EngineConfigurationFactory; -import org.apache.axis.MessageContext; -import org.apache.axis.configuration.FileProvider; -import org.apache.axis.configuration.SimpleProvider; -import org.apache.axis.constants.Style; -import org.apache.axis.constants.Use; -import org.apache.axis.description.JavaServiceDesc; -import org.apache.axis.description.OperationDesc; -import org.apache.axis.description.ParameterDesc; -import org.apache.axis.handlers.soap.SOAPService; -import org.apache.axis.providers.java.RPCProvider; -import org.apache.tuscany.binding.axis.assembly.WebServiceBinding; -import org.apache.tuscany.binding.axis.handler.WebServicePortMetaData; -import org.apache.tuscany.common.resource.ResourceLoader; -import org.apache.tuscany.core.config.JavaIntrospectionHelper; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.webapp.TuscanyWebAppRuntime; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.Binding; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.Module; -import org.osoa.sca.ServiceRuntimeException; -import org.osoa.sca.ServiceUnavailableException; - -/** - */ -public class AxisEngineConfigurationFactory implements EngineConfigurationFactory { - - private TuscanyWebAppRuntime tuscanyRuntime; - - /** - * Constructor - * - */ - public AxisEngineConfigurationFactory(TuscanyWebAppRuntime tuscanyRuntime) { - this.tuscanyRuntime = tuscanyRuntime; - } - - /** - * Creates a new factory. - * - * @see org.apache.axis.configuration.EngineConfigurationFactoryFinder - */ - public static EngineConfigurationFactory newFactory(Object param) { - if (param instanceof ServletConfig) { - - // Only configure Tuscany apps - // Get the Tuscany runtime out of the servlet context - TuscanyWebAppRuntime tuscanyRuntime = (TuscanyWebAppRuntime) ((ServletConfig) param).getServletContext().getAttribute(TuscanyWebAppRuntime.class.getName()); - if (tuscanyRuntime == null) - return null; - - return new AxisEngineConfigurationFactory(tuscanyRuntime); - } else { - return null; - } - } - - /** - * @see org.apache.axis.EngineConfigurationFactory#getClientEngineConfig() - */ - public EngineConfiguration getClientEngineConfig() { - - // Used only on the server side - return null; - } - - /** - * @see org.apache.axis.EngineConfigurationFactory#getServerEngineConfig() - */ - public EngineConfiguration getServerEngineConfig() { - - // Get the current SCA module context - AggregateContext moduleContext = tuscanyRuntime.getModuleComponentContext(); - tuscanyRuntime.start(); - try { - - Module module = (Module)moduleContext.getAggregate(); - AssemblyModelContext modelContext = module.getAssemblyModelContext(); - - // Load the .wsdd configuration - ResourceLoader bundleContext = modelContext.getApplicationResourceLoader(); - InputStream wsdd; - try { - URL url = bundleContext.getResource("org/apache/tuscany/binding/axis/engine/config/server-config.wsdd"); - wsdd = url.openStream(); - } catch (IOException e1) { - throw new ServiceRuntimeException(e1); - } - FileProvider wsddConfigurationProvider = new FileProvider(wsdd); - - // Create our dynamic configuration - SimpleProvider dynamicConfigurationProvider = new SimpleProvider(wsddConfigurationProvider); - - // Register all the Web service entry points - for (Iterator i = module.getEntryPoints().iterator(); i.hasNext();) { - EntryPoint entryPoint = (EntryPoint) i.next(); - Binding binding = (Binding) entryPoint.getBindings().get(0); - if (binding instanceof WebServiceBinding) { - //FIXME This should not use the proxy factory - use EntryPointContext#getInstance() - // Get the proxy factory associated with the entry point - final ProxyFactory proxyFactory=(ProxyFactory)entryPoint.getConfiguredService().getProxyFactory(); - - // Create a new SOAP service - SOAPService service = new SOAPService(new RPCProvider() { - protected Object makeNewServiceObject(MessageContext arg0, String arg1) throws Exception { - - // The SOAP service will delegate to a dynamic proxy - return proxyFactory.createProxy(); - } - }); - - // Get the WSDL definition and port - WebServiceBinding wsBinding = (WebServiceBinding) binding; - Definition definition=wsBinding.getWSDLDefinition(); - Port port=wsBinding.getWSDLPort(); - WebServicePortMetaData wsPortMetaData = new WebServicePortMetaData(definition, port, null, false); - - // Configure the SOAP service - service.setOption(RPCProvider.OPTION_WSDL_TARGETNAMESPACE, wsPortMetaData.getPortName().getNamespaceURI()); - service.setOption(RPCProvider.OPTION_WSDL_SERVICEELEMENT, wsPortMetaData.getServiceName().getLocalPart()); - service.setOption(RPCProvider.OPTION_WSDL_SERVICEPORT, wsPortMetaData.getPortName().getLocalPart()); - service.setOption(RPCProvider.OPTION_WSDL_PORTTYPE, wsPortMetaData.getPortTypeName().getLocalPart()); - //FIXME RPCProvider is not happy if you don't give it a class name... - service.setOption(RPCProvider.OPTION_CLASSNAME, Object.class.getName()); - - // Create a service description - JavaServiceDesc serviceDesc = (JavaServiceDesc) service.getServiceDescription(); - serviceDesc.setName(entryPoint.getName()); - String wsdlFile = definition.getDocumentBaseURI(); - if (wsdlFile.startsWith("file:")) - wsdlFile = wsdlFile.substring(5); - serviceDesc.setWSDLFile(wsdlFile); - serviceDesc.setDefaultNamespace(wsPortMetaData.getPortName().getNamespaceURI()); - serviceDesc.setStyle(Style.DOCUMENT); - serviceDesc.setUse(Use.LITERAL); - - // Get the service interface - Class serviceInterface=entryPoint.getConfiguredService().getService().getServiceContract().getInterface(); - Set methods=JavaIntrospectionHelper.getAllUniqueMethods(serviceInterface); - serviceDesc.setAllowedMethods(new ArrayList(methods)); - - // Create a JAX-RPC service - QName wsdlServiceName = wsPortMetaData.getService().getQName(); - Service jaxrpcService; - try { - URL url=new URL(wsBinding.getWSDLDefinition().getDocumentBaseURI()); - jaxrpcService = ServiceFactory.newInstance().createService(url, wsdlServiceName); - } catch (ServiceException e) { - throw new ServiceUnavailableException(e); - } catch (MalformedURLException e) { - throw new ServiceUnavailableException(e); - } - - // Create operation descriptions for all the operations - PortType wsdlPortType = wsPortMetaData.getPortType(); - for (Iterator j = wsdlPortType.getOperations().iterator(); j.hasNext();) { - Operation wsdlOperation = (Operation) j.next(); - String operationName = wsdlOperation.getName(); - - // Create a JAX RPC call object - QName portName = wsPortMetaData.getPortName(); - org.apache.axis.client.Call call; - try { - call = (org.apache.axis.client.Call) jaxrpcService.createCall(portName, operationName); - } catch (ServiceException e) { - throw new IllegalArgumentException(e); - } - - OperationDesc operationDesc = call.getOperation(); - operationDesc.setName(operationName); - List argTypes=new ArrayList(); - for (ParameterDesc parameterDesc : (List)operationDesc.getAllInParams()) { - argTypes.add(parameterDesc.getJavaType()); - } - Method method=JavaIntrospectionHelper.findClosestMatchingMethod(operationName, argTypes.toArray(new Class[argTypes.size()]), methods); - operationDesc.setMethod(method); - -// OperationDesc operationDesc = new OperationDesc(); -// operationDesc.setName(operationName); -// Method method=JavaIntrospectionHelper.findClosestMatchingMethod(operationName, new Class[]{String.class}, methods); -// operationDesc.setMethod(method); -// -// WebServiceOperationMetaData wsOperationMetaData = wsPortMetaData.getOperationMetaData(operationName); -// String soapAction = wsOperationMetaData.getSOAPAction(); -// if (soapAction != null && soapAction.length()!=0) -// operationDesc.setSoapAction(soapAction); -// -// operationDesc.setElementQName((QName) wsOperationMetaData.getOperationSignature().get(0)); -// -// Message inputMessage=wsdlOperation.getInput()!=null? wsdlOperation.getInput().getMessage():null; -// if (inputMessage!=null & !inputMessage.getParts().isEmpty()) { -// ParameterDesc parameterDesc = new ParameterDesc(); -// QName anyQName = new QName(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "any"); -// parameterDesc.setTypeQName(anyQName); -// parameterDesc.setQName(anyQName); -// parameterDesc.setJavaType(Object.class); -// operationDesc.addParameter(parameterDesc); -// } -// -// Message outputMessage=wsdlOperation.getOutput()!=null? wsdlOperation.getOutput().getMessage():null; -// if (outputMessage!=null & !outputMessage.getParts().isEmpty()) { -// QName anyQName = new QName(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "any"); -// operationDesc.setReturnType(anyQName); -// operationDesc.setReturnQName(anyQName); -// operationDesc.setReturnClass(Object.class); -// } - - serviceDesc.addOperationDesc(operationDesc); - } - - // Deploy the service - dynamicConfigurationProvider.deployService(entryPoint.getName(), service); - - } - } - return dynamicConfigurationProvider; - - } finally { - tuscanyRuntime.stop(); - } - - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ExternalWebServiceClient.java b/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ExternalWebServiceClient.java deleted file mode 100644 index 9d024bb036..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ExternalWebServiceClient.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.handler; - -import java.lang.reflect.Method; -import java.net.MalformedURLException; -import java.net.URL; -import java.rmi.RemoteException; -import java.util.Map; -import java.util.Set; - -import javax.xml.namespace.QName; -import javax.xml.rpc.Call; -import javax.xml.rpc.Service; -import javax.xml.rpc.ServiceException; -import javax.xml.rpc.ServiceFactory; - -import org.apache.tuscany.binding.axis.assembly.WebServiceBinding; -import org.apache.tuscany.core.config.JavaIntrospectionHelper; -import org.apache.tuscany.core.invocation.MethodHashMap; -import org.apache.tuscany.model.assembly.ExternalService; -import org.osoa.sca.ServiceRuntimeException; -import org.osoa.sca.ServiceUnavailableException; - -/** - * A mock client for a transport binding - * - * @version $Rev$ $Date$ - */ -public class ExternalWebServiceClient { - - - private WebServicePortMetaData wsPortMetaData; - private Service jaxrpcService; - private Map jaxrpcCalls=new MethodHashMap(); - - /** - * Constructs a new ExternalWebServiceClient. - * @param externalService - * @param wsBinding - */ - public ExternalWebServiceClient(ExternalService externalService, WebServiceBinding wsBinding) { - - // Create a port metadata info object to hold the port information - wsPortMetaData = new WebServicePortMetaData(wsBinding.getWSDLDefinition(), wsBinding.getWSDLPort(), wsBinding.getURI(), false); - - // Create a JAX-RPC service - QName wsdlServiceName = wsPortMetaData.getService().getQName(); - try { - URL url=new URL(wsBinding.getWSDLDefinition().getDocumentBaseURI()); - jaxrpcService = ServiceFactory.newInstance().createService(url, wsdlServiceName); - } catch (ServiceException e) { - throw new ServiceUnavailableException(e); - } catch (MalformedURLException e) { - throw new ServiceUnavailableException(e); - } - - // Create JAX-RPC calls for all the methods on the service contract - Set methods=JavaIntrospectionHelper.getAllUniqueMethods(externalService.getConfiguredService().getService().getServiceContract().getInterface()); - for (Method method : methods) { - Call call=createCall(method); - jaxrpcCalls.put(method, call); - } - - } - - /** - * Create a JAX-RPC call for the given method. - * @param method - * @return - */ - private Call createCall(Method method) { - - // Create a JAX RPC call object - QName portName = wsPortMetaData.getPortName(); - Call call; - try { - call = (Call) jaxrpcService.createCall(portName, method.getName()); - } catch (ServiceException e) { - throw new IllegalArgumentException(e); - } - - // Set the target endpoint address - String endpoint = wsPortMetaData.getEndpoint(); - if (endpoint != null) { - String originalEndpoint = call.getTargetEndpointAddress(); - if (!endpoint.equals(originalEndpoint)) - call.setTargetEndpointAddress(endpoint); - } - - return call; - } - - /** - * Invoke an operation on the external Web service. - * @param method - * @param args - * @return - */ - public Object invoke(Method method, Object[] args) { - Call call=jaxrpcCalls.get(method); - try { - return call.invoke(args); - } catch (RemoteException e) { - throw new ServiceRuntimeException(e); - } - } -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ExternalWebServiceTargetInvoker.java b/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ExternalWebServiceTargetInvoker.java deleted file mode 100644 index 64f33a1829..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ExternalWebServiceTargetInvoker.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.handler; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import org.apache.tuscany.core.context.ExternalServiceContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.context.TargetException; -import org.apache.tuscany.core.invocation.Interceptor; -import org.apache.tuscany.core.invocation.TargetInvoker; -import org.apache.tuscany.core.message.Message; - -/** - * Responsible for invoking an external web service - * - * @version $Rev$ $Date$ - */ -public class ExternalWebServiceTargetInvoker implements TargetInvoker { - - private QualifiedName serviceName; - private String esName; - private Method method; - private ScopeContext container; - - private ExternalServiceContext context; - - /** - * Constructs a new ExternalWebServiceTargetInvoker. - * @param esName - * @param container - */ - public ExternalWebServiceTargetInvoker(QualifiedName serviceName, Method method, ScopeContext container) { - assert (serviceName != null) : "No service name specified"; - assert (method != null) : "No method specified"; - assert (container != null) : "No scope container specified"; - this.serviceName = serviceName; - this.esName=serviceName.getPartName(); - this.method = method; - this.container = container; - } - - public Object invokeTarget(Object payload) throws InvocationTargetException { - if (context == null) { - InstanceContext iContext = container.getContext(esName); - if (!(iContext instanceof ExternalServiceContext)) { - TargetException te = new TargetException("Unexpected target context type"); - te.setIdentifier(iContext.getClass().getName()); - te.addContextName(iContext.getName()); - throw te; - } - context = (ExternalServiceContext) iContext; - } - ExternalWebServiceClient client = (ExternalWebServiceClient) context.getImplementationInstance(true); - if (payload != null) { - return client.invoke(method, (Object[])payload); - } else { - return client.invoke(method, null); - } - } - - public boolean isCacheable() { - return false; - } - - public Message invoke(Message msg) { - try { - Object resp = invokeTarget(msg.getBody()); - msg.setBody(resp); - } catch (InvocationTargetException e) { - msg.setBody(e.getCause()); - } catch (Throwable e) { - msg.setBody(e); - } - return msg; - } - - public void setNext(Interceptor next) { - throw new UnsupportedOperationException(); - } - - public Object clone() { - try { - ExternalWebServiceTargetInvoker invoker = (ExternalWebServiceTargetInvoker) super.clone(); - invoker.container = container; - invoker.context = this.context; - invoker.esName = this.esName; - invoker.method = this.method; - invoker.serviceName = this.serviceName; - return invoker; - } catch (CloneNotSupportedException e) { - return null; // will not happen - } - } -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/WebServiceEntryPointServlet.java b/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/WebServiceEntryPointServlet.java deleted file mode 100644 index d3773ca415..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/WebServiceEntryPointServlet.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.handler; - -import java.io.File; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.axis.AxisEngine; -import org.apache.axis.AxisFault; -import org.apache.axis.EngineConfiguration; -import org.apache.axis.server.AxisServer; -import org.apache.axis.transport.http.AxisServlet; - -import org.apache.tuscany.binding.axis.engine.config.AxisEngineConfigurationFactory; -import org.apache.tuscany.core.context.webapp.TuscanyWebAppRuntime; - -/** - */ -public class WebServiceEntryPointServlet extends AxisServlet { - - /** - * - */ - public WebServiceEntryPointServlet() { - super(); - } - - /** - * @see org.apache.axis.transport.http.AxisServletBase#getEngine() - */ - public AxisServer getEngine() throws AxisFault { - AxisServer engine = null; - ServletContext context = getServletContext(); - synchronized (context) { - engine = (AxisServer) getServletContext().getAttribute(getServletName() + ".WebServiceEntryPointAxisEngine"); - if (engine == null) { - Map environment = new HashMap(); - environment.put(AxisEngine.ENV_SERVLET_CONTEXT, context); - String webInfPath = context.getRealPath("/WEB-INF"); - if (webInfPath != null) - environment.put(AxisEngine.ENV_SERVLET_REALPATH, webInfPath + File.separator + "attachments"); - TuscanyWebAppRuntime tuscanyRuntime = (TuscanyWebAppRuntime) context.getAttribute(TuscanyWebAppRuntime.class.getName()); - EngineConfiguration config = new AxisEngineConfigurationFactory(tuscanyRuntime).getServerEngineConfig(); - if (config != null) { - environment.put(EngineConfiguration.PROPERTY_NAME, config); - } - engine = AxisServer.getServer(environment); - engine.setName(getServletName()); - context.setAttribute(getServletName() + ".WebServiceEntryPointAxisEngine", engine); - } - } - return engine; - } - - /** - * @see org.apache.axis.transport.http.AxisServlet#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) - */ - public void doPost(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException { - super.doPost(arg0, arg1); - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/WebServiceOperationMetaData.java b/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/WebServiceOperationMetaData.java deleted file mode 100644 index 99aa62f78f..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/WebServiceOperationMetaData.java +++ /dev/null @@ -1,484 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.handler; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import javax.wsdl.Binding; -import javax.wsdl.BindingInput; -import javax.wsdl.BindingOperation; -import javax.wsdl.BindingOutput; -import javax.wsdl.Input; -import javax.wsdl.Message; -import javax.wsdl.Operation; -import javax.wsdl.Output; -import javax.wsdl.Part; -import javax.wsdl.extensions.soap.SOAPBinding; -import javax.wsdl.extensions.soap.SOAPHeader; -import javax.wsdl.extensions.soap.SOAPOperation; -import javax.xml.namespace.QName; - -/** - * Metadata for a WSDL operation - * - */ -public class WebServiceOperationMetaData { - // WSDL Binding and BindingOperation - private Binding binding; - private BindingOperation bindingOperation; - - // Fields to cache derived metadata - private transient Set inputHeaderParts; - private transient Set outputHeaderParts; - private transient String style; - private transient String use; - private transient String soapAction; - private transient List signature; - private String encoding; - private transient QName rpcOperationName; - - public WebServiceOperationMetaData(Binding binding, BindingOperation bindingOperation) { - this.binding = binding; - this.bindingOperation = bindingOperation; - } - - public WebServiceOperationMetaData(Binding binding, BindingOperation bindingOperation, String style, String use, String encoding, String soapAction) { - this.binding = binding; - this.bindingOperation = bindingOperation; - this.style = style; - this.use = use; - this.encoding = encoding; - this.soapAction = soapAction; - } - - public Set getInputHeaderParts() { - if (inputHeaderParts == null) { - // Build a set of header parts that we need to exclude - inputHeaderParts = new HashSet(); - BindingInput bindingInput = bindingOperation.getBindingInput(); - - if (bindingInput != null) { - Operation operation = bindingOperation.getOperation(); - javax.wsdl.Message message = operation.getInput().getMessage(); - List elements = bindingInput.getExtensibilityElements(); - for (Iterator i = elements.iterator(); i.hasNext();) { - Object extensibilityElement = i.next(); - Part part = getPartFromSOAPHeader(message, extensibilityElement); - if (part != null) { - inputHeaderParts.add(part); - } - } - } - } - return inputHeaderParts; - } - - public Set getOutputHeaderParts() { - if (outputHeaderParts == null) { - // Build a set of header parts that we need to exclude - outputHeaderParts = new HashSet(); - BindingOutput bindingOutput = bindingOperation.getBindingOutput(); - - if (bindingOutput != null) { - Operation operation = bindingOperation.getOperation(); - javax.wsdl.Message message = operation.getOutput().getMessage(); - List elements = bindingOutput.getExtensibilityElements(); - for (Iterator i = elements.iterator(); i.hasNext();) { - Object extensibilityElement = i.next(); - Part part = getPartFromSOAPHeader(message, extensibilityElement); - if (part != null) { - outputHeaderParts.add(part); - } - } - } - } - return outputHeaderParts; - } - - private Part getPartFromSOAPHeader(Message message, Object extensibilityElement) { - Part part = null; - if (extensibilityElement instanceof SOAPHeader) { - SOAPHeader soapHeader = (SOAPHeader) extensibilityElement; - QName msgName = soapHeader.getMessage(); - if (message.getQName().equals(msgName)) { - part = message.getPart(soapHeader.getPart()); - } - } else if (extensibilityElement instanceof SOAPHeader) { - SOAPHeader soapHeader = (SOAPHeader) extensibilityElement; - QName msgName = soapHeader.getMessage(); - if (message.getQName().equals(msgName)) { - part = message.getPart(soapHeader.getPart()); - } - } - return part; - } - - public String getStyle() { - if (style == null) { - SOAPOperation soapOperation = (SOAPOperation) WebServicePortMetaData.getExtensibilityElement(bindingOperation.getExtensibilityElements(), SOAPOperation.class); - if (soapOperation != null) - style = soapOperation.getStyle(); - if (style == null) { - SOAPBinding soapBinding = (SOAPBinding) WebServicePortMetaData.getExtensibilityElement(binding.getExtensibilityElements(), SOAPBinding.class); - if (soapBinding != null) - style = soapBinding.getStyle(); - } - if (style == null) - style = "document"; - } - return style; - } - - /** - * Returns the SOAP action for the given operation. - * - * @param wsdlBindingOperation - * @return - */ - public String getSOAPAction() { - if (soapAction == null) { - final List wsdlBindingOperationExtensions = bindingOperation.getExtensibilityElements(); - final SOAPOperation soapOp = (SOAPOperation) WebServicePortMetaData.getExtensibilityElement(wsdlBindingOperationExtensions, SOAPOperation.class); - if (soapOp != null) - soapAction = soapOp.getSoapActionURI(); - } - return soapAction; - } - - public QName getRPCOperationName() { - if (rpcOperationName == null) { - javax.wsdl.extensions.soap.SOAPBody soapBody = getSOAPBody(true); - String ns = (soapBody != null) ? soapBody.getNamespaceURI() : binding.getPortType().getQName().getNamespaceURI(); - String name = bindingOperation.getOperation().getName(); - rpcOperationName = new QName(ns, name); - } - return rpcOperationName; - } - - private List getSOAPBodyParts(boolean input) { - javax.wsdl.extensions.soap.SOAPBody soapBody = getSOAPBody(input); - if (soapBody != null) { - List parts = soapBody.getParts(); - if (parts!=null) { - List names = new ArrayList(); - for (Iterator i = parts.iterator(); i.hasNext();) { - Object part = i.next(); - if (part instanceof String) - names.add(part); - else if (part instanceof Part) { - names.add(((Part) part).getName()); - } - } - return names; - } else - return null; - } else - return null; - } - - private javax.wsdl.extensions.soap.SOAPBody getSOAPBody(boolean input) { - List elements = null; - if (input) { - BindingInput bindingInput = bindingOperation.getBindingInput(); - if (bindingInput == null) - return null; - elements = bindingInput.getExtensibilityElements(); - } else { - BindingOutput bindingOutput = bindingOperation.getBindingOutput(); - if (bindingOutput == null) - return null; - elements = bindingOutput.getExtensibilityElements(); - } - javax.wsdl.extensions.soap.SOAPBody soapBody = (javax.wsdl.extensions.soap.SOAPBody) WebServicePortMetaData.getExtensibilityElement(elements, - javax.wsdl.extensions.soap.SOAPBody.class); - return soapBody; - } - - /** - * Returns the use attribute - * - * @param wsdlOperation - * @return - */ - public String getUse() { - if (use == null) { - javax.wsdl.extensions.soap.SOAPBody soapBody = getSOAPBody(true); - if (soapBody != null) { - use = soapBody.getUse(); - } - if (use == null) - use = "literal"; - } - return use; - } - - public String getEncoding() { - if (encoding == null) { - javax.wsdl.extensions.soap.SOAPBody soapBody = getSOAPBody(true); - if (soapBody != null) { - List styles=(List)soapBody.getEncodingStyles(); - if (styles!=null && !styles.isEmpty()) - encoding = styles.get(0); - } - if (encoding == null) - encoding = ""; - } - return encoding; - } - - public boolean isDocLitWrapped() { - boolean flag = getStyle().equals("document") && getUse().equals("literal"); - if (!flag) - return false; - Message msg = getMessage(true); - if (msg == null) - return false; - List parts = msg.getOrderedParts(null); - if (parts.size() != 1) - return false; - Part part = (Part) parts.get(0); - QName element = part.getElementName(); - if (element == null) - return false; - return element.getLocalPart().equals(bindingOperation.getOperation().getName()); - } - - /* - public SOAPMediator createMediator(boolean serverMode) - throws SOAPException { - // create a new mediator for each invoke for thread-safety - boolean rpcStyle = getStyle().equals("rpc"); - boolean rpcEncoded = isEncoded(); - - SOAPMediator mediator = null; - - if (!rpcStyle) { - // Document - mediator = new SOAPDocumentLiteralMediatorImpl(this, serverMode); - } else { - if (!rpcEncoded) - mediator = new SOAPRPCLiteralMediatorImpl(this, serverMode); // RPC-literal - else - mediator = new SOAPRPCEncodedMediatorImpl(this, serverMode); // RPC-encoded - } - return mediator; - } - */ - - /** - * Get the operation signature from the WSDL operation - * - * @param wsdlBinding - * @param bindingOperation - * @return - */ - public List getOperationSignature() { - if (signature == null) { - signature = new ArrayList(); - - Operation operation = bindingOperation.getOperation(); - if (operation == null) - return signature; - - final Input input = operation.getInput(); - if (input == null) { - return signature; - } - - String style = getStyle(); - - if (style.equals("rpc")) { - Collection partNames = input.getMessage().getParts().values(); - for (Iterator i = partNames.iterator(); i.hasNext();) { - Part part = (Part) i.next(); - signature.add(part.getName()); - } - } else { - /* - * WS-I Basic Profile 1.1 4.7.6 Operation Signatures - * Definition: operation signature - * - * The profile defines the "operation signature" to be the - * fully qualified name of the child element of SOAP body of - * the SOAP input message described by an operation in a - * WSDL binding. - * - * In the case of rpc-literal binding, the operation name is - * used as a wrapper for the part accessors. In the - * document-literal case, since a wrapper with the operation - * name is not present, the message signatures must be - * correctly designed so that they meet this requirement. - * - * An endpoint that supports multiple operations must - * unambiguously identify the operation being invoked based - * on the input message that it receives. This is only - * possible if all the operations specified in the - * wsdl:binding associated with an endpoint have a unique - * operation signature. - * - * R2710 The operations in a wsdl:binding in a DESCRIPTION - * MUST result in operation signatures that are different - * from one another. - */ - List bodyParts = getSOAPBodyParts(true); - - Collection parts = input.getMessage().getParts().values(); - // Exclude the parts to be transmitted in SOAP header - if (bodyParts == null) - parts.removeAll(getInputHeaderParts()); - for (Iterator i = parts.iterator(); i.hasNext();) { - Part part = (Part) i.next(); - if (bodyParts == null) { - // All parts - QName elementName = part.getElementName(); - if (elementName == null) { - elementName = new QName("", part.getName()); - // TODO: [rfeng] throw new - // ServiceRuntimeException("Message part for - // document style must refer to an XSD element - // using a QName: " + part); - } - signature.add(elementName); - } else { - // "parts" in soap:body - if (bodyParts.contains(part.getName())) { - QName elementName = part.getElementName(); - if (elementName == null) { - elementName = new QName("", part.getName()); - // TODO: [rfeng] throw new - // ServiceRuntimeException("Message part for - // document style must refer to an XSD - // element using a QName: " + part); - } - signature.add(elementName); - } - - } - } - } - } - return signature; - } - - public Message getMessage(boolean isInput) { - Operation operation = bindingOperation.getOperation(); - if (operation == null) - return null; - - if (isInput) { - final Input input = operation.getInput(); - return input == null ? null : input.getMessage(); - } else { - final Output output = operation.getOutput(); - return output == null ? null : output.getMessage(); - } - } - - public Part getInputPart(int index) { - Part part = null; - Message message = getMessage(true); - if (message == null) - return part; - - List parts = message.getOrderedParts(null); - return (Part) parts.get(index); - - } - - public Part getOutputPart(int index) { - Part part = null; - Message message = getMessage(false); - if (message == null) - return part; - - List parts = message.getOrderedParts(null); - return (Part) parts.get(index); - - } - - /** - * Get a list of indexes for each part in the SOAP body - * - * @param isInput TODO - * @return - */ - public List getBodyPartIndexes(boolean isInput) { - List indexes = new ArrayList(); - - Message message = getMessage(isInput); - if (message == null) - return indexes; - - List bodyParts = getSOAPBodyParts(isInput); - List parts = message.getOrderedParts(null); - Set headerParts = (isInput) ? getInputHeaderParts() : getOutputHeaderParts(); - - int index = 0; - for (Iterator i = parts.iterator(); i.hasNext(); index++) { - Part part = (Part) i.next(); - if (headerParts.contains(part)) - continue; - if (bodyParts == null) { - // All parts - indexes.add(new Integer(index)); - } else { - // "parts" in soap:body - if (bodyParts.contains(part.getName())) - indexes.add(new Integer(index)); - - } - } - return indexes; - } - - /** - * Get the corresponding index for a part in the SOAP header by element - * name - * - * @param elementName - * @param isInput TODO - * @return - */ - public int getHeaderPartIndex(QName elementName, boolean isInput) { - - Message message = getMessage(isInput); - if (message == null) - return -1; - - List parts = message.getOrderedParts(null); - Set headerParts = isInput ? getInputHeaderParts() : getOutputHeaderParts(); - - int index = 0; - for (Iterator i = parts.iterator(); i.hasNext(); index++) { - Part part = (Part) i.next(); - // Test if the part is in header section - if (headerParts.contains(part) && elementName.equals(part.getElementName())) { - return index; - } - } - return -1; - } - - public BindingOperation getBindingOperation() { - return bindingOperation; - } - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/WebServicePortMetaData.java b/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/WebServicePortMetaData.java deleted file mode 100644 index 9ce85d3ca8..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/WebServicePortMetaData.java +++ /dev/null @@ -1,362 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.handler; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import javax.wsdl.Binding; -import javax.wsdl.BindingOperation; -import javax.wsdl.Definition; -import javax.wsdl.Port; -import javax.wsdl.PortType; -import javax.wsdl.Service; -import javax.wsdl.extensions.soap.SOAPAddress; -import javax.wsdl.extensions.soap.SOAPBinding; -import javax.xml.namespace.QName; -import javax.xml.soap.Name; -import javax.xml.soap.SOAPBodyElement; -import javax.xml.soap.SOAPElement; - -import org.apache.tuscany.model.types.wsdl.WSDLServiceContract; - -/** - * Metadata for a WSDL port - * - */ -public class WebServicePortMetaData { - - private final static String SOAP_ENCODING_URI = "http://schemas.xmlsoap.org/wsdl/soap/"; - - private Service wsdlService; - private QName wsdlServiceName; - private Port wsdlPort; - private Binding wsdlBinding; - private QName wsdlPortName; - private PortType wsdlPortType; - private QName wsdlPortTypeName; - private String endpoint; - private boolean managed; - private List allOperationMetaData; - private WSDLServiceContract interfaceType; - - /** - * Constructor - * - * @param wsdlDefinition - * @param portName - */ - public WebServicePortMetaData(Definition wsdlDefinition, Port wsdlPort, String endpoint, boolean managed) { - - // Lookup the named port - this.wsdlPort=wsdlPort; - wsdlPortName = new QName(wsdlDefinition.getTargetNamespace(), wsdlPort.getName()); - - Collection services=(Collection)wsdlDefinition.getServices().values(); - for (Service service : services) { - if (service.getPorts().containsValue(wsdlPort)) { - wsdlService = service; - wsdlServiceName = service.getQName(); - break; - } - } - - // Save the binding - wsdlBinding = wsdlPort.getBinding(); - if (wsdlBinding == null) { - throw new IllegalArgumentException("WSDL binding cannot be found for " + wsdlPortName); - } - - // Save the portType - wsdlPortType = wsdlBinding.getPortType(); - if (wsdlPortType == null) { - throw new IllegalArgumentException("WSDL portType cannot be found for " + wsdlPortName); - } - wsdlPortTypeName = wsdlPortType.getQName(); - - // Save the endpoint - this.endpoint = endpoint; - - // Track if this endpoint is managed or not - this.managed = managed; - } - - /** - * Constructor - * - * @param serviceName - * @param portName - * @param portType - */ - public WebServicePortMetaData(QName serviceName, String portName, QName portTypeName, String endpoint) { - wsdlServiceName = serviceName; - wsdlPortName = new QName(serviceName.getNamespaceURI(), portName); - wsdlPortTypeName = portTypeName; - this.endpoint = endpoint; - } - - /** - * @return Returns the wsdlPort. - */ - public javax.wsdl.Port getPort() { - return wsdlPort; - } - - /** - * @return Returns the wsdlService. - */ - public QName getServiceName() { - return wsdlServiceName; - } - - /** - * @return Returns the wsdlService. - */ - public javax.wsdl.Service getService() { - return wsdlService; - } - - /** - * @return Returns the wsdlPortType. - */ - public PortType getPortType() { - return wsdlPortType; - } - - /** - * @return Returns the wsdlPortType. - */ - public QName getPortTypeName() { - return wsdlPortTypeName; - } - - /** - * @return Returns the wsdlBinding. - */ - public Binding getBinding() { - return wsdlBinding; - } - - /** - * @return Returns the wsdlPortName. - */ - public QName getPortName() { - return wsdlPortName; - } - - /** - * Returns the endpoint of a given port. - * - * @param wsdlPort - * @return - */ - public String getEndpoint() { - - // Return the specified endpoint - if (endpoint != null) - return endpoint; - - // Find the target endpoint on the port - if (wsdlPort != null) { - final List wsdlPortExtensions = wsdlPort.getExtensibilityElements(); - for (Iterator i = wsdlPortExtensions.iterator(); i.hasNext();) { - final Object extension = i.next(); - if (extension instanceof SOAPAddress) { - final SOAPAddress address = (SOAPAddress) extension; - return address.getLocationURI(); - } - } - } - - return null; - } - - /** - * Returns the SOAP binding style. - * @return - */ - public String getStyle() { - - // Find the binding style - String style = null; - if (wsdlBinding != null) { - final List wsdlBindingExtensions = wsdlBinding.getExtensibilityElements(); - SOAPBinding soapBinding = (SOAPBinding) getExtensibilityElement(wsdlBindingExtensions, SOAPBinding.class); - if (soapBinding != null) - style = soapBinding.getStyle(); - } - - // Default to document - return (style == null) ? "document" : style; - } - - /** - * Returns the use attribute - * @return - */ - public String getUse() { - List list = getAllOperationMetaData(); - WebServiceOperationMetaData operationMetaData = (WebServiceOperationMetaData) list.get(0); - return operationMetaData.getUse(); - } - - /** - * Returns the encoding attribute - * @return - */ - public String getEncoding() { - List list = getAllOperationMetaData(); - WebServiceOperationMetaData operationMetaData = (WebServiceOperationMetaData) list.get(0); - return operationMetaData.getEncoding(); - } - - /** - * @return Returns true if this is a managed web service. - */ - public boolean isManaged() { - return managed; - } - - /** - * Returns the first extensibility element of the given type. - * @param elements - * @param type - * @return - */ - public static Object getExtensibilityElement(List elements, Class type) { - for (Iterator i = elements.iterator(); i.hasNext();) { - Object element = i.next(); - if (type.isInstance(element)) - return element; - } - return null; - } - - /** - * Returns the extensibility elements of the given type. - * @param elements - * @param type - * @return - */ - public static List getExtensibilityElements(List elements, Class type) { - List result = new ArrayList(); - for (Iterator i = elements.iterator(); i.hasNext();) { - Object element = i.next(); - if (type.isInstance(element)) - result.add(element); - } - return result; - } - - /** - * Get the operation signature from the SOAP Body - * @param body - * @return A list of QNames - */ - public static List getOperationSignature(javax.xml.soap.SOAPBody body) { - List signature = new ArrayList(); - for (Iterator i = body.getChildElements(); i.hasNext();) { - Object child = i.next(); - if (child instanceof SOAPBodyElement) { - Name name = ((SOAPBodyElement) child).getElementName(); - QName qname = new QName(name.getURI(), name.getLocalName(), name.getPrefix()); - signature.add(qname); - } - } - return signature; - } - - public static List getRPCOperationSignature(javax.xml.soap.SOAPBody body) { - List signature = new ArrayList(); - for (Iterator i = body.getChildElements(); i.hasNext();) { - Object child = i.next(); - if (child instanceof SOAPBodyElement) { - SOAPBodyElement op = ((SOAPBodyElement) child); - for (Iterator j = op.getChildElements(); j.hasNext();) { - Object part = i.next(); - if (part instanceof SOAPElement) { - SOAPElement p = (SOAPElement) part; - signature.add(p.getLocalName()); - } - } - } - } - return signature; - } - - public WebServiceOperationMetaData getOperationMetaData(javax.xml.soap.SOAPBody body) { - List s1 = getOperationSignature(body); - // List rpcParts = getRPCOperationSignature(body); - for (Iterator it = getAllOperationMetaData().iterator(); it.hasNext();) { - WebServiceOperationMetaData descriptor = (WebServiceOperationMetaData) it.next(); - - String style = descriptor.getStyle(); - - if (style.equals("document")) { - List s2 = descriptor.getOperationSignature(); - if (s1.equals(s2)) - return descriptor; - } else { - QName op1 = (QName) s1.get(0); - QName op2 = descriptor.getRPCOperationName(); - if (op1.equals(op2)) { - /* - * // FIXME: [rfeng] We don't support method overloading - * List partNames = getOperationSignature(binding, - * bindingOperation); if (rpcParts.equals(partNames)) - */ - return descriptor; - } - } - } - return null; - } - - public List getAllOperationMetaData() { - if (allOperationMetaData == null) { - allOperationMetaData = new ArrayList(); - for (Iterator it = wsdlBinding.getBindingOperations().iterator(); it.hasNext();) { - final BindingOperation bindingOperation = (BindingOperation) it.next(); - if (bindingOperation.getOperation() != null) - allOperationMetaData.add(new WebServiceOperationMetaData(wsdlBinding, bindingOperation)); - } - } - return allOperationMetaData; - } - - public WebServiceOperationMetaData getOperationMetaData(String operationName) { - for (Iterator it = getAllOperationMetaData().iterator(); it.hasNext();) { - WebServiceOperationMetaData descriptor = (WebServiceOperationMetaData) it.next(); - String opName = descriptor.getBindingOperation().getOperation().getName(); - - if (opName.equals(operationName)) - return descriptor; - } - return null; - } - - /** - * Returns the WSDL service contract - * @return - */ - public WSDLServiceContract getInterfaceType() { - return interfaceType; - } - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/loader/WebServiceSCDLModelLoader.java b/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/loader/WebServiceSCDLModelLoader.java deleted file mode 100644 index e60d77525f..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/loader/WebServiceSCDLModelLoader.java +++ /dev/null @@ -1,74 +0,0 @@ -package org.apache.tuscany.binding.axis.loader; - -import org.apache.tuscany.binding.axis.assembly.WebServiceAssemblyFactory; -import org.apache.tuscany.binding.axis.assembly.WebServiceBinding; -import org.apache.tuscany.binding.axis.assembly.impl.WebServiceAssemblyFactoryImpl; -import org.apache.tuscany.binding.axis.assembly.impl.WebServiceBindingImpl; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.apache.tuscany.core.loader.SCDLModelLoaderRegistry; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.scdl.loader.SCDLModelLoader; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Destroy; - -/** - * Populates the assembly model from an SCDL model - */ -@org.osoa.sca.annotations.Scope("MODULE") -public class WebServiceSCDLModelLoader implements SCDLModelLoader { - - private RuntimeContext runtimeContext; - private SCDLModelLoaderRegistry loaderRegistry; - private WebServiceAssemblyFactory wsFactory; - - /** - * Constructs a new WebServiceSCDLModelLoader. - */ - public WebServiceSCDLModelLoader() { - this.wsFactory=new WebServiceAssemblyFactoryImpl(); - } - - /** - * @param runtimeContext The runtimeContext to set. - */ - @Autowire - public void setRuntimeContext(RuntimeContext runtimeContext) { - this.runtimeContext = runtimeContext; - } - - // @Autowire - public void setLoaderRegistry(SCDLModelLoaderRegistry registry) { - this.loaderRegistry = registry; - } - - @Init(eager=true) - public void init() { - runtimeContext.addLoader(this); -// loaderRegistry.registerLoader(this); - } - - @Destroy - public void destroy() { - loaderRegistry.unregisterLoader(this); - } - - /** - * @see org.apache.tuscany.model.scdl.loader.SCDLModelLoader#load(org.apache.tuscany.model.assembly.AssemblyModelContext, java.lang.Object) - */ - public AssemblyModelObject load(AssemblyModelContext modelContext, Object object) { - if (object instanceof org.apache.tuscany.model.scdl.WebServiceBinding) { - org.apache.tuscany.model.scdl.WebServiceBinding scdlBinding=(org.apache.tuscany.model.scdl.WebServiceBinding)object; - WebServiceBinding binding=wsFactory.createWebServiceBinding(); - binding.setURI(scdlBinding.getUri()); - - // Set the port URI into the assembly binding, it'll be resolved in the initialize method - ((WebServiceBindingImpl)binding).setPortURI(scdlBinding.getPort()); - - return binding; - - } else - return null; - } -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/main/resources/org/apache/tuscany/binding/axis/Messages.properties b/tags/java-stable-20060304/sca/binding.axis/src/main/resources/org/apache/tuscany/binding/axis/Messages.properties deleted file mode 100644 index ac3fc641e5..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/main/resources/org/apache/tuscany/binding/axis/Messages.properties +++ /dev/null @@ -1,28 +0,0 @@ -# ==================================================================== -# Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable. -# -# 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. -# ==================================================================== - -# ==================================================================== -# To code developer: -# Do NOT change the properties between this line and the -# "%%% END OF TRANSLATED PROPERTIES %%%" line. -# Make a new property name, append to the end of the file and change -# the code to use the new property. -# ==================================================================== - -# ===================================================================== -# %%% END OF TRANSLATED PROPERTIES %%% -# ===================================================================== -# NLS_MESSAGEFORMAT_ALL diff --git a/tags/java-stable-20060304/sca/binding.axis/src/main/resources/org/apache/tuscany/binding/axis/engine/config/server-config.wsdd b/tags/java-stable-20060304/sca/binding.axis/src/main/resources/org/apache/tuscany/binding/axis/engine/config/server-config.wsdd deleted file mode 100644 index 6790888ee6..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/main/resources/org/apache/tuscany/binding/axis/engine/config/server-config.wsdd +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/binding.axis/src/main/resources/system.fragment b/tags/java-stable-20060304/sca/binding.axis/src/main/resources/system.fragment deleted file mode 100644 index ebfefa309a..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/main/resources/system.fragment +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/WebServiceAssemblyLoaderTestCase.java b/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/WebServiceAssemblyLoaderTestCase.java deleted file mode 100644 index 6c8b58b0d1..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/WebServiceAssemblyLoaderTestCase.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.assembly.tests; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.binding.axis.assembly.WebServiceBinding; -import org.apache.tuscany.binding.axis.loader.WebServiceSCDLModelLoader; -import org.apache.tuscany.common.resource.ResourceLoader; -import org.apache.tuscany.common.resource.impl.ResourceLoaderImpl; -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.Binding; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.ExternalService; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; -import org.apache.tuscany.model.assembly.loader.AssemblyModelLoader; -import org.apache.tuscany.model.scdl.loader.SCDLModelLoader; -import org.apache.tuscany.model.scdl.loader.impl.SCDLAssemblyModelLoaderImpl; - -/** - */ -public class WebServiceAssemblyLoaderTestCase extends TestCase { - - /** - * - */ - public WebServiceAssemblyLoaderTestCase() { - super(); - } - - public void testLoader() { - - ResourceLoader resourceLoader=new ResourceLoaderImpl(Thread.currentThread().getContextClassLoader()); - WebServiceSCDLModelLoader wsLoader=new WebServiceSCDLModelLoader(); - List scdlLoaders=new ArrayList(); - scdlLoaders.add(wsLoader); - AssemblyModelLoader assemblyLoader=new SCDLAssemblyModelLoaderImpl(scdlLoaders); - AssemblyFactory assemblyFactory=new AssemblyFactoryImpl(); - AssemblyModelContext modelContext=new AssemblyModelContextImpl(assemblyFactory, assemblyLoader, resourceLoader); - - Module module = assemblyLoader.loadModule(getClass().getResource("sca.module").toString()); - module.initialize(modelContext); - - Assert.assertTrue(module.getName().equals("tuscany.binding.axis.assembly.tests.bigbank.account")); - - Component component = module.getComponent("AccountServiceComponent"); - Assert.assertTrue(component != null); - - EntryPoint entryPoint = module.getEntryPoint("AccountService"); - Assert.assertTrue(entryPoint != null); - - ExternalService externalService = module.getExternalService("StockQuoteService"); - Assert.assertTrue(externalService != null); - - Binding binding = externalService.getBindings().get(0); - Assert.assertTrue(binding instanceof WebServiceBinding); - } - - protected void setUp() throws Exception { - super.setUp(); - - Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountReport.java b/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountReport.java deleted file mode 100644 index 6ac32e9c9a..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountReport.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.assembly.tests.bigbank.account.services.account; - -import java.util.List; - -/** - * @model - */ - -public interface AccountReport { - - /** - * @model type="services.account.AccountSummary" - */ - - List getAccountSummaries(); -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountService.java b/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountService.java deleted file mode 100644 index 58f842878d..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountService.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.assembly.tests.bigbank.account.services.account; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface AccountService { - - public AccountReport getAccountReport(String customerID); -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountServiceImpl.java b/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountServiceImpl.java deleted file mode 100644 index 91fd5e0164..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountServiceImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.assembly.tests.bigbank.account.services.account; - -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Reference; - -import org.apache.tuscany.binding.axis.assembly.tests.bigbank.account.services.accountdata.AccountDataService; -import org.apache.tuscany.binding.axis.assembly.tests.bigbank.account.services.stockquote.StockQuoteService; - -public class AccountServiceImpl implements AccountService { - - @Property - public String currency = "USD"; - - @Reference - public AccountDataService accountDataService; - @Reference - public StockQuoteService stockQuoteService; - - public AccountServiceImpl() { - } - - public AccountReport getAccountReport(String customerID) { - return null; - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountSummary.java b/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountSummary.java deleted file mode 100644 index 85825013a2..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountSummary.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.assembly.tests.bigbank.account.services.account; - -/** - * @model - */ - -public interface AccountSummary { - - /** - * @model - */ - String getAccountNumber(); - - void setAccountNumber(String accountNumber); - - /** - * @model - */ - String getAccountType(); - - void setAccountType(String accountType); - - /** - * @model - */ - float getBalance(); - - void setBalance(float balance); -} - diff --git a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java b/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java deleted file mode 100644 index 4242d2fcc7..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.assembly.tests.bigbank.account.services.accountdata; - -public interface AccountDataService { - - CheckingAccount getCheckingAccount(String customerID); - - SavingsAccount getSavingsAccount(String customerID); - - StockAccount getStockAccount(String customerID); -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java b/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java deleted file mode 100644 index 66ae034d9a..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.assembly.tests.bigbank.account.services.accountdata; - -public class AccountDataServiceImpl implements AccountDataService { - - public CheckingAccount getCheckingAccount(String customerID) { - - CheckingAccount checkingAccount = new CheckingAccount(); - checkingAccount.setAccountNumber(customerID + "_" + "CHA12345"); - checkingAccount.setBalance(1500.0f); - - return checkingAccount; - } - - public SavingsAccount getSavingsAccount(String customerID) { - - SavingsAccount savingsAccount = new SavingsAccount(); - savingsAccount.setAccountNumber(customerID + "_" + "SAA12345"); - savingsAccount.setBalance(1500.0f); - - return savingsAccount; - } - - public StockAccount getStockAccount(String customerID) { - - StockAccount stockAccount = new StockAccount(); - stockAccount.setAccountNumber(customerID + "_" + "STA12345"); - stockAccount.setSymbol("IBM"); - stockAccount.setQuantity(100); - - return stockAccount; - } -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java b/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java deleted file mode 100644 index 6c48b7120a..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.assembly.tests.bigbank.account.services.accountdata; - -public class CheckingAccount { - - private String accountNumber; - private float balance; - - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - - public float getBalance() { - return balance; - } - - public void setBalance(float balance) { - this.balance = balance; - } -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java b/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java deleted file mode 100644 index 718145feb5..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.assembly.tests.bigbank.account.services.accountdata; - -public class SavingsAccount { - - private String accountNumber; - private float balance; - - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - - public float getBalance() { - return balance; - } - - public void setBalance(float balance) { - this.balance = balance; - } -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/accountdata/StockAccount.java b/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/accountdata/StockAccount.java deleted file mode 100644 index 05f7644d80..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/accountdata/StockAccount.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.assembly.tests.bigbank.account.services.accountdata; - -public class StockAccount { - - private String accountNumber; - private String symbol; - private int quantity; - - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - - public int getQuantity() { - return quantity; - } - - public void setQuantity(int quantity) { - this.quantity = quantity; - } - - public String getSymbol() { - return symbol; - } - - public void setSymbol(String symbol) { - this.symbol = symbol; - } -} diff --git a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java b/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java deleted file mode 100644 index a1c8f131a1..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis.assembly.tests.bigbank.account.services.stockquote; - -public interface StockQuoteService { - - public float getQuote(String symbol); -} - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountService.wsdl b/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountService.wsdl deleted file mode 100644 index 921218c5b9..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountService.wsdl +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl b/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl deleted file mode 100644 index 9678d9d6ea..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/sca.module b/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/sca.module deleted file mode 100644 index 7057907864..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/sca.module +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - AccountExternalService - - - - - - AccountExternalService - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/mediator/tests/DocLit.wsdl b/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/mediator/tests/DocLit.wsdl deleted file mode 100644 index 4aec526803..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/mediator/tests/DocLit.wsdl +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/mediator/tests/DocLitWrapped.wsdl b/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/mediator/tests/DocLitWrapped.wsdl deleted file mode 100644 index 7839d3ea71..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/mediator/tests/DocLitWrapped.wsdl +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/mediator/tests/RpcLit.wsdl b/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/mediator/tests/RpcLit.wsdl deleted file mode 100644 index 8f94f9c66f..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/mediator/tests/RpcLit.wsdl +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/mediator/tests/sca.module b/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/mediator/tests/sca.module deleted file mode 100644 index 7d8bb7861f..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/mediator/tests/sca.module +++ /dev/null @@ -1,20 +0,0 @@ - - - - - diff --git a/tags/java-stable-20060304/sca/binding.axis2/LICENSE.txt b/tags/java-stable-20060304/sca/binding.axis2/LICENSE.txt deleted file mode 100644 index 75b52484ea..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/LICENSE.txt +++ /dev/null @@ -1,202 +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/tags/java-stable-20060304/sca/binding.axis2/pom.xml b/tags/java-stable-20060304/sca/binding.axis2/pom.xml deleted file mode 100644 index 813a1765de..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/pom.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - org.apache.tuscany - tuscany-sca - SNAPSHOT - - 4.0.0 - tuscany-binding-axis2 - Tuscany Axis2 Binding - Implementation of the SCA Web Services binding using Axis2. - SNAPSHOT - - - - jeremy - http://people.apache.org/~jboynes/maven2 - - true - - - - - - - org.apache.tuscany - tuscany-core - ${pom.version} - compile - - - - axis2 - axis2-core - 0.94 - compile - - - - ws-commons - ws-policy - SNAPSHOT - runtime - - - - commons-httpclient - commons-httpclient - 3.0 - runtime - - - - commons-codec - commons-codec - 1.3 - runtime - - - - axis - axis-wsdl4j - 1.2 - - - - - stax - stax-api - 1.0 - compile - - - - woodstox - wstx-asl - 2.8.2 - runtime - - - - log4j - log4j - 1.2.12 - runtime - - - - - - tomcat - servlet-api - 5.0.18 - provided - - - - - diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceAssemblyFactory.java b/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceAssemblyFactory.java deleted file mode 100644 index 2906435ac4..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceAssemblyFactory.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.assembly; - -import org.apache.tuscany.model.assembly.AssemblyFactory; - -/** - * The Factory for the model. - */ -public interface WebServiceAssemblyFactory extends AssemblyFactory { - - /** - * Returns a new WebServiceBinding. - */ - WebServiceBinding createWebServiceBinding(); - -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceBinding.java b/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceBinding.java deleted file mode 100644 index 6eabebd358..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceBinding.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.assembly; - -import javax.wsdl.Definition; -import javax.wsdl.Port; - -import org.apache.tuscany.model.assembly.Binding; - -/** - * Represents a Web service binding. - */ -public interface WebServiceBinding extends Binding { - - /** - * Returns the WSDL port defining this binding. - */ - Port getWSDLPort(); - - /** - * Returns the WSDL definition containing the WSDL port. - * @return - */ - Definition getWSDLDefinition(); - - /** - * Sets the WSDL port defining this binding. - */ - void setWSDLPort(Port value); - - /** - * Sets the WSDL definition containing the WSDL port. - * @param definition - */ - void setWSDLDefinition(Definition definition); - -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceAssemblyFactoryImpl.java b/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceAssemblyFactoryImpl.java deleted file mode 100644 index 7840ebf6ef..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceAssemblyFactoryImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.assembly.impl; - -import org.apache.tuscany.binding.axis2.assembly.WebServiceAssemblyFactory; -import org.apache.tuscany.binding.axis2.assembly.WebServiceBinding; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; - -/** - * An implementation of the model Factory. - */ -public class WebServiceAssemblyFactoryImpl extends AssemblyFactoryImpl implements WebServiceAssemblyFactory { - - /** - * Creates an instance of the factory. - */ - public WebServiceAssemblyFactoryImpl() { - super(); - } - - /** - * @see org.apache.tuscany.binding.axis2.assembly.WebServiceAssemblyFactory#createWebServiceBinding() - */ - public WebServiceBinding createWebServiceBinding() { - return new WebServiceBindingImpl(); - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceBindingImpl.java b/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceBindingImpl.java deleted file mode 100644 index d89055ff73..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceBindingImpl.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.assembly.impl; - -import java.util.Collection; -import java.util.List; - -import javax.wsdl.Definition; -import javax.wsdl.Port; -import javax.wsdl.Service; - -import org.apache.tuscany.binding.axis2.assembly.WebServiceBinding; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.impl.BindingImpl; - -/** - * An implementation of WebServiceBinding. - */ -public class WebServiceBindingImpl extends BindingImpl implements WebServiceBinding { - - private Definition definition; - private Port port; - private String portURI; - - /** - * Constructor - */ - protected WebServiceBindingImpl() { - } - - /** - * @see org.apache.tuscany.binding.axis2.assembly.WebServiceBinding#getWSDLPort() - */ - public Port getWSDLPort() { - return port; - } - - /** - * @see org.apache.tuscany.binding.axis2.assembly.WebServiceBinding#setWSDLPort(javax.wsdl.Port) - */ - public void setWSDLPort(Port value) { - checkNotFrozen(); - this.port=value; - } - - /** - * @see org.apache.tuscany.binding.axis2.assembly.WebServiceBinding#getWSDLDefinition() - */ - public Definition getWSDLDefinition() { - return definition; - } - - /** - * @see org.apache.tuscany.binding.axis2.assembly.WebServiceBinding#setWSDLDefinition(javax.wsdl.Definition) - */ - public void setWSDLDefinition(Definition definition) { - checkNotFrozen(); - this.definition=definition; - } - - /** - * @param portURI The portURI to set. - */ - public void setPortURI(String portURI) { - this.portURI = portURI; - } - - /** - * @see org.apache.tuscany.model.assembly.impl.BindingImpl#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) - */ - public void initialize(AssemblyModelContext modelContext) { - if (isInitialized()) - return; - super.initialize(modelContext); - - // Get the WSDL port namespace and name - if (port==null && portURI!=null) { - int h=portURI.indexOf('#'); - String portNamespace=portURI.substring(0,h); - String portName=portURI.substring(h+1); - - // Load the WSDL definitions for the given namespace - List definitions=modelContext.getAssemblyLoader().loadDefinitions(portNamespace); - if (definitions==null) - throw new IllegalArgumentException("Cannot find WSDL definition for "+portNamespace); - for (Definition definition: definitions) { - - // Find the port with the given name - for (Service service : (Collection)definition.getServices().values()) { - Port port=service.getPort(portName); - if (port!=null) { - this.definition=definition; - this.port=port; - return; - } - } - } - throw new IllegalArgumentException("Cannot find WSDL port "+portURI); - } - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceConfigurationBuilder.java b/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceConfigurationBuilder.java deleted file mode 100644 index bae333ad85..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceConfigurationBuilder.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.builder; - -import java.lang.reflect.Method; -import java.util.Collection; -import java.util.Map; -import java.util.Set; - -import org.apache.tuscany.binding.axis2.assembly.WebServiceBinding; -import org.apache.tuscany.binding.axis2.config.ExternalWebServiceRuntimeConfiguration; -import org.apache.tuscany.binding.axis2.handler.ExternalWebServiceClient; -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.config.JavaIntrospectionHelper; -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.injection.SingletonObjectFactory; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.MethodHashMap; -import org.apache.tuscany.core.invocation.ProxyConfiguration; -import org.apache.tuscany.core.invocation.impl.InvokerInterceptor; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.invocation.spi.ProxyFactoryFactory; -import org.apache.tuscany.core.message.MessageFactory; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.ExternalService; -import org.apache.tuscany.model.assembly.Service; -import org.apache.tuscany.model.assembly.ServiceContract; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -import commonj.sdo.helper.TypeHelper; - -/** - * Creates a RuntimeConfigurationBuilder for an external service configured with the {@link WebServiceBinding} - * - * @version $Rev$ $Date$ - */ -@Scope("MODULE") -public class ExternalWebServiceConfigurationBuilder implements RuntimeConfigurationBuilder { - - private RuntimeContext runtimeContext; - - private ProxyFactoryFactory proxyFactoryFactory; - - private MessageFactory messageFactory; - - private RuntimeConfigurationBuilder policyBuilder; - - public ExternalWebServiceConfigurationBuilder() { - } - - @Init(eager = true) - public void init() { - runtimeContext.addBuilder(this); - } - - /** - * @param runtimeContext The runtimeContext to set. - */ - @Autowire - public void setRuntimeContext(RuntimeContext runtimeContext) { - this.runtimeContext = runtimeContext; - } - - /** - * Sets the factory used to construct proxies implmementing the business interface required by a reference - */ - @Autowire - public void setProxyFactoryFactory(ProxyFactoryFactory factory) { - this.proxyFactoryFactory = factory; - } - - /** - * Sets the factory used to construct invocation messages - * - * @param msgFactory - */ - @Autowire - public void setMessageFactory(MessageFactory msgFactory) { - this.messageFactory = msgFactory; - } - - /** - * Sets a builder responsible for creating source-side and target-side invocation chains for a reference. The - * reference builder may be hierarchical, containing other child reference builders that operate on specific - * metadata used to construct and invocation chain. - * - * @see org.apache.tuscany.core.builder.impl.HierarchicalBuilder - */ - public void setPolicyBuilder(RuntimeConfigurationBuilder builder) { - policyBuilder = builder; - } - - public void build(AssemblyModelObject object, Context context) throws BuilderException { - if (!(object instanceof ExternalService)) { - return; - } - ExternalService externalService = (ExternalService) object; - if (externalService.getBindings().size() < 1 || !(externalService.getBindings().get(0) instanceof WebServiceBinding)) { - return; - } - - WebServiceBinding wsBinding=(WebServiceBinding)externalService.getBindings().get(0); - - TypeHelper typeHelper=externalService.getAggregate().getAssemblyModelContext().getTypeHelper(); - ExternalWebServiceClient externalWebServiceClient=new ExternalWebServiceClient(externalService, wsBinding, typeHelper); - ExternalWebServiceRuntimeConfiguration config = new ExternalWebServiceRuntimeConfiguration(externalService.getName(), new SingletonObjectFactory(externalWebServiceClient)); - - ConfiguredService configuredService = externalService.getConfiguredService(); - Service service = configuredService.getService(); - ServiceContract serviceContract = service.getServiceContract(); - Map iConfigMap = new MethodHashMap(); - ProxyFactory proxyFactory = proxyFactoryFactory.createProxyFactory(); - Set javaMethods = JavaIntrospectionHelper.getAllUniqueMethods(serviceContract.getInterface()); - for (Method method : javaMethods) { - InvocationConfiguration iConfig = new InvocationConfiguration(method); - iConfigMap.put(method, iConfig); - } - QualifiedName qName = new QualifiedName(externalService.getName() + "/" + service.getName()); - ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, serviceContract.getInterface().getClassLoader(), messageFactory); - proxyFactory.setBusinessInterface(serviceContract.getInterface()); - proxyFactory.setProxyConfiguration(pConfiguration); - config.addTargetProxyFactory(service.getName(), proxyFactory); - configuredService.setProxyFactory(proxyFactory); - if (policyBuilder != null) { - // invoke the reference builder to handle additional policy metadata - policyBuilder.build(configuredService, context); - } - // add tail interceptor - for (InvocationConfiguration iConfig : (Collection) iConfigMap.values()) { - iConfig.addTargetInterceptor(new InvokerInterceptor()); - } - - externalService.getConfiguredService().setRuntimeConfiguration(config); - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceWireBuilder.java b/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceWireBuilder.java deleted file mode 100644 index 4daf167d74..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceWireBuilder.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.apache.tuscany.binding.axis2.builder; - -import org.apache.tuscany.binding.axis2.config.ExternalWebServiceRuntimeConfiguration; -import org.apache.tuscany.binding.axis2.handler.ExternalWebServiceTargetInvoker; -import org.apache.tuscany.core.builder.BuilderConfigException; -import org.apache.tuscany.core.builder.WireBuilder; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -@Scope("MODULE") -public class ExternalWebServiceWireBuilder implements WireBuilder { - - private RuntimeContext runtimeContext; - - /** - * Constructs a new ExternalWebServiceWireBuilder. - */ - public ExternalWebServiceWireBuilder() { - super(); - } - - @Autowire - public void setRuntimeContext(RuntimeContext context) { - runtimeContext = context; - } - - @Init(eager=true) - public void init() { - runtimeContext.addBuilder(this); - } - - public void connect(ProxyFactory sourceFactory, ProxyFactory targetFactory, Class targetType, boolean downScope, ScopeContext targetScopeContext) throws BuilderConfigException { - if (!(ExternalWebServiceRuntimeConfiguration.class.isAssignableFrom(targetType))) { - return; - } - for (InvocationConfiguration sourceInvocationConfig : sourceFactory.getProxyConfiguration().getInvocationConfigurations().values()) { - - ExternalWebServiceTargetInvoker invoker = new ExternalWebServiceTargetInvoker(sourceFactory.getProxyConfiguration().getTargetName(), sourceInvocationConfig.getMethod(), targetScopeContext); - - // if (downScope) { - // // the source scope is shorter than the target, so the invoker can cache the target instance - // invoker.setCacheable(true); - // } else { - // invoker.setCacheable(false); - // } - sourceInvocationConfig.setTargetInvoker(invoker); - } - - } - - public void completeTargetChain(ProxyFactory targetFactory, Class targetType, ScopeContext targetScopeContext) - throws BuilderConfigException { - //TODO implement - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/WebServiceEntryPointConfigurationBuilder.java b/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/WebServiceEntryPointConfigurationBuilder.java deleted file mode 100644 index a164f5bc44..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/WebServiceEntryPointConfigurationBuilder.java +++ /dev/null @@ -1,170 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.builder; - -import java.lang.reflect.Method; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import org.apache.tuscany.binding.axis2.assembly.WebServiceBinding; -import org.apache.tuscany.binding.axis2.config.WebServiceEntryPointRuntimeConfiguration; -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.builder.impl.EntryPointRuntimeConfiguration; -import org.apache.tuscany.core.config.JavaIntrospectionHelper; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.invocation.Interceptor; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.InvocationRuntimeException; -import org.apache.tuscany.core.invocation.ProxyConfiguration; -import org.apache.tuscany.core.invocation.TargetInvoker; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.invocation.spi.ProxyFactoryFactory; -import org.apache.tuscany.core.message.Message; -import org.apache.tuscany.core.message.MessageFactory; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.Service; -import org.apache.tuscany.model.assembly.ServiceContract; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -/** - * Creates a RuntimeConfigurationBuilder for an entry point configured with the {@link WebServiceBinding} - * - * @version $Rev$ $Date$ - */ -@Scope("MODULE") -public class WebServiceEntryPointConfigurationBuilder implements RuntimeConfigurationBuilder { - - private RuntimeContext runtimeContext; - - private ProxyFactoryFactory proxyFactoryFactory; - - private MessageFactory messageFactory; - - private RuntimeConfigurationBuilder policyBuilder; - - public WebServiceEntryPointConfigurationBuilder() { - } - - @Init(eager = true) - public void init() { - runtimeContext.addBuilder(this); - } - - /** - * @param runtimeContext The runtimeContext to set. - */ - @Autowire - public void setRuntimeContext(RuntimeContext runtimeContext) { - this.runtimeContext = runtimeContext; - } - - /** - * Sets the factory used to construct proxies implmementing the business interface required by a reference - */ - @Autowire - public void setProxyFactoryFactory(ProxyFactoryFactory factory) { - this.proxyFactoryFactory = factory; - } - - /** - * Sets the factory used to construct invocation messages - * - * @param msgFactory - */ - @Autowire - public void setMessageFactory(MessageFactory msgFactory) { - this.messageFactory = msgFactory; - } - - /** - * Sets a builder responsible for creating source-side and target-side invocation chains for a reference. The - * reference builder may be hierarchical, containing other child reference builders that operate on specific - * metadata used to construct and invocation chain. - * - * @see org.apache.tuscany.core.builder.impl.HierarchicalBuilder - */ - public void setPolicyBuilder(RuntimeConfigurationBuilder builder) { - policyBuilder = builder; - } - - public void build(AssemblyModelObject object, AggregateContext parentContext) throws BuilderException { - if (!(object instanceof EntryPoint)) { - return; - } - EntryPoint entryPoint = (EntryPoint) object; - if (entryPoint.getBindings().size() < 1 || !(entryPoint.getBindings().get(0) instanceof WebServiceBinding)) { - return; - } - - EntryPointRuntimeConfiguration config = new WebServiceEntryPointRuntimeConfiguration(entryPoint.getName(), entryPoint.getConfiguredService().getService().getName(), messageFactory); - - ConfiguredService configuredService = entryPoint.getConfiguredService(); - Service service = configuredService.getService(); - ServiceContract serviceContract = service.getServiceContract(); - Map iConfigMap = new HashMap(); - ProxyFactory proxyFactory = proxyFactoryFactory.createProxyFactory(); - Set javaMethods = JavaIntrospectionHelper.getAllUniqueMethods(serviceContract.getInterface()); - for (Method method : javaMethods) { - InvocationConfiguration iConfig = new InvocationConfiguration(method); - iConfigMap.put(method, iConfig); - } - QualifiedName qName = new QualifiedName(entryPoint.getConfiguredReference().getTargetConfiguredServices().get(0).getAggregatePart().getName() + "/" + service.getName()); - ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, serviceContract.getInterface().getClassLoader(), messageFactory); - proxyFactory.setBusinessInterface(serviceContract.getInterface()); - proxyFactory.setProxyConfiguration(pConfiguration); - config.addSourceProxyFactory(service.getName(), proxyFactory); - configuredService.setProxyFactory(proxyFactory); - if (policyBuilder != null) { - // invoke the reference builder to handle additional policy metadata - policyBuilder.build(configuredService, parentContext); - } - // add tail interceptor - for (InvocationConfiguration iConfig : (Collection) iConfigMap.values()) { - iConfig.addTargetInterceptor(new EntryPointInvokerInterceptor()); - } - entryPoint.getConfiguredReference().setRuntimeConfiguration(config); - } - - //FIXME same as the InvokerInterceptor except that it doesn't throw an exception in setNext - // For some reason another InvokerInterceptor is added after this one, need Jim to look into it - // and figure out why. - public class EntryPointInvokerInterceptor implements Interceptor { - - public EntryPointInvokerInterceptor() { - } - - public Message invoke(Message msg) throws InvocationRuntimeException { - TargetInvoker invoker = msg.getTargetInvoker(); - if (invoker == null) { - throw new InvocationRuntimeException("No target invoker specified on message"); - } - return invoker.invoke(msg); - } - - public void setNext(Interceptor next) { - } - - } - - -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/ExternalWebServiceRuntimeConfiguration.java b/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/ExternalWebServiceRuntimeConfiguration.java deleted file mode 100644 index c776e861e2..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/ExternalWebServiceRuntimeConfiguration.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.config; - -import org.apache.tuscany.core.builder.ObjectFactory; -import org.apache.tuscany.core.builder.impl.BaseExternalServiceRuntimeConfiguration; - -/** - * Creates instances of {@link org.apache.tuscany.core.context.ExternalServiceContext} configured with the appropriate - * invocation chains and bindings. This implementation serves as a marker for - * {@link org.apache.tuscany.binding.axis2.builder.ExternalWebServiceWireBuilder} - * - * @version $Rev$ $Date$ - */ -public class ExternalWebServiceRuntimeConfiguration extends BaseExternalServiceRuntimeConfiguration { - - public ExternalWebServiceRuntimeConfiguration(String name, ObjectFactory objectFactory) { - super(name, objectFactory); - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/WebServiceEntryPointRuntimeConfiguration.java b/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/WebServiceEntryPointRuntimeConfiguration.java deleted file mode 100644 index 3038fa258e..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/WebServiceEntryPointRuntimeConfiguration.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.config; - -import org.apache.tuscany.core.builder.impl.EntryPointRuntimeConfiguration; -import org.apache.tuscany.core.message.MessageFactory; - -/** - * Creates instances of {@link org.apache.tuscany.core.context.EntryPointContext} configured with the appropriate - * invocation chains and bindings. This implementation serves as a marker for - * {@link org.apache.tuscany.binding.axis2.builder.WebServiceEntryPointWireBuilder} - * - * @version $Rev$ $Date$ - */ -public class WebServiceEntryPointRuntimeConfiguration extends EntryPointRuntimeConfiguration { - - public WebServiceEntryPointRuntimeConfiguration(String name, String serviceName, MessageFactory messageFactory) { - super(name, serviceName, messageFactory); - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/ExternalWebServiceClient.java b/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/ExternalWebServiceClient.java deleted file mode 100644 index 39bd26f72d..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/ExternalWebServiceClient.java +++ /dev/null @@ -1,143 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.handler; - -import java.lang.reflect.Method; - -import javax.xml.namespace.QName; -import javax.xml.parsers.FactoryConfigurationError; - -import org.apache.axis2.AxisFault; -import org.apache.axis2.Constants; -import org.apache.axis2.addressing.EndpointReference; -import org.apache.axis2.client.Options; -import org.apache.axis2.client.ServiceClient; -import org.apache.axis2.context.MessageContextConstants; -import org.apache.axis2.om.OMElement; -import org.apache.tuscany.binding.axis2.assembly.WebServiceBinding; -import org.apache.tuscany.binding.axis2.util.AxiomHelper; -import org.apache.tuscany.model.assembly.ExternalService; -import org.osoa.sca.ServiceRuntimeException; - -import commonj.sdo.helper.TypeHelper; - -/** - * An ExternalWebServiceClient using Axis2 - */ -public class ExternalWebServiceClient { - - private ExternalService externalService; - private TypeHelper typeHelper; - private WebServicePortMetaData wsPortMetaData; - - /** - * Constructs a new ExternalWebServiceClient. - * - * @param externalService - * @param wsBinding - */ - public ExternalWebServiceClient(ExternalService externalService, WebServiceBinding wsBinding, TypeHelper typeHelper) { - this.externalService = externalService; - this.typeHelper=typeHelper; - this.wsPortMetaData = new WebServicePortMetaData(wsBinding.getWSDLDefinition(), wsBinding.getWSDLPort(), wsBinding.getURI(), false); - } - - /** - * Invoke an operation on the external Web service. - * - * @param method - * @param args - * @return - */ - public Object invoke(Method method, Object[] args) { - - ServiceClient serviceClient; - ClassLoader ccl=Thread.currentThread().getContextClassLoader(); - try { - Thread.currentThread().setContextClassLoader(ExternalWebServiceClient.class.getClassLoader()); - - serviceClient = createServiceClient(method); - - } finally { - Thread.currentThread().setContextClassLoader(ccl); - } - - String typeName = method.getName(); - String typeNS = wsPortMetaData.getPortType().getQName().getNamespaceURI(); - - OMElement requestOM = AxiomHelper.toOMElement(typeHelper, args, new QName(typeNS, typeName)); - - OMElement responseOM; - ccl=Thread.currentThread().getContextClassLoader(); - try { - Thread.currentThread().setContextClassLoader(ExternalWebServiceClient.class.getClassLoader()); - - responseOM = serviceClient.sendReceive(requestOM); - - } catch (AxisFault e) { - throw new ServiceRuntimeException(e); - } finally { - Thread.currentThread().setContextClassLoader(ccl); - } - - Object[] os = AxiomHelper.toObjects(typeHelper, responseOM); - Object response; - if (os == null || os.length < 1) { - response = null; - } else { - response = os[0]; - } - - return response; - } - - private ServiceClient createServiceClient(Method method) throws FactoryConfigurationError { - - /* - * TODO: Simlistic impl for now, needs to be redone. Should cache our ConfigurationContext and pass in on ServiceClient constructor, should - * probably use WSDL configured Axis2 OperationClient - */ - - Options options = new Options(); - - options.setProperty(Constants.Configuration.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.TRUE); - - WebServiceOperationMetaData operationMetaData = wsPortMetaData.getOperationMetaData(method.getName()); - - EndpointReference targetEPR = new EndpointReference(wsPortMetaData.getEndpoint()); - options.setTo(targetEPR); - - String soapAction = operationMetaData.getSOAPAction(); - if (soapAction != null) { - options.setSoapAction(soapAction); - } - - // If use is encoded assume its an old style service and wont understand chunking - if ("encoded".equals(operationMetaData.getUse())) { - options.setProperty(MessageContextConstants.CHUNKED, Boolean.FALSE); - } - - ServiceClient serviceClient; - try { - serviceClient = new ServiceClient(); - } catch (org.apache.axis2.AxisFault e) { - throw new RuntimeException(e); - } - - serviceClient.setOptions(options); - - return serviceClient; - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/ExternalWebServiceTargetInvoker.java b/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/ExternalWebServiceTargetInvoker.java deleted file mode 100644 index fcb2e2e944..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/ExternalWebServiceTargetInvoker.java +++ /dev/null @@ -1,110 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.handler; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import org.apache.tuscany.core.context.ExternalServiceContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.context.TargetException; -import org.apache.tuscany.core.invocation.Interceptor; -import org.apache.tuscany.core.invocation.TargetInvoker; -import org.apache.tuscany.core.message.Message; - -/** - * Responsible for invoking an external web service - * - * @version $Rev$ $Date$ - */ -public class ExternalWebServiceTargetInvoker implements TargetInvoker { - - private QualifiedName serviceName; - private String esName; - private Method method; - private ScopeContext container; - - private ExternalServiceContext context; - - /** - * Constructs a new ExternalWebServiceTargetInvoker. - * @param esName - * @param container - */ - public ExternalWebServiceTargetInvoker(QualifiedName serviceName, Method method, ScopeContext container) { - assert (serviceName != null) : "No service name specified"; - assert (method != null) : "No method specified"; - assert (container != null) : "No scope container specified"; - this.serviceName = serviceName; - this.esName=serviceName.getPartName(); - this.method = method; - this.container = container; - } - - public Object invokeTarget(Object payload) throws InvocationTargetException { - if (context == null) { - InstanceContext iContext = container.getContext(esName); - if (!(iContext instanceof ExternalServiceContext)) { - TargetException te = new TargetException("Unexpected target context type"); - te.setIdentifier(iContext.getClass().getName()); - te.addContextName(iContext.getName()); - throw te; - } - context = (ExternalServiceContext) iContext; - } - ExternalWebServiceClient client = (ExternalWebServiceClient) context.getImplementationInstance(true); - if (payload != null) { - return client.invoke(method, (Object[])payload); - } else { - return client.invoke(method, null); - } - } - - public boolean isCacheable() { - return false; - } - - public Message invoke(Message msg) { - try { - Object resp = invokeTarget(msg.getBody()); - msg.setBody(resp); - } catch (InvocationTargetException e) { - msg.setBody(e.getCause()); - } catch (Throwable e) { - msg.setBody(e); - } - return msg; - } - - public void setNext(Interceptor next) { - throw new UnsupportedOperationException(); - } - - public Object clone() { - try { - ExternalWebServiceTargetInvoker invoker = (ExternalWebServiceTargetInvoker) super.clone(); - invoker.container = container; - invoker.context = this.context; - invoker.esName = this.esName; - invoker.method = this.method; - invoker.serviceName = this.serviceName; - return invoker; - } catch (CloneNotSupportedException e) { - return null; // will not happen - } - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/WebServiceEntryPointInOutSyncMessageReceiver.java b/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/WebServiceEntryPointInOutSyncMessageReceiver.java deleted file mode 100644 index f0f49d5654..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/WebServiceEntryPointInOutSyncMessageReceiver.java +++ /dev/null @@ -1,177 +0,0 @@ -package org.apache.tuscany.binding.axis2.handler; - -import java.io.IOException; -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.ListIterator; - -import javax.wsdl.Part; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; - -import org.apache.axis2.AxisFault; -import org.apache.axis2.context.MessageContext; -import org.apache.axis2.context.OperationContext; -import org.apache.axis2.description.AxisOperation; -import org.apache.axis2.engine.MessageReceiver; -import org.apache.axis2.om.OMAbstractFactory; -import org.apache.axis2.om.OMDocument; -import org.apache.axis2.om.OMElement; -import org.apache.axis2.om.OMFactory; -import org.apache.axis2.om.OMNamespace; -import org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver; -import org.apache.axis2.soap.SOAPBody; -import org.apache.axis2.soap.SOAPEnvelope; -import org.apache.axis2.soap.SOAPFactory; -import org.apache.tuscany.binding.axis2.util.AxiomHelper; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EntryPointContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.sdo.helper.TypeHelperImpl; -import org.apache.tuscany.sdo.util.SDOUtil; -import org.apache.wsdl.WSDLConstants; -import org.eclipse.emf.common.util.UniqueEList; - -import commonj.sdo.DataObject; -import commonj.sdo.Property; -import commonj.sdo.Sequence; -import commonj.sdo.Type; -import commonj.sdo.helper.TypeHelper; - -public class WebServiceEntryPointInOutSyncMessageReceiver extends AbstractInOutSyncMessageReceiver { - // public static final String MEP_URL = "http://www.w3.org/2004/08/wsdl/tuscany/in-out"; - public static final String MEP_URL = WSDLConstants.MEP_URI_OUT_IN; - - protected final AggregateContext moduleContext; - - protected final EntryPoint entryPoint; - protected final EntryPointContext entryPointContext; - - private final WebServicePortMetaData wsdlPortInfo; - - /** - * Field log - */ - - /** - * Constructor WebServiceEntryPointInOutSyncMessageReceiver - * - * @param entryPoint - * @param moduleContext - * @param context - * @param wsdlPortInfo - */ - public WebServiceEntryPointInOutSyncMessageReceiver(AggregateContext moduleContext, EntryPoint entryPoint, EntryPointContext context, WebServicePortMetaData wsdlPortInfo) { - this.moduleContext = moduleContext; - this.entryPoint = entryPoint; - this.entryPointContext= context; - this.wsdlPortInfo = wsdlPortInfo; - } - - public void invokeBusinessLogic(MessageContext msgContext, MessageContext outMsgContext) throws AxisFault { - - ClassLoader ccl=Thread.currentThread().getContextClassLoader(); - try { - Thread.currentThread().setContextClassLoader(entryPoint.getAggregate().getAssemblyModelContext().getApplicationResourceLoader().getClassLoader()); - - AxisOperation axisOperation = msgContext.getAxisOperation(); - String axisOperationName= axisOperation.getName().getLocalPart(); - - TypeHelper typeHelper=entryPoint.getAggregate().getAssemblyModelContext().getTypeHelper(); - - OMElement requestOM = msgContext.getEnvelope().getBody().getFirstElement(); - DataObject msgdo = AxiomHelper.toDataObject(typeHelper, requestOM); - // Sequence parmSeq = msgdo.getSequence("mixed"); - - requestOM = msgContext.getEnvelope().getBody().getFirstElement(); - Object[] args = AxiomHelper.toObjects(typeHelper, requestOM); - - - - -// ArrayList parms = new ArrayList(parmSeq.size()); -// for (int i = 0; i < parmSeq.size(); ++i) { -// Object parmDO = (Object) parmSeq.getValue(i);// parm element -// if (parmDO instanceof DataObject) { -// -// Sequence nn = ((DataObject) parmDO).getSequence("mixed"); -// -// for (int j = 0; j < nn.size(); j++) { -// -// Object valueDO = (Object) nn.getValue(j); // data array s -// if (valueDO instanceof DataObject) { -// -// Sequence seqVal = ((DataObject) valueDO).getSequence("mixed"); -// Object seqDO = seqVal.getValue(0); -// if (seqDO instanceof String) { -// parms.add(seqDO); -// } else { -// parms.add(valueDO); // no sure if this is right? -// -// } -// } -// } -// } -// } -// Object[] args= parms.toArray(new Object[parms.size()]); - Class[] argsClazz= new Class[args.length]; - for(int i= args.length -1; i> -1; --i){ - argsClazz[i]= args[i].getClass(); - - } - Class clazz = entryPoint.getConfiguredService().getService().getServiceContract().getInterface(); - Method operationMethod= clazz.getMethod(axisOperationName, argsClazz); - - - InvocationHandler handler = (InvocationHandler) entryPointContext.getImplementationInstance(); - - - Object response = handler.invoke(null, operationMethod, args); - - - SOAPFactory fac = getSOAPFactory(msgContext); - SOAPEnvelope soapenv = fac.getDefaultEnvelope(); - SOAPBody soapbody = soapenv.getBody(); - //new SDO way.... - QName responseTypeQN = getResponseTypeName(operationMethod.getName()); - OMElement responseOM = AxiomHelper.toOMElement(typeHelper, new Object[] {response}, responseTypeQN); - soapbody.addChild(responseOM); - - - - //Endof new SDO way - - - - - - // se.addChild(sf.createText(response, true)); - outMsgContext.setEnvelope(soapenv); - // outMsgContext.setAxisOperation(axisOperation); - // outMsgContext.setAxisService(msgContext.getAxisService()); - - - } catch (Exception e) { - e.printStackTrace(); - throw new AxisFault("Error creating DataObject from Soapenvelope. " + e.getClass() + " " + e.getMessage(), e); - - } catch (Throwable e) { - - e.printStackTrace(); - throw new AxisFault("Error creating DataObject from Soapenvelope. " + e.getClass() + " " + e.getMessage(), e); - } finally { - Thread.currentThread().setContextClassLoader(ccl); - } - - } - protected QName getResponseTypeName(String operationName) { - WebServiceOperationMetaData op = wsdlPortInfo.getOperationMetaData(operationName); - Part part = op.getOutputPart(0); - QName elementName = part.getElementName(); - return elementName; - } - - -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/WebServiceEntryPointServlet.java b/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/WebServiceEntryPointServlet.java deleted file mode 100644 index cfcac3acdd..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/WebServiceEntryPointServlet.java +++ /dev/null @@ -1,480 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ - -package org.apache.tuscany.binding.axis2.handler; - -import java.io.File; -import java.io.IOException; -import java.io.OutputStream; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.wsdl.Definition; -import javax.wsdl.Operation; -import javax.wsdl.Port; -import javax.wsdl.PortType; -import javax.xml.namespace.QName; - -import org.apache.axis2.AxisFault; -import org.apache.axis2.Constants; -import org.apache.axis2.context.ConfigurationContext; -import org.apache.axis2.context.ConfigurationContextFactory; -import org.apache.axis2.context.MessageContext; -import org.apache.axis2.context.SessionContext; -import org.apache.axis2.description.AxisOperation; -import org.apache.axis2.description.AxisService; -import org.apache.axis2.description.AxisServiceGroup; -import org.apache.axis2.description.InOutAxisOperation; -import org.apache.axis2.engine.AxisConfiguration; -import org.apache.axis2.engine.AxisEngine; -import org.apache.axis2.transport.http.HTTPConstants; -import org.apache.axis2.transport.http.HTTPTransportUtils; -import org.apache.axis2.transport.http.ListingAgent; -import org.apache.axis2.transport.http.ServletBasedOutTransportInfo; -import org.apache.tuscany.binding.axis2.assembly.WebServiceBinding; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EntryPointContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.model.assembly.Binding; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.Module; - -/** - * Class AxisServlet - */ -public class WebServiceEntryPointServlet - extends HttpServlet -{ - - private static final long serialVersionUID = -2085869393709833372L; - - private static final String CONFIGURATION_CONTEXT = "CONFIGURATION_CONTEXT"; - - public static final String SESSION_ID = "SessionId"; - - private ConfigurationContext configContext; - - private AxisConfiguration axisConfiguration; - - private ListingAgent lister; - - private MessageContext createAndSetInitialParamsToMsgCtxt( Object sessionContext, MessageContext msgContext, - HttpServletResponse httpServletResponse, - HttpServletRequest httpServletRequest ) - throws AxisFault - { - msgContext = new MessageContext(); - msgContext.setConfigurationContext( configContext ); - msgContext.setSessionContext( (SessionContext) sessionContext ); - msgContext.setTransportIn( axisConfiguration.getTransportIn( new QName( Constants.TRANSPORT_HTTP ) ) ); - msgContext.setTransportOut( axisConfiguration.getTransportOut( new QName( Constants.TRANSPORT_HTTP ) ) ); - - msgContext.setProperty( Constants.OUT_TRANSPORT_INFO, new ServletBasedOutTransportInfo( httpServletResponse ) ); - msgContext.setProperty( MessageContext.TRANSPORT_HEADERS, getTransportHeaders( httpServletRequest ) ); - msgContext.setProperty( SESSION_ID, httpServletRequest.getSession().getId() ); - - return msgContext; - } - - public void destroy() - { - super.destroy(); - } - - /** - * Method doGet - * - * @param httpServletRequest - * @param httpServletResponse - * @throws ServletException - * @throws IOException - */ - protected void doGet( HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse ) - throws ServletException, IOException - { - MessageContext msgContext = null; - OutputStream out = null; - - try - { - Object sessionContext = getSessionContext( httpServletRequest ); - HashMap map = getHTTPParameters( httpServletRequest ); - - msgContext = createAndSetInitialParamsToMsgCtxt( sessionContext, msgContext, httpServletResponse, - httpServletRequest ); - msgContext.setDoingREST( true ); - msgContext.setServerSide( true ); - out = httpServletResponse.getOutputStream(); - - boolean processed = HTTPTransportUtils.processHTTPGetRequest( msgContext, httpServletRequest - .getInputStream(), out, httpServletRequest.getContentType(), httpServletRequest - .getHeader( HTTPConstants.HEADER_SOAP_ACTION ), httpServletRequest.getRequestURL().toString(), - configContext, map ); - - if ( !processed ) - { - lister.handle( httpServletRequest, httpServletResponse, out ); - } - } - catch ( AxisFault e ) - { - if ( msgContext != null ) - { - handleFault( msgContext, out, e ); - } - else - { - throw new ServletException( e ); - } - } - catch ( Exception e ) - { - throw new ServletException( e ); - } - } - - /* - * (non-Javadoc) - * @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) - */ - - /** - * Method doPost - * - * @param req - * @param res - * @throws ServletException - * @throws IOException - */ - protected void doPost( HttpServletRequest req, HttpServletResponse res ) - throws ServletException, IOException - { - MessageContext msgContext = null; - OutputStream out = null; - - ClassLoader tccl = Thread.currentThread().getContextClassLoader(); - ClassLoader mycl = getClass().getClassLoader(); - try - { - if ( tccl != mycl ) - { - Thread.currentThread().setContextClassLoader( mycl ); - } - Object sessionContext = getSessionContext( req ); - - msgContext = createAndSetInitialParamsToMsgCtxt( sessionContext, msgContext, res, req ); - - // adding ServletContext into msgContext; - msgContext.setProperty( Constants.SERVLET_CONTEXT, sessionContext ); - out = res.getOutputStream(); - HTTPTransportUtils.processHTTPPostRequest( msgContext, req.getInputStream(), out, req.getContentType(), req - .getHeader( HTTPConstants.HEADER_SOAP_ACTION ), req.getRequestURL().toString() ); - - Object contextWritten = msgContext.getOperationContext().getProperty( Constants.RESPONSE_WRITTEN ); - - res.setContentType( "text/xml; charset=" + msgContext.getProperty( MessageContext.CHARACTER_SET_ENCODING ) ); - - if ( ( contextWritten == null ) || !Constants.VALUE_TRUE.equals( contextWritten ) ) - { - res.setStatus( HttpServletResponse.SC_ACCEPTED ); - } - } - catch ( AxisFault e ) - { - if ( msgContext != null ) - { - res.setStatus( HttpServletResponse.SC_INTERNAL_SERVER_ERROR ); - handleFault( msgContext, out, e ); - } - else - { - throw new ServletException( e ); - } - } - finally - { - if ( tccl != mycl ) - { - Thread.currentThread().setContextClassLoader( tccl ); - } - } - } - - private void handleFault( MessageContext msgContext, OutputStream out, AxisFault e ) - throws AxisFault - { - msgContext.setProperty( MessageContext.TRANSPORT_OUT, out ); - - AxisEngine engine = new AxisEngine( configContext ); - MessageContext faultContext = engine.createFaultMessageContext( msgContext, e ); - - engine.sendFault( faultContext ); - } - - /** - * Method init - * - * @param config - * @throws ServletException - */ - public void init( ServletConfig config ) - throws ServletException - { - ClassLoader tccl = Thread.currentThread().getContextClassLoader(); - ClassLoader mycl = getClass().getClassLoader(); - try - { - if ( tccl != mycl ) - { - Thread.currentThread().setContextClassLoader( mycl ); - } - configContext = initConfigContext( config ); - initTuscany( configContext.getAxisConfiguration(), config ); - lister = new ListingAgent( configContext ); - axisConfiguration = configContext.getAxisConfiguration(); - config.getServletContext().setAttribute( CONFIGURATION_CONTEXT, configContext ); - } - catch ( Exception e ) - { - e.printStackTrace(); - throw new ServletException( e ); - } - finally - { - if ( tccl != mycl ) - { - Thread.currentThread().setContextClassLoader( tccl ); - } - } - } - - RuntimeContext getTuscanyWebAppRuntime( ServletConfig config ) - { - - Object ret = (RuntimeContext) ( config ).getServletContext() - .getAttribute( "org.apache.tuscany.core.runtime.RuntimeContext" ); - if ( !( ret instanceof RuntimeContext ) ) - { - RuntimeException rete = new RuntimeException( "Tuscany configuration not found! " - + ( ( ret == null ) ? "" : "unexpected class" + ret.getClass() ) ); - rete.printStackTrace();//pretty majar make sure something gets logged. - throw rete; - - } - return (RuntimeContext) ret; - } - - void initTuscany( final AxisConfiguration axisConfig, ServletConfig config ) - throws AxisFault - { - - // Register all the Web service entry points - RuntimeContext tuscanyRuntime = getTuscanyWebAppRuntime( config ); - - // Get the current SCA module context - - // AggregateContext moduleContext = (AggregateContext) tuscanyRuntime.getAggregate().getAssemblyModelContext();//getRootContext();//.getModuleComponentContext(); - try - { - tuscanyRuntime.start(); - AggregateContext moduleContext = tuscanyRuntime.getRootContext(); - Module rootModule = (Module) moduleContext.getAggregate(); - - for ( Iterator m = rootModule.getComponents().iterator(); m.hasNext(); ) - { - Module module = (Module) ( (Component) m.next() ).getComponentImplementation(); - - for ( Iterator i = module.getEntryPoints().iterator(); i.hasNext(); ) - { - EntryPoint entryPoint = (EntryPoint) i.next(); - final String epName = entryPoint.getName(); - - ServletContext servletContext = config.getServletContext(); - AggregateContext moduleContext2 = (AggregateContext) servletContext - .getAttribute( "org.apache.tuscany.core.webapp.ModuleComponentContext" ); - InstanceContext entryPointContext = moduleContext2.getContext( epName ); - - Binding binding = (Binding) entryPoint.getBindings().get( 0 ); - if ( binding instanceof WebServiceBinding ) - { - - WebServiceBinding wsBinding = (WebServiceBinding) binding; - Definition definition = wsBinding.getWSDLDefinition(); - Port port = wsBinding.getWSDLPort(); - QName qname = new QName( definition.getTargetNamespace(), port.getName() ); - if ( qname != null ) - { - - WebServicePortMetaData wsdlPortInfo = new WebServicePortMetaData( definition, port, null, - false ); - - WebServiceEntryPointInOutSyncMessageReceiver msgrec = new WebServiceEntryPointInOutSyncMessageReceiver( - moduleContext, - entryPoint, - (EntryPointContext) entryPointContext, - wsdlPortInfo ); - - AxisServiceGroup serviceGroup = new AxisServiceGroup( axisConfig ); - axisConfig - .addMessageReceiver( WebServiceEntryPointInOutSyncMessageReceiver.MEP_URL, msgrec ); - serviceGroup.setServiceGroupName( wsdlPortInfo.getServiceName().getLocalPart() ); - - // to create service from wsdl stream ---> - // AxisServiceBuilder axisServiceBuilder = new AxisServiceBuilder(); - // return axisServiceBuilder.getAxisService(in); - - AxisService axisService = new AxisService( epName ); - axisService.setParent( serviceGroup ); - axisService.setServiceDescription( "Tuscany configured service EntryPoint name '" + epName - + "'" ); - // axisService.setTargetNamespace(wsdlPortInfo.getPortName().getNamespaceURI()); - axisService.addMessageReceiver( WebServiceEntryPointInOutSyncMessageReceiver.MEP_URL, - msgrec ); - - // Create operation descriptions for all the operations - PortType wsdlPortType = wsdlPortInfo.getPortType(); - for ( Iterator j = wsdlPortType.getOperations().iterator(); j.hasNext(); ) - { - Operation wsdlOperation = (Operation) j.next(); - String operationName = wsdlOperation.getName(); - AxisOperation axisOp = new InOutAxisOperation( new javax.xml.namespace.QName( qname - .getNamespaceURI(), operationName ) ); - axisOp.setMessageReceiver( msgrec ); - axisService.addOperation( axisOp ); - axisOp.setMessageExchangePattern( WebServiceEntryPointInOutSyncMessageReceiver.MEP_URL ); - - axisConfig.addService( axisService ); - - } - axisConfig.addServiceGroup( serviceGroup ); - - } - - } - } - } - } - finally - { - // tuscanyRuntime.stop(); - } - } - - /** - * Initialize the Axis configuration context - * - * @param config Servlet configuration - * @throws ServletException - */ - protected ConfigurationContext initConfigContext( ServletConfig config ) - throws ServletException - { - try - { - ServletContext context = config.getServletContext(); - String repoDir = context.getRealPath( "/WEB-INF" ); - ConfigurationContextFactory erfac = new ConfigurationContextFactory(); - ConfigurationContext configContext = erfac.createConfigurationContextFromFileSystem( repoDir ); - configContext.setProperty( Constants.CONTAINER_MANAGED, Constants.VALUE_TRUE ); - configContext.setRootDir( new File( context.getRealPath( "/WEB-INF" ) ) ); - return configContext; - } - catch ( Exception e ) - { - throw new ServletException( e ); - } - } - - private HashMap getHTTPParameters( HttpServletRequest httpServletRequest ) - { - HashMap map = new HashMap(); - Enumeration enu = httpServletRequest.getParameterNames(); - - while ( enu.hasMoreElements() ) - { - String name = (String) enu.nextElement(); - String value = httpServletRequest.getParameter( name ); - - map.put( name, value ); - } - - return map; - } - - private Object getSessionContext( HttpServletRequest httpServletRequest ) - { - Object sessionContext = httpServletRequest.getSession( true ).getAttribute( Constants.SESSION_CONTEXT_PROPERTY ); - - if ( sessionContext == null ) - { - sessionContext = new SessionContext( null ); - httpServletRequest.getSession().setAttribute( Constants.SESSION_CONTEXT_PROPERTY, sessionContext ); - } - - return sessionContext; - } - - private Map getTransportHeaders( HttpServletRequest req ) - { - HashMap headerMap = new HashMap(); - Enumeration headerNames = req.getHeaderNames(); - - while ( headerNames.hasMoreElements() ) - { - String key = (String) headerNames.nextElement(); - String value = req.getHeader( key ); - - headerMap.put( key, value ); - } - - return headerMap; - } - //RRFOO - //TODO get axis2.xml in - /* - * - // Get the current SCA module context - AggregateContext moduleContext = tuscanyRuntime.getModuleComponentContext(); - tuscanyRuntime.start(); - try { - - Module module = (Module)moduleContext.getAggregate(); - AssemblyModelContext modelContext = module.getAssemblyModelContext(); - - // Load the .wsdd configuration - ResourceLoader bundleContext = modelContext.getResourceLoader(); - InputStream wsdd; - try { - URL url = bundleContext.getResource("org/apache/tuscany/binding/axis/engine/config/server-config.wsdd"); - wsdd = url.openStream(); - } catch (IOException e1) { - throw new ServiceRuntimeException(e1); - } - - * - */ -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/WebServiceOperationMetaData.java b/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/WebServiceOperationMetaData.java deleted file mode 100644 index 04c05b95dd..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/WebServiceOperationMetaData.java +++ /dev/null @@ -1,484 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.handler; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import javax.wsdl.Binding; -import javax.wsdl.BindingInput; -import javax.wsdl.BindingOperation; -import javax.wsdl.BindingOutput; -import javax.wsdl.Input; -import javax.wsdl.Message; -import javax.wsdl.Operation; -import javax.wsdl.Output; -import javax.wsdl.Part; -import javax.wsdl.extensions.soap.SOAPBinding; -import javax.wsdl.extensions.soap.SOAPHeader; -import javax.wsdl.extensions.soap.SOAPOperation; -import javax.xml.namespace.QName; - -/** - * Metadata for a WSDL operation - * - */ -public class WebServiceOperationMetaData { - // WSDL Binding and BindingOperation - private Binding binding; - private BindingOperation bindingOperation; - - // Fields to cache derived metadata - private transient Set inputHeaderParts; - private transient Set outputHeaderParts; - private transient String style; - private transient String use; - private transient String soapAction; - private transient List signature; - private String encoding; - private transient QName rpcOperationName; - - public WebServiceOperationMetaData(Binding binding, BindingOperation bindingOperation) { - this.binding = binding; - this.bindingOperation = bindingOperation; - } - - public WebServiceOperationMetaData(Binding binding, BindingOperation bindingOperation, String style, String use, String encoding, String soapAction) { - this.binding = binding; - this.bindingOperation = bindingOperation; - this.style = style; - this.use = use; - this.encoding = encoding; - this.soapAction = soapAction; - } - - public Set getInputHeaderParts() { - if (inputHeaderParts == null) { - // Build a set of header parts that we need to exclude - inputHeaderParts = new HashSet(); - BindingInput bindingInput = bindingOperation.getBindingInput(); - - if (bindingInput != null) { - Operation operation = bindingOperation.getOperation(); - javax.wsdl.Message message = operation.getInput().getMessage(); - List elements = bindingInput.getExtensibilityElements(); - for (Iterator i = elements.iterator(); i.hasNext();) { - Object extensibilityElement = i.next(); - Part part = getPartFromSOAPHeader(message, extensibilityElement); - if (part != null) { - inputHeaderParts.add(part); - } - } - } - } - return inputHeaderParts; - } - - public Set getOutputHeaderParts() { - if (outputHeaderParts == null) { - // Build a set of header parts that we need to exclude - outputHeaderParts = new HashSet(); - BindingOutput bindingOutput = bindingOperation.getBindingOutput(); - - if (bindingOutput != null) { - Operation operation = bindingOperation.getOperation(); - javax.wsdl.Message message = operation.getOutput().getMessage(); - List elements = bindingOutput.getExtensibilityElements(); - for (Iterator i = elements.iterator(); i.hasNext();) { - Object extensibilityElement = i.next(); - Part part = getPartFromSOAPHeader(message, extensibilityElement); - if (part != null) { - outputHeaderParts.add(part); - } - } - } - } - return outputHeaderParts; - } - - private Part getPartFromSOAPHeader(Message message, Object extensibilityElement) { - Part part = null; - if (extensibilityElement instanceof SOAPHeader) { - SOAPHeader soapHeader = (SOAPHeader) extensibilityElement; - QName msgName = soapHeader.getMessage(); - if (message.getQName().equals(msgName)) { - part = message.getPart(soapHeader.getPart()); - } - } else if (extensibilityElement instanceof SOAPHeader) { - SOAPHeader soapHeader = (SOAPHeader) extensibilityElement; - QName msgName = soapHeader.getMessage(); - if (message.getQName().equals(msgName)) { - part = message.getPart(soapHeader.getPart()); - } - } - return part; - } - - public String getStyle() { - if (style == null) { - SOAPOperation soapOperation = (SOAPOperation) WebServicePortMetaData.getExtensibilityElement(bindingOperation.getExtensibilityElements(), SOAPOperation.class); - if (soapOperation != null) - style = soapOperation.getStyle(); - if (style == null) { - SOAPBinding soapBinding = (SOAPBinding) WebServicePortMetaData.getExtensibilityElement(binding.getExtensibilityElements(), SOAPBinding.class); - if (soapBinding != null) - style = soapBinding.getStyle(); - } - if (style == null) - style = "document"; - } - return style; - } - - /** - * Returns the SOAP action for the given operation. - * - * @param wsdlBindingOperation - * @return - */ - public String getSOAPAction() { - if (soapAction == null) { - final List wsdlBindingOperationExtensions = bindingOperation.getExtensibilityElements(); - final SOAPOperation soapOp = (SOAPOperation) WebServicePortMetaData.getExtensibilityElement(wsdlBindingOperationExtensions, SOAPOperation.class); - if (soapOp != null) - soapAction = soapOp.getSoapActionURI(); - } - return soapAction; - } - - public QName getRPCOperationName() { - if (rpcOperationName == null) { - javax.wsdl.extensions.soap.SOAPBody soapBody = getSOAPBody(true); - String ns = (soapBody != null) ? soapBody.getNamespaceURI() : binding.getPortType().getQName().getNamespaceURI(); - String name = bindingOperation.getOperation().getName(); - rpcOperationName = new QName(ns, name); - } - return rpcOperationName; - } - - private List getSOAPBodyParts(boolean input) { - javax.wsdl.extensions.soap.SOAPBody soapBody = getSOAPBody(input); - if (soapBody != null) { - List parts = soapBody.getParts(); - if (parts!=null) { - List names = new ArrayList(); - for (Iterator i = parts.iterator(); i.hasNext();) { - Object part = i.next(); - if (part instanceof String) - names.add(part); - else if (part instanceof Part) { - names.add(((Part) part).getName()); - } - } - return names; - } else - return null; - } else - return null; - } - - private javax.wsdl.extensions.soap.SOAPBody getSOAPBody(boolean input) { - List elements = null; - if (input) { - BindingInput bindingInput = bindingOperation.getBindingInput(); - if (bindingInput == null) - return null; - elements = bindingInput.getExtensibilityElements(); - } else { - BindingOutput bindingOutput = bindingOperation.getBindingOutput(); - if (bindingOutput == null) - return null; - elements = bindingOutput.getExtensibilityElements(); - } - javax.wsdl.extensions.soap.SOAPBody soapBody = (javax.wsdl.extensions.soap.SOAPBody) WebServicePortMetaData.getExtensibilityElement(elements, - javax.wsdl.extensions.soap.SOAPBody.class); - return soapBody; - } - - /** - * Returns the use attribute - * - * @param wsdlOperation - * @return - */ - public String getUse() { - if (use == null) { - javax.wsdl.extensions.soap.SOAPBody soapBody = getSOAPBody(true); - if (soapBody != null) { - use = soapBody.getUse(); - } - if (use == null) - use = "literal"; - } - return use; - } - - public String getEncoding() { - if (encoding == null) { - javax.wsdl.extensions.soap.SOAPBody soapBody = getSOAPBody(true); - if (soapBody != null) { - List styles=(List)soapBody.getEncodingStyles(); - if (styles!=null && !styles.isEmpty()) - encoding = styles.get(0); - } - if (encoding == null) - encoding = ""; - } - return encoding; - } - - public boolean isDocLitWrapped() { - boolean flag = getStyle().equals("document") && getUse().equals("literal"); - if (!flag) - return false; - Message msg = getMessage(true); - if (msg == null) - return false; - List parts = msg.getOrderedParts(null); - if (parts.size() != 1) - return false; - Part part = (Part) parts.get(0); - QName element = part.getElementName(); - if (element == null) - return false; - return element.getLocalPart().equals(bindingOperation.getOperation().getName()); - } - - /* - public SOAPMediator createMediator(boolean serverMode) - throws SOAPException { - // create a new mediator for each invoke for thread-safety - boolean rpcStyle = getStyle().equals("rpc"); - boolean rpcEncoded = isEncoded(); - - SOAPMediator mediator = null; - - if (!rpcStyle) { - // Document - mediator = new SOAPDocumentLiteralMediatorImpl(this, serverMode); - } else { - if (!rpcEncoded) - mediator = new SOAPRPCLiteralMediatorImpl(this, serverMode); // RPC-literal - else - mediator = new SOAPRPCEncodedMediatorImpl(this, serverMode); // RPC-encoded - } - return mediator; - } - */ - - /** - * Get the operation signature from the WSDL operation - * - * @param wsdlBinding - * @param bindingOperation - * @return - */ - public List getOperationSignature() { - if (signature == null) { - signature = new ArrayList(); - - Operation operation = bindingOperation.getOperation(); - if (operation == null) - return signature; - - final Input input = operation.getInput(); - if (input == null) { - return signature; - } - - String style = getStyle(); - - if (style.equals("rpc")) { - Collection partNames = input.getMessage().getParts().values(); - for (Iterator i = partNames.iterator(); i.hasNext();) { - Part part = (Part) i.next(); - signature.add(part.getName()); - } - } else { - /* - * WS-I Basic Profile 1.1 4.7.6 Operation Signatures - * Definition: operation signature - * - * The profile defines the "operation signature" to be the - * fully qualified name of the child element of SOAP body of - * the SOAP input message described by an operation in a - * WSDL binding. - * - * In the case of rpc-literal binding, the operation name is - * used as a wrapper for the part accessors. In the - * document-literal case, since a wrapper with the operation - * name is not present, the message signatures must be - * correctly designed so that they meet this requirement. - * - * An endpoint that supports multiple operations must - * unambiguously identify the operation being invoked based - * on the input message that it receives. This is only - * possible if all the operations specified in the - * wsdl:binding associated with an endpoint have a unique - * operation signature. - * - * R2710 The operations in a wsdl:binding in a DESCRIPTION - * MUST result in operation signatures that are different - * from one another. - */ - List bodyParts = getSOAPBodyParts(true); - - Collection parts = input.getMessage().getParts().values(); - // Exclude the parts to be transmitted in SOAP header - if (bodyParts == null) - parts.removeAll(getInputHeaderParts()); - for (Iterator i = parts.iterator(); i.hasNext();) { - Part part = (Part) i.next(); - if (bodyParts == null) { - // All parts - QName elementName = part.getElementName(); - if (elementName == null) { - elementName = new QName("", part.getName()); - // TODO: [rfeng] throw new - // ServiceRuntimeException("Message part for - // document style must refer to an XSD element - // using a QName: " + part); - } - signature.add(elementName); - } else { - // "parts" in soap:body - if (bodyParts.contains(part.getName())) { - QName elementName = part.getElementName(); - if (elementName == null) { - elementName = new QName("", part.getName()); - // TODO: [rfeng] throw new - // ServiceRuntimeException("Message part for - // document style must refer to an XSD - // element using a QName: " + part); - } - signature.add(elementName); - } - - } - } - } - } - return signature; - } - - public Message getMessage(boolean isInput) { - Operation operation = bindingOperation.getOperation(); - if (operation == null) - return null; - - if (isInput) { - final Input input = operation.getInput(); - return input == null ? null : input.getMessage(); - } else { - final Output output = operation.getOutput(); - return output == null ? null : output.getMessage(); - } - } - - public Part getInputPart(int index) { - Part part = null; - Message message = getMessage(true); - if (message == null) - return part; - - List parts = message.getOrderedParts(null); - return (Part) parts.get(index); - - } - - public Part getOutputPart(int index) { - Part part = null; - Message message = getMessage(false); - if (message == null) - return part; - - List parts = message.getOrderedParts(null); - return (Part) parts.get(index); - - } - - /** - * Get a list of indexes for each part in the SOAP body - * - * @param isInput TODO - * @return - */ - public List getBodyPartIndexes(boolean isInput) { - List indexes = new ArrayList(); - - Message message = getMessage(isInput); - if (message == null) - return indexes; - - List bodyParts = getSOAPBodyParts(isInput); - List parts = message.getOrderedParts(null); - Set headerParts = (isInput) ? getInputHeaderParts() : getOutputHeaderParts(); - - int index = 0; - for (Iterator i = parts.iterator(); i.hasNext(); index++) { - Part part = (Part) i.next(); - if (headerParts.contains(part)) - continue; - if (bodyParts == null) { - // All parts - indexes.add(new Integer(index)); - } else { - // "parts" in soap:body - if (bodyParts.contains(part.getName())) - indexes.add(new Integer(index)); - - } - } - return indexes; - } - - /** - * Get the corresponding index for a part in the SOAP header by element - * name - * - * @param elementName - * @param isInput TODO - * @return - */ - public int getHeaderPartIndex(QName elementName, boolean isInput) { - - Message message = getMessage(isInput); - if (message == null) - return -1; - - List parts = message.getOrderedParts(null); - Set headerParts = isInput ? getInputHeaderParts() : getOutputHeaderParts(); - - int index = 0; - for (Iterator i = parts.iterator(); i.hasNext(); index++) { - Part part = (Part) i.next(); - // Test if the part is in header section - if (headerParts.contains(part) && elementName.equals(part.getElementName())) { - return index; - } - } - return -1; - } - - public BindingOperation getBindingOperation() { - return bindingOperation; - } - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/WebServicePortMetaData.java b/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/WebServicePortMetaData.java deleted file mode 100644 index 15eec4dc7e..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/WebServicePortMetaData.java +++ /dev/null @@ -1,362 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.handler; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import javax.wsdl.Binding; -import javax.wsdl.BindingOperation; -import javax.wsdl.Definition; -import javax.wsdl.Port; -import javax.wsdl.PortType; -import javax.wsdl.Service; -import javax.wsdl.extensions.soap.SOAPAddress; -import javax.wsdl.extensions.soap.SOAPBinding; -import javax.xml.namespace.QName; -//import javax.xml.soap.Name; -//import javax.xml.soap.SOAPBodyElement; -//import javax.xml.soap.SOAPElement; - -import org.apache.tuscany.model.types.wsdl.WSDLServiceContract; - -/** - * Metadata for a WSDL port - * - */ -public class WebServicePortMetaData { - - private final static String SOAP_ENCODING_URI = "http://schemas.xmlsoap.org/wsdl/soap/"; - - private Service wsdlService; - private QName wsdlServiceName; - private Port wsdlPort; - private Binding wsdlBinding; - private QName wsdlPortName; - private PortType wsdlPortType; - private QName wsdlPortTypeName; - private String endpoint; - private boolean managed; - private List allOperationMetaData; - private WSDLServiceContract interfaceType; - - /** - * Constructor - * - * @param wsdlDefinition - * @param portName - */ - public WebServicePortMetaData(Definition wsdlDefinition, Port wsdlPort, String endpoint, boolean managed) { - - // Lookup the named port - this.wsdlPort=wsdlPort; - wsdlPortName = new QName(wsdlDefinition.getTargetNamespace(), wsdlPort.getName()); - - Collection services=(Collection)wsdlDefinition.getServices().values(); - for (Service service : services) { - if (service.getPorts().containsValue(wsdlPort)) { - wsdlService = service; - wsdlServiceName = service.getQName(); - break; - } - } - - // Save the binding - wsdlBinding = wsdlPort.getBinding(); - if (wsdlBinding == null) { - throw new IllegalArgumentException("WSDL binding cannot be found for " + wsdlPortName); - } - - // Save the portType - wsdlPortType = wsdlBinding.getPortType(); - if (wsdlPortType == null) { - throw new IllegalArgumentException("WSDL portType cannot be found for " + wsdlPortName); - } - wsdlPortTypeName = wsdlPortType.getQName(); - - // Save the endpoint - this.endpoint = endpoint; - - // Track if this endpoint is managed or not - this.managed = managed; - } - - /** - * Constructor - * - * @param serviceName - * @param portName - * @param portType - */ - public WebServicePortMetaData(QName serviceName, String portName, QName portTypeName, String endpoint) { - wsdlServiceName = serviceName; - wsdlPortName = new QName(serviceName.getNamespaceURI(), portName); - wsdlPortTypeName = portTypeName; - this.endpoint = endpoint; - } - - /** - * @return Returns the wsdlPort. - */ - public javax.wsdl.Port getPort() { - return wsdlPort; - } - - /** - * @return Returns the wsdlService. - */ - public QName getServiceName() { - return wsdlServiceName; - } - - /** - * @return Returns the wsdlService. - */ - public javax.wsdl.Service getService() { - return wsdlService; - } - - /** - * @return Returns the wsdlPortType. - */ - public PortType getPortType() { - return wsdlPortType; - } - - /** - * @return Returns the wsdlPortType. - */ - public QName getPortTypeName() { - return wsdlPortTypeName; - } - - /** - * @return Returns the wsdlBinding. - */ - public Binding getBinding() { - return wsdlBinding; - } - - /** - * @return Returns the wsdlPortName. - */ - public QName getPortName() { - return wsdlPortName; - } - - /** - * Returns the endpoint of a given port. - * - * @param wsdlPort - * @return - */ - public String getEndpoint() { - - // Return the specified endpoint - if (endpoint != null) - return endpoint; - - // Find the target endpoint on the port - if (wsdlPort != null) { - final List wsdlPortExtensions = wsdlPort.getExtensibilityElements(); - for (Iterator i = wsdlPortExtensions.iterator(); i.hasNext();) { - final Object extension = i.next(); - if (extension instanceof SOAPAddress) { - final SOAPAddress address = (SOAPAddress) extension; - return address.getLocationURI(); - } - } - } - - return null; - } - - /** - * Returns the SOAP binding style. - * @return - */ - public String getStyle() { - - // Find the binding style - String style = null; - if (wsdlBinding != null) { - final List wsdlBindingExtensions = wsdlBinding.getExtensibilityElements(); - SOAPBinding soapBinding = (SOAPBinding) getExtensibilityElement(wsdlBindingExtensions, SOAPBinding.class); - if (soapBinding != null) - style = soapBinding.getStyle(); - } - - // Default to document - return (style == null) ? "document" : style; - } - - /** - * Returns the use attribute - * @return - */ - public String getUse() { - List list = getAllOperationMetaData(); - WebServiceOperationMetaData operationMetaData = (WebServiceOperationMetaData) list.get(0); - return operationMetaData.getUse(); - } - - /** - * Returns the encoding attribute - * @return - */ - public String getEncoding() { - List list = getAllOperationMetaData(); - WebServiceOperationMetaData operationMetaData = (WebServiceOperationMetaData) list.get(0); - return operationMetaData.getEncoding(); - } - - /** - * @return Returns true if this is a managed web service. - */ - public boolean isManaged() { - return managed; - } - - /** - * Returns the first extensibility element of the given type. - * @param elements - * @param type - * @return - */ - public static Object getExtensibilityElement(List elements, Class type) { - for (Iterator i = elements.iterator(); i.hasNext();) { - Object element = i.next(); - if (type.isInstance(element)) - return element; - } - return null; - } - - /** - * Returns the extensibility elements of the given type. - * @param elements - * @param type - * @return - */ - public static List getExtensibilityElements(List elements, Class type) { - List result = new ArrayList(); - for (Iterator i = elements.iterator(); i.hasNext();) { - Object element = i.next(); - if (type.isInstance(element)) - result.add(element); - } - return result; - } - - /** - * Get the operation signature from the SOAP Body - * @param body - * @return A list of QNames - */ -// public static List getOperationSignature(javax.xml.soap.SOAPBody body) { -// List signature = new ArrayList(); -// for (Iterator i = body.getChildElements(); i.hasNext();) { -// Object child = i.next(); -// if (child instanceof SOAPBodyElement) { -// Name name = ((SOAPBodyElement) child).getElementName(); -// QName qname = new QName(name.getURI(), name.getLocalName(), name.getPrefix()); -// signature.add(qname); -// } -// } -// return signature; -// } - -// public static List getRPCOperationSignature(javax.xml.soap.SOAPBody body) { -// List signature = new ArrayList(); -// for (Iterator i = body.getChildElements(); i.hasNext();) { -// Object child = i.next(); -// if (child instanceof SOAPBodyElement) { -// SOAPBodyElement op = ((SOAPBodyElement) child); -// for (Iterator j = op.getChildElements(); j.hasNext();) { -// Object part = i.next(); -// if (part instanceof SOAPElement) { -// SOAPElement p = (SOAPElement) part; -// signature.add(p.getLocalName()); -// } -// } -// } -// } -// return signature; -// } - -// public WebServiceOperationMetaData getOperationMetaData(javax.xml.soap.SOAPBody body) { -// List s1 = getOperationSignature(body); -// // List rpcParts = getRPCOperationSignature(body); -// for (Iterator it = getAllOperationMetaData().iterator(); it.hasNext();) { -// WebServiceOperationMetaData descriptor = (WebServiceOperationMetaData) it.next(); -// -// String style = descriptor.getStyle(); -// -// if (style.equals("document")) { -// List s2 = descriptor.getOperationSignature(); -// if (s1.equals(s2)) -// return descriptor; -// } else { -// QName op1 = (QName) s1.get(0); -// QName op2 = descriptor.getRPCOperationName(); -// if (op1.equals(op2)) { -// /* -// * // FIXME: [rfeng] We don't support method overloading -// * List partNames = getOperationSignature(binding, -// * bindingOperation); if (rpcParts.equals(partNames)) -// */ -// return descriptor; -// } -// } -// } -// return null; -// } - - public List getAllOperationMetaData() { - if (allOperationMetaData == null) { - allOperationMetaData = new ArrayList(); - for (Iterator it = wsdlBinding.getBindingOperations().iterator(); it.hasNext();) { - final BindingOperation bindingOperation = (BindingOperation) it.next(); - if (bindingOperation.getOperation() != null) - allOperationMetaData.add(new WebServiceOperationMetaData(wsdlBinding, bindingOperation)); - } - } - return allOperationMetaData; - } - - public WebServiceOperationMetaData getOperationMetaData(String operationName) { - for (Iterator it = getAllOperationMetaData().iterator(); it.hasNext();) { - WebServiceOperationMetaData descriptor = (WebServiceOperationMetaData) it.next(); - String opName = descriptor.getBindingOperation().getOperation().getName(); - - if (opName.equals(operationName)) - return descriptor; - } - return null; - } - - /** - * Returns the WSDL service contract - * @return - */ - public WSDLServiceContract getInterfaceType() { - return interfaceType; - } - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/loader/WebServiceSCDLModelLoader.java b/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/loader/WebServiceSCDLModelLoader.java deleted file mode 100644 index d587a4680f..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/loader/WebServiceSCDLModelLoader.java +++ /dev/null @@ -1,74 +0,0 @@ -package org.apache.tuscany.binding.axis2.loader; - -import org.apache.tuscany.binding.axis2.assembly.WebServiceAssemblyFactory; -import org.apache.tuscany.binding.axis2.assembly.WebServiceBinding; -import org.apache.tuscany.binding.axis2.assembly.impl.WebServiceAssemblyFactoryImpl; -import org.apache.tuscany.binding.axis2.assembly.impl.WebServiceBindingImpl; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.apache.tuscany.core.loader.SCDLModelLoaderRegistry; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.scdl.loader.SCDLModelLoader; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Destroy; - -/** - * Populates the assembly model from an SCDL model - */ -@org.osoa.sca.annotations.Scope("MODULE") -public class WebServiceSCDLModelLoader implements SCDLModelLoader { - - private RuntimeContext runtimeContext; - private SCDLModelLoaderRegistry loaderRegistry; - private WebServiceAssemblyFactory wsFactory; - - /** - * Constructs a new WebServiceSCDLModelLoader. - */ - public WebServiceSCDLModelLoader() { - this.wsFactory=new WebServiceAssemblyFactoryImpl(); - } - - /** - * @param runtimeContext The runtimeContext to set. - */ - @Autowire - public void setRuntimeContext(RuntimeContext runtimeContext) { - this.runtimeContext = runtimeContext; - } - - // @Autowire - public void setLoaderRegistry(SCDLModelLoaderRegistry registry) { - this.loaderRegistry = registry; - } - - @Init(eager=true) - public void init() { - runtimeContext.addLoader(this); -// loaderRegistry.registerLoader(this); - } - - @Destroy - public void destroy() { - loaderRegistry.unregisterLoader(this); - } - - /** - * @see org.apache.tuscany.model.scdl.loader.SCDLModelLoader#load(org.apache.tuscany.model.assembly.AssemblyModelContext, java.lang.Object) - */ - public AssemblyModelObject load(AssemblyModelContext modelContext, Object object) { - if (object instanceof org.apache.tuscany.model.scdl.WebServiceBinding) { - org.apache.tuscany.model.scdl.WebServiceBinding scdlBinding=(org.apache.tuscany.model.scdl.WebServiceBinding)object; - WebServiceBinding binding=wsFactory.createWebServiceBinding(); - binding.setURI(scdlBinding.getUri()); - - // Set the port URI into the assembly binding, it'll be resolved in the initialize method - ((WebServiceBindingImpl)binding).setPortURI(scdlBinding.getPort()); - - return binding; - - } else - return null; - } -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/util/AxiomHelper.java b/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/util/AxiomHelper.java deleted file mode 100644 index 3df1a4104d..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/util/AxiomHelper.java +++ /dev/null @@ -1,185 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.util; - -import java.io.IOException; -import java.io.PipedInputStream; -import java.io.PipedOutputStream; -import java.util.List; - -import javax.xml.namespace.QName; -import javax.xml.stream.FactoryConfigurationError; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.axis2.om.OMAbstractFactory; -import org.apache.axis2.om.OMElement; -import org.apache.axis2.om.OMXMLParserWrapper; -import org.apache.axis2.om.impl.llom.factory.OMXMLBuilderFactory; -import org.apache.tuscany.sdo.helper.DataFactoryImpl; -import org.apache.tuscany.sdo.helper.XMLHelperImpl; -import org.apache.tuscany.sdo.helper.XSDHelperImpl; -import org.osoa.sca.ServiceRuntimeException; - -import commonj.sdo.DataObject; -import commonj.sdo.Property; -import commonj.sdo.helper.TypeHelper; -import commonj.sdo.helper.XMLDocument; -import commonj.sdo.helper.XSDHelper; - -/** - * Utility methods to convert between Axis2 AXIOM, SDO DataObjects and Java objects. - * - * Most of these methods rely on the schemas having been registered with XSDHelper.define - */ -public class AxiomHelper { - - /** - * Deserialize an OMElement into Java Objects - * - * @param om - * the OMElement - * @return the array of deserialized Java objects - */ - public static Object[] toObjects(TypeHelper typeHelper, OMElement om) { - DataObject dataObject = toDataObject(typeHelper, om); - Object[] os = toObjects(dataObject); - return os; - } - - /** - * Convert a typed DataObject to Java objects - * - * @param dataObject - * @return the array of Objects from the DataObject - */ - public static Object[] toObjects(DataObject dataObject) { - List ips = dataObject.getInstanceProperties(); - Object[] os = new Object[ips.size()]; - for (int i = 0; i < ips.size(); i++) { - os[i] = dataObject.get((Property) ips.get(i)); - } - return os; - } - - /** - * Convert objects to an AXIOM OMElement - * - * @param os - * @param typeNS - * @param typeName - * @return an AXIOM OMElement - */ - public static OMElement toOMElement(TypeHelper typeHelper, Object[] os, QName typeQN) { - DataObject dataObject = toDataObject(typeHelper, os, typeQN); - OMElement omElement = toOMElement(typeHelper, dataObject, typeQN); - return omElement; - } - - /** - * Convert a DataObject to AXIOM OMElement - * - * @param dataObject - * @param typeNS - * @param typeName - * @return - * @throws XMLStreamException - * @throws IOException - */ - public static OMElement toOMElement(TypeHelper typeHelper, DataObject dataObject, QName typeQN) { - try { - - PipedOutputStream pos = new PipedOutputStream(); - PipedInputStream pis = new PipedInputStream(pos); - new XMLHelperImpl(typeHelper).save(dataObject, typeQN.getNamespaceURI(), typeQN.getLocalPart(), pos); - pos.close(); - - XMLStreamReader parser; - ClassLoader ccl=Thread.currentThread().getContextClassLoader(); - try { - Thread.currentThread().setContextClassLoader(AxiomHelper.class.getClassLoader()); - parser = XMLInputFactory.newInstance().createXMLStreamReader(pis); - } finally { - Thread.currentThread().setContextClassLoader(ccl); - } - OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXOMBuilder(OMAbstractFactory.getOMFactory(), parser); - OMElement root = builder.getDocumentElement(); - - return root; - - } catch (IOException e) { - throw new ServiceRuntimeException(e); - } catch (XMLStreamException e) { - throw new ServiceRuntimeException(e); - } catch (FactoryConfigurationError e) { - throw new ServiceRuntimeException(e); - } - } - - /** - * Deserialize an AXIOM OMElement into a DataObject - * - * @param omElement - * @return - */ - public static DataObject toDataObject(TypeHelper typeHelper, OMElement omElement) { - try { - - PipedOutputStream pos = new PipedOutputStream(); - PipedInputStream pis = new PipedInputStream(pos); - - ClassLoader ccl=Thread.currentThread().getContextClassLoader(); - try { - Thread.currentThread().setContextClassLoader(AxiomHelper.class.getClassLoader()); - omElement.serialize(pos); - } finally { - Thread.currentThread().setContextClassLoader(ccl); - } - - pos.flush(); - pos.close(); - - XMLDocument document = new XMLHelperImpl(typeHelper).load(pis); - - return document.getRootObject(); - - } catch (IOException e) { - throw new ServiceRuntimeException(e); - } catch (XMLStreamException e) { - throw new ServiceRuntimeException(e); - } - } - - /** - * Convert objects to typed DataObject - * - * @param typeNS - * @param typeName - * @param os - * @return the DataObject - */ - public static DataObject toDataObject(TypeHelper typeHelper, Object[] os, QName typeQN) { - XSDHelper xsdHelper=new XSDHelperImpl(typeHelper); - Property property=xsdHelper.getGlobalProperty(typeQN.getNamespaceURI(), typeQN.getLocalPart(), true); - DataObject dataObject = new DataFactoryImpl(typeHelper).create(property.getType()); - List ips = dataObject.getInstanceProperties(); - for (int i = 0; i < ips.size(); i++) { - Property p = (Property) ips.get(i); - dataObject.set(i, os[i]); - } - return dataObject; - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/main/resources/org/apache/tuscany/binding/axis2/engine/config/axis2.xml b/tags/java-stable-20060304/sca/binding.axis2/src/main/resources/org/apache/tuscany/binding/axis2/engine/config/axis2.xml deleted file mode 100644 index d42457fdf6..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/main/resources/org/apache/tuscany/binding/axis2/engine/config/axis2.xml +++ /dev/null @@ -1,167 +0,0 @@ - - - - - false - false - false - - - - - admin - axis2 - - . - - 127.0.0.1 - 5555 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6060 - - - - - - - - - - - - - - - - - HTTP/1.1 - chunked - - - HTTP/1.1 - chunked - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/main/resources/system.fragment b/tags/java-stable-20060304/sca/binding.axis2/src/main/resources/system.fragment deleted file mode 100644 index cef83e6d65..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/main/resources/system.fragment +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/WebServiceAssemblyLoaderTestCase.java b/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/WebServiceAssemblyLoaderTestCase.java deleted file mode 100644 index b9abe418ca..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/WebServiceAssemblyLoaderTestCase.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.assembly.tests; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.binding.axis2.assembly.WebServiceBinding; -import org.apache.tuscany.binding.axis2.loader.WebServiceSCDLModelLoader; -import org.apache.tuscany.common.resource.ResourceLoader; -import org.apache.tuscany.common.resource.impl.ResourceLoaderImpl; -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.Binding; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.ExternalService; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; -import org.apache.tuscany.model.assembly.loader.AssemblyModelLoader; -import org.apache.tuscany.model.scdl.loader.SCDLModelLoader; -import org.apache.tuscany.model.scdl.loader.impl.SCDLAssemblyModelLoaderImpl; - -/** - */ -public class WebServiceAssemblyLoaderTestCase extends TestCase { - - /** - * - */ - public WebServiceAssemblyLoaderTestCase() { - super(); - } - - public void testLoader() { - - ResourceLoader resourceLoader=new ResourceLoaderImpl(Thread.currentThread().getContextClassLoader()); - WebServiceSCDLModelLoader wsLoader=new WebServiceSCDLModelLoader(); - List scdlLoaders=new ArrayList(); - scdlLoaders.add(wsLoader); - AssemblyModelLoader assemblyLoader=new SCDLAssemblyModelLoaderImpl(scdlLoaders); - AssemblyFactory assemblyFactory=new AssemblyFactoryImpl(); - AssemblyModelContext modelContext=new AssemblyModelContextImpl(assemblyFactory, assemblyLoader, resourceLoader); - - Module module = assemblyLoader.loadModule(getClass().getResource("sca.module").toString()); - module.initialize(modelContext); - - Assert.assertTrue(module.getName().equals("tuscany.binding.axis2.assembly.tests.bigbank.account")); - - Component component = module.getComponent("AccountServiceComponent"); - Assert.assertTrue(component != null); - - EntryPoint entryPoint = module.getEntryPoint("AccountService"); - Assert.assertTrue(entryPoint != null); - - ExternalService externalService = module.getExternalService("StockQuoteService"); - Assert.assertTrue(externalService != null); - - Binding binding = externalService.getBindings().get(0); - Assert.assertTrue(binding instanceof WebServiceBinding); - } - - protected void setUp() throws Exception { - super.setUp(); - - Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountReport.java b/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountReport.java deleted file mode 100644 index a50594a243..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountReport.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.assembly.tests.bigbank.account.services.account; - -import java.util.List; - -/** - * @model - */ - -public interface AccountReport { - - /** - * @model type="services.account.AccountSummary" - */ - - List getAccountSummaries(); -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountService.java b/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountService.java deleted file mode 100644 index 241a11333f..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountService.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.assembly.tests.bigbank.account.services.account; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface AccountService { - - public AccountReport getAccountReport(String customerID); -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountServiceImpl.java b/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountServiceImpl.java deleted file mode 100644 index 8e66b18324..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountServiceImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.assembly.tests.bigbank.account.services.account; - -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Reference; - -import org.apache.tuscany.binding.axis2.assembly.tests.bigbank.account.services.accountdata.AccountDataService; -import org.apache.tuscany.binding.axis2.assembly.tests.bigbank.account.services.stockquote.StockQuoteService; - -public class AccountServiceImpl implements AccountService { - - @Property - public String currency = "USD"; - - @Reference - public AccountDataService accountDataService; - @Reference - public StockQuoteService stockQuoteService; - - public AccountServiceImpl() { - } - - public AccountReport getAccountReport(String customerID) { - return null; - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountSummary.java b/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountSummary.java deleted file mode 100644 index 3b30161cf5..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountSummary.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.assembly.tests.bigbank.account.services.account; - -/** - * @model - */ - -public interface AccountSummary { - - /** - * @model - */ - String getAccountNumber(); - - void setAccountNumber(String accountNumber); - - /** - * @model - */ - String getAccountType(); - - void setAccountType(String accountType); - - /** - * @model - */ - float getBalance(); - - void setBalance(float balance); -} - diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java b/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java deleted file mode 100644 index fba6d582da..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.assembly.tests.bigbank.account.services.accountdata; - -public interface AccountDataService { - - CheckingAccount getCheckingAccount(String customerID); - - SavingsAccount getSavingsAccount(String customerID); - - StockAccount getStockAccount(String customerID); -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java b/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java deleted file mode 100644 index c34ce84bc3..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.assembly.tests.bigbank.account.services.accountdata; - -public class AccountDataServiceImpl implements AccountDataService { - - public CheckingAccount getCheckingAccount(String customerID) { - - CheckingAccount checkingAccount = new CheckingAccount(); - checkingAccount.setAccountNumber(customerID + "_" + "CHA12345"); - checkingAccount.setBalance(1500.0f); - - return checkingAccount; - } - - public SavingsAccount getSavingsAccount(String customerID) { - - SavingsAccount savingsAccount = new SavingsAccount(); - savingsAccount.setAccountNumber(customerID + "_" + "SAA12345"); - savingsAccount.setBalance(1500.0f); - - return savingsAccount; - } - - public StockAccount getStockAccount(String customerID) { - - StockAccount stockAccount = new StockAccount(); - stockAccount.setAccountNumber(customerID + "_" + "STA12345"); - stockAccount.setSymbol("IBM"); - stockAccount.setQuantity(100); - - return stockAccount; - } -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java b/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java deleted file mode 100644 index d7b116da30..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.assembly.tests.bigbank.account.services.accountdata; - -public class CheckingAccount { - - private String accountNumber; - private float balance; - - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - - public float getBalance() { - return balance; - } - - public void setBalance(float balance) { - this.balance = balance; - } -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java b/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java deleted file mode 100644 index cd7f74bb6e..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.assembly.tests.bigbank.account.services.accountdata; - -public class SavingsAccount { - - private String accountNumber; - private float balance; - - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - - public float getBalance() { - return balance; - } - - public void setBalance(float balance) { - this.balance = balance; - } -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/StockAccount.java b/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/StockAccount.java deleted file mode 100644 index 70756fd817..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/StockAccount.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.assembly.tests.bigbank.account.services.accountdata; - -public class StockAccount { - - private String accountNumber; - private String symbol; - private int quantity; - - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - - public int getQuantity() { - return quantity; - } - - public void setQuantity(int quantity) { - this.quantity = quantity; - } - - public String getSymbol() { - return symbol; - } - - public void setSymbol(String symbol) { - this.symbol = symbol; - } -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java b/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java deleted file mode 100644 index d2db111fbe..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.binding.axis2.assembly.tests.bigbank.account.services.stockquote; - -public interface StockQuoteService { - - public float getQuote(String symbol); -} - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/util/AxiomHelperTestCase.java b/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/util/AxiomHelperTestCase.java deleted file mode 100644 index 3d9a5b8bf1..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/util/AxiomHelperTestCase.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.apache.tuscany.binding.axis2.util; - -import java.net.URL; - -import javax.xml.namespace.QName; - -import junit.framework.TestCase; - -import org.apache.axis2.om.OMElement; -import org.apache.tuscany.sdo.helper.TypeHelperImpl; -import org.apache.tuscany.sdo.helper.XSDHelperImpl; -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.apache.tuscany.sdo.util.SDOUtil; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.util.BasicExtendedMetaData; - -import commonj.sdo.DataObject; -import commonj.sdo.helper.TypeHelper; - -public class AxiomHelperTestCase extends TestCase { - - public static final QName GREETING_QN = new QName("http://helloworldaxis.samples.tuscany.apache.org", "getGreetings"); - - private TypeHelper typeHelper; - - public void testToObjects1() { - String s = "petra"; - OMElement omElement = AxiomHelper.toOMElement(typeHelper, new Object[] { s }, GREETING_QN); - assertNotNull(omElement); - - Object[] os = AxiomHelper.toObjects(typeHelper, omElement); - assertNotNull(os); - assertEquals(os.length, 1); - assertEquals(os[0], s); - } - - public void testToObjects2() { - String s = "sue"; - DataObject dataObject = AxiomHelper.toDataObject(typeHelper, new Object[] { s }, GREETING_QN); - assertNotNull(dataObject); - - Object[] os = AxiomHelper.toObjects(dataObject); - assertNotNull(os); - assertEquals(os.length, 1); - assertEquals(os[0], s); - } - - public void testToOMElement1() { - String s = "beate"; - OMElement omElement = AxiomHelper.toOMElement(typeHelper, new Object[] { s }, GREETING_QN); - assertNotNull(omElement); - } - - public void testToOMElement2() { - String s = "emma"; - DataObject dataObject = AxiomHelper.toDataObject(typeHelper, new Object[] { s }, GREETING_QN); - assertNotNull(dataObject); - - OMElement omElement = AxiomHelper.toOMElement(typeHelper, dataObject, GREETING_QN); - assertNotNull(omElement); - } - - public void testToDataObject() { - String s = "bersi"; - DataObject dataObject = AxiomHelper.toDataObject(typeHelper, new Object[] { s }, GREETING_QN); - assertNotNull(dataObject); - - Object[] os = AxiomHelper.toObjects(dataObject); - assertNotNull(os); - assertEquals(os.length, 1); - assertEquals(os[0], s); - } - - protected void setUp() throws Exception { - super.setUp(); - DataObjectUtil.initRuntime(); - ClassLoader cl=Thread.currentThread().getContextClassLoader(); - try { - Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); - typeHelper=SDOUtil.createTypeHelper(); - URL url = getClass().getResource("helloworld.wsdl"); - new XSDHelperImpl(typeHelper).define(url.openStream(), null); - } finally { - Thread.currentThread().setContextClassLoader(cl); - } - } - -} diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountService.wsdl b/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountService.wsdl deleted file mode 100644 index 921218c5b9..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountService.wsdl +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl b/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl deleted file mode 100644 index 9678d9d6ea..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/assembly/tests/sca.module b/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/assembly/tests/sca.module deleted file mode 100644 index 8e25576168..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/assembly/tests/sca.module +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - AccountExternalService - - - - - - AccountExternalService - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/mediator/tests/DocLit.wsdl b/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/mediator/tests/DocLit.wsdl deleted file mode 100644 index 4aec526803..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/mediator/tests/DocLit.wsdl +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/mediator/tests/DocLitWrapped.wsdl b/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/mediator/tests/DocLitWrapped.wsdl deleted file mode 100644 index 7839d3ea71..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/mediator/tests/DocLitWrapped.wsdl +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/mediator/tests/RpcLit.wsdl b/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/mediator/tests/RpcLit.wsdl deleted file mode 100644 index 8f94f9c66f..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/mediator/tests/RpcLit.wsdl +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/mediator/tests/sca.module b/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/mediator/tests/sca.module deleted file mode 100644 index 7d8bb7861f..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/mediator/tests/sca.module +++ /dev/null @@ -1,20 +0,0 @@ - - - - - diff --git a/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/util/helloworld.wsdl b/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/util/helloworld.wsdl deleted file mode 100644 index 2c5f5041a8..0000000000 --- a/tags/java-stable-20060304/sca/binding.axis2/src/test/resources/org/apache/tuscany/binding/axis2/util/helloworld.wsdl +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/common/LICENSE.txt b/tags/java-stable-20060304/sca/common/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/tags/java-stable-20060304/sca/common/LICENSE.txt +++ /dev/null @@ -1,202 +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/tags/java-stable-20060304/sca/common/pom.xml b/tags/java-stable-20060304/sca/common/pom.xml deleted file mode 100644 index b903d8f6a6..0000000000 --- a/tags/java-stable-20060304/sca/common/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - org.apache.tuscany - tuscany-sca - SNAPSHOT - - 4.0.0 - tuscany-common - Tuscany Common - Tuscany classes common to runtime and tools. - SNAPSHOT - - - - junit - junit - 3.8.1 - test - - - diff --git a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/TuscanyException.java b/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/TuscanyException.java deleted file mode 100644 index 74110fef99..0000000000 --- a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/TuscanyException.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.apache.tuscany.common; - -import java.util.ArrayList; -import java.util.List; - -/** - * The root checked exception for the Tuscany rubntime - * - * @version $Rev: 368822 $ $Date: 2006-01-13 10:54:38 -0800 (Fri, 13 Jan 2006) $ - */ -public abstract class TuscanyException extends Exception { - - protected List contextStack; - - public TuscanyException() { - super(); - } - - public TuscanyException(String message) { - super(message); - } - - public TuscanyException(String message, Throwable cause) { - super(message, cause); - } - - public TuscanyException(Throwable cause) { - super(cause); - } - - /** - * Returns a collection of names representing the context call stack where the error occured. The top of the stack - * is the first element in the collection. - */ - public List returnContextNames(String name) { - if (contextStack == null) { - contextStack = new ArrayList(); - } - return contextStack; - } - - /** - * Pushes a context name where an error occured onto the call stack - */ - public void addContextName(String name) { - if (contextStack == null) { - contextStack = new ArrayList(); - } - contextStack.add(name); - } - - private String identifier; - - /** - * Returns a string representing additional error information referred to in the error message - */ - public String getIdentifier() { - return identifier; - } - - /** - * Sets an additional error information referred to in the error message - */ - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - - public String getMessage() { - if (identifier == null && contextStack == null) { - return super.getMessage(); - } - StringBuffer b = new StringBuffer(); - if (identifier != null) { - b.append(" [" + identifier + "]"); - } - if (contextStack != null) { - b.append("\nContext stack trace: "); - for (int i = contextStack.size() - 1; i >= 0; i--) { - b.append("[" + contextStack.get(i) + "]"); - } - } - return super.getMessage() + b.toString(); - - } -} diff --git a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/TuscanyRuntimeException.java b/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/TuscanyRuntimeException.java deleted file mode 100644 index 922705f7b5..0000000000 --- a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/TuscanyRuntimeException.java +++ /dev/null @@ -1,91 +0,0 @@ -package org.apache.tuscany.common; - -import java.util.ArrayList; -import java.util.List; - -/** - * The root unchecked exception for the Tuscany runtime - * - * @version $Rev: 368822 $ $Date: 2006-01-13 10:54:38 -0800 (Fri, 13 Jan 2006) $ - */ - -public abstract class TuscanyRuntimeException extends RuntimeException { - - protected List contextStack; - - protected String moduleComponentName; - - protected String componentName; - - public TuscanyRuntimeException() { - super(); - } - - public TuscanyRuntimeException(String message) { - super(message); - } - - public TuscanyRuntimeException(String message, Throwable cause) { - super(message, cause); - } - - public TuscanyRuntimeException(Throwable cause) { - super(cause); - } - - /** - * Returns a collection of names representing the context call stack where the error occured. The top of the stack - * is the first element in the collection. - */ - public List returnContextNames(String name) { - if (contextStack == null) { - contextStack = new ArrayList(); - } - return contextStack; - } - - /** - * Pushes a context name where an error occured onto the call stack - */ - public void addContextName(String name) { - if (contextStack == null) { - contextStack = new ArrayList(); - } - contextStack.add(name); - } - - private String identifier; - - /** - * Returns a string representing additional error information referred to in the error message - */ - public String getIdentifier() { - return identifier; - } - - /** - * Sets an additional error information referred to in the error message - */ - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - - public String getMessage() { - if (identifier == null && contextStack == null) { - return super.getMessage(); - } - StringBuffer b = new StringBuffer(); - if (identifier != null) { - b.append(" [" + identifier + "]"); - } - if (contextStack != null) { - b.append("\nContext stack trace: "); - for (int i = contextStack.size() - 1; i >= 0; i--) { - b.append("[" + contextStack.get(i) + "]"); - } - } - return super.getMessage() + b.toString(); - - } - -} diff --git a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/discovery/util/ServiceProviderRegistry.java b/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/discovery/util/ServiceProviderRegistry.java deleted file mode 100644 index 65ede08a32..0000000000 --- a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/discovery/util/ServiceProviderRegistry.java +++ /dev/null @@ -1,177 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.common.discovery.util; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.URL; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Enumeration; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.WeakHashMap; - -import org.apache.tuscany.common.io.util.FixedURLInputStream; - -//FIXME Port to 1.5 collections - -/** - * A Registry for service providers defined using the - * JAR service provider mechanism. - * - */ -public class ServiceProviderRegistry { - - private Map registry = Collections.synchronizedMap(new WeakHashMap()); - - private final static ServiceProviderRegistry instance = new ServiceProviderRegistry(); - - /** - * Constructor. - */ - public ServiceProviderRegistry() { - super(); - } - - /** - * @return Returns the instance. - */ - public static ServiceProviderRegistry getInstance() { - return instance; - } - - /** - * Get the available providers of a given type. - * - * @param clazz - * @return - */ - public List getServiceProviders(final Class clazz) { - List providers = (List) registry.get(clazz); - if (providers != null) - return providers; - - providers = (List) AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - return loadServiceProviders(clazz); - } - }); - - registry.put(clazz, providers); - return providers; - } - - /** - * Get an provider of a given type. - * - * @param clazz - * @return - */ - public Object getServiceProvider(Class clazz) { - List providers = getServiceProviders(clazz); - if (providers.isEmpty()) - return null; - else { - return providers.get(0); - } - } - - /** - * Registers an provider programatically - * - * @param clazz - * @param provider - */ - public void registerServiceProvider(Class clazz, Object provider) { - getServiceProviders(clazz).add(provider); - } - - /** - * Load providers of the given type - * - * @param clazz - * @return - */ - private List loadServiceProviders(Class clazz) { - List classNames = new ArrayList(); - - // First look for a system property named - String className = System.getProperty(clazz.getName()); - if (className != null) - classNames.add(className); - - // Find all the class names mentioned in all the META-INF/services/ - ClassLoader loader = Thread.currentThread().getContextClassLoader(); - try { - Enumeration files = loader.getResources("META-INF/services/" + clazz.getName()); - while (files.hasMoreElements()) { - URL url = (URL) files.nextElement(); - readClassNames(url, classNames); - } - } catch (IOException e) { - } - - // Instantiate an provider for each of the named classes - List providers = new ArrayList(); - Iterator i = classNames.iterator(); - while (i.hasNext()) { - String name = (String) i.next(); - try { - Class providerClass = Class.forName(name, true, loader); - providers.add(providerClass.newInstance()); - } catch (Exception e) { - // Ignore ClassNotFoundException - } - } - return providers; - } - - /** - * Read class names from the given URL. - * @param url - * @param classNames - * @throws IOException - */ - private void readClassNames(URL url, List classNames) throws IOException { - InputStream is = new FixedURLInputStream(url); - try { - BufferedReader in = new BufferedReader(new InputStreamReader(is, "UTF-8")); - String inputLine = null; - while ((inputLine = in.readLine()) != null) { - int i = inputLine.indexOf('#'); - if (i >= 0) { - inputLine = inputLine.substring(0, i); - } - inputLine = inputLine.trim(); - if (inputLine.length() > 0) { - if (!classNames.contains(inputLine)) { - classNames.add(inputLine); - } - } - } - } finally { - is.close(); - } - } - -} diff --git a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/io/util/ClassLoaderObjectInputStream.java b/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/io/util/ClassLoaderObjectInputStream.java deleted file mode 100644 index 607267a464..0000000000 --- a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/io/util/ClassLoaderObjectInputStream.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.common.io.util; - -import java.io.IOException; -import java.io.InputStream; -import java.io.ObjectInputStream; -import java.io.ObjectStreamClass; -import java.security.AccessController; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; - -/** - *

- * An implementation of an ObjectInputStream that takes a ClassLoader or works - * with the current Thread context ClassLoader. - */ -public class ClassLoaderObjectInputStream extends ObjectInputStream { - protected ClassLoader classLoader; - - /** - * Constructor - * - * @param in - * @param classLoader - * @throws IOException - */ - public ClassLoaderObjectInputStream(InputStream in, ClassLoader classLoader) throws IOException { - super(in); - this.classLoader = classLoader; - } - - /** - * @see java.io.ObjectInputStream#resolveClass(java.io.ObjectStreamClass) - */ - protected Class resolveClass(final ObjectStreamClass desc) throws IOException, ClassNotFoundException { - - final String name = desc.getName(); - try { - return (Class) AccessController.doPrivileged(new PrivilegedExceptionAction() { - public Object run() throws ClassNotFoundException, IOException { - try { - return Class.forName(name, false, classLoader); - } catch (ClassNotFoundException e) { - return ClassLoaderObjectInputStream.super.resolveClass(desc); - } - } - }); - } catch (PrivilegedActionException ex) { - Exception e = ex.getException(); - if (e instanceof ClassNotFoundException) { - throw (ClassNotFoundException) e; - } else if (e instanceof IOException) { - throw (IOException) e; - } - return null; - } - } -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/io/util/FixedURLClassLoader.java b/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/io/util/FixedURLClassLoader.java deleted file mode 100644 index f2f6f958f7..0000000000 --- a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/io/util/FixedURLClassLoader.java +++ /dev/null @@ -1,310 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.common.io.util; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.JarURLConnection; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLClassLoader; -import java.net.URLConnection; -import java.net.URLStreamHandler; -import java.net.URLStreamHandlerFactory; -import java.security.Permission; -import java.util.Map; -import java.util.jar.JarEntry; -import java.util.jar.JarFile; - -/** - *

- * This class is a workaround for URL stream issue as illustrated below. - *

- * InputStream is=url.getInputStream(); - * is.close(); // This line doesn't close the JAR file if the URL is a jar entry like "jar:file:/a.jar!/sca.module" - *

- * We also need to turn off the JarFile cache. - */ -public class FixedURLClassLoader extends URLClassLoader { - - /** - * @param urls - * @param parent - */ - public FixedURLClassLoader(URL[] urls, ClassLoader parent) { - super(normalizeURLs(urls), parent, new FixedURLStreamHandlerFactory()); - } - - private static URL[] normalizeURLs(URL[] urls) { - URL[] newURLs = new URL[urls.length]; - for (int i = 0; i < urls.length; i++) - try { - /** - * Any URL that ends with a '/' is assumed to refer to a directory. Otherwise, the URL is assumed to - * refer to a JAR file which will be downloaded and opened as needed. - */ - String spec = urls[i].toString(); - if (!(urls[i].getProtocol().equals("jar") || urls[i].getFile().endsWith("/"))) { - spec = "jar:" + spec + "!/"; - } - newURLs[i] = new URL(null, spec, FixedURLStreamHandler.instance); - } catch (MalformedURLException e) { - } - return newURLs; - } - - /** - * @see java.lang.Object#finalize() - */ - protected void finalize() throws Throwable { - super.finalize(); - } - - public static class FixedURLStreamHandlerFactory implements URLStreamHandlerFactory { - public URLStreamHandler createURLStreamHandler(String protocol) { - return FixedURLStreamHandler.instance; - } - } - - public static class FixedURLStreamHandler extends URLStreamHandler { - public static final URLStreamHandler instance = new FixedURLStreamHandler(); - - public FixedURLStreamHandler() { - super(); - } - - protected URLConnection openConnection(URL url) throws IOException { - URLConnection connection = new URL(url.toString()).openConnection(); - connection.setUseCaches(false); - return new FixedURLConnection(connection, url); - } - } - - public static class FixedURLConnection extends URLConnection { - private URLConnection connection; - - public FixedURLConnection(URLConnection connection, URL url) { - super(url); - this.connection = connection; - } - - public void addRequestProperty(String key, String value) { - connection.addRequestProperty(key, value); - } - - public void connect() throws IOException { - connection.connect(); - } - - public boolean getAllowUserInteraction() { - return connection.getAllowUserInteraction(); - } - - public Object getContent() throws IOException { - return connection.getContent(); - } - - public Object getContent(Class[] classes) throws IOException { - return connection.getContent(classes); - } - - public String getContentEncoding() { - return connection.getContentEncoding(); - } - - public int getContentLength() { - return connection.getContentLength(); - } - - public String getContentType() { - return connection.getContentType(); - } - - public long getDate() { - return connection.getDate(); - } - - public boolean getDefaultUseCaches() { - return connection.getDefaultUseCaches(); - } - - public boolean getDoInput() { - return connection.getDoInput(); - } - - public boolean getDoOutput() { - return connection.getDoOutput(); - } - - public long getExpiration() { - return connection.getExpiration(); - } - - public String getHeaderField(int n) { - return connection.getHeaderField(n); - } - - public String getHeaderField(String name) { - return connection.getHeaderField(name); - } - - public long getHeaderFieldDate(String name, long Default) { - return connection.getHeaderFieldDate(name, Default); - } - - public int getHeaderFieldInt(String name, int Default) { - return connection.getHeaderFieldInt(name, Default); - } - - public String getHeaderFieldKey(int n) { - return connection.getHeaderFieldKey(n); - } - - public Map getHeaderFields() { - return connection.getHeaderFields(); - } - - public long getIfModifiedSince() { - return connection.getIfModifiedSince(); - } - - public InputStream getInputStream() throws IOException { - if (connection instanceof JarURLConnection && url.toString().startsWith("jar:file:")) { - return getByteArrayInputStream(); - // return new FixedURLInputStream((JarURLConnection) connection); - } else { - return connection.getInputStream(); - } - } - - private InputStream getByteArrayInputStream() throws IOException { - JarFile jFile = null; - try { - String spec = url.toString(); - spec = spec.substring("jar:".length()); - int index = spec.lastIndexOf("!/"); - String file = new URL(spec.substring(0, index)).getFile(); - jFile = new JarFile(file); - String entryName = spec.substring(index + 2); - JarEntry jarEntry = jFile.getJarEntry(entryName); - if (jarEntry != null) { - InputStream jarStream = null; - try { - jarStream = jFile.getInputStream(jarEntry); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - byte buf[] = new byte[4096]; - int length = 0; - length = jarStream.read(buf); - while (length > 0) { - out.write(buf, 0, length); - length = jarStream.read(buf); - } - // out.flush(); - jarStream.close(); - // out.close(); - return new ByteArrayInputStream(out.toByteArray()); - } catch (IOException e) { - if (jarStream != null) - jarStream.close(); - throw e; - } - } else { - throw new IOException("Entry " + entryName + " is not found in " + file); - } - } catch (IOException ex) { - throw ex; - } finally { - if (jFile != null) { - try { - jFile.close(); - } catch (IOException e) { - // Ignore it - } - } - } - } - - public long getLastModified() { - return connection.getLastModified(); - } - - public OutputStream getOutputStream() throws IOException { - return connection.getOutputStream(); - } - - public Permission getPermission() throws IOException { - return connection.getPermission(); - } - - public Map getRequestProperties() { - return connection.getRequestProperties(); - } - - public String getRequestProperty(String key) { - return connection.getRequestProperty(key); - } - - public URL getURL() { - return url; - } - - public boolean getUseCaches() { - return connection.getUseCaches(); - } - - public int hashCode() { - return connection.hashCode(); - } - - public void setAllowUserInteraction(boolean allowuserinteraction) { - connection.setAllowUserInteraction(allowuserinteraction); - } - - public void setDefaultUseCaches(boolean defaultusecaches) { - connection.setDefaultUseCaches(defaultusecaches); - } - - public void setDoInput(boolean doinput) { - connection.setDoInput(doinput); - } - - public void setDoOutput(boolean dooutput) { - connection.setDoOutput(dooutput); - } - - public void setIfModifiedSince(long ifmodifiedsince) { - connection.setIfModifiedSince(ifmodifiedsince); - } - - public void setRequestProperty(String key, String value) { - connection.setRequestProperty(key, value); - } - - public void setUseCaches(boolean usecaches) { - connection.setUseCaches(usecaches); - } - - public String toString() { - return connection.toString(); - } - - } - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/io/util/FixedURLInputStream.java b/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/io/util/FixedURLInputStream.java deleted file mode 100644 index 192798ff26..0000000000 --- a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/io/util/FixedURLInputStream.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.common.io.util; - -import java.io.IOException; -import java.io.InputStream; -import java.net.JarURLConnection; -import java.net.URL; -import java.util.jar.JarFile; - -/** - *

- * This class is a workaround for URL stream issue as illustrated below. - *

- * InputStream is=url.getInputStream(); - * is.close(); // This line doesn't close the JAR file if the URL is a jar entry like "jar:file:/a.jar!/sca.module" - *

- * We also need to turn off the JarFile cache. - */ -public class FixedURLInputStream extends InputStream { - - private JarFile jarFile; - private InputStream is; - - /** - * Constructor - * - * @param url - * @throws IOException - */ - public FixedURLInputStream(URL url) throws IOException { - String protocol = url.getProtocol(); - if (protocol != null && (protocol.equals("jar") || protocol.equals("wsjar"))) { - String urlStr = url.toString(); - if (urlStr.startsWith("wsjar:")) { - url = new URL("jar:" + urlStr.substring(6)); - } - JarURLConnection connection = (JarURLConnection) url.openConnection(); - // We cannot use cache - connection.setUseCaches(false); - try { - is = connection.getInputStream(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - jarFile = connection.getJarFile(); - } else { - is = url.openStream(); - } - } - - /** - * Constructor - * - * @param connection - * @throws IOException - */ - public FixedURLInputStream(JarURLConnection connection) throws IOException { - // We cannot use cache - connection.setUseCaches(false); - is = connection.getInputStream(); - jarFile = connection.getJarFile(); - } - - public int available() throws IOException { - return is.available(); - } - - public void close() throws IOException { - is.close(); - // We need to close the JAR file - if (jarFile != null) - jarFile.close(); - } - - public synchronized void mark(int readlimit) { - is.mark(readlimit); - } - - public boolean markSupported() { - return is.markSupported(); - } - - public int read() throws IOException { - return is.read(); - } - - public int read(byte[] b, int off, int len) throws IOException { - return is.read(b, off, len); - } - - public int read(byte[] b) throws IOException { - return is.read(b); - } - - public synchronized void reset() throws IOException { - is.reset(); - } - - public long skip(long n) throws IOException { - return is.skip(n); - } - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/io/util/IOHelper.java b/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/io/util/IOHelper.java deleted file mode 100644 index 8227a052df..0000000000 --- a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/io/util/IOHelper.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * - * 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. - */ - -package org.apache.tuscany.common.io.util; - -import java.io.BufferedInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -/** - * I/O utility methods - * - * @version $Rev$ $Date$ - */ -public class IOHelper { - - // ---------------------------------- - // Fields - // ---------------------------------- - - public static int BYTES = 8192; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - private IOHelper() { - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public static void copy(InputStream in, OutputStream out) throws IOException { - copy(in, out, -1); - } - - public static void copy(InputStream in, OutputStream out, long byteCount) throws IOException { - byte buffer[] = new byte[BYTES]; - int len = BYTES; - - if (byteCount >= 0) { - while (byteCount > 0) { - if (byteCount < BYTES) { - len = in.read(buffer, 0, (int) byteCount); - } else { - len = in.read(buffer, 0, BYTES); - } - if (len == -1) { - break; - } - byteCount -= len; - out.write(buffer, 0, len); - } - } else { - while (true) { - len = in.read(buffer, 0, BYTES); - if (len < 0) { - break; - } - out.write(buffer, 0, len); - } - } - } - - public static byte[] read(InputStream in) throws IOException { - byte buffer[] = new byte[BYTES]; - ByteArrayOutputStream out = new ByteArrayOutputStream(); - int len = BYTES; - while (true) { - len = in.read(buffer, 0, BYTES); - if (len < 0) { - break; - } - out.write(buffer, 0, len); - } - return out.toByteArray(); - } - - /** - * Removes a directory from the file sytsem - */ - public static boolean deleteDir(File pDir) { - if (pDir.isDirectory()) { - String[] children = pDir.list(); - for (int i = 0; i < children.length; i++) { - boolean success = deleteDir(new File(pDir, children[i])); - if (!success) { - return false; - } - } - } - return pDir.delete(); - } - - /** - * Returns a stream to the resource associated with pPath in the directory - * pRoot - */ - public static InputStream getResource(File pRoot, String pPath) throws FileNotFoundException { - - File[] files = pRoot.listFiles(); - for (int i = 0; i < files.length; i++) { - if (files[i].isFile() && files[i].getName().equals(pPath)) { - return new BufferedInputStream(new FileInputStream(files[i])); - } - } - return null; - } - -} diff --git a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/io/util/UTF8String.java b/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/io/util/UTF8String.java deleted file mode 100644 index 651c81f92a..0000000000 --- a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/io/util/UTF8String.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.common.io.util; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.UnsupportedEncodingException; - -/** - * String encoded with UTF-8 - * - */ -public class UTF8String { - public static final String UTF8 = "UTF-8"; - private String string; - - /** - * - */ - public UTF8String(String str) { - super(); - this.string = str; - } - - public UTF8String(byte[] bytes) { - this(toString(bytes)); - } - - public static String toString(byte[] bytes) { - try { - if (bytes == null) - return null; - return new String(bytes, UTF8); - } catch (UnsupportedEncodingException e) { - throw new UnsupportedOperationException(e.getMessage()); - } - } - - public static byte[] getBytes(String str) { - try { - if (str == null) - return null; - return str.getBytes(UTF8); - } catch (UnsupportedEncodingException e) { - throw new UnsupportedOperationException(e.getMessage()); - } - } - - public ByteArrayInputStream getInputStream() { - return new ByteArrayInputStream(getBytes()); - } - - public static ByteArrayInputStream getInputStream(String str) { - return new ByteArrayInputStream(getBytes(str)); - } - - public static String toString(ByteArrayOutputStream bos) { - try { - return bos.toString(UTF8); - } catch (UnsupportedEncodingException e) { - throw new UnsupportedOperationException(e.getMessage()); - } - } - - public byte[] getBytes() { - try { - if (string == null) - return null; - return string.getBytes(UTF8); - } catch (UnsupportedEncodingException e) { - throw new UnsupportedOperationException(e.getMessage()); - } - } - - public String toString() { - return string; - } - - public int hashCode() { - return (string == null) ? 0 : string.hashCode(); - } - - public boolean equals(Object object) { - if (!(object instanceof UTF8String)) - return false; - UTF8String s = (UTF8String) object; - if (string == s.string) - return true; - if (string == null || s.string == null) - return false; - return string.equals(s.string); - } -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/monitor/LogLevel.java b/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/monitor/LogLevel.java deleted file mode 100644 index f3362b13cb..0000000000 --- a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/monitor/LogLevel.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.common.monitor; - -import static java.lang.annotation.ElementType.METHOD; -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import java.lang.annotation.Target; - -/** - * Annotation that can be applied to methods in a monitoring interface - * to indicate to logging frameworks the severity of the event. - * - * @version $Rev$ $Date$ - */ -@Target({METHOD}) -@Retention(RUNTIME) -public @interface LogLevel { - /** - * The log level as specified by {@link java.util.logging.Level}. - */ - String value(); -} diff --git a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/monitor/MonitorFactory.java b/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/monitor/MonitorFactory.java deleted file mode 100644 index aa92092005..0000000000 --- a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/monitor/MonitorFactory.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.common.monitor; - -/** - * A MonitorFactory creates implementations of components' monitor interfaces - * that interface with a its monitoring scheme. For example, a implementation - * may create versions that emit appropriate logging events or which send - * notifications to a management API. - * - * @version $Rev$ $Date$ - */ -public interface MonitorFactory { - /** - * Return a monitor for a component's monitor interface. - * - * @param monitorInterface the component's monitoring interface - * @return an implementation of the monitoring interface; will not be null - */ - T getMonitor(Class monitorInterface); -} diff --git a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/monitor/impl/InvalidLevelException.java b/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/monitor/impl/InvalidLevelException.java deleted file mode 100644 index cfb924d8fb..0000000000 --- a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/monitor/impl/InvalidLevelException.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.common.monitor.impl; - -/** - * @version $Rev$ $Date$ - */ -public class InvalidLevelException extends IllegalArgumentException { - private final String method; - private final String level; - - public InvalidLevelException(String method, String level) { - super(); - this.method = method; - this.level = level; - } - - public String getMethod() { - return method; - } - - public String getLevel() { - return level; - } - - public String getMessage() { - return "Invalid level for method " + method + " : " + level; - } -} diff --git a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/monitor/impl/JavaLoggingMonitorFactory.java b/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/monitor/impl/JavaLoggingMonitorFactory.java deleted file mode 100644 index 06bb87d6dd..0000000000 --- a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/monitor/impl/JavaLoggingMonitorFactory.java +++ /dev/null @@ -1,139 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.common.monitor.impl; - -import java.lang.ref.WeakReference; -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; -import java.util.WeakHashMap; -import java.util.Map; -import java.util.HashMap; -import java.util.Properties; -import java.util.Iterator; -import java.util.logging.Logger; -import java.util.logging.Level; - -import org.apache.tuscany.common.monitor.MonitorFactory; -import org.apache.tuscany.common.monitor.LogLevel; - -/** - * A factory for monitors that forwards events to a {@link java.util.logging.Logger Java Logging (JSR47) Logger}. - * - * @version $Rev$ $Date$ - */ -public class JavaLoggingMonitorFactory implements MonitorFactory { - private final String bundleName; - private final Level defaultLevel; - private final Map levels; - - private final Map, WeakReference> proxies = new WeakHashMap(); - - /** - * - * @param levels - * @param defaultLevel - * @param bundleName - */ - public JavaLoggingMonitorFactory(Properties levels, Level defaultLevel, String bundleName) { - this.defaultLevel = defaultLevel; - this.bundleName = bundleName; - this.levels = new HashMap(levels.size()); - for (Iterator> i = levels.entrySet().iterator(); i.hasNext();) { - Map.Entry entry = i.next(); - String method = (String) entry.getKey(); - String level = (String) entry.getValue(); - try { - this.levels.put(method, Level.parse(level)); - } catch (IllegalArgumentException e) { - throw new InvalidLevelException(method, level); - } - } - } - - public synchronized T getMonitor(Class monitorInterface) { - T proxy = getCachedMonitor(monitorInterface); - if (proxy == null) { - proxy = createMonitor(monitorInterface); - proxies.put(monitorInterface, new WeakReference(proxy)); - } - return proxy; - } - - private T getCachedMonitor(Class monitorInterface) { - WeakReference ref = (WeakReference) proxies.get(monitorInterface); - return (ref != null) ? ref.get() : null; - } - - private T createMonitor(Class monitorInterface) { - String className = monitorInterface.getName(); - Logger logger = Logger.getLogger(className, bundleName); - Method[] methods = monitorInterface.getMethods(); - Map levels = new HashMap(methods.length); - for (int i = 0; i < methods.length; i++) { - Method method = methods[i]; - String key = className + '#' + method.getName(); - Level level = this.levels.get(key); - - // if not specified the in config properties, look for an annotation on the method - if (level == null) { - LogLevel annotation = method.getAnnotation(LogLevel.class); - if (annotation != null && annotation.value() != null) { - try { - level = Level.parse(annotation.value()); - } catch (IllegalArgumentException e) { - // bad value, just use the default - level = defaultLevel; - } - } - } - if (level != null) { - levels.put(method.getName(), level); - } - } - InvocationHandler handler = new LoggingHandler(logger, levels); - return (T) Proxy.newProxyInstance(monitorInterface.getClassLoader(), new Class[]{monitorInterface}, handler); - } - - private static final class LoggingHandler implements InvocationHandler { - private final Logger logger; - private final Map methodLevels; - - public LoggingHandler(Logger logger, Map methodLevels) { - this.logger = logger; - this.methodLevels = methodLevels; - } - - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - String sourceMethod = method.getName(); - Level level = methodLevels.get(sourceMethod); - if (level != null && logger.isLoggable(level)) { - // construct the key for the resource bundle - String className = logger.getName(); - String key = className + '#' + sourceMethod; - - // if the only argument is a Throwable use the special logger for it - if (args != null && args.length == 1 && args[0] instanceof Throwable) { - logger.logp(level, className, sourceMethod, key, (Throwable) args[0]); - } else { - logger.logp(level, className, sourceMethod, key, args); - } - } - return null; - } - } -} diff --git a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/monitor/impl/NullMonitorFactory.java b/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/monitor/impl/NullMonitorFactory.java deleted file mode 100644 index a2bbbd3965..0000000000 --- a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/monitor/impl/NullMonitorFactory.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.common.monitor.impl; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; - -import org.apache.tuscany.common.monitor.MonitorFactory; - -/** - * Implementation of a {@link MonitorFactory} that produces implementations that simply return. - * - * @version $Rev$ $Date$ - */ -public class NullMonitorFactory implements MonitorFactory { - public T getMonitor(Class monitorInterface) { - /* - * This uses a reflection proxy to implement the monitor interface which - * is a simple but perhaps not very performant solution. Performance - * might be improved by code generating an implementation with empty methods. - */ - return monitorInterface.cast(Proxy.newProxyInstance(monitorInterface.getClassLoader(), new Class[]{monitorInterface}, NULL_MONITOR)); - } - - /** - * Singleton invocation hander that does nothing. - */ - private static final InvocationHandler NULL_MONITOR = new InvocationHandler() { - public Object invoke(Object proxy, Method method, Object[] args) { - return null; - } - }; -} diff --git a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/resource/ResourceLoader.java b/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/resource/ResourceLoader.java deleted file mode 100644 index 9771c1e966..0000000000 --- a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/resource/ResourceLoader.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.common.resource; - -import java.io.IOException; -import java.net.URL; -import java.util.Iterator; -import java.util.List; - -/** - * Interface which abstracts the implementation of something that is able to - * load resources (such as a ClassLoader). All Tuscany code should use this - * API rather than a ClassLoader directly in order to reduce the risk of - * memory leaks due to ClassLoader references. - * - * @version $Rev: 379878 $ $Date: 2006-02-22 12:45:50 -0800 (Wed, 22 Feb 2006) $ - */ -public interface ResourceLoader { - - /** - * Returns the parent resource loaders. - * - * @return resource loaders that are parents to this one - */ - List getParents(); - - /** - * Loads the class with the specified binary name. - * - * @param name the binary name of the class - * @return the resulting Class object - * @throws ClassNotFoundException if the class was not found - * @see ClassLoader#loadClass(String) - */ - Class loadClass(String name) throws ClassNotFoundException; - - /** - * Converts an array of bytes into a Class. - * @param bytes - * @return - */ - Class addClass(byte[] bytes); - - /** - * Finds the first resource with the given name. - *

- * Each parent is searched first (in the order returned by {@link #getParents()}) - * and the first resource located is found. If no parent returns a resource then - * the first resource defined by this ResourceLoader is returned. - * - * @param name the resource name - * @return a {@link URL} that can be used to read the resource, or null if no resource could be found - * @throws IOException if there was a problem locating the resource - */ - URL getResource(String name) throws IOException; - - /** - * Find resources with the given name that are available directly from this - * ResourceLoader. Resources from parent ResourceLoaders are not returned. - * - * @param name the resource name - * @return an Iterator of {@link URL} objects for the resource - * @throws IOException if there was a problem locating the resources - */ - Iterator getResources(String name) throws IOException; - - /** - * Find resources with the given name that are available from this - * ResourceLoader or any of its parents. - * - * @param name the resource name - * @return an Iterator of {@link URL} objects for the resource - * @throws IOException if there was a problem locating the resources - */ - Iterator getAllResources(String name) throws IOException; - - //FIXME this is temporary to work around classloader problems with SDO when running in Tomcat - ClassLoader getClassLoader(); - -} diff --git a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/resource/impl/ResourceLoaderImpl.java b/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/resource/impl/ResourceLoaderImpl.java deleted file mode 100644 index 5f83596f19..0000000000 --- a/tags/java-stable-20060304/sca/common/src/main/java/org/apache/tuscany/common/resource/impl/ResourceLoaderImpl.java +++ /dev/null @@ -1,175 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.common.resource.impl; - -import java.io.IOException; -import java.lang.ref.WeakReference; -import java.net.URL; -import java.util.Collections; -import java.util.Enumeration; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import org.apache.tuscany.common.resource.ResourceLoader; - -/** - * Default implementation of the ResourceLoader interface. - * - * @version $Rev: 369102 $ $Date: 2006-01-14 13:48:56 -0800 (Sat, 14 Jan 2006) $ - */ -public class ResourceLoaderImpl implements ResourceLoader { - private final WeakReference classLoaderReference; - private WeakReference generatedClassLoaderReference; - private final List parents; - - /** - * A class loader that allows new classes to be defined from an array of bytes - */ - private class GeneratedClassLoader extends ClassLoader { - - /** - * Constructs a new ResourceLoaderImpl.GeneratedClassLoader. - */ - public GeneratedClassLoader(ClassLoader classLoader) { - super(classLoader); - } - - /** - * Converts an array of bytes into a Class. - * @param bytes - * @return - */ - private Class addClass(byte[] bytes) { - return defineClass(null, bytes, 0, bytes.length); - } - - } - - /** - * Constructs a new ResourceLoaderImpl. - * @param classLoader - */ - public ResourceLoaderImpl(ClassLoader classLoader) { - classLoaderReference = new WeakReference(classLoader); - generatedClassLoaderReference = new WeakReference(new GeneratedClassLoader(classLoader)); - ClassLoader parentCL = classLoader.getParent(); - parents = parentCL == null ? Collections.EMPTY_LIST : Collections.singletonList(new ResourceLoaderImpl(parentCL)); - } - - - /** - * Return the classloader backing this resource loader. - * - * @return the classloader that backs this resource loader - * @throws IllegalStateException if the classloader has been garbage collected - */ - //FIXME Temporary used to set the classloader on the thread context, need to changed to private - public ClassLoader getClassLoader() throws IllegalStateException { - ClassLoader cl = classLoaderReference.get(); - if (cl == null) { - throw new IllegalStateException("Referenced ClassLoader has been garbage collected"); - } - return cl; - } - - public List getParents() { - return parents; - } - - public Class loadClass(String name) throws ClassNotFoundException { - GeneratedClassLoader cl = generatedClassLoaderReference.get(); - if (cl != null) { - return Class.forName(name, true, cl); - } else { - return Class.forName(name, true, getClassLoader()); - } - } - - public Class addClass(byte[] bytes) { - GeneratedClassLoader cl = generatedClassLoaderReference.get(); - if (cl == null) { - cl=new GeneratedClassLoader(getClassLoader()); - generatedClassLoaderReference = new WeakReference(cl); - } - return cl.addClass(bytes); - } - - public Iterator getResources(String name) throws IOException { - // This implementation used to cache but users are not likely - // to ask for the same resource multiple times. - - // Create a new set, add all the resources visible from the current ClassLoader - Set set = new HashSet(); - ClassLoader classLoader = getClassLoader(); - for (Enumeration e = classLoader.getResources(name); e.hasMoreElements();) { - set.add(e.nextElement()); - } - - // Remove the resources visible from the parent ClassLoaders - for (ResourceLoader parent : getParents()) { - for (Iterator i = parent.getAllResources(name); i.hasNext();) { - set.remove(i.next()); - } - } - return set.iterator(); - } - - public Iterator getAllResources(String name) throws IOException { - return new EnumerationIterator(getClassLoader().getResources(name)); - } - - public URL getResource(String name) throws IOException { - return getClassLoader().getResource(name); - } - - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof ResourceLoaderImpl)) { - return false; - } - final ResourceLoaderImpl other = (ResourceLoaderImpl) obj; - return getClassLoader() == other.getClassLoader(); - } - - public int hashCode() { - return getClassLoader().hashCode(); - } - - private static class EnumerationIterator implements Iterator { - private final Enumeration e; - - public EnumerationIterator(Enumeration e) { - this.e = e; - } - - public boolean hasNext() { - return e.hasMoreElements(); - } - - public E next() { - return e.nextElement(); - } - - public void remove() { - throw new UnsupportedOperationException(); - } - } -} diff --git a/tags/java-stable-20060304/sca/common/src/main/resources/META-INF/services/org.apache.tuscany.common.logging.LogProvider b/tags/java-stable-20060304/sca/common/src/main/resources/META-INF/services/org.apache.tuscany.common.logging.LogProvider deleted file mode 100644 index 6cf181502c..0000000000 --- a/tags/java-stable-20060304/sca/common/src/main/resources/META-INF/services/org.apache.tuscany.common.logging.LogProvider +++ /dev/null @@ -1 +0,0 @@ -org.apache.tuscany.common.logging.impl.JSR47LogProviderImpl \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/common/src/main/resources/META-INF/services/org.apache.tuscany.common.resource.loader.ResourceLoaderProvider b/tags/java-stable-20060304/sca/common/src/main/resources/META-INF/services/org.apache.tuscany.common.resource.loader.ResourceLoaderProvider deleted file mode 100644 index 70456ec1d0..0000000000 --- a/tags/java-stable-20060304/sca/common/src/main/resources/META-INF/services/org.apache.tuscany.common.resource.loader.ResourceLoaderProvider +++ /dev/null @@ -1 +0,0 @@ -org.apache.tuscany.common.resource.loader.impl.ResourceLoaderProviderImpl \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/common/src/main/resources/org/apache/tuscany/common/Messages.properties b/tags/java-stable-20060304/sca/common/src/main/resources/org/apache/tuscany/common/Messages.properties deleted file mode 100644 index 4581e44bff..0000000000 --- a/tags/java-stable-20060304/sca/common/src/main/resources/org/apache/tuscany/common/Messages.properties +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable. -# -# 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. -# ==================================================================== -# To code developer: -# Do NOT change the properties between this line and the -# "%%% END OF TRANSLATED PROPERTIES %%%" line. -# Make a new property name, append to the end of the file and change -# the code to use the new property. -# ==================================================================== - -# ===================================================================== -# %%% END OF TRANSLATED PROPERTIES %%% -# ===================================================================== -# NLS_MESSAGEFORMAT_ALL diff --git a/tags/java-stable-20060304/sca/common/src/test/java/org/apache/tuscany/common/monitor/impl/JavaLoggingTestCase.java b/tags/java-stable-20060304/sca/common/src/test/java/org/apache/tuscany/common/monitor/impl/JavaLoggingTestCase.java deleted file mode 100644 index 011ccf63ab..0000000000 --- a/tags/java-stable-20060304/sca/common/src/test/java/org/apache/tuscany/common/monitor/impl/JavaLoggingTestCase.java +++ /dev/null @@ -1,145 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.common.monitor.impl; - -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; -import java.util.logging.Handler; -import java.util.logging.Level; -import java.util.logging.LogRecord; -import java.util.logging.Logger; - -import junit.framework.TestCase; - -import org.apache.tuscany.common.monitor.MonitorFactory; -import org.apache.tuscany.common.monitor.LogLevel; - -/** - * @version $Rev$ $Date$ - */ -public class JavaLoggingTestCase extends TestCase { - private static final Logger logger = Logger.getLogger(Monitor.class.getName()); - private static final MockHandler handler = new MockHandler(); - - private MonitorFactory factory; - - /** - * Smoke test to ensure the logger is working - */ - public void testLogger() { - logger.info("test"); - assertEquals(1, handler.logs.size()); - } - - public void testUnloggedEvent() { - Monitor mon = factory.getMonitor(Monitor.class); - mon.eventNotToLog(); - assertEquals(0, handler.logs.size()); - } - - public void testEventWithNoArgs() { - Monitor mon = factory.getMonitor(Monitor.class); - mon.eventWithNoArgs(); - assertEquals(1, handler.logs.size()); - LogRecord record = handler.logs.get(0); - assertEquals(Level.INFO, record.getLevel()); - assertEquals(logger.getName(), record.getLoggerName()); - assertEquals(Monitor.class.getName() + "#eventWithNoArgs", record.getMessage()); - } - - public void testEventWithAnnotation() { - Monitor mon = factory.getMonitor(Monitor.class); - mon.eventWithAnnotation(); - assertEquals(1, handler.logs.size()); - LogRecord record = handler.logs.get(0); - assertEquals(Level.INFO, record.getLevel()); - assertEquals(logger.getName(), record.getLoggerName()); - assertEquals(Monitor.class.getName() + "#eventWithAnnotation", record.getMessage()); - } - - public void testEventWithThrowable() { - Exception e = new Exception(); - Monitor mon = factory.getMonitor(Monitor.class); - mon.eventWithThrowable(e); - assertEquals(1, handler.logs.size()); - LogRecord record = handler.logs.get(0); - assertEquals(Level.WARNING, record.getLevel()); - assertEquals(logger.getName(), record.getLoggerName()); - assertEquals(Monitor.class.getName() + "#eventWithThrowable", record.getMessage()); - assertSame(e, record.getThrown()); - } - - public void testEventWithOneArg() { - Monitor mon = factory.getMonitor(Monitor.class); - mon.eventWithOneArg("ARG"); - assertEquals(1, handler.logs.size()); - LogRecord record = handler.logs.get(0); - assertEquals(Monitor.class.getName() + "#eventWithOneArg", record.getMessage()); - assertEquals(Monitor.class.getName(), record.getResourceBundleName()); - } - - protected void setUp() throws Exception { - super.setUp(); - logger.setUseParentHandlers(false); - logger.addHandler(handler); - handler.flush(); - - String sourceClass = Monitor.class.getName(); - Properties levels = new Properties(); - levels.setProperty(sourceClass + "#eventWithNoArgs", "INFO"); - levels.setProperty(sourceClass + "#eventWithOneArg", "INFO"); - levels.setProperty(sourceClass + "#eventWithThrowable", "WARNING"); - factory = new JavaLoggingMonitorFactory(levels, Level.FINE, sourceClass); - } - - protected void tearDown() throws Exception { - logger.removeHandler(handler); - handler.flush(); - super.tearDown(); - } - - public static class MockHandler extends Handler { - List logs = new ArrayList(); - - public void publish(LogRecord record) { - logs.add(record); - } - - public void flush() { - logs.clear(); - } - - public void close() throws SecurityException { - } - } - - public static interface Monitor { - void eventNotToLog(); - - void eventWithNoArgs(); - - void eventWithOneArg(String msg); - - void eventWithTwoArgs(String m1, String m2); - - void eventWithThrowable(Exception e); - - @LogLevel("INFO") - void eventWithAnnotation(); - } -} diff --git a/tags/java-stable-20060304/sca/common/src/test/resources/org/apache/tuscany/common/monitor/impl/JavaLoggingTestCase$Monitor.properties b/tags/java-stable-20060304/sca/common/src/test/resources/org/apache/tuscany/common/monitor/impl/JavaLoggingTestCase$Monitor.properties deleted file mode 100644 index e16fa437fa..0000000000 --- a/tags/java-stable-20060304/sca/common/src/test/resources/org/apache/tuscany/common/monitor/impl/JavaLoggingTestCase$Monitor.properties +++ /dev/null @@ -1 +0,0 @@ -org.apache.tuscany.common.monitor.impl.JavaLoggingTestCase$Monitor#eventWithOneArg=Log message with arg={0} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/container.java/LICENSE.txt b/tags/java-stable-20060304/sca/container.java/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/tags/java-stable-20060304/sca/container.java/LICENSE.txt +++ /dev/null @@ -1,202 +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/tags/java-stable-20060304/sca/container.java/pom.xml b/tags/java-stable-20060304/sca/container.java/pom.xml deleted file mode 100644 index a6558658b3..0000000000 --- a/tags/java-stable-20060304/sca/container.java/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - org.apache.tuscany - tuscany-sca - SNAPSHOT - - 4.0.0 - tuscany-container-java - Tuscany Java IoC Container - Container for managing components as defined by the SCA implementation specification. - SNAPSHOT - - - - org.apache.tuscany - tuscany-core - ${pom.version} - compile - - - - junit - junit - 3.8.1 - test - - - diff --git a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/assembly/JavaAssemblyFactory.java b/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/assembly/JavaAssemblyFactory.java deleted file mode 100644 index 3ed37e70ff..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/assembly/JavaAssemblyFactory.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly; - -import org.apache.tuscany.model.assembly.AssemblyFactory; - - -/** - * The Factory for the model. - */ -public interface JavaAssemblyFactory extends AssemblyFactory { - - /** - * Returns a new JavaImplementation. - */ - JavaImplementation createJavaImplementation(); - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/assembly/JavaImplementation.java b/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/assembly/JavaImplementation.java deleted file mode 100644 index e8cf6b4014..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/assembly/JavaImplementation.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly; - -import org.apache.tuscany.model.assembly.ComponentImplementation; - - -/** - * Represents a java implementation. - */ -public interface JavaImplementation extends ComponentImplementation { - - /** - * Returns the implementation class. - */ - Class getImplementationClass(); - - /** - * Sets the implementation class. - */ - void setImplementationClass(Class value); - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/assembly/impl/JavaAssemblyFactoryImpl.java b/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/assembly/impl/JavaAssemblyFactoryImpl.java deleted file mode 100644 index c8f29a2140..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/assembly/impl/JavaAssemblyFactoryImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly.impl; - -import org.apache.tuscany.container.java.assembly.JavaAssemblyFactory; -import org.apache.tuscany.container.java.assembly.JavaImplementation; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; - -/** - * A factory for the model. - */ -public class JavaAssemblyFactoryImpl extends AssemblyFactoryImpl implements JavaAssemblyFactory { - - /** - * Constructor - */ - public JavaAssemblyFactoryImpl() { - super(); - } - - /** - * @see org.apache.tuscany.container.java.assembly.JavaAssemblyFactory#createJavaImplementation() - */ - public JavaImplementation createJavaImplementation() { - return new JavaImplementationImpl(); - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/assembly/impl/JavaImplementationImpl.java b/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/assembly/impl/JavaImplementationImpl.java deleted file mode 100644 index 5ed0109b1d..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/assembly/impl/JavaImplementationImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly.impl; - -import java.net.URL; - -import org.apache.tuscany.container.java.assembly.JavaAssemblyFactory; -import org.apache.tuscany.container.java.assembly.JavaImplementation; -import org.apache.tuscany.core.config.impl.Java5ComponentTypeIntrospector; -import org.apache.tuscany.core.config.ComponentTypeIntrospector; -import org.apache.tuscany.core.config.ConfigurationException; -import org.apache.tuscany.core.config.JavaIntrospectionHelper; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.ComponentType; -import org.apache.tuscany.model.assembly.impl.ComponentImplementationImpl; - -/** - * An implementation of JavaImplementation. - */ -public class JavaImplementationImpl extends ComponentImplementationImpl implements JavaImplementation { - - private Class implementationClass; - - /** - * Constructor - */ - protected JavaImplementationImpl() { - } - - /** - * @see org.apache.tuscany.container.java.assembly.JavaImplementation#getImplementationClass() - */ - public Class getImplementationClass() { - return implementationClass; - } - - /** - * @see org.apache.tuscany.container.java.assembly.JavaImplementation#setImplementationClass(java.lang.Class) - */ - public void setImplementationClass(Class value) { - checkNotFrozen(); - implementationClass=value; - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) - */ - public void initialize(AssemblyModelContext modelContext) { - if (isInitialized()) - return; - - // Initialize the component type - ComponentType componentType=getComponentType(); - if (componentType==null) { - componentType=createComponentType(modelContext, implementationClass); - setComponentType(componentType); - } - - super.initialize(modelContext); - } - - /** - * Create the component type - * @param modelContext - * @param implClass - */ - private static ComponentType createComponentType(AssemblyModelContext modelContext, Class implClass) { - String baseName = JavaIntrospectionHelper.getBaseName(implClass); - URL componentTypeFile = implClass.getResource(baseName + ".componentType"); - if (componentTypeFile != null) { - return modelContext.getAssemblyLoader().loadComponentType(componentTypeFile.toString()); - } else { - JavaAssemblyFactory factory = new JavaAssemblyFactoryImpl(); - ComponentTypeIntrospector introspector = new Java5ComponentTypeIntrospector(factory); - try { - return introspector.introspect(implClass); - } catch (ConfigurationException e) { - throw new IllegalArgumentException("Unable to introspect implementation class: " + implClass.getName(), e); - } - } - } - - } diff --git a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/builder/JavaComponentContextBuilder.java b/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/builder/JavaComponentContextBuilder.java deleted file mode 100644 index 9ac030dfb9..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/builder/JavaComponentContextBuilder.java +++ /dev/null @@ -1,348 +0,0 @@ -package org.apache.tuscany.container.java.builder; - -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.tuscany.container.java.assembly.JavaImplementation; -import org.apache.tuscany.container.java.config.JavaComponentRuntimeConfiguration; -import org.apache.tuscany.core.builder.BuilderConfigException; -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.NoAccessorException; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.builder.impl.HierarchicalBuilder; -import org.apache.tuscany.core.builder.impl.ProxyObjectFactory; -import org.apache.tuscany.core.config.JavaIntrospectionHelper; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.injection.EventInvoker; -import org.apache.tuscany.core.injection.FactoryInitException; -import org.apache.tuscany.core.injection.FieldInjector; -import org.apache.tuscany.core.injection.Injector; -import org.apache.tuscany.core.injection.MethodEventInvoker; -import org.apache.tuscany.core.injection.MethodInjector; -import org.apache.tuscany.core.injection.SDOObjectFactory; -import org.apache.tuscany.core.injection.SingletonObjectFactory; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.MethodHashMap; -import org.apache.tuscany.core.invocation.ProxyConfiguration; -import org.apache.tuscany.core.invocation.impl.InvokerInterceptor; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.invocation.spi.ProxyFactoryFactory; -import org.apache.tuscany.core.message.MessageFactory; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.assembly.ConfiguredProperty; -import org.apache.tuscany.model.assembly.ConfiguredReference; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.Service; -import org.apache.tuscany.model.assembly.ServiceContract; -import org.apache.tuscany.model.assembly.SimpleComponent; -import org.osoa.sca.annotations.ComponentName; -import org.osoa.sca.annotations.Context; -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Init; - -import commonj.sdo.DataObject; - -/** - * Builds runtime configurations for component implementations that map to - * {@link org.apache.tuscany.container.java.assembly.JavaImplementation}. The logical model is then decorated with the - * runtime configuration. - * - * @see org.apache.tuscany.core.builder.RuntimeConfiguration - * - * @version $Rev: 368822 $ $Date: 2006-01-13 10:54:38 -0800 (Fri, 13 Jan 2006) $ - */ -@org.osoa.sca.annotations.Scope("MODULE") -public class JavaComponentContextBuilder implements RuntimeConfigurationBuilder { - - private RuntimeContext runtimeContext; - - private ProxyFactoryFactory proxyFactoryFactory; - - private MessageFactory messageFactory; - - /* the top-level builder responsible for evaluating policies */ - private HierarchicalBuilder policyBuilder = new HierarchicalBuilder(); - - @Init(eager = true) - public void init() { - runtimeContext.addBuilder(this); - } - - /** - * @param runtimeContext The runtimeContext to set. - */ - @Autowire - public void setRuntimeContext(RuntimeContext runtimeContext) { - this.runtimeContext = runtimeContext; - } - - /** - * Sets the factory used to construct proxies implmementing the business interface required by a reference - */ - @Autowire - public void setProxyFactoryFactory(ProxyFactoryFactory factory) { - this.proxyFactoryFactory = factory; - } - - /** - * Sets the factory used to construct invocation messages - * - * @param msgFactory - */ - @Autowire - public void setMessageFactory(MessageFactory msgFactory) { - this.messageFactory = msgFactory; - } - - /** - * Adds a builder responsible for creating source-side and target-side invocation chains for a reference. The - * reference builder may be hierarchical, containing other child reference builders that operate on specific - * metadata used to construct and invocation chain. - */ - public void addPolicyBuilder(RuntimeConfigurationBuilder builder) { - policyBuilder.addBuilder(builder); - } - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public JavaComponentContextBuilder() { - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public void build(AssemblyModelObject modelObject, AggregateContext parentContext) throws BuilderException { - if (!(modelObject instanceof SimpleComponent)) { - return; - } - SimpleComponent component = (SimpleComponent) modelObject; - if (component.getComponentImplementation() instanceof JavaImplementation) { - JavaImplementation javaImpl = (JavaImplementation) component.getComponentImplementation(); - // FIXME scope - Scope scope = component.getComponentImplementation().getComponentType().getServices().get(0).getServiceContract() - .getScope(); - Class implClass = null; - Set fields; - Set methods; - try { - implClass = javaImpl.getImplementationClass(); - fields = JavaIntrospectionHelper.getAllFields(implClass); - methods = JavaIntrospectionHelper.getAllUniqueMethods(implClass); - String name = component.getName(); - Constructor ctr = implClass.getConstructor((Class[]) null); - - List injectors = new ArrayList(); - - EventInvoker initInvoker = null; - boolean eagerInit = false; - EventInvoker destroyInvoker = null; - for (Field field : fields) { - ComponentName compName = field.getAnnotation(ComponentName.class); - if (compName != null) { - Injector injector = new FieldInjector(field, new SingletonObjectFactory(name)); - injectors.add(injector); - } - Context context = field.getAnnotation(Context.class); - if (context != null) { - Injector injector = new FieldInjector(field, new SingletonObjectFactory(parentContext)); - injectors.add(injector); - } - } - for (Method method : methods) { - Init init = method.getAnnotation(Init.class); - if (init != null && initInvoker == null) { - initInvoker = new MethodEventInvoker(method); - eagerInit = init.eager(); - continue; - } - // @spec - should we allow the same method to have @init and - // @destroy? - Destroy destroy = method.getAnnotation(Destroy.class); - if (destroy != null && destroyInvoker == null) { - destroyInvoker = new MethodEventInvoker(method); - continue; - } - ComponentName compName = method.getAnnotation(ComponentName.class); - if (compName != null) { - Injector injector = new MethodInjector(method, new SingletonObjectFactory(name)); - injectors.add(injector); - } - Context context = method.getAnnotation(Context.class); - if (context != null) { - Injector injector = new MethodInjector(method, new SingletonObjectFactory(parentContext)); - injectors.add(injector); - } - } - // handle properties - List configuredProperties = component.getConfiguredProperties(); - if (configuredProperties != null) { - for (ConfiguredProperty property : configuredProperties) { - Injector injector = createPropertyInjector(property, fields, methods); - injectors.add(injector); - } - } - JavaComponentRuntimeConfiguration config = new JavaComponentRuntimeConfiguration(name, JavaIntrospectionHelper - .getDefaultConstructor(implClass), eagerInit, initInvoker, destroyInvoker, scope); - component.getComponentImplementation().setRuntimeConfiguration(config); - - // create target-side invocation chains for each service offered by the implementation - for (ConfiguredService configuredService : component.getConfiguredServices()) { - Service service = configuredService.getService(); - ServiceContract serviceContract = service.getServiceContract(); - Map iConfigMap = new MethodHashMap(); - ProxyFactory proxyFactory = proxyFactoryFactory.createProxyFactory(); - Set javaMethods = JavaIntrospectionHelper.getAllUniqueMethods(serviceContract.getInterface()); - for (Method method : javaMethods) { - InvocationConfiguration iConfig = new InvocationConfiguration(method); - iConfigMap.put(method, iConfig); - } - QualifiedName qName = new QualifiedName(component.getName() + QualifiedName.NAME_SEPARATOR + service.getName()); - ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, serviceContract.getInterface() - .getClassLoader(), messageFactory); - proxyFactory.setBusinessInterface(serviceContract.getInterface()); - proxyFactory.setProxyConfiguration(pConfiguration); - config.addTargetProxyFactory(service.getName(), proxyFactory); - configuredService.setProxyFactory(proxyFactory); - if (policyBuilder != null) { - // invoke the reference builder to handle target-side metadata - policyBuilder.build(configuredService, parentContext); - } - // add tail interceptor - for (InvocationConfiguration iConfig : (Collection) iConfigMap.values()) { - iConfig.addTargetInterceptor(new InvokerInterceptor()); - } - - } - - // handle references - List configuredReferences = component.getConfiguredReferences(); - if (configuredReferences != null) { - for (ConfiguredReference reference : configuredReferences) { - ProxyFactory proxyFactory = proxyFactoryFactory.createProxyFactory(); - ServiceContract serviceContract = reference.getReference().getServiceContract(); - Map iConfigMap = new HashMap(); - Set javaMethods = JavaIntrospectionHelper.getAllUniqueMethods(serviceContract.getInterface()); - for (Method method : javaMethods) { - InvocationConfiguration iConfig = new InvocationConfiguration(method); - iConfigMap.put(method, iConfig); - } - String targetCompName = reference.getTargetConfiguredServices().get(0).getAggregatePart().getName(); - String targetSerivceName = reference.getTargetConfiguredServices().get(0).getService().getName(); - - QualifiedName qName = new QualifiedName(targetCompName + "/" + targetSerivceName); - // QualifiedName qName = new QualifiedName(reference.getAggregatePart().getName() + "/" - // + reference.getPort().getName()); - ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, serviceContract.getInterface().getClassLoader(), messageFactory); - proxyFactory.setBusinessInterface(serviceContract.getInterface()); - proxyFactory.setProxyConfiguration(pConfiguration); - config.addSourceProxyFactory(reference.getReference().getName(), proxyFactory); - reference.setProxyFactory(proxyFactory); - if (policyBuilder != null) { - // invoke the reference builder to handle metadata associated with the reference - policyBuilder.build(reference, parentContext); - } - Injector injector = createReferenceInjector(reference.getReference().getName(), proxyFactory, fields, - methods); - injectors.add(injector); - } - } - config.setSetters(injectors); - } catch (BuilderException e) { - e.addContextName(component.getName()); - e.addContextName(parentContext.getName()); - throw e; - } catch (NoSuchMethodException e) { - BuilderConfigException ce = new BuilderConfigException("Class does not have a no-arg constructor", e); - ce.setIdentifier(implClass.getName()); - ce.addContextName(component.getName()); - ce.addContextName(parentContext.getName()); - throw ce; - } - } - } - - // ---------------------------------- - // Private methods - // ---------------------------------- - - /** - * Creates an Injector for component properties - */ - private Injector createPropertyInjector(ConfiguredProperty property, Set fields, Set methods) - throws NoAccessorException { - Object value = property.getValue(); - String propName = property.getProperty().getName(); - Class type = value.getClass(); - - // There is no efficient way to do this - Method method = null; - Field field = JavaIntrospectionHelper.findClosestMatchingField(propName, type, fields); - if (field == null) { - method = JavaIntrospectionHelper.findClosestMatchingMethod(propName, new Class[] { type }, methods); - if (method == null) { - throw new NoAccessorException(propName); - } - } - Injector injector = null; - if (value instanceof DataObject) { - if (field != null) { - injector = new FieldInjector(field, new SDOObjectFactory((DataObject) value)); - } else { - injector = new MethodInjector(method, new SDOObjectFactory((DataObject) value)); - } - } else if (JavaIntrospectionHelper.isImmutable(type)) { - if (field != null) { - injector = new FieldInjector(field, new SingletonObjectFactory(value)); - } else { - injector = new MethodInjector(method, new SingletonObjectFactory(value)); - } - } - return injector; - - } - - /** - * Creates an Injector for service references - */ - private Injector createReferenceInjector(String refName, ProxyFactory proxyFactory, Set fields, Set methods) - throws NoAccessorException, BuilderConfigException { - Method method = null; - Field field = JavaIntrospectionHelper.findClosestMatchingField(refName, proxyFactory.getBusinessInterface(), fields); - if (field == null) { - method = JavaIntrospectionHelper.findClosestMatchingMethod(refName, - new Class[] { proxyFactory.getBusinessInterface() }, methods); - if (method == null) { - throw new NoAccessorException(refName); - } - } - Injector injector; - try { - if (field != null) { - injector = new FieldInjector(field, new ProxyObjectFactory(proxyFactory)); - } else { - injector = new MethodInjector(method, new ProxyObjectFactory(proxyFactory)); - } - } catch (FactoryInitException e) { - BuilderConfigException ce = new BuilderConfigException("Error configuring reference", e); - ce.setIdentifier(refName); - throw ce; - } - return injector; - - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/builder/JavaTargetWireBuilder.java b/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/builder/JavaTargetWireBuilder.java deleted file mode 100644 index 5df160cb54..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/builder/JavaTargetWireBuilder.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.builder; - -import org.apache.tuscany.container.java.config.JavaComponentRuntimeConfiguration; -import org.apache.tuscany.container.java.invocation.ScopedJavaComponentInvoker; -import org.apache.tuscany.core.builder.BuilderConfigException; -import org.apache.tuscany.core.builder.WireBuilder; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -/** - * Completes a wire to a Java-based target component by adding a scoped java invoker to the source chain - * - * @version $Rev$ $Date$ - */ -@Scope("MODULE") -public class JavaTargetWireBuilder implements WireBuilder { - - private RuntimeContext runtimeContext; - - @Autowire - public void setRuntimeContext(RuntimeContext context) { - runtimeContext = context; - } - - public JavaTargetWireBuilder() { - } - - @Init(eager=true) - public void init() { - runtimeContext.addBuilder(this); - } - - public void connect(ProxyFactory sourceFactory, ProxyFactory targetFactory, Class targetType, boolean downScope, - ScopeContext targetScopeContext) throws BuilderConfigException { - if (!(JavaComponentRuntimeConfiguration.class.isAssignableFrom(targetType))) { - return; - } - for (InvocationConfiguration sourceInvocationConfig : sourceFactory.getProxyConfiguration().getInvocationConfigurations() - .values()) { - ScopedJavaComponentInvoker invoker = new ScopedJavaComponentInvoker(sourceFactory.getProxyConfiguration() - .getTargetName(), sourceInvocationConfig.getMethod(), targetScopeContext); - if (downScope) { - // the source scope is shorter than the target, so the invoker can cache the target instance - invoker.setCacheable(false); - } else { - invoker.setCacheable(true); //TODO set to true - } - sourceInvocationConfig.setTargetInvoker(invoker); - } - } - - public void completeTargetChain(ProxyFactory targetFactory, Class targetType, ScopeContext targetScopeContext) - throws BuilderConfigException { - // TODO implement. - // if (!(JavaComponentRuntimeConfiguration.class.isAssignableFrom(targetType))) { - // return; - // } - // for (InvocationConfiguration targetInvocationConfig : - // targetFactory.getProxyConfiguration().getInvocationConfigurations() - // .values()) { - // ScopedJavaComponentInvoker invoker = new ScopedJavaComponentInvoker(targetFactory.getProxyConfiguration() - // .getTargetName(), ((JavaOperationType) targetInvocationConfig.getOperationType()).getJavaMethod(), - // targetScopeContext); - // targetInvocationConfig.setTargetInvoker(invoker); - // } - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/config/JavaComponentRuntimeConfiguration.java b/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/config/JavaComponentRuntimeConfiguration.java deleted file mode 100644 index bfe6dc25d5..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/config/JavaComponentRuntimeConfiguration.java +++ /dev/null @@ -1,151 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.config; - -import java.lang.reflect.Constructor; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.container.java.context.JavaComponentContext; -import org.apache.tuscany.core.builder.ContextCreationException; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.SimpleComponentContext; -import org.apache.tuscany.core.injection.EventInvoker; -import org.apache.tuscany.core.injection.Injector; -import org.apache.tuscany.core.injection.PojoObjectFactory; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.model.assembly.Scope; - -/** - * A RuntimeConfiguration that handles POJO component implementation types - * - * @version $Rev$ $Date$ - */ -public class JavaComponentRuntimeConfiguration implements RuntimeConfiguration { - - // the component name as configured in the hosting module - private String name; - - // the implementation type constructor - private Constructor ctr; - - // injectors for properties, references and other metadata values such as - private List setters; - - // an invoker for a method decorated with @Init - private EventInvoker init; - - // whether the component should be eagerly initialized when its scope starts - private boolean eagerInit; - - // an invoker for a method decorated with @Destroy - private EventInvoker destroy; - - // the scope of the implementation instance - private Scope scope; - - private boolean stateless; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - /** - * Creates the runtime configuration - * - * @param name the SCDL name of the component the context refers to - * @param ctr the implementation type constructor - * @param setters a collection of Injectors used to configure properties, references and other meta - * data values on implementation instances - * @param eagerInit whether the component should be eagerly initialized - * @param init an Invoker pointing to a method on the implementation type decorated with - * @Init - * @param destroy an Invoker pointing to a method on the implementation type decorated with - * @Destroy - * @param scope the scope of the component implementation type - */ - public JavaComponentRuntimeConfiguration(String name, Constructor ctr, List setters, boolean eagerInit, - EventInvoker init, EventInvoker destroy, Scope scope) { - assert (name != null) : "Name was null"; - assert (ctr != null) : "Constructor was null"; - this.name = name; - this.ctr = ctr; - this.setters = setters; - this.eagerInit = eagerInit; - this.init = init; - this.destroy = destroy; - this.scope = scope; - stateless = (scope == Scope.INSTANCE); - } - - public JavaComponentRuntimeConfiguration(String name, Constructor ctr, boolean eagerInit, EventInvoker init, - EventInvoker destroy, Scope scope) { - this(name, ctr, null, eagerInit, init, destroy, scope); - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public String getName() { - return name; - } - - public Scope getScope() { - return scope; - } - - public SimpleComponentContext createInstanceContext() throws ContextCreationException { - PojoObjectFactory objectFactory = new PojoObjectFactory(ctr, null, setters); - return new JavaComponentContext(name, objectFactory, eagerInit, init, destroy, stateless); - } - - private Map targetProxyFactories = new HashMap(); - - public void addTargetProxyFactory(String serviceName, ProxyFactory factory) { - targetProxyFactories.put(serviceName, factory); - } - - public ProxyFactory getTargetProxyFactory(String serviceName) { - return targetProxyFactories.get(serviceName); - } - - public Map getTargetProxyFactories() { - return targetProxyFactories; - } - - private Map sourceProxyFactories = new HashMap(); - - public void addSourceProxyFactory(String referenceName, ProxyFactory factory) { - sourceProxyFactories.put(referenceName, factory); - } - - public ProxyFactory getSourceProxyFactory(String referenceName) { - return sourceProxyFactories.get(referenceName); - } - - public Map getSourceProxyFactories() { - return sourceProxyFactories; - } - - public void setSetters(List setters) { - this.setters = setters; - } - - public void prepare(){ - - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/context/JavaComponentContext.java b/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/context/JavaComponentContext.java deleted file mode 100644 index 0b4a800f1f..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/context/JavaComponentContext.java +++ /dev/null @@ -1,206 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.context; - -import java.util.Iterator; - -import org.apache.tuscany.core.builder.ObjectFactory; -import org.apache.tuscany.core.context.AbstractContext; -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.core.context.ContextInitException; -import org.apache.tuscany.core.context.LifecycleEventListener; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.SimpleComponentContext; -import org.apache.tuscany.core.context.TargetException; -import org.apache.tuscany.core.injection.EventInvoker; -import org.apache.tuscany.core.injection.Injector; -import org.apache.tuscany.core.injection.ObjectCallbackException; -import org.apache.tuscany.core.injection.ObjectCreationException; - -/** - * Manages Java service component implementation instances - * - * @version $Rev$ $Date$ - */ -public class JavaComponentContext extends AbstractContext implements SimpleComponentContext { - - private boolean eagerInit; - - private EventInvoker initInvoker; - - private EventInvoker destroyInvoker; - - private Injector componentName; - - private Injector moduleContext; - - private boolean stateless; - - // the cached target instance - private Object cachedTargetInstance; - - // creates a new implementation instance with injected references and properties - private ObjectFactory objectFactory; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public JavaComponentContext(String name, ObjectFactory objectFactory, boolean eagerInit, EventInvoker initInvoker, - EventInvoker destroyInvoker, boolean stateless) { - super(name); - assert (objectFactory != null) : "Object factory was null"; - if (eagerInit == true && initInvoker == null) { - ContextInitException e = new ContextInitException("No intialization method found for implementation"); - e.setIdentifier(getName()); - throw e; - } - this.objectFactory = objectFactory; - - this.eagerInit = eagerInit; - this.initInvoker = initInvoker; - this.destroyInvoker = destroyInvoker; - this.stateless = stateless; - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public void setName(String name) { - super.setName(name); - } - - protected int type; - - public int getType() { - return type; - } - - public void setType(int type) { - this.type = type; - } - - public synchronized Object getInstance(QualifiedName qName) throws TargetException { - return getInstance(qName, true); - } - - public synchronized Object getInstance(QualifiedName qName, boolean notify) throws TargetException { - //TODO implement returning of proxy and invocation chain for service - if (cachedTargetInstance != null) { - return cachedTargetInstance; // already cached, just return - } - - if (getLifecycleState() == ERROR || getLifecycleState() == CONFIG_ERROR) { - return null; - } - synchronized (this) { - try { - Object instance = objectFactory.getInstance(); - startInstance(instance); - if (notify) { - for (Iterator iter = contextListener.iterator(); iter.hasNext();) { - LifecycleEventListener listener = (LifecycleEventListener) iter.next(); - listener.onInstanceCreate(this); - } - } - setLifecycleState(RUNNING); - if (stateless) { - return instance; - } else { - // cache the actual instance - cachedTargetInstance = instance; - return cachedTargetInstance; - } - } catch (ObjectCreationException e) { - setLifecycleState(Context.ERROR); - TargetException te = new TargetException("Error creating instance for component", e); - te.setIdentifier(getName()); - throw te; - } - } - - } - - public Object getImplementationInstance() throws TargetException{ - //TODO refactor when getInstance() returns a proxy - return getInstance(null); - } - - public Object getImplementationInstance(boolean notify) throws TargetException{ - //TODO refactor when getInstance() returns a proxy - return getInstance(null,notify); - } - - - public boolean isEagerInit() { - return eagerInit; - } - - public boolean isDestroyable() { - return (destroyInvoker != null); - } - - // ---------------------------------- - // Lifecycle methods - // ---------------------------------- - - public void start() throws ContextInitException { - if (getLifecycleState() != UNINITIALIZED && getLifecycleState() != STOPPED) { - throw new IllegalStateException("Component must be in UNINITIALIZED state [" + getLifecycleState() + "]"); - } - if (objectFactory == null) { - setLifecycleState(ERROR); - ContextInitException e = new ContextInitException("Object factory not found"); - e.setIdentifier(getName()); - throw e; - } - setLifecycleState(INITIALIZED); - } - - public void stop() { - if (cachedTargetInstance != null) { - if (destroyInvoker != null) { - try { - destroyInvoker.invokeEvent(cachedTargetInstance); - } catch (ObjectCallbackException e) { - TargetException te = new TargetException(e.getCause()); - te.setIdentifier(getName()); - throw te; - } - } - } - setLifecycleState(STOPPED); - } - - // ---------------------------------- - // Private methods - // ---------------------------------- - private void startInstance(Object instance) throws TargetException { - try { - // handle @Init - if (initInvoker != null) { - initInvoker.invokeEvent(instance); - } - } catch (ObjectCallbackException e) { - TargetException te = new TargetException("Error initializing instance", e); - te.setIdentifier(getName()); - throw te; - } - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/invocation/AbstractJavaComponentInvoker.java b/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/invocation/AbstractJavaComponentInvoker.java deleted file mode 100644 index 0109416e75..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/invocation/AbstractJavaComponentInvoker.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.invocation; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Set; - -import org.apache.tuscany.core.config.JavaIntrospectionHelper; -import org.apache.tuscany.core.context.TargetException; -import org.apache.tuscany.core.invocation.Interceptor; -import org.apache.tuscany.core.invocation.InvocationRuntimeException; -import org.apache.tuscany.core.invocation.TargetInvoker; -import org.apache.tuscany.core.message.Message; - -/** - * Base class for dispatching to a Java based component implementation. Subclasses implement a strategy for resolving - * implementation instances. - * - * @version $Rev$ $Date$ - */ -public abstract class AbstractJavaComponentInvoker implements TargetInvoker { - - protected Method operation; - - public AbstractJavaComponentInvoker(Method operation) { - assert (operation != null) : "Operation method cannot be null"; - this.operation = operation; - } - - public Object invokeTarget(Object payload) throws InvocationTargetException { - try { - Object instance = getInstance(); - if (!operation.getDeclaringClass().isInstance(instance)) { - Set methods = JavaIntrospectionHelper.getAllUniqueMethods(instance.getClass()); - Method newOperation = JavaIntrospectionHelper.findClosestMatchingMethod(operation.getName(), operation - .getParameterTypes(), methods); - if (newOperation != null) - operation = newOperation; - } - if (payload != null && !payload.getClass().isArray()) { - return operation.invoke(instance, payload); - } else { - return operation.invoke(instance, (Object[]) payload); - } - } catch (IllegalAccessException e) { - throw new InvocationRuntimeException(e); - } - } - - public Message invoke(Message msg) { - try { - Object resp = invokeTarget(msg.getBody()); - msg.setBody(resp); - } catch (InvocationTargetException e) { - msg.setBody(e.getCause()); - } catch (Throwable e) { - msg.setBody(e); - } - return msg; - } - - protected abstract Object getInstance() throws TargetException; - - public void setNext(Interceptor next) { - throw new IllegalStateException("This interceptor must be the last interceptor in an interceptor chain"); - } - - public Object clone(){ - try { - AbstractJavaComponentInvoker clone = (AbstractJavaComponentInvoker) super.clone(); - clone.operation = this.operation; - return clone; - } catch (CloneNotSupportedException e) { - return null; // will not happen - } - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/invocation/ScopedJavaComponentInvoker.java b/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/invocation/ScopedJavaComponentInvoker.java deleted file mode 100644 index 4d69ba51f5..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/invocation/ScopedJavaComponentInvoker.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.invocation; - -import java.lang.reflect.Method; - -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.context.TargetException; - -/** - * Uses a scope container to resolve an implementation instance based on the current thread context - * - * @version $Rev$ $Date$ - */ -public class ScopedJavaComponentInvoker extends AbstractJavaComponentInvoker { - - private ScopeContext container; - - private QualifiedName name; - - private Object target; - - public boolean cacheable; - - public ScopedJavaComponentInvoker(QualifiedName serviceName, Method operation, ScopeContext container) { - super(operation); - assert (serviceName != null) : "No service name specified"; - assert (container != null) : "No scope container specified"; - name = serviceName; - this.container = container; - } - - /** - * Returns whether the target is cacheable. - */ - public boolean isCacheable() { - return cacheable; - } - - /** - * Sets whether the target service instance may be cached by the invoker. This is a possible optimization when a - * wire is configured for a "down-scope" reference, i.e. a reference from a source of a shorter lifetime to a source - * of greater lifetime. - */ - public void setCacheable(boolean val) { - cacheable = val; - } - - /** - * Resolves the target service instance or returns a cached one - */ - protected Object getInstance() throws TargetException { - if (!cacheable) { - return container.getInstance(name); - } else { - if (target == null) { - target = container.getInstance(name); - } - return target; - } - } - - public Object clone() { - ScopedJavaComponentInvoker invoker = (ScopedJavaComponentInvoker) super.clone(); - invoker.target = null; - invoker.cacheable = this.cacheable; - invoker.container = this.container; - invoker.name = this.name; - return invoker; - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/invocation/StaticJavaComponentTargetInvoker.java b/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/invocation/StaticJavaComponentTargetInvoker.java deleted file mode 100644 index 8e0342beb7..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/invocation/StaticJavaComponentTargetInvoker.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.invocation; - -import java.lang.reflect.Method; - -/** - * Caches component instances that do not need to be resolved for every invocation, e.g. an invocation originating from - * a lesser scope intended for a target with a wider scope - * - * @version $Rev$ $Date$ - */ -public class StaticJavaComponentTargetInvoker extends AbstractJavaComponentInvoker { - - private Object instance; - - public StaticJavaComponentTargetInvoker(Method operation, Object instance) { - super(operation); - assert (instance != null) : "Instance cannot be null"; - this.instance = instance; - } - - protected Object getInstance() { - return instance; - } - - public boolean isCacheable() { - return true; - } - - public Object clone() { - StaticJavaComponentTargetInvoker invoker = (StaticJavaComponentTargetInvoker) super.clone(); - invoker.instance = null; - return invoker; - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/loader/JavaSCDLModelLoader.java b/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/loader/JavaSCDLModelLoader.java deleted file mode 100644 index e1c50a9ff4..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/main/java/org/apache/tuscany/container/java/loader/JavaSCDLModelLoader.java +++ /dev/null @@ -1,81 +0,0 @@ -package org.apache.tuscany.container.java.loader; - -import org.apache.tuscany.container.java.assembly.JavaAssemblyFactory; -import org.apache.tuscany.container.java.assembly.JavaImplementation; -import org.apache.tuscany.container.java.assembly.impl.JavaAssemblyFactoryImpl; -import org.apache.tuscany.core.loader.SCDLModelLoaderRegistry; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.scdl.loader.SCDLModelLoader; -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Init; - -/** - * Populates the assembly model from an SCDL model - */ -@org.osoa.sca.annotations.Scope("MODULE") -public class JavaSCDLModelLoader implements SCDLModelLoader { - - private RuntimeContext runtimeContext; - private SCDLModelLoaderRegistry loaderRegistry; - private JavaAssemblyFactory javaFactory; - - /** - * Constructs a new JavaSCDLModelLoader. - */ - public JavaSCDLModelLoader() { - this.javaFactory=new JavaAssemblyFactoryImpl(); - } - - /** - * @param runtimeContext The runtimeContext to set. - */ - @Autowire - public void setRuntimeContext(RuntimeContext runtimeContext) { - this.runtimeContext = runtimeContext; - } - -// @Reference - public void setLoaderRegistry(SCDLModelLoaderRegistry registry) { - this.loaderRegistry = registry; - } - - @Init(eager=true) - public void init() { - runtimeContext.addLoader(this); -// loaderRegistry.registerLoader(this); - } - - @Destroy - public void destroy() { -// loaderRegistry.unregisterLoader(this); - } - - /** - * @see org.apache.tuscany.model.scdl.loader.SCDLModelLoader#load(org.apache.tuscany.model.assembly.AssemblyModelContext, java.lang.Object) - */ - public AssemblyModelObject load(AssemblyModelContext modelContext, Object object) { - if (object instanceof org.apache.tuscany.model.scdl.JavaImplementation) { - org.apache.tuscany.model.scdl.JavaImplementation scdlJavaImplementation=(org.apache.tuscany.model.scdl.JavaImplementation)object; - JavaImplementation implementation=javaFactory.createJavaImplementation(); - - //FIXME Temp set the current app classloader on the class to load the impl class - ClassLoader ccl=Thread.currentThread().getContextClassLoader(); - Class implementationClass; - try { - Thread.currentThread().setContextClassLoader(modelContext.getApplicationResourceLoader().getClassLoader()); - implementationClass=modelContext.getApplicationResourceLoader().loadClass(scdlJavaImplementation.getClass_()); - } catch (ClassNotFoundException e) { - throw new IllegalArgumentException(e); - } finally { - Thread.currentThread().setContextClassLoader(ccl); - } - implementation.setImplementationClass(implementationClass); - - return implementation; - } else - return null; - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/main/resources/org/apache/tuscany/container/java/Messages.properties b/tags/java-stable-20060304/sca/container.java/src/main/resources/org/apache/tuscany/container/java/Messages.properties deleted file mode 100644 index 4581e44bff..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/main/resources/org/apache/tuscany/container/java/Messages.properties +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable. -# -# 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. -# ==================================================================== -# To code developer: -# Do NOT change the properties between this line and the -# "%%% END OF TRANSLATED PROPERTIES %%%" line. -# Make a new property name, append to the end of the file and change -# the code to use the new property. -# ==================================================================== - -# ===================================================================== -# %%% END OF TRANSLATED PROPERTIES %%% -# ===================================================================== -# NLS_MESSAGEFORMAT_ALL diff --git a/tags/java-stable-20060304/sca/container.java/src/main/resources/system.fragment b/tags/java-stable-20060304/sca/container.java/src/main/resources/system.fragment deleted file mode 100644 index e29d165b0b..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/main/resources/system.fragment +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/container.java/src/main/test/sca.module b/tags/java-stable-20060304/sca/container.java/src/main/test/sca.module deleted file mode 100644 index e1f10097f4..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/main/test/sca.module +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - MyFoo - 1 - - - TestService2 - - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/impl/JavaImplementationTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/impl/JavaImplementationTestCase.java deleted file mode 100644 index d916f67050..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/impl/JavaImplementationTestCase.java +++ /dev/null @@ -1,137 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly.impl; - -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.common.resource.impl.ResourceLoaderImpl; -import org.apache.tuscany.container.java.assembly.mock.HelloWorldImpl; -import org.apache.tuscany.container.java.assembly.mock.HelloWorldWithFieldProperties; -import org.apache.tuscany.container.java.assembly.mock.NakedHelloWorld; -import org.apache.tuscany.container.java.assembly.mock.NakedHelloWorldWithInterface; -import org.apache.tuscany.model.assembly.ComponentType; -import org.apache.tuscany.model.assembly.Property; -import org.apache.tuscany.model.assembly.Service; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; -import org.apache.tuscany.model.scdl.loader.impl.SCDLAssemblyModelLoaderImpl; - -/** - * @version $Rev$ $Date$ - */ -public class JavaImplementationTestCase extends TestCase { - private JavaImplementationImpl impl = (JavaImplementationImpl) new JavaAssemblyFactoryImpl().createJavaImplementation(); - - public void testFoo() { - impl.setImplementationClass(HelloWorldImpl.class); - - // this is not needed anymore - //assertEquals("org/apache/tuscany/container/java/assembly/mock/HelloWorldImpl.componentType", impl.getComponentTypeName()); - } - - public void testNoImplementationClass() { - //FIXME this test fails with NPE -// impl.setImplementationClass(null); -// try { -// impl.initialize(new AssemblyModelContextImpl(new AssemblyLoaderImpl(), ResourceLoaderFactory.getResourceLoader(Thread.currentThread().getContextClassLoader()))); -// impl.getComponentType(); -// fail("Expected IllegalArgumentException"); -// } catch (IllegalArgumentException e) { -// // ok -// } - } - - public void testNakedHelloWorld() { - impl.setImplementationClass(NakedHelloWorld.class); - impl.initialize(new AssemblyModelContextImpl(new AssemblyFactoryImpl(), new SCDLAssemblyModelLoaderImpl(null), new ResourceLoaderImpl(Thread.currentThread().getContextClassLoader()))); - ComponentType type = impl.getComponentType(); - Assert.assertNotNull(type); - Assert.assertTrue(type.getProperties().isEmpty()); - Assert.assertTrue(type.getReferences().isEmpty()); - List services = type.getServices(); - Assert.assertEquals(1, services.size()); - Assert.assertTrue(services.get(0).getName().equals("NakedHelloWorld")); - } - - public void testNakedHelloWorldWithInterface() { - impl.setImplementationClass(NakedHelloWorldWithInterface.class); - impl.initialize(new AssemblyModelContextImpl(new AssemblyFactoryImpl(), new SCDLAssemblyModelLoaderImpl(null), new ResourceLoaderImpl(Thread.currentThread().getContextClassLoader()))); - ComponentType type = impl.getComponentType(); - Assert.assertNotNull(type); - Assert.assertTrue(type.getProperties().isEmpty()); - Assert.assertTrue(type.getReferences().isEmpty()); - List services = type.getServices(); - Assert.assertEquals(1, services.size()); - Assert.assertTrue(services.get(0).getName().equals("NakedHelloWorldWithInterface")); - } - - public void testHelloWorldWithSidefile() { - impl.setImplementationClass(HelloWorldImpl.class); - impl.initialize(new AssemblyModelContextImpl(new AssemblyFactoryImpl(), new SCDLAssemblyModelLoaderImpl(null), new ResourceLoaderImpl(Thread.currentThread().getContextClassLoader()))); - ComponentType type = impl.getComponentType(); - Assert.assertNotNull(type); - List props = type.getProperties(); - Assert.assertEquals(1, props.size()); - Assert.assertTrue(props.get(0).getName().equals("text")); - - Assert.assertTrue(type.getReferences().isEmpty()); - - List services = type.getServices(); - Assert.assertEquals(1, services.size()); - Assert.assertTrue(services.get(0).getName().equals("HelloWorldService")); - } - - public void testHelloWorldWithFieldProperties() { - impl.setImplementationClass(HelloWorldWithFieldProperties.class); - impl.initialize(new AssemblyModelContextImpl(new AssemblyFactoryImpl(), new SCDLAssemblyModelLoaderImpl(null), new ResourceLoaderImpl(Thread.currentThread().getContextClassLoader()))); - ComponentType type = impl.getComponentType(); - Assert.assertNotNull(type); - List props = type.getProperties(); - Assert.assertEquals(3, props.size()); - - Property prop = type.getProperty("text"); - Assert.assertNotNull(prop); - Assert.assertEquals("text", prop.getName()); - Assert.assertEquals(false, prop.isRequired()); - Assert.assertEquals(String.class, prop.getType()); - - prop = type.getProperty("text2"); - Assert.assertNotNull(prop); - Assert.assertEquals("text2", prop.getName()); - Assert.assertEquals(true, prop.isRequired()); - Assert.assertEquals(Integer.class, prop.getType()); - - prop = type.getProperty("foo"); - Assert.assertNotNull(prop); - Assert.assertEquals("foo", prop.getName()); - Assert.assertEquals(false, prop.isRequired()); - Assert.assertEquals(Integer.TYPE, prop.getType()); - } - - protected void setUp() throws Exception { - super.setUp(); - Thread.currentThread().setContextClassLoader(JavaImplementationTestCase.class.getClassLoader()); - } - - protected void tearDown() throws Exception { - Thread.currentThread().setContextClassLoader(null); - super.tearDown(); - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/HelloWorldImpl.componentType b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/HelloWorldImpl.componentType deleted file mode 100644 index 784d8bf728..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/HelloWorldImpl.componentType +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/HelloWorldImpl.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/HelloWorldImpl.java deleted file mode 100644 index 74f4c658ce..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/HelloWorldImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly.mock; - -/** - * @version $Rev$ $Date$ - */ -public class HelloWorldImpl implements HelloWorldService { - - private String text; - - private int count; - - public String hello(String name) { - ++count; - return "Hello " + name; - } - - public int count() { - return count; - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/HelloWorldService.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/HelloWorldService.java deleted file mode 100644 index a7d0fe7788..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/HelloWorldService.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly.mock; - -/** - * @version $Rev$ $Date$ - */ -public interface HelloWorldService { - String hello(String name); - - public int count(); - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/HelloWorldWithFieldProperties.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/HelloWorldWithFieldProperties.java deleted file mode 100644 index e015e611ae..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/HelloWorldWithFieldProperties.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly.mock; - -import org.osoa.sca.annotations.Property; - -/** - * @version $Rev$ $Date$ - */ -public class HelloWorldWithFieldProperties { - @Property - private String text; - - @Property(required = true) - public Integer text2; - - @Property(name = "foo") - public int text3; - - @Property(name = "not exposed") - protected int field4; - - public String hello(String name) { - return "Hello " + name; - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/NakedHelloWorld.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/NakedHelloWorld.java deleted file mode 100644 index 2f1ae5d17b..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/NakedHelloWorld.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly.mock; - -/** - * @version $Rev$ $Date$ - */ -public class NakedHelloWorld { - public String hello(String name) { - return "Hello " + name; - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/NakedHelloWorldWithInterface.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/NakedHelloWorldWithInterface.java deleted file mode 100644 index 9d5fe5e969..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/mock/NakedHelloWorldWithInterface.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly.mock; - -import java.io.Serializable; - -/** - * @version $Rev$ $Date$ - */ -public class NakedHelloWorldWithInterface implements Serializable { - public String hello(String name) { - return "Hello " + name; - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/JavaAssemblyLoaderTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/JavaAssemblyLoaderTestCase.java deleted file mode 100644 index d5cea8bea2..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/JavaAssemblyLoaderTestCase.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly.tests; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.common.resource.ResourceLoader; -import org.apache.tuscany.common.resource.impl.ResourceLoaderImpl; -import org.apache.tuscany.container.java.assembly.tests.bigbank.account.services.accountdata.AccountDataService; -import org.apache.tuscany.container.java.loader.JavaSCDLModelLoader; -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; -import org.apache.tuscany.model.assembly.loader.AssemblyModelLoader; -import org.apache.tuscany.model.scdl.loader.SCDLModelLoader; -import org.apache.tuscany.model.scdl.loader.impl.SCDLAssemblyModelLoaderImpl; - -/** - */ -public class JavaAssemblyLoaderTestCase extends TestCase { - - /** - * - */ - public JavaAssemblyLoaderTestCase() { - super(); - } - - public void testLoader() { - - ResourceLoader resourceLoader=new ResourceLoaderImpl(Thread.currentThread().getContextClassLoader()); - JavaSCDLModelLoader javaLoader=new JavaSCDLModelLoader(); - List scdlLoaders=new ArrayList(); - scdlLoaders.add(javaLoader); - AssemblyModelLoader assemblyLoader=new SCDLAssemblyModelLoaderImpl(scdlLoaders); - AssemblyFactory assemblyFactory=new AssemblyFactoryImpl(); - AssemblyModelContext modelContext=new AssemblyModelContextImpl(assemblyFactory, assemblyLoader, resourceLoader); - - Module module = assemblyLoader.loadModule(getClass().getResource("sca.module").toString()); - module.initialize(modelContext); - Assert.assertTrue(module.getName().equals("tuscany.container.java.assembly.tests.bigbank.account")); - - Component component=module.getComponent("AccountServiceComponent"); - Assert.assertTrue(component!= null); - - EntryPoint entryPoint=module.getEntryPoint("AccountService"); - Assert.assertTrue(entryPoint!= null); - - Object value = component.getConfiguredProperty("currency").getValue(); - Assert.assertTrue(value.equals("EURO")); - - //ConfiguredService configuredService = component.getConfiguredReference("accountDataService").getTargetConfiguredServices().get(0); - //Assert.assertTrue(configuredService.getAggregatePart().getName().equals("AccountDataServiceComponent")); - - Class interfaceClass = component.getConfiguredReference("accountDataService").getReference().getServiceContract().getInterface(); - Assert.assertTrue(interfaceClass == AccountDataService.class); - - } - - protected void setUp() throws Exception { - super.setUp(); - - Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/account/AccountReport.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/account/AccountReport.java deleted file mode 100644 index 1770c2b011..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/account/AccountReport.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly.tests.bigbank.account.services.account; - -import java.util.List; - -/** - * @model - */ - -public interface AccountReport { - - /** - * @model type="services.account.AccountSummary" - */ - - List getAccountSummaries(); -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/account/AccountService.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/account/AccountService.java deleted file mode 100644 index 1bb938655f..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/account/AccountService.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly.tests.bigbank.account.services.account; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface AccountService { - - public AccountReport getAccountReport(String customerID); -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/account/AccountService.wsdl b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/account/AccountService.wsdl deleted file mode 100644 index 921218c5b9..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/account/AccountService.wsdl +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/account/AccountServiceImpl.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/account/AccountServiceImpl.java deleted file mode 100644 index 9a5ddb0005..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/account/AccountServiceImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly.tests.bigbank.account.services.account; - -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Reference; - -import org.apache.tuscany.container.java.assembly.tests.bigbank.account.services.accountdata.AccountDataService; -import org.apache.tuscany.container.java.assembly.tests.bigbank.account.services.stockquote.StockQuoteService; - -public class AccountServiceImpl implements AccountService { - - @Property - public String currency = "USD"; - - @Reference - public AccountDataService accountDataService; - @Reference - public StockQuoteService stockQuoteService; - - public AccountServiceImpl() { - } - - public AccountReport getAccountReport(String customerID) { - return null; - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/account/AccountSummary.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/account/AccountSummary.java deleted file mode 100644 index 2b11e23425..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/account/AccountSummary.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly.tests.bigbank.account.services.account; - -/** - * @model - */ - -public interface AccountSummary { - - /** - * @model - */ - String getAccountNumber(); - - void setAccountNumber(String accountNumber); - - /** - * @model - */ - String getAccountType(); - - void setAccountType(String accountType); - - /** - * @model - */ - float getBalance(); - - void setBalance(float balance); -} - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java deleted file mode 100644 index 56f24ea4ac..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly.tests.bigbank.account.services.accountdata; - -public interface AccountDataService { - - CheckingAccount getCheckingAccount(String customerID); - - SavingsAccount getSavingsAccount(String customerID); - - StockAccount getStockAccount(String customerID); -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java deleted file mode 100644 index a7a40f954d..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly.tests.bigbank.account.services.accountdata; - -public class AccountDataServiceImpl implements AccountDataService { - - public CheckingAccount getCheckingAccount(String customerID) { - - CheckingAccount checkingAccount = new CheckingAccount(); - checkingAccount.setAccountNumber(customerID + "_" + "CHA12345"); - checkingAccount.setBalance(1500.0f); - - return checkingAccount; - } - - public SavingsAccount getSavingsAccount(String customerID) { - - SavingsAccount savingsAccount = new SavingsAccount(); - savingsAccount.setAccountNumber(customerID + "_" + "SAA12345"); - savingsAccount.setBalance(1500.0f); - - return savingsAccount; - } - - public StockAccount getStockAccount(String customerID) { - - StockAccount stockAccount = new StockAccount(); - stockAccount.setAccountNumber(customerID + "_" + "STA12345"); - stockAccount.setSymbol("IBM"); - stockAccount.setQuantity(100); - - return stockAccount; - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java deleted file mode 100644 index ff84e9968a..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly.tests.bigbank.account.services.accountdata; - -public class CheckingAccount { - - private String accountNumber; - private float balance; - - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - - public float getBalance() { - return balance; - } - - public void setBalance(float balance) { - this.balance = balance; - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java deleted file mode 100644 index b39d9051de..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly.tests.bigbank.account.services.accountdata; - -public class SavingsAccount { - - private String accountNumber; - private float balance; - - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - - public float getBalance() { - return balance; - } - - public void setBalance(float balance) { - this.balance = balance; - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/accountdata/StockAccount.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/accountdata/StockAccount.java deleted file mode 100644 index bce0821b25..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/accountdata/StockAccount.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly.tests.bigbank.account.services.accountdata; - -public class StockAccount { - - private String accountNumber; - private String symbol; - private int quantity; - - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - - public int getQuantity() { - return quantity; - } - - public void setQuantity(int quantity) { - this.quantity = quantity; - } - - public String getSymbol() { - return symbol; - } - - public void setSymbol(String symbol) { - this.symbol = symbol; - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java deleted file mode 100644 index 78ece12b41..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly.tests.bigbank.account.services.stockquote; - -public interface StockQuoteService { - - public float getQuote(String symbol); -} - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/stockquote/StockQuoteServiceImpl.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/stockquote/StockQuoteServiceImpl.java deleted file mode 100644 index fa180d0ceb..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/stockquote/StockQuoteServiceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.assembly.tests.bigbank.account.services.stockquote; - -/* Dummy'd up StockQuoteService, override webservice for now */ - -public class StockQuoteServiceImpl implements StockQuoteService { - - public float getQuote(String symbol) { - // Just hardcode for now - return 83.00f; - } - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl deleted file mode 100644 index 9678d9d6ea..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/builder/JavaComponentContextBuilderTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/builder/JavaComponentContextBuilderTestCase.java deleted file mode 100644 index 4459e9d01d..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/builder/JavaComponentContextBuilderTestCase.java +++ /dev/null @@ -1,111 +0,0 @@ -package org.apache.tuscany.container.java.builder; - -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.common.monitor.impl.NullMonitorFactory; -import org.apache.tuscany.container.java.invocation.mock.MockSyncInterceptor; -import org.apache.tuscany.container.java.mock.MockConfigContext; -import org.apache.tuscany.container.java.mock.MockFactory; -import org.apache.tuscany.container.java.mock.components.GenericComponent; -import org.apache.tuscany.container.java.mock.components.ModuleScopeComponent; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.builder.impl.DefaultWireBuilder; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.context.ScopeStrategy; -import org.apache.tuscany.core.context.impl.AggregateContextImpl; -import org.apache.tuscany.core.context.impl.EventContextImpl; -import org.apache.tuscany.core.context.scope.DefaultScopeStrategy; -import org.apache.tuscany.core.context.scope.ModuleScopeContext; -import org.apache.tuscany.core.invocation.ProxyConfiguration; -import org.apache.tuscany.core.invocation.jdk.JDKProxyFactoryFactory; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.message.impl.MessageFactoryImpl; -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; - -public class JavaComponentContextBuilderTestCase extends TestCase { - - private AssemblyFactory factory = new AssemblyFactoryImpl(); - - private AssemblyModelContext assemblyContext = new AssemblyModelContextImpl(null,null); - - public JavaComponentContextBuilderTestCase() { - } - - public void testBuilder() throws Exception { - JavaComponentContextBuilder builder = new JavaComponentContextBuilder(); - builder.setMessageFactory(new MessageFactoryImpl()); - // HierarchicalBuilder refBuilder = new HierarchicalBuilder(); - MockSyncInterceptor interceptor = new MockSyncInterceptor(); - builder.addPolicyBuilder(new MockInterceptorBuilder(interceptor, true)); - //builder.setPolicyBuilder(refBuilder); - AggregateContext ctx = createContext(); - builder.setProxyFactoryFactory(new JDKProxyFactoryFactory()); - JavaTargetWireBuilder javaWireBuilder = new JavaTargetWireBuilder(); - ScopeStrategy strategy = new DefaultScopeStrategy(); - DefaultWireBuilder wireBuilder = new DefaultWireBuilder(); - wireBuilder.addWireBuilder(javaWireBuilder); - Module module = MockFactory.createModule(); - EventContext eCtx = new EventContextImpl(); - ScopeContext scopeContext = new ModuleScopeContext(eCtx); - scopeContext.start(); - scopeContext.onEvent(EventContext.MODULE_START, null); - List components = module.getComponents(); - Map compMap = new HashMap(components.size()); - - for (Component component : components) { - compMap.put(component.getName(), component); - builder.build(component, ctx); - RuntimeConfiguration config = (RuntimeConfiguration) component.getComponentImplementation().getRuntimeConfiguration(); - Assert.assertNotNull(config); - } - for (Component component : components) { - RuntimeConfiguration source = (RuntimeConfiguration) component.getComponentImplementation().getRuntimeConfiguration(); - Assert.assertNotNull(source); - for (ProxyFactory pFactory : (Collection) source.getSourceProxyFactories().values()) { - ProxyConfiguration pConfig = pFactory.getProxyConfiguration(); - Component target = compMap.get(pConfig.getTargetName().getPartName()); - - if (target != null) { - RuntimeConfiguration targetConfig = (RuntimeConfiguration) target.getComponentImplementation() - .getRuntimeConfiguration(); - boolean downScope = strategy.downScopeReference(source.getScope(), targetConfig.getScope()); - wireBuilder.connect(pFactory, targetConfig.getTargetProxyFactory(pFactory.getProxyConfiguration().getTargetName() - .getPortName()), targetConfig.getClass(), downScope, scopeContext); - } - pFactory.initialize(); - } - - scopeContext.registerConfiguration(source); - } - for (Component component : components) { - RuntimeConfiguration config = (RuntimeConfiguration) component.getComponentImplementation().getRuntimeConfiguration(); - InstanceContext context = (InstanceContext) config.createInstanceContext(); - if ("source".equals(component.getName())) { - ModuleScopeComponent source = (ModuleScopeComponent) context.getInstance(null); - Assert.assertNotNull(source); - GenericComponent gComp = (GenericComponent) source.getGenericComponent(); - gComp.getString(); - } - } - } - - private static AggregateContext createContext() { - return new AggregateContextImpl("test.parent", null, new DefaultScopeStrategy(), new EventContextImpl(), - new MockConfigContext(null), new NullMonitorFactory()); - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/builder/JavaTargetWireBuilderTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/builder/JavaTargetWireBuilderTestCase.java deleted file mode 100644 index c5b1ecd4fd..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/builder/JavaTargetWireBuilderTestCase.java +++ /dev/null @@ -1,115 +0,0 @@ -package org.apache.tuscany.container.java.builder; - -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.Map; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.container.java.config.JavaComponentRuntimeConfiguration; -import org.apache.tuscany.container.java.invocation.mock.MockHandler; -import org.apache.tuscany.container.java.invocation.mock.MockSyncInterceptor; -import org.apache.tuscany.container.java.invocation.mock.SimpleTarget; -import org.apache.tuscany.container.java.invocation.mock.SimpleTargetImpl; -import org.apache.tuscany.container.java.mock.MockScopeContext; -import org.apache.tuscany.core.builder.impl.DefaultWireBuilder; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.MethodHashMap; -import org.apache.tuscany.core.invocation.ProxyConfiguration; -import org.apache.tuscany.core.invocation.impl.InvokerInterceptor; -import org.apache.tuscany.core.invocation.jdk.JDKProxyFactory; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.message.Message; -import org.apache.tuscany.core.message.MessageFactory; -import org.apache.tuscany.core.message.impl.MessageFactoryImpl; - -public class JavaTargetWireBuilderTestCase extends TestCase { - - private Method hello; - private Method goodbye; - - public JavaTargetWireBuilderTestCase() { - } - - public JavaTargetWireBuilderTestCase(String arg0) { - super(arg0); - } - - public void setUp() throws Exception { - hello = SimpleTarget.class.getMethod("hello", new Class[] { String.class }); - goodbye = SimpleTarget.class.getMethod("goodbye", new Class[] { String.class }); - } - - - /** - * Tests basic wiring of a source to a target, including handlers and interceptors - */ - public void testInvocation() throws Exception { - MessageFactory msgFactory = new MessageFactoryImpl(); - - InvocationConfiguration source = new InvocationConfiguration(hello); - MockHandler sourceRequestHandler = new MockHandler(); - MockHandler sourceResponseHandler = new MockHandler(); - MockSyncInterceptor sourceInterceptor = new MockSyncInterceptor(); - source.addRequestHandler(sourceRequestHandler); - source.addResponseHandler(sourceResponseHandler); - source.addSourceInterceptor(sourceInterceptor); - - ProxyFactory sourceFactory = new JDKProxyFactory(); - Map sourceInvocationConfigs = new MethodHashMap(); - sourceInvocationConfigs.put(hello, source); - ProxyConfiguration sourceConfig = new ProxyConfiguration(new QualifiedName("target/SimpleTarget"), - sourceInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory); - sourceFactory.setProxyConfiguration(sourceConfig); - sourceFactory.setBusinessInterface(SimpleTarget.class); - - InvocationConfiguration target = new InvocationConfiguration(hello); - MockHandler targetRequestHandler = new MockHandler(); - MockHandler targetResponseHandler = new MockHandler(); - MockSyncInterceptor targetInterceptor = new MockSyncInterceptor(); - target.addRequestHandler(targetRequestHandler); - target.addResponseHandler(targetResponseHandler); - target.addTargetInterceptor(targetInterceptor); - target.addTargetInterceptor(new InvokerInterceptor()); - - ProxyFactory targetFactory = new JDKProxyFactory(); - Map targetInvocationConfigs = new MethodHashMap(); - targetInvocationConfigs.put(hello, target); - ProxyConfiguration targetConfig = new ProxyConfiguration(new QualifiedName("target/SimpleTarget"), - targetInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory); - targetFactory.setProxyConfiguration(targetConfig); - targetFactory.setBusinessInterface(SimpleTarget.class); - - // bootstrap a scope container with the target in it - Map instances = new HashMap(); - SimpleTarget simpleTarget = new SimpleTargetImpl(); - instances.put("target",simpleTarget); - MockScopeContext scopeCtx = new MockScopeContext(instances); - - // connect the source to the target - DefaultWireBuilder builder = new DefaultWireBuilder(); - builder.addWireBuilder(new JavaTargetWireBuilder()); - - builder.connect(sourceFactory, targetFactory, JavaComponentRuntimeConfiguration.class, true, scopeCtx); - source.build(); - target.build(); - Assert.assertNotNull(source.getTargetInvoker()); - - Message msg = msgFactory.createMessage(); - msg.setBody("foo"); - msg.setTargetInvoker(source.getTargetInvoker()); - Message response = (Message) source.getSourceInterceptor().invoke(msg); - Assert.assertEquals("foo", response.getBody()); - Assert.assertEquals(1, sourceRequestHandler.getCount()); - Assert.assertEquals(1, sourceResponseHandler.getCount()); - Assert.assertEquals(1, sourceInterceptor.getCount()); - Assert.assertEquals(1, targetRequestHandler.getCount()); - Assert.assertEquals(1, targetResponseHandler.getCount()); - Assert.assertEquals(1, targetInterceptor.getCount()); - } - - -} - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/builder/MockHandlerBuilder.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/builder/MockHandlerBuilder.java deleted file mode 100644 index 939d780e0f..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/builder/MockHandlerBuilder.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.builder; - -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.MessageHandler; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.assembly.ConfiguredReference; -import org.apache.tuscany.model.assembly.ConfiguredService; - -/** - * Adds a handler to a source or target proxy configuration - * - * @version $Rev$ $Date$ - */ -public class MockHandlerBuilder implements RuntimeConfigurationBuilder { - - private MessageHandler handler; - - private boolean source; - - private boolean request; - - /** - * Creates the builder. - * - * @param handler the handler to add to the source or target proxy configuration - * @param source true if the handler should be added on the source side; false if the handler should be added to the - * target side - * @param request true if the handler is a request handler; false if the handler is a response handler - */ - public MockHandlerBuilder(MessageHandler handler, boolean source, boolean request) { - this.handler = handler; - this.source = source; - this.request = request; - } - - public void build(AssemblyModelObject modelObject, Context context) throws BuilderException { - if (source) { - if (!(modelObject instanceof ConfiguredReference)) { - return; - } else { - ConfiguredReference cref = (ConfiguredReference) modelObject; - ProxyFactory pFactory = (ProxyFactory) cref.getProxyFactory(); - for (InvocationConfiguration config : pFactory.getProxyConfiguration().getInvocationConfigurations().values()) { - if (request) { - config.addRequestHandler(handler); - } else { - config.addResponseHandler(handler); - } - } - } - } else { - if (!(modelObject instanceof ConfiguredService)) { - return; - } else { - ConfiguredService cservice = (ConfiguredService) modelObject; - ProxyFactory pFactory = (ProxyFactory) cservice.getProxyFactory(); - for (InvocationConfiguration config : pFactory.getProxyConfiguration().getInvocationConfigurations().values()) { - if (request) { - config.addRequestHandler(handler); - } else { - config.addResponseHandler(handler); - } - } - } - - } - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/builder/MockInterceptorBuilder.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/builder/MockInterceptorBuilder.java deleted file mode 100644 index 8bf6ed9e27..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/builder/MockInterceptorBuilder.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.builder; - -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.core.invocation.Interceptor; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.assembly.ConfiguredReference; -import org.apache.tuscany.model.assembly.ConfiguredService; - -/** - * Adds an interceptor to a source or target proxy configuration - * - * @version $Rev$ $Date$ - */ -public class MockInterceptorBuilder implements RuntimeConfigurationBuilder { - - private Interceptor interceptor; - - private boolean source; - - /** - * Creates the builder - * - * @param interceptor the interceptor ot add - * @param source true if the interceptor should be added to the source side; false if the interceptor should be - * added to the target side - */ - public MockInterceptorBuilder(Interceptor interceptor, boolean source) { - this.interceptor = interceptor; - this.source = source; - } - - public void build(AssemblyModelObject modelObject, Context context) throws BuilderException { - if (source) { - if (!(modelObject instanceof ConfiguredReference)) { - return; - } else { - ConfiguredReference cref = (ConfiguredReference) modelObject; - ProxyFactory pFactory = (ProxyFactory) cref.getProxyFactory(); - for (InvocationConfiguration config : pFactory.getProxyConfiguration().getInvocationConfigurations().values()) { - config.addSourceInterceptor(interceptor); - } - } - } else { - if (!(modelObject instanceof ConfiguredService)) { - return; - } else { - ConfiguredService cservice = (ConfiguredService) modelObject; - ProxyFactory pFactory = (ProxyFactory) cservice.getProxyFactory(); - for (InvocationConfiguration config : pFactory.getProxyConfiguration().getInvocationConfigurations().values()) { - config.addTargetInterceptor(interceptor); - } - } - - } - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/config/ModuleComponentConfigurationLoaderTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/config/ModuleComponentConfigurationLoaderTestCase.java deleted file mode 100644 index 1e8d7ebb9b..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/config/ModuleComponentConfigurationLoaderTestCase.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.config; - -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.common.resource.impl.ResourceLoaderImpl; -import org.apache.tuscany.container.java.assembly.impl.JavaImplementationImpl; -import org.apache.tuscany.container.java.loader.JavaSCDLModelLoader; -import org.apache.tuscany.core.config.ConfigurationException; -import org.apache.tuscany.core.config.ModuleComponentConfigurationLoader; -import org.apache.tuscany.core.config.impl.ModuleComponentConfigurationLoaderImpl; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.ComponentImplementation; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.ModuleComponent; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; -import org.apache.tuscany.model.assembly.loader.AssemblyModelLoader; -import org.apache.tuscany.model.scdl.loader.SCDLModelLoader; -import org.apache.tuscany.model.scdl.loader.impl.SCDLAssemblyModelLoaderImpl; - -/** - * @version $Rev: 379821 $ $Date: 2006-02-22 09:25:32 -0800 (Wed, 22 Feb 2006) $ - */ -public class ModuleComponentConfigurationLoaderTestCase extends TestCase { - private ModuleComponentConfigurationLoader loader; - private AssemblyModelContext modelContext; - - public void testFoo() throws ConfigurationException { - URL xml = ModuleComponentConfigurationLoaderTestCase.class.getResource("ModuleComponentLoaderTest1.module"); - ModuleComponent moduleComponent = loader.loadModuleComponent("test", "test", xml.toString()); - - Assert.assertEquals("test", moduleComponent.getName()); - Module module = moduleComponent.getModuleImplementation(); - Assert.assertEquals("ModuleComponentLoaderTest1", module.getName()); - List components = module.getComponents(); - Assert.assertEquals(1, components.size()); - Component component = components.get(0); - Assert.assertEquals("HelloWorldServiceComponent", component.getName()); - - component = module.getComponent("HelloWorldServiceComponent"); - Assert.assertEquals("HelloWorldServiceComponent", component.getName()); - - ComponentImplementation implementation = component.getComponentImplementation(); - Assert.assertTrue(implementation instanceof JavaImplementationImpl); - } - - protected void setUp() throws Exception { - super.setUp(); - Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); - List scdlLoaders=new ArrayList(); - JavaSCDLModelLoader javaLoader=new JavaSCDLModelLoader(); - scdlLoaders.add(javaLoader); - AssemblyModelLoader modelLoader=new SCDLAssemblyModelLoaderImpl(scdlLoaders); - modelContext=new AssemblyModelContextImpl(new AssemblyFactoryImpl(), modelLoader, - new ResourceLoaderImpl(this.getClass().getClassLoader())); - loader = new ModuleComponentConfigurationLoaderImpl(modelContext); - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/context/BadPojoTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/context/BadPojoTestCase.java deleted file mode 100644 index 56567e9535..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/context/BadPojoTestCase.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.context; - -import junit.framework.TestCase; - -import org.apache.tuscany.container.java.mock.MockFactory; -import org.apache.tuscany.container.java.mock.components.BadContextPojo; -import org.apache.tuscany.container.java.mock.components.BadNamePojo; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.impl.AggregateContextImpl; -import org.apache.tuscany.model.assembly.Scope; - -public class BadPojoTestCase extends TestCase { - - /** - * Tests that a pojo with @ComponentName specified on a non-String type generates an error. - *

- * NB: the test assumes an error with a message containing - * "@ComponentName" is generated - */ - public void testBadNameType() throws Exception { - AggregateContext mc = new AggregateContextImpl(); - mc.setName("mc"); - try { - JavaComponentContext context = MockFactory.createPojoContext("BadNamePojo", BadNamePojo.class, - Scope.MODULE, mc); - } catch (NoSuchMethodException e) { - if (e.getMessage().indexOf("@ComponentName") < 0) { - throw e; - } - } - - } - - /** - * Tests that a pojo with @Context specified on a non-ModuleContext type generates an error. - *

- * NB: the test assumes an error with a message containing - * "@Context" is generated - */ - public void testContextType() throws Exception { - AggregateContext mc = new AggregateContextImpl(); - mc.setName("mc"); - try { - JavaComponentContext context = MockFactory.createPojoContext("BadContextPojo", BadContextPojo.class, - Scope.MODULE, mc); - } catch (NoSuchMethodException e) { - if (e.getMessage().indexOf("@Context") < 0) { - throw e; - } - } - - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/context/PojoLifecycleTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/context/PojoLifecycleTestCase.java deleted file mode 100644 index 113351c592..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/context/PojoLifecycleTestCase.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.context; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.container.java.mock.MockFactory; -import org.apache.tuscany.container.java.mock.components.ModuleScopeInitOnlyComponent; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.impl.AggregateContextImpl; -import org.apache.tuscany.model.assembly.Scope; - -/** - * Tests @Init method called, @Context set for ModuleContext, @ComponentName set - * - * @version $Rev$ $Date$ - */ -public class PojoLifecycleTestCase extends TestCase { - - public void testComponentNameSet() throws Exception { - AggregateContext mc = new AggregateContextImpl(); - mc.setName("mc"); - JavaComponentContext context = MockFactory.createPojoContext("TestServiceInit", - ModuleScopeInitOnlyComponent.class, Scope.MODULE, mc); - context.start(); - ModuleScopeInitOnlyComponent instance = (ModuleScopeInitOnlyComponent) context.getInstance(null); - Assert.assertNotNull(instance); - Assert.assertEquals("TestServiceInit", instance.getName()); - context.stop(); - } - - public void testModuleContextSet() throws Exception { - AggregateContext mc = new AggregateContextImpl(); - mc.setName("mc"); - JavaComponentContext context = MockFactory.createPojoContext("TestServiceInit", - ModuleScopeInitOnlyComponent.class, Scope.MODULE, mc); - context.start(); - ModuleScopeInitOnlyComponent instance = (ModuleScopeInitOnlyComponent) context.getInstance(null); - Assert.assertNotNull(instance); - Assert.assertEquals(mc, instance.getModuleContext()); - context.stop(); - } - - public void testInit() throws Exception { - AggregateContext mc = new AggregateContextImpl(); - mc.setName("mc"); - JavaComponentContext context = MockFactory.createPojoContext("TestServiceInit", - ModuleScopeInitOnlyComponent.class, Scope.MODULE, mc); - context.start(); - ModuleScopeInitOnlyComponent instance = (ModuleScopeInitOnlyComponent) context.getInstance(null); - Assert.assertNotNull(instance); - Assert.assertTrue(instance.isInitialized()); - context.stop(); - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/context/PojoTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/context/PojoTestCase.java deleted file mode 100644 index 5c30ad02a7..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/context/PojoTestCase.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.context; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.container.java.assembly.JavaAssemblyFactory; -import org.apache.tuscany.container.java.assembly.impl.JavaAssemblyFactoryImpl; -import org.apache.tuscany.container.java.context.JavaComponentContext; -import org.apache.tuscany.container.java.mock.components.GenericComponent; -import org.apache.tuscany.container.java.mock.components.ModuleScopeComponentImpl; -import org.apache.tuscany.container.java.mock.components.RequestScopeComponentImpl; -import org.apache.tuscany.container.java.mock.components.SessionScopeComponentImpl; -import org.apache.tuscany.container.java.mock.components.StatelessComponentImpl; -import org.apache.tuscany.core.config.JavaIntrospectionHelper; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.impl.AggregateContextImpl; -import org.apache.tuscany.core.injection.PojoObjectFactory; - -/** - * @version $Rev$ $Date$ - */ -public class PojoTestCase extends TestCase { - - JavaAssemblyFactory factory = new JavaAssemblyFactoryImpl(); - - public void testGetModuleInstance() throws Exception { - AggregateContext mc = new AggregateContextImpl(); - mc.setName("mc"); - JavaComponentContext c = new JavaComponentContext("foo", new PojoObjectFactory(JavaIntrospectionHelper - .getDefaultConstructor(ModuleScopeComponentImpl.class), null, null), false, null, null, false); - GenericComponent service = (GenericComponent) c.getInstance(null); - Assert.assertNotNull(service); - service.setString("foo"); - GenericComponent service2 = (GenericComponent) c.getInstance(null); - Assert.assertNotNull(service2); - Assert.assertSame(service, service2); - } - - public void testGetSessionInstance() throws Exception { - AggregateContext mc = new AggregateContextImpl(); - mc.setName("mc"); - JavaComponentContext c = new JavaComponentContext("foo", new PojoObjectFactory(JavaIntrospectionHelper - .getDefaultConstructor(SessionScopeComponentImpl.class), null, null), false, null, null, false); - GenericComponent service = (GenericComponent) c.getInstance(null); - Assert.assertNotNull(service); - service.setString("foo"); - GenericComponent service2 = (GenericComponent) c.getInstance(null); - Assert.assertNotNull(service2); - Assert.assertSame(service, service2); - } - - public void testGetRequestInstance() throws Exception { - AggregateContext mc = new AggregateContextImpl(); - mc.setName("mc"); - JavaComponentContext c = new JavaComponentContext("foo", new PojoObjectFactory(JavaIntrospectionHelper - .getDefaultConstructor(RequestScopeComponentImpl.class), null, null), false, null, null, false); - GenericComponent service = (GenericComponent) c.getInstance(null); - Assert.assertNotNull(service); - service.setString("foo"); - GenericComponent service2 = (GenericComponent) c.getInstance(null); - Assert.assertNotNull(service2); - Assert.assertSame(service, service2); - } - - public void testGetStatelessInstance() throws Exception { - AggregateContext mc = new AggregateContextImpl(); - mc.setName("fooContext"); - JavaComponentContext c = new JavaComponentContext("foo", new PojoObjectFactory(JavaIntrospectionHelper - .getDefaultConstructor(StatelessComponentImpl.class), null, null), false, null, null, true); - GenericComponent service = (GenericComponent) c.getInstance(null); - Assert.assertNotNull(service); - service.setString("foo"); - GenericComponent service2 = (GenericComponent) c.getInstance(null); - Assert.assertNotNull(service2); - Assert.assertTrue(!"foo".equals(service2.getString())); - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/JavaBuilderContextIntegrationTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/JavaBuilderContextIntegrationTestCase.java deleted file mode 100644 index b935f19214..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/JavaBuilderContextIntegrationTestCase.java +++ /dev/null @@ -1,240 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.integration; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.container.java.builder.JavaComponentContextBuilder; -import org.apache.tuscany.container.java.builder.JavaTargetWireBuilder; -import org.apache.tuscany.container.java.builder.MockHandlerBuilder; -import org.apache.tuscany.container.java.builder.MockInterceptorBuilder; -import org.apache.tuscany.container.java.invocation.mock.MockHandler; -import org.apache.tuscany.container.java.invocation.mock.MockSyncInterceptor; -import org.apache.tuscany.container.java.mock.MockFactory; -import org.apache.tuscany.container.java.mock.components.GenericComponent; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.builder.impl.DefaultWireBuilder; -import org.apache.tuscany.core.builder.impl.HierarchicalBuilder; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.invocation.jdk.JDKProxyFactoryFactory; -import org.apache.tuscany.core.invocation.spi.ProxyFactoryFactory; -import org.apache.tuscany.core.message.MessageFactory; -import org.apache.tuscany.core.message.impl.MessageFactoryImpl; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.runtime.RuntimeContextImpl; -import org.apache.tuscany.core.system.builder.SystemComponentContextBuilder; -import org.apache.tuscany.core.system.builder.SystemEntryPointBuilder; -import org.apache.tuscany.core.system.builder.SystemExternalServiceBuilder; - -/** - * Verifies that the aggregate context implementation and java component builders construct references properly - * - * @version $Rev$ $Date$ - */ -public class JavaBuilderContextIntegrationTestCase extends TestCase { - - public JavaBuilderContextIntegrationTestCase(String arg0) { - super(arg0); - } - - protected void setUp() throws Exception { - super.setUp(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void testRefWithSourceInterceptor() throws Exception { - MessageFactory msgFactory = new MessageFactoryImpl(); - - List builders = new ArrayList(); - builders.add((new SystemComponentContextBuilder())); - builders.add(new SystemEntryPointBuilder()); - builders.add(new SystemExternalServiceBuilder()); - - ProxyFactoryFactory proxyFactoryFactory =new JDKProxyFactoryFactory(); - - JavaComponentContextBuilder javaBuilder = new JavaComponentContextBuilder(); - javaBuilder.setMessageFactory(msgFactory); - javaBuilder.setProxyFactoryFactory(proxyFactoryFactory); - - MockSyncInterceptor mockInterceptor = new MockSyncInterceptor(); - MockInterceptorBuilder interceptorBuilder = new MockInterceptorBuilder(mockInterceptor, true); - //HierarchicalBuilder refBuilder = new HierarchicalBuilder(); - //refBuilder.addBuilder(interceptorBuilder); - javaBuilder.addPolicyBuilder(interceptorBuilder); - builders.add(javaBuilder); - - DefaultWireBuilder defaultWireBuilder = new DefaultWireBuilder(); - - RuntimeContext runtime = new RuntimeContextImpl(null, null, builders, defaultWireBuilder); - runtime.addBuilder(new JavaTargetWireBuilder()); - runtime.start(); - runtime.getRootContext().registerModelObject( - MockFactory.createAggregateComponent("test.module")); - AggregateContext child = (AggregateContext) runtime.getRootContext().getContext("test.module"); - child.registerModelObject(MockFactory.createModule()); - child.fireEvent(EventContext.MODULE_START, null); - GenericComponent source = (GenericComponent) child.locateInstance("source"); - Assert.assertNotNull(source); - source.getGenericComponent().getString(); - Assert.assertEquals(1, mockInterceptor.getCount()); - source.getGenericComponent().getString(); - Assert.assertEquals(2, mockInterceptor.getCount()); - child.fireEvent(EventContext.MODULE_STOP, null); - runtime.stop(); - } - - public void testRefWithSourceInterceptorHandler() throws Exception { - MessageFactory msgFactory = new MessageFactoryImpl(); - - List builders = new ArrayList(); - builders.add((new SystemComponentContextBuilder())); - builders.add(new SystemEntryPointBuilder()); - builders.add(new SystemExternalServiceBuilder()); - - JavaComponentContextBuilder javaBuilder = new JavaComponentContextBuilder(); - javaBuilder.setMessageFactory(msgFactory); - javaBuilder.setProxyFactoryFactory(new JDKProxyFactoryFactory()); - - MockSyncInterceptor mockInterceptor = new MockSyncInterceptor(); - MockInterceptorBuilder interceptorBuilder = new MockInterceptorBuilder(mockInterceptor, true); - //HierarchicalBuilder refBuilder = new HierarchicalBuilder(); - //refBuilder.addBuilder(interceptorBuilder); - MockHandler mockHandler = new MockHandler(); - MockHandlerBuilder handlerBuilder = new MockHandlerBuilder(mockHandler, true, true); - //refBuilder.addBuilder(handlerBuilder); - javaBuilder.addPolicyBuilder(interceptorBuilder); - javaBuilder.addPolicyBuilder(handlerBuilder); - - //javaBuilder.setPolicyBuilder(refBuilder); - builders.add(javaBuilder); - - DefaultWireBuilder defaultWireBuilder = new DefaultWireBuilder(); - RuntimeContext runtime = new RuntimeContextImpl(null, null, builders, defaultWireBuilder); - runtime.addBuilder(new JavaTargetWireBuilder()); - runtime.start(); - runtime.getRootContext().registerModelObject( - MockFactory.createAggregateComponent("test.module")); - AggregateContext child = (AggregateContext) runtime.getRootContext().getContext("test.module"); - child.registerModelObject(MockFactory.createModule()); - child.fireEvent(EventContext.MODULE_START, null); - GenericComponent source = (GenericComponent) child.locateInstance("source"); - Assert.assertNotNull(source); - source.getGenericComponent().getString(); - Assert.assertEquals(1, mockInterceptor.getCount()); - Assert.assertEquals(1, mockHandler.getCount()); - source.getGenericComponent().getString(); - Assert.assertEquals(2, mockInterceptor.getCount()); - Assert.assertEquals(2, mockHandler.getCount()); - child.fireEvent(EventContext.MODULE_STOP, null); - runtime.stop(); - } - - public void testRefWithTargetInterceptorHandler() throws Exception { - MessageFactory msgFactory = new MessageFactoryImpl(); - - List builders = new ArrayList(); - builders.add((new SystemComponentContextBuilder())); - builders.add(new SystemEntryPointBuilder()); - builders.add(new SystemExternalServiceBuilder()); - - JavaComponentContextBuilder javaBuilder = new JavaComponentContextBuilder(); - javaBuilder.setMessageFactory(msgFactory); - javaBuilder.setProxyFactoryFactory(new JDKProxyFactoryFactory()); - - MockSyncInterceptor mockInterceptor = new MockSyncInterceptor(); - MockInterceptorBuilder interceptorBuilder = new MockInterceptorBuilder(mockInterceptor, false); - //HierarchicalBuilder refBuilder = new HierarchicalBuilder(); - //refBuilder.addBuilder(interceptorBuilder); - MockHandler mockHandler = new MockHandler(); - MockHandlerBuilder handlerBuilder = new MockHandlerBuilder(mockHandler, false, true); - //refBuilder.addBuilder(handlerBuilder); - javaBuilder.addPolicyBuilder(interceptorBuilder); - javaBuilder.addPolicyBuilder(handlerBuilder); - - // javaBuilder.setPolicyBuilder(refBuilder); - builders.add(javaBuilder); - - DefaultWireBuilder defaultWireBuilder = new DefaultWireBuilder(); - - RuntimeContext runtime = new RuntimeContextImpl(null, null, builders, defaultWireBuilder); - runtime.addBuilder(new JavaTargetWireBuilder()); - runtime.start(); - runtime.getRootContext().registerModelObject( - MockFactory.createAggregateComponent("test.module")); - AggregateContext child = (AggregateContext) runtime.getRootContext().getContext("test.module"); - child.registerModelObject(MockFactory.createModule()); - child.fireEvent(EventContext.MODULE_START, null); - GenericComponent source = (GenericComponent) child.locateInstance("source"); - Assert.assertNotNull(source); - source.getGenericComponent().getString(); - Assert.assertEquals(1, mockInterceptor.getCount()); - Assert.assertEquals(1, mockHandler.getCount()); - source.getGenericComponent().getString(); - Assert.assertEquals(2, mockInterceptor.getCount()); - Assert.assertEquals(2, mockHandler.getCount()); - child.fireEvent(EventContext.MODULE_STOP, null); - runtime.stop(); - } - - public void testRefWithTargetInterceptor() throws Exception { - MessageFactory msgFactory = new MessageFactoryImpl(); - - List builders = new ArrayList(); - builders.add((new SystemComponentContextBuilder())); - builders.add(new SystemEntryPointBuilder()); - builders.add(new SystemExternalServiceBuilder()); - - JavaComponentContextBuilder javaBuilder = new JavaComponentContextBuilder(); - javaBuilder.setMessageFactory(msgFactory); - javaBuilder.setProxyFactoryFactory(new JDKProxyFactoryFactory()); - - MockSyncInterceptor mockInterceptor = new MockSyncInterceptor(); - MockInterceptorBuilder interceptorBuilder = new MockInterceptorBuilder(mockInterceptor, false); - //HierarchicalBuilder refBuilder = new HierarchicalBuilder(); - //refBuilder.addBuilder(interceptorBuilder); - javaBuilder.addPolicyBuilder(interceptorBuilder); - - //javaBuilder.setPolicyBuilder(refBuilder); - builders.add(javaBuilder); - - DefaultWireBuilder defaultWireBuilder = new DefaultWireBuilder(); - - RuntimeContext runtime = new RuntimeContextImpl(null, null, builders, defaultWireBuilder); - runtime.addBuilder(new JavaTargetWireBuilder()); - - runtime.start(); - runtime.getRootContext().registerModelObject( - MockFactory.createAggregateComponent("test.module")); - AggregateContext child = (AggregateContext) runtime.getRootContext().getContext("test.module"); - child.registerModelObject(MockFactory.createModule()); - child.fireEvent(EventContext.MODULE_START, null); - GenericComponent source = (GenericComponent) child.locateInstance("source"); - Assert.assertNotNull(source); - source.getGenericComponent().getString(); - Assert.assertEquals(1, mockInterceptor.getCount()); - source.getGenericComponent().getString(); - Assert.assertEquals(2, mockInterceptor.getCount()); - child.fireEvent(EventContext.MODULE_STOP, null); - runtime.stop(); - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/JavaIntegrationTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/JavaIntegrationTestCase.java deleted file mode 100644 index 795a6fe908..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/JavaIntegrationTestCase.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * - * Copyright 2005 BEA Systems Inc. - * Copyright 2005 International Business Machines Corporation - * - * 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. - */ -package org.apache.tuscany.container.java.integration; - -import junit.framework.TestCase; - -import org.apache.tuscany.container.java.assembly.JavaAssemblyFactory; -import org.apache.tuscany.container.java.assembly.impl.JavaAssemblyFactoryImpl; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.runtime.RuntimeContextImpl; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.ModuleComponent; - -/** - * Integration test that verifies container.java can be used to host components. - * - * @version $Rev$ $Date$ - */ -public class JavaIntegrationTestCase extends TestCase { - private JavaAssemblyFactory factory; - private RuntimeContext runtime; - - public void testModuleWithOneComponent() throws Exception { - Module module = factory.createModule(); - ModuleComponent moduleComponent = factory.createModuleComponent(); - moduleComponent.setModuleImplementation(module); - -// runtime.registerModelObject(moduleComponent); - } - - protected void setUp() throws Exception { - super.setUp(); - - // Create a factory for model objects - factory = new JavaAssemblyFactoryImpl(); - - // Create and bootstrap an empty Tuscany runtime - this.runtime = new RuntimeContextImpl(); - this.runtime.start(); - -// Component component = MockSystemAssemblyFactory.createComponent(RuntimeContext.SYSTEM, SystemAggregateContextImpl.class.getName(), ContextConstants.AGGREGATE_SCOPE_ENUM); -// runtime.registerModelObject(component); - } - - protected void tearDown() throws Exception { - runtime.stop(); - super.tearDown(); - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/JavaRuntimeBootstrapTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/JavaRuntimeBootstrapTestCase.java deleted file mode 100644 index d474d9cb4f..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/JavaRuntimeBootstrapTestCase.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.integration; - -import org.apache.tuscany.container.java.mock.MockFactory; -import org.apache.tuscany.container.java.mock.components.GenericComponent; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.runtime.RuntimeContext; - -import junit.framework.Assert; -import junit.framework.TestCase; - -/** - * Ensures basic runtime with Java support boots properly - * - * @version $Rev$ $Date$ - */ -public class JavaRuntimeBootstrapTestCase extends TestCase { - - /** - * Tests the runtime can be bootstrapped with Java builders and two module-scoped Java-based components can be wired - */ - public void testRuntimeBoot() throws Exception{ - RuntimeContext runtime = MockFactory.createJavaRuntime(); - InstanceContext ctx = runtime.getSystemContext().getContext(MockFactory.SYSTEM_CHILD); - Assert.assertNotNull(ctx); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test")); - AggregateContext testCtx = (AggregateContext) runtime.getRootContext().getContext("test"); - Assert.assertNotNull(testCtx); - testCtx.registerModelObject(MockFactory.createModule()); - testCtx.fireEvent(EventContext.MODULE_START,null); - GenericComponent source = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source); - GenericComponent target = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(target); - source.getGenericComponent().getString(); - - } - -} - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/binding/EntryPointToJavaTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/binding/EntryPointToJavaTestCase.java deleted file mode 100644 index a9408ef9ee..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/binding/EntryPointToJavaTestCase.java +++ /dev/null @@ -1,248 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.integration.binding; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.container.java.assembly.mock.HelloWorldService; -import org.apache.tuscany.container.java.builder.MockInterceptorBuilder; -import org.apache.tuscany.container.java.invocation.mock.MockSyncInterceptor; -import org.apache.tuscany.container.java.mock.MockFactory; -import org.apache.tuscany.container.java.mock.binding.foo.FooBindingBuilder; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EntryPointContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.model.assembly.Scope; - -/** - * Tests basic entry point functionality with Java components - * - * @version $Rev$ $Date$ - */ -public class EntryPointToJavaTestCase extends TestCase { - - private Method hello; - - public void setUp() throws Exception { - hello = HelloWorldService.class.getMethod("hello", new Class[] { String.class }); - } - - /** - * Tests creation and invocation of an entry point wired to a module-scoped service offered by a Java component - */ - public void testEPtoJavaModuleScopeInvoke() throws Throwable { - RuntimeContext runtime = MockFactory.registerFooBinding(MockFactory.createJavaRuntime()); - FooBindingBuilder builder = (FooBindingBuilder) ((AggregateContext) runtime.getSystemContext().getContext(MockFactory.SYSTEM_CHILD)) - .getContext(MockFactory.FOO_BUILDER).getInstance(null); - MockSyncInterceptor mockInterceptor = new MockSyncInterceptor(); - MockInterceptorBuilder interceptorBuilder = new MockInterceptorBuilder(mockInterceptor, false); - builder.addPolicyBuilder(interceptorBuilder); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test.module")); - AggregateContext child = (AggregateContext) runtime.getRootContext().getContext("test.module"); - child.registerModelObject(MockFactory.createModuleWithEntryPoint(Scope.MODULE)); - child.fireEvent(EventContext.MODULE_START, null); - child.fireEvent(EventContext.REQUEST_START, null); - EntryPointContext ctx = (EntryPointContext) child.getContext("source"); - Assert.assertNotNull(ctx); - InvocationHandler handler = (InvocationHandler) ctx.getImplementationInstance(); - Assert.assertEquals(0, mockInterceptor.getCount()); - Object response = handler.invoke(null, hello, new Object[] { "foo" }); - Assert.assertEquals("Hello foo", response); - Assert.assertEquals(1, mockInterceptor.getCount()); - child.fireEvent(EventContext.REQUEST_END, null); - - // second request - child.fireEvent(EventContext.REQUEST_START, null); - ctx = (EntryPointContext) child.getContext("source"); - Assert.assertNotNull(ctx); - handler = (InvocationHandler) ctx.getImplementationInstance(); - Assert.assertEquals(1, mockInterceptor.getCount()); - response = handler.invoke(null, hello, new Object[] { "foo" }); - Assert.assertEquals("Hello foo", response); - Assert.assertEquals(2, mockInterceptor.getCount()); - HelloWorldService service1 = (HelloWorldService)child.getContext("target").getInstance(null); - Assert.assertEquals(2, service1.count()); - child.fireEvent(EventContext.REQUEST_END, null); - - child.fireEvent(EventContext.MODULE_STOP, null); - runtime.stop(); - } - - /** - * Tests creation and invocation of an entry point wired to a session-scoped service offered by a Java component - */ - public void testEPtoJavaSessionScopeInvoke() throws Throwable { - RuntimeContext runtime = MockFactory.registerFooBinding(MockFactory.createJavaRuntime()); - FooBindingBuilder builder = (FooBindingBuilder) ((AggregateContext) runtime.getSystemContext().getContext(MockFactory.SYSTEM_CHILD)) - .getContext(MockFactory.FOO_BUILDER).getInstance(null); - MockSyncInterceptor mockInterceptor = new MockSyncInterceptor(); - MockInterceptorBuilder interceptorBuilder = new MockInterceptorBuilder(mockInterceptor, false); - builder.addPolicyBuilder(interceptorBuilder); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test.module")); - AggregateContext child = (AggregateContext) runtime.getRootContext().getContext("test.module"); - child.registerModelObject(MockFactory.createModuleWithEntryPoint(Scope.SESSION)); - child.fireEvent(EventContext.MODULE_START, null); - - // first session - Object session = new Object(); - child.fireEvent(EventContext.REQUEST_START, null); - child.fireEvent(EventContext.SESSION_NOTIFY, session); - - EntryPointContext ctx = (EntryPointContext) child.getContext("source"); - Assert.assertNotNull(ctx); - InvocationHandler handler = (InvocationHandler) ctx.getImplementationInstance(); - Assert.assertEquals(0, mockInterceptor.getCount()); - Object response = handler.invoke(null, hello, new Object[] { "foo" }); - Assert.assertEquals("Hello foo", response); - Assert.assertEquals(1, mockInterceptor.getCount()); - child.fireEvent(EventContext.REQUEST_END, session); - - child.fireEvent(EventContext.REQUEST_START, null); - child.fireEvent(EventContext.SESSION_NOTIFY, session); - EntryPointContext ctx2 = (EntryPointContext) child.getContext("source"); - Assert.assertNotNull(ctx2); - response = handler.invoke(null, hello, new Object[] { "foo" }); - Assert.assertEquals("Hello foo", response); - Assert.assertEquals(2, mockInterceptor.getCount()); - HelloWorldService service1 = (HelloWorldService)child.getContext("target").getInstance(null); - Assert.assertEquals(2, service1.count()); - child.fireEvent(EventContext.REQUEST_END, session); - child.fireEvent(EventContext.SESSION_END, session); - - - // second session - Object session2 = new Object(); - child.fireEvent(EventContext.REQUEST_START, null); - child.fireEvent(EventContext.SESSION_NOTIFY, session2); - - ctx = (EntryPointContext) child.getContext("source"); - Assert.assertNotNull(ctx); - Assert.assertEquals(2, mockInterceptor.getCount()); - response = handler.invoke(null, hello, new Object[] { "foo" }); - Assert.assertEquals("Hello foo", response); - Assert.assertEquals(3, mockInterceptor.getCount()); - child.fireEvent(EventContext.REQUEST_END, session2); - - child.fireEvent(EventContext.REQUEST_START, null); - child.fireEvent(EventContext.SESSION_NOTIFY, session2); - ctx2 = (EntryPointContext) child.getContext("source"); - Assert.assertNotNull(ctx2); - response = handler.invoke(null, hello, new Object[] { "foo" }); - Assert.assertEquals("Hello foo", response); - Assert.assertEquals(4, mockInterceptor.getCount()); - HelloWorldService service2 = (HelloWorldService)child.getContext("target").getInstance(null); - Assert.assertEquals(2, service2.count()); - Assert.assertEquals(2, service1.count()); //ensure sessions not crossed - child.fireEvent(EventContext.REQUEST_END, session2); - child.fireEvent(EventContext.SESSION_NOTIFY, session2); - - - child.fireEvent(EventContext.MODULE_STOP, null); - runtime.stop(); - } - - - /** - * Tests creation and invocation of an entry point wired to a module-scoped service offered by a Java component - */ - public void testEPtoJavaStatelessInvoke() throws Throwable { - RuntimeContext runtime = MockFactory.registerFooBinding(MockFactory.createJavaRuntime()); - FooBindingBuilder builder = (FooBindingBuilder) ((AggregateContext) runtime.getSystemContext().getContext(MockFactory.SYSTEM_CHILD)) - .getContext(MockFactory.FOO_BUILDER).getInstance(null); - MockSyncInterceptor mockInterceptor = new MockSyncInterceptor(); - MockInterceptorBuilder interceptorBuilder = new MockInterceptorBuilder(mockInterceptor, false); - builder.addPolicyBuilder(interceptorBuilder); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test.module")); - AggregateContext child = (AggregateContext) runtime.getRootContext().getContext("test.module"); - child.registerModelObject(MockFactory.createModuleWithEntryPoint(Scope.INSTANCE)); - child.fireEvent(EventContext.MODULE_START, null); - child.fireEvent(EventContext.REQUEST_START, null); - EntryPointContext ctx = (EntryPointContext) child.getContext("source"); - Assert.assertNotNull(ctx); - InvocationHandler handler = (InvocationHandler) ctx.getImplementationInstance(); - Assert.assertEquals(0, mockInterceptor.getCount()); - Object response = handler.invoke(null, hello, new Object[] { "foo" }); - Assert.assertEquals("Hello foo", response); - Assert.assertEquals(1, mockInterceptor.getCount()); - child.fireEvent(EventContext.REQUEST_END, null); - - // second request - child.fireEvent(EventContext.REQUEST_START, null); - ctx = (EntryPointContext) child.getContext("source"); - Assert.assertNotNull(ctx); - handler = (InvocationHandler) ctx.getImplementationInstance(); - Assert.assertEquals(1, mockInterceptor.getCount()); - response = handler.invoke(null, hello, new Object[] { "foo" }); - Assert.assertEquals("Hello foo", response); - Assert.assertEquals(2, mockInterceptor.getCount()); - HelloWorldService service1 = (HelloWorldService)child.getContext("target").getInstance(null); - Assert.assertEquals(0, service1.count()); - child.fireEvent(EventContext.REQUEST_END, null); - - child.fireEvent(EventContext.MODULE_STOP, null); - runtime.stop(); - } - - public void testEPtoJavaRequestInvoke() throws Throwable { - RuntimeContext runtime = MockFactory.registerFooBinding(MockFactory.createJavaRuntime()); - FooBindingBuilder builder = (FooBindingBuilder) ((AggregateContext) runtime.getSystemContext().getContext(MockFactory.SYSTEM_CHILD)) - .getContext(MockFactory.FOO_BUILDER).getInstance(null); - MockSyncInterceptor mockInterceptor = new MockSyncInterceptor(); - MockInterceptorBuilder interceptorBuilder = new MockInterceptorBuilder(mockInterceptor, false); - builder.addPolicyBuilder(interceptorBuilder); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test.module")); - AggregateContext child = (AggregateContext) runtime.getRootContext().getContext("test.module"); - child.registerModelObject(MockFactory.createModuleWithEntryPoint(Scope.REQUEST)); - child.fireEvent(EventContext.MODULE_START, null); - child.fireEvent(EventContext.REQUEST_START, null); - EntryPointContext ctx = (EntryPointContext) child.getContext("source"); - Assert.assertNotNull(ctx); - InvocationHandler handler = (InvocationHandler) ctx.getImplementationInstance(); - Assert.assertEquals(0, mockInterceptor.getCount()); - Object response = handler.invoke(null, hello, new Object[] { "foo" }); - Assert.assertEquals("Hello foo", response); - Assert.assertEquals(1, mockInterceptor.getCount()); - - ctx = (EntryPointContext) child.getContext("source"); - Assert.assertNotNull(ctx); - handler = (InvocationHandler) ctx.getImplementationInstance(); - response = handler.invoke(null, hello, new Object[] { "foo" }); - HelloWorldService service1 = (HelloWorldService)child.getContext("target").getInstance(null); - Assert.assertEquals(2, service1.count()); - - child.fireEvent(EventContext.REQUEST_END, null); - - // second request - child.fireEvent(EventContext.REQUEST_START, null); - ctx = (EntryPointContext) child.getContext("source"); - Assert.assertNotNull(ctx); - handler = (InvocationHandler) ctx.getImplementationInstance(); - Assert.assertEquals(2, mockInterceptor.getCount()); - response = handler.invoke(null, hello, new Object[] { "foo" }); - Assert.assertEquals("Hello foo", response); - Assert.assertEquals(3, mockInterceptor.getCount()); - HelloWorldService service2 = (HelloWorldService)child.getContext("target").getInstance(null); - Assert.assertEquals(1, service2.count()); - child.fireEvent(EventContext.REQUEST_END, null); - - child.fireEvent(EventContext.MODULE_STOP, null); - runtime.stop(); - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/binding/JavaToExternalServiceTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/binding/JavaToExternalServiceTestCase.java deleted file mode 100644 index a2c88e315a..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/binding/JavaToExternalServiceTestCase.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.integration.binding; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.container.java.assembly.mock.HelloWorldService; -import org.apache.tuscany.container.java.builder.MockInterceptorBuilder; -import org.apache.tuscany.container.java.invocation.mock.MockSyncInterceptor; -import org.apache.tuscany.container.java.mock.MockFactory; -import org.apache.tuscany.container.java.mock.binding.foo.FooBindingBuilder; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.runtime.RuntimeContext; - -/** - * Tests basic Java to external service interaction - * - * @version $Rev$ $Date$ - */ -public class JavaToExternalServiceTestCase extends TestCase { - - /** - * Tests an invocation of an external service configured with the - * {@link org.apache.tuscany.container.java.mock.binding.foo.FooBinding} from a Java component - * - * @throws Exception - */ - public void testJavaToESInvoke() throws Exception { - RuntimeContext runtime = MockFactory.registerFooBinding(MockFactory.createJavaRuntime()); - FooBindingBuilder builder = (FooBindingBuilder) ((AggregateContext) runtime.getSystemContext().getContext( - MockFactory.SYSTEM_CHILD)).getContext(MockFactory.FOO_BUILDER).getInstance(null); - MockSyncInterceptor mockInterceptor = new MockSyncInterceptor(); - MockInterceptorBuilder interceptorBuilder = new MockInterceptorBuilder(mockInterceptor, false); - builder.addPolicyBuilder(interceptorBuilder); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test.module")); - AggregateContext child = (AggregateContext) runtime.getRootContext().getContext("test.module"); - child.registerModelObject(MockFactory.createModuleWithExternalService()); - child.fireEvent(EventContext.MODULE_START, null); - HelloWorldService source = (HelloWorldService) child.locateInstance("source"); - Assert.assertNotNull(source); - Assert.assertEquals(0, mockInterceptor.getCount()); - Assert.assertEquals("foo", source.hello("foo")); - Assert.assertEquals(1, mockInterceptor.getCount()); - child.fireEvent(EventContext.MODULE_STOP, null); - runtime.stop(); - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/context/ScopeReferenceTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/context/ScopeReferenceTestCase.java deleted file mode 100644 index fc9bab4ca3..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/integration/context/ScopeReferenceTestCase.java +++ /dev/null @@ -1,709 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.integration.context; - -import org.apache.tuscany.container.java.mock.MockFactory; -import org.apache.tuscany.container.java.mock.components.GenericComponent; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.model.assembly.Scope; - -import junit.framework.Assert; -import junit.framework.TestCase; - -/** - * Tests scoping is properly handled for service references - * - * @version $Rev$ $Date$ - */ -public class ScopeReferenceTestCase extends TestCase { - - /** - * Tests a module-to-module scoped wire is setup properly by the runtime - */ - public void testModuleToModule() throws Exception{ - RuntimeContext runtime = MockFactory.createJavaRuntime(); - InstanceContext ctx = runtime.getSystemContext().getContext("tuscany.system.child"); - Assert.assertNotNull(ctx); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test")); - AggregateContext testCtx = (AggregateContext) runtime.getRootContext().getContext("test"); - Assert.assertNotNull(testCtx); - testCtx.registerModelObject(MockFactory.createModule()); - testCtx.fireEvent(EventContext.MODULE_START,null); - GenericComponent source = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source); - GenericComponent target = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(target); - source.getGenericComponent().getString(); - } - - /** - * Tests a module-to-session scoped wire is setup properly by the runtime - */ - public void testModuleToSession() throws Exception{ - RuntimeContext runtime = MockFactory.createJavaRuntime(); - InstanceContext ctx = runtime.getSystemContext().getContext("tuscany.system.child"); - Assert.assertNotNull(ctx); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test")); - AggregateContext testCtx = (AggregateContext) runtime.getRootContext().getContext("test"); - Assert.assertNotNull(testCtx); - testCtx.registerModelObject(MockFactory.createModule(Scope.MODULE,Scope.SESSION)); - testCtx.fireEvent(EventContext.MODULE_START,null); - - // first session - Object session = new Object(); - testCtx.fireEvent(EventContext.REQUEST_START,null); - testCtx.fireEvent(EventContext.SESSION_NOTIFY,session); - GenericComponent source = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source); - GenericComponent target = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(target); - source.getGenericComponent().setString("foo"); - Assert.assertEquals("foo",target.getString()); - testCtx.fireEvent(EventContext.REQUEST_END,session); - - //second session - Object session2 = new Object(); - testCtx.fireEvent(EventContext.REQUEST_START,null); - testCtx.fireEvent(EventContext.SESSION_NOTIFY,session2); - GenericComponent target2 = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(target2); - Assert.assertTrue(!"foo".equals(target2.getString())); - - Assert.assertTrue(!"foo".equals(source.getGenericComponent().getString())); - source.getGenericComponent().setString("bar"); - Assert.assertEquals("bar",target2.getString()); - Assert.assertEquals("bar",source.getGenericComponent().getString()); - //testCtx.fireEvent(EventContext.SESSION_NOTIFY,session); - - } - - /** - * Tests a module-to-request scoped wire is setup properly by the runtime - */ - public void testModuleToRequest() throws Exception{ - RuntimeContext runtime = MockFactory.createJavaRuntime(); - InstanceContext ctx = runtime.getSystemContext().getContext("tuscany.system.child"); - Assert.assertNotNull(ctx); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test")); - AggregateContext testCtx = (AggregateContext) runtime.getRootContext().getContext("test"); - Assert.assertNotNull(testCtx); - testCtx.registerModelObject(MockFactory.createModule(Scope.MODULE,Scope.REQUEST)); - testCtx.fireEvent(EventContext.MODULE_START,null); - - // first request - testCtx.fireEvent(EventContext.REQUEST_START,null); - GenericComponent source = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source); - GenericComponent target = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(target); - source.getGenericComponent().setString("foo"); - Assert.assertEquals("foo",target.getString()); - testCtx.fireEvent(EventContext.REQUEST_END,null); - - //second request - testCtx.fireEvent(EventContext.REQUEST_START,null); - GenericComponent target2 = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(target2); - Assert.assertTrue(!"foo".equals(target2.getString())); - - Assert.assertTrue(!"foo".equals(source.getGenericComponent().getString())); - source.getGenericComponent().setString("bar"); - Assert.assertEquals("bar",target2.getString()); - Assert.assertEquals("bar",source.getGenericComponent().getString()); - - } - - /** - * Tests a module-to-stateless scoped wire is setup properly by the runtime - */ - public void testModuleToStateless() throws Exception{ - RuntimeContext runtime = MockFactory.createJavaRuntime(); - InstanceContext ctx = runtime.getSystemContext().getContext("tuscany.system.child"); - Assert.assertNotNull(ctx); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test")); - AggregateContext testCtx = (AggregateContext) runtime.getRootContext().getContext("test"); - Assert.assertNotNull(testCtx); - testCtx.registerModelObject(MockFactory.createModule(Scope.MODULE,Scope.INSTANCE)); - testCtx.fireEvent(EventContext.MODULE_START,null); - - // first request - testCtx.fireEvent(EventContext.REQUEST_START,null); - GenericComponent source = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source); - GenericComponent target = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(target); - source.getGenericComponent().setString("foo"); - Assert.assertTrue(!"foo".equals(target.getString())); - testCtx.fireEvent(EventContext.REQUEST_END,null); - - //second request - testCtx.fireEvent(EventContext.REQUEST_START,null); - GenericComponent target2 = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(target2); - Assert.assertTrue(!"foo".equals(target2.getString())); - - Assert.assertTrue(!"foo".equals(source.getGenericComponent().getString())); - source.getGenericComponent().setString("bar"); - Assert.assertTrue(!"bar".equals(target2.getString())); - } - - /** - * Tests a session-to-session scoped wire is setup properly by the runtime - */ - public void testSessionToSession() throws Exception{ - RuntimeContext runtime = MockFactory.createJavaRuntime(); - InstanceContext ctx = runtime.getSystemContext().getContext("tuscany.system.child"); - Assert.assertNotNull(ctx); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test")); - AggregateContext testCtx = (AggregateContext) runtime.getRootContext().getContext("test"); - Assert.assertNotNull(testCtx); - testCtx.registerModelObject(MockFactory.createModule(Scope.SESSION,Scope.SESSION)); - testCtx.fireEvent(EventContext.MODULE_START,null); - - // first session - Object session = new Object(); - testCtx.fireEvent(EventContext.REQUEST_START,null); - testCtx.fireEvent(EventContext.SESSION_NOTIFY,session); - GenericComponent source = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source); - GenericComponent target = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(target); - source.getGenericComponent().setString("foo"); - source.getGenericComponent().setString("foo"); - Assert.assertEquals("foo",target.getString()); - testCtx.fireEvent(EventContext.REQUEST_END,session); - - //second session - Object session2 = new Object(); - testCtx.fireEvent(EventContext.REQUEST_START,null); - testCtx.fireEvent(EventContext.SESSION_NOTIFY,session2); - GenericComponent source2 = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source2); - GenericComponent target2 = (GenericComponent)testCtx.getContext("target").getInstance(null); - - Assert.assertNotNull(target2); - Assert.assertEquals(null,target2.getString()); - Assert.assertEquals(null,source2.getGenericComponent().getString()); - source2.getGenericComponent().setString("baz"); - Assert.assertEquals("baz",source2.getGenericComponent().getString()); - Assert.assertEquals("baz",target2.getString()); - - testCtx.fireEvent(EventContext.REQUEST_END,session2); - - } - - - /** - * Tests a session-to-module scoped wire is setup properly by the runtime - */ - public void testSessionToModule() throws Exception{ - RuntimeContext runtime = MockFactory.createJavaRuntime(); - InstanceContext ctx = runtime.getSystemContext().getContext("tuscany.system.child"); - Assert.assertNotNull(ctx); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test")); - AggregateContext testCtx = (AggregateContext) runtime.getRootContext().getContext("test"); - Assert.assertNotNull(testCtx); - testCtx.registerModelObject(MockFactory.createModule(Scope.SESSION,Scope.MODULE)); - testCtx.fireEvent(EventContext.MODULE_START,null); - - // first session - Object session = new Object(); - testCtx.fireEvent(EventContext.REQUEST_START,null); - testCtx.fireEvent(EventContext.SESSION_NOTIFY,session); - GenericComponent source = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source); - GenericComponent target = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(target); - source.getGenericComponent().setString("foo"); - source.getGenericComponent().setString("foo"); - Assert.assertEquals("foo",target.getString()); - testCtx.fireEvent(EventContext.REQUEST_END,session); - - //second session - Object session2 = new Object(); - testCtx.fireEvent(EventContext.REQUEST_START,null); - testCtx.fireEvent(EventContext.SESSION_NOTIFY,session2); - GenericComponent source2 = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source2); - GenericComponent target2 = (GenericComponent)testCtx.getContext("target").getInstance(null); - - Assert.assertNotNull(target2); - Assert.assertEquals("foo",target2.getString()); - Assert.assertEquals("foo",source2.getGenericComponent().getString()); - source2.getGenericComponent().setString("baz"); - Assert.assertEquals("baz",source2.getGenericComponent().getString()); - Assert.assertEquals("baz",target2.getString()); - Assert.assertEquals("baz",target.getString()); - - testCtx.fireEvent(EventContext.REQUEST_END,session2); - - } - - /** - * Tests a session-to-request scoped wire is setup properly by the runtime - */ - public void testSessionToRequest() throws Exception{ - RuntimeContext runtime = MockFactory.createJavaRuntime(); - InstanceContext ctx = runtime.getSystemContext().getContext("tuscany.system.child"); - Assert.assertNotNull(ctx); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test")); - AggregateContext testCtx = (AggregateContext) runtime.getRootContext().getContext("test"); - Assert.assertNotNull(testCtx); - testCtx.registerModelObject(MockFactory.createModule(Scope.SESSION,Scope.REQUEST)); - testCtx.fireEvent(EventContext.MODULE_START,null); - - // first session - Object session = new Object(); - testCtx.fireEvent(EventContext.REQUEST_START,null); - testCtx.fireEvent(EventContext.SESSION_NOTIFY,session); - GenericComponent source = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source); - GenericComponent target = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(target); - source.getGenericComponent().setString("foo"); - Assert.assertEquals("foo",target.getString()); - testCtx.fireEvent(EventContext.REQUEST_END,session); - - //second session - Object session2 = new Object(); - testCtx.fireEvent(EventContext.REQUEST_START,null); - testCtx.fireEvent(EventContext.SESSION_NOTIFY,session2); - GenericComponent source2 = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source); - GenericComponent target2 = (GenericComponent)testCtx.getContext("target").getInstance(null); - - Assert.assertNotNull(target2); - Assert.assertEquals(null,target2.getString()); - source2.getGenericComponent().setString("baz"); - Assert.assertEquals("baz",target2.getString()); - Assert.assertEquals("baz",source2.getGenericComponent().getString()); - - Assert.assertEquals("foo",target.getString()); - testCtx.fireEvent(EventContext.REQUEST_END,session); - - } - - - /** - * Tests a session-to-stateless scoped wire is setup properly by the runtime - */ - public void testSessionToStateless() throws Exception{ - RuntimeContext runtime = MockFactory.createJavaRuntime(); - InstanceContext ctx = runtime.getSystemContext().getContext("tuscany.system.child"); - Assert.assertNotNull(ctx); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test")); - AggregateContext testCtx = (AggregateContext) runtime.getRootContext().getContext("test"); - Assert.assertNotNull(testCtx); - testCtx.registerModelObject(MockFactory.createModule(Scope.SESSION,Scope.INSTANCE)); - testCtx.fireEvent(EventContext.MODULE_START,null); - - // first session - Object session = new Object(); - testCtx.fireEvent(EventContext.REQUEST_START,null); - testCtx.fireEvent(EventContext.SESSION_NOTIFY,session); - GenericComponent source = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source); - GenericComponent target = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(target); - source.getGenericComponent().setString("foo"); - Assert.assertEquals(null,target.getString()); - testCtx.fireEvent(EventContext.REQUEST_END,session); - - //second session - Object session2 = new Object(); - testCtx.fireEvent(EventContext.REQUEST_START,null); - testCtx.fireEvent(EventContext.SESSION_NOTIFY,session2); - GenericComponent source2 = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source); - GenericComponent target2 = (GenericComponent)testCtx.getContext("target").getInstance(null); - - Assert.assertNotNull(target2); - Assert.assertEquals(null,target2.getString()); - source2.getGenericComponent().setString("baz"); - Assert.assertEquals(null,target2.getString()); //Note assumes no pooling - Assert.assertEquals(null,source2.getGenericComponent().getString()); - - Assert.assertEquals(null,target.getString()); //Note assumes no pooling - testCtx.fireEvent(EventContext.REQUEST_END,session); - - } - - /** - * Tests a request-to-request scoped wire is setup properly by the runtime - */ - public void testRequestToRequest() throws Exception{ - RuntimeContext runtime = MockFactory.createJavaRuntime(); - InstanceContext ctx = runtime.getSystemContext().getContext("tuscany.system.child"); - Assert.assertNotNull(ctx); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test")); - AggregateContext testCtx = (AggregateContext) runtime.getRootContext().getContext("test"); - Assert.assertNotNull(testCtx); - testCtx.registerModelObject(MockFactory.createModule(Scope.REQUEST,Scope.REQUEST)); - testCtx.fireEvent(EventContext.MODULE_START,null); - - // first request - testCtx.fireEvent(EventContext.REQUEST_START,null); - GenericComponent source = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source); - GenericComponent target = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(target); - source.getGenericComponent().setString("foo"); - Assert.assertEquals("foo",target.getString()); - testCtx.fireEvent(EventContext.REQUEST_END,null); - - //second request - testCtx.fireEvent(EventContext.REQUEST_START,null); - GenericComponent source2 = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source2); - GenericComponent target2 = (GenericComponent)testCtx.getContext("target").getInstance(null); - - Assert.assertNotNull(target2); - Assert.assertEquals(null,target2.getString()); - Assert.assertEquals(null,source2.getGenericComponent().getString()); - source2.getGenericComponent().setString("baz"); - Assert.assertEquals("baz",source2.getGenericComponent().getString()); - Assert.assertEquals("baz",target2.getString()); - - testCtx.fireEvent(EventContext.REQUEST_END,null); - - } - - /** - * Tests a request-to-module scoped wire is setup properly by the runtime - */ - public void testRequestToModule() throws Exception{ - RuntimeContext runtime = MockFactory.createJavaRuntime(); - InstanceContext ctx = runtime.getSystemContext().getContext("tuscany.system.child"); - Assert.assertNotNull(ctx); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test")); - AggregateContext testCtx = (AggregateContext) runtime.getRootContext().getContext("test"); - Assert.assertNotNull(testCtx); - testCtx.registerModelObject(MockFactory.createModule(Scope.REQUEST,Scope.MODULE)); - testCtx.fireEvent(EventContext.MODULE_START,null); - - // first request - testCtx.fireEvent(EventContext.REQUEST_START,null); - GenericComponent source = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source); - GenericComponent target = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(target); - source.getGenericComponent().setString("foo"); - Assert.assertEquals("foo",target.getString()); - testCtx.fireEvent(EventContext.REQUEST_END,null); - - //second request - testCtx.fireEvent(EventContext.REQUEST_START,null); - GenericComponent source2 = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source2); - GenericComponent target2 = (GenericComponent)testCtx.getContext("target").getInstance(null); - - Assert.assertNotNull(target2); - Assert.assertEquals("foo",target2.getString()); - Assert.assertEquals("foo",source2.getGenericComponent().getString()); - source2.getGenericComponent().setString("baz"); - Assert.assertEquals("baz",source2.getGenericComponent().getString()); - Assert.assertEquals("baz",target2.getString()); - Assert.assertEquals("baz",target.getString()); - - testCtx.fireEvent(EventContext.REQUEST_END,null); - - } - - /** - * Tests a request-to-session scoped wire is setup properly by the runtime - */ - public void testRequestToSession() throws Exception{ - RuntimeContext runtime = MockFactory.createJavaRuntime(); - InstanceContext ctx = runtime.getSystemContext().getContext("tuscany.system.child"); - Assert.assertNotNull(ctx); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test")); - AggregateContext testCtx = (AggregateContext) runtime.getRootContext().getContext("test"); - Assert.assertNotNull(testCtx); - testCtx.registerModelObject(MockFactory.createModule(Scope.REQUEST,Scope.SESSION)); - testCtx.fireEvent(EventContext.MODULE_START,null); - - // first session - Object session = new Object(); - testCtx.fireEvent(EventContext.REQUEST_START,null); - testCtx.fireEvent(EventContext.SESSION_NOTIFY,session); - GenericComponent source = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source); - GenericComponent target = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(target); - source.getGenericComponent().setString("foo"); - Assert.assertEquals("foo",target.getString()); - testCtx.fireEvent(EventContext.REQUEST_END,session); - - //second request for session - testCtx.fireEvent(EventContext.REQUEST_START,null); - testCtx.fireEvent(EventContext.SESSION_NOTIFY,session); - GenericComponent targetR2 = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertEquals("foo",targetR2.getString()); - GenericComponent sourceR2 = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(sourceR2); - Assert.assertEquals("foo",sourceR2.getGenericComponent().getString()); - - testCtx.fireEvent(EventContext.REQUEST_END,session); - - //second session - Object session2 = new Object(); - testCtx.fireEvent(EventContext.REQUEST_START,null); - testCtx.fireEvent(EventContext.SESSION_NOTIFY,session2); - GenericComponent source2 = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source2); - GenericComponent target2 = (GenericComponent)testCtx.getContext("target").getInstance(null); - - Assert.assertNotNull(target2); - Assert.assertEquals(null,target2.getString()); - Assert.assertEquals(null,source2.getGenericComponent().getString()); - source2.getGenericComponent().setString("baz"); - Assert.assertEquals("baz",source2.getGenericComponent().getString()); - Assert.assertEquals("baz",target2.getString()); - - testCtx.fireEvent(EventContext.REQUEST_END,session2); - testCtx.fireEvent(EventContext.REQUEST_START,null); - testCtx.fireEvent(EventContext.SESSION_NOTIFY,session); - testCtx.fireEvent(EventContext.REQUEST_END,session); - - } - - - /** - * Tests a request-to-stateless scoped wire is setup properly by the runtime - */ - public void testRequestToStateless() throws Exception{ - RuntimeContext runtime = MockFactory.createJavaRuntime(); - InstanceContext ctx = runtime.getSystemContext().getContext("tuscany.system.child"); - Assert.assertNotNull(ctx); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test")); - AggregateContext testCtx = (AggregateContext) runtime.getRootContext().getContext("test"); - Assert.assertNotNull(testCtx); - testCtx.registerModelObject(MockFactory.createModule(Scope.REQUEST,Scope.INSTANCE)); - testCtx.fireEvent(EventContext.MODULE_START,null); - - // first request - testCtx.fireEvent(EventContext.REQUEST_START,null); - GenericComponent source = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source); - GenericComponent target = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(target); - source.getGenericComponent().setString("foo"); - Assert.assertEquals(null,target.getString()); - testCtx.fireEvent(EventContext.REQUEST_END,null); - - //second request - testCtx.fireEvent(EventContext.REQUEST_START,null); - GenericComponent source2 = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source2); - GenericComponent target2 = (GenericComponent)testCtx.getContext("target").getInstance(null); - - Assert.assertNotNull(target2); - Assert.assertEquals(null,target2.getString()); - Assert.assertEquals(null,source2.getGenericComponent().getString()); - source2.getGenericComponent().setString("baz"); - Assert.assertEquals(null,source2.getGenericComponent().getString()); - Assert.assertEquals(null,target2.getString()); - - testCtx.fireEvent(EventContext.REQUEST_END,null); - - } - - - /** - * Tests a stateless-to-stateless scoped wire is setup properly by the runtime - */ - public void testStatelessToStateless() throws Exception{ - RuntimeContext runtime = MockFactory.createJavaRuntime(); - InstanceContext ctx = runtime.getSystemContext().getContext("tuscany.system.child"); - Assert.assertNotNull(ctx); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test")); - AggregateContext testCtx = (AggregateContext) runtime.getRootContext().getContext("test"); - Assert.assertNotNull(testCtx); - testCtx.registerModelObject(MockFactory.createModule(Scope.INSTANCE,Scope.INSTANCE)); - testCtx.fireEvent(EventContext.MODULE_START,null); - - // first request - testCtx.fireEvent(EventContext.REQUEST_START,null); - GenericComponent source = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source); - GenericComponent target = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(target); - source.getGenericComponent().setString("foo"); - Assert.assertEquals(null,target.getString()); - testCtx.fireEvent(EventContext.REQUEST_END,null); - - //second request - testCtx.fireEvent(EventContext.REQUEST_START,null); - GenericComponent source2 = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source2); - GenericComponent target2 = (GenericComponent)testCtx.getContext("target").getInstance(null); - - Assert.assertNotNull(target2); - Assert.assertEquals(null,target2.getString()); - Assert.assertEquals(null,source2.getGenericComponent().getString()); - source2.getGenericComponent().setString("baz"); - Assert.assertEquals(null,source2.getGenericComponent().getString()); - Assert.assertEquals(null,target2.getString()); - - testCtx.fireEvent(EventContext.REQUEST_END,null); - - } - - /** - * Tests a stateless-to-request scoped wire is setup properly by the runtime - */ - public void testStatelessToRequest() throws Exception{ - RuntimeContext runtime = MockFactory.createJavaRuntime(); - InstanceContext ctx = runtime.getSystemContext().getContext("tuscany.system.child"); - Assert.assertNotNull(ctx); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test")); - AggregateContext testCtx = (AggregateContext) runtime.getRootContext().getContext("test"); - Assert.assertNotNull(testCtx); - testCtx.registerModelObject(MockFactory.createModule(Scope.INSTANCE,Scope.REQUEST)); - testCtx.fireEvent(EventContext.MODULE_START,null); - - // first request - testCtx.fireEvent(EventContext.REQUEST_START,null); - GenericComponent source = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source); - GenericComponent target = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(target); - source.getGenericComponent().setString("foo"); - Assert.assertEquals("foo",target.getString()); - testCtx.fireEvent(EventContext.REQUEST_END,null); - - GenericComponent targetR1 = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(targetR1); - Assert.assertEquals("foo",target.getString()); - - //second request - testCtx.fireEvent(EventContext.REQUEST_START,null); - GenericComponent source2 = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source2); - GenericComponent target2 = (GenericComponent)testCtx.getContext("target").getInstance(null); - - Assert.assertNotNull(target2); - Assert.assertEquals(null,target2.getString()); - Assert.assertEquals(null,source2.getGenericComponent().getString()); - source2.getGenericComponent().setString("baz"); - Assert.assertEquals("baz",source2.getGenericComponent().getString()); - Assert.assertEquals("baz",target2.getString()); - - testCtx.fireEvent(EventContext.REQUEST_END,null); - - } - - /** - * Tests a stateless-to-session scoped wire is setup properly by the runtime - */ - public void testStatelessToSession() throws Exception{ - RuntimeContext runtime = MockFactory.createJavaRuntime(); - InstanceContext ctx = runtime.getSystemContext().getContext("tuscany.system.child"); - Assert.assertNotNull(ctx); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test")); - AggregateContext testCtx = (AggregateContext) runtime.getRootContext().getContext("test"); - Assert.assertNotNull(testCtx); - testCtx.registerModelObject(MockFactory.createModule(Scope.INSTANCE,Scope.SESSION)); - testCtx.fireEvent(EventContext.MODULE_START,null); - - // first session - Object session = new Object(); - testCtx.fireEvent(EventContext.REQUEST_START,null); - testCtx.fireEvent(EventContext.SESSION_NOTIFY,session); - GenericComponent source = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source); - GenericComponent target = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(target); - source.getGenericComponent().setString("foo"); - Assert.assertEquals("foo",target.getString()); - testCtx.fireEvent(EventContext.REQUEST_END,session); - - //second request for session - testCtx.fireEvent(EventContext.REQUEST_START,null); - testCtx.fireEvent(EventContext.SESSION_NOTIFY,session); - GenericComponent targetR2 = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertEquals("foo",targetR2.getString()); - GenericComponent sourceR2 = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(sourceR2); - Assert.assertEquals("foo",sourceR2.getGenericComponent().getString()); - - testCtx.fireEvent(EventContext.REQUEST_END,session); - - //second session - Object session2 = new Object(); - testCtx.fireEvent(EventContext.REQUEST_START,null); - testCtx.fireEvent(EventContext.SESSION_NOTIFY,session2); - GenericComponent source2 = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source2); - GenericComponent target2 = (GenericComponent)testCtx.getContext("target").getInstance(null); - - Assert.assertNotNull(target2); - Assert.assertEquals(null,target2.getString()); - Assert.assertEquals(null,source2.getGenericComponent().getString()); - source2.getGenericComponent().setString("baz"); - Assert.assertEquals("baz",source2.getGenericComponent().getString()); - Assert.assertEquals("baz",target2.getString()); - - testCtx.fireEvent(EventContext.REQUEST_END,session2); - testCtx.fireEvent(EventContext.REQUEST_START,null); - testCtx.fireEvent(EventContext.SESSION_NOTIFY,session); - testCtx.fireEvent(EventContext.REQUEST_END,session); - - } - - - /** - * Tests a stateless-to-module scoped wire is setup properly by the runtime - */ - public void testStatelessToModule() throws Exception{ - RuntimeContext runtime = MockFactory.createJavaRuntime(); - InstanceContext ctx = runtime.getSystemContext().getContext("tuscany.system.child"); - Assert.assertNotNull(ctx); - runtime.getRootContext().registerModelObject(MockFactory.createAggregateComponent("test")); - AggregateContext testCtx = (AggregateContext) runtime.getRootContext().getContext("test"); - Assert.assertNotNull(testCtx); - testCtx.registerModelObject(MockFactory.createModule(Scope.INSTANCE,Scope.MODULE)); - testCtx.fireEvent(EventContext.MODULE_START,null); - - testCtx.fireEvent(EventContext.REQUEST_START,null); - GenericComponent source = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source); - GenericComponent target = (GenericComponent)testCtx.getContext("target").getInstance(null); - Assert.assertNotNull(target); - source.getGenericComponent().setString("foo"); - Assert.assertEquals("foo",target.getString()); - testCtx.fireEvent(EventContext.REQUEST_END,null); - - //second session - testCtx.fireEvent(EventContext.REQUEST_START,null); - GenericComponent source2 = (GenericComponent)testCtx.getContext("source").getInstance(null); - Assert.assertNotNull(source2); - GenericComponent target2 = (GenericComponent)testCtx.getContext("target").getInstance(null); - - Assert.assertNotNull(target2); - Assert.assertEquals("foo",target2.getString()); - Assert.assertEquals("foo",source2.getGenericComponent().getString()); - source2.getGenericComponent().setString("baz"); - Assert.assertEquals("baz",source2.getGenericComponent().getString()); - Assert.assertEquals("baz",target2.getString()); - - testCtx.fireEvent(EventContext.REQUEST_END,null); - - } - -} - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/MediationTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/MediationTestCase.java deleted file mode 100644 index 6266f18b87..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/MediationTestCase.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.invocation; - -import java.lang.reflect.Method; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.container.java.invocation.mock.SimpleTargetImpl; -import org.apache.tuscany.core.message.Message; -import org.apache.tuscany.core.message.MessageFactory; -import org.apache.tuscany.core.message.impl.MessageFactoryImpl; - -/** - * Tests invoking on a different interface from the one actually implemented by the target - * - * @version $Rev$ $Date$ - */ -public class MediationTestCase extends TestCase { - - private Method hello; - - private MessageFactory msgFactory = new MessageFactoryImpl(); - - public void setUp() throws Exception { - hello = Hello.class.getMethod("hello", new Class[] { String.class }); - } - - public void testMediation() throws Exception { - StaticJavaComponentTargetInvoker invoker = new StaticJavaComponentTargetInvoker(hello, new SimpleTargetImpl()); - Message msg = msgFactory.createMessage(); - msg.setBody("foo"); - Assert.assertEquals("foo", invoker.invoke(msg).getBody()); - } - - public interface Hello { - - public String hello(String message) throws Exception; - - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/ScopedPojoInvokerTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/ScopedPojoInvokerTestCase.java deleted file mode 100644 index 6f532bc76a..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/ScopedPojoInvokerTestCase.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.invocation; - -import java.lang.reflect.Method; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.container.java.invocation.ScopedJavaComponentInvoker; -import org.apache.tuscany.container.java.invocation.mock.SimpleTarget; -import org.apache.tuscany.container.java.mock.MockScopeContext; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.ScopeContext; - -public class ScopedPojoInvokerTestCase extends TestCase { - - private Method echoMethod; - - public ScopedPojoInvokerTestCase() { - super(); - } - - public ScopedPojoInvokerTestCase(String arg0) { - super(arg0); - } - - public void setUp() throws Exception { - echoMethod = SimpleTarget.class.getDeclaredMethod("echo", new Class[]{String.class}); - Assert.assertNotNull(echoMethod); - } - - public void testScopedInvoke() throws Exception { - ScopeContext container = new MockScopeContext(); - ScopedJavaComponentInvoker invoker = new ScopedJavaComponentInvoker(new QualifiedName("foo"), echoMethod, container); - Object ret = invoker.invokeTarget("foo"); - Assert.assertEquals("foo", ret); - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/StaticPojoInvokerTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/StaticPojoInvokerTestCase.java deleted file mode 100644 index e90b7623e8..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/StaticPojoInvokerTestCase.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.invocation; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import org.apache.tuscany.container.java.invocation.StaticJavaComponentTargetInvoker; - -import junit.framework.Assert; -import junit.framework.TestCase; - -public class StaticPojoInvokerTestCase extends TestCase { - - private Method echoMethod; - private Method arrayMethod; - private Method nullParamMethod; - private Method primitiveMethod; - private Method checkedMethod; - private Method runtimeMethod; - - public StaticPojoInvokerTestCase() { - - } - - public StaticPojoInvokerTestCase(String arg0) { - super(arg0); - } - - public void setUp() throws Exception { - echoMethod = TestBean.class.getDeclaredMethod("echo", new Class[]{String.class}); - arrayMethod = TestBean.class.getDeclaredMethod("arrayEcho", new Class[]{String[].class}); - nullParamMethod = TestBean.class.getDeclaredMethod("nullParam", (Class[]) null); - primitiveMethod = TestBean.class.getDeclaredMethod("primitiveEcho", new Class[]{Integer.TYPE}); - checkedMethod = TestBean.class.getDeclaredMethod("checkedException", (Class[]) null); - runtimeMethod = TestBean.class.getDeclaredMethod("runtimeException", (Class[]) null); - Assert.assertNotNull(echoMethod); - Assert.assertNotNull(checkedMethod); - Assert.assertNotNull(runtimeMethod); - } - - public void testObjectInvoke() throws Throwable { - TestBean bean = new TestBean(); - StaticJavaComponentTargetInvoker invoker = new StaticJavaComponentTargetInvoker(echoMethod, bean); - Object ret = invoker.invokeTarget("foo"); - Assert.assertEquals("foo", ret); - } - - public void testArrayInvoke() throws Throwable { - TestBean bean = new TestBean(); - StaticJavaComponentTargetInvoker invoker = new StaticJavaComponentTargetInvoker(arrayMethod, bean); - String[] args = new String[]{"foo", "bar"}; - Object ret = invoker.invokeTarget(new Object[]{args}); - String[] retA = (String[]) ret; - Assert.assertNotNull(retA); - Assert.assertEquals(2, retA.length); - Assert.assertEquals("foo", retA[0]); - Assert.assertEquals("bar", retA[1]); - } - - public void testNullInvoke() throws Throwable { - TestBean bean = new TestBean(); - StaticJavaComponentTargetInvoker invoker = new StaticJavaComponentTargetInvoker(nullParamMethod, bean); - Object ret = invoker.invokeTarget(null); - String retS = (String) ret; - Assert.assertEquals("foo", retS); - } - - public void testPrimitiveInvoke() throws Throwable { - TestBean bean = new TestBean(); - StaticJavaComponentTargetInvoker invoker = new StaticJavaComponentTargetInvoker(primitiveMethod, bean); - Object ret = invoker.invokeTarget(new Integer[]{new Integer(1)}); - Integer retI = (Integer) ret; - Assert.assertEquals(1, retI.intValue()); - } - - public void testInvokeCheckedException() throws Throwable { - TestBean bean = new TestBean(); - StaticJavaComponentTargetInvoker invoker = new StaticJavaComponentTargetInvoker(checkedMethod, bean); - try { - invoker.invokeTarget(null); - } catch (InvocationTargetException e) { - if (e.getCause() != null && TestException.class.equals(e.getCause().getClass())) { - return; - } - } catch (Throwable e) { - } - fail(TestException.class.getName() + " should have been thrown"); - } - - public void testInvokeRuntimeException() throws Throwable { - TestBean bean = new TestBean(); - StaticJavaComponentTargetInvoker invoker = new StaticJavaComponentTargetInvoker(runtimeMethod, bean); - try { - invoker.invokeTarget(null); - } catch (InvocationTargetException e) { - if (e.getCause() != null && e.getCause() instanceof TestRuntimeException) { - return; - } - } - fail(TestException.class.getName() + " should have been thrown"); - } - - private class TestBean { - - public String echo(String msg) throws Exception { - Assert.assertEquals("foo", msg); - return msg; - } - - public String[] arrayEcho(String[] msg) throws Exception { - Assert.assertNotNull(msg); - Assert.assertEquals(2, msg.length); - Assert.assertEquals("foo", msg[0]); - Assert.assertEquals("bar", msg[1]); - return msg; - } - - public String nullParam() throws Exception { - return "foo"; - } - - public int primitiveEcho(int i) throws Exception { - return i; - } - - public void checkedException() throws TestException { - throw new TestException(); - } - - public void runtimeException() throws TestRuntimeException { - throw new TestRuntimeException(); - } - } - - public class TestException extends Exception { - } - - public class TestRuntimeException extends RuntimeException { - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/MockHandler.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/MockHandler.java deleted file mode 100644 index da862b1bc1..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/MockHandler.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - */ -package org.apache.tuscany.container.java.invocation.mock; - -import org.apache.tuscany.core.invocation.MessageHandler; -import org.apache.tuscany.core.message.Message; - -/** - * - */ -public class MockHandler implements MessageHandler { - - private int count =0; - - public boolean processMessage(Message message) { - //System.out.println("Invoking handler"); - count++; - return true; - } - - public int getCount(){ - return count; - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/MockSyncInterceptor.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/MockSyncInterceptor.java deleted file mode 100644 index 4a07f32e2c..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/MockSyncInterceptor.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.invocation.mock; - -import org.apache.tuscany.core.invocation.Interceptor; -import org.apache.tuscany.core.message.Message; - -public class MockSyncInterceptor implements Interceptor { - - private int count; - - private Interceptor next; - - public MockSyncInterceptor() { - } - - public Message invoke(Message msg) { - ++count; - //System.out.println("Invoking interceptor"); - return next.invoke(msg); - } - - public int getCount() { - return count; - } - - public void setNext(Interceptor next) { - this.next=next; - } -} - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/SimpleSource.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/SimpleSource.java deleted file mode 100644 index 213caab7e9..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/SimpleSource.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.invocation.mock; - -public interface SimpleSource { - - public void invokeHello() throws Exception; - - public void invokeGoodbye() throws Exception; -} - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/SimpleSourceImpl.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/SimpleSourceImpl.java deleted file mode 100644 index 2e7bd75f11..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/SimpleSourceImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.invocation.mock; - -public class SimpleSourceImpl implements SimpleSource { - - private SimpleTarget proxy; - - public SimpleSourceImpl(SimpleTarget proxy) { - this.proxy = proxy; - } - - public void invokeHello() throws Exception { - proxy.hello("hello"); - } - - public void invokeGoodbye() throws Exception { - proxy.goodbye("hello"); - } - -} - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/SimpleTarget.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/SimpleTarget.java deleted file mode 100644 index cbd3037529..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/SimpleTarget.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.invocation.mock; - -public interface SimpleTarget { - - public String hello(String message) throws Exception; - - public String goodbye(String message) throws Exception; - - public String echo(String message) throws Exception; - -} - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/SimpleTargetImpl.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/SimpleTargetImpl.java deleted file mode 100644 index 18abf6108a..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/invocation/mock/SimpleTargetImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.invocation.mock; - -public class SimpleTargetImpl implements SimpleTarget { - - public SimpleTargetImpl() { - super(); - } - - public String hello(String message) throws Exception { - return message; - } - - public String goodbye(String message) throws Exception { - return message; - } - - public String echo(String message) throws Exception { - return message; - } - - -} - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockConfigContext.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockConfigContext.java deleted file mode 100644 index 413f4a5a5b..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockConfigContext.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.core.builder.BuilderConfigException; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.builder.impl.AssemblyVisitor; -import org.apache.tuscany.core.config.ConfigurationException; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.ConfigurationContext; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.model.assembly.Extensible; - -/** - * A mock configuration context - * - * @version $Rev: 368822 $ $Date: 2006-01-13 10:54:38 -0800 (Fri, 13 Jan 2006) $ - */ -public class MockConfigContext implements ConfigurationContext { - - private List builders = new ArrayList(); - - public MockConfigContext(List builders) { - this.builders=builders; - } - - public void configure(Extensible model) throws ConfigurationException { - } - - public void build(AggregateContext parent, Extensible model) throws BuilderConfigException { - AssemblyVisitor visitor = new AssemblyVisitor(parent, builders); - visitor.start(model); - } - - public void wire(ProxyFactory sourceFactory, ProxyFactory targetFactory, Class targetType, boolean downScope, ScopeContext targetScopeContext) throws BuilderConfigException { - } - - public void wire(ProxyFactory targetFactory, Class targetType, ScopeContext targetScopeContext) throws BuilderConfigException { - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockFactory.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockFactory.java deleted file mode 100644 index 192ce328fb..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockFactory.java +++ /dev/null @@ -1,548 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock; - -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import junit.framework.Assert; - -import org.apache.tuscany.container.java.assembly.JavaAssemblyFactory; -import org.apache.tuscany.container.java.assembly.JavaImplementation; -import org.apache.tuscany.container.java.assembly.impl.JavaAssemblyFactoryImpl; -import org.apache.tuscany.container.java.assembly.mock.HelloWorldImpl; -import org.apache.tuscany.container.java.assembly.mock.HelloWorldService; -import org.apache.tuscany.container.java.builder.JavaComponentContextBuilder; -import org.apache.tuscany.container.java.builder.JavaTargetWireBuilder; -import org.apache.tuscany.container.java.context.JavaComponentContext; -import org.apache.tuscany.container.java.invocation.mock.MockSyncInterceptor; -import org.apache.tuscany.container.java.mock.binding.foo.FooBinding; -import org.apache.tuscany.container.java.mock.binding.foo.FooBindingBuilder; -import org.apache.tuscany.container.java.mock.binding.foo.FooBindingWireBuilder; -import org.apache.tuscany.container.java.mock.components.GenericComponent; -import org.apache.tuscany.container.java.mock.components.HelloWorldClient; -import org.apache.tuscany.container.java.mock.components.ModuleScopeComponentImpl; -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.config.ConfigurationException; -import org.apache.tuscany.core.config.JavaIntrospectionHelper; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.SystemAggregateContext; -import org.apache.tuscany.core.context.impl.AggregateContextImpl; -import org.apache.tuscany.core.injection.EventInvoker; -import org.apache.tuscany.core.injection.FieldInjector; -import org.apache.tuscany.core.injection.Injector; -import org.apache.tuscany.core.injection.MethodEventInvoker; -import org.apache.tuscany.core.injection.MethodInjector; -import org.apache.tuscany.core.injection.PojoObjectFactory; -import org.apache.tuscany.core.injection.SingletonObjectFactory; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.runtime.RuntimeContextImpl; -import org.apache.tuscany.core.system.assembly.SystemAssemblyFactory; -import org.apache.tuscany.core.system.assembly.SystemBinding; -import org.apache.tuscany.core.system.assembly.SystemImplementation; -import org.apache.tuscany.core.system.assembly.impl.SystemAssemblyFactoryImpl; -import org.apache.tuscany.core.system.builder.SystemComponentContextBuilder; -import org.apache.tuscany.core.system.builder.SystemEntryPointBuilder; -import org.apache.tuscany.core.system.builder.SystemExternalServiceBuilder; -import org.apache.tuscany.core.system.context.SystemAggregateContextImpl; -import org.apache.tuscany.model.assembly.AggregatePart; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.ConfiguredReference; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.ExternalService; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.Reference; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.Service; -import org.apache.tuscany.model.assembly.SimpleComponent; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; -import org.apache.tuscany.model.types.java.JavaServiceContract; -import org.osoa.sca.annotations.ComponentName; -import org.osoa.sca.annotations.Context; -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Init; - -/** - * Generates test components, modules, and runtime artifacts - * - * @version $Rev$ $Date$ - */ -public class MockFactory { - - public static final String JAVA_BUILDER = "java.runtime.builder"; - - public static final String JAVA_WIRE_BUILDER = "java.wire.builder"; - - public static final String FOO_BUILDER = "foo.binding.builder"; - - public static final String FOO_WIRE_BUILDER = "foo.binding.wire.builder"; - - public static final String SYSTEM_CHILD = "tuscany.system.child"; - - private static JavaAssemblyFactory factory = new JavaAssemblyFactoryImpl(); - - private static SystemAssemblyFactory systemFactory = new SystemAssemblyFactoryImpl(); - - private static AssemblyModelContext assemblyContext = new AssemblyModelContextImpl(null, null); - - /** - * Creates an initialized simple component - * - * @param name the component name - * @param type the implementation type - * @param scope the component scope - */ - public static SimpleComponent createComponent(String name, Class type, Scope scope) { - SimpleComponent sc = factory.createSimpleComponent(); - JavaImplementation impl = factory.createJavaImplementation(); - impl.setComponentType(factory.createComponentType()); - impl.setImplementationClass(type); - sc.setComponentImplementation(impl); - Service s = factory.createService(); - JavaServiceContract ji = factory.createJavaServiceContract(); - s.setServiceContract(ji); - ji.setScope(scope); - impl.getComponentType().getServices().add(s); - sc.setName(name); - sc.setComponentImplementation(impl); - return sc; - } - - /** - * Creates a system component of the given type with the given name and scope - */ - public static Component createSystemComponent(String name, Class type, Scope scope) { - - Component sc = null; - if (AggregateContext.class.isAssignableFrom(type)) { - sc = systemFactory.createModuleComponent(); - } else { - sc = systemFactory.createSimpleComponent(); - } - SystemImplementation impl = systemFactory.createSystemImplementation(); - impl.setImplementationClass(type); - sc.setComponentImplementation(impl); - Service s = systemFactory.createService(); - JavaServiceContract ji = systemFactory.createJavaServiceContract(); - s.setServiceContract(ji); - ji.setScope(scope); - impl.setComponentType(systemFactory.createComponentType()); - impl.getComponentType().getServices().add(s); - sc.setName(name); - sc.setComponentImplementation(impl); - return sc; - } - - /** - * Creates an aggregate component with the given name - */ - public static Component createAggregateComponent(String name) { - Component sc = sc = systemFactory.createModuleComponent(); - SystemImplementation impl = systemFactory.createSystemImplementation(); - impl.setImplementationClass(AggregateContextImpl.class); - sc.setComponentImplementation(impl); - Service s = systemFactory.createService(); - JavaServiceContract ji = systemFactory.createJavaServiceContract(); - s.setServiceContract(ji); - ji.setScope(Scope.AGGREGATE); - impl.setComponentType(systemFactory.createComponentType()); - impl.getComponentType().getServices().add(s); - sc.setName(name); - sc.setComponentImplementation(impl); - return sc; - } - - /** - * Creates a system aggregate component with the given name - */ - public static Component createSystemAggregateComponent(String name) { - Component sc = sc = systemFactory.createModuleComponent(); - SystemImplementation impl = systemFactory.createSystemImplementation(); - impl.setImplementationClass(SystemAggregateContextImpl.class); - sc.setComponentImplementation(impl); - Service s = systemFactory.createService(); - JavaServiceContract ji = systemFactory.createJavaServiceContract(); - s.setServiceContract(ji); - ji.setScope(Scope.AGGREGATE); - impl.setComponentType(systemFactory.createComponentType()); - impl.getComponentType().getServices().add(s); - sc.setName(name); - sc.setComponentImplementation(impl); - return sc; - } - - /** - * Creates an external service configured with the 'Foo' test binding - */ - public static ExternalService createFooBindingExternalService(String name, Class interfaz) { - ExternalService es = factory.createExternalService(); - es.setName(name); - Service s = factory.createService(); - JavaServiceContract ji = factory.createJavaServiceContract(); - ji.setScope(Scope.MODULE); - ji.setInterface(interfaz); - s.setServiceContract(ji); - ConfiguredService configuredService = factory.createConfiguredService(); - es.setConfiguredService(configuredService); - - FooBinding binding = new FooBinding(); - es.getBindings().add(binding); - return es; - } - - /** - * Creates an entry point with the given name configured with the given interface and the {@link FooBinding} - */ - public static EntryPoint createFooBindingEntryPoint(String name, Class interfaz) { - EntryPoint ep = factory.createEntryPoint(); - ep.setName(name); - Service s = factory.createService(); - JavaServiceContract ji = factory.createJavaServiceContract(); - ji.setScope(Scope.MODULE); - ji.setInterface(interfaz); - s.setServiceContract(ji); - ConfiguredService configuredService = factory.createConfiguredService(); - configuredService.setService(s); - ep.setConfiguredService(configuredService); - FooBinding binding = new FooBinding(); - ep.getBindings().add(binding); - return ep; - } - - /** - * Creates an entry point wired to the given target (e.g. component, external service) using the system binding - * - * @param name the name of the entry point - * @param interfaz the inteface exposed by the entry point - * @param refName the name of the entry point reference - * @param target the target the entry point is wired to - */ - public static EntryPoint createEPSystemBinding(String name, Class interfaz, String refName, AggregatePart target) { - JavaServiceContract contract = systemFactory.createJavaServiceContract(); - contract.setInterface(interfaz); - - EntryPoint ep = systemFactory.createEntryPoint(); - ep.setName(name); - - Reference ref = systemFactory.createReference(); - ref.setName(refName); - ref.setServiceContract(contract); - ConfiguredReference configuredReference = systemFactory.createConfiguredReference(); - configuredReference.setReference(ref); - Service service = systemFactory.createService(); - service.setServiceContract(contract); - - ConfiguredService cService = systemFactory.createConfiguredService(); - cService.setService(service); - cService.initialize(MockFactory.assemblyContext); - - configuredReference.getTargetConfiguredServices().add(cService); - ep.setConfiguredReference(configuredReference); - - Service epService = systemFactory.createService(); - epService.setServiceContract(contract); - - ConfiguredService epCService = systemFactory.createConfiguredService(); - epCService.initialize(MockFactory.assemblyContext); - epCService.setService(epService); - - ep.setConfiguredService(epCService); - SystemBinding binding = systemFactory.createSystemBinding(); - ep.getBindings().add(binding); - if (target != null) { - if (target instanceof Component) { - ((Component) target).getConfiguredServices().add(cService); - } else if (target instanceof ExternalService) { - ((ExternalService) target).setConfiguredService(cService); - } - target.initialize(MockFactory.assemblyContext); - } - ep.initialize(null); - return ep; - } - - /** - * Creates an external service configured with a {@link SystemBinding} - */ - public static ExternalService createESSystemBinding(String name, String refName) { - ExternalService es = systemFactory.createExternalService(); - es.setName(name); - ConfiguredService configuredService = systemFactory.createConfiguredService(); - es.setConfiguredService(configuredService); - SystemBinding binding = systemFactory.createSystemBinding(); - binding.setTargetName(refName); - es.getBindings().add(binding); - es.initialize(null); - return es; - } - - /** - * Creates a module with a Java-based "target" module-scoped component wired to a module-scoped "source" - */ - public static Module createModule() { - return createModule(Scope.MODULE, Scope.MODULE); - } - - /** - * Creates a module with a Java-based "target" component wired to a "source" - */ - public static Module createModule(Scope sourceScope, Scope targetScope) { - Component sourceComponent = createComponent("source", ModuleScopeComponentImpl.class, sourceScope); - Component targetComponent = createComponent("target", ModuleScopeComponentImpl.class, targetScope); - - Service targetService = factory.createService(); - JavaServiceContract targetContract = factory.createJavaServiceContract(); - targetContract.setInterface(GenericComponent.class); - targetService.setServiceContract(targetContract); - targetService.setName("GenericComponent"); - ConfiguredService cTargetService = factory.createConfiguredService(); - cTargetService.setService(targetService); - cTargetService.initialize(assemblyContext); - targetComponent.getConfiguredServices().add(cTargetService); - targetComponent.initialize(assemblyContext); - - Reference ref = factory.createReference(); - ConfiguredReference cref = factory.createConfiguredReference(); - ref.setName("setGenericComponent"); - JavaServiceContract inter = factory.createJavaServiceContract(); - inter.setInterface(GenericComponent.class); - ref.setServiceContract(inter); - cref.setReference(ref); - cref.getTargetConfiguredServices().add(cTargetService); - cref.initialize(assemblyContext); - sourceComponent.getConfiguredReferences().add(cref); - sourceComponent.initialize(assemblyContext); - - Module module = factory.createModule(); - module.setName("test.module"); - module.getComponents().add(sourceComponent); - module.getComponents().add(targetComponent); - module.initialize(assemblyContext); - return module; - } - - /** - * Creates a module with a Java-based source component wired to a "target" external service configured with the - * {@link FooBinding} - */ - public static Module createModuleWithExternalService() { - Component sourceComponent = createComponent("source", HelloWorldClient.class, Scope.MODULE); - ExternalService targetES = createFooBindingExternalService("target", HelloWorldService.class); - - Service targetService = factory.createService(); - JavaServiceContract targetContract = factory.createJavaServiceContract(); - targetContract.setInterface(HelloWorldService.class); - targetService.setServiceContract(targetContract); - targetService.setName("HelloWorld"); - ConfiguredService cTargetService = factory.createConfiguredService(); - cTargetService.setService(targetService); - targetES.setConfiguredService(cTargetService); - targetES.initialize(assemblyContext); - - Reference ref = factory.createReference(); - ConfiguredReference cref = factory.createConfiguredReference(); - ref.setName("setHelloWorldService"); - JavaServiceContract inter = factory.createJavaServiceContract(); - inter.setInterface(HelloWorldService.class); - ref.setServiceContract(inter); - cref.setReference(ref); - cref.getTargetConfiguredServices().add(cTargetService); - cref.initialize(assemblyContext); - sourceComponent.getConfiguredReferences().add(cref); - sourceComponent.initialize(assemblyContext); - - Module module = factory.createModule(); - module.setName("test.module"); - module.getComponents().add(sourceComponent); - module.getExternalServices().add(targetES); - module.initialize(assemblyContext); - return module; - } - - /** - * Creates a module with an entry point named "source" configured with the {@link FooBinding} wired to a service - * offered by a Java-based component named "target" - * - * @param scope the scope of the target service - */ - public static Module createModuleWithEntryPoint(Scope scope) { - EntryPoint sourceEP = createFooBindingEntryPoint("source", HelloWorldService.class); - Component targetComponent = createComponent("target", HelloWorldImpl.class, scope); - - Service targetService = factory.createService(); - JavaServiceContract targetContract = factory.createJavaServiceContract(); - targetContract.setInterface(HelloWorldService.class); - targetService.setServiceContract(targetContract); - targetService.setName("HelloWorldService"); - ConfiguredService cTargetService = factory.createConfiguredService(); - cTargetService.setService(targetService); - targetComponent.getConfiguredServices().add(cTargetService); - targetComponent.initialize(assemblyContext); - - Reference ref = factory.createReference(); - ConfiguredReference cref = factory.createConfiguredReference(); - ref.setName("setHelloWorldService"); - JavaServiceContract inter = factory.createJavaServiceContract(); - inter.setInterface(HelloWorldService.class); - ref.setServiceContract(inter); - cref.setReference(ref); - cref.getTargetConfiguredServices().add(cTargetService); - cref.initialize(assemblyContext); - sourceEP.setConfiguredReference(cref); - sourceEP.getConfiguredService().getService().setName("HelloWorldService"); - sourceEP.initialize(assemblyContext); - - Module module = factory.createModule(); - module.setName("test.module"); - module.getEntryPoints().add(sourceEP); - module.getComponents().add(targetComponent); - module.initialize(assemblyContext); - return module; - } - - /** - * Returns a collection of bootstrap configuration builders - */ - public static List createSystemBuilders() { - List builders = new ArrayList(); - builders.add((new SystemComponentContextBuilder())); - builders.add(new SystemEntryPointBuilder()); - builders.add(new SystemExternalServiceBuilder()); - return builders; - } - - /** - * Creates an aggregate runtime configuration - * - * @param name the name of the component - * @param aggregateContext the containing aggregate context - * @throws BuilderException - * @see RuntimeConfiguration - */ - public static RuntimeConfiguration createAggregateConfiguration(String name, - AggregateContext aggregateContext) throws BuilderException { - - Component sc = createAggregateComponent(name); - SystemComponentContextBuilder builder = new SystemComponentContextBuilder(); - builder.build(sc, aggregateContext); - return (RuntimeConfiguration) sc.getComponentImplementation().getRuntimeConfiguration(); - } - - /** - * Creates a Java POJO component context - * - * @param name the name of the context - * @param implType the POJO class - * @param scope the component scope - * @param moduleComponentContext the containing aggregate context - * @throws NoSuchMethodException if the POJO does not have a default noi-args constructor - */ - public static JavaComponentContext createPojoContext(String name, Class implType, Scope scope, - AggregateContext moduleComponentContext) throws NoSuchMethodException { - SimpleComponent component = createComponent(name, implType, scope); - - Set fields = JavaIntrospectionHelper.getAllFields(implType); - Set methods = JavaIntrospectionHelper.getAllUniqueMethods(implType); - List injectors = new ArrayList(); - EventInvoker initInvoker = null; - boolean eagerInit = false; - EventInvoker destroyInvoker = null; - for (Field field : fields) { - ComponentName compName = field.getAnnotation(ComponentName.class); - if (compName != null) { - Injector injector = new FieldInjector(field, new SingletonObjectFactory(name)); - injectors.add(injector); - } - Context context = field.getAnnotation(Context.class); - if (context != null) { - Injector injector = new FieldInjector(field, new SingletonObjectFactory(moduleComponentContext)); - injectors.add(injector); - } - } - for (Method method : methods) { - // FIXME Java5 - Init init = method.getAnnotation(Init.class); - if (init != null && initInvoker == null) { - initInvoker = new MethodEventInvoker(method); - eagerInit = init.eager(); - continue; - } - Destroy destroy = method.getAnnotation(Destroy.class); - if (destroy != null && destroyInvoker == null) { - destroyInvoker = new MethodEventInvoker(method); - continue; - } - ComponentName compName = method.getAnnotation(ComponentName.class); - if (compName != null) { - Injector injector = new MethodInjector(method, new SingletonObjectFactory(name)); - injectors.add(injector); - } - Context context = method.getAnnotation(Context.class); - if (context != null) { - Injector injector = new MethodInjector(method, new SingletonObjectFactory(moduleComponentContext)); - injectors.add(injector); - } - } - boolean stateless = (scope == Scope.INSTANCE); - JavaComponentContext context = new JavaComponentContext("foo", new PojoObjectFactory(JavaIntrospectionHelper - .getDefaultConstructor(implType), null, injectors), eagerInit, initInvoker, destroyInvoker, stateless); - return context; - } - - /** - * Creates a default {@link RuntimeContext} configured with support for Java component implementations - * - * @throws ConfigurationException - */ - public static RuntimeContext createJavaRuntime() throws ConfigurationException { - RuntimeContext runtime = new RuntimeContextImpl(null, null, MockFactory.createSystemBuilders(), null); - runtime.start(); - runtime.getSystemContext().registerModelObject(createSystemAggregateComponent(SYSTEM_CHILD)); - SystemAggregateContext ctx = (SystemAggregateContext) runtime.getSystemContext().getContext(SYSTEM_CHILD); - ctx.registerModelObject(createSystemComponent(JAVA_BUILDER, JavaComponentContextBuilder.class, Scope.MODULE)); - ctx.registerModelObject(createSystemComponent(JAVA_WIRE_BUILDER, JavaTargetWireBuilder.class, Scope.MODULE)); - ctx.fireEvent(EventContext.MODULE_START, null); - return runtime; - } - - /** - * Registers the {@link FooBinding} builders with a given runtime - * - * @throws ConfigurationException - */ - public static RuntimeContext registerFooBinding(RuntimeContext runtime) throws ConfigurationException { - AggregateContext child = (AggregateContext) runtime.getSystemContext().getContext(MockFactory.SYSTEM_CHILD); - JavaComponentContextBuilder javaBuilder = (JavaComponentContextBuilder) child.getContext(MockFactory.JAVA_BUILDER) - .getInstance(null); - MockSyncInterceptor mockInterceptor = new MockSyncInterceptor(); - child.registerModelObject(MockFactory.createSystemComponent(FOO_BUILDER, FooBindingBuilder.class, Scope.MODULE)); - child.registerModelObject(MockFactory.createSystemComponent(FOO_WIRE_BUILDER, FooBindingWireBuilder.class, Scope.MODULE)); - // since the child context is already started, we need to manually retrieve the components to init them - Assert.assertNotNull(child.getContext(FOO_BUILDER).getInstance(null)); - Assert.assertNotNull(child.getContext(FOO_WIRE_BUILDER).getInstance(null)); - return runtime; - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockScopeContext.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockScopeContext.java deleted file mode 100644 index a6d9c0b2c5..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockScopeContext.java +++ /dev/null @@ -1,137 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.container.java.invocation.mock.SimpleTargetImpl; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.EventException; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.LifecycleEventListener; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.context.ScopeRuntimeException; -import org.apache.tuscany.core.context.SimpleComponentContext; -import org.apache.tuscany.core.context.TargetException; -import org.apache.tuscany.model.assembly.SimpleComponent; - -public class MockScopeContext implements ScopeContext { - - Map components; - - public MockScopeContext() { - components = new HashMap(); - components.put("foo", new SimpleTargetImpl()); - components.put("bar", new SimpleTargetImpl()); - } - - public MockScopeContext(Map instances) { - components = instances; - } - - - public void start() { - } - - public void stop() { - } - - public String getName() { - return "Mock Scope Container"; - } - - public boolean isCacheable() { - return false; - } - - public int[] getEventTypes() { - return null; - } - - public SimpleComponentContext getContext(String name) { - return null; - } - - public Object getInstance(QualifiedName name) throws ScopeRuntimeException { - return components.get(name.getPartName()); - } - - public Object getInstance(QualifiedName componentName, boolean notify) throws TargetException { - return getInstance(componentName); - } - - public SimpleComponentContext getContextByKey(String name, Object key) { - return null; - } - - public void setComponent(SimpleComponent component) throws ScopeRuntimeException { - } - - public void removeContext(String name) throws ScopeRuntimeException { - } - - public void removeContextByKey(String name, Object key) throws ScopeRuntimeException { - } - - public SimpleComponent[] getComponents() { - return null; - } - - public void onEvent(int type, Object message) throws EventException { - } - - - public void registerConfigurations(List> configurations) { - } - - public void registerConfiguration(RuntimeConfiguration configuration) { - } - - public int getLifecycleState(){ - return RUNNING; - } - - - public void setLifecycleState(int state) { - } - - - public void setName(String name) { - } - - - public void addContextListener(LifecycleEventListener listener) { - } - - - public void removeContextListener(LifecycleEventListener listener) { - } - - public Object getImplementationInstance() throws TargetException{ - return this; - } - - public Object getImplementationInstance(boolean notify) throws TargetException{ - return this; - } - - -} - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBinding.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBinding.java deleted file mode 100644 index 75aabff105..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBinding.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.binding.foo; - -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelVisitor; -import org.apache.tuscany.model.assembly.Binding; -import org.apache.tuscany.model.assembly.ModelInitException; - -/** - * Represents a mock binding that echoes back a single parameter - * - * @version $Rev$ $Date$ - */ -public class FooBinding implements Binding { - - public FooBinding() { - } - - public String getURI() { - return null; - } - - public void setURI(String value) { - } - - public void initialize(AssemblyModelContext modelContext) throws ModelInitException { - } - - public void freeze() { - } - - public boolean accept(AssemblyModelVisitor visitor) { - return false; - } - - private Object config; - - public void setRuntimeConfiguration(Object configuration) { - config = configuration; - } - - public Object getRuntimeConfiguration() { - System.out.println("retting"); - return config; - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBindingBuilder.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBindingBuilder.java deleted file mode 100644 index 248f7e54bc..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBindingBuilder.java +++ /dev/null @@ -1,192 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.binding.foo; - -import java.lang.reflect.Method; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.ObjectFactory; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.builder.impl.EntryPointRuntimeConfiguration; -import org.apache.tuscany.core.builder.impl.HierarchicalBuilder; -import org.apache.tuscany.core.config.JavaIntrospectionHelper; -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.injection.ObjectCreationException; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.ProxyConfiguration; -import org.apache.tuscany.core.invocation.impl.InvokerInterceptor; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.invocation.spi.ProxyFactoryFactory; -import org.apache.tuscany.core.message.MessageFactory; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.ExternalService; -import org.apache.tuscany.model.assembly.Service; -import org.apache.tuscany.model.assembly.ServiceContract; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -/** - * Creates a RuntimeConfigurationBuilder for an entry point or external service configured with the - * {@link FooBinding} - * - * @version $Rev$ $Date$ - */ -@Scope("MODULE") -public class FooBindingBuilder implements RuntimeConfigurationBuilder { - - @Autowire - private RuntimeContext runtimeContext; - - private ProxyFactoryFactory proxyFactoryFactory; - - private MessageFactory messageFactory; - - /* the top-level builder responsible for evaluating policies */ - private HierarchicalBuilder policyBuilder = new HierarchicalBuilder(); - - public FooBindingBuilder() { - } - - @Init(eager = true) - public void init() { - runtimeContext.addBuilder(this); - } - - /** - * @param runtimeContext The runtimeContext to set. - */ - @Autowire - public void setRuntimeContext(RuntimeContext runtimeContext) { - this.runtimeContext = runtimeContext; - } - - /** - * Sets the factory used to construct proxies implmementing the business interface required by a reference - */ - @Autowire - public void setProxyFactoryFactory(ProxyFactoryFactory factory) { - this.proxyFactoryFactory = factory; - } - - /** - * Sets the factory used to construct invocation messages - * - * @param msgFactory - */ - @Autowire - public void setMessageFactory(MessageFactory msgFactory) { - this.messageFactory = msgFactory; - } - - /** - * Adds a builder responsible for creating source-side and target-side invocation chains for a reference. The - * reference builder may be hierarchical, containing other child reference builders that operate on specific - * metadata used to construct and invocation chain. - */ - public void addPolicyBuilder(RuntimeConfigurationBuilder builder) { - policyBuilder.addBuilder(builder); - } - - public void build(AssemblyModelObject object, Context context) throws BuilderException { - if (object instanceof EntryPoint) { - EntryPoint ep = (EntryPoint) object; - if (ep.getBindings().size() < 1 || !(ep.getBindings().get(0) instanceof FooBinding)) { - return; - } - EntryPointRuntimeConfiguration config = new FooEntryPointRuntimeConfiguration(ep.getName(), ep.getConfiguredService() - .getService().getName(), messageFactory); - - ConfiguredService configuredService = ep.getConfiguredService(); - Service service = configuredService.getService(); - ServiceContract serviceContract = service.getServiceContract(); - Map iConfigMap = new HashMap(); - ProxyFactory proxyFactory = proxyFactoryFactory.createProxyFactory(); - Set javaMethods = JavaIntrospectionHelper.getAllUniqueMethods(serviceContract.getInterface()); - for (Method method : javaMethods) { - InvocationConfiguration iConfig = new InvocationConfiguration(method); - iConfigMap.put(method, iConfig); - } - QualifiedName qName = new QualifiedName(ep.getConfiguredReference().getTargetConfiguredServices().get(0).getAggregatePart().getName() + "/" + service.getName()); - ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, serviceContract.getInterface().getClassLoader(), messageFactory); - proxyFactory.setBusinessInterface(serviceContract.getInterface()); - proxyFactory.setProxyConfiguration(pConfiguration); - config.addSourceProxyFactory(service.getName(), proxyFactory); - configuredService.setProxyFactory(proxyFactory); - if (policyBuilder != null) { - // invoke the reference builder to handle additional policy metadata - policyBuilder.build(configuredService, context); - } - // add tail interceptor - for (InvocationConfiguration iConfig : (Collection) iConfigMap.values()) { - iConfig.addTargetInterceptor(new InvokerInterceptor()); - } - ep.getConfiguredReference().setRuntimeConfiguration(config); - - } else if (object instanceof ExternalService) { - ExternalService es = (ExternalService) object; - if (es.getBindings().size() < 1 || !(es.getBindings().get(0) instanceof FooBinding)) { - return; - } - - FooExternalServiceRuntimeConfiguration config = new FooExternalServiceRuntimeConfiguration(es.getName(), - new FooClientFactory()); - - ConfiguredService configuredService = es.getConfiguredService(); - Service service = configuredService.getService(); - ServiceContract serviceContract = service.getServiceContract(); - Map iConfigMap = new HashMap(); - ProxyFactory proxyFactory = proxyFactoryFactory.createProxyFactory(); - Set javaMethods = JavaIntrospectionHelper.getAllUniqueMethods(serviceContract.getInterface()); - for (Method method : javaMethods) { - InvocationConfiguration iConfig = new InvocationConfiguration(method); - iConfigMap.put(method, iConfig); - } - QualifiedName qName = new QualifiedName(es.getName() + "/" + service.getName()); - ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, serviceContract.getInterface().getClassLoader(), messageFactory); - proxyFactory.setBusinessInterface(serviceContract.getInterface()); - proxyFactory.setProxyConfiguration(pConfiguration); - config.addTargetProxyFactory(service.getName(), proxyFactory); - configuredService.setProxyFactory(proxyFactory); - if (policyBuilder != null) { - // invoke the reference builder to handle additional policy metadata - policyBuilder.build(configuredService, context); - } - // add tail interceptor - for (InvocationConfiguration iConfig : (Collection) iConfigMap.values()) { - iConfig.addTargetInterceptor(new InvokerInterceptor()); - } - - es.getConfiguredService().setRuntimeConfiguration(config); - } else { - return; - - } - } - - private class FooClientFactory implements ObjectFactory { - - public Object getInstance() throws ObjectCreationException { - return new FooClient(); - } - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBindingWireBuilder.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBindingWireBuilder.java deleted file mode 100644 index bba70e4c84..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBindingWireBuilder.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.apache.tuscany.container.java.mock.binding.foo; - -import org.apache.tuscany.core.builder.BuilderConfigException; -import org.apache.tuscany.core.builder.WireBuilder; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.osoa.sca.annotations.Init; - -public class FooBindingWireBuilder implements WireBuilder { - - public FooBindingWireBuilder() { - super(); - } - - private RuntimeContext runtimeContext; - - @Autowire - public void setRuntimeContext(RuntimeContext context) { - runtimeContext = context; - } - - @Init(eager=true) - public void init() { - runtimeContext.addBuilder(this); - } - - - public void connect(ProxyFactory sourceFactory, ProxyFactory targetFactory, Class targetType, boolean downScope, - ScopeContext targetScopeContext) throws BuilderConfigException { - if (!FooExternalServiceRuntimeConfiguration.class.isAssignableFrom(targetType)) { - return; - } - for (InvocationConfiguration sourceInvocationConfig : sourceFactory.getProxyConfiguration().getInvocationConfigurations() - .values()) { - FooESTargetInvoker invoker = new FooESTargetInvoker(sourceFactory.getProxyConfiguration().getTargetName() - .getPartName(), targetScopeContext); - sourceInvocationConfig.setTargetInvoker(invoker); - // if (downScope) { - // // the source scope is shorter than the target, so the invoker can cache the target instance - // invoker.setCacheable(true); - // } else { - // invoker.setCacheable(false); - // } - } - - } - - public void completeTargetChain(ProxyFactory targetFactory, Class targetType, ScopeContext targetScopeContext) - throws BuilderConfigException { - // TODO implement - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooClient.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooClient.java deleted file mode 100644 index 9f67eb7786..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooClient.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.binding.foo; - -import java.lang.reflect.Array; - -import org.apache.tuscany.core.context.TargetException; - -/** - * A mock client for a transport binding - * - * @version $Rev$ $Date$ - */ -public class FooClient { - - public FooClient() { - } - - public Object invoke(Object msg) { - if (msg!=null && msg.getClass().isArray() && Array.getLength(msg) == 1){ - return Array.get(msg,0); - }else{ - throw new TargetException("This binding only understands operations with a single parameter"); - } - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooESTargetInvoker.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooESTargetInvoker.java deleted file mode 100644 index 6dd42ef4d6..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooESTargetInvoker.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.binding.foo; - -import java.lang.reflect.InvocationTargetException; - -import org.apache.tuscany.core.context.ExternalServiceContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.context.TargetException; -import org.apache.tuscany.core.invocation.Interceptor; -import org.apache.tuscany.core.invocation.TargetInvoker; -import org.apache.tuscany.core.message.Message; - -/** - * Responsible for invoking a mock transport binding client configured for an external service - * - * @version $Rev$ $Date$ - */ -public class FooESTargetInvoker implements TargetInvoker { - - private String name; - - private ScopeContext container; - - private ExternalServiceContext context; - - public FooESTargetInvoker(String esName, ScopeContext container) { - assert (esName != null) : "No external service name specified"; - assert (container != null) : "No scope container specified"; - name = esName; - this.container = container; - } - - public Object invokeTarget(Object payload) throws InvocationTargetException { - if (context == null) { - InstanceContext iContext = container.getContext(name); - if (!(iContext instanceof ExternalServiceContext)) { - TargetException te = new TargetException("Unexpected target context type"); - te.setIdentifier(iContext.getClass().getName()); - te.addContextName(iContext.getName()); - throw te; - } - context = (ExternalServiceContext) iContext; - } - FooClient client = (FooClient) context.getImplementationInstance(true); - if (payload != null) { - return client.invoke(payload); - } else { - return client.invoke(null); - } - } - - public boolean isCacheable() { - return false; - } - - public Message invoke(Message msg) { - try { - Object resp = invokeTarget(msg.getBody()); - msg.setBody(resp); - } catch (InvocationTargetException e) { - msg.setBody(e.getCause()); - } catch (Throwable e) { - msg.setBody(e); - } - return msg; - } - - public void setNext(Interceptor next) { - throw new UnsupportedOperationException(); - } - - public Object clone() { - try { - FooESTargetInvoker invoker = (FooESTargetInvoker) super.clone(); - invoker.container = container; - invoker.context = this.context; - invoker.name = this.name; - return invoker; - } catch (CloneNotSupportedException e) { - return null; // will not happen - } - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooEntryPointRuntimeConfiguration.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooEntryPointRuntimeConfiguration.java deleted file mode 100644 index bee388127e..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooEntryPointRuntimeConfiguration.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.binding.foo; - -import org.apache.tuscany.core.builder.impl.EntryPointRuntimeConfiguration; -import org.apache.tuscany.core.message.MessageFactory; - -/** - * - * - * @version $Rev$ $Date$ - */ -public class FooEntryPointRuntimeConfiguration extends EntryPointRuntimeConfiguration { - - public FooEntryPointRuntimeConfiguration(String name, String serviceName, MessageFactory msgFactory) { - super(name, serviceName, msgFactory); - } - -} - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooExternalServiceRuntimeConfiguration.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooExternalServiceRuntimeConfiguration.java deleted file mode 100644 index e06a78d529..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooExternalServiceRuntimeConfiguration.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.binding.foo; - -import org.apache.tuscany.core.builder.ObjectFactory; -import org.apache.tuscany.core.builder.impl.BaseExternalServiceRuntimeConfiguration; - -/** - * Creates instances of {@link org.apache.tuscany.core.context.ExternalServiceContext} configured with the appropriate - * invocation chains and bindings. This implementation serves as a marker for - * {@link org.apache.tuscany.container.java.mock.binding.foo.FooBindingWireBuilder} - * - * @version $Rev$ $Date$ - */ -public class FooExternalServiceRuntimeConfiguration extends BaseExternalServiceRuntimeConfiguration { - - public FooExternalServiceRuntimeConfiguration(String name, ObjectFactory objectFactory) { - super(name, objectFactory); - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/AbstractGenericComponent.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/AbstractGenericComponent.java deleted file mode 100644 index 0c9d8172f8..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/AbstractGenericComponent.java +++ /dev/null @@ -1,296 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import java.util.List; -import java.util.Map; - -import org.osoa.sca.ModuleContext; -import org.osoa.sca.annotations.ComponentName; -import org.osoa.sca.annotations.Context; -import org.osoa.sca.annotations.Property; - -/** - * Base test component implementation - * - * @version $Rev$ $Date$ - */ -public class AbstractGenericComponent implements GenericComponent { - - @ComponentName - private String name; - - public String getName() { - return name; - } - - @Context - private ModuleContext context; - - public ModuleContext getModuleContext() { - return context; - } - - //---------------------------------- - // Collections - //---------------------------------- - - Map testMap; - - public Map getTestMap() { - return testMap; - } - - public void setTestMap(Map testMap) { - this.testMap = testMap; - } - - List testList; - - public List getTestList() { - return testList; - } - - public void setTestList(List testList) { - this.testList = testList; - } - - //---------------------------------- - // Arrays - //---------------------------------- - - private int[] arrayInt; - - public int[] getArrayInt() { - return arrayInt; - } - - public void setArrayInt(int[] arrayInt) { - this.arrayInt = arrayInt; - } - - private float[] arrayFloat; - - public float[] getArrayFloat() { - return arrayFloat; - } - - public void setArrayFloat(float[] pArrayFloat) { - arrayFloat = pArrayFloat; - } - - private double[] arrayDouble; - - public double[] getArrayDouble() { - return arrayDouble; - } - - public void setArrayDouble(double[] pArrayDouble) { - arrayDouble = pArrayDouble; - } - - private long[] arrayLong; - - public long[] getArrayLong() { - return arrayLong; - } - - public void setArrayLong(long[] arrayLong) { - this.arrayLong = arrayLong; - } - - private short[] arrayShort; - - public short[] getArrayShort() { - return arrayShort; - } - - public void setArrayShort(short[] arrayShort) { - this.arrayShort = arrayShort; - } - - private boolean[] arrayBoolean; - - public boolean[] getArrayBoolean() { - return arrayBoolean; - } - - public void setArrayBoolean(boolean[] arrayBoolean) { - this.arrayBoolean = arrayBoolean; - } - - private String[] arrayString; - - public String[] getArrayString() { - return arrayString; - } - - public void setArrayString(String[] arrayString) { - this.arrayString = arrayString; - } - - //---------------------------------- - // Primitives - //---------------------------------- - - private boolean mBoolean; - - public boolean getBoolean() { - return mBoolean; - } - - public void setBoolean(boolean pBoolean) { - mBoolean = pBoolean; - } - - private short mShort; - - public short getShort() { - return mShort; - } - - public void setShort(short pShort) { - mShort = pShort; - } - - private int mInt; - - public int getInt() { - return mInt; - } - - public void setInt(int pInt) { - mInt = pInt; - } - - private long mLong; - - public long getLong() { - return mLong; - } - - public void setLong(long pLong) { - mLong = pLong; - } - - private double mDouble; - - public double getDouble() { - return mDouble; - } - - public void setDouble(double pDouble) { - mDouble = pDouble; - } - - private float mFloat; - - public float getFloat() { - return mFloat; - } - - public void setFloat(float pFloat) { - mFloat = pFloat; - } - - private char mChar; - - public char getChar() { - return mChar; - } - - public void setChar(char pChar) { - mChar = pChar; - } - - //---------------------------------- - // Object types - //---------------------------------- - - private String mString; - - public String getString() { - return mString; - } - - public void setString(String pString) { - mString = pString; - } - - private Short mOShort; - - public Short getOShort() { - return mOShort; - } - - public void setOShort(Short pOShort) { - mOShort = pOShort; - } - - private Integer mOInteger; - - public Integer getOInteger() { - return mOInteger; - } - - public void setOInteger(Integer pOInteger) { - mOInteger = pOInteger; - } - - private Long mOLong; - - public Long getOLong() { - return mOLong; - } - - public void setOLong(Long pOLong) { - mOLong = pOLong; - } - - private Float mOFloat; - - public Float getOFloat() { - return mOFloat; - } - - public void setOFloat(Float pOFloat) { - mOFloat = pOFloat; - } - - private Double mODouble; - - public Double getODouble() { - return mODouble; - } - - public void setODouble(Double pODouble) { - mODouble = pODouble; - } - - @Property(name = "genericComponent") - private GenericComponent mGenericComponent; - - public GenericComponent getGenericComponent() { - return mGenericComponent; - } - - public void setGenericComponent(GenericComponent pGenericComponent) { - mGenericComponent = pGenericComponent; - } - - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/BadContextPojo.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/BadContextPojo.java deleted file mode 100644 index 7840b57dea..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/BadContextPojo.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import org.osoa.sca.annotations.Context; - -public class BadContextPojo { - - @Context - String moduleContext; - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/BadNamePojo.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/BadNamePojo.java deleted file mode 100644 index d9753fa9f0..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/BadNamePojo.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import org.osoa.sca.annotations.ComponentName; - -public class BadNamePojo { - @ComponentName - private int name; -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/DataObject.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/DataObject.java deleted file mode 100644 index 695cc2a5a1..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/DataObject.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import java.io.Serializable; - -/** - * A complex type for testing - * - * @version $Rev$ $Date$ - */ -public class DataObject implements Serializable { - - private String stringValue; - - public String getStringValue() { - return stringValue; - } - - public void setStringValue(String stringValue) { - this.stringValue = stringValue; - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/GenericComponent.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/GenericComponent.java deleted file mode 100644 index 44f1c02bfd..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/GenericComponent.java +++ /dev/null @@ -1,142 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import java.util.List; -import java.util.Map; - -import org.osoa.sca.ModuleContext; - -/** - * Generic test component - * - * @version $Rev$ $Date$ - */ -public interface GenericComponent { - - public String getName(); - - public ModuleContext getModuleContext(); - - // ---------------------------------- - // Collections - // ---------------------------------- - - public Map getTestMap(); - - public void setTestMap(Map pTestMap); - - public List getTestList(); - - public void setTestList(List pTestList); - - // ---------------------------------- - // Arrays - // ---------------------------------- - - public int[] getArrayInt(); - - public void setArrayInt(int[] pArrayInt); - - public float[] getArrayFloat(); - - public void setArrayFloat(float[] pArrayFloat); - - public double[] getArrayDouble(); - - public void setArrayDouble(double[] pArrayDouble); - - public long[] getArrayLong(); - - public void setArrayLong(long[] pArrayLong); - - public short[] getArrayShort(); - - public void setArrayShort(short[] pArrayShort); - - public boolean[] getArrayBoolean(); - - public void setArrayBoolean(boolean[] pArrayBoolean); - - public String[] getArrayString(); - - public void setArrayString(String[] pArrayString); - - // ---------------------------------- - // Primitives - // ---------------------------------- - - public boolean getBoolean(); - - public void setBoolean(boolean pBoolean); - - public short getShort(); - - public void setShort(short pShort); - - public int getInt(); - - public void setInt(int pInt); - - public long getLong(); - - public void setLong(long pLong); - - public double getDouble(); - - public void setDouble(double pDouble); - - public float getFloat(); - - public void setFloat(float pFloat); - - public char getChar(); - - public void setChar(char pChar); - - // ---------------------------------- - // Object types - // ---------------------------------- - - public String getString(); - - public void setString(String pString); - - public Short getOShort(); - - public void setOShort(Short pOShort); - - public Integer getOInteger(); - - public void setOInteger(Integer pOInteger); - - public Long getOLong(); - - public void setOLong(Long pOLong); - - public Float getOFloat(); - - public void setOFloat(Float pOFloat); - - public Double getODouble(); - - public void setODouble(Double pODouble); - - public GenericComponent getGenericComponent(); - - public void setGenericComponent(GenericComponent pGenericComponent); -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/HelloWorldClient.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/HelloWorldClient.java deleted file mode 100644 index 1e7ca9f36b..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/HelloWorldClient.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import org.apache.tuscany.container.java.assembly.mock.HelloWorldService; - -/** - * - * - * @version $Rev$ $Date$ - */ -public class HelloWorldClient implements HelloWorldService{ - - private int count; - - public HelloWorldClient() { - } - - private HelloWorldService service; - - public void setHelloWorldService(HelloWorldService service){ - this.service = service; - } - - public String hello(String name) { - ++count; - return service.hello(name); - } - - public int count() { - return count; - } - -} - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/LocalComponentImpl.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/LocalComponentImpl.java deleted file mode 100644 index 4b57c7f301..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/LocalComponentImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import org.osoa.sca.ModuleContext; -import org.osoa.sca.annotations.ComponentName; -import org.osoa.sca.annotations.Context; -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Reference; - -/** - * A test local service - * - * @version $Rev$ $Date$ - */ - -public class LocalComponentImpl { - - @ComponentName - protected String name; - - public String getName() { - return name; - } - - @Context - protected ModuleContext moduleCtx; - - public ModuleContext getModuleContext() { - return moduleCtx; - } - - @Property(name = "fieldSetter", required = true) - private String mfieldSetter; - - public String getfieldSetter() { - return mfieldSetter; - } - - public void setfieldSetter(String pfieldSetter) throws Exception { - throw new Exception("Set method instead of field"); - } - - private String mMethodSetter; - boolean mSetByMethod; - - public String getMethodSetter() throws Exception { - if (mSetByMethod) { - return mMethodSetter; - } - throw new Exception("Property method setter failed"); - - } - - @Property(required = true) - public void setMethodSetter(String pMethodSetter) { - mSetByMethod = true; - mMethodSetter = pMethodSetter; - } - - @Reference(name = "requiredDataObject", required = true) - private DataObject mRequiredDataObject; - - public DataObject getRequiredDataObject() { - return mRequiredDataObject; - } - - public void setRequiredDataObject(DataObject pRequiredDataObject) { - mRequiredDataObject = pRequiredDataObject; - } - - @Reference(name = "optionalDataObject") - private DataObject mOptionalDataObject; - - public DataObject getOptionalDataObject() { - return mOptionalDataObject; - } - - public void setOptionalDataObject(DataObject pOptionalDataObject) { - mOptionalDataObject = pOptionalDataObject; - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponent.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponent.java deleted file mode 100644 index 7787e8cf5b..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponent.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import org.osoa.sca.annotations.Scope; - -/** - * @version $Rev$ $Date$ - */ -@Scope("MODULE") -public interface ModuleScopeComponent extends GenericComponent { - - //public boolean isInit(); -} - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponentImpl.componentType b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponentImpl.componentType deleted file mode 100644 index ca4c633e59..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponentImpl.componentType +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponentImpl.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponentImpl.java deleted file mode 100644 index ca65be4bb0..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponentImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - - -/** - * @version $Rev$ $Date$ - */ -public class ModuleScopeComponentImpl extends AbstractGenericComponent implements - ModuleScopeComponent { - -// private boolean init; -// -// @Init(eager=false) -// public void init(){ -// init= true; -// } -// -// public boolean isInit(){ -// return init; -// } - - - private String foo; - - public void setFoo(String foo) { - this.foo = foo; - } - - public String getFoo() { - return foo; - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeDestroyOnlyComponent.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeDestroyOnlyComponent.java deleted file mode 100644 index 76218c2d6c..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeDestroyOnlyComponent.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import org.osoa.sca.annotations.Destroy; - -public class ModuleScopeDestroyOnlyComponent extends ModuleScopeComponentImpl { - - boolean destroyed = false; - - public boolean isDestroyed() { - return destroyed; - } - - @Destroy - public void destroy() { - destroyed = true; - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeEagerInitComponent.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeEagerInitComponent.java deleted file mode 100644 index 56a0421f24..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeEagerInitComponent.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import org.osoa.sca.annotations.Init; - -public class ModuleScopeEagerInitComponent extends ModuleScopeComponentImpl { - - boolean initialized = false; - - public boolean isInitialized() { - return initialized; - } - - // this value tests to ensure introspection can find the init() method even - // if a field is named the same. Ultimately, this should be in the - // introspection tests - private boolean init; - - @Init(eager = true) - public void init() { - initialized = true; - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeEagerInitDestroyComponent.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeEagerInitDestroyComponent.java deleted file mode 100644 index dae156737a..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeEagerInitDestroyComponent.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import org.osoa.sca.annotations.Destroy; - -public class ModuleScopeEagerInitDestroyComponent extends ModuleScopeEagerInitComponent { - - boolean destroyed = false; - - public boolean isDestroyed() { - return destroyed; - } - - @Destroy - public void destroy() { - destroyed = true; - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeInitDestroyComponent.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeInitDestroyComponent.java deleted file mode 100644 index d9b1303677..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeInitDestroyComponent.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import org.osoa.sca.annotations.Destroy; - -public class ModuleScopeInitDestroyComponent extends ModuleScopeInitOnlyComponent { - - boolean destroyed = false; - - public boolean isDestroyed() { - return destroyed; - } - - @Destroy - public void destroy() { - destroyed = true; - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeInitOnlyComponent.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeInitOnlyComponent.java deleted file mode 100644 index a9b465d79e..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeInitOnlyComponent.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import org.osoa.sca.annotations.Init; - -public class ModuleScopeInitOnlyComponent extends ModuleScopeComponentImpl { - - boolean initialized = false; - - public boolean isInitialized() { - return initialized; - } - - // this value tests to ensure introspection can find the init() method even - // if a field is named the same. Ultimately, this should be in the introspection tests - private boolean init; - - @Init - public void init() { - initialized = true; - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RemotableService.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RemotableService.java deleted file mode 100644 index 645fd7f47c..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RemotableService.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import org.osoa.sca.annotations.Remotable; - -/** - * Used for testing basic remoting operations - * - * @version $Rev$ $Date$ - */ - -@Remotable -public interface RemotableService { - - public void syncOneWay(String msg); - - public String syncTwoWay(String msg); - - public DataObject syncTwoWayCustomType(DataObject val); - - public String getString(); - - public void setString(String string); - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RemotableServiceImpl.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RemotableServiceImpl.java deleted file mode 100644 index 34a4273323..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RemotableServiceImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import junit.framework.Assert; -import org.osoa.sca.annotations.Property; - - -/** - * @version $Rev$ $Date$ - */ -public class RemotableServiceImpl implements RemotableService { - - // ---------------------------------- - // Properties - // ---------------------------------- - - @Property(name = "string", required = true) - private String mString; - - public String getString() { - return mString; - } - - public void setString(String string) { - mString = string; - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public void syncOneWay(String msg) { - Assert.assertEquals("hello", msg); - } - - public String syncTwoWay(String msg) { - return "response"; - } - - public DataObject syncTwoWayCustomType(DataObject val) { - Assert.assertEquals("hello", val.getStringValue()); - DataObject dto = new DataObject(); - dto.setStringValue("return"); - return dto; - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeComponent.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeComponent.java deleted file mode 100644 index ac7931bd2c..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeComponent.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import org.osoa.sca.annotations.Scope; - -/** - * @version $Rev$ $Date$ - */ -@Scope("REQUEST") -public interface RequestScopeComponent extends GenericComponent { - -} - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeComponentImpl.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeComponentImpl.java deleted file mode 100644 index 5b20519d90..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeComponentImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -/** - * @version $Rev$ $Date$ - */ -public class RequestScopeComponentImpl extends AbstractGenericComponent implements - RequestScopeComponent { - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeComponent.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeComponent.java deleted file mode 100644 index 236e083a2b..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeComponent.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import org.osoa.sca.annotations.Scope; - -/** - * @version $Rev$ $Date$ - */ -@Scope("SESSION") -public interface SessionScopeComponent extends GenericComponent { - -} - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeComponentImpl.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeComponentImpl.java deleted file mode 100644 index 41ffeccdfc..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeComponentImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -/** - * @version $Rev$ $Date$ - */ -public class SessionScopeComponentImpl extends AbstractGenericComponent implements - SessionScopeComponent { - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeDestroyOnlyComponent.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeDestroyOnlyComponent.java deleted file mode 100644 index be20a23d29..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeDestroyOnlyComponent.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import org.osoa.sca.annotations.Destroy; - -public class SessionScopeDestroyOnlyComponent extends SessionScopeComponentImpl { - - boolean destroyed = false; - - public boolean isDestroyed() { - return destroyed; - } - - @Destroy - public void destroy() { - destroyed = true; - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeInitDestroyComponent.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeInitDestroyComponent.java deleted file mode 100644 index 32aa0142a4..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeInitDestroyComponent.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import org.osoa.sca.annotations.Destroy; - -public class SessionScopeInitDestroyComponent extends SessionScopeInitOnlyComponent { - - boolean destroyed = false; - - public boolean isDestroyed() { - return destroyed; - } - - @Destroy - public void destroy() { - destroyed = true; - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeInitOnlyComponent.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeInitOnlyComponent.java deleted file mode 100644 index a518a9b244..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeInitOnlyComponent.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import org.osoa.sca.annotations.Init; - -public class SessionScopeInitOnlyComponent extends SessionScopeComponentImpl { - - boolean initialized = false; - - public boolean isInitialized() { - return initialized; - } - - @Init - public void init() { - initialized = true; - } - - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/StatelessComponent.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/StatelessComponent.java deleted file mode 100644 index 3fe84dd785..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/StatelessComponent.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -import org.osoa.sca.annotations.Scope; - -/** - * @version $Rev$ $Date$ - */ -@Scope("STATELESS") -public interface StatelessComponent extends GenericComponent { - -} - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/StatelessComponentImpl.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/StatelessComponentImpl.java deleted file mode 100644 index 8b806d6a2e..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/StatelessComponentImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.mock.components; - -/** - * @version $Rev$ $Date$ - */ -public class StatelessComponentImpl extends AbstractGenericComponent implements - StatelessComponent { - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/AggregateScopeTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/AggregateScopeTestCase.java deleted file mode 100644 index 77130f6334..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/AggregateScopeTestCase.java +++ /dev/null @@ -1,178 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.scopes; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.container.java.builder.JavaComponentContextBuilder; -import org.apache.tuscany.container.java.mock.MockFactory; -import org.apache.tuscany.container.java.mock.components.GenericComponent; -import org.apache.tuscany.container.java.mock.components.ModuleScopeComponentImpl; -import org.apache.tuscany.container.java.mock.components.SessionScopeComponentImpl; -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.impl.AggregateContextImpl; -import org.apache.tuscany.core.context.impl.EventContextImpl; -import org.apache.tuscany.core.context.scope.AggregateScopeContext; -import org.apache.tuscany.model.assembly.Extensible; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.SimpleComponent; - -/** - * Tests component nesting. This test need to be in the container.java progject since it relies on Java POJOs for scope - * testing. - * - * @version $Rev$ $Date$ - */ -public class AggregateScopeTestCase extends TestCase { - - /** - * Ensures scope events are propagated in an aggregate scope - */ - public void testAggregateScopePropagation() throws Exception { - EventContext ctx = new EventContextImpl(); - AggregateContext moduleComponentCtx = new AggregateContextImpl(); - moduleComponentCtx.setName("testMC"); - AggregateScopeContext scopeContainer = new AggregateScopeContext(ctx); - scopeContainer.registerConfiguration(MockFactory.createAggregateConfiguration("AggregateComponent", moduleComponentCtx)); - scopeContainer.start(); - AggregateContext child = (AggregateContext) scopeContainer.getContext("AggregateComponent"); - List models = createAssembly(moduleComponentCtx); - for (Extensible model : models) { - child.registerModelObject(model); - } - - scopeContainer.onEvent(EventContext.MODULE_START, null); - Object session = new Object(); - scopeContainer.onEvent(EventContext.REQUEST_START, null); - scopeContainer.onEvent(EventContext.SESSION_NOTIFY, session); - AggregateContext componentCtx = (AggregateContext) scopeContainer.getContext("AggregateComponent"); - GenericComponent testService1 = (GenericComponent) componentCtx.locateInstance("TestService1"); - GenericComponent testService2 = (GenericComponent) componentCtx.locateInstance("TestService2"); - GenericComponent testService3 = (GenericComponent) componentCtx.locateInstance("TestService3"); - Assert.assertNotNull(testService1); - Assert.assertNotNull(testService2); - Assert.assertNotNull(testService3); - scopeContainer.onEvent(EventContext.REQUEST_END, null); - scopeContainer.onEvent(EventContext.REQUEST_START, null); - scopeContainer.onEvent(EventContext.SESSION_NOTIFY, session); - - GenericComponent testService2a = (GenericComponent) componentCtx.locateInstance("TestService2"); - Assert.assertNotNull(testService2a); - GenericComponent testService3a = (GenericComponent) componentCtx.locateInstance("TestService3"); - Assert.assertNotNull(testService3a); - Assert.assertEquals(testService2, testService2a); - Assert.assertNotSame(testService3, testService3a); - scopeContainer.onEvent(EventContext.REQUEST_END, null); - scopeContainer.onEvent(EventContext.SESSION_END, session); - - Object session2 = new Object(); - scopeContainer.onEvent(EventContext.REQUEST_START, null); - scopeContainer.onEvent(EventContext.SESSION_NOTIFY, session2); - GenericComponent testService2b = (GenericComponent) componentCtx.locateInstance("TestService2"); - Assert.assertNotNull(testService2b); - Assert.assertNotSame(testService2, testService2b); - - scopeContainer.onEvent(EventContext.REQUEST_END, null); - scopeContainer.onEvent(EventContext.SESSION_END, session2); - - } - - /** - * Ensures only child entry points (and not components) are accessible from parents - */ - public void testAggregateNoEntryPoint() throws Exception { - EventContext ctx = new EventContextImpl(); - AggregateContext moduleComponentCtx = new AggregateContextImpl(); - moduleComponentCtx.setName("testMC"); - AggregateScopeContext scopeContainer = new AggregateScopeContext(ctx); - scopeContainer.registerConfiguration(MockFactory.createAggregateConfiguration("AggregateComponent", moduleComponentCtx)); - scopeContainer.start(); - AggregateContext child = (AggregateContext) scopeContainer.getContext("AggregateComponent"); - List parts = createAssembly(moduleComponentCtx); - for (Extensible part : parts) { - child.registerModelObject(part); - } - - // aggregate.onEvent(EventContext.SYSTEM_START, null); - scopeContainer.onEvent(EventContext.MODULE_START, null); - QualifiedName name = new QualifiedName("AggregateComponent/TestService1"); - AggregateContext componentCtx = (AggregateContext) scopeContainer.getContext("AggregateComponent"); - } - - /** - * Tests adding a context before its parent has been started - */ - public void testRegisterContextBeforeStart() throws Exception { - EventContext ctx = new EventContextImpl(); - AggregateContext moduleComponentCtx = new AggregateContextImpl(); - moduleComponentCtx.setName("testMC"); - AggregateScopeContext scopeContainer = new AggregateScopeContext(ctx); - scopeContainer.registerConfiguration(MockFactory.createAggregateConfiguration("AggregateComponent", moduleComponentCtx)); - scopeContainer.start(); - scopeContainer.onEvent(EventContext.MODULE_START, null); - QualifiedName name = new QualifiedName("AggregateComponent/TestService1"); - AggregateContext componentCtx = (AggregateContext) scopeContainer.getContext("AggregateComponent"); - scopeContainer.onEvent(EventContext.MODULE_STOP, null); - scopeContainer.stop(); - } - - /** - * Tests adding a context after its parent has been started - */ - public void testRegisterContextAfterStart() throws Exception { - EventContext ctx = new EventContextImpl(); - AggregateContext moduleComponentCtx = new AggregateContextImpl(); - moduleComponentCtx.setName("testMC"); - AggregateScopeContext scopeContainer = new AggregateScopeContext(ctx); - scopeContainer.start(); - - scopeContainer.onEvent(EventContext.MODULE_START, null); - scopeContainer.registerConfiguration(MockFactory.createAggregateConfiguration("AggregateComponent", moduleComponentCtx)); - QualifiedName name = new QualifiedName("AggregateComponent/TestService1"); - AggregateContext componentCtx = (AggregateContext) scopeContainer.getContext("AggregateComponent"); - scopeContainer.onEvent(EventContext.MODULE_STOP, null); - scopeContainer.stop(); - } - - /** - * Creats an assembly containing a module-scoped component definition, a session-scoped component definition, and a - * request-scoped component definition - * - * @param ctx the parent module context - */ - private List createAssembly(AggregateContext ctx) throws BuilderException { - JavaComponentContextBuilder builder = new JavaComponentContextBuilder(); - SimpleComponent component = MockFactory.createComponent("TestService1", ModuleScopeComponentImpl.class, Scope.MODULE); - SimpleComponent sessionComponent = MockFactory.createComponent("TestService2", SessionScopeComponentImpl.class, - Scope.SESSION); - SimpleComponent requestComponent = MockFactory.createComponent("TestService3", SessionScopeComponentImpl.class, - Scope.REQUEST); - builder.build(component, ctx); - builder.build(sessionComponent, ctx); - builder.build(requestComponent, ctx); - List configs = new ArrayList(); - configs.add(component); - configs.add(sessionComponent); - configs.add(requestComponent); - return configs; - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicHttpSessionScopeTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicHttpSessionScopeTestCase.java deleted file mode 100644 index a56589c4d1..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicHttpSessionScopeTestCase.java +++ /dev/null @@ -1,223 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.scopes; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.container.java.builder.JavaComponentContextBuilder; -import org.apache.tuscany.container.java.mock.MockFactory; -import org.apache.tuscany.container.java.mock.components.SessionScopeComponent; -import org.apache.tuscany.container.java.mock.components.SessionScopeComponentImpl; -import org.apache.tuscany.container.java.mock.components.SessionScopeInitDestroyComponent; -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.impl.EventContextImpl; -import org.apache.tuscany.core.context.scope.HttpSessionScopeContext; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.SimpleComponent; - -/** - * Unit tests for the Http session scope container - * - * @version $Rev$ $Date$ - */ -public class BasicHttpSessionScopeTestCase extends TestCase { - - /** - * Tests instance identity is properly maintained - */ - public void testInstanceManagement() throws Exception { - EventContext ctx = new EventContextImpl(); - HttpSessionScopeContext scope = new HttpSessionScopeContext(ctx); - scope.registerConfigurations(createConfigurations()); - scope.start(); - Object session = new Object(); - Object session2 = new Object(); - // first request - ctx.setIdentifier(EventContext.HTTP_SESSION, session); - SessionScopeComponent comp1 = (SessionScopeComponent) scope.getContext("TestService1").getInstance(null); - Assert.assertNotNull(comp1); - ctx.clearIdentifier(EventContext.HTTP_SESSION); - - // second request - ctx.setIdentifier(EventContext.HTTP_SESSION, session); - SessionScopeComponent comp2 = (SessionScopeComponent) scope.getContext("TestService1").getInstance(null); - Assert.assertNotNull(comp2); - Assert.assertSame(comp1, comp2); - ctx.clearIdentifier(EventContext.HTTP_SESSION); - - // third request, different session - ctx.setIdentifier(EventContext.HTTP_SESSION, session2); - SessionScopeComponent comp3 = (SessionScopeComponent) scope.getContext("TestService1").getInstance(null); - Assert.assertNotNull(comp3); - Assert.assertNotSame(comp1, comp3); // should be different instances - ctx.clearIdentifier(EventContext.HTTP_SESSION); - - scope.onEvent(EventContext.SESSION_END, session); - scope.onEvent(EventContext.SESSION_END, session2); - - scope.stop(); - } - - /** - * Tests setting no components in the scope - */ - public void testSetNullComponents() throws Exception { - EventContext ctx = new EventContextImpl(); - HttpSessionScopeContext scope = new HttpSessionScopeContext(ctx); - scope.registerConfigurations(new ArrayList>()); - scope.start(); - scope.stop(); - } - - public void testGetContextByKey() throws Exception { - EventContext ctx = new EventContextImpl(); - HttpSessionScopeContext scope = new HttpSessionScopeContext(ctx); - scope.registerConfigurations(createConfigurations()); - scope.start(); - Object session = new Object(); - Object session2 = new Object(); - - // first request - ctx.setIdentifier(EventContext.HTTP_SESSION, session); - SessionScopeComponent comp1 = (SessionScopeComponent) scope.getContext("TestService1").getInstance(null); - Assert.assertNotNull(comp1); - ctx.clearIdentifier(EventContext.HTTP_SESSION); - - // second request, different session - ctx.setIdentifier(EventContext.HTTP_SESSION, session2); - SessionScopeComponent comp2 = (SessionScopeComponent) scope.getContextByKey("TestService1", session) - .getInstance(null); - SessionScopeComponent comp3 = (SessionScopeComponent) scope.getContextByKey("TestService1", session) - .getInstance(null); - Assert.assertNotNull(comp2); - scope.onEvent(EventContext.REQUEST_END, session2); - Assert.assertSame(comp1, comp2); // should be same instances - Assert.assertSame(comp2, comp3); // should not be same instances - ctx.clearIdentifier(EventContext.HTTP_SESSION); - - // shutdown sessions - scope.onEvent(EventContext.SESSION_END, session); - scope.onEvent(EventContext.SESSION_END, session2); - - scope.stop(); - } - - public void testRegisterContextBeforeSession() throws Exception { - EventContext ctx = new EventContextImpl(); - HttpSessionScopeContext scope = new HttpSessionScopeContext(ctx); - scope.registerConfigurations(createConfigurations()); - scope.start(); - Object session = new Object(); - scope.registerConfiguration(createConfiguration("NewTestService")); - - // first request - ctx.setIdentifier(EventContext.HTTP_SESSION, session); - - SessionScopeInitDestroyComponent comp2 = (SessionScopeInitDestroyComponent) scope.getContext("NewTestService") - .getInstance(null); - Assert.assertNotNull(comp2); - Assert.assertTrue(comp2.isInitialized()); - ctx.clearIdentifier(EventContext.HTTP_SESSION); - - // second request different session - Object session2 = new Object(); - ctx.setIdentifier(EventContext.HTTP_SESSION, session2); - SessionScopeInitDestroyComponent comp3 = (SessionScopeInitDestroyComponent) scope.getContext("NewTestService") - .getInstance(null); - Assert.assertNotNull(comp3); - Assert.assertNotSame(comp2, comp3); - Assert.assertTrue(comp3.isInitialized()); - ctx.clearIdentifier(EventContext.HTTP_SESSION); - - scope.onEvent(EventContext.SESSION_END, session); - Assert.assertTrue(comp2.isDestroyed()); - - scope.onEvent(EventContext.SESSION_END, session2); - Assert.assertTrue(comp3.isDestroyed()); - scope.stop(); - } - - /** - * Tests runtime context registration - */ - public void testRegisterContextAfterSession() throws Exception { - EventContext ctx = new EventContextImpl(); - HttpSessionScopeContext scope = new HttpSessionScopeContext(ctx); - scope.registerConfigurations(createConfigurations()); - scope.start(); - Object session = new Object(); - - // first request - ctx.setIdentifier(EventContext.HTTP_SESSION, session); - SessionScopeComponent comp1 = (SessionScopeComponent) scope.getContext("TestService1").getInstance(null); - Assert.assertNotNull(comp1); - ctx.clearIdentifier(EventContext.HTTP_SESSION); - - scope.registerConfiguration(createConfiguration("NewTestService")); - - // second request - ctx.setIdentifier(EventContext.HTTP_SESSION, session); - SessionScopeInitDestroyComponent comp2 = (SessionScopeInitDestroyComponent) scope.getContext("NewTestService") - .getInstance(null); - Assert.assertNotNull(comp2); - Assert.assertTrue(comp2.isInitialized()); - ctx.clearIdentifier(EventContext.HTTP_SESSION); - - // third request different session - Object session2 = new Object(); - ctx.setIdentifier(EventContext.HTTP_SESSION, session2); - SessionScopeInitDestroyComponent comp3 = (SessionScopeInitDestroyComponent) scope.getContext("NewTestService") - .getInstance(null); - Assert.assertNotNull(comp3); - Assert.assertNotSame(comp2, comp3); - Assert.assertTrue(comp3.isInitialized()); - ctx.clearIdentifier(EventContext.HTTP_SESSION); - - scope.onEvent(EventContext.SESSION_END, session); - Assert.assertTrue(comp2.isDestroyed()); - - scope.onEvent(EventContext.SESSION_END, session2); - Assert.assertTrue(comp3.isDestroyed()); - scope.stop(); - } - - // ---------------------------------- - // Private methods - // ---------------------------------- - JavaComponentContextBuilder builder = new JavaComponentContextBuilder(); - - private List> createConfigurations() throws NoSuchMethodException, BuilderException { - SimpleComponent component = MockFactory.createComponent("TestService1", SessionScopeComponentImpl.class, Scope.SESSION); - builder.build(component, null); - List> configs = new ArrayList(); - configs.add((RuntimeConfiguration) component.getComponentImplementation().getRuntimeConfiguration()); - return configs; - } - - private RuntimeConfiguration createConfiguration(String name) throws NoSuchMethodException, BuilderException { - SimpleComponent component = MockFactory.createComponent(name, SessionScopeInitDestroyComponent.class, Scope.SESSION); - builder.build(component, null); - return (RuntimeConfiguration) component.getComponentImplementation().getRuntimeConfiguration(); - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicModuleScopeTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicModuleScopeTestCase.java deleted file mode 100644 index e1dab000ce..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicModuleScopeTestCase.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.scopes; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.container.java.builder.JavaComponentContextBuilder; -import org.apache.tuscany.container.java.mock.MockFactory; -import org.apache.tuscany.container.java.mock.components.ModuleScopeComponentImpl; -import org.apache.tuscany.container.java.mock.components.ModuleScopeInitDestroyComponent; -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.impl.EventContextImpl; -import org.apache.tuscany.core.context.scope.ModuleScopeContext; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.SimpleComponent; - -/** - * Unit tests for the module scope container - * - * @version $Rev$ $Date$ - */ -public class BasicModuleScopeTestCase extends TestCase { - - /** - * Tests instance identity is properly maintained - */ - public void testInstanceManagement() throws Exception { - EventContext ctx = new EventContextImpl(); - ModuleScopeContext scope = new ModuleScopeContext(ctx); - scope.registerConfigurations(createConfigurations()); - scope.start(); - // first request - scope.onEvent(EventContext.MODULE_START, null); - ModuleScopeComponentImpl comp1 = (ModuleScopeComponentImpl) scope.getContext("TestService1").getInstance(null); - Assert.assertNotNull(comp1); - // second request - ModuleScopeComponentImpl comp2 = (ModuleScopeComponentImpl) scope.getContext("TestService1").getInstance(null); - Assert.assertNotNull(comp2); - Assert.assertSame(comp1, comp2); - scope.onEvent(EventContext.MODULE_STOP, null); - scope.stop(); - } - - public void testSetNullComponents() throws Exception { - EventContext ctx = new EventContextImpl(); - ModuleScopeContext scope = new ModuleScopeContext(ctx); - scope.registerConfigurations(createConfigurations()); - scope.start(); - scope.onEvent(EventContext.MODULE_START, null); - scope.onEvent(EventContext.MODULE_STOP, null); - scope.stop(); - } - - public void testRegisterContextBeforeStart() throws Exception { - EventContext ctx = new EventContextImpl(); - ModuleScopeContext scope = new ModuleScopeContext(ctx); - scope.registerConfigurations(createConfigurations()); - scope.start(); - scope.registerConfiguration(createConfiguration("NewTestService")); - scope.onEvent(EventContext.MODULE_START,null); - ModuleScopeInitDestroyComponent comp2 = (ModuleScopeInitDestroyComponent) scope.getContext("NewTestService").getInstance(null); - Assert.assertNotNull(comp2); - Assert.assertTrue(comp2.isInitialized()); - scope.onEvent(EventContext.MODULE_STOP,null); - Assert.assertTrue(comp2.isDestroyed()); - scope.stop(); - } - - public void testRegisterContextAfterStart() throws Exception { - EventContext ctx = new EventContextImpl(); - ModuleScopeContext scope = new ModuleScopeContext(ctx); - scope.start(); - scope.registerConfiguration(createConfiguration("NewTestService")); - scope.onEvent(EventContext.MODULE_START,null); - scope.registerConfigurations(createConfigurations()); - ModuleScopeInitDestroyComponent comp2 = (ModuleScopeInitDestroyComponent) scope.getContext("NewTestService").getInstance(null); - Assert.assertNotNull(comp2); - Assert.assertTrue(comp2.isInitialized()); - scope.onEvent(EventContext.MODULE_STOP,null); - Assert.assertTrue(comp2.isDestroyed()); - scope.stop(); - } - - // ---------------------------------- - // Private methods - // ---------------------------------- - - JavaComponentContextBuilder builder = new JavaComponentContextBuilder(); - - private List> createConfigurations() throws NoSuchMethodException, BuilderException { - SimpleComponent component = MockFactory.createComponent("TestService1", ModuleScopeComponentImpl.class, Scope.MODULE); - builder.build(component, null); - List> configs = new ArrayList(); - configs.add((RuntimeConfiguration) component.getComponentImplementation().getRuntimeConfiguration()); - return configs; - } - - private RuntimeConfiguration createConfiguration(String name) - throws NoSuchMethodException, BuilderException { - SimpleComponent component = MockFactory.createComponent(name, ModuleScopeInitDestroyComponent.class, - Scope.MODULE); - builder.build(component, null); - return (RuntimeConfiguration) component.getComponentImplementation().getRuntimeConfiguration(); - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicRequestScopeTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicRequestScopeTestCase.java deleted file mode 100644 index b3a6e5f64b..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicRequestScopeTestCase.java +++ /dev/null @@ -1,148 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.scopes; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.container.java.builder.JavaComponentContextBuilder; -import org.apache.tuscany.container.java.mock.MockFactory; -import org.apache.tuscany.container.java.mock.components.RequestScopeComponent; -import org.apache.tuscany.container.java.mock.components.RequestScopeComponentImpl; -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.impl.EventContextImpl; -import org.apache.tuscany.core.context.scope.RequestScopeContext; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.SimpleComponent; - -/** - * Unit tests for the request scope container - * - * @version $Rev$ $Date$ - */ -public class BasicRequestScopeTestCase extends TestCase { - - /** - * Tests instance identity is properly maintained - */ - public void testInstanceManagement() throws Exception { - EventContext ctx = new EventContextImpl(); - RequestScopeContext scope = new RequestScopeContext(ctx); - scope.registerConfigurations(createConfigurations()); - scope.start(); - - // first request - RequestScopeComponentImpl comp1 = (RequestScopeComponentImpl) scope.getContext("TestService1").getInstance(null); - Assert.assertNotNull(comp1); - scope.onEvent(EventContext.REQUEST_END, null); - - // second request - RequestScopeComponentImpl comp2 = (RequestScopeComponentImpl) scope.getContext("TestService1").getInstance(null); - Assert.assertNotNull(comp2); - Assert.assertNotSame(comp1, comp2); - scope.onEvent(EventContext.REQUEST_END, null); - - scope.stop(); - } - - public void testRegisterContextBeforeRequest() throws Exception { - EventContext ctx = new EventContextImpl(); - RequestScopeContext scope = new RequestScopeContext(ctx); - scope.registerConfigurations(createConfigurations()); - scope.registerConfiguration(createConfiguration("NewTestService")); - scope.start(); - RequestScopeComponent comp1 = (RequestScopeComponent) scope.getContext("TestService1").getInstance(null); - Assert.assertNotNull(comp1); - RequestScopeComponent comp2 = (RequestScopeComponent) scope.getContext("NewTestService").getInstance(null); - Assert.assertNotNull(comp2); - scope.onEvent(EventContext.REQUEST_END, null); - scope.stop(); - } - - public void testRegisterContextAfterRequest() throws Exception { - EventContext ctx = new EventContextImpl(); - RequestScopeContext scope = new RequestScopeContext(ctx); - scope.registerConfigurations(createConfigurations()); - scope.start(); - RequestScopeComponent comp1 = (RequestScopeComponent) scope.getContext("TestService1").getInstance(null); - Assert.assertNotNull(comp1); - scope.registerConfiguration(createConfiguration("NewTestService")); - RequestScopeComponent comp2 = (RequestScopeComponent) scope.getContext("NewTestService").getInstance(null); - Assert.assertNotNull(comp2); - scope.onEvent(EventContext.REQUEST_END, null); - scope.stop(); - } - - /** - * Tests setting no components in the scope - */ - public void testSetNullComponents() throws Exception { - EventContext ctx = new EventContextImpl(); - RequestScopeContext scope = new RequestScopeContext(ctx); - scope.registerConfigurations(createConfigurations()); - scope.start(); - scope.stop(); - } - - public void testGetComponentByKey() throws Exception { - EventContext ctx = new EventContextImpl(); - RequestScopeContext scope = new RequestScopeContext(ctx); - scope.registerConfigurations(createConfigurations()); - scope.start(); - - RequestScopeComponentImpl comp1 = (RequestScopeComponentImpl) scope.getContext("TestService1").getInstance(null); - Assert.assertNotNull(comp1); - scope.onEvent(EventContext.REQUEST_END, null); - - // second request - // should be null since the other context (thread) expired w/ onEvent(..) - Assert.assertNull((RequestScopeComponentImpl) scope.getContextByKey("TestService1", Thread.currentThread())); - // Note should test better using concurrent threads to pull the instance - - scope.stop(); - } - - // ---------------------------------- - // Private methods - // ---------------------------------- - - JavaComponentContextBuilder builder = new JavaComponentContextBuilder(); - - private List> createConfigurations() throws NoSuchMethodException, BuilderException { - SimpleComponent component = MockFactory.createComponent("TestService1", RequestScopeComponentImpl.class, - Scope.REQUEST); - builder.build(component, null); - List> configs = new ArrayList(); - configs.add((RuntimeConfiguration) component.getComponentImplementation().getRuntimeConfiguration()); - return configs; - } - - private RuntimeConfiguration createConfiguration(String name) throws NoSuchMethodException, - BuilderException { - SimpleComponent component = MockFactory.createComponent(name, RequestScopeComponentImpl.class, - Scope.REQUEST); - builder.build(component, null); - return (RuntimeConfiguration) component.getComponentImplementation().getRuntimeConfiguration(); - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicStatelessScopeTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicStatelessScopeTestCase.java deleted file mode 100644 index 807a0901ce..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicStatelessScopeTestCase.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.scopes; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.container.java.builder.JavaComponentContextBuilder; -import org.apache.tuscany.container.java.mock.MockFactory; -import org.apache.tuscany.container.java.mock.components.StatelessComponent; -import org.apache.tuscany.container.java.mock.components.StatelessComponentImpl; -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.impl.EventContextImpl; -import org.apache.tuscany.core.context.scope.StatelessScopeContext; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.SimpleComponent; - -/** - * Unit tests for the module scope container - * - * @version $Rev$ $Date$ - */ -public class BasicStatelessScopeTestCase extends TestCase { - - /** - * Tests instance identity is properly maintained - */ - public void testInstanceManagement() throws Exception { - EventContext ctx = new EventContextImpl(); - StatelessScopeContext scope = new StatelessScopeContext(ctx); - scope.registerConfigurations(createConfigurations()); - scope.start(); - // first request - StatelessComponentImpl comp1 = (StatelessComponentImpl) scope.getContext("TestService1").getInstance(null); - Assert.assertNotNull(comp1); - // second request - StatelessComponentImpl comp2 = (StatelessComponentImpl) scope.getContext("TestService1").getInstance(null); - Assert.assertNotNull(comp2); - Assert.assertNotSame(comp1, comp2); - scope.stop(); - } - - public void testRegisterContextBeforeRequest() throws Exception { - EventContext ctx = new EventContextImpl(); - StatelessScopeContext scope = new StatelessScopeContext(ctx); - scope.registerConfigurations(createConfigurations()); - scope.registerConfiguration(createConfiguration("NewTestService")); - scope.start(); - StatelessComponent comp1 = (StatelessComponent) scope.getContext("TestService1").getInstance(null); - Assert.assertNotNull(comp1); - StatelessComponent comp2 = (StatelessComponent) scope.getContext("NewTestService").getInstance(null); - Assert.assertNotNull(comp2); - scope.stop(); - } - - public void testRegisterContextAfterRequest() throws Exception { - EventContext ctx = new EventContextImpl(); - StatelessScopeContext scope = new StatelessScopeContext(ctx); - scope.registerConfigurations(createConfigurations()); - scope.start(); - StatelessComponent comp1 = (StatelessComponent) scope.getContext("TestService1").getInstance(null); - Assert.assertNotNull(comp1); - scope.registerConfiguration(createConfiguration("NewTestService")); - StatelessComponent comp2 = (StatelessComponent) scope.getContext("NewTestService").getInstance(null); - Assert.assertNotNull(comp2); - scope.stop(); - } - - - /** - * Tests setting no components in the scope - */ - public void testSetNullComponents() throws Exception { - EventContext ctx = new EventContextImpl(); - StatelessScopeContext scope = new StatelessScopeContext(ctx); - scope.registerConfigurations(createConfigurations()); - scope.start(); - scope.stop(); - } - - // ---------------------------------- - // Private methods - // ---------------------------------- - - JavaComponentContextBuilder builder = new JavaComponentContextBuilder(); - - private List> createConfigurations() - throws NoSuchMethodException, BuilderException { - SimpleComponent component = MockFactory.createComponent("TestService1", StatelessComponentImpl.class, - Scope.INSTANCE); - builder.build(component, null); - List> configs = new ArrayList(); - configs.add((RuntimeConfiguration) component.getComponentImplementation().getRuntimeConfiguration()); - return configs; - } - - private RuntimeConfiguration createConfiguration(String name) - throws NoSuchMethodException, BuilderException { - SimpleComponent component = MockFactory.createComponent(name, StatelessComponentImpl.class, - Scope.INSTANCE); - builder.build(component, null); - return (RuntimeConfiguration) component.getComponentImplementation().getRuntimeConfiguration(); - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/HttpSessionScopeLifecycleTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/HttpSessionScopeLifecycleTestCase.java deleted file mode 100644 index 1d5780dac4..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/HttpSessionScopeLifecycleTestCase.java +++ /dev/null @@ -1,157 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.scopes; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.container.java.builder.JavaComponentContextBuilder; -import org.apache.tuscany.container.java.mock.MockFactory; -import org.apache.tuscany.container.java.mock.components.SessionScopeDestroyOnlyComponent; -import org.apache.tuscany.container.java.mock.components.SessionScopeInitDestroyComponent; -import org.apache.tuscany.container.java.mock.components.SessionScopeInitOnlyComponent; -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.impl.EventContextImpl; -import org.apache.tuscany.core.context.scope.HttpSessionScopeContext; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.SimpleComponent; - -/** - * Lifecycle unit tests for the Http session scope container - * - * @version $Rev$ $Date$ - */ -public class HttpSessionScopeLifecycleTestCase extends TestCase { - - /** - * Tests instance identity is properly maintained - */ - public void testInitDestroy() throws Exception { - EventContext ctx = new EventContextImpl(); - HttpSessionScopeContext scope = new HttpSessionScopeContext(ctx); - scope.registerConfigurations(createComponents()); - scope.start(); - Object session = new Object(); - Object session2 = new Object(); - // first request, no need to notify scope container since sessions are - // evaluated lazily - ctx.setIdentifier(EventContext.HTTP_SESSION, session); - SessionScopeInitDestroyComponent initDestroy = (SessionScopeInitDestroyComponent) scope.getContext( - "TestServiceInitDestroy").getInstance(null); - Assert.assertNotNull(initDestroy); - SessionScopeInitOnlyComponent initOnly = (SessionScopeInitOnlyComponent) scope.getContext("TestServiceInitOnly") - .getInstance(null); - Assert.assertNotNull(initOnly); - SessionScopeDestroyOnlyComponent destroyOnly = (SessionScopeDestroyOnlyComponent) scope.getContext( - "TestServiceDestroyOnly").getInstance(null); - Assert.assertNotNull(destroyOnly); - - Assert.assertTrue(initDestroy.isInitialized()); - Assert.assertTrue(initOnly.isInitialized()); - Assert.assertFalse(initDestroy.isDestroyed()); - Assert.assertFalse(destroyOnly.isDestroyed()); - // end request - ctx.clearIdentifier(EventContext.HTTP_SESSION); - // expire session - scope.onEvent(EventContext.SESSION_END, session); - Assert.assertTrue(initDestroy.isDestroyed()); - Assert.assertTrue(destroyOnly.isDestroyed()); - - scope.stop(); - } - - /** - * Test instances destroyed in proper (i.e. reverse) order - */ - public void testDestroyOrder() throws Exception { - EventContext ctx = new EventContextImpl(); - HttpSessionScopeContext scope = new HttpSessionScopeContext(ctx); - scope.registerConfigurations(createOrderedInitComponents()); - scope.start(); - Object session = new Object(); - Object session2 = new Object(); - // request start - ctx.setIdentifier(EventContext.HTTP_SESSION, session); - - OrderedInitPojo one = (OrderedInitPojo) scope.getContext("one").getInstance(null); - Assert.assertNotNull(one); - Assert.assertEquals(1, one.getNumberInstantiated()); - Assert.assertEquals(1, one.getInitOrder()); - - OrderedInitPojo two = (OrderedInitPojo) scope.getContext("two").getInstance(null); - Assert.assertNotNull(two); - Assert.assertEquals(2, two.getNumberInstantiated()); - Assert.assertEquals(2, two.getInitOrder()); - - OrderedInitPojo three = (OrderedInitPojo) scope.getContext("three").getInstance(null); - Assert.assertNotNull(three); - Assert.assertEquals(3, three.getNumberInstantiated()); - Assert.assertEquals(3, three.getInitOrder()); - - // end request - ctx.clearIdentifier(EventContext.HTTP_SESSION); - - // expire session - scope.onEvent(EventContext.SESSION_END, session); - Assert.assertEquals(0, one.getNumberInstantiated()); - scope.stop(); - } - - // ---------------------------------- - // Private methods - // ---------------------------------- - - JavaComponentContextBuilder builder = new JavaComponentContextBuilder(); - - private List> createComponents() throws NoSuchMethodException, BuilderException { - SimpleComponent[] ca = new SimpleComponent[3]; - ca[0] = MockFactory.createComponent("TestServiceInitDestroy", SessionScopeInitDestroyComponent.class, - Scope.SESSION); - ca[1] = MockFactory.createComponent("TestServiceInitOnly", SessionScopeInitOnlyComponent.class, Scope.SESSION); - ca[2] = MockFactory.createComponent("TestServiceDestroyOnly", SessionScopeDestroyOnlyComponent.class, - Scope.SESSION); - List> configs = new ArrayList(); - for (int i = 0; i < ca.length; i++) { - builder.build(ca[i], null); - configs.add((RuntimeConfiguration) ca[i].getComponentImplementation().getRuntimeConfiguration()); - - } - return configs; - } - - private List> createOrderedInitComponents() throws NoSuchMethodException, - BuilderException { - SimpleComponent[] ca = new SimpleComponent[3]; - ca[0] = MockFactory.createComponent("one", OrderedInitPojo.class, Scope.SESSION); - ca[1] = MockFactory.createComponent("two", OrderedInitPojo.class, Scope.SESSION); - ca[2] = MockFactory.createComponent("three", OrderedInitPojo.class, Scope.SESSION); - List> configs = new ArrayList(); - for (int i = 0; i < ca.length; i++) { - builder.build(ca[i], null); - configs.add((RuntimeConfiguration) ca[i].getComponentImplementation().getRuntimeConfiguration()); - - } - return configs; - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/ModuleScopeLifecycleTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/ModuleScopeLifecycleTestCase.java deleted file mode 100644 index 2c8a79de14..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/ModuleScopeLifecycleTestCase.java +++ /dev/null @@ -1,224 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.scopes; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.container.java.builder.JavaComponentContextBuilder; -import org.apache.tuscany.container.java.mock.MockFactory; -import org.apache.tuscany.container.java.mock.components.ModuleScopeDestroyOnlyComponent; -import org.apache.tuscany.container.java.mock.components.ModuleScopeEagerInitComponent; -import org.apache.tuscany.container.java.mock.components.ModuleScopeEagerInitDestroyComponent; -import org.apache.tuscany.container.java.mock.components.ModuleScopeInitDestroyComponent; -import org.apache.tuscany.container.java.mock.components.ModuleScopeInitOnlyComponent; -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.impl.EventContextImpl; -import org.apache.tuscany.core.context.scope.ModuleScopeContext; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.SimpleComponent; - -/** - * Lifecycle unit tests for the Http session scope container - * - * @version $Rev$ $Date$ - */ -public class ModuleScopeLifecycleTestCase extends TestCase { - - public void testInitDestroy() throws Exception { - EventContext ctx = new EventContextImpl(); - ModuleScopeContext scope = new ModuleScopeContext(ctx); - scope.registerConfigurations(createComponents()); - scope.start(); - scope.onEvent(EventContext.MODULE_START, null); - ModuleScopeInitDestroyComponent initDestroy = (ModuleScopeInitDestroyComponent) scope.getContext( - "TestServiceInitDestroy").getInstance(null); - Assert.assertNotNull(initDestroy); - ModuleScopeInitOnlyComponent initOnly = (ModuleScopeInitOnlyComponent) scope.getContext("TestServiceInitOnly") - .getInstance(null); - Assert.assertNotNull(initOnly); - ModuleScopeDestroyOnlyComponent destroyOnly = (ModuleScopeDestroyOnlyComponent) scope.getContext( - "TestServiceDestroyOnly").getInstance(null); - Assert.assertNotNull(destroyOnly); - - Assert.assertTrue(initDestroy.isInitialized()); - Assert.assertTrue(initOnly.isInitialized()); - Assert.assertFalse(initDestroy.isDestroyed()); - Assert.assertFalse(destroyOnly.isDestroyed()); - - // expire module - scope.onEvent(EventContext.MODULE_STOP, null); - - Assert.assertTrue(initDestroy.isDestroyed()); - Assert.assertTrue(destroyOnly.isDestroyed()); - - scope.stop(); - } - - public void testEagerInit() throws Exception { - EventContext ctx = new EventContextImpl(); - ModuleScopeContext scope = new ModuleScopeContext(ctx); - scope.registerConfigurations(createEagerInitComponents()); - scope.start(); - scope.onEvent(EventContext.MODULE_START, null); - ModuleScopeEagerInitDestroyComponent initDestroy = (ModuleScopeEagerInitDestroyComponent) scope.getContext( - "TestServiceEagerInitDestroy").getInstance(null); - Assert.assertNotNull(initDestroy); - ModuleScopeEagerInitComponent initOnly = (ModuleScopeEagerInitComponent) scope - .getContext("TestServiceEagerInit").getInstance(null); - Assert.assertNotNull(initOnly); - - Assert.assertTrue(initDestroy.isInitialized()); - Assert.assertTrue(initOnly.isInitialized()); - Assert.assertFalse(initDestroy.isDestroyed()); - - // expire module - scope.onEvent(EventContext.MODULE_STOP, null); - - Assert.assertTrue(initDestroy.isDestroyed()); - - scope.stop(); - - } - - public void testDestroyOrder() throws Exception { - EventContext ctx = new EventContextImpl(); - ModuleScopeContext scope = new ModuleScopeContext(ctx); - scope.registerConfigurations(createOrderedInitComponents()); - scope.start(); - scope.onEvent(EventContext.MODULE_START, null); - OrderedInitPojo one = (OrderedInitPojo) scope.getContext("one").getInstance(null); - Assert.assertNotNull(one); - Assert.assertEquals(1, one.getNumberInstantiated()); - Assert.assertEquals(1, one.getInitOrder()); - - OrderedInitPojo two = (OrderedInitPojo) scope.getContext("two").getInstance(null); - Assert.assertNotNull(two); - Assert.assertEquals(2, two.getNumberInstantiated()); - Assert.assertEquals(2, two.getInitOrder()); - - OrderedInitPojo three = (OrderedInitPojo) scope.getContext("three").getInstance(null); - Assert.assertNotNull(three); - Assert.assertEquals(3, three.getNumberInstantiated()); - Assert.assertEquals(3, three.getInitOrder()); - - // expire module - scope.onEvent(EventContext.MODULE_STOP, null); - Assert.assertEquals(0, one.getNumberInstantiated()); - scope.stop(); - } - - public void testEagerInitDestroyOrder() throws Exception { - EventContext ctx = new EventContextImpl(); - ModuleScopeContext scope = new ModuleScopeContext(ctx); - scope.registerConfigurations(createOrderedEagerInitComponents()); - scope.start(); - scope.onEvent(EventContext.MODULE_START, null); - OrderedEagerInitPojo one = (OrderedEagerInitPojo) scope.getContext("one").getInstance(null); - Assert.assertNotNull(one); - - OrderedEagerInitPojo two = (OrderedEagerInitPojo) scope.getContext("two").getInstance(null); - Assert.assertNotNull(two); - - OrderedEagerInitPojo three = (OrderedEagerInitPojo) scope.getContext("three").getInstance(null); - Assert.assertNotNull(three); - - // expire module - scope.onEvent(EventContext.MODULE_STOP, null); - Assert.assertEquals(0, one.getNumberInstantiated()); - scope.stop(); - } - - // ---------------------------------- - // Private methods - // ---------------------------------- - - JavaComponentContextBuilder builder = new JavaComponentContextBuilder(); - - private List> createComponents() throws NoSuchMethodException, BuilderException { - SimpleComponent[] ca = new SimpleComponent[3]; - ca[0] = MockFactory.createComponent("TestServiceInitDestroy", ModuleScopeInitDestroyComponent.class, - Scope.MODULE); - ca[1] = MockFactory.createComponent("TestServiceInitOnly", ModuleScopeInitOnlyComponent.class, - Scope.MODULE); - ca[2] = MockFactory.createComponent("TestServiceDestroyOnly", ModuleScopeDestroyOnlyComponent.class, - Scope.MODULE); - List> configs = new ArrayList(); - for (int i = 0; i < ca.length; i++) { - builder.build(ca[i], null); - configs.add((RuntimeConfiguration) ca[i].getComponentImplementation() - .getRuntimeConfiguration()); - - } - return configs; - } - - private List> createEagerInitComponents() throws NoSuchMethodException, - BuilderException { - SimpleComponent[] ca = new SimpleComponent[2]; - ca[0] = MockFactory.createComponent("TestServiceEagerInitDestroy", ModuleScopeEagerInitDestroyComponent.class, - Scope.MODULE); - ca[1] = MockFactory.createComponent("TestServiceEagerInit", ModuleScopeEagerInitComponent.class, - Scope.MODULE); - List> configs = new ArrayList(); - for (int i = 0; i < ca.length; i++) { - builder.build(ca[i], null); - configs.add((RuntimeConfiguration) ca[i].getComponentImplementation() - .getRuntimeConfiguration()); - - } - return configs; - } - - private List> createOrderedInitComponents() throws NoSuchMethodException, - BuilderException { - SimpleComponent[] ca = new SimpleComponent[3]; - ca[0] = MockFactory.createComponent("one", OrderedInitPojo.class, Scope.MODULE); - ca[1] = MockFactory.createComponent("two", OrderedInitPojo.class, Scope.MODULE); - ca[2] = MockFactory.createComponent("three", OrderedInitPojo.class, Scope.MODULE); - List> configs = new ArrayList(); - for (int i = 0; i < ca.length; i++) { - builder.build(ca[i], null); - configs.add((RuntimeConfiguration) ca[i].getComponentImplementation() - .getRuntimeConfiguration()); - - } - return configs; - } - - private List> createOrderedEagerInitComponents() throws NoSuchMethodException, - BuilderException { - SimpleComponent[] ca = new SimpleComponent[3]; - ca[0] = MockFactory.createComponent("one", OrderedEagerInitPojo.class, Scope.MODULE); - ca[1] = MockFactory.createComponent("two", OrderedEagerInitPojo.class, Scope.MODULE); - ca[2] = MockFactory.createComponent("three", OrderedEagerInitPojo.class, Scope.MODULE); - List> configs = new ArrayList(); - for (int i = 0; i < ca.length; i++) { - builder.build(ca[i], null); - configs.add((RuntimeConfiguration) ca[i].getComponentImplementation() - .getRuntimeConfiguration()); - - } - return configs; - } -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/OrderException.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/OrderException.java deleted file mode 100644 index fc5f7c8c58..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/OrderException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.scopes; - -public class OrderException extends Exception { - - public OrderException() { - super(); - } - - public OrderException(String message) { - super(message); - } - - public OrderException(String message, Throwable cause) { - super(message, cause); - } - - public OrderException(Throwable cause) { - super(cause); - } - -} - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/OrderedEagerInitPojo.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/OrderedEagerInitPojo.java deleted file mode 100644 index d439159550..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/OrderedEagerInitPojo.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.scopes; - -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Init; - -public class OrderedEagerInitPojo { - - private static Object lock = new Object(); - private static int numberInstantied; - private int initOrder; - - @Init(eager = true) - public void init() { - synchronized (lock) { - ++numberInstantied; - initOrder = numberInstantied; - } - } - - @Destroy - public void destroy() throws OrderException { - synchronized (lock) { - if (initOrder != numberInstantied) { - throw new OrderException("Instance shutdown done out of order"); - } - --numberInstantied; - } - } - - public int getNumberInstantiated() { - return numberInstantied; - } - - public int getInitOrder() { - return initOrder; - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/OrderedInitPojo.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/OrderedInitPojo.java deleted file mode 100644 index ee5c5145c2..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/OrderedInitPojo.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.scopes; - -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Init; - -public class OrderedInitPojo { - - private static Object lock = new Object(); - private static int numberInstantied; - private int initOrder; - - @Init - public void init() { - synchronized (lock) { - ++numberInstantied; - initOrder = numberInstantied; - } - } - - @Destroy - public void destroy() throws OrderException { - synchronized (lock) { - if (initOrder != numberInstantied) { - throw new OrderException("Instance shutdown done out of order"); - } - --numberInstantied; - } - } - - public int getNumberInstantiated() { - return numberInstantied; - } - - public int getInitOrder() { - return initOrder; - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/RequestScopeLifecycleTestCase.java b/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/RequestScopeLifecycleTestCase.java deleted file mode 100644 index 1979d9b25c..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/java/org/apache/tuscany/container/java/scopes/RequestScopeLifecycleTestCase.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.java.scopes; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.container.java.builder.JavaComponentContextBuilder; -import org.apache.tuscany.container.java.mock.MockFactory; -import org.apache.tuscany.container.java.mock.components.SessionScopeDestroyOnlyComponent; -import org.apache.tuscany.container.java.mock.components.SessionScopeInitDestroyComponent; -import org.apache.tuscany.container.java.mock.components.SessionScopeInitOnlyComponent; -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.impl.EventContextImpl; -import org.apache.tuscany.core.context.scope.RequestScopeContext; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.SimpleComponent; - -/** - * Lifecycle unit tests for the Http session scope container - * - * @version $Rev$ $Date$ - */ -public class RequestScopeLifecycleTestCase extends TestCase { - - /** - * Tests instance identity is properly maintained - */ - public void testInitDestroy() throws Exception { - EventContext ctx = new EventContextImpl(); - RequestScopeContext scope = new RequestScopeContext(ctx); - scope.registerConfigurations(createComponents()); - scope.start(); - SessionScopeInitDestroyComponent initDestroy = (SessionScopeInitDestroyComponent) scope.getContext( - "TestServiceInitDestroy").getInstance(null); - Assert.assertNotNull(initDestroy); - SessionScopeInitOnlyComponent initOnly = (SessionScopeInitOnlyComponent) scope.getContext("TestServiceInitOnly") - .getInstance(null); - Assert.assertNotNull(initOnly); - SessionScopeDestroyOnlyComponent destroyOnly = (SessionScopeDestroyOnlyComponent) scope.getContext( - "TestServiceDestroyOnly").getInstance(null); - Assert.assertNotNull(destroyOnly); - - Assert.assertTrue(initDestroy.isInitialized()); - Assert.assertTrue(initOnly.isInitialized()); - Assert.assertFalse(initDestroy.isDestroyed()); - Assert.assertFalse(destroyOnly.isDestroyed()); - - // end request - scope.onEvent(EventContext.REQUEST_END, null); - Assert.assertTrue(initDestroy.isDestroyed()); - Assert.assertTrue(destroyOnly.isDestroyed()); - - scope.stop(); - } - - /** - * Test instances destroyed in proper (i.e. reverse) order - */ - public void testDestroyOrder() throws Exception { - EventContext ctx = new EventContextImpl(); - RequestScopeContext scope = new RequestScopeContext(ctx); - scope.registerConfigurations(createOrderedInitComponents()); - scope.start(); - // request start - OrderedInitPojo one = (OrderedInitPojo) scope.getContext("one").getInstance(null); - Assert.assertNotNull(one); - Assert.assertEquals(1, one.getNumberInstantiated()); - Assert.assertEquals(1, one.getInitOrder()); - - OrderedInitPojo two = (OrderedInitPojo) scope.getContext("two").getInstance(null); - Assert.assertNotNull(two); - Assert.assertEquals(2, two.getNumberInstantiated()); - Assert.assertEquals(2, two.getInitOrder()); - - OrderedInitPojo three = (OrderedInitPojo) scope.getContext("three").getInstance(null); - Assert.assertNotNull(three); - Assert.assertEquals(3, three.getNumberInstantiated()); - Assert.assertEquals(3, three.getInitOrder()); - - // end request - scope.onEvent(EventContext.REQUEST_END, null); - - Assert.assertEquals(0, one.getNumberInstantiated()); - scope.stop(); - } - - // ---------------------------------- - // Private methods - // ---------------------------------- - - JavaComponentContextBuilder builder = new JavaComponentContextBuilder(); - - private List> createComponents() throws NoSuchMethodException, BuilderException { - SimpleComponent[] ca = new SimpleComponent[3]; - ca[0] = MockFactory.createComponent("TestServiceInitDestroy", SessionScopeInitDestroyComponent.class, - Scope.REQUEST); - ca[1] = MockFactory.createComponent("TestServiceInitOnly", SessionScopeInitOnlyComponent.class, - Scope.REQUEST); - ca[2] = MockFactory.createComponent("TestServiceDestroyOnly", SessionScopeDestroyOnlyComponent.class, - Scope.REQUEST); - List> configs = new ArrayList(); - for (int i = 0; i < ca.length; i++) { - builder.build(ca[i], null); - configs.add((RuntimeConfiguration) ca[i].getComponentImplementation().getRuntimeConfiguration()); - - } - return configs; - } - - private List> createOrderedInitComponents() throws NoSuchMethodException, - BuilderException { - SimpleComponent[] ca = new SimpleComponent[3]; - ca[0] = MockFactory.createComponent("one", OrderedInitPojo.class, Scope.REQUEST); - ca[1] = MockFactory.createComponent("two", OrderedInitPojo.class, Scope.REQUEST); - ca[2] = MockFactory.createComponent("three", OrderedInitPojo.class, Scope.REQUEST); - List> configs = new ArrayList(); - for (int i = 0; i < ca.length; i++) { - builder.build(ca[i], null); - configs.add((RuntimeConfiguration) ca[i].getComponentImplementation().getRuntimeConfiguration()); - - } - return configs; - } - -} diff --git a/tags/java-stable-20060304/sca/container.java/src/test/resources/org/apache/tuscany/container/java/assembly/tests/sca.module b/tags/java-stable-20060304/sca/container.java/src/test/resources/org/apache/tuscany/container/java/assembly/tests/sca.module deleted file mode 100644 index d1eda8b8dd..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/resources/org/apache/tuscany/container/java/assembly/tests/sca.module +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - AccountServiceComponent - - - - - - EURO - - - AccountDataServiceComponent - StockQuoteService - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/container.java/src/test/resources/org/apache/tuscany/container/java/config/ModuleComponentLoaderTest1.module b/tags/java-stable-20060304/sca/container.java/src/test/resources/org/apache/tuscany/container/java/config/ModuleComponentLoaderTest1.module deleted file mode 100644 index 46169aa304..0000000000 --- a/tags/java-stable-20060304/sca/container.java/src/test/resources/org/apache/tuscany/container/java/config/ModuleComponentLoaderTest1.module +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - diff --git a/tags/java-stable-20060304/sca/container.js/LICENSE.txt b/tags/java-stable-20060304/sca/container.js/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/tags/java-stable-20060304/sca/container.js/LICENSE.txt +++ /dev/null @@ -1,202 +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/tags/java-stable-20060304/sca/container.js/pom.xml b/tags/java-stable-20060304/sca/container.js/pom.xml deleted file mode 100644 index aa90b1dc4d..0000000000 --- a/tags/java-stable-20060304/sca/container.js/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - org.apache.tuscany - tuscany-sca - SNAPSHOT - - 4.0.0 - tuscany-container-js - Tuscany JavaScript Component Implementation Type - Tuscany JavaScript Component Implementation Type. - SNAPSHOT - - - - org.apache.tuscany - tuscany-core - ${pom.version} - compile - - - - rhino - js - 1.6R2 - provided - - - - junit - junit - 3.8.1 - test - - - - - - - org.apache.tuscany - tuscany-sdo-plugin - - - - ${basedir}/src/main/resources/model/sca-implementation-js.xsd - true - true - true - true - - - generate - - - - - - - - diff --git a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/assembly/JavaScriptAssemblyFactory.java b/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/assembly/JavaScriptAssemblyFactory.java deleted file mode 100644 index 0072bcdaa1..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/assembly/JavaScriptAssemblyFactory.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.assembly; - -import org.apache.tuscany.model.assembly.AssemblyFactory; - -public interface JavaScriptAssemblyFactory extends AssemblyFactory { - - /** - * Returns a new object of class 'JavaScript Implementation'. - */ - JavaScriptImplementation createJavaScriptImplementation(); - -} diff --git a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/assembly/JavaScriptImplementation.java b/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/assembly/JavaScriptImplementation.java deleted file mode 100644 index 6edaf2b60a..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/assembly/JavaScriptImplementation.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.assembly; - -import org.apache.tuscany.common.resource.ResourceLoader; -import org.apache.tuscany.model.assembly.ComponentImplementation; - -/** - * A representation of a JavaScript component implementation type - * - * @version $Rev$ $Date$ - */ -public interface JavaScriptImplementation extends ComponentImplementation { - - public ResourceLoader getResourceLoader(); - - public String getScriptFile(); - - public void setScriptFile(String fn); -} diff --git a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/assembly/impl/JavaScriptAssemblyFactoryImpl.java b/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/assembly/impl/JavaScriptAssemblyFactoryImpl.java deleted file mode 100644 index 21930d22ec..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/assembly/impl/JavaScriptAssemblyFactoryImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.assembly.impl; - -import org.apache.tuscany.container.js.assembly.JavaScriptAssemblyFactory; -import org.apache.tuscany.container.js.assembly.JavaScriptImplementation; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; - -public class JavaScriptAssemblyFactoryImpl extends AssemblyFactoryImpl implements JavaScriptAssemblyFactory { - - public JavaScriptAssemblyFactoryImpl() { - super(); - } - - public JavaScriptImplementation createJavaScriptImplementation() { - return new JavaScriptImplementationImpl(); - } - -} diff --git a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/assembly/impl/JavaScriptImplementationImpl.java b/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/assembly/impl/JavaScriptImplementationImpl.java deleted file mode 100644 index c6b58a25c6..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/assembly/impl/JavaScriptImplementationImpl.java +++ /dev/null @@ -1,116 +0,0 @@ -package org.apache.tuscany.container.js.assembly.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; - -import org.apache.tuscany.common.resource.ResourceLoader; -import org.apache.tuscany.container.js.assembly.JavaScriptImplementation; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.ComponentType; -import org.apache.tuscany.model.assembly.ModelInitException; -import org.apache.tuscany.model.assembly.impl.ComponentImplementationImpl; - -/** - * Default implementation of a JavScript component implementation type - * - * @version $Rev$ $Date$ - */ -public class JavaScriptImplementationImpl extends ComponentImplementationImpl implements JavaScriptImplementation { - - private ResourceLoader resourceLoader; - - public JavaScriptImplementationImpl() { - super(); - } - - public ResourceLoader getResourceLoader() { - return null; - } - - public void initialize(AssemblyModelContext modelContext) throws ModelInitException { - if (isInitialized()) { - return; - } - this.resourceLoader = modelContext.getApplicationResourceLoader(); - if(resourceLoader == null){ - throw new ModelInitException("No resource loader set on model context"); - } - getScriptFile(); - - // Initialize the component type - ComponentType componentType = getComponentType(); - if (componentType == null) { - try { - componentType = createComponentType(modelContext); - } catch (IOException e) { - throw new ModelInitException("Error retrieving component type file",e); - } - setComponentType(componentType); - } - - super.initialize(modelContext); - - } - - String script; - - public String getScriptFile() { - return script; - } - - public void setScriptFile(String fn) { - script = fn; - } - - private String scriptCode; - - public String getScript() throws ModelInitException { - if (scriptCode != null) { - return scriptCode; - } - try { - URL url = resourceLoader.getResource(getScriptFile()); - if (url == null) { - ModelInitException ce = new ModelInitException("Script not found"); - ce.setIdentifier(getScriptFile()); - throw ce; - } - InputStream inputStream = url.openStream(); - try { - StringBuffer sb = new StringBuffer(); - int n = 0; - while ((n = inputStream.read()) != -1) { - sb.append((char) n); - } - scriptCode = sb.toString(); - return scriptCode; - } finally { - inputStream.close(); - } - } catch (IOException e) { - ModelInitException ce = new ModelInitException("Error reading script file",e); - ce.setIdentifier(getScriptFile()); - throw ce; - } - } - - /** - * Create the component type - * - * @param modelContext - * @param implementationClass - */ - private ComponentType createComponentType(AssemblyModelContext modelContext) throws IOException{ - String prefix = script.substring(0,script.lastIndexOf('.')); - URL componentTypeFile = resourceLoader.getResource(prefix + ".componentType"); - if (componentTypeFile != null) { - return modelContext.getAssemblyLoader().loadComponentType(componentTypeFile.toString()); - } else { - // TODO we could introspect the JavaScript source - return modelContext.getAssemblyFactory().createComponentType(); - } - } - - -} diff --git a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/builder/JavaScriptComponentContextBuilder.java b/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/builder/JavaScriptComponentContextBuilder.java deleted file mode 100644 index 37ec68942a..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/builder/JavaScriptComponentContextBuilder.java +++ /dev/null @@ -1,217 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.builder; - -import java.lang.reflect.Method; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.container.js.assembly.JavaScriptImplementation; -import org.apache.tuscany.container.js.assembly.impl.JavaScriptImplementationImpl; -import org.apache.tuscany.container.js.config.JavaScriptComponentRuntimeConfiguration; -import org.apache.tuscany.container.js.rhino.RhinoScript; -import org.apache.tuscany.core.builder.BuilderConfigException; -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.MethodHashMap; -import org.apache.tuscany.core.invocation.ProxyConfiguration; -import org.apache.tuscany.core.invocation.impl.InvokerInterceptor; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.invocation.spi.ProxyFactoryFactory; -import org.apache.tuscany.core.message.MessageFactory; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.assembly.ComponentImplementation; -import org.apache.tuscany.model.assembly.ConfiguredReference; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.ModelInitException; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.Service; -import org.apache.tuscany.model.assembly.ServiceContract; -import org.apache.tuscany.model.assembly.SimpleComponent; -import org.osoa.sca.annotations.Init; - -/** - * Builds {@link org.apache.tuscany.container.js.config.JavaScriptComponentRuntimeConfiguration}s from a JavaScript - * component type - * - * @version $Rev$ $Date$ - */ -@org.osoa.sca.annotations.Scope("MODULE") -public class JavaScriptComponentContextBuilder implements RuntimeConfigurationBuilder { - - private ProxyFactoryFactory factory; - private MessageFactory msgFactory; - private RuntimeConfigurationBuilder referenceBuilder; - private RuntimeContext runtimeContext; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public JavaScriptComponentContextBuilder() { - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - @Init(eager = true) - public void init() { - runtimeContext.addBuilder(this); - } - - /** - * @param runtimeContext The runtimeContext to set. - */ - @Autowire - public void setRuntimeContext(RuntimeContext runtimeContext) { - this.runtimeContext = runtimeContext; - } - - /** - * Sets the factory used to construct proxies implmementing the business interface required by a reference - */ - @Autowire - public void setProxyFactoryFactory(ProxyFactoryFactory factory) { - this.factory = factory; - } - - /** - * Sets the factory used to construct invocation messages - */ - @Autowire - public void setMessageFactory(MessageFactory msgFactory) { - this.msgFactory = msgFactory; - } - - /** - * Sets a builder responsible for creating source-side and target-side invocation chains for a reference. The - * reference builder may be hierarchical, containing other child reference builders that operate on specific - * metadata used to construct and invocation chain. - * - * @see org.apache.tuscany.core.builder.impl.HierarchicalBuilder - */ - public void setReferenceBuilder(RuntimeConfigurationBuilder builder) { - this.referenceBuilder = builder; - } - - public void build(AssemblyModelObject modelObject, AggregateContext context) throws BuilderException { - if (modelObject instanceof SimpleComponent) { - SimpleComponent component = (SimpleComponent) modelObject; - ComponentImplementation impl = component.getComponentImplementation(); - if (impl instanceof JavaScriptImplementation) { - Scope scope = ((JavaScriptImplementation) impl).getComponentType().getServices().get(0).getServiceContract() - .getScope(); - Map services = new HashMap(); - for (Service service : ((JavaScriptImplementation) impl).getComponentType().getServices()) { - services.put(service.getName(), service.getServiceContract().getInterface()); - } - Map properties = new HashMap(); - // TODO support properties - String script = null; - if (impl instanceof JavaScriptImplementationImpl) { // fixme - try { - script = ((JavaScriptImplementationImpl) impl).getScript(); - } catch (ModelInitException e) { - throw new BuilderConfigException(e); - } - } - - RhinoScript invoker = createRhinoInvoker(component.getName(), script, properties); - JavaScriptComponentRuntimeConfiguration config = new JavaScriptComponentRuntimeConfiguration(component.getName(), - scope, services, properties, invoker); - - // create target-side invocation chains for each service offered by the implementation - for (ConfiguredService configuredService : component.getConfiguredServices()) { - Service service = configuredService.getService(); - ServiceContract contract = service.getServiceContract(); - Map iConfigMap = new MethodHashMap(); - ProxyFactory proxyFactory = factory.createProxyFactory(); - for (Method method : contract.getInterface().getMethods()) { - InvocationConfiguration iConfig = new InvocationConfiguration(method); - iConfigMap.put(method, iConfig); - } - QualifiedName qName = new QualifiedName(component.getName() + QualifiedName.NAME_SEPARATOR + service.getName()); - ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, contract.getInterface().getClassLoader(), msgFactory); - proxyFactory.setBusinessInterface(contract.getInterface()); - proxyFactory.setProxyConfiguration(pConfiguration); - configuredService.setProxyFactory(proxyFactory); - if (referenceBuilder != null) { - // invoke the reference builder to handle target-side metadata - referenceBuilder.build(configuredService, context); - } - // add tail interceptor - for (InvocationConfiguration iConfig : (Collection) iConfigMap.values()) { - iConfig.addTargetInterceptor(new InvokerInterceptor()); - } - config.addTargetProxyFactory(service.getName(), proxyFactory); - } - - // handle references - List configuredReferences = component.getConfiguredReferences(); - if (configuredReferences != null) { - for (ConfiguredReference reference : configuredReferences) { - ProxyFactory proxyFactory = factory.createProxyFactory(); - ServiceContract interfaze = reference.getReference().getServiceContract(); - Map iConfigMap = new MethodHashMap(); - for (Method method : interfaze.getInterface().getMethods()) { - InvocationConfiguration iConfig = new InvocationConfiguration(method); - iConfigMap.put(method, iConfig); - } - String targetCompName = reference.getTargetConfiguredServices().get(0).getAggregatePart().getName(); - String targetSerivceName = reference.getTargetConfiguredServices().get(0).getService().getName(); - - QualifiedName qName = new QualifiedName(targetCompName + "/" + targetSerivceName); - - // QualifiedName qName = new QualifiedName(reference.getPart().getName() + "/" - // + reference.getPort().getName()); - ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, interfaze.getInterface().getClassLoader(), msgFactory); - proxyFactory.setBusinessInterface(interfaze.getInterface()); - proxyFactory.setProxyConfiguration(pConfiguration); - reference.setProxyFactory(proxyFactory); - if (referenceBuilder != null) { - // invoke the reference builder to handle metadata associated with the reference - referenceBuilder.build(reference, context); - } - config.addSourceProxyFactory(reference.getReference().getName(), proxyFactory); - } - } - component.getComponentImplementation().setRuntimeConfiguration(config); - } - } - } - - /** - * Creates a representation of the JavaScript implementation script that is used to perform invocations - * - * @param name - * @param script the Script source - * @param properties configured properties for the component - * @return - */ - private RhinoScript createRhinoInvoker(String name, String script, Map properties) { - RhinoScript ri = new RhinoScript(name, script, properties); - return ri; - } -} diff --git a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/builder/JavaScriptTargetWireBuilder.java b/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/builder/JavaScriptTargetWireBuilder.java deleted file mode 100644 index 74433db823..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/builder/JavaScriptTargetWireBuilder.java +++ /dev/null @@ -1,75 +0,0 @@ -package org.apache.tuscany.container.js.builder; - -import java.lang.reflect.Method; - -import org.apache.tuscany.container.js.config.JavaScriptComponentRuntimeConfiguration; -import org.apache.tuscany.container.js.rhino.RhinoTargetInvoker; -import org.apache.tuscany.core.builder.BuilderConfigException; -import org.apache.tuscany.core.builder.WireBuilder; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -/** - * Responsible for bridging source- and target-side invocations chains when the target type is a JavaScript - * implementation - * - * @version $Rev$ $Date$ - */ -@Scope("MODULE") -public class JavaScriptTargetWireBuilder implements WireBuilder { - - private RuntimeContext runtimeContext; - - @Autowire - public void setRuntimeContext(RuntimeContext context) { - runtimeContext = context; - } - - public JavaScriptTargetWireBuilder() { - } - - @Init(eager=true) - public void init() { - runtimeContext.addBuilder(this); - } - - public void connect(ProxyFactory sourceFactory, ProxyFactory targetFactory, Class targetType, boolean downScope, - ScopeContext targetScopeContext) throws BuilderConfigException { - if (!(JavaScriptComponentRuntimeConfiguration.class.isAssignableFrom(targetType))) { - return; - } - for (InvocationConfiguration sourceInvocationConfig : sourceFactory.getProxyConfiguration().getInvocationConfigurations() - .values()) { - Method method = sourceInvocationConfig.getMethod(); - RhinoTargetInvoker invoker = new RhinoTargetInvoker(sourceFactory.getProxyConfiguration().getTargetName() - .getPartName(), method.getName(), targetScopeContext); - if (downScope) { - // the source scope is shorter than the target, so the invoker can cache the target instance - // invoker.setCacheable(true); - } else { - // invoker.setCacheable(false); - } - sourceInvocationConfig.setTargetInvoker(invoker); - } - } - - public void completeTargetChain(ProxyFactory targetFactory, Class targetType, ScopeContext targetScopeContext) - throws BuilderConfigException { - if (!(JavaScriptComponentRuntimeConfiguration.class.isAssignableFrom(targetType))) { - return; - } - for (InvocationConfiguration targetInvocationConfig : targetFactory.getProxyConfiguration().getInvocationConfigurations() - .values()) { - Method method = targetInvocationConfig.getMethod(); - RhinoTargetInvoker invoker = new RhinoTargetInvoker(targetFactory.getProxyConfiguration().getTargetName() - .getPartName(), method.getName(), targetScopeContext); - targetInvocationConfig.setTargetInvoker(invoker); - } - } - -} diff --git a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/config/JavaScriptComponentRuntimeConfiguration.java b/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/config/JavaScriptComponentRuntimeConfiguration.java deleted file mode 100644 index b24f98f32a..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/config/JavaScriptComponentRuntimeConfiguration.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.config; - -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.container.js.context.JavaScriptComponentContext; -import org.apache.tuscany.container.js.rhino.RhinoScript; -import org.apache.tuscany.core.builder.ContextCreationException; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.SimpleComponentContext; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.model.assembly.Scope; - -/** - * Creates instance contexts for JavaScript component types - * - * @version $Rev$ $Date$ - */ -public class JavaScriptComponentRuntimeConfiguration implements RuntimeConfiguration { - - private Scope scope; - - private String name; - - private Map services; - - private Map properties; - - private RhinoScript invoker; - - public JavaScriptComponentRuntimeConfiguration(String name, Scope scope, Map services, - Map properties, RhinoScript invoker) { - this.name = name; - this.scope = scope; - this.services = services; - this.properties = properties; - this.invoker = invoker; - } - - public SimpleComponentContext createInstanceContext() throws ContextCreationException { - return new JavaScriptComponentContext(name, services, properties, sourceProxyFactories, targetProxyFactories, invoker - .copy()); - } - - public Scope getScope() { - return scope; - } - - public String getName() { - return name; - } - - private Map targetProxyFactories = new HashMap(); - - public void addTargetProxyFactory(String serviceName, ProxyFactory factory) { - targetProxyFactories.put(serviceName, factory); - } - - public ProxyFactory getTargetProxyFactory(String serviceName) { - return targetProxyFactories.get(serviceName); - } - - public Map getTargetProxyFactories() { - return targetProxyFactories; - } - - private Map sourceProxyFactories = new HashMap(); - - public void addSourceProxyFactory(String referenceName, ProxyFactory factory) { - sourceProxyFactories.put(referenceName, factory); - } - - public ProxyFactory getSourceProxyFactory(String referenceName) { - return sourceProxyFactories.get(referenceName); - } - - public Map getSourceProxyFactories() { - return sourceProxyFactories; - } - - public void prepare() { - - } - -} diff --git a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/context/JavaScriptComponentContext.java b/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/context/JavaScriptComponentContext.java deleted file mode 100644 index 8a4db7eb44..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/context/JavaScriptComponentContext.java +++ /dev/null @@ -1,161 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.context; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.apache.tuscany.container.js.rhino.RhinoScript; -import org.apache.tuscany.core.context.AbstractContext; -import org.apache.tuscany.core.context.CoreRuntimeException; -import org.apache.tuscany.core.context.LifecycleEventListener; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.SimpleComponentContext; -import org.apache.tuscany.core.context.TargetException; -import org.apache.tuscany.core.invocation.spi.ProxyCreationException; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; - -public class JavaScriptComponentContext extends AbstractContext implements SimpleComponentContext { - - private Map services; - - private RhinoScript rhinoInvoker; - - private Map properties; - - private Map sourceProxyFactories; - - private Map targetProxyFactories; - - private Object instance; - - public JavaScriptComponentContext(String name, Map services, Map properties, - Map sourceProxyFactories, Map targetProxyFactories, RhinoScript invoker) { - super(name); - assert (services != null) : "No service interface mapping specified"; - assert (properties != null) : "No properties specified"; - this.services = services; - this.properties = properties; - this.rhinoInvoker = invoker; - this.sourceProxyFactories = sourceProxyFactories; - this.targetProxyFactories = targetProxyFactories; - } - - public Object getInstance(QualifiedName qName) throws TargetException { - return getInstance(qName, true); - } - - public synchronized Object getInstance(QualifiedName qName, boolean notify) throws TargetException { - String portName=qName.getPortName(); - ProxyFactory targetFactory; - if (portName!=null) { - targetFactory = targetProxyFactories.get(portName); - } else { - //FIXME The port name is null here, either locateService needs more information (the expected interface) to - // select the correct port, or we need to return a factory that matches the whole set of services exposed by - // the component. - targetFactory = targetProxyFactories.values().iterator().next(); - } - if (targetFactory == null) { - TargetException e = new TargetException("Target service not found"); - e.setIdentifier(qName.getPortName()); - e.addContextName(getName()); - throw e; - } - try { - Object proxy = targetFactory.createProxy(); //createProxy(new Class[] { iface }); - notifyListeners(notify); - return proxy; - } catch (ProxyCreationException e) { - TargetException te = new TargetException("Error returning target", e); - e.setIdentifier(qName.getPortName()); - e.addContextName(getName()); - throw te; - } - } - - public Object getImplementationInstance() throws TargetException { - return getImplementationInstance(true); - } - - public Object getImplementationInstance(boolean notify) throws TargetException { - rhinoInvoker.updateScriptScope(properties); // create prop values - return rhinoInvoker; - } - -// private Object createProxy(Class[] ifaces) throws ProxyCreationException { -// // final RhinoInvoker rhinoInvoker = implementation.getRhinoInvoker().copy(); -// rhinoInvoker.updateScriptScope(properties); // create prop values -// final Map refs = createInvocationContext(); -// InvocationHandler ih = new InvocationHandler() { -// public Object invoke(Object proxy, Method method, Object[] args) { -// return rhinoInvoker.invoke(method.getName(), args, method.getReturnType(), refs); -// // return rhinoInvoker.invoke(method.getName(), args, method.getReturnType(),createInvocationContext()); -// } -// }; -// return Proxy.newProxyInstance(ifaces[0].getClassLoader(), ifaces, ih); -// } - - private void notifyListeners(boolean notify) { - if (notify) { - for (Iterator iter = contextListener.iterator(); iter.hasNext();) { - LifecycleEventListener listener = (LifecycleEventListener) iter.next(); - listener.onInstanceCreate(this); - } - } - } - - /** - * Creates a map containing any properties and their values - */ - // private Map createPropertyValues() { - // Map context = new HashMap(); - // List configuredProperties = component.getConfiguredProperties(); - // if (configuredProperties != null) { - // for (ConfiguredProperty property : configuredProperties) { - // context.put(property.getProperty().getName(), property.getValue()); - // } - // } - // return context; - // } - /** - * Creates a map containing any ServiceReferences - */ - private Map createInvocationContext() throws ProxyCreationException { - Map context = new HashMap(); - for (Map.Entry entry : sourceProxyFactories.entrySet()) { - context.put(entry.getKey(), entry.getValue().createProxy()); - } - return context; - } - - public boolean isEagerInit() { - return false; - } - - public boolean isDestroyable() { - return false; - } - - public void start() throws CoreRuntimeException { - } - - public void stop() throws CoreRuntimeException { - } - -} diff --git a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/loader/JavaScriptSCDLModelLoader.java b/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/loader/JavaScriptSCDLModelLoader.java deleted file mode 100644 index ed7d267c89..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/loader/JavaScriptSCDLModelLoader.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.apache.tuscany.container.js.loader; - -import org.apache.tuscany.container.js.assembly.JavaScriptAssemblyFactory; -import org.apache.tuscany.container.js.assembly.JavaScriptImplementation; -import org.apache.tuscany.container.js.assembly.impl.JavaScriptAssemblyFactoryImpl; -import org.apache.tuscany.container.js.scdl.ScdlFactory; -import org.apache.tuscany.container.js.scdl.impl.ScdlPackageImpl; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.apache.tuscany.core.loader.SCDLModelLoaderRegistry; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.scdl.loader.SCDLModelLoader; -import org.apache.tuscany.sdo.util.SDOUtil; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Reference; - -/** - * Populates the assembly model from an SCDL model - */ -@org.osoa.sca.annotations.Scope("MODULE") -public class JavaScriptSCDLModelLoader implements SCDLModelLoader { - - private RuntimeContext runtimeContext; - private SCDLModelLoaderRegistry loaderRegistry; - private JavaScriptAssemblyFactory jsFactory; - - static { - // Register the JavaScript SCDL model - SDOUtil.registerStaticTypes(ScdlFactory.class); - } - - /** - * @param runtimeContext The runtimeContext to set. - */ - @Autowire - public void setRuntimeContext(RuntimeContext runtimeContext) { - this.runtimeContext = runtimeContext; - } - -// @Reference - public void setLoaderRegistry(SCDLModelLoaderRegistry registry) { - this.loaderRegistry = registry; - } - - @Init(eager=true) - public void init() { - runtimeContext.addLoader(this); -// loaderRegistry.registerLoader(this); - } - - @Destroy - public void destroy() { -// loaderRegistry.unregisterLoader(this); - } - - /** - * Constructs a new JavaSCDLModelLoader. - */ - public JavaScriptSCDLModelLoader() { - this.jsFactory=new JavaScriptAssemblyFactoryImpl(); - } - - /** - * @see org.apache.tuscany.model.scdl.loader.SCDLModelLoader#load(org.apache.tuscany.model.assembly.AssemblyModelContext, java.lang.Object) - */ - public AssemblyModelObject load(AssemblyModelContext modelContext, Object object) { - if (object instanceof org.apache.tuscany.container.js.scdl.JavaScriptImplementation) { - org.apache.tuscany.container.js.scdl.JavaScriptImplementation scdlImplementation=(org.apache.tuscany.container.js.scdl.JavaScriptImplementation)object; - JavaScriptImplementation implementation=jsFactory.createJavaScriptImplementation(); - implementation.setScriptFile(scdlImplementation.getScriptFile()); - return implementation; - } else - return null; - } -} diff --git a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/rhino/RhinoScript.java b/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/rhino/RhinoScript.java deleted file mode 100644 index 4ddee12fe4..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/rhino/RhinoScript.java +++ /dev/null @@ -1,298 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.rhino; - -import java.util.Iterator; -import java.util.Map; - -import org.mozilla.javascript.Context; -import org.mozilla.javascript.ContextFactory; -import org.mozilla.javascript.Function; -import org.mozilla.javascript.Script; -import org.mozilla.javascript.Scriptable; -import org.mozilla.javascript.Wrapper; - -/** - * Represents, and is responsible for dispatching to, a JavaScript artifact in Rhino - */ -public class RhinoScript { - - private String scriptName; - - private String script; - - private Scriptable scriptScope; - - private Scriptable sharedScope; - - /* - * Enable dynamic scopes so a script can be used concurrently with a global shared scope and individual execution - * scopes. See http://www.mozilla.org/rhino/scopes.html TODO: need to review how ths fits in with Tuscany scopes - */ - private static class MyFactory extends ContextFactory { - protected boolean hasFeature(Context cx, int featureIndex) { - if (featureIndex == Context.FEATURE_DYNAMIC_SCOPE) { - return true; - } - return super.hasFeature(cx, featureIndex); - } - } - - static { - ContextFactory.initGlobal(new MyFactory()); - } - - /** - * Create a new RhinoInvoker. - * - * @param scriptName the name of the script. Can be anything, only used in messages to identify the script - * @param script the complete script - */ - public RhinoScript(String scriptName, String script) { - this(scriptName, script, (Map) null); - } - - /** - * Create a new RhinoInvoker. - * - * @param scriptName the name of the script. Can be anything, only used in messages to identify the script - * @param script the complete script - * @param context name-value pairs that are added in to the scope where the script is compiled. May be null. The - * value objects are made available to the script by using a variable with the name. - */ - public RhinoScript(String scriptName, String script, Map context) { - this.scriptName = scriptName; - this.script = script; - initScriptScope(scriptName, script, context); - initSharedScope(); - } - - /** - * Construct a RhinoInvoker from another RhinoInvoker object. This uses the original script scope so the script - * doesn't need to be recompiled. - */ - protected RhinoScript(String scriptName, String script, Scriptable scriptScope) { - this.scriptName = scriptName; - this.script = script; - this.scriptScope = scriptScope; - initSharedScope(); - } - - /** - * Invoke a script function - * - * @param functionName the name of the function to invoke. - * @param arg arguments to the function, may be a single object or an array of objects. - * @return the function return value. - */ - public Object invoke(String functionName, Object args) { - return invoke(functionName, args, null, null); - } - - /** - * Invoke a script function - * - * @param functionName the name of the function to invoke. - * @param arg arguments to the function, may be a single object or an array of objects. - * @param contexts a Map of name-value pairs which are added to the invocation Scope to enable the script to access - * the values by using the variable in name. - * @return the function return value. - */ - public Object invoke(String functionName, Object args, Map contexts) { - return invoke(functionName, args, null, contexts); - } - - /** - * Invoke a script function - * - * @param functionName the name of the function to invoke. - * @param arg arguments to the function, may be a single object or an array of objects. - * @param responseClass the desired class of the response object. - * @param contexts a Map of name-value pairs which are added to the invocation Scope to enable the script to access - * the values by using the variable in name. - * @return the function return value. - */ - public Object invoke(String functionName, Object arg, Class responseClass, Map contexts) { - Context cx = Context.enter(); - try { - Function function = getFunction(scriptScope, functionName); - Scriptable invocationScope = getInvocationScope(cx, contexts); - Object[] args = processArgs(arg, invocationScope); - Object jsResponse = function.call(cx, invocationScope, invocationScope, args); - Object response = processResponse(jsResponse, responseClass); - return response; - } finally { - Context.exit(); - } - } - - /** - * Turn args to JS objects and convert any OMElement to E4X XML - */ - protected Object[] processArgs(Object arg, Scriptable scope) { - // TODO: implement pluggable way to transform objects (eg SDO or AXIOM) to E4X XML objects - // if (arg instanceof OMElement) { - // try { - // arg = E4XAXIOMUtils.toScriptableObject((OMElement) arg, scope); - // } catch (XmlException e) { - // throw new RuntimeException(e); - // } - // } else if (arg instanceof MessageContext) { - // arg = new E4XMessageContext((MessageContext) arg, scope); - // } - Object[] args; - if (arg == null) { - args = new Object[] { null }; - } else if (arg.getClass().isArray()) { - args = (Object[]) arg; - for (int i = 0; i < args.length; i++) { - args[i] = Context.toObject(args[i], scope); - } - } else { - args = new Object[] { Context.toObject(arg, scope) }; - } - return args; - } - - /** - * Unwrap and convert response - */ - protected Object processResponse(Object response, Class responseClass) { - // TODO: implement pluggable way to transform E4X XML into specific objects (eg SDO or AXIOM) - // } else if (response instanceof XMLObject) { - // response = E4XAXIOMUtils.toOMElement((XMLObject) response); - if (Context.getUndefinedValue().equals(response)) { - response = null; - } else if (response instanceof Wrapper) { - response = ((Wrapper) response).unwrap(); - } else { - if (responseClass != null) { - response = Context.toType(response, responseClass); - } else { - response = Context.toType(response, String.class); - } - } - return response; - } - - /** - * Create a Rhino scope and compile the script into it - */ - protected void initScriptScope(String fileName, String scriptCode, Map context) { - Context cx = Context.enter(); - try { - - this.scriptScope = cx.initStandardObjects(null, true); - Script compiledScript = cx.compileString(scriptCode, fileName, 1, null); - compiledScript.exec(cx, scriptScope); - addContexts(scriptScope, context); - - } finally { - Context.exit(); - } - } - - /** - * Initializes the shared scope - */ - protected void initSharedScope() { - Context cx = Context.enter(); - try { - - this.sharedScope = cx.newObject(scriptScope); - sharedScope.setPrototype(scriptScope); - sharedScope.setParentScope(null); - - } finally { - Context.exit(); - } - } - - /** - * Get a Rhino scope for the function invocation. If the invocation has no context objects then this will use the - * shared scope otherwise a new scope is created to hold the context objects. Any new variables the executing script - * might define will go in the sharedScope. This new scope is just to hold the invocation specific context objects. - */ - protected Scriptable getInvocationScope(Context cx, Map contexts) { - - Scriptable scope; - if (contexts == null || contexts.size() == 0) { - scope = sharedScope; - } else { - scope = cx.newObject(sharedScope); - scope.setPrototype(sharedScope); - scope.setParentScope(null); - addContexts(scope, contexts); - } - - return scope; - } - - /** - * Add the context to the scope. This will make the objects available to a script by using the name it was added - * with. - */ - protected void addContexts(Scriptable scope, Map contexts) { - if (contexts != null) { - for (Iterator i = contexts.keySet().iterator(); i.hasNext();) { - String name = (String) i.next(); - Object value = contexts.get(name); - if (value != null) { - scope.put(name, scope, Context.toObject(value, scope)); - } - } - } - } - - /** - * Get the Rhino Function object for the named script function - */ - protected Function getFunction(Scriptable scope, String functionName) { - - Object handleObj = scope.get(functionName, scope); - - if (!(handleObj instanceof Function)) { - throw new RuntimeException("script function '" + functionName + "' is undefined or not a function in script " - + scriptName); - } - - return (Function) handleObj; - } - - /** - * Make a copy of this RhinoScript object. This shares the script scope to avoid the overhead of recompiling the - * script, and to allow any initialization done by the script to be shared. - */ - public RhinoScript copy() { - return new RhinoScript(scriptName, script, scriptScope); - } - - /** - * Update the scope where the script is complied with new context values - * - * @param properties - */ - public void updateScriptScope(Map context) { - Context.enter(); - try { - addContexts(scriptScope, context); - } finally { - Context.exit(); - } - } - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/rhino/RhinoTargetInvoker.java b/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/rhino/RhinoTargetInvoker.java deleted file mode 100644 index 62cf40f333..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/main/java/org/apache/tuscany/container/js/rhino/RhinoTargetInvoker.java +++ /dev/null @@ -1,81 +0,0 @@ -package org.apache.tuscany.container.js.rhino; - -import java.lang.reflect.InvocationTargetException; - -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.invocation.Interceptor; -import org.apache.tuscany.core.invocation.TargetInvoker; -import org.apache.tuscany.core.message.Message; - -public class RhinoTargetInvoker implements TargetInvoker { - - private ScopeContext container; - - private QualifiedName name; - - private String operation; - - private RhinoScript target; - - public RhinoTargetInvoker(String serviceName, String operation, ScopeContext container) { - assert (serviceName != null) : "No service name specified"; - assert (container != null) : "No scope container specified"; - assert (operation != null) : "No operation specified"; - this.name = new QualifiedName(serviceName); - this.container = container; - this.operation = operation; - } - - public Object invokeTarget(Object payload) throws InvocationTargetException { - if (cacheable) { - if (target == null) { - target = (RhinoScript) container.getContext(name.getPartName()).getImplementationInstance(); - } - return target.invoke(operation, payload); - } else { - return ((RhinoScript) container.getContext(name.getPartName()).getImplementationInstance()) - .invoke(operation, payload); - } - } - - private boolean cacheable; - - public boolean isCacheable() { - return cacheable; - } - - public void setCacheable(boolean val) { - cacheable = val; - } - - public Message invoke(Message msg) { - try { - Object resp = invokeTarget(msg.getBody()); - msg.setBody(resp); - } catch (InvocationTargetException e) { - msg.setBody(e.getCause()); - } catch (Throwable e) { - msg.setBody(e); - } - return msg; - } - - public void setNext(Interceptor next) { - throw new IllegalStateException("This interceptor must be the last interceptor in an interceptor chain"); - } - - public Object clone() { - try { - RhinoTargetInvoker invoker = (RhinoTargetInvoker) super.clone(); - invoker.container = this.container; - invoker.cacheable = this.cacheable; - invoker.name = this.name; - invoker.operation = this.operation; - invoker.target = null; - return invoker; - } catch (CloneNotSupportedException e) { - return null; // will not happen - } - } -} diff --git a/tags/java-stable-20060304/sca/container.js/src/main/resources/model/sca-implementation-js.xsd b/tags/java-stable-20060304/sca/container.js/src/main/resources/model/sca-implementation-js.xsd deleted file mode 100644 index c68161d7bd..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/main/resources/model/sca-implementation-js.xsd +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/container.js/src/main/resources/org/apache/tuscany/container/js/handler/JavaScriptComponentConfigurationHandler.componentType b/tags/java-stable-20060304/sca/container.js/src/main/resources/org/apache/tuscany/container/js/handler/JavaScriptComponentConfigurationHandler.componentType deleted file mode 100644 index c737a08a0b..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/main/resources/org/apache/tuscany/container/js/handler/JavaScriptComponentConfigurationHandler.componentType +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/container.js/src/main/resources/system.fragment b/tags/java-stable-20060304/sca/container.js/src/main/resources/system.fragment deleted file mode 100644 index 4c17a7ac1c..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/main/resources/system.fragment +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/container.js/src/samples/java/org/apache/tuscany/container/js/sample/helloworld/HelloWorld.java b/tags/java-stable-20060304/sca/container.js/src/samples/java/org/apache/tuscany/container/js/sample/helloworld/HelloWorld.java deleted file mode 100644 index ed03753557..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/samples/java/org/apache/tuscany/container/js/sample/helloworld/HelloWorld.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.apache.tuscany.container.js.sample.helloworld; - -public interface HelloWorld { - - public String getGreeting(String s); - -} diff --git a/tags/java-stable-20060304/sca/container.js/src/samples/java/org/apache/tuscany/container/js/sample/helloworld/HelloWorldImpl.componentType b/tags/java-stable-20060304/sca/container.js/src/samples/java/org/apache/tuscany/container/js/sample/helloworld/HelloWorldImpl.componentType deleted file mode 100644 index cce77fab00..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/samples/java/org/apache/tuscany/container/js/sample/helloworld/HelloWorldImpl.componentType +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/container.js/src/samples/java/org/apache/tuscany/container/js/sample/helloworld/HelloWorldImpl.js b/tags/java-stable-20060304/sca/container.js/src/samples/java/org/apache/tuscany/container/js/sample/helloworld/HelloWorldImpl.js deleted file mode 100644 index cb63914377..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/samples/java/org/apache/tuscany/container/js/sample/helloworld/HelloWorldImpl.js +++ /dev/null @@ -1,4 +0,0 @@ - -function getGreeting(s) { - return "jsHello " + s; -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/container.js/src/samples/java/org/apache/tuscany/container/js/sample/helloworld/Main.java b/tags/java-stable-20060304/sca/container.js/src/samples/java/org/apache/tuscany/container/js/sample/helloworld/Main.java deleted file mode 100644 index 2e63a5a21e..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/samples/java/org/apache/tuscany/container/js/sample/helloworld/Main.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.apache.tuscany.container.js.sample.helloworld; - -import org.apache.tuscany.core.client.TuscanyRuntime; -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; - -public class Main { - - public static final void main(String[] args) throws Exception { - - TuscanyRuntime tuscany = new TuscanyRuntime("jsHello", null); - tuscany.start(); - ModuleContext moduleContext = CurrentModuleContext.getContext(); - - HelloWorld s = - (HelloWorld) moduleContext.locateService("HelloWorldJSComponent"); - - String value = s.getGreeting("Petra"); - - System.out.println(value); - - tuscany.stop(); - } - -} diff --git a/tags/java-stable-20060304/sca/container.js/src/samples/java/sca.module b/tags/java-stable-20060304/sca/container.js/src/samples/java/sca.module deleted file mode 100644 index 25c35fa6d0..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/samples/java/sca.module +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/impl/JavaScriptImplementationTestCase.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/impl/JavaScriptImplementationTestCase.java deleted file mode 100644 index c751b0a2ef..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/impl/JavaScriptImplementationTestCase.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.assembly.impl; - -import junit.framework.TestCase; - -/** - * FIXME commented out until SCDL loading works - * - * @version $Rev: 368822 $ $Date: 2006-01-13 18:54:38 +0000 (Fri, 13 Jan 2006) $ - */ -public class JavaScriptImplementationTestCase extends TestCase { - - private JavaScriptImplementationImpl impl = (JavaScriptImplementationImpl) new JavaScriptAssemblyFactoryImpl() - .createJavaScriptImplementation(); - - public void testDummy(){} // remove when tests added back - -// public void testNoImplementationClass() { -// impl.setScriptFile("no.such.script.js"); -// try { -// impl.initialize(new AssemblyModelContextImpl(null, null)); -// impl.getComponentType(); -// fail("Expected IllegalArgumentException"); -// } catch (IllegalArgumentException e) { -// // ok -// } -// } - -// public void testHelloWorldWithSidefile() { -// impl.setScriptFile("org/apache/tuscany/container/js/assembly/mock/HelloWorldImpl.js"); -// impl.initialize(new AssemblyModelContextImpl(new AssemblyLoaderImpl(), ResourceLoaderFactory.getResourceLoader(Thread -// .currentThread().getContextClassLoader()))); -// ComponentType type = impl.getComponentType(); -// Assert.assertNotNull(type); -// List props = type.getProperties(); -// Assert.assertEquals(1, props.size()); -// Assert.assertTrue(props.get(0).getName().equals("text")); -// -// Assert.assertTrue(type.getReferences().isEmpty()); -// -// List services = type.getServices(); -// Assert.assertEquals(1, services.size()); -// Assert.assertTrue(services.get(0).getName().equals("HelloWorldService")); -// } - - // static { - // // bootstrap this somehow - // AssemblyPackage.eINSTANCE.getClass(); - // } - - protected void setUp() throws Exception { - super.setUp(); - Thread.currentThread().setContextClassLoader(JavaScriptImplementationTestCase.class.getClassLoader()); - } - - protected void tearDown() throws Exception { - Thread.currentThread().setContextClassLoader(null); - super.tearDown(); - } -} diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/mock/HelloWorldService.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/mock/HelloWorldService.java deleted file mode 100644 index 8edb27a473..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/mock/HelloWorldService.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.assembly.mock; - -/** - * @version $Rev: 368822 $ $Date: 2006-01-13 18:54:38 +0000 (Fri, 13 Jan 2006) $ - */ -public interface HelloWorldService { - String hello(String name); -} diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/JavaScriptAssemblyLoaderTestCase.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/JavaScriptAssemblyLoaderTestCase.java deleted file mode 100644 index 91ce8a73eb..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/JavaScriptAssemblyLoaderTestCase.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.assembly.tests; - -import junit.framework.TestCase; - -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; - -/** - */ -public class JavaScriptAssemblyLoaderTestCase extends TestCase { - - private AssemblyModelContext modelContext; - - /** - * - */ - public JavaScriptAssemblyLoaderTestCase() { - super(); - } - - public void testLoader() { -/* - - AssemblyLoader loader = modelContext.getAssemblyLoader(); - Module module = loader.getModule(getClass().getResource("sca.module").toString()); - module.initialize(modelContext); - - Assert.assertTrue(module.getName().equals("tuscany.container.js.assembly.tests.bigbank.account")); - - Component component = module.getComponent("AccountServiceComponent"); - Assert.assertTrue(component != null); - - EntryPoint entryPoint = module.getEntryPoint("AccountService"); - Assert.assertTrue(entryPoint != null); - - Object value = component.getConfiguredProperty("currency").getValue(); - Assert.assertTrue(value.equals("EURO")); - - ConfiguredService configuredService = component.getConfiguredReference("accountDataService").getConfiguredServices().get(0); - Assert.assertTrue(configuredService.getPart().getName().equals("AccountDataServiceComponent")); - - InterfaceType interfaceType = configuredService.getService().getInterfaceContract().getInterfaceType(); - OperationType operationType = interfaceType.getOperationType("getCheckingAccount"); - Type type = operationType.getInputType(); - Property arg = (Property) type.getProperties().get(0); - Assert.assertTrue(arg.getType().getInstanceClass() == String.class); -*/ - - } - - protected void setUp() throws Exception { - super.setUp(); - - Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); - modelContext = new AssemblyModelContextImpl(null,null); - } - -} diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/account/AccountReport.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/account/AccountReport.java deleted file mode 100644 index 90c47d400c..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/account/AccountReport.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.assembly.tests.bigbank.account.services.account; - -import java.util.List; - -/** - * @model - */ - -public interface AccountReport { - - /** - * @model type="services.account.AccountSummary" - */ - - List getAccountSummaries(); -} diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/account/AccountService.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/account/AccountService.java deleted file mode 100644 index ff555e178f..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/account/AccountService.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.assembly.tests.bigbank.account.services.account; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface AccountService { - - public AccountReport getAccountReport(String customerID); -} diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/account/AccountSummary.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/account/AccountSummary.java deleted file mode 100644 index ad3b4ad737..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/account/AccountSummary.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.assembly.tests.bigbank.account.services.account; - -/** - * @model - */ - -public interface AccountSummary { - - /** - * @model - */ - String getAccountNumber(); - - void setAccountNumber(String accountNumber); - - /** - * @model - */ - String getAccountType(); - - void setAccountType(String accountType); - - /** - * @model - */ - float getBalance(); - - void setBalance(float balance); -} - diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java deleted file mode 100644 index 42d8994392..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.assembly.tests.bigbank.account.services.accountdata; - -public interface AccountDataService { - - CheckingAccount getCheckingAccount(String customerID); - - SavingsAccount getSavingsAccount(String customerID); - - StockAccount getStockAccount(String customerID); -} diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java deleted file mode 100644 index 24b91020f7..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.assembly.tests.bigbank.account.services.accountdata; - -public class AccountDataServiceImpl implements AccountDataService { - - public CheckingAccount getCheckingAccount(String customerID) { - - CheckingAccount checkingAccount = new CheckingAccount(); - checkingAccount.setAccountNumber(customerID + "_" + "CHA12345"); - checkingAccount.setBalance(1500.0f); - - return checkingAccount; - } - - public SavingsAccount getSavingsAccount(String customerID) { - - SavingsAccount savingsAccount = new SavingsAccount(); - savingsAccount.setAccountNumber(customerID + "_" + "SAA12345"); - savingsAccount.setBalance(1500.0f); - - return savingsAccount; - } - - public StockAccount getStockAccount(String customerID) { - - StockAccount stockAccount = new StockAccount(); - stockAccount.setAccountNumber(customerID + "_" + "STA12345"); - stockAccount.setSymbol("IBM"); - stockAccount.setQuantity(100); - - return stockAccount; - } -} diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java deleted file mode 100644 index 43b755e0fb..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.assembly.tests.bigbank.account.services.accountdata; - -public class CheckingAccount { - - private String accountNumber; - private float balance; - - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - - public float getBalance() { - return balance; - } - - public void setBalance(float balance) { - this.balance = balance; - } -} diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java deleted file mode 100644 index 3f8cb65ad7..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.assembly.tests.bigbank.account.services.accountdata; - -public class SavingsAccount { - - private String accountNumber; - private float balance; - - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - - public float getBalance() { - return balance; - } - - public void setBalance(float balance) { - this.balance = balance; - } -} diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/StockAccount.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/StockAccount.java deleted file mode 100644 index ae6cdd6ff6..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/StockAccount.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.assembly.tests.bigbank.account.services.accountdata; - -public class StockAccount { - - private String accountNumber; - private String symbol; - private int quantity; - - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - - public int getQuantity() { - return quantity; - } - - public void setQuantity(int quantity) { - this.quantity = quantity; - } - - public String getSymbol() { - return symbol; - } - - public void setSymbol(String symbol) { - this.symbol = symbol; - } -} diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java deleted file mode 100644 index 8720bcdaf6..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.assembly.tests.bigbank.account.services.stockquote; - -public interface StockQuoteService { - - public float getQuote(String symbol); -} - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/stockquote/StockQuoteServiceImpl.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/stockquote/StockQuoteServiceImpl.java deleted file mode 100644 index 9765b67c2f..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/stockquote/StockQuoteServiceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.assembly.tests.bigbank.account.services.stockquote; - -/* Dummy'd up StockQuoteService, override webservice for now */ - -public class StockQuoteServiceImpl implements StockQuoteService { - - public float getQuote(String symbol) { - // Just hardcode for now - return 83.00f; - } - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl deleted file mode 100644 index 01df4ef054..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/builder/JSComponentContextBuilderTestCase.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/builder/JSComponentContextBuilderTestCase.java deleted file mode 100644 index d21c17636a..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/builder/JSComponentContextBuilderTestCase.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.apache.tuscany.container.js.builder; - -import java.util.Collection; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.common.resource.impl.ResourceLoaderImpl; -import org.apache.tuscany.container.js.assembly.mock.HelloWorldService; -import org.apache.tuscany.container.js.config.JavaScriptComponentRuntimeConfiguration; -import org.apache.tuscany.container.js.mock.MockAssemblyFactory; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.impl.EventContextImpl; -import org.apache.tuscany.core.context.scope.ModuleScopeContext; -import org.apache.tuscany.core.invocation.jdk.JDKProxyFactoryFactory; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.SimpleComponent; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; -import org.apache.tuscany.model.scdl.loader.impl.SCDLAssemblyModelLoaderImpl; - -public class JSComponentContextBuilderTestCase extends TestCase { - - public void testBasicInvocation() throws Exception { - JavaScriptComponentContextBuilder jsBuilder = new JavaScriptComponentContextBuilder(); - jsBuilder.setProxyFactoryFactory(new JDKProxyFactoryFactory()); - JavaScriptTargetWireBuilder jsWireBuilder = new JavaScriptTargetWireBuilder(); - SimpleComponent component = MockAssemblyFactory.createComponent("foo", - "org/apache/tuscany/container/js/assembly/mock/HelloWorldImpl.js", HelloWorldService.class, Scope.MODULE); - component.initialize(new AssemblyModelContextImpl(new AssemblyFactoryImpl(), new SCDLAssemblyModelLoaderImpl(null), new ResourceLoaderImpl(Thread.currentThread().getContextClassLoader()))); - jsBuilder.build(component, null); - ModuleScopeContext context = new ModuleScopeContext(new EventContextImpl()); - RuntimeConfiguration config = (RuntimeConfiguration) component.getComponentImplementation() - .getRuntimeConfiguration(); - context.registerConfiguration(config); - context.start(); - context.onEvent(EventContext.MODULE_START, null); - for (ProxyFactory proxyFactory : (Collection) config.getTargetProxyFactories().values()) { - jsWireBuilder.completeTargetChain(proxyFactory, JavaScriptComponentRuntimeConfiguration.class, context); - proxyFactory.initialize(); - } - InstanceContext ctx = config.createInstanceContext(); - HelloWorldService hello = (HelloWorldService) ctx.getInstance(new QualifiedName("foo/HelloWorldService")); - Assert.assertNotNull(hello); - Assert.assertEquals("Hello foo", hello.hello("foo")); - } -} diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/builder/MockHandlerBuilder.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/builder/MockHandlerBuilder.java deleted file mode 100644 index 5f5e8d769a..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/builder/MockHandlerBuilder.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.builder; - -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.MessageHandler; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.assembly.ConfiguredReference; -import org.apache.tuscany.model.assembly.ConfiguredService; - -/** - * Adds a handler to a source or target proxy configuration - * - * @version $Rev$ $Date$ - */ -public class MockHandlerBuilder implements RuntimeConfigurationBuilder { - - private MessageHandler handler; - - private boolean source; - - private boolean request; - - /** - * Creates the builder. - * - * @param handler the handler to add to the source or target proxy configuration - * @param source true if the handler should be added on the source side; false if the handler should be added to the - * target side - * @param request true if the handler is a request handler; false if the handler is a response handler - */ - public MockHandlerBuilder(MessageHandler handler, boolean source, boolean request) { - this.handler = handler; - this.source = source; - this.request = request; - } - - public void build(AssemblyModelObject modelObject, Context context) throws BuilderException { - if (source) { - if (!(modelObject instanceof ConfiguredReference)) { - return; - } else { - ConfiguredReference cref = (ConfiguredReference) modelObject; - ProxyFactory pFactory = (ProxyFactory) cref.getProxyFactory(); - for (InvocationConfiguration config : pFactory.getProxyConfiguration().getInvocationConfigurations().values()) { - if (request) { - config.addRequestHandler(handler); - } else { - config.addResponseHandler(handler); - } - } - } - } else { - if (!(modelObject instanceof ConfiguredService)) { - return; - } else { - ConfiguredService cservice = (ConfiguredService) modelObject; - ProxyFactory pFactory = (ProxyFactory) cservice.getProxyFactory(); - for (InvocationConfiguration config : pFactory.getProxyConfiguration().getInvocationConfigurations().values()) { - if (request) { - config.addRequestHandler(handler); - } else { - config.addResponseHandler(handler); - } - } - } - - } - } - -} diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/builder/MockInterceptorBuilder.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/builder/MockInterceptorBuilder.java deleted file mode 100644 index 0ed27101dd..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/builder/MockInterceptorBuilder.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.builder; - -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.core.invocation.Interceptor; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.assembly.ConfiguredReference; -import org.apache.tuscany.model.assembly.ConfiguredService; - -/** - * Adds an interceptor to a source or target proxy configuration - * - * @version $Rev$ $Date$ - */ -public class MockInterceptorBuilder implements RuntimeConfigurationBuilder { - - private Interceptor interceptor; - - private boolean source; - - /** - * Creates the builder - * - * @param interceptor the interceptor ot add - * @param source true if the interceptor should be added to the source side; false if the interceptor should be - * added to the target side - */ - public MockInterceptorBuilder(Interceptor interceptor, boolean source) { - this.interceptor = interceptor; - this.source = source; - } - - public void build(AssemblyModelObject modelObject, Context context) throws BuilderException { - if (source) { - if (!(modelObject instanceof ConfiguredReference)) { - return; - } else { - ConfiguredReference cref = (ConfiguredReference) modelObject; - ProxyFactory pFactory = (ProxyFactory) cref.getProxyFactory(); - for (InvocationConfiguration config : pFactory.getProxyConfiguration().getInvocationConfigurations().values()) { - config.addSourceInterceptor(interceptor); - } - } - } else { - if (!(modelObject instanceof ConfiguredService)) { - return; - } else { - ConfiguredService cservice = (ConfiguredService) modelObject; - ProxyFactory pFactory = (ProxyFactory) cservice.getProxyFactory(); - for (InvocationConfiguration config : pFactory.getProxyConfiguration().getInvocationConfigurations().values()) { - config.addTargetInterceptor(interceptor); - } - } - - } - } - -} diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/config/ModuleComponentConfigurationLoaderTestCase.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/config/ModuleComponentConfigurationLoaderTestCase.java deleted file mode 100644 index 4f9ba1ab49..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/config/ModuleComponentConfigurationLoaderTestCase.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.config; - -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.common.resource.impl.ResourceLoaderImpl; -import org.apache.tuscany.container.js.assembly.impl.JavaScriptImplementationImpl; -import org.apache.tuscany.container.js.loader.JavaScriptSCDLModelLoader; -import org.apache.tuscany.core.config.ConfigurationException; -import org.apache.tuscany.core.config.ModuleComponentConfigurationLoader; -import org.apache.tuscany.core.config.impl.ModuleComponentConfigurationLoaderImpl; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.ComponentImplementation; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.ModuleComponent; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; -import org.apache.tuscany.model.assembly.loader.AssemblyModelLoader; -import org.apache.tuscany.model.scdl.loader.SCDLModelLoader; -import org.apache.tuscany.model.scdl.loader.impl.SCDLAssemblyModelLoaderImpl; - -/** - * @version $Rev: 368822 $ $Date: 2006-01-13 18:54:38 +0000 (Fri, 13 Jan 2006) $ - */ -public class ModuleComponentConfigurationLoaderTestCase extends TestCase { - private ModuleComponentConfigurationLoader loader; - - public void testFoo() throws ConfigurationException { - URL xml = ModuleComponentConfigurationLoaderTestCase.class.getResource("ModuleComponentLoaderTest1.module"); - ModuleComponent moduleComponent = loader.loadModuleComponent("test", "test", xml.toString()); - Assert.assertEquals("test", moduleComponent.getName()); - Module module = moduleComponent.getModuleImplementation(); - Assert.assertEquals("ModuleComponentLoaderTest1", module.getName()); - List components = module.getComponents(); - Assert.assertEquals(1, components.size()); - Component component = components.get(0); - Assert.assertEquals("HelloWorldServiceComponent", component.getName()); - - component = module.getComponent("HelloWorldServiceComponent"); - Assert.assertEquals("HelloWorldServiceComponent", component.getName()); - - ComponentImplementation implementation = component.getComponentImplementation(); - Assert.assertTrue(implementation instanceof JavaScriptImplementationImpl); - } - - protected void setUp() throws Exception { - super.setUp(); - Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); - List scdlLoaders=new ArrayList(); - JavaScriptSCDLModelLoader jsLoader=new JavaScriptSCDLModelLoader(); - scdlLoaders.add(jsLoader); - AssemblyModelLoader modelLoader=new SCDLAssemblyModelLoaderImpl(scdlLoaders); - AssemblyModelContext modelContext=new AssemblyModelContextImpl( - new AssemblyFactoryImpl(), modelLoader,new ResourceLoaderImpl(this.getClass().getClassLoader())); - loader = new ModuleComponentConfigurationLoaderImpl(modelContext); - } -} diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/integration/JSComponentContextTestCase.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/integration/JSComponentContextTestCase.java deleted file mode 100644 index cd29f59327..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/integration/JSComponentContextTestCase.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.integration; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.container.js.assembly.mock.HelloWorldService; -import org.apache.tuscany.container.js.builder.JavaScriptComponentContextBuilder; -import org.apache.tuscany.container.js.builder.JavaScriptTargetWireBuilder; -import org.apache.tuscany.container.js.builder.MockInterceptorBuilder; -import org.apache.tuscany.container.js.invocation.mock.MockSyncInterceptor; -import org.apache.tuscany.container.js.mock.MockAssemblyFactory; -import org.apache.tuscany.container.js.mock.MockModuleFactory; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.builder.impl.DefaultWireBuilder; -import org.apache.tuscany.core.builder.impl.HierarchicalBuilder; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.impl.AggregateContextImpl; -import org.apache.tuscany.core.invocation.jdk.JDKProxyFactoryFactory; -import org.apache.tuscany.core.message.MessageFactory; -import org.apache.tuscany.core.message.impl.MessageFactoryImpl; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.runtime.RuntimeContextImpl; -import org.apache.tuscany.core.system.builder.SystemComponentContextBuilder; -import org.apache.tuscany.core.system.builder.SystemEntryPointBuilder; -import org.apache.tuscany.core.system.builder.SystemExternalServiceBuilder; -import org.apache.tuscany.model.assembly.Scope; - -/** - * Integration tests for JavaScript components and aggregate contexts - * - * @version $Rev$ $Date$ - */ -public class JSComponentContextTestCase extends TestCase { - - public void testBasicInvocation() throws Exception { - MessageFactory msgFactory = new MessageFactoryImpl(); - - List builders = new ArrayList(); - builders.add((new SystemComponentContextBuilder())); - builders.add(new SystemEntryPointBuilder()); - builders.add(new SystemExternalServiceBuilder()); - - JavaScriptComponentContextBuilder javaBuilder = new JavaScriptComponentContextBuilder(); - javaBuilder.setMessageFactory(msgFactory); - javaBuilder.setProxyFactoryFactory(new JDKProxyFactoryFactory()); - - MockSyncInterceptor mockInterceptor = new MockSyncInterceptor(); - MockInterceptorBuilder interceptorBuilder = new MockInterceptorBuilder(mockInterceptor, true); - HierarchicalBuilder refBuilder = new HierarchicalBuilder(); - refBuilder.addBuilder(interceptorBuilder); - javaBuilder.setReferenceBuilder(refBuilder); - builders.add(javaBuilder); - - DefaultWireBuilder defaultWireBuilder = new DefaultWireBuilder(); - - RuntimeContext runtime = new RuntimeContextImpl(null, null, builders, defaultWireBuilder); - runtime.addBuilder(new JavaScriptTargetWireBuilder()); - runtime.start(); - runtime.getRootContext().registerModelObject( - MockAssemblyFactory.createSystemComponent("test.module", AggregateContextImpl.class.getName(), - Scope.AGGREGATE)); - AggregateContext child = (AggregateContext) runtime.getRootContext().getContext("test.module"); - child.registerModelObject(MockModuleFactory.createModule()); - child.fireEvent(EventContext.MODULE_START, null); - HelloWorldService source = (HelloWorldService) child.locateInstance("source/HelloWorldService"); - Assert.assertNotNull(source); - Assert.assertEquals("Hello foo",source.hello("foo")); - //Assert.assertEquals(1, mockInterceptor.getCount()); - child.fireEvent(EventContext.MODULE_STOP, null); - runtime.stop(); - } - -} - diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/invocation/mock/MockHandler.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/invocation/mock/MockHandler.java deleted file mode 100644 index 7064ec5d65..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/invocation/mock/MockHandler.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * - */ -package org.apache.tuscany.container.js.invocation.mock; - -import org.apache.tuscany.core.invocation.MessageHandler; -import org.apache.tuscany.core.message.Message; - -/** - * A test handler - * - * @version $Rev$ $Date$ - */ -public class MockHandler implements MessageHandler { - - private int count =0; - - public boolean processMessage(Message message) { - //System.out.println("Invoking handler"); - count++; - return true; - } - - public int getCount(){ - return count; - } -} diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/invocation/mock/MockSyncInterceptor.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/invocation/mock/MockSyncInterceptor.java deleted file mode 100644 index caab4b3756..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/invocation/mock/MockSyncInterceptor.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.invocation.mock; - -import org.apache.tuscany.core.invocation.Interceptor; -import org.apache.tuscany.core.message.Message; - -/** - * A test interceptor - * - * @version $Rev$ $Date$ - */ -public class MockSyncInterceptor implements Interceptor { - - private int count; - - private Interceptor next; - - public MockSyncInterceptor() { - } - - public Message invoke(Message msg) { - ++count; - //System.out.println("Invoking interceptor"); - return next.invoke(msg); - } - - public int getCount() { - return count; - } - - public void setNext(Interceptor next) { - this.next=next; - } -} - diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/mock/MockAssemblyFactory.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/mock/MockAssemblyFactory.java deleted file mode 100644 index 5cb80b29aa..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/mock/MockAssemblyFactory.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.mock; - -import org.apache.tuscany.container.js.assembly.JavaScriptAssemblyFactory; -import org.apache.tuscany.container.js.assembly.JavaScriptImplementation; -import org.apache.tuscany.container.js.assembly.impl.JavaScriptAssemblyFactoryImpl; -import org.apache.tuscany.core.config.JavaIntrospectionHelper; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.system.assembly.SystemAssemblyFactory; -import org.apache.tuscany.core.system.assembly.SystemImplementation; -import org.apache.tuscany.core.system.assembly.impl.SystemAssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.Service; -import org.apache.tuscany.model.assembly.SimpleComponent; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; -import org.apache.tuscany.model.types.java.JavaServiceContract; - -/** - * Generates test components and module assemblies - * - * @version $Rev: 377775 $ $Date: 2006-02-14 09:18:31 -0800 (Tue, 14 Feb 2006) $ - */ -public class MockAssemblyFactory { - - private static JavaScriptAssemblyFactory factory = new JavaScriptAssemblyFactoryImpl(); - - private static SystemAssemblyFactory systemFactory = new SystemAssemblyFactoryImpl(); - - public static SimpleComponent createComponent(String name, String scriptFile, Class type, Scope scope) { - SimpleComponent sc = factory.createSimpleComponent(); - JavaScriptImplementation impl = factory.createJavaScriptImplementation(); - impl.setComponentType(factory.createComponentType()); - impl.setScriptFile(scriptFile); - sc.setComponentImplementation(impl); - Service s = factory.createService(); - String serviceName = type.getName().substring(type.getName().lastIndexOf('.')+1); - s.setName(serviceName); - JavaServiceContract contract = factory.createJavaServiceContract(); - s.setServiceContract(contract); - contract.setScope(scope); - contract.setInterface(type); - impl.getComponentType().getServices().add(s); - ConfiguredService cService = factory.createConfiguredService(); - cService.setService(s); - cService.initialize(new AssemblyModelContextImpl(null,null)); - sc.getConfiguredServices().add(cService); - sc.setName(name); - sc.setComponentImplementation(impl); - return sc; - } - - public static Component createSystemComponent(String name, String type, Scope scope) throws NoSuchMethodException, - ClassNotFoundException { - Class claz = JavaIntrospectionHelper.loadClass(type); - Component sc = null; - if (AggregateContext.class.isAssignableFrom(claz)) { - sc = systemFactory.createModuleComponent(); - } else { - sc = systemFactory.createSimpleComponent(); - } - SystemImplementation impl = systemFactory.createSystemImplementation(); - impl.setImplementationClass(claz); - sc.setComponentImplementation(impl); - Service s = systemFactory.createService(); - JavaServiceContract ji = systemFactory.createJavaServiceContract(); - s.setServiceContract(ji); - ji.setScope(scope); - impl.setComponentType(systemFactory.createComponentType()); - impl.getComponentType().getServices().add(s); - sc.setName(name); - sc.setComponentImplementation(impl); - return sc; - } - - // public static SimpleComponent createComponent(String name, String scriptFile, String serviceName, ScopeEnum - // scope) - // throws NoSuchMethodException, ClassNotFoundException { - // SimpleComponent sc = new PojoSimpleComponent(); - // PojoJavaScriptImplementation impl = new PojoJavaScriptImplementation(); - // impl.setScriptFile(scriptFile); - // impl.initialize(new AssemblyModelContextImpl()); - // - // sc.setComponentImplementation(impl); - // Service s = new PojoService(); - // s.setName(serviceName.substring(serviceName.lastIndexOf('.') + 1)); - // PojoJavaInterface ji = new PojoJavaInterface(); - // ji.setInterface(serviceName); - // Class claz = JavaIntrospectionHelper.loadClass(serviceName); - // PojoInterfaceType iType = new PojoInterfaceType(); - // iType.setInstanceClass(claz); - // for (Method m : claz.getMethods()) { - // // assume no method overloading - // PojoOperationType type = new PojoOperationType(); - // type.setName(m.getName()); - // for (Class inputType : m.getParameterTypes()) { - // type.setOutputType(new SDOType(null,null,inputType,Collections.EMPTY_LIST)); - // } - // iType.addOperationType(type); - // } - // ji.setInterfaceType(iType); - // - // - // s.setInterfaceContract(ji); - // ji.setScope(scope); - // impl.getServices().add(s); - // sc.setName(name); - // sc.setComponentImplementation(impl); - // PojoConfiguredService cService = new PojoConfiguredService(); - // cService.setService(s); - // sc.getConfiguredServices().add(cService); - // return sc; - // } - // - // public static Component createSystemComponent(String name, String type, ScopeEnum scope) throws - // NoSuchMethodException, - // ClassNotFoundException { - // - // Class claz = JavaIntrospectionHelper.loadClass(type); - // PojoComponent sc = null; - // if (AggregateContext.class.isAssignableFrom(claz)) { - // sc = new PojoAggregateComponent(); - // } else { - // sc = new PojoSimpleComponent(); - // } - // SystemImplementation impl = new PojoSystemImplementation(); - // impl.setClass(type); - // sc.setComponentImplementation(impl); - // Service s = new PojoService(); - // JavaInterface ji = new PojoJavaInterface(); - // s.setInterfaceContract(ji); - // ji.setScope(scope); - // impl.getServices().add(s); - // sc.setName(name); - // sc.setComponentImplementation(impl); - // return sc; - // } - -} diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/mock/MockModuleFactory.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/mock/MockModuleFactory.java deleted file mode 100644 index fe66104000..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/mock/MockModuleFactory.java +++ /dev/null @@ -1,115 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.container.js.mock; - -import org.apache.tuscany.common.resource.impl.ResourceLoaderImpl; -import org.apache.tuscany.container.js.assembly.mock.HelloWorldService; -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.ConfiguredReference; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.Reference; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.Service; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; -import org.apache.tuscany.model.scdl.loader.impl.SCDLAssemblyModelLoaderImpl; -import org.apache.tuscany.model.types.java.JavaServiceContract; - -/** - * Generates mock modules - * - * @version $Rev$ $Date$ - */ -public class MockModuleFactory { - - private static AssemblyFactory factory = new AssemblyFactoryImpl(); - - private static AssemblyModelContext assemblyContext = new AssemblyModelContextImpl(new AssemblyFactoryImpl(), - new SCDLAssemblyModelLoaderImpl(null), new ResourceLoaderImpl(Thread.currentThread().getContextClassLoader())); - - private MockModuleFactory() { - } - - public static Module createModule() throws Exception { - Component sourceComponent = MockAssemblyFactory.createComponent("source", - "org/apache/tuscany/container/js/assembly/mock/HelloWorldImpl.js", HelloWorldService.class, Scope.MODULE); - Component targetComponent = MockAssemblyFactory.createComponent("target", - "org/apache/tuscany/container/js/assembly/mock/HelloWorldImpl.js", HelloWorldService.class, Scope.MODULE); - - Service targetService = factory.createService(); - JavaServiceContract targetContract = factory.createJavaServiceContract(); - targetContract.setInterface(HelloWorldService.class); - targetService.setServiceContract(targetContract); - targetService.setName("GenericComponent"); - ConfiguredService cTargetService = factory.createConfiguredService(); - cTargetService.setService(targetService); - cTargetService.initialize(assemblyContext); - targetComponent.getConfiguredServices().add(cTargetService); - targetComponent.initialize(assemblyContext); - - Reference ref = factory.createReference(); - ConfiguredReference cref = factory.createConfiguredReference(); - ref.setName("setGenericComponent"); - JavaServiceContract inter = factory.createJavaServiceContract(); - inter.setInterface(HelloWorldService.class); - ref.setServiceContract(inter); - cref.setReference(ref); - cref.getTargetConfiguredServices().add(cTargetService); - cref.initialize(assemblyContext); - sourceComponent.getConfiguredReferences().add(cref); - sourceComponent.initialize(assemblyContext); - - Module module = factory.createModule(); - module.setName("test.module"); - module.getComponents().add(sourceComponent); - module.getComponents().add(targetComponent); - module.initialize(assemblyContext); - return module; - } - - // public static Module createModule() throws Exception { - // Component sourceComponent = - // MockAssemblyFactory.createComponent("source","org/apache/tuscany/container/js/assembly/mock/HelloWorldImpl.js",HelloWorldService.class.getCanonicalName(),ScopeEnum.MODULE_LITERAL); - // Component targetComponent = - // MockAssemblyFactory.createComponent("target","org/apache/tuscany/container/js/assembly/mock/HelloWorldImpl.js",HelloWorldService.class.getCanonicalName(),ScopeEnum.MODULE_LITERAL); - // PojoReference ref = new PojoReference(); - // PojoConfiguredReference cref = new PojoConfiguredReference(); - // ref.setName("helloWorld"); - // PojoInterface inter = new PojoJavaInterface(); - // PojoInterfaceType type = new PojoInterfaceType(); - // type.setInstanceClass(HelloWorldService.class); - // PojoOperationType oType = new PojoOperationType(); - // oType.setName("hello"); - // SDOType inputType = new SDOType("String","",String.class,null); - // oType.setInputType(inputType); - // type.addOperationType(oType); - // inter.setInterfaceType(type); - // ref.setInterfaceContract(inter); - // cref.setReference(ref); - // cref.setPart(targetComponent); - // PojoPort port = new PojoPort(); - // port.setName("HelloWorldService"); - // cref.setPort(port); - // sourceComponent.getConfiguredReferences().add(cref); - // PojoModule module = new PojoModule(); - // module.setName("test.module"); - // module.addComponent(sourceComponent); - // module.addComponent(targetComponent); - // return module; - // } - -} diff --git a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/rhino/RhinoInvokerTestCase.java b/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/rhino/RhinoInvokerTestCase.java deleted file mode 100644 index 9269c1cf7e..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/java/org/apache/tuscany/container/js/rhino/RhinoInvokerTestCase.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright 2004,2005 The Apache Software Foundation. - * - * 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. - */ -package org.apache.tuscany.container.js.rhino; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.util.HashMap; -import java.util.Map; - -import junit.framework.TestCase; - -import org.mozilla.javascript.EcmaError; - -/** - * Tests for the RhinoInvoker - */ -public class RhinoInvokerTestCase extends TestCase { - - private static final String scriptName = "RhinoInvokerTestCase.js"; - private String script; - - protected void setUp() throws Exception { - super.setUp(); - this.script = readResource(scriptName); - } - - public void testSimpleInvocation() { - RhinoScript ri = new RhinoScript(scriptName, script); - Object x = ri.invoke("echo", "petra", null); - assertEquals("petra", x); - } - - public void testCopy() { - RhinoScript ri = new RhinoScript(scriptName, script); - Object x = ri.invoke("echo", "petra", null); - assertEquals("petra", x); - - ri = ri.copy(); - x = ri.invoke("echo", "sue", null); - assertEquals("sue", x); - - } - - public void testContexts1() { - RhinoScript ri = new RhinoScript(scriptName, script); - Map contexts = new HashMap(); - contexts.put("a", "petra"); - Object x = ri.invoke("getA", null, contexts); - assertEquals("petra", x); - } - - /** - * Tests context not accessable across invocations - */ - public void testContexts2() { - RhinoScript ri = new RhinoScript(scriptName, script); - Map contexts = new HashMap(); - contexts.put("a", "petra"); - Object x = ri.invoke("getA", null, contexts); - assertEquals("petra", x); - - try { - x = ri.invoke("getA", null, null); - assertTrue("expected ReferenceError", false); - } catch (EcmaError e) { - assertEquals("ReferenceError", e.getName()); - } - } - - /** - * Tests shared scope is accessable across invocations - */ - public void testScopes1() { - RhinoScript ri = new RhinoScript(scriptName, script); - ri.invoke("setGlobalVarY", "petra", null); - - Object x = ri.invoke("getGlobalVarY", null, null); - assertEquals("petra", x); - } - - /** - * Tests local vars are NOT accessable across invocations - */ - public void testScopes2() { - RhinoScript ri = new RhinoScript(scriptName, script); - ri.invoke("setLocalVarY", "petra", null); - - try { - ri.invoke("getGlobalVarY", null, null); - assertTrue("expected ReferenceError", false); - } catch (EcmaError e) { - assertEquals("ReferenceError", e.getName()); - } - } - - /** - * Tests shared scope is accessable when using contexts (ie an invocation scope) - */ - public void testScopes3() { - RhinoScript ri = new RhinoScript(scriptName, script); - ri.invoke("setGlobalVarY", "petra", null); - - Map contexts = new HashMap(); - contexts.put("a", "sue"); - Object x = ri.invoke("getGlobalVarY", null, contexts); - assertEquals("petra", x); - - x = ri.invoke("getA", null, contexts); - assertEquals("sue", x); - - } - - /** - * Tests a copy only retains the script scope not the shared scope - */ - public void testScopes4() { - RhinoScript ri = new RhinoScript(scriptName, script); - ri.invoke("setGlobalVarY", "petra", null); - - ri = ri.copy(); - try { - ri.invoke("getGlobalVarY", null, null); - assertTrue("expected ReferenceError", false); - } catch (EcmaError e) { - assertEquals("ReferenceError", e.getName()); - } - try { - ri.invoke("getA", null, null); - assertTrue("expected ReferenceError", false); - } catch (EcmaError e) { - assertEquals("ReferenceError", e.getName()); - } - - } - - public void testGetInt() { - RhinoScript ri = new RhinoScript(scriptName, script); - Object x = ri.invoke("getInt", null, Integer.TYPE, null); - assertEquals(Integer.class, x.getClass()); - } - - /** - * Read a resource into a String - */ - private String readResource(String name) { - try { - URL url = getClass().getResource(name); - if (url == null) { - throw new RuntimeException("resource not found: " + name); - } - InputStream inputStream = url.openStream(); - - StringBuffer resource = new StringBuffer(); - int n = 0; - - while ((n = inputStream.read()) != -1) { - resource.append((char) n); - } - - inputStream.close(); - - String s = resource.toString(); - return s; - - } catch (IOException e) { - throw new RuntimeException("IOException reading resource " + name, e); - } - } - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/mock/HelloWorldImpl.componentType b/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/mock/HelloWorldImpl.componentType deleted file mode 100644 index 3e9bb5bc28..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/mock/HelloWorldImpl.componentType +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/mock/HelloWorldImpl.js b/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/mock/HelloWorldImpl.js deleted file mode 100644 index 6c5f697040..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/mock/HelloWorldImpl.js +++ /dev/null @@ -1,4 +0,0 @@ - -function hello(name) { - return "Hello " + name; -} diff --git a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/AccountService.wsdl b/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/AccountService.wsdl deleted file mode 100644 index ecd07d3934..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/AccountService.wsdl +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/AccountServiceImpl.componentType b/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/AccountServiceImpl.componentType deleted file mode 100644 index 9f75ba9134..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/AccountServiceImpl.componentType +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/account/AccountService.wsdl b/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/account/AccountService.wsdl deleted file mode 100644 index ecd07d3934..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/account/AccountService.wsdl +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/account/AccountServiceImpl.componentType b/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/account/AccountServiceImpl.componentType deleted file mode 100644 index 9f75ba9134..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/account/AccountServiceImpl.componentType +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.componentType b/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.componentType deleted file mode 100644 index 0217420bea..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.componentType +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/stockquote/StockQuoteServiceImpl.componentType b/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/stockquote/StockQuoteServiceImpl.componentType deleted file mode 100644 index e67876ba35..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/stockquote/StockQuoteServiceImpl.componentType +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl b/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl deleted file mode 100644 index 01df4ef054..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/sca.module b/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/sca.module deleted file mode 100644 index 86f516c128..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/assembly/tests/sca.module +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - AccountServiceComponent - - - - - - EURO - - - AccountDataServiceComponent - StockQuoteService - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/config/ModuleComponentLoaderTest1.module b/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/config/ModuleComponentLoaderTest1.module deleted file mode 100644 index d8e2c425ea..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/config/ModuleComponentLoaderTest1.module +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/rhino/RhinoInvokerTestCase.js b/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/rhino/RhinoInvokerTestCase.js deleted file mode 100644 index 2de740d5f8..0000000000 --- a/tags/java-stable-20060304/sca/container.js/src/test/resources/org/apache/tuscany/container/js/rhino/RhinoInvokerTestCase.js +++ /dev/null @@ -1,22 +0,0 @@ - -function echo(x) { - return x; -} - -function getA(x) { - return a; -} - -function setGlobalVarY(x) { - y = x; -} -function setLocalVarY(x) { - var y = x; -} -function getGlobalVarY(x) { - return y; -} - -function getInt(x) { - return 42; -} diff --git a/tags/java-stable-20060304/sca/core/LICENSE.txt b/tags/java-stable-20060304/sca/core/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/tags/java-stable-20060304/sca/core/LICENSE.txt +++ /dev/null @@ -1,202 +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/tags/java-stable-20060304/sca/core/pom.xml b/tags/java-stable-20060304/sca/core/pom.xml deleted file mode 100644 index 2a4f7d89a1..0000000000 --- a/tags/java-stable-20060304/sca/core/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - org.apache.tuscany - tuscany-sca - SNAPSHOT - - 4.0.0 - tuscany-core - Tuscany Core - Core Tuscany runtime. - SNAPSHOT - - - - org.apache.tuscany - tuscany-model - ${pom.version} - compile - - - - tomcat - servlet-api - 5.0.18 - provided - - - - junit - junit - 3.8.1 - test - - - - - - - org.apache.tuscany - tuscany-sdo-plugin - - - - ${basedir}/src/main/resources/model/tuscany-system.xsd - true - true - true - true - - - generate - - - - - - - - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/addressing/AddressingConstants.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/addressing/AddressingConstants.java deleted file mode 100644 index 8154ad4709..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/addressing/AddressingConstants.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.addressing; - -/** - */ -public interface AddressingConstants { - - String NS_URI = "http://schemas.xmlsoap.org/ws/2004/08/addressing"; - String TO_HEADER_NAME = NS_URI + "#To"; - String FROM_HEADER_NAME = NS_URI + "#From"; - String MESSAGE_ID_HEADER_NAME = NS_URI + "#MessageID"; - String ACTION_HEADER_NAME = NS_URI + "#Action"; - String REPLY_TO_HEADER_NAME = NS_URI + "#ReplyTo"; - String RELATES_TO_HEADER_NAME = NS_URI + "#RelatesTo"; - String FAULT_TO_HEADER_NAME = NS_URI + "#FaultTo"; - String ENDPOINT_REFERENCE_HEADER_NAME = NS_URI + "#EndpointReference"; - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/addressing/AddressingFactory.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/addressing/AddressingFactory.java deleted file mode 100644 index 878322bc6e..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/addressing/AddressingFactory.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.addressing; - - -/** - * The Factory for the model. - */ -public interface AddressingFactory { - - /** - * Returns a new object of class 'Endpoint Reference'. - */ - EndpointReference createEndpointReference(); - - /** - * Create a new message ID - * - * @return - */ - String createMessageID(); - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/addressing/EndpointReference.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/addressing/EndpointReference.java deleted file mode 100644 index f8ecd34354..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/addressing/EndpointReference.java +++ /dev/null @@ -1,120 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.addressing; - -import java.util.Map; - -import org.apache.tuscany.core.invocation.MessageHandler; -import org.apache.tuscany.model.assembly.ConfiguredPort; - -/** - * A representation of the model object 'Endpoint Reference'. - */ -public interface EndpointReference extends org.osoa.sca.ServiceReference, MessageHandler { - - /** - * Returns the endpoint address. - * - * @return The address. - */ - String getAddress(); - - /** - * Sets the endpoint address. - * - * @param address The address. - */ - void setAddress(String address); - - /** - * Returns the QName of the WSDL portType associated with this endpoint reference. - * - * @return The QName of the portType. - */ - String getPortTypeName(); - - /** - * Sets the QName of the WSDL portType associated with this endpoint reference. - * - * @param qname The QName of the portType. - */ - void setPortTypeName(String qname); - - /** - * Returns the QName of the WSDL service associated with this endpoint reference. - * - * @return The QName of the service. - */ - String getServiceName(); - - /** - * Sets the QName of the WSDL service associated with this endpoint reference. - * - * @param qname The QName of the service. - */ - void setServiceName(String qname); - - /** - * Returns the name of the WSDL port associated with this endpoint reference. - * - * @return The name of the port. - */ - String getPortName(); - - /** - * Sets the name of the WSDL port associated with this endpoint reference. - * - * @param name The name of the port. - */ - void setPortName(String name); - - /** - * Returns the endpoint reference parameters.. - * - * @return The collection of reference parameters. - */ - Map getReferenceParameters(); - - /** - * Returns the configured port corresponding to this endpoint reference. - * - * @return - */ - ConfiguredPort getConfiguredPort(); - - /** - * Returns the configured port corresponding to this endpoint reference. - * - * @return - */ - void setConfiguredPort(ConfiguredPort configuredPort); - - /** - * Returns the message handler associated with this endpoint reference - * - * @return - */ - MessageHandler getMessageHandler(); - - /** - * Sets the message handler associated with this endpoint reference - * - * @param messageHandler - */ - void setMessageHandler(MessageHandler messageHandler); - -} // EndpointReference diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/addressing/impl/AddressingFactoryImpl.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/addressing/impl/AddressingFactoryImpl.java deleted file mode 100644 index 882e3157c2..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/addressing/impl/AddressingFactoryImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.addressing.impl; - -import org.eclipse.emf.ecore.util.EcoreUtil; - -import org.apache.tuscany.core.addressing.AddressingFactory; -import org.apache.tuscany.core.addressing.EndpointReference; - -/** - * A factory for endpoint references. - * - */ -public class AddressingFactoryImpl implements AddressingFactory { - - /** - * Constructor - */ - public AddressingFactoryImpl() { - super(); - } - - /** - * @see org.apache.tuscany.core.addressing.AddressingFactory#createEndpointReference() - */ - public EndpointReference createEndpointReference() { - return new EndpointReferenceImpl(); - } - - /** - * @see org.apache.tuscany.core.addressing.AddressingFactory#createMessageID() - */ - public String createMessageID() { - return EcoreUtil.generateUUID(); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/addressing/impl/EndpointReferenceImpl.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/addressing/impl/EndpointReferenceImpl.java deleted file mode 100644 index f4fbd2036b..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/addressing/impl/EndpointReferenceImpl.java +++ /dev/null @@ -1,182 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.addressing.impl; - -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.core.addressing.EndpointReference; -import org.apache.tuscany.core.invocation.MessageHandler; -import org.apache.tuscany.core.message.Message; -import org.apache.tuscany.model.assembly.ConfiguredPort; - -/** - * An implementation of EndpointReference. - */ -public class EndpointReferenceImpl implements EndpointReference { - - private ConfiguredPort configuredPort; - private MessageHandler messageHandler; - private String address; - private String portTypeName; - private String portName; - private String serviceName; - private Map referenceParameters; - - /** - * @see org.apache.tuscany.core.addressing.EndpointReference#getAddress() - */ - public String getAddress() { - return address; - } - - /** - * @see org.apache.tuscany.core.addressing.EndpointReference#setAddress(java.lang.String) - */ - public void setAddress(String value) { - this.address=value; - } - - /** - * @see org.apache.tuscany.core.addressing.EndpointReference#getPortTypeName() - */ - public String getPortTypeName() { - return portTypeName; - } - - /** - * @see org.apache.tuscany.core.addressing.EndpointReference#setPortTypeName(java.lang.String) - */ - public void setPortTypeName(String value) { - this.portTypeName=value; - } - - /** - * @see org.apache.tuscany.core.addressing.EndpointReference#getServiceName() - */ - public String getServiceName() { - return serviceName; - } - - /** - * @see org.apache.tuscany.core.addressing.EndpointReference#getPortName() - */ - public String getPortName() { - return portName; - } - - /** - * @see org.apache.tuscany.core.addressing.EndpointReference#setServiceName(java.lang.String) - */ - public void setServiceName(String value) { - this.serviceName=value; - } - - /** - * @see org.apache.tuscany.core.addressing.EndpointReference#setPortName(java.lang.String) - */ - public void setPortName(String portName) { - this.portName=portName; - } - - /** - * @see org.apache.tuscany.core.addressing.EndpointReference#getReferenceParameters() - */ - public Map getReferenceParameters() { - if (referenceParameters==null) - referenceParameters=new HashMap(); - return referenceParameters; - } - - /** - * @see org.apache.tuscany.core.addressing.EndpointReference#getConfiguredPort() - */ - public ConfiguredPort getConfiguredPort() { - return configuredPort; - } - - /** - * @see org.apache.tuscany.core.addressing.EndpointReference#setConfiguredPort(org.apache.tuscany.model.assembly.ConfiguredPort) - */ - public void setConfiguredPort(ConfiguredPort configuredPort) { - this.configuredPort = configuredPort; - } - - /** - * @see org.apache.tuscany.core.addressing.EndpointReference#getMessageHandler() - */ - public MessageHandler getMessageHandler() { - return messageHandler; - } - - /** - * @see org.apache.tuscany.core.addressing.EndpointReference#setMessageHandler(org.apache.tuscany.core.invocation.MessageHandler) - */ - public void setMessageHandler(MessageHandler messageHandler) { - this.messageHandler = messageHandler; - } - - /** - * @see org.osoa.sca.ServiceReference#getSessionID() - */ - public Object getSessionID() { - throw new UnsupportedOperationException(); - } - - /** - * @see org.osoa.sca.ServiceReference#endSession() - */ - public void endSession() { - throw new UnsupportedOperationException(); - } - - /** - * @see org.osoa.sca.ServiceReference#getCallbackID() - */ - public Object getCallbackID() { - throw new UnsupportedOperationException(); - } - - /** - * @see org.osoa.sca.ServiceReference#setCallbackID(java.lang.Object) - */ - public void setCallbackID(Object callbackID) { - throw new UnsupportedOperationException(); - } - - /** - * @see org.osoa.sca.ServiceReference#getCallback() - */ - public Object getCallback() { - throw new UnsupportedOperationException(); - } - - /** - * @see org.osoa.sca.ServiceReference#setCallback(java.lang.Object) - */ - public void setCallback(Object callback) { - throw new UnsupportedOperationException(); - } - - /** - * @see org.apache.tuscany.core.invocation.MessageHandler#processMessage(org.apache.tuscany.core.message.Message) - */ - public boolean processMessage(Message message) { - return messageHandler.processMessage(message); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/BuilderConfigException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/BuilderConfigException.java deleted file mode 100644 index 04b7b69cf5..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/BuilderConfigException.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.apache.tuscany.core.builder; - -/** - * Represents an error processing a logical configuration model - * - * @version $Rev$ $Date$ - */ -public class BuilderConfigException extends BuilderException { - - public BuilderConfigException() { - super(); - } - - public BuilderConfigException(String message) { - super(message); - } - - public BuilderConfigException(String message, Throwable cause) { - super(message, cause); - } - - public BuilderConfigException(Throwable cause) { - super(cause); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/BuilderException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/BuilderException.java deleted file mode 100644 index 246f188988..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/BuilderException.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.builder; - -import org.apache.tuscany.core.context.CoreRuntimeException; - -/** - * The root exception for the builder package. Builder exceptions denote a non-recoverable failure. - * - * @version $Rev$ $Date$ - */ -public abstract class BuilderException extends CoreRuntimeException { - - public BuilderException() { - super(); - } - - public BuilderException(String message) { - super(message); - } - - public BuilderException(String message, Throwable cause) { - super(message, cause); - } - - public BuilderException(Throwable cause) { - super(cause); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/BuilderInitException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/BuilderInitException.java deleted file mode 100644 index cd57eaf7ab..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/BuilderInitException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.builder; - -/** - * Denotes an exception initializing a builder - * - * @version $Rev$ $Date$ - */ -public class BuilderInitException extends BuilderException { - - public BuilderInitException() { - super(); - } - - public BuilderInitException(String message, Throwable cause) { - super(message, cause); - } - - public BuilderInitException(String message) { - super(message); - } - - public BuilderInitException(Throwable cause) { - super(cause); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/ConfigurationException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/ConfigurationException.java deleted file mode 100644 index 70a31c34c6..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/ConfigurationException.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.apache.tuscany.core.builder; - -/** - * Represents an error processing a logical configuration model - * - * @version $Rev$ $Date$ - */ -public class ConfigurationException extends BuilderException { - - public ConfigurationException() { - super(); - } - - public ConfigurationException(String message) { - super(message); - } - - public ConfigurationException(String message, Throwable cause) { - super(message, cause); - } - - public ConfigurationException(Throwable cause) { - super(cause); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/ContextCreationException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/ContextCreationException.java deleted file mode 100644 index 24b526371d..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/ContextCreationException.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.builder; - - -/** - * Denotes an exception creating an instance context - * - * @version $Rev$ $Date$ - */ -public class ContextCreationException extends BuilderException { - - public ContextCreationException() { - super(); - } - - public ContextCreationException(String message) { - super(message); - } - - public ContextCreationException(String message, Throwable cause) { - super(message, cause); - } - - public ContextCreationException(Throwable cause) { - super(cause); - } - -} - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/HierarchicalWireBuilder.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/HierarchicalWireBuilder.java deleted file mode 100644 index ace34a1ad5..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/HierarchicalWireBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.builder; - -/** - * A wire builder that delegates to child wire builders - * - * @version $Rev$ $Date$ - */ -public interface HierarchicalWireBuilder extends WireBuilder{ - - /** - * Registers a child wire builder - */ - public void addWireBuilder(WireBuilder builder); - -} - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/NoAccessorException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/NoAccessorException.java deleted file mode 100644 index 34b6294638..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/NoAccessorException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.builder; - -/** - * Denotes an attempt to access a non-existent field or method - * - * @version $Rev$ $Date$ - */ -public class NoAccessorException extends BuilderException { - - public NoAccessorException() { - super(); - } - - public NoAccessorException(String message) { - super(message); - } - - public NoAccessorException(String message, Throwable cause) { - super(message, cause); - } - - public NoAccessorException(Throwable cause) { - super(cause); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/ObjectFactory.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/ObjectFactory.java deleted file mode 100644 index 7d27df4ebd..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/ObjectFactory.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.apache.tuscany.core.builder; - -import org.apache.tuscany.core.injection.ObjectCreationException; - -/** - * Implementations create new instances of a particular type - * - * @version $Rev$ $Date$ - */ -public interface ObjectFactory { - - /** - * Return a instance of the type that this factory creates. - * - * @return a instance from this factory - */ - T getInstance() throws ObjectCreationException; - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/RuntimeConfiguration.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/RuntimeConfiguration.java deleted file mode 100644 index 79396e6052..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/RuntimeConfiguration.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.apache.tuscany.core.builder; - -import java.util.Map; - -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.model.assembly.Scope; - -/** - * Implementations create instances of {@link org.apache.tuscany.core.context.Context} based on a compiled - * configuration, such as a logical assembly model. For example, implementations of - * {@link org.apache.tuscany.core.builder.RuntimeConfigurationBuilder} analyze an - * {@link org.apache.tuscany.model.assembly.AssemblyModelObject} to create implementations of - * RuntimeConfiguration. - * - * @version $Rev$ $Date$ - */ -public interface RuntimeConfiguration { - - /** - * Creates an instance context based on the current runtime configuration - * - * @return a new instance context - * @throws ContextCreationException if an error occurs creating the context - */ - public T createInstanceContext() throws ContextCreationException; - - /** - * Returns the scope identifier associated with the type of contexts produced by the current configuration - */ - public Scope getScope(); - - /** - * Returns the name of the contexts produced by the current configuration - */ - public String getName(); - - public void prepare(); - - /** - * Adds a target-side proxy factory for the given service name to the configuration. Target-side proxy factories - * contain the invocation chains associated with the destination service of a wire and are responsible for - * generating proxies - */ - public void addTargetProxyFactory(String serviceName, ProxyFactory factory); - - /** - * Returns the target-side proxy factory associated with the given service name - */ - public ProxyFactory getTargetProxyFactory(String serviceName); - - /** - * Returns a collection of target-side proxy factories for the configuration keyed by service name - */ - public Map getTargetProxyFactories(); - - /** - * Adds a source-side proxy factory for the given reference. Source-side proxy factories contain the invocation - * chains for a reference in the component implementation associated with the instance context created by this - * configuration. Source-side proxy factories also produce proxies that are injected on a reference in a component - * implementation. - */ - public void addSourceProxyFactory(String referenceName, ProxyFactory factory); - - public ProxyFactory getSourceProxyFactory(String referenceName); - - public Map getSourceProxyFactories(); - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/RuntimeConfigurationBuilder.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/RuntimeConfigurationBuilder.java deleted file mode 100644 index d797253520..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/RuntimeConfigurationBuilder.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.apache.tuscany.core.builder; - -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.model.assembly.AssemblyModelObject; - -/** - * Implementations are responsible for generating a runtime configuration model from a logical configuration model. The - * logical configuration model (LCM) is decorated with the runtime configuration model (RCM). - * - * @version $Rev$ $Date$ - * @see RuntimeConfiguration - */ -public interface RuntimeConfigurationBuilder { - - /** - * Builds a runtime configuration for the supplied model object for registration under the supplied context. - * - * @param object the logical configuration model node - * @param context the context that will be the parent of the built context - * @throws BuilderException - */ - public void build(AssemblyModelObject object, Y context) throws BuilderException; - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/UnknownTypeException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/UnknownTypeException.java deleted file mode 100644 index 015b0ba342..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/UnknownTypeException.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.apache.tuscany.core.builder; - -/** - * Denotes an unknown configuration parameter type - * - * @version $Rev$ $Date$ - */ -public class UnknownTypeException extends BuilderException { - - public UnknownTypeException() { - super(); - } - - public UnknownTypeException(String message) { - super(message); - } - - public UnknownTypeException(String message, Throwable cause) { - super(message, cause); - } - - public UnknownTypeException(Throwable cause) { - super(cause); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/WireBuilder.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/WireBuilder.java deleted file mode 100644 index 6f0cf9ce14..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/WireBuilder.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.builder; - -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; - -/** - * Responsible for finalizing target-side proxy factories and bridging - * {@link org.apache.tuscany.core.invocation.InvocationConfiguration}s held by source- and target-side proxy factories. - *

- * Wire builders may optimize the invocation chains based on certain characteristics of th wire, such as source and - * target scopes. - * - * @version $Rev$ $Date$ - */ -public interface WireBuilder { - - /** - * Connects invocation configurations of the source proxy factory to corresponding ones in the target proxy to - * factory - * - * @param sourceFactory the proxy factory used in constructing the source side of the invocation chain - * @param targetFactory the proxy factory used in constructing the target side of the invocation chain - * @param targetType the context type of the target. Used to determine if a paricular wire builder should construct - * the wire - * @param downScope true if the component containing the reference (source side) is of a lesser scope than the - * target service - * @param targetScopeContext the scope context responsible for managing intance contexts of the target component - * type - * @throws BuilderConfigException if an error occurs during the wire build process - */ - public void connect(ProxyFactory sourceFactory, ProxyFactory targetFactory, Class targetType, boolean downScope, - ScopeContext targetScopeContext) throws BuilderConfigException; - - /** - * Finishes processing the target side invocation chain. For example, a - * {@link org.apache.tuscany.core.invocation.TargetInvoker} used by target-side proxies is usually set during this - * phase. - * - * @param targetFactory the target-side proxy factory - * @param targetType the target context type - * @param targetScopeContext the target scope - * @throws BuilderConfigException if an error occurs during the wire build process - */ - public void completeTargetChain(ProxyFactory targetFactory, Class targetType, ScopeContext targetScopeContext) - throws BuilderConfigException; - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/AssemblyVisitor.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/AssemblyVisitor.java deleted file mode 100644 index 20e9143537..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/AssemblyVisitor.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.builder.impl; - -import java.util.List; - -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.assembly.AssemblyModelVisitor; - -/** - * Decorates an assembly object graph with runtime configurations using a set of builders - * - * @version $Rev$ $Date$ - */ -public class AssemblyVisitor implements AssemblyModelVisitor { - - private AggregateContext parent; - - List builders; - - /** - * Constructs a visitor - * - * @param parent the parent context for the object graph - * @param builders the collection of builders for creating runtime configurations - */ - public AssemblyVisitor(AggregateContext parent, List builders) { - this.parent = parent; - this.builders = builders; - } - - /** - * Initiate walking the object graph - */ - public boolean start(AssemblyModelObject modelObject) { - return modelObject.accept(this); - } - - /** - * Callback when walking the graph - */ - public boolean visit(AssemblyModelObject modelObject) { - for (RuntimeConfigurationBuilder builder : builders) { - builder.build(modelObject, parent); - } - return true; - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/BaseExternalServiceRuntimeConfiguration.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/BaseExternalServiceRuntimeConfiguration.java deleted file mode 100644 index ce092a7d34..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/BaseExternalServiceRuntimeConfiguration.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.builder.impl; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.core.builder.ContextCreationException; -import org.apache.tuscany.core.builder.ObjectFactory; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.ExternalServiceContext; -import org.apache.tuscany.core.context.impl.ExternalServiceContextImpl; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.model.assembly.Scope; - -/** - * A template implementation that creates instances of {@link org.apache.tuscany.core.context.ExternalServiceContext} - * configured with the appropriate invocation chains and bindings. This class is intended to be subclassed when - * contributing new bindings to the runtime. The subclass serves as a marker so the binding {@link WireBuilder} - * responsible for setting the proper {@link org.apache.tuscany.core.invocation.TargetInvoker} on the invocation chains - * can be notified. - * - * @version $Rev$ $Date$ - */ -public abstract class BaseExternalServiceRuntimeConfiguration implements RuntimeConfiguration { - - private String name; - - private ProxyFactory proxyFactory; - - private ObjectFactory objectFactory; - - private String targetServiceName; - - private Map targetProxyFactories; - - public BaseExternalServiceRuntimeConfiguration(String name, ObjectFactory objectFactory) { - assert (name != null) : "Name was null"; - assert (objectFactory != null) : "Object factory was null"; - this.name = name; - this.objectFactory = objectFactory; - } - - public ExternalServiceContext createInstanceContext() throws ContextCreationException { - return new ExternalServiceContextImpl(name, proxyFactory, objectFactory); - } - - public Scope getScope() { - return Scope.MODULE; - } - - public String getName() { - return name; - } - - public void prepare() { - } - - public void addTargetProxyFactory(String serviceName, ProxyFactory factory) { - assert (serviceName != null) : "No service name specified"; - assert (factory != null) : "Proxy factory was null"; - this.targetServiceName = serviceName; // external services are configured with only one service - this.proxyFactory = factory; - } - - public ProxyFactory getTargetProxyFactory(String serviceName) { - if (this.targetServiceName.equals(serviceName)) { - return proxyFactory; - } else { - return null; - } - } - - public Map getTargetProxyFactories() { - if (targetProxyFactories == null) { - targetProxyFactories = new HashMap(1); - targetProxyFactories.put(targetServiceName, proxyFactory); - } - return targetProxyFactories; - } - - public void addSourceProxyFactory(String referenceName, ProxyFactory factory) { - // no wires inside an aggregate from an external service - } - - public ProxyFactory getSourceProxyFactory(String referenceName) { - return null; - } - - public Map getSourceProxyFactories() { - return Collections.EMPTY_MAP; - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/DefaultWireBuilder.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/DefaultWireBuilder.java deleted file mode 100644 index 6ed5472a64..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/DefaultWireBuilder.java +++ /dev/null @@ -1,110 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.builder.impl; - -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.core.builder.BuilderConfigException; -import org.apache.tuscany.core.builder.HierarchicalWireBuilder; -import org.apache.tuscany.core.builder.WireBuilder; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.impl.InvokerInterceptor; -import org.apache.tuscany.core.invocation.impl.MessageChannelImpl; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; - -/** - * The top-most wire builder configured in a runtime. Responsible for constructing wires from source and target chains, - * this implementation first bridges the chains and then delegates to any other wire builders. - * - * @version $Rev$ $Date$ - */ -public class DefaultWireBuilder implements HierarchicalWireBuilder { - - // collection configured wire builders - private List builders = new ArrayList(); - - public DefaultWireBuilder() { - } - - /** - * Adds a wire builder to delegate to - */ - public void addWireBuilder(WireBuilder builder) { - builders.add(builder); - } - - public void setWireBuilders(List builders) { - builders.addAll(builders); - } - - public void connect(ProxyFactory sourceFactory, ProxyFactory targetFactory, Class targetType, boolean downScope, - ScopeContext targetScopeContext) { - QualifiedName targetName = sourceFactory.getProxyConfiguration().getTargetName(); - // get the proxy chain for the target - if (targetFactory != null) { - // if null, the target side has no interceptors or handlers - Map targetInvocationConfigs = targetFactory.getProxyConfiguration() - .getInvocationConfigurations(); - for (InvocationConfiguration sourceInvocationConfig : sourceFactory.getProxyConfiguration() - .getInvocationConfigurations().values()) { - // match invocation chains - InvocationConfiguration targetInvocationConfig = targetInvocationConfigs.get(sourceInvocationConfig.getMethod()); - // if handler is configured, add that - if (targetInvocationConfig.getRequestHandlers() != null) { - sourceInvocationConfig.setTargetRequestChannel(new MessageChannelImpl(targetInvocationConfig - .getRequestHandlers())); - sourceInvocationConfig.setTargetResponseChannel(new MessageChannelImpl(targetInvocationConfig - .getResponseHandlers())); - } else { - // no handlers, just connect interceptors - if (targetInvocationConfig.getTargetInterceptor() == null) { - BuilderConfigException e = new BuilderConfigException("No target handler or interceptor for operation"); - e.setIdentifier(targetInvocationConfig.getMethod().getName()); - throw e; - } - if (!(sourceInvocationConfig.getLastTargetInterceptor() instanceof InvokerInterceptor && targetInvocationConfig - .getTargetInterceptor() instanceof InvokerInterceptor)) { - // check that we do not have the case where the only interceptors are invokers since we just need one - sourceInvocationConfig.addTargetInterceptor(targetInvocationConfig.getTargetInterceptor()); - } - } - } - } - // delegate to other wire builders - for (WireBuilder builder : builders) { - builder.connect(sourceFactory, targetFactory, targetType, downScope, targetScopeContext); - } - // signal that wire build process is complete - boolean optimizable = true; - for (InvocationConfiguration sourceInvocationConfig : sourceFactory.getProxyConfiguration().getInvocationConfigurations() - .values()) { - sourceInvocationConfig.build(); - // TODO optimize if no proxy needed using NullProxyFactory - } - } - - public void completeTargetChain(ProxyFactory targetFactory, Class targetType, ScopeContext targetScopeContext) - throws BuilderConfigException { - // delegate to other wire builders - for (WireBuilder builder : builders) { - builder.completeTargetChain(targetFactory, targetType, targetScopeContext); - } - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/EntryPointRuntimeConfiguration.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/EntryPointRuntimeConfiguration.java deleted file mode 100644 index 108cc2d366..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/EntryPointRuntimeConfiguration.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.builder.impl; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.core.builder.ContextCreationException; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.EntryPointContext; -import org.apache.tuscany.core.context.impl.EntryPointContextImpl; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.message.MessageFactory; -import org.apache.tuscany.model.assembly.Scope; - -/** - * Produces entry point contexts - * - * @version $Rev$ $Date$ - */ -public abstract class EntryPointRuntimeConfiguration implements RuntimeConfiguration { - - private String name; - - private ProxyFactory proxyFactory; - - private String referenceName; - - private MessageFactory msgFactory; - - private Map sourceProxyFactories; - - public EntryPointRuntimeConfiguration(String name, String referenceName, MessageFactory msgFactory) { - assert (name != null) : "Entry point name was null"; - assert (msgFactory != null) : "Message factory was null"; - this.name = name; - this.referenceName = referenceName; - this.msgFactory = msgFactory; - } - - public EntryPointContext createInstanceContext() throws ContextCreationException { - return new EntryPointContextImpl(name, proxyFactory, msgFactory); - } - - public Scope getScope() { - return Scope.MODULE; - } - - public String getName() { - return name; - } - - public void prepare() { - } - - public void addTargetProxyFactory(String serviceName, ProxyFactory factory) { - // no wires to an entry point from with an aggregate - } - - public ProxyFactory getTargetProxyFactory(String serviceName) { - // no wires to an entry point from with an aggregate - return null; - } - - public Map getTargetProxyFactories() { - // no wires to an entry point from with an aggregate - return Collections.EMPTY_MAP; - } - - public void addSourceProxyFactory(String refName, ProxyFactory factory) { - assert (refName != null) : "No reference name specified"; - assert (factory != null) : "Proxy factory was null"; - this.referenceName = refName; // entry points are configured with only one reference - this.proxyFactory = factory; - } - - public ProxyFactory getSourceProxyFactory(String refName) { - if (this.referenceName.equals(refName)) { - return proxyFactory; - } else { - return null; - } - } - - public Map getSourceProxyFactories() { - if (sourceProxyFactories == null) { - sourceProxyFactories = new HashMap(1); - sourceProxyFactories.put(referenceName, proxyFactory); - } - return sourceProxyFactories; - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/HierarchicalBuilder.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/HierarchicalBuilder.java deleted file mode 100644 index 41f56c1bf0..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/HierarchicalBuilder.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.builder.impl; - -import java.util.Collections; -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; - -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.model.assembly.AssemblyModelObject; - -/** - * A builder that contains nested builders. Used for synchronizing parts of the build process, such as references. - * - * @version $Rev$ $Date$ - */ -public class HierarchicalBuilder implements RuntimeConfigurationBuilder { - private List builders = new CopyOnWriteArrayList(); - - private List readOnlyBuilders = Collections.unmodifiableList(builders); - - public HierarchicalBuilder() { - } - - public void addBuilder(RuntimeConfigurationBuilder builder) { - builders.add(builder); - } - - public void removeBuilder(RuntimeConfigurationBuilder builder){ - builders.remove(builder); - } - - public List getBuilders(){ - return readOnlyBuilders; - } - - public void build(AssemblyModelObject object, Context context) throws BuilderException { - for (RuntimeConfigurationBuilder builder : builders) { - builder.build(object, context); - } - - } - - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/ProxyObjectFactory.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/ProxyObjectFactory.java deleted file mode 100644 index c5d3b56034..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/impl/ProxyObjectFactory.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.builder.impl; - -import org.apache.tuscany.core.builder.ObjectFactory; -import org.apache.tuscany.core.injection.ObjectCreationException; -import org.apache.tuscany.core.invocation.spi.ProxyCreationException; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; - -/** - * Uses a proxy factory to return an object instance - * - * @version $Rev$ $Date$ - */ -public class ProxyObjectFactory implements ObjectFactory { - - private ProxyFactory factory; - - public ProxyObjectFactory(ProxyFactory factory) { - this.factory = factory; - } - - public Object getInstance() throws ObjectCreationException { - try { - return factory.createProxy(); - } catch (ProxyCreationException e) { - throw new ObjectCreationException(e); - } - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/client/TuscanyRuntime.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/client/TuscanyRuntime.java deleted file mode 100644 index 629f3ac0c2..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/client/TuscanyRuntime.java +++ /dev/null @@ -1,204 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.client; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.common.monitor.MonitorFactory; -import org.apache.tuscany.common.monitor.impl.NullMonitorFactory; -import org.apache.tuscany.common.resource.ResourceLoader; -import org.apache.tuscany.common.resource.impl.ResourceLoaderImpl; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.builder.impl.DefaultWireBuilder; -import org.apache.tuscany.core.config.ConfigurationException; -import org.apache.tuscany.core.config.ModuleComponentConfigurationLoader; -import org.apache.tuscany.core.config.impl.ModuleComponentConfigurationLoaderImpl; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.CoreRuntimeException; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.runtime.RuntimeContextImpl; -import org.apache.tuscany.core.system.builder.SystemComponentContextBuilder; -import org.apache.tuscany.core.system.builder.SystemEntryPointBuilder; -import org.apache.tuscany.core.system.builder.SystemExternalServiceBuilder; -import org.apache.tuscany.core.system.loader.SystemSCDLModelLoader; -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.ModuleComponent; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; -import org.apache.tuscany.model.assembly.loader.AssemblyModelLoader; -import org.apache.tuscany.model.scdl.loader.SCDLModelLoader; -import org.apache.tuscany.model.scdl.loader.impl.SCDLAssemblyModelLoaderImpl; -import org.osoa.sca.ModuleContext; -import org.osoa.sca.SCA; -import org.osoa.sca.ServiceRuntimeException; - -/** - * Create and initialize a Tuscany SCA runtime environment. - * - * @version $Rev$ $Date$ - */ -public class TuscanyRuntime extends SCA { - private final Monitor monitor; - private final Object sessionKey = new Object(); - - private final RuntimeContext runtimeContext; - private AggregateContext systemModuleComponentContext; - private AggregateContext moduleContext; - - private final static String SYSTEM_MODULE_COMPONENT = "org.apache.tuscany.core.system"; - - /** - * Construct a runtime using a null MonitorFactory. - * - * @param name the name of the module component - * @param uri the URI to assign to the module component - * @throws ConfigurationException if there was a problem loading the SCA configuration - * @see TuscanyRuntime#TuscanyRuntime(String, String, org.apache.tuscany.common.monitor.MonitorFactory) - */ - public TuscanyRuntime(String name, String uri) throws ConfigurationException { - this(name, uri, new NullMonitorFactory()); - } - - /** - * Construct a runtime containing a single module component with the - * specified name. The module definition is loaded from a "/sca.module" - * resource found on the classpath of the current Thread context classloader. - * - * @param name the name of the module component - * @param uri the URI to assign to the module component - * @param monitorFactory the MonitorFactory for this runtime - * @throws ConfigurationException if there was a problem loading the SCA configuration - */ - public TuscanyRuntime(String name, String uri, MonitorFactory monitorFactory) throws ConfigurationException { - this.monitor = monitorFactory.getMonitor(Monitor.class); - - // Create a resource loader from the current classloader - ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); - ResourceLoader resourceLoader = new ResourceLoaderImpl(classLoader); - - // Create an assembly model factory - AssemblyFactory modelFactory=new AssemblyFactoryImpl(); - - // Create an assembly model loader - List scdlLoaders=new ArrayList(); - scdlLoaders.add(new SystemSCDLModelLoader()); - AssemblyModelLoader modelLoader=new SCDLAssemblyModelLoaderImpl(scdlLoaders); - - // Create an assembly model context - AssemblyModelContext modelContext = new AssemblyModelContextImpl(modelFactory, modelLoader, resourceLoader); - - // Create system configuration builders - List configBuilders = new ArrayList(); - configBuilders.add((new SystemComponentContextBuilder())); - configBuilders.add(new SystemEntryPointBuilder()); - configBuilders.add(new SystemExternalServiceBuilder()); - - // Create a runtime context and start it - runtimeContext = new RuntimeContextImpl(monitorFactory, scdlLoaders, configBuilders,new DefaultWireBuilder()); - runtimeContext.start(); - monitor.started(runtimeContext); - - // Get the system context - AggregateContext systemContext = runtimeContext.getSystemContext(); - - // Load the system module component - ModuleComponentConfigurationLoader loader = new ModuleComponentConfigurationLoaderImpl(modelContext); - ModuleComponent systemModuleComponent = loader.loadSystemModuleComponent(SYSTEM_MODULE_COMPONENT, SYSTEM_MODULE_COMPONENT); - - // Register it with the system context - systemContext.registerModelObject(systemModuleComponent); - - // Get the aggregate context representing the system module component - systemModuleComponentContext = (AggregateContext) systemContext.getContext(SYSTEM_MODULE_COMPONENT); - systemModuleComponentContext.registerModelObject(systemModuleComponent.getComponentImplementation()); - systemModuleComponentContext.fireEvent(EventContext.MODULE_START, null); - - // Load the SCDL configuration of the application module - ModuleComponent moduleComponent = loader.loadModuleComponent(name, uri); - - // Register it under the root application context - runtimeContext.getRootContext().registerModelObject(moduleComponent); - moduleContext=(AggregateContext)runtimeContext.getContext(moduleComponent.getName()); - moduleContext.registerModelObject(moduleComponent.getComponentImplementation()); - - } - - /** - * Start the runtime and associate the module context with the calling thread. - */ - @Override - public void start() { - setModuleContext((ModuleContext)moduleContext); - try { - //moduleContext.start(); - moduleContext.fireEvent(EventContext.MODULE_START, null); - moduleContext.fireEvent(EventContext.REQUEST_START, null); - moduleContext.fireEvent(EventContext.SESSION_NOTIFY, sessionKey); - monitor.started(moduleContext); - } catch (CoreRuntimeException e) { - setModuleContext(null); - monitor.startFailed(moduleContext, e); - //FIXME throw a better exception - throw new ServiceRuntimeException(e); - } - } - - /** - * Disassociate the module context from the current thread and shut down the runtime. - */ - @Override - public void stop() { - setModuleContext(null); - moduleContext.fireEvent(EventContext.REQUEST_END, null); - moduleContext.fireEvent(EventContext.SESSION_END, sessionKey); - moduleContext.fireEvent(EventContext.MODULE_STOP, null); - moduleContext.stop(); - monitor.stopped(moduleContext); - runtimeContext.stop(); - monitor.stopped(runtimeContext); - } - - /** - * Monitor interface for a TuscanyRuntime. - */ - public static interface Monitor { - /** - * Event emitted after the runtime has been started. - * - * @param ctx the runtime's module component context - */ - void started(AggregateContext ctx); - - /** - * Event emitted when an attempt to start the runtime failed. - * - * @param ctx the runtime's module component context - * @param e the exception that caused the failure - */ - void startFailed(AggregateContext ctx, CoreRuntimeException e); - - /** - * Event emitted after the runtime has been stopped. - * - * @param ctx the runtime's module component context - */ - void stopped(AggregateContext ctx); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/ComponentTypeIntrospector.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/ComponentTypeIntrospector.java deleted file mode 100644 index c80a8f31ba..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/ComponentTypeIntrospector.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.config; - -import org.apache.tuscany.model.assembly.ComponentType; - -/** - * Interface for implementations that are able create SCA definitions - * by inspecting Java classes. - * - * @version $Rev$ $Date$ - */ -public interface ComponentTypeIntrospector { - /** - * Create a componentType definition by introspecting a Java Class. - * - * @param implClass the class to inspect - * @return a componentType definition - * @throws ConfigurationException if the Class does not define a valid component type - */ - ComponentType introspect(Class implClass) throws ConfigurationException; - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/ConfigurationException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/ConfigurationException.java deleted file mode 100644 index 96365311f2..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/ConfigurationException.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.config; - -import org.apache.tuscany.common.TuscanyException; - - -/** - * Base class for exceptions that pertain to configuration. - * - * @version $Rev$ $Date$ - */ -public class ConfigurationException extends TuscanyException { - public ConfigurationException() { - } - - public ConfigurationException(String message) { - super(message); - } - - public ConfigurationException(String message, Throwable cause) { - super(message, cause); - } - - public ConfigurationException(Throwable cause) { - super(cause); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/ConfigurationLoadException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/ConfigurationLoadException.java deleted file mode 100644 index 3055dc2fd2..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/ConfigurationLoadException.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.config; - -import java.io.IOException; - -/** - * Exception indicating that there was a problem loading a configuration resource. - * - * @version $Rev$ $Date$ - */ -public class ConfigurationLoadException extends ConfigurationException { - - /** - * Constructor specifying the resource that was being loaded and the IOException that resulted. - * These are returned as the message and cause respectively. - * - * @param resource the resource being loaded - * @param cause the IOException that occurred - */ - public ConfigurationLoadException(String resource, IOException cause) { - super(resource, cause); - } - - /** - * Constructor specifying the resource that was being loaded. - * - * @param resource the resource being loaded - */ - public ConfigurationLoadException(String resource) { - super(resource); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/ImplementationCache.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/ImplementationCache.java deleted file mode 100644 index 595f499797..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/ImplementationCache.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.config; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.model.assembly.ComponentImplementation; - -/** - * Cache of introspected implementations. - * - * @version $Rev$ $Date$ - */ -public interface ImplementationCache { - /** - * Return an implementation from a given namespace. - * - * @param type the namespace that defines the type of implementation - * @param name the name of an implementation in that namespace - * @return the implementation or null if it is not present in the cache - */ - ComponentImplementation get(QName type, String name); - - /** - * Add an implementation to the cache - * - * @param type the namespace that defines the type of implementation - * @param name the name of an implementation in that namespace - * @param implementation the introspected implementation - */ - void put(QName type, String name, ComponentImplementation implementation); -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/InvalidRootElementException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/InvalidRootElementException.java deleted file mode 100644 index 19df4784cd..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/InvalidRootElementException.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.config; - -/** - * Configuration exception that indicates the root element in an XML file was not the one expected. - * - * @version $Rev$ $Date$ - */ -public class InvalidRootElementException extends ConfigurationException { - private final String resource; - private final String element; - - /** - * Constructor specifying the location of the resource and the element that was expected. - * - * @param resource the resource - * @param element the expected root element - */ - public InvalidRootElementException(String resource, String element) { - super(); - this.resource = resource; - this.element = element; - } - - public String getMessage() { - return "XML document element in resource " + resource + " is not a " + element; - } - - public String getResource() { - return resource; - } - - public String getElement() { - return element; - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/JavaIntrospectionHelper.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/JavaIntrospectionHelper.java deleted file mode 100644 index c10ff82310..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/JavaIntrospectionHelper.java +++ /dev/null @@ -1,349 +0,0 @@ -package org.apache.tuscany.core.config; - -import java.lang.reflect.AccessibleObject; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -/** - * Implements various reflection-related operations - * - * @version $Rev$ $Date$ - */ -public class JavaIntrospectionHelper { - - private static final Class[] EMPTY_CLASS_ARRY = new Class[0]; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - /** - * Hide the constructor - */ - private JavaIntrospectionHelper() { - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - /** - * Returns a collection of public, private, protected, or default fields declared by a class or one of its - * supertypes - */ - public static Set getAllFields(Class pClass) { - return getAllFields(pClass, new HashSet()); - } - - /** - * Recursively evaluates the type hierachy to return all fields on a given type - * - * @spec This raises an interesting issue - do we allow injection on private supertype fields in a subtype even if - * they are annotated? - */ - private static Set getAllFields(Class pClass, Set fields) { - if (pClass == null || pClass.isArray() || Object.class.equals(pClass)) { - return fields; - } - fields = getAllFields(pClass.getSuperclass(), fields); - Field[] declaredFields = pClass.getDeclaredFields(); - for (int i = 0; i < declaredFields.length; i++) { - declaredFields[i].setAccessible(true); // ignore Java accessibility - fields.add(declaredFields[i]); - } - return fields; - } - - /** - * Returns a collection of public, private, protected, or default methods declared by a class or one of its - * supertypes. Note that overriden methods will not be returned in the collection (i.e. only the method override - * will be).

This method can potentially be expensive as reflection information is not cached. It is assumed - * that this method will be used during a configuration phase. - */ - public static Set getAllUniqueMethods(Class pClass) { - return getAllUniqueMethods(pClass, new HashSet()); - } - - /** - * Recursively evaluates the type hierarchy to return all unique methods - */ - private static Set getAllUniqueMethods(Class pClass, Set methods) { - if (pClass == null || pClass.isArray() || Object.class.equals(pClass)) { - return methods; - } - // we first evaluate methods of the subclass and then move to the parent - Method[] declaredMethods = pClass.getDeclaredMethods(); - for (int i = 0; i < declaredMethods.length; i++) { - if (methods.size() == 0) { - methods.add(declaredMethods[i]); - } else { - List temp = new ArrayList(); - boolean matched = false; - for (Method method : methods) { - // only add if not already in the set from a supclass (i.e. the - // method is not overrided) - if (exactMethodMatch(declaredMethods[i], method)) { - matched = true; - break; - } - } - if (!matched) { - // TODO ignore Java accessibility - declaredMethods[i].setAccessible(true); - temp.add(declaredMethods[i]); - - } - methods.addAll(temp); - temp.clear(); - } - } - // evaluate class hierarchy - this is done last to track inherited methods - methods = getAllUniqueMethods(pClass.getSuperclass(), methods); - return methods; - } - - /** - * Finds the closest matching field with the given name, that is, a field of the exact specified type or, - * alternately, of a supertype. - * - * @param name the name of the field - * @param type the field type - * @param fields the collection of fields to search - * @return the matching field or null if not found - * @throws NoSuchFieldException if no field found - */ - public static Field findClosestMatchingField(String name, Class type, Set fields) { - Field candidate = null; - for (Field field : fields) { - if (field.getName().equals(name)) { - if (field.getType().equals(type)) { - return field; // exact match - } else if (field.getType().isAssignableFrom(type) - || (field.getType().isPrimitive() && primitiveAssignable(field.getType(), type))) { - // We could have the situation where a field parameter is a primitive and the demarshalled value is - // an object counterpart (e.g. Integer and int) - // @spec issue - // either an interface or super class, so keep a reference until - // we know there are no closer types - candidate = field; - } - } - } - if (candidate != null) { - return candidate; - } else { - return null; - } - } - - /** - * Finds the closest matching method with the given name, that is, a method taking the exact parameter types or, - * alternately, parameter supertypes. - * - * @param name the name of the method - * @param types the method parameter types - * @param methods the collection of methods to search - * @return the matching method or null if not found - * @throws NoSuchFieldException if no field found - */ - public static Method findClosestMatchingMethod(String name, Class[] types, Set methods) { - if (types == null) { - types = EMPTY_CLASS_ARRY; - } - Method candidate = null; - for (Method method : methods) { - if (method.getName().equals(name) && method.getParameterTypes().length == types.length) { - Class[] params = method.getParameterTypes(); - boolean disqualify = false; - boolean exactMatch = true; - for (int i = 0; i < params.length; i++) { - if (!params[i].equals(types[i]) && !params[i].isAssignableFrom(types[i])) { - // no match - disqualify = true; - exactMatch = false; - break; - } else if (!params[i].equals(types[i]) && params[i].isAssignableFrom(types[i])) { - // not exact match - exactMatch = false; - } - } - if (disqualify) { - continue; - } else if (exactMatch) { - return method; - } else { - candidate = method; - } - } - } - if (candidate != null) { - return candidate; - } else { - return null; - } - } - - /** - * Returns a field or method defined in the given class or its superclasses matching a literal name and parameter - * types

This method can potentially be expensive as reflection information is not cached. It is assumed that - * this method will be used during a configuration phase. - * - * @param clazz the class to introspect - * @param propertName the literal name of the property (i.e. JavaBean conventions are not applied) - * @param paramTypes the parameter types for a method or null for fields or methods with no parameters - * @return the field, method or null - */ - public static AccessibleObject getBeanProperty(Class clazz, String propertName, Class[] paramTypes) { - - Set methods = getAllUniqueMethods(clazz); - for (Method method : methods) { - if (method.getName().equals(propertName)) { - Class[] types = method.getParameterTypes(); - if (types.length == 0 && paramTypes == null) { - return method; - } else if (types.length != 0 && paramTypes == null) { - break; - } else if (types.length == paramTypes.length) { - for (int n = 0; n < types.length - 1; n++) { - if (!types[n].equals(paramTypes[n]) || !types[n].isAssignableFrom(paramTypes[n])) { - break; - } - } - return method; - } - } - } - - Set fields = getAllFields(clazz); - for (Field field : fields) { - if (field.getName().equals(propertName)) { - return field; - } - } - return null; - } - - /** - * Determines if two methods "match" - that is, they have the same method names and exact parameter types (one is - * not a supertype of the other) - */ - public static boolean exactMethodMatch(Method method1, Method method2) { - if (!method1.getName().equals(method2.getName())) { - return false; - } - Class[] types1 = method1.getParameterTypes(); - Class[] types2 = method2.getParameterTypes(); - if (types1.length == 0 && types2.length == 0) { - return true; - } else if (types1.length == types2.length) { - for (int n = 0; n < types1.length; n++) { - if (!types1[n].equals(types2[n])) { - return false; - } - } - return true; - } - return false; - } - - public static Constructor getDefaultConstructor(Class clazz) throws NoSuchMethodException { - return clazz.getConstructor((Class[]) null); - } - - /** - * Loads a class corresponding to the class name using the current context class loader. - * - * @throws ClassNotFoundException if the class was not found on the classpath - */ - public static Class loadClass(String pName) throws ClassNotFoundException { - ClassLoader loader = Thread.currentThread().getContextClassLoader(); - return Class.forName(pName, true, loader); - } - - /** - * Returns the simple name of a class - i.e. the class name devoid of its package qualifier - * - * @param implClass - * @return - */ - public static String getBaseName(Class implClass) { - String baseName = implClass.getName(); - int lastDot = baseName.lastIndexOf('.'); - if (lastDot != -1) { - baseName = baseName.substring(lastDot + 1); - } - return baseName; - } - - public static boolean isImmutable(Class clazz) { - return (String.class == clazz || clazz.isPrimitive() || Number.class.isAssignableFrom(clazz) - || Boolean.class.isAssignableFrom(clazz) || Character.class.isAssignableFrom(clazz) || Byte.class - .isAssignableFrom(clazz)); - } - - /** - * Takes a property name and converts it to a getter method name according to JavaBean conventions. For example, - * property foo is returned as getFoo - */ - public static String toGetter(String name) { - return "get" + name.toUpperCase().substring(0, 1) + name.substring(1); - } - - /** - * Takes a setter or getter method name and converts it to a property name according to JavaBean conventions. For - * example, setFoo(var) is returned as property foo - */ - public static String toPropertyName(String name) { - return name.substring(3, 4).toLowerCase() + name.substring(4); - } - - /** - * Takes a property name and converts it to a setter method name according to JavaBean conventions. For example, the - * property foo is returned as setFoo(var) - */ - public static String toSetter(String name) { - return "set" + name.toUpperCase().substring(0, 1) + name.substring(1); - } - - /** - * Compares a two types, assuming one is a primitive, to dtermine if the other is its object counterpart - */ - private static boolean primitiveAssignable(Class memberType, Class param) { - if (memberType == Integer.class) { - return (param == Integer.TYPE); - } else if (memberType == Double.class) { - return (param == Double.TYPE); - } else if (memberType == Float.class) { - return (param == Float.TYPE); - } else if (memberType == Short.class) { - return (param == Short.TYPE); - } else if (memberType == Character.class) { - return (param == Character.TYPE); - } else if (memberType == Boolean.class) { - return (param == Boolean.TYPE); - } else if (memberType == Byte.class) { - return (param == Byte.TYPE); - } else if (param == Integer.class) { - return (memberType == Integer.TYPE); - } else if (param == Double.class) { - return (memberType == Double.TYPE); - } else if (param == Float.class) { - return (memberType == Float.TYPE); - } else if (param == Short.class) { - return (memberType == Short.TYPE); - } else if (param == Character.class) { - return (memberType == Character.TYPE); - } else if (param == Boolean.class) { - return (memberType == Boolean.TYPE); - } else if (param == Byte.class) { - return (memberType == Byte.TYPE); - } else { - return false; - } - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/MissingResourceException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/MissingResourceException.java deleted file mode 100644 index 7b40ccbefa..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/MissingResourceException.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.config; - -/** - * Exception that indicates an expected resource could not be found. - * - * @version $Rev$ $Date$ - */ -public class MissingResourceException extends ConfigurationException { - /** - * Constructor that indicates which resource could not be found. - * The supplied parameter is also returned as the message. - * - * @param resource the resource that could not be found - */ - public MissingResourceException(String resource) { - super(resource); - } - - /** - * Return the name of the expected resource. - * - * @return the name of the expected resource - */ - public String getResource() { - return getMessage(); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/ModuleComponentConfigurationLoader.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/ModuleComponentConfigurationLoader.java deleted file mode 100644 index a8e2718222..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/ModuleComponentConfigurationLoader.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.config; - -import java.util.Collection; - -import org.apache.tuscany.model.assembly.ModuleComponent; - -/** - * Interface for loading configuration information from some external - * form into a Tuscany logical model. - * - * @version $Rev: 368822 $ $Date: 2006-01-13 10:54:38 -0800 (Fri, 13 Jan 2006) $ - */ -public interface ModuleComponentConfigurationLoader { - - /** - * Load a SCDL module component. - * - * @param name the name of the module component - * @param uri - * @return a new module component definition - * @throws ConfigurationException if there was a problem loading the module component. - */ - ModuleComponent loadModuleComponent(String name, String uri) throws ConfigurationLoadException; - - /** - * Load a System SCDL module component. - * - * @param name the name of the module component - * @param uri - * @return a new module component definition - * @throws ConfigurationException if there was a problem loading the module component. - */ - ModuleComponent loadSystemModuleComponent(String name, String uri) throws ConfigurationLoadException; - - /** - * Load a SCDL module component. - * - * @param name the name of the module component - * @param uri - * @param url - * @return a new module component definition - * @throws ConfigurationException if there was a problem loading the module component. - */ - ModuleComponent loadModuleComponent(String name, String uri, String url) throws ConfigurationLoadException; - - /** - * Load a SCDL module component. - * - * @param name the name of the module component - * @param uri - * @param url - * @param urls - * @return a new module component definition - * @throws ConfigurationException if there was a problem loading the module component. - */ - ModuleComponent loadModuleComponent(String name, String uri, String url, Collection urls) throws ConfigurationLoadException; - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/impl/Java5ComponentTypeIntrospector.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/impl/Java5ComponentTypeIntrospector.java deleted file mode 100644 index 8799969028..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/impl/Java5ComponentTypeIntrospector.java +++ /dev/null @@ -1,423 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.config.impl; - -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import org.osoa.sca.annotations.Callback; -import org.osoa.sca.annotations.Remotable; - -import org.apache.tuscany.core.config.ComponentTypeIntrospector; -import org.apache.tuscany.core.config.ConfigurationException; -import org.apache.tuscany.core.config.JavaIntrospectionHelper; -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.ComponentType; -import org.apache.tuscany.model.assembly.Multiplicity; -import org.apache.tuscany.model.assembly.Property; -import org.apache.tuscany.model.assembly.Reference; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.Service; -import org.apache.tuscany.model.assembly.ServiceContract; -import org.apache.tuscany.model.types.java.JavaServiceContract; - -/** - * Introspects Java annotation-based metata data - * - * @version $Rev$ $Date$ - */ -public class Java5ComponentTypeIntrospector implements ComponentTypeIntrospector { - private final AssemblyFactory factory; - - public Java5ComponentTypeIntrospector(AssemblyFactory factory) { - this.factory = factory; - } - - /** - * Returns a component type for the given class - * - * @throws ConfigurationException - */ - public ComponentType introspect(Class implClass) throws ConfigurationException { - ComponentType compType = factory.createComponentType(); - introspectServices(compType, implClass); - introspectAnnotatedMembers(compType, implClass); - - // if implementation is not annotated and no annotated members were found, add public fields and setters - if (!implClass.isAnnotationPresent(org.osoa.sca.annotations.Service.class) && compType.getProperties().isEmpty() - && compType.getReferences().isEmpty()) { - introspectMembers(compType, implClass); - } - - // FIXME scopes should be handled at the interface level - if (compType != null) { - Scope scope = getScope(implClass); - for (Iterator i = compType.getServices().iterator(); i.hasNext();) { - ServiceContract intf = i.next().getServiceContract(); - if (intf != null) - intf.setScope(scope); - } - } - - return compType; - } - - /** - * Returns the scope for a given class - * - */ - private static Scope getScope(Class implClass) { - org.osoa.sca.annotations.Scope scope = implClass.getAnnotation(org.osoa.sca.annotations.Scope.class); - if (scope == null) { - // scope was not defined on the implementation class, look for annotated interfaces - Class[] interfaces = implClass.getInterfaces(); - for (int i = 0; i < interfaces.length; i++) { - scope = interfaces[i].getAnnotation(org.osoa.sca.annotations.Scope.class); - } - } - if (scope == null) { - return Scope.INSTANCE; - } - - if ("MODULE".equalsIgnoreCase(scope.value())) { - return (Scope.MODULE); - } else if ("SESSION".equalsIgnoreCase(scope.value())) { - return (Scope.SESSION); - } else if ("REQUEST".equalsIgnoreCase(scope.value())) { - return (Scope.REQUEST); - } else { - return (Scope.INSTANCE); - } - } - - /** - * Adds the supported services for a component implementation type to its component type - * - * @param compType the component type being generated - * @param implClass the component implementation type class - * @throws ConfigurationException - */ - protected void introspectServices(ComponentType compType, Class implClass) throws ConfigurationException { - List services = compType.getServices(); - assert services.isEmpty() : "componentType already has services defined"; - - // add services defined in an @Service annotation - org.osoa.sca.annotations.Service serviceAnnotation = implClass.getAnnotation(org.osoa.sca.annotations.Service.class); - if (serviceAnnotation != null) { - Class[] interfaces = serviceAnnotation.interfaces(); - Class value = serviceAnnotation.value(); - if (interfaces.length > 0) { - if (!Void.class.equals(value)) { - throw new IllegalArgumentException("Both interfaces and value specified in @Service on " - + implClass.getName()); - } - for (int i = 0; i < interfaces.length; i++) { - Class intf = interfaces[i]; - addService(services, intf); - } - return; - } else if (!Void.class.equals(value)) { - addService(services, value); - return; - } - } - - // no @Service annotation, add all implemented interfaces with an @Remotable annotation - Class[] interfaces = implClass.getInterfaces(); - for (int i = 0; i < interfaces.length; i++) { - Class intf = interfaces[i]; - if (intf.isAnnotationPresent(Remotable.class)) { - addService(services, intf); - } - } - - // if no Remotable interfaces were specified, the class itself is the service - if (services.isEmpty()) { - addService(services, implClass); - } - } - - /** - * Recursively adds supported services to a component type by walking the class hierarchy - * - * @throws ConfigurationException - */ - protected void addService(List services, Class serviceClass) throws ConfigurationException { - JavaServiceContract javaInterface = factory.createJavaServiceContract(); - javaInterface.setInterface(serviceClass); - Callback callback = serviceClass.getAnnotation(Callback.class); - if (callback != null && !Void.class.equals(callback.value())) { - javaInterface.setCallbackInterface(callback.value()); - } - - String name = JavaIntrospectionHelper.getBaseName(serviceClass); - Service service = factory.createService(); - service.setName(name); - service.setServiceContract(javaInterface); - services.add(service); - } - - /** - * Root method for determining public field and method metadata - * - * @throws ConfigurationException - */ - protected void introspectAnnotatedMembers(ComponentType compType, Class implClass) throws ConfigurationException { - - introspectPublicFields(compType, implClass); - introspectPrivateFields(compType, implClass); - - introspectPublicMethods(compType, implClass); - introspectPrivateMethods(compType, implClass); - } - - /** - * Introspects metdata for all public fields and methods for a class hierarchy - * - * @throws ConfigurationException - */ - protected void introspectMembers(ComponentType compType, Class implClass) throws ConfigurationException { - List properties = compType.getProperties(); - List references = compType.getReferences(); - - // inspect public fields from class and all superclasses - Field[] fields = implClass.getFields(); - for (int i = 0; i < fields.length; i++) { - Field field = fields[i]; - if (field.getType().isAnnotationPresent(Remotable.class)) { - addReference(references, field); - } else { - addProperty(properties, field); - } - } - - // add public methods from class and all superclasses - Method[] methods = implClass.getMethods(); - for (int i = 0; i < methods.length; i++) { - Method method = methods[i]; - if (Void.class.equals(method.getReturnType()) && method.getName().startsWith("set") - && method.getParameterTypes().length == 1 - && !method.getParameterTypes()[0].isAnnotationPresent(Remotable.class)) { - String name = method.getName(); - name = Character.toLowerCase(name.charAt(3)) + name.substring(4); - Class type = method.getParameterTypes()[0]; - if (type.isAnnotationPresent(Remotable.class)) { - addReference(references, name, type, false); - } else { - addProperty(properties, name, type, false); - } - } - } - } - - private void introspectPublicFields(ComponentType compType, Class implClass) throws ConfigurationException { - List properties = compType.getProperties(); - List references = compType.getReferences(); - - // inspect public fields from class and all superclasses - Field[] fields = implClass.getFields(); - for (int i = 0; i < fields.length; i++) { - Field field = fields[i]; - if (field.isAnnotationPresent(org.osoa.sca.annotations.Property.class)) { - addProperty(properties, field); - } else if (field.isAnnotationPresent(org.osoa.sca.annotations.Reference.class)) { - addReference(references, field); - } - } - } - - private void introspectPrivateFields(ComponentType compType, Class implClass) throws ConfigurationException { - List properties = compType.getProperties(); - List references = compType.getReferences(); - - // inspect private fields declared in class - Field[] fields = implClass.getDeclaredFields(); - for (int i = 0; i < fields.length; i++) { - Field field = fields[i]; - if (!Modifier.isPrivate(field.getModifiers())) { - continue; - } - if (field.isAnnotationPresent(org.osoa.sca.annotations.Property.class)) { - addProperty(properties, field); - } else if (field.isAnnotationPresent(org.osoa.sca.annotations.Reference.class)) { - addReference(references, field); - } - } - } - - private void introspectPublicMethods(ComponentType compType, Class implClass) throws ConfigurationException { - List properties = compType.getProperties(); - List references = compType.getReferences(); - - // add public methods from class and all superclasses - Method[] methods = implClass.getMethods(); - for (int i = 0; i < methods.length; i++) { - Method method = methods[i]; - if (method.isAnnotationPresent(org.osoa.sca.annotations.Property.class)) { - addProperty(properties, method); - } else if (method.isAnnotationPresent(org.osoa.sca.annotations.Reference.class)) { - addReference(references, method); - } - } - } - - private void introspectPrivateMethods(ComponentType compType, Class implClass) throws ConfigurationException { - List properties = compType.getProperties(); - List references = compType.getReferences(); - - // add private methods declared on class - Method[] methods = implClass.getDeclaredMethods(); - for (int i = 0; i < methods.length; i++) { - Method method = methods[i]; - if (!Modifier.isPrivate(method.getModifiers())) { - continue; - } - if (method.isAnnotationPresent(org.osoa.sca.annotations.Property.class)) { - addProperty(properties, method); - } else if (method.isAnnotationPresent(org.osoa.sca.annotations.Reference.class)) { - addReference(references, method); - } - } - } - - protected void addProperty(List properties, Field field) throws ConfigurationException { - String name; - boolean required; - org.osoa.sca.annotations.Property annotation = field.getAnnotation(org.osoa.sca.annotations.Property.class); - if (annotation != null) { - name = annotation.name(); - if (name.length() == 0) { - name = field.getName(); - } - required = annotation.required(); - } else { - name = field.getName(); - required = false; - } - addProperty(properties, name, field.getType(), required); - } - - protected void addProperty(List properties, Method method) throws ConfigurationException { - if (!Void.class.equals(method.getReturnType())) { - throw new ConfigurationException("Property setter method does not return void: " + method.toString()); - } - Class[] params = method.getParameterTypes(); - if (params.length != 1) { - throw new ConfigurationException("Property setter method does not have 1 parameter: " + method.toString()); - } - - String name; - boolean required; - org.osoa.sca.annotations.Property annotation = method.getAnnotation(org.osoa.sca.annotations.Property.class); - if (annotation != null) { - name = annotation.name(); - required = annotation.required(); - } else { - name = ""; - required = false; - } - if (name.length() == 0) { - name = method.getName(); - if (name.length() > 3 && name.startsWith("set")) { - name = Character.toLowerCase(name.charAt(3)) + name.substring(4); - } - } - addProperty(properties, name, params[0], required); - } - - protected void addProperty(List properties, String name, Class type, boolean required) - throws ConfigurationException { - Property prop = factory.createProperty(); - prop.setName(name); - prop.setType(type); - prop.setRequired(required); - - // a java.util.Map is not a "many" - prop.setMany(type.isArray() || Collection.class.isAssignableFrom(type)); - - // todo how is the default specified using annotations? - prop.setDefaultValue(null); - - properties.add(prop); - } - - protected void addReference(List references, Field field) throws ConfigurationException { - String name; - boolean required; - org.osoa.sca.annotations.Reference annotation = field.getAnnotation(org.osoa.sca.annotations.Reference.class); - if (annotation != null) { - name = annotation.name(); - if (name.length() == 0) { - name = field.getName(); - } - required = annotation.required(); - } else { - name = field.getName(); - required = false; - } - addReference(references, name, field.getType(), required); - } - - protected void addReference(List references, Method method) throws ConfigurationException { - if (!Void.TYPE.equals(method.getReturnType())) { - throw new ConfigurationException("Reference setter method does not return void: " + method.toString()); - } - Class[] params = method.getParameterTypes(); - if (params.length != 1) { - throw new ConfigurationException("Reference setter method does not have 1 parameter: " + method.toString()); - } - - String name; - boolean required; - org.osoa.sca.annotations.Reference annotation = method.getAnnotation(org.osoa.sca.annotations.Reference.class); - if (annotation != null) { - name = annotation.name(); - required = annotation.required(); - } else { - name = ""; - required = false; - } - if (name.length() == 0) { - name = method.getName(); - if (name.length() > 3 && name.startsWith("set")) { - name = Character.toLowerCase(name.charAt(3)) + name.substring(4); - } - } - addReference(references, name, params[0], required); - } - - protected void addReference(List references, String name, Class type, boolean required) - throws ConfigurationException { - Reference ref = factory.createReference(); - ref.setName(name); - boolean many = type.isArray() || Collection.class.isAssignableFrom(type); - Multiplicity multiplicity; - if (required) - multiplicity = many ? Multiplicity.ONE_N : Multiplicity.ONE_ONE; - else - multiplicity = many ? Multiplicity.ZERO_N : Multiplicity.ZERO_ONE; - ref.setMultiplicity(multiplicity); - ServiceContract javaInterface = factory.createJavaServiceContract(); - javaInterface.setInterface(type); - ref.setServiceContract(javaInterface); - references.add(ref); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/impl/ModuleComponentConfigurationLoaderImpl.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/impl/ModuleComponentConfigurationLoaderImpl.java deleted file mode 100644 index bed4b0ac40..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/config/impl/ModuleComponentConfigurationLoaderImpl.java +++ /dev/null @@ -1,142 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.config.impl; - -import java.io.IOException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import org.apache.tuscany.common.resource.ResourceLoader; -import org.apache.tuscany.core.config.ConfigurationLoadException; -import org.apache.tuscany.core.config.ModuleComponentConfigurationLoader; -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.ModuleComponent; -import org.apache.tuscany.model.assembly.ModuleFragment; -import org.apache.tuscany.model.assembly.loader.AssemblyModelLoader; - -/** - */ -public class ModuleComponentConfigurationLoaderImpl implements ModuleComponentConfigurationLoader { - - private static final String SCA_MODULE_FILE_NAME = "sca.module"; - //FIXME can fragments have a variable prefix name? - private static final String SCA_FRAGMENT_FILE_NAME = "sca.fragment"; - private static final String SYSTEM_MODULE_FILE_NAME = "system.module"; - //FIXME can fragments have a variable prefix name? - private static final String SYSTEM_FRAGMENT_FILE_NAME = "system.fragment"; - - private AssemblyModelContext modelContext; - private ResourceLoader resourceLoader; - private AssemblyFactory assemblyFactory; - private AssemblyModelLoader modelLoader; - - /** - * Constructor - */ - public ModuleComponentConfigurationLoaderImpl(AssemblyModelContext modelContext) { - this.modelContext=modelContext; - this.modelLoader=this.modelContext.getAssemblyLoader(); - this.assemblyFactory=this.modelContext.getAssemblyFactory(); - this.resourceLoader=this.modelContext.getApplicationResourceLoader(); - } - - /** - * @see org.apache.tuscany.model.assembly.loader.AssemblyModelLoader#loadModuleComponent(java.lang.String, java.lang.String) - */ - public ModuleComponent loadSystemModuleComponent(String name, String uri) throws ConfigurationLoadException { - return loadModuleComponent(SYSTEM_MODULE_FILE_NAME, SYSTEM_FRAGMENT_FILE_NAME, name, uri); - } - - /** - * @see org.apache.tuscany.model.assembly.loader.AssemblyModelLoader#loadModuleComponent(java.lang.String, java.lang.String) - */ - public ModuleComponent loadModuleComponent(String name, String uri) throws ConfigurationLoadException { - return loadModuleComponent(SCA_MODULE_FILE_NAME, SCA_FRAGMENT_FILE_NAME, name, uri); - } - - /** - * Load a module component. - */ - private ModuleComponent loadModuleComponent(String moduleFileName, String fragmentFileName, String name, String uri) throws ConfigurationLoadException { - - // Load the sca.module file - URL moduleUrl; - try { - moduleUrl = resourceLoader.getResource(moduleFileName); - } catch (IOException e) { - throw new ConfigurationLoadException(moduleFileName, e); - } - if (moduleUrl == null) { - throw new ConfigurationLoadException(moduleFileName); - } - String moduleUri=moduleUrl.toString(); - - // Load the sca.fragment files - Iterator i; - try { - i = resourceLoader.getAllResources(fragmentFileName); - } catch (IOException e) { - throw new ConfigurationLoadException(fragmentFileName, e); - } - List moduleFragmentUris=new ArrayList(); - for (; i.hasNext(); ) { - URL url=i.next(); - moduleFragmentUris.add(url.toString()); - } - - return loadModuleComponent(name, uri, moduleUri, moduleFragmentUris); - } - - /** - * @see org.apache.tuscany.core.config.ModuleComponentConfigurationLoader#loadModuleComponent(java.lang.String, java.lang.String, java.lang.String) - */ - public ModuleComponent loadModuleComponent(String name, String uri, String url) throws ConfigurationLoadException { - return loadModuleComponent( name, uri, url, (Collection)null); - } - - /** - * @see org.apache.tuscany.core.config.ModuleComponentConfigurationLoader#loadModuleComponent(java.lang.String, java.lang.String, java.lang.String, java.util.Collection) - */ - public ModuleComponent loadModuleComponent(String name, String uri, String moduleUri, Collection moduleFragmentUris) throws ConfigurationLoadException { - - // Load the module file - Module module=modelLoader.loadModule(moduleUri); - - // Load the sca.fragment files - if (moduleFragmentUris!=null) { - for (String moduleFragmentUri : moduleFragmentUris) { - ModuleFragment moduleFragment=modelLoader.loadModuleFragment(moduleFragmentUri); - module.getModuleFragments().add(moduleFragment); - } - } - - // Create the module component - ModuleComponent moduleComponent=assemblyFactory.createModuleComponent(); - moduleComponent.setName(name); - moduleComponent.setURI(uri); - moduleComponent.setComponentImplementation(module); - moduleComponent.initialize(modelContext); - - return moduleComponent; - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/AbstractContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/AbstractContext.java deleted file mode 100644 index c1abcb3c03..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/AbstractContext.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; - -/** - * Functionality common to all Context implementations - * - * @version $Rev$ $Date$ - */ -public abstract class AbstractContext implements Context { - - public AbstractContext() { - } - - public AbstractContext(String name) { - this.name = name; - } - - protected String name; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - protected int lifecycleState = UNINITIALIZED; - - public int getLifecycleState() { - return lifecycleState; - } - - public void setLifecycleState(int state) { - lifecycleState = state; - } - - protected List contextListener = new CopyOnWriteArrayList(); - - public void addContextListener(LifecycleEventListener listener) { - contextListener.add(listener); - } - - public void removeContextListener(LifecycleEventListener listener) { - contextListener.remove(listener); - } - - public String toString() { - switch (lifecycleState) { - case (CONFIG_ERROR): - return "Context [" + name + "] in state [CONFIG_ERROR]"; - case (ERROR): - return "Context [" + name + "] in state [ERROR]"; - case (INITIALIZING): - return "Context [" + name + "] in state [INITIALIZING]"; - case (INITIALIZED): - return "Context [" + name + "] in state [INITIALIZED]"; - case (RUNNING): - return "Context [" + name + "] in state [RUNNING]"; - case (STOPPING): - return "Context [" + name + "] in state [STOPPING]"; - case (STOPPED): - return "Context [" + name + "] in state [STOPPED]"; - case (UNINITIALIZED): - return "Context [" + name + "] in state [UNINITIALIZED]"; - default: - return "Context [" + name + "] in state [UNKNOWN]"; - } - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/AggregateContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/AggregateContext.java deleted file mode 100644 index 0fab87358f..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/AggregateContext.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.apache.tuscany.core.context; - -import java.util.List; - -import org.apache.tuscany.core.config.ConfigurationException; -import org.apache.tuscany.model.assembly.Aggregate; -import org.apache.tuscany.model.assembly.Extensible; -import org.apache.tuscany.model.assembly.AggregatePart; - -/** - * A context which contains child component contexts. - * - * @version $Rev$ $Date$ - */ -public interface AggregateContext extends InstanceContext { - - /** - * Propagates an event to registered listeners. All lifecycle events will be propagated to children in the order - * that they were registered. Listeners are expected to be well-behaved and if an exception is thrown the - * notification process will be aborted. - * - * @param pEventType the type of event. Basic types are defined in {@link EventContext} - * @param pMessage the message associated with the event or null - * @throws EventException if an error occurs while sending the event - */ - public void fireEvent(int pEventType, Object pMessage) throws EventException; - - /** - * Registers a listener to receive notifications for the context - * - * @throws ContextRuntimeException if an error occurs during registration - */ - public void registerListener(RuntimeEventListener listener) throws ContextRuntimeException; - - /** - * Adds runtime artifacts represented by the set of model objects to the aggregate context by merging them with - * existing artifacts. Implementing classes may support only a subset of {@link AggregatePart} types. - * - * @see org.apache.tuscany.model.assembly.Component - * @see org.apache.tuscany.model.assembly.ModuleComponent - * @see org.apache.tuscany.model.assembly.SimpleComponent - * @see org.apache.tuscany.model.assembly.EntryPoint - * @see org.apache.tuscany.model.assembly.ExternalService - */ - public void registerModelObjects(List models) throws ConfigurationException; - - /** - * Adds a runtime artifact represented by the model object to the aggregate context by merging it with existing - * artifacts. Implementing classes may support only a subset of {@link AggregatePart} types. - * - * @see org.apache.tuscany.model.assembly.Component - * @see org.apache.tuscany.model.assembly.ModuleComponent - * @see org.apache.tuscany.model.assembly.SimpleComponent - * @see org.apache.tuscany.model.assembly.EntryPoint - * @see org.apache.tuscany.model.assembly.ExternalService - */ - public void registerModelObject(Extensible model) throws ConfigurationException; - - /** - * Returns the child context associated with a given name - */ - public InstanceContext getContext(String name); - - /** - * Returns the parent context, or null if the context does not have one - */ - public AggregateContext getParent(); - - /** - * Intended for internal use by the runtime, returns an implementation instance for the given context name, which - * may be a compound component/service form. Unlike {@link InstanceContext#getInstance(QualifiedName)}, which for aggregate contexts only returns - * entry point proxies, this method will return any type of contained implementation instance. - * - * @throws TargetException if there was an error returning the instance - */ - public Object locateInstance(String name) throws TargetException; - - /** - * Returns the aggregate managed by this aggregate context - * @return - */ - @Deprecated - public Aggregate getAggregate(); - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/AutowireContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/AutowireContext.java deleted file mode 100644 index 5f3973f358..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/AutowireContext.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -/** - * A specialization of an AggregateContext that is able to automatically resolve references - * for its children using EntryPoint or Service interfaces exposed by it or, recursively, any - * of it parents. - * - * @version $Rev$ $Date$ - */ -public interface AutowireContext extends AggregateContext { - - /** - * Returns an reference to the requested service. - * - * @param instanceInterface the type of service being requested - * @return a reference to the requested service or null if none can be found - * @throws AutowireResolutionException if an error occurs attempting to resolve an autowire - */ - T resolveInstance(Class instanceInterface) throws AutowireResolutionException; - - // todo add additional methods that allow other qualifications to be supplied -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/AutowireResolutionException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/AutowireResolutionException.java deleted file mode 100644 index 4da4206a94..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/AutowireResolutionException.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -/** - * Denotes an exception while resolving an automatic wire - * - * @version $Rev$ $Date$ - */ -public class AutowireResolutionException extends TargetException { - - public AutowireResolutionException() { - super(); - } - - public AutowireResolutionException(String message) { - super(message); - } - - public AutowireResolutionException(String message, Throwable cause) { - super(message, cause); - } - - public AutowireResolutionException(Throwable cause) { - super(cause); - } - -} - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ConfigurationContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ConfigurationContext.java deleted file mode 100644 index a57ed03ffd..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ConfigurationContext.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -import org.apache.tuscany.core.builder.BuilderConfigException; -import org.apache.tuscany.core.config.ConfigurationException; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.model.assembly.Extensible; - -/** - * Offers configuration services in the runtime. A ConfigurationContext is able to configure a model and then build the - * runtime representation corresponding to that model in the live system.

Configuration contexts will typically be - * hierarchical, delegating to their parent after performing an operation. The parent ConfigurationContext will - * typically be injected into an implementation of this interface during registration. - * - * @version $Rev$ $Date$ - */ -public interface ConfigurationContext { - - /** - * Adds additional configuration information to a model object. - * - * @param model the model object to be configured - * @throws ConfigurationException - */ - public void configure(Extensible model) throws ConfigurationException; - - /** - * Decorates the supplied model object with a {@link org.apache.tuscany.core.builder.RuntimeConfiguration} that can - * be used to create the runtime context corresponding to the model. - * - * @param parent an AggregrateContext that will ultimately become the parent of the runtime context - * @param model the model object that defines the configuration to be built - * @throws BuilderConfigException - * @see org.apache.tuscany.core.builder.RuntimeConfiguration - */ - public void build(AggregateContext parent, Extensible model) throws BuilderConfigException; - - /** - * Constructs a wire from a source proxy factory to a corresponding target, potentially performing optimizations - * - * @param sourceFactory the proxy factory that will be used to create the injected proxy for a reference - * @param targetFactory the proxy factory that contains the invocation chains for the target side of the wire - * @param targetType the {@link org.apache.tuscany.core.builder.RuntimeConfiguration} implementation type for the - * wire target - * @param downScope whether the source is a shorter lived scope than the target. Used in optimization. - * @param targetScopeContext the scope context of the target service - * @throws BuilderConfigException - */ - public void wire(ProxyFactory sourceFactory, ProxyFactory targetFactory, Class targetType, boolean downScope, - ScopeContext targetScopeContext) throws BuilderConfigException; - - public void wire(ProxyFactory targetFactory, Class targetType, ScopeContext targetScopeContext) throws BuilderConfigException; - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/Context.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/Context.java deleted file mode 100644 index 2eb70e8711..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/Context.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -/** - * An entity that provides an execution context for a runtime artifact - * - * @version $Rev$ $Date$ - */ -public interface Context { - - /* A configuration error state */ - public static final int CONFIG_ERROR = -1; - - /* Has not been initialized */ - public static final int UNINITIALIZED = 0; - - /* In the process of being configured and initialized */ - public static final int INITIALIZING = 1; - - /* Instantiated and configured */ - public static final int INITIALIZED = 2; - - /* Configured and initialized */ - public static final int RUNNING = 4; - - /* In the process of being shutdown */ - public static final int STOPPING = 5; - - /* Has been shutdown and removed from the module */ - public static final int STOPPED = 6; - - /* In an error state */ - public static final int ERROR = 7; - - /** - * Returns the name of the context - */ - public String getName(); - - /** - * Sets the name of the context - */ - public void setName(String name); - - /** - * Returns the lifecycle state - * - * @see #UNINITIALIZED - * @see #INITIALIZING - * @see #INITIALIZED - * @see #RUNNING - * @see #STOPPING - * @see #STOPPED - */ - public int getLifecycleState(); - - /** - * Sets the lifecycle state - * - * @see #UNINITIALIZED - * @see #INITIALIZING - * @see #INITIALIZED - * @see #RUNNING - * @see #STOPPING - * @see #STOPPED - */ - public void setLifecycleState(int state); - - /** - * Starts the container - * - * @throws CoreRuntimeException - */ - public void start() throws CoreRuntimeException; - - /** - * Stops the container - * - * @throws CoreRuntimeException - */ - public void stop() throws CoreRuntimeException; - - /** - * Registers a listener for context events - */ - public void addContextListener(LifecycleEventListener listener); - - /** - * Deregisters a context event listener - */ - public void removeContextListener(LifecycleEventListener listener); - -} - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ContextInitException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ContextInitException.java deleted file mode 100644 index e024a98b0e..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ContextInitException.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -/** - * Denotes an error encountered while initializing an instance context - * - * @version $Rev$ $Date$ - */ -public class ContextInitException extends ContextRuntimeException { - - public ContextInitException() { - super(); - } - - public ContextInitException(String message) { - super(message); - } - - public ContextInitException(String message, Throwable cause) { - super(message, cause); - } - - public ContextInitException(Throwable cause) { - super(cause); - } - -} - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ContextRuntimeException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ContextRuntimeException.java deleted file mode 100644 index 0d35f145dc..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ContextRuntimeException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -/** - * An unchecked exception encountered by an {@link org.apache.tuscany.core.context.Context} - * - * @version $Rev$ $Date$ - */ -public class ContextRuntimeException extends CoreRuntimeException { - - public ContextRuntimeException() { - super(); - } - - public ContextRuntimeException(String message) { - super(message); - } - - public ContextRuntimeException(String message, Throwable cause) { - super(message, cause); - } - - public ContextRuntimeException(Throwable cause) { - super(cause); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/CoreRuntimeException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/CoreRuntimeException.java deleted file mode 100644 index a46d35c22c..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/CoreRuntimeException.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.apache.tuscany.core.context; - -import org.apache.tuscany.common.TuscanyRuntimeException; - -/** - * The root exception for the runtime package. Exceptions occurring in the runtime are generally non-recoverable - * - * @version $Rev$ $Date$ - */ -public abstract class CoreRuntimeException extends TuscanyRuntimeException { - - public CoreRuntimeException() { - super(); - } - - public CoreRuntimeException(String message) { - super(message); - } - - public CoreRuntimeException(String message, Throwable cause) { - super(message, cause); - } - - public CoreRuntimeException(Throwable cause) { - super(cause); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/DuplicateNameException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/DuplicateNameException.java deleted file mode 100644 index 81a334d3c8..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/DuplicateNameException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -/** - * Denotes an attempt to add a context with a name equal to an existing context - * - * @version $Rev$ $Date$ - */ -public class DuplicateNameException extends ContextRuntimeException { - - public DuplicateNameException() { - super(); - } - - public DuplicateNameException(String message) { - super(message); - } - - public DuplicateNameException(String message, Throwable cause) { - super(message, cause); - } - - public DuplicateNameException(Throwable cause) { - super(cause); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/EntryPointContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/EntryPointContext.java deleted file mode 100644 index aef2840f9a..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/EntryPointContext.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -/** - * The runtime artifact representing an entry point, EntryPointContext manages invocation handler - * instances that expose service operations offered by a component in the parent aggregate. The invocation handler - * instance is responsible for dispatching the request down an invocation chain to the target instance. The invocation - * chain may contain {@link org.apache.tuscany.core.invocation.Interceptor}s and - * {@link org.apache.tuscany.core.invocation.MessageHandler}s that implement policies or perform mediations on the - * invocation. - *

- * Entry point contexts are used by transport binding artifacts to invoke an operation on a service. The transport - * binding uses an {@link java.lang.reflect.InvocationHandler} instance obtained from the EntryPointContext - * to perform the invocation as in: - * - *

- *              AggregateContext aggregateContext = ...
- *              EntryPointContext ctx = (EntryPointContext) aggregateContext.getContext("source");
- *              Assert.assertNotNull(ctx);
- *              InvocationHandler handler = (InvocationHandler) ctx.getImplementationInstance();
- *              Object response = handler.invoke(null, operation, new Object[] { param });
- * 
- * - * The Proxy instance passed to InvocationHandler may be null as the client is invoking - * directly on the handler. - *

- * Alternatively, the following will return a proxy implementing the service interface exposed by the entry point: - * - *

- *              AggregateContext aggregateContext = ...
- *              EntryPointContext ctx = (EntryPointContext) aggregateContext.getContext("source");
- *              Assert.assertNotNull(ctx);
- *              HelloWorld proxy = (Helloworld) ctx.getInstance(null); // service name not necessary
- * 
- * - * The proxy returned will be backed by the entry point invocation chain. - * - * @version $Rev$ $Date$ - */ -public interface EntryPointContext extends InstanceContext { - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/EventContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/EventContext.java deleted file mode 100644 index 9f7c98200a..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/EventContext.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -/** - * Implementations are responsible for tracking scope keys associated with the current request. - * - * @version $Rev$ $Date$ - */ -public interface EventContext { - - /* An event type fired when a request is first serviced in the runtime */ - public static final int REQUEST_START = 1; - - /* An event type fired when the runtime finishes servicing a request */ - public static final int REQUEST_END = 2; - - /* An event type fired when a session is set for the current context */ - public static final int SESSION_NOTIFY = 3; - - /* An event type fired when a session is invalidated in the runtime */ - public static final int SESSION_END = 4; - - /* An event type fired when the current deployment unit is initialized */ - public static final int MODULE_START = 5; - - /* An event type fired when the current deployment unit is quiesced */ - public static final int MODULE_STOP = 6; - - public static final int SYSTEM_START = 7; - - public static final int SYSTEM_STOP = 8; - - /* An identifier type associated with an HTTP session */ - public static final Object HTTP_SESSION = new Object(); - - /** - * Returns the unique key for the given identifier, e.g a session - */ - public Object getIdentifier(Object type); - - /** - * Sets the unique key for the given identifier, e.g a session - */ - public void setIdentifier(Object type, Object identifier); - - /** - * Clears the unique key for the given identifier, e.g a session - */ - public void clearIdentifier(Object type); - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/EventException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/EventException.java deleted file mode 100644 index aaf26aee69..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/EventException.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -/** - * Denotes an error encountered while firing a module event - * - * @version $Rev$ $Date$ - */ -public class EventException extends CoreRuntimeException { - - public EventException(String message, Throwable cause) { - super(message, cause); - } - - public EventException(String message) { - super(message); - } - - public EventException(Throwable cause) { - super(cause); - } - - public EventException() { - super(); - } - -} - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ExternalServiceContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ExternalServiceContext.java deleted file mode 100644 index 298246dc81..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ExternalServiceContext.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -/** - * Manages an external service - * - * @version $Rev$ $Date$ - */ -public interface ExternalServiceContext extends InstanceContext { - -} - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/InstanceContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/InstanceContext.java deleted file mode 100644 index 473762b6b0..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/InstanceContext.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -/** - * Manages instances of a runtime artifact. An InstanceContext may contain child contexts which - * themselves manage implementation instances or it may be a leaf context. - * - * @see org.apache.tuscany.core.context.SimpleComponentContext - * @see org.apache.tuscany.core.context.AggregateContext - * @see org.apache.tuscany.core.context.EntryPointContext - * @see org.apache.tuscany.core.context.ExternalServiceContext - * - * @version $Rev$ $Date$ - */ -public interface InstanceContext extends Context { - - /** - * Returns the instance associated with the requested name, which may be in a simple or compound form. Simple (i.e. - * leaf) contexts will return an instance associated with the service name part of the compound name, which may be - * null. - *

- * Aggregate contexts will return an instance (likely a proxy) of a contained entry point context. In this case, the - * port name on the qualified name will correspond to the aggregate context name and the part name will be used to - * retrieve the contained entry point context. The latter may be null. If the contained context is not an entry - * point context, an exception will be thrown. - * - * @param qName a qualified name of the requested instance - * @return the implementation instance or a proxy to it - * @throws TargetException if an error occurs retrieving the instance or the requested component is not an entry - * point. - * - * @see AggregateContext - * @see org.apache.tuscany.model.assembly.EntryPoint - */ - public Object getInstance(QualifiedName qName) throws TargetException; - - /** - * Returns an instance associated with the requested name without notifying ContextEventListeners - * that may be registered with this context on instance creation. Note that {@link #getInstance(QualifiedName)} - * should generally be called and this method is only provided as an optimization for particular circumstances. - * - * @param qName a qualified name of the requested instance - * @param notify whether to notify ContextEventListeners - * @return the instance or a proxy to it - * @throws TargetException if an error occurs retrieving the instance or proxy - * @see LifecycleEventListener - */ - public Object getInstance(QualifiedName qName, boolean notify) throws TargetException; - - /** - * Returns the implementation instance associated witht he component. An implementation instance does not - * have a proxy invocation chainXXX - * @return - * @throws TargetException - */ - public Object getImplementationInstance() throws TargetException; - - public Object getImplementationInstance(boolean notify) throws TargetException; - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/InvalidNameException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/InvalidNameException.java deleted file mode 100644 index 65c709e569..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/InvalidNameException.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -/** - * Denotes an invalid name - * - * @version $Rev$ $Date$ - */ -public class InvalidNameException extends ContextRuntimeException { - - public InvalidNameException() { - super(); - } - - public InvalidNameException(String message) { - super(message); - } - - public InvalidNameException(String message, Throwable cause) { - super(message, cause); - } - - public InvalidNameException(Throwable cause) { - super(cause); - } - -} - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/LifecycleEventListener.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/LifecycleEventListener.java deleted file mode 100644 index 78962b53b4..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/LifecycleEventListener.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -import java.util.EventListener; - -/** - * Callback interface for receiving instance context lifecycle events - * - * @version $Rev$ $Date$ - */ -public interface LifecycleEventListener extends EventListener { - - /** - * Notifies the listener that a new component context was created - */ - public void onInstanceCreate(Context component); -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/QualifiedName.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/QualifiedName.java deleted file mode 100644 index ad71721b75..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/QualifiedName.java +++ /dev/null @@ -1,83 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -/** - * An evaluated name consisting of a part/port pair. In the runtime, a part generally 'contains' or 'provides' ports - * such as a module component/entry point or a component/service pair. - * - * @version $Rev$ $Date$ - */ -public class QualifiedName { - - private String qName; - - private String partName; - - private String portName; - - public static final String NAME_SEPARATOR = "/"; - - /** - * Constructs a new qualified name - * - * @throws InvalidNameException if the name is in an invalid format - */ - public QualifiedName(String qualifiedName) throws InvalidNameException { - assert (qualifiedName != null) : "Name was null"; - int pos = qualifiedName.indexOf(QualifiedName.NAME_SEPARATOR); - switch (pos) { - case -1: - partName = qualifiedName; - break; - case 0: - throw new InvalidNameException(qualifiedName); - default: - partName = qualifiedName.substring(0, pos); - portName = qualifiedName.substring(pos + 1); - break; - } - qName = qualifiedName; - } - - /** - * Returns the parsed part name - */ - public String getPartName() { - return partName; - } - - /** - * Returns the parsed port name if the original is of the compound for part/port - */ - public String getPortName() { - return portName; - } - - /** - * Returns the full part/port name pair - * - * @return - */ - public String getQualifiedName() { - return qName; - } - - public String toString() { - return qName; - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/RuntimeEventListener.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/RuntimeEventListener.java deleted file mode 100644 index e90f30b9cc..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/RuntimeEventListener.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -import java.util.EventListener; - -/** - * Listeners observe events fired in the SCA runtime. - * - * @version $Rev$ $Date$ - */ -public interface RuntimeEventListener extends EventListener { - - /** - * A method called when an event for which the Listener class is registered to observe is fired in the runtime - * - * @param type the event type identifier - * @param message the event message - * @throws EventException if an error occurs processing the event - */ - public void onEvent(int type, Object message) throws EventException; -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeAwareContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeAwareContext.java deleted file mode 100644 index 565d7b49a6..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeAwareContext.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -import java.util.Map; - -import org.apache.tuscany.model.assembly.Scope; - -/** - * Denotes an aggregate context that supports scopes - * - * @version $Rev$ $Date$ - */ -public interface ScopeAwareContext extends AggregateContext { - - /** - * Returns an immutable collection of scopes keyed by type for the aggregate context - */ - public Map getScopeContexts(); -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeContext.java deleted file mode 100644 index abda942c88..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeContext.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -import java.util.List; - -import org.apache.tuscany.core.builder.RuntimeConfiguration; - -/** - * Manages the lifecycle and visibility of InstanceContexts. - * - * @see org.apache.tuscany.core.context.InstanceContext - * - * @version $Rev$ $Date$ - */ -public interface ScopeContext extends InstanceContext, RuntimeEventListener { - - /** - * Returns whether implementation instances may be held for the duration of an invocation - */ - public boolean isCacheable(); - - /** - * Registers the runtime configurations used to construct instance contexts for the scope - */ - public void registerConfigurations(List> configurations); - - /** - * Adds a runtime configuration to the scope - */ - public void registerConfiguration(RuntimeConfiguration configuration); - - /** - * Returns a context bound to the given name or null if the component does not exist. The returned context is bound - * to a key determined from the thread context. - */ - public InstanceContext getContext(String name); - - /** - * Returns a context bound to the given name and scoped to the given key or null if the context does not exist - */ - public InstanceContext getContextByKey(String name, Object key); - - /** - * Removes a context with the given name, determining the scope key from the thread context - * - * @throws ScopeRuntimeException - */ - public void removeContext(String name) throws ScopeRuntimeException; - - /** - * Removes a context bound to the given name and scope key - * - * @throws ScopeRuntimeException - */ - public void removeContextByKey(String name, Object key) throws ScopeRuntimeException; - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeIdentifier.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeIdentifier.java deleted file mode 100644 index 38a847295c..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeIdentifier.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -/** - * Implementations enable lazy retrieval of a scope id associated with a request, i.e. an id (and presumably a context) do not - * have to be generated if the scope is never accessed. Identifiers are associated with the current request thread and keyed on - * scope type. - * - * @version $Rev$ $Date$ - * @see org.apache.tuscany.container.module.EventContext - */ -public interface ScopeIdentifier { - - /** - * Returns the scope id for the request. - */ - public Object getIdentifier(); -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeInitializationException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeInitializationException.java deleted file mode 100644 index 6ef5bfe9dd..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeInitializationException.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -/** - * Denotes an initialization exception thrown by a scope container - * - * @version $Rev$ $Date$ - */ -public class ScopeInitializationException extends ScopeRuntimeException { - - public ScopeInitializationException() { - super(); - } - - public ScopeInitializationException(String message) { - super(message); - } - - public ScopeInitializationException(String message, Throwable cause) { - super(message, cause); - } - - public ScopeInitializationException(Throwable cause) { - super(cause); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeRuntimeException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeRuntimeException.java deleted file mode 100644 index 5022f7589d..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeRuntimeException.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -/** - * Denotes a general runtime exception encountered by a scope container - * - * @version $Rev$ $Date$ - */ -public class ScopeRuntimeException extends CoreRuntimeException { - - public ScopeRuntimeException() { - super(); - } - - public ScopeRuntimeException(String message) { - super(message); - } - - public ScopeRuntimeException(String message, Throwable cause) { - super(message, cause); - } - - public ScopeRuntimeException(Throwable cause) { - super(cause); - } - -} - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeStrategy.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeStrategy.java deleted file mode 100644 index b648fc2dcc..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ScopeStrategy.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -import java.util.Map; - -import org.apache.tuscany.model.assembly.Scope; - -/** - * Implementations provide scope container creation facilities and scope semantics to the runtime - * - * @version $Rev$ $Date$ - */ -public interface ScopeStrategy { - - /* Denotes an undefined scope */ - public static final int SCOPE_NOT_FOUND = -3; - - /** - * Creates and returns new instances of configured scope containers - */ - public Map createScopes(EventContext eventContext); - - /** - * Determines whether a wire proceeds from a source of higher scope to a target of lesser scope - */ - public boolean downScopeReference(Scope sourceScope, Scope targetScope); - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ServiceNotFoundException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ServiceNotFoundException.java deleted file mode 100644 index 253909d7fa..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/ServiceNotFoundException.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -import org.osoa.sca.ServiceUnavailableException; - -/** - * Denotes the specific case where a service was not found at runtime - * - * @version $Rev$ $Date$ - */ -public class ServiceNotFoundException extends ServiceUnavailableException { - - public ServiceNotFoundException() { - super(); - } - - public ServiceNotFoundException(String message) { - super(message); - } - - public ServiceNotFoundException(Throwable cause) { - super(cause); - } - - public ServiceNotFoundException(String message, Throwable cause) { - super(message, cause); - } - -} - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/SimpleComponentContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/SimpleComponentContext.java deleted file mode 100644 index d35a3712a0..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/SimpleComponentContext.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -/** - * A runtime entity that manages a non-aggregate (i.e. leaf-type) instance. - * - * @version $Rev$ $Date$ - */ -public interface SimpleComponentContext extends InstanceContext { - - /** - * Returns whether a the context should be eagerly initialized - */ - public boolean isEagerInit(); - - /** - * Returns whether a the context should be called back when its scope ends - */ - public boolean isDestroyable(); - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/SystemAggregateContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/SystemAggregateContext.java deleted file mode 100644 index afb8499104..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/SystemAggregateContext.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -import org.apache.tuscany.core.config.ConfigurationException; - -/** - * Marker type for system aggregate contexts - * - * @version $Rev$ $Date$ - */ -public interface SystemAggregateContext extends AutowireContext, ScopeAwareContext, ConfigurationContext { - - /** - * Register a simple Java Object as a system component. - * This is primarily intended for use by bootstrap code to create the initial - * configuration components. - * - * @param name the name of the resulting component - * @param instance the Object that will become the component's implementation - * @throws ConfigurationException - */ - void registerJavaObject(String name, Object instance) throws ConfigurationException; -} - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/TargetException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/TargetException.java deleted file mode 100644 index dd39d06aa1..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/TargetException.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -/** - * Denotes an error while performing an operation on a target component implementation instance or proxy - * - * @version $Rev$ $Date$ - */ -public class TargetException extends CoreRuntimeException { - - public TargetException() { - super(); - } - - public TargetException(String message) { - super(message); - } - - public TargetException(String message, Throwable cause) { - super(message, cause); - } - - public TargetException(Throwable cause) { - super(cause); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/impl/AbstractAggregateContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/impl/AbstractAggregateContext.java deleted file mode 100644 index 9ee1878625..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/impl/AbstractAggregateContext.java +++ /dev/null @@ -1,652 +0,0 @@ -package org.apache.tuscany.core.context.impl; - -import static org.apache.tuscany.core.context.EventContext.HTTP_SESSION; -import static org.apache.tuscany.core.context.EventContext.REQUEST_END; -import static org.apache.tuscany.core.context.EventContext.SESSION_NOTIFY; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; - -import javax.wsdl.Part; - -import org.apache.tuscany.common.monitor.MonitorFactory; -import org.apache.tuscany.core.builder.BuilderConfigException; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.config.ConfigurationException; -import org.apache.tuscany.core.context.AbstractContext; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.AutowireContext; -import org.apache.tuscany.core.context.ConfigurationContext; -import org.apache.tuscany.core.context.ContextInitException; -import org.apache.tuscany.core.context.CoreRuntimeException; -import org.apache.tuscany.core.context.DuplicateNameException; -import org.apache.tuscany.core.context.EntryPointContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.EventException; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.RuntimeEventListener; -import org.apache.tuscany.core.context.ScopeAwareContext; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.context.ScopeRuntimeException; -import org.apache.tuscany.core.context.ScopeStrategy; -import org.apache.tuscany.core.context.SimpleComponentContext; -import org.apache.tuscany.core.context.TargetException; -import org.apache.tuscany.core.context.scope.DefaultScopeStrategy; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.invocation.spi.ProxyInitializationException; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.apache.tuscany.core.system.annotation.ParentContext; -import org.apache.tuscany.model.assembly.Aggregate; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.Extensible; -import org.apache.tuscany.model.assembly.ExternalService; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.ComponentImplementation; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; - -/** - * The base implementation of an aggregate context - * - * @version $Rev$ $Date$ - */ -public abstract class AbstractAggregateContext extends AbstractContext implements AutowireContext, ScopeAwareContext { - - public static final int DEFAULT_WAIT = 1000 * 60; - - // ---------------------------------- - // Fields - // ---------------------------------- - - // The parent context, if one exists - @ParentContext - protected AggregateContext parentContext; - - // The parent configuration context, if one exists - @Autowire(required = false) - protected ConfigurationContext configurationContext; - - // The system monitor factory - @Autowire(required = false) - protected MonitorFactory monitorFactory; - - // The logical model representing the module assembly - // protected ModuleComponent moduleComponent; - protected Module module; - - protected Map> configurations = new HashMap(); - - // Factory for scope contexts - @Autowire(required = false) - protected ScopeStrategy scopeStrategy; - - // The event context for associating context events to threads - protected EventContext eventContext; - - // The scopes for this context - protected Map scopeContexts; - - protected Map immutableScopeContexts; - - // A component context name to scope context index - protected Map scopeIndex; - - // Listeners for context events - protected List listeners = new CopyOnWriteArrayList(); - - // Blocking latch to ensure the module is initialized exactly once prior to servicing requests - protected CountDownLatch initializeLatch = new CountDownLatch(1); - - // Indicates whether the module context has been initialized - protected boolean initialized; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public AbstractAggregateContext() { - scopeIndex = new ConcurrentHashMap(); - // FIXME the factory should be injected - module = new AssemblyFactoryImpl().createModule(); - } - - public AbstractAggregateContext(String name, AggregateContext parent, ScopeStrategy strategy, EventContext ctx, - ConfigurationContext configCtx, MonitorFactory factory) { - super(name); - this.scopeStrategy = strategy; - this.eventContext = ctx; - this.configurationContext = configCtx; - this.monitorFactory = factory; - scopeIndex = new ConcurrentHashMap(); - parentContext = parent; - // FIXME the factory should be injected - module = new AssemblyFactoryImpl().createModule(); - } - - // ---------------------------------- - // Lifecycle methods - // ---------------------------------- - - public void start() { - synchronized (initializeLatch) { - try { - if (lifecycleState != UNINITIALIZED && lifecycleState != STOPPED) { - throw new IllegalStateException("Context not in UNINITIALIZED state"); - } - lifecycleState = INITIALIZING; - initializeScopes(); - - Map>> configurationsByScope = new HashMap(); - if (configurations != null) { - for (RuntimeConfiguration source : configurations.values()) { - // FIXME scopes are defined at the interface level - Scope sourceScope = source.getScope(); - wireSource(source); - buildTarget(source); - scopeIndex.put(source.getName(), scopeContexts.get(sourceScope)); - List> list = configurationsByScope.get(sourceScope); - if (list == null) { - list = new ArrayList(); - configurationsByScope.put(sourceScope, list); - } - list.add(source); - } - } - for (EntryPoint ep : module.getEntryPoints()) { - registerAutowire(ep); - } - for (Component component : module.getComponents()) { - registerAutowire(component); - } - for (ExternalService es : module.getExternalServices()) { - registerAutowire(es); - } - for (Map.Entry entries : configurationsByScope.entrySet()) { - // register configurations with scope contexts - ScopeContext scope = scopeContexts.get(entries.getKey()); - scope.registerConfigurations((List>) entries.getValue()); - } - initializeProxies(); - for (ScopeContext scope : scopeContexts.values()) { - // register scope contexts as a listeners for events in the aggregate context - registerListener(scope); - scope.start(); - } - lifecycleState = RUNNING; - } catch (ProxyInitializationException e) { - lifecycleState = ERROR; - ContextInitException cie = new ContextInitException(e); - cie.addContextName(getName()); - throw cie; - } catch (ConfigurationException e) { - lifecycleState = ERROR; - throw new ContextInitException(e); - } catch (CoreRuntimeException e) { - lifecycleState = ERROR; - e.addContextName(getName()); - throw e; - } finally { - initialized = true; - // release the latch and allow requests to be processed - initializeLatch.countDown(); - } - } - } - - public void stop() { - if (lifecycleState == STOPPED) { - return; - } - // need to block a start until reset is complete - initializeLatch = new CountDownLatch(2); - lifecycleState = STOPPING; - initialized = false; - if (scopeContexts != null) { - for (ScopeContext scope : scopeContexts.values()) { - try { - if (scope.getLifecycleState() == ScopeContext.RUNNING) { - scope.stop(); - } - } catch (ScopeRuntimeException e) { - // log.error("Error stopping scope container [" + scopeContainers[i].getName() + "]", e); - } - } - } - scopeContexts = null; - scopeIndex.clear(); - // allow initialized to be called - initializeLatch.countDown(); - lifecycleState = STOPPED; - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public void setModule(Module module) { - assert (module != null) : "Module cannot be null"; - name = module.getName(); - this.module = module; - } - - public void setScopeStrategy(ScopeStrategy scopeStrategy) { - this.scopeStrategy = scopeStrategy; - } - - public void setEventContext(EventContext eventContext) { - this.eventContext = eventContext; - } - - public void setMonitorFactory(MonitorFactory factory) { - this.monitorFactory = factory; - } - - public AggregateContext getParent() { - return parentContext; - } - - public void registerModelObjects(List models) throws ConfigurationException { - assert (models != null) : "Model object collection was null"; - for (Extensible model : models) { - registerModelObject(model); - } - } - - public void registerModelObject(Extensible model) throws ConfigurationException { - assert (model != null) : "Model object was null"; - initializeScopes(); - if (configurationContext != null) { - try { - configurationContext.configure(model); - configurationContext.build(this, model); - } catch (ConfigurationException e) { - e.addContextName(getName()); - throw e; - } catch (BuilderConfigException e) { - e.addContextName(getName()); - throw e; - } - } - RuntimeConfiguration configuration = null; - if (model instanceof Module) { - // merge new module definition with the existing one - Module oldModule = module; - Module newModule = (Module) model; - module = newModule; - for (Component component : newModule.getComponents()) { - ComponentImplementation componentImplementation = component.getComponentImplementation(); - if (componentImplementation == null) { - ConfigurationException e = new ConfigurationException("Component implementation not set"); - e.addContextName(component.getName()); - e.addContextName(getName()); - throw e; - } - configuration = (RuntimeConfiguration) componentImplementation.getRuntimeConfiguration(); - if (configuration == null) { - ConfigurationException e = new ConfigurationException("Runtime configuration not set"); - e.addContextName(component.getName()); - e.addContextName(getName()); - throw e; - } - registerConfiguration(configuration); - registerAutowire(component); - } - for (EntryPoint ep : newModule.getEntryPoints()) { - configuration = (RuntimeConfiguration) ep.getConfiguredReference().getRuntimeConfiguration(); - if (configuration == null) { - ConfigurationException e = new ConfigurationException("Runtime configuration not set"); - e.setIdentifier(ep.getName()); - e.addContextName(getName()); - throw e; - } - registerConfiguration(configuration); - registerAutowire(ep); - } - for (ExternalService service : newModule.getExternalServices()) { - configuration = (RuntimeConfiguration) service.getConfiguredService().getRuntimeConfiguration(); - if (configuration == null) { - ConfigurationException e = new ConfigurationException("Runtime configuration not set"); - e.setIdentifier(service.getName()); - e.addContextName(getName()); - throw e; - } - registerConfiguration(configuration); - registerAutowire(service); - } - if (lifecycleState == RUNNING) { - for (Component component : newModule.getComponents()) { - RuntimeConfiguration config = (RuntimeConfiguration) component - .getComponentImplementation().getRuntimeConfiguration(); - wireSource(config); - buildTarget(config); - try { - if (config.getSourceProxyFactories() != null) { - for (ProxyFactory sourceProxyFactory : (Collection) config.getSourceProxyFactories() - .values()) { - sourceProxyFactory.initialize(); - } - } - if (config.getTargetProxyFactories() != null) { - for (ProxyFactory targetProxyFactory : (Collection) config.getTargetProxyFactories() - .values()) { - targetProxyFactory.initialize(); - } - } - } catch (ProxyInitializationException e) { - throw new ConfigurationException(e); - } - - } - for (EntryPoint ep : newModule.getEntryPoints()) { - RuntimeConfiguration config = (RuntimeConfiguration) ep - .getConfiguredReference().getRuntimeConfiguration(); - wireSource(config); - buildTarget(config); - try { - if (config.getSourceProxyFactories() != null) { - for (ProxyFactory sourceProxyFactory : (Collection) config.getSourceProxyFactories() - .values()) { - sourceProxyFactory.initialize(); - } - } - if (config.getTargetProxyFactories() != null) { - for (ProxyFactory targetProxyFactory : (Collection) config.getTargetProxyFactories() - .values()) { - targetProxyFactory.initialize(); - } - } - } catch (ProxyInitializationException e) { - throw new ConfigurationException(e); - } - - } - for (ExternalService es : newModule.getExternalServices()) { - RuntimeConfiguration config = (RuntimeConfiguration) es - .getConfiguredService().getRuntimeConfiguration(); - buildTarget(config); - try { - if (config.getSourceProxyFactories() != null) { - for (ProxyFactory sourceProxyFactory : (Collection) config.getSourceProxyFactories() - .values()) { - sourceProxyFactory.initialize(); - } - } - if (config.getTargetProxyFactories() != null) { - for (ProxyFactory targetProxyFactory : (Collection) config.getTargetProxyFactories() - .values()) { - targetProxyFactory.initialize(); - } - } - } catch (ProxyInitializationException e) { - throw new ConfigurationException(e); - } - - } - - } - // merge existing module component assets - module.getComponents().addAll(oldModule.getComponents()); - module.getEntryPoints().addAll(oldModule.getEntryPoints()); - module.getExternalServices().addAll(oldModule.getExternalServices()); - } else { - if (model instanceof Component) { - Component component = (Component) model; - module.getComponents().add(component); - configuration = (RuntimeConfiguration) component.getComponentImplementation() - .getRuntimeConfiguration(); - } else if (model instanceof EntryPoint) { - EntryPoint ep = (EntryPoint) model; - module.getEntryPoints().add(ep); - configuration = (RuntimeConfiguration) ep.getConfiguredReference().getRuntimeConfiguration(); - } else if (model instanceof ExternalService) { - ExternalService service = (ExternalService) model; - module.getExternalServices().add(service); - configuration = (RuntimeConfiguration) service.getConfiguredService().getRuntimeConfiguration(); - } else { - BuilderConfigException e = new BuilderConfigException("Unknown model type"); - e.setIdentifier(model.getClass().getName()); - e.addContextName(getName()); - throw e; - } - if (configuration == null) { - ConfigurationException e = new ConfigurationException("Runtime configuration not set"); - if (model instanceof Part) { - e.setIdentifier(((Part) model).getName()); - } - e.addContextName(getName()); - throw e; - } - registerConfiguration(configuration); - registerAutowire(model); - } - } - - protected void registerConfiguration(RuntimeConfiguration configuration) throws ConfigurationException { - if (lifecycleState == RUNNING) { - if (scopeIndex.get(configuration.getName()) != null) { - throw new DuplicateNameException(configuration.getName()); - } - ScopeContext scope = scopeContexts.get(configuration.getScope()); - if (scope == null) { - ConfigurationException e = new ConfigurationException("Component has an unknown scope"); - e.addContextName(configuration.getName()); - e.addContextName(getName()); - throw e; - } - scope.registerConfiguration(configuration); - scopeIndex.put(configuration.getName(), scope); - configurations.put(configuration.getName(), configuration); // xcv - } else { - if (configurations.get(configuration.getName()) != null) { - throw new DuplicateNameException(configuration.getName()); - } - configurations.put(configuration.getName(), configuration); - } - - } - - public void registerListener(RuntimeEventListener listener) { - assert (listener != null) : "Listener cannot be null"; - listeners.add(listener); - } - - public void fireEvent(int eventType, Object message) throws EventException { - checkInit(); - if (eventType == SESSION_NOTIFY) { - // update context - eventContext.setIdentifier(HTTP_SESSION, message); - } else if (eventType == REQUEST_END) { - // be very careful with pooled threads, ensuring threadlocals are cleaned up - eventContext.clearIdentifier(HTTP_SESSION); - } - for (RuntimeEventListener listener : listeners) { - listener.onEvent(eventType, message); - } - } - - public InstanceContext getContext(String componentName) { - checkInit(); - assert (componentName != null) : "Name was null"; - ScopeContext scope = scopeIndex.get(componentName); - if (scope == null) { - return null; - } - return scope.getContext(componentName); - - } - - public Object getInstance(QualifiedName qName) throws TargetException { - return getInstance(qName, true); - } - - public Object getInstance(QualifiedName qName, boolean notify) throws TargetException { - assert (qName != null) : "Name was null "; - // use the port name to get the context since entry points ports - ScopeContext scope = scopeIndex.get(qName.getPortName()); - if (scope == null) { - return null; - } - InstanceContext ctx = scope.getContext(qName.getPortName()); - if (!(ctx instanceof EntryPointContext)) { - TargetException e = new TargetException("Target not an entry point"); - e.setIdentifier(qName.getQualifiedName()); - e.addContextName(name); - throw e; - } - return ctx.getInstance(null, notify); - } - - public Object locateInstance(String qualifiedName) throws TargetException { - checkInit(); - QualifiedName qName = new QualifiedName(qualifiedName); - ScopeContext scope = scopeIndex.get(qName.getPartName()); - if (scope == null) { - TargetException e = new TargetException("Component not found"); - e.setIdentifier(qualifiedName); - e.addContextName(getName()); - throw e; - } - InstanceContext ctx = scope.getContext(qName.getPartName()); - try { - return ctx.getInstance(qName, true); - } catch (TargetException e) { - e.addContextName(getName()); - throw e; - } - } - - public Map getScopeContexts() { - initializeScopes(); - return immutableScopeContexts; - } - - // ---------------------------------- - // Abstract methods - // ---------------------------------- - - /** - * Registers a model object as autowirable - * - * @throws ContextInitException - */ - protected abstract void registerAutowire(Extensible model) throws ConfigurationException; - - // ---------------------------------- - // Protected methods - // ---------------------------------- - - /** - * Blocks until the module context has been initialized - */ - protected void checkInit() { - if (!initialized) { - try { - /* block until the module has initialized */ - boolean success = initializeLatch.await(DEFAULT_WAIT, TimeUnit.MILLISECONDS); - if (!success) { - throw new ContextInitException("Timeout waiting for module context to initialize"); - } - } catch (InterruptedException e) { // should not happen - } - } - - } - - protected void initializeScopes() { - if (scopeContexts == null) { - if (scopeStrategy == null) { - scopeStrategy = new DefaultScopeStrategy(); - } - scopeContexts = scopeStrategy.createScopes(eventContext); - immutableScopeContexts = Collections.unmodifiableMap(scopeContexts); - } - } - - /** - * Iterates through references and delegates to the configuration context to wire them to their targets - */ - protected void wireSource(RuntimeConfiguration source) { - Scope sourceScope = source.getScope(); - if (source.getSourceProxyFactories() != null) { - for (ProxyFactory sourceFactory : ((Map) source.getSourceProxyFactories()).values()) { - QualifiedName targetName = sourceFactory.getProxyConfiguration().getTargetName(); - RuntimeConfiguration target = configurations.get(targetName.getPartName()); - if (target == null) { - ContextInitException e = new ContextInitException("Target not found"); - e.setIdentifier(targetName.getPartName()); - e.addContextName(source.getName()); - e.addContextName(name); - throw e; - } - // get the proxy chain for the target - ProxyFactory targetFactory = target.getTargetProxyFactory(sourceFactory.getProxyConfiguration().getTargetName() - .getPortName()); - if (targetFactory == null) { - ContextInitException e = new ContextInitException("No proxy factory found for service"); - e.setIdentifier(sourceFactory.getProxyConfiguration().getTargetName().getPortName()); - e.addContextName(target.getName()); - e.addContextName(source.getName()); - e.addContextName(name); - throw e; - } - boolean downScope = scopeStrategy.downScopeReference(sourceScope, target.getScope()); - configurationContext.wire(sourceFactory, targetFactory, target.getClass(), downScope, scopeContexts.get(target - .getScope())); - } - } - // wire invokers when the proxy only contains the target chain - if (source.getTargetProxyFactories() != null) { - for (ProxyFactory targetFactory : ((Map) source.getTargetProxyFactories()).values()) { - configurationContext.wire(targetFactory, source.getClass(), scopeContexts.get(sourceScope)); - } - } - source.prepare(); - } - - /** - * Signals to target side of reference configurations to initialize - */ - protected void buildTarget(RuntimeConfiguration target) { - if (target.getTargetProxyFactories() != null) { - for (ProxyFactory targetFactory : ((Map) target.getTargetProxyFactories()).values()) { - for (InvocationConfiguration iConfig : (Collection) targetFactory - .getProxyConfiguration().getInvocationConfigurations().values()) { - iConfig.build(); - } - } - } - } - - protected void initializeProxies() throws ProxyInitializationException { - for (RuntimeConfiguration config : configurations.values()) { - if (config.getSourceProxyFactories() != null) { - for (ProxyFactory sourceProxyFactory : (Collection) config.getSourceProxyFactories().values()) { - sourceProxyFactory.initialize(); - } - } - if (config.getSourceProxyFactories() != null) { - for (ProxyFactory targetProxyFactory : (Collection) config.getTargetProxyFactories().values()) { - targetProxyFactory.initialize(); - } - } - } - } - - /** - * @see org.apache.tuscany.core.context.AggregateContext#getAggregate() - */ - public Aggregate getAggregate() { - return module; - } -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/impl/AggregateContextImpl.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/impl/AggregateContextImpl.java deleted file mode 100644 index 69e0b8edfc..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/impl/AggregateContextImpl.java +++ /dev/null @@ -1,222 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context.impl; - -import org.apache.tuscany.common.monitor.MonitorFactory; -import org.apache.tuscany.core.builder.BuilderConfigException; -import org.apache.tuscany.core.config.ConfigurationException; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.AutowireContext; -import org.apache.tuscany.core.context.AutowireResolutionException; -import org.apache.tuscany.core.context.ConfigurationContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.context.ScopeStrategy; -import org.apache.tuscany.core.context.ServiceNotFoundException; -import org.apache.tuscany.core.context.TargetException; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.apache.tuscany.model.assembly.Extensible; -import org.osoa.sca.ModuleContext; -import org.osoa.sca.RequestContext; -import org.osoa.sca.ServiceReference; -import org.osoa.sca.ServiceUnavailableException; - -/** - * The standard implementation of an aggregate context. Autowiring is performed by delegating to the parent context. - * - * @version $Rev$ $Date$ - */ -public class AggregateContextImpl extends AbstractAggregateContext implements ConfigurationContext, ModuleContext { - - // ---------------------------------- - // Fields - // ---------------------------------- - - @Autowire(required = false) - private AutowireContext autowireContext; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public AggregateContextImpl() { - super(); - eventContext = new EventContextImpl(); - } - - public AggregateContextImpl(String name, AggregateContext parent, ScopeStrategy strategy, EventContext ctx, - ConfigurationContext configCtx, MonitorFactory factory) { - super(name, parent, strategy, ctx, configCtx, factory); - } - - public AggregateContextImpl(String name, AggregateContext parent, AutowireContext autowireContext, ScopeStrategy strategy, - EventContext ctx, ConfigurationContext configCtx, MonitorFactory factory) { - super(name, parent, strategy, ctx, configCtx, factory); - this.autowireContext = autowireContext; - } - - // ---------------------------------- - // ModuleContext methods - // ---------------------------------- - - private String uri; - - public String getURI() { - return uri; - } - - public void setURI(String uri) { - this.uri = uri; - } - - public Object locateService(String qualifiedName) throws ServiceUnavailableException { - checkInit(); - QualifiedName qName = new QualifiedName(qualifiedName); - ScopeContext scope = scopeIndex.get(qName.getPartName()); - if (scope == null) { - throw new ServiceNotFoundException(qualifiedName); - } - InstanceContext ctx = scope.getContext(qName.getPartName()); - try { - Object o = ctx.getInstance(qName, true); - if (o == null) { - throw new ServiceUnavailableException(qualifiedName); - } - return o; - } catch (TargetException e) { - e.addContextName(getName()); - throw new ServiceUnavailableException(e); - } - } - - public ServiceReference createServiceReference(String serviceName) { - throw new UnsupportedOperationException(); - } - - public RequestContext getRequestContext() { - throw new UnsupportedOperationException(); - } - - public ServiceReference createServiceReferenceForSession(Object self) { - throw new UnsupportedOperationException(); - } - - public ServiceReference createServiceReferenceForSession(Object self, String serviceName) { - throw new UnsupportedOperationException(); - } - - public ServiceReference newSession(String serviceName) { - throw new UnsupportedOperationException(); - } - - public ServiceReference newSession(String serviceName, Object sessionId) { - throw new UnsupportedOperationException(); - } - - // ---------------------------------- - // AutowireContext methods - // ---------------------------------- - - public T resolveInstance(Class instanceInterface) throws AutowireResolutionException { - if (MonitorFactory.class.equals(instanceInterface)) { - return instanceInterface.cast(monitorFactory); - } else if (ConfigurationContext.class.equals(instanceInterface)) { - return instanceInterface.cast(this); - } else if (AutowireContext.class.equals(instanceInterface)) { - return instanceInterface.cast(this); - } - if (autowireContext != null) { - try { - return autowireContext.resolveInstance(instanceInterface); - } catch (AutowireResolutionException e) { - e.addContextName(getName()); - throw e; - } - } - return null; - } - - @Override - protected void registerAutowire(Extensible model) { - // this context only delegates autowiring - } - - // ---------------------------------- - // ConfigurationContext methods - // ---------------------------------- - - public void configure(Extensible model) throws ConfigurationException { - if (configurationContext != null) { - try { - configurationContext.configure(model); - } catch (ConfigurationException e) { - e.addContextName(getName()); - throw e; - } - } - } - - public void build(AggregateContext parent, Extensible model) throws BuilderConfigException { - if (configurationContext != null) { - try { - configurationContext.build(parent, model); - } catch (BuilderConfigException e) { - e.addContextName(getName()); - throw e; - } - } - } - - public void wire(ProxyFactory sourceFactory, ProxyFactory targetFactory, Class targetType, boolean downScope, - ScopeContext targetScopeContext) throws BuilderConfigException { - if (configurationContext != null) { - try { - configurationContext.wire(sourceFactory, targetFactory, targetType, downScope, targetScopeContext); - } catch (BuilderConfigException e) { - e.addContextName(getName()); - throw e; - } - } - } - - public void wire(ProxyFactory targetFactory, Class targetType, ScopeContext targetScopeContext) throws BuilderConfigException { - if (configurationContext != null) { - try { - configurationContext.wire(targetFactory, targetType, targetScopeContext); - } catch (BuilderConfigException e) { - e.addContextName(getName()); - throw e; - } - } - } - - // ---------------------------------- - // InstanceContext methods - // ---------------------------------- - - public Object getImplementationInstance() throws TargetException { - return this; - } - - public Object getImplementationInstance(boolean notify) throws TargetException { - return this; - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/impl/EntryPointContextImpl.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/impl/EntryPointContextImpl.java deleted file mode 100644 index 791ce6b8a5..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/impl/EntryPointContextImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context.impl; - -import java.lang.reflect.InvocationHandler; - -import org.apache.tuscany.core.context.AbstractContext; -import org.apache.tuscany.core.context.ContextInitException; -import org.apache.tuscany.core.context.CoreRuntimeException; -import org.apache.tuscany.core.context.EntryPointContext; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.TargetException; -import org.apache.tuscany.core.invocation.jdk.JDKInvocationHandler; -import org.apache.tuscany.core.invocation.spi.ProxyCreationException; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.message.MessageFactory; - -/** - * The default implementation of an entry point context - * - * @version $Rev$ $Date$ - */ -public class EntryPointContextImpl extends AbstractContext implements EntryPointContext { - - private MessageFactory messageFactory; - - private ProxyFactory proxyFactory; - - private Object target; - - private InvocationHandler invocationHandler; - - // a proxy implementing the service exposed by the entry point backed by the invocation handler - private Object proxy; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - /** - * Creates a new entry point - * - * @param name the entry point name - * @param proxyFactory the proxy factory containing the invocation chains for the entry point - * @param parentContext the containing aggregate of the entry point - * @param messageFactory a factory for generating invocation messages - * @throws ContextInitException if an error occurs creating the entry point - */ - public EntryPointContextImpl(String name, ProxyFactory proxyFactory, MessageFactory messageFactory) - throws ContextInitException { - super(name); - assert (proxyFactory != null) : "Proxy factory was null"; - assert (messageFactory != null) : "Message factory was null"; - this.proxyFactory = proxyFactory; - this.messageFactory = messageFactory; - invocationHandler = new JDKInvocationHandler(messageFactory, proxyFactory.getProxyConfiguration() - .getInvocationConfigurations()); - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public Object getInstance(QualifiedName qName) throws TargetException { - if (proxy == null) { - try { - proxy = proxyFactory.createProxy(); - } catch (ProxyCreationException e) { - TargetException te = new TargetException(e); - te.addContextName(getName()); - throw te; - } - } - return proxy; - } - - public Object getInstance(QualifiedName qName, boolean notify) throws TargetException { - return getInstance(qName); - } - - public void start() throws ContextInitException { - lifecycleState = RUNNING; - } - - public void stop() throws CoreRuntimeException { - lifecycleState = STOPPED; - } - - // ---------------------------------- - // InstanceContext methods - // ---------------------------------- - - public Object getImplementationInstance() throws TargetException { - return invocationHandler; - } - - public Object getImplementationInstance(boolean notify) throws TargetException { - return getImplementationInstance(); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/impl/EventContextImpl.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/impl/EventContextImpl.java deleted file mode 100644 index accf6b3030..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/impl/EventContextImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context.impl; - -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.ScopeIdentifier; - -/** - * An implementation of an {@link org.apache.tuscany.core.context.EventContext} that handles event-to-thread associations using an - * InheritableThreadLocal - * - * @version $Rev$ $Date$ - */ -public class EventContextImpl implements EventContext { - - // @TODO design a proper propagation strategy for creating new threads - /* - * a map ( associated with the current thread) of scope identifiers keyed on the event context id type. the scope identifier - * may be a {@link ScopeIdentifier} or an opaque id - */ - private ThreadLocal eventContext = new InheritableThreadLocal(); - - public Object getIdentifier(Object type) { - Map map = eventContext.get(); - if (map == null) { - return null; - } - Object currentId = map.get(type); - if (currentId instanceof ScopeIdentifier) { - currentId = ((ScopeIdentifier) currentId).getIdentifier(); - // once we have accessed the id, replace the lazy wrapper - map.put(type, currentId); - } - return currentId; - } - - public void setIdentifier(Object type, Object identifier) { - Map map = eventContext.get(); - if (map == null) { - map = new HashMap(); - eventContext.set(map); - } - map.put(type, identifier); - } - - public void clearIdentifier(Object type) { - if (type == null) { - return; - } - Map map = eventContext.get(); - if (map != null) { - map.remove(type); - } - } - - public EventContextImpl() { - super(); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/impl/ExternalServiceContextImpl.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/impl/ExternalServiceContextImpl.java deleted file mode 100644 index a73081ef66..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/impl/ExternalServiceContextImpl.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context.impl; - -import org.apache.tuscany.core.builder.ObjectFactory; -import org.apache.tuscany.core.context.AbstractContext; -import org.apache.tuscany.core.context.CoreRuntimeException; -import org.apache.tuscany.core.context.ExternalServiceContext; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.TargetException; -import org.apache.tuscany.core.invocation.spi.ProxyCreationException; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; - -/** - * The default implementation of an external service context - * - * @version $Rev$ $Date$ - */ -public class ExternalServiceContextImpl extends AbstractContext implements ExternalServiceContext { - - private ProxyFactory targetProxyFactory; - - private ObjectFactory targetInstanceFactory; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - /** - * Creates an external service context - * - * @param name the name of the external service - * @param targetProxyFactory the factory which creates proxies implementing the configured service interface for the - * external service. There is always only one proxy factory as an external service is configured with one - * service - * @param targetInstanceFactory the object factory that creates an artifact capabile of communicating over the - * binding transport configured on the external service. The object factory may implement a caching strategy. - */ - public ExternalServiceContextImpl(String name, ProxyFactory targetProxyFactory, ObjectFactory targetInstanceFactory) { - super(name); - assert (targetProxyFactory != null) : "Target proxy factory was null"; - assert (targetInstanceFactory != null) : "Target instance factory was null"; - this.targetProxyFactory = targetProxyFactory; - this.targetInstanceFactory = targetInstanceFactory; - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public Object getInstance(QualifiedName qName) throws TargetException { - try { - return targetProxyFactory.createProxy(); - // TODO do we cache the proxy, (assumes stateful capabilities will be provided in an interceptor) - } catch (ProxyCreationException e) { - TargetException te = new TargetException(e); - te.addContextName(getName()); - throw te; - } - } - - public Object getInstance(QualifiedName qName, boolean notify) throws TargetException { - return getInstance(qName); - } - - public void start() throws CoreRuntimeException { - lifecycleState = RUNNING; - } - - public void stop() throws CoreRuntimeException { - lifecycleState = STOPPED; - } - - public Object getImplementationInstance() throws TargetException { - return targetInstanceFactory.getInstance(); - } - - public Object getImplementationInstance(boolean notify) throws TargetException { - return getImplementationInstance(); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/AbstractScopeContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/AbstractScopeContext.java deleted file mode 100644 index 449af4bdf8..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/AbstractScopeContext.java +++ /dev/null @@ -1,158 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context.scope; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.AbstractContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.context.TargetException; - -/** - * Implements functionality common to scope contexts. - *

- * NB: Minimal synchronization is performed, particularly for initializing and destroying scopes, and it is - * assumed the scope container will block requests until these operations have completed. - * - * @version $Rev$ $Date$ - */ -public abstract class AbstractScopeContext extends AbstractContext implements ScopeContext{ - // ---------------------------------- - // Fields - // ---------------------------------- - - // The collection of runtime configurations for the scope - protected Map> runtimeConfigurations = new ConcurrentHashMap(); - - // The event context the scope container is associated with - protected EventContext eventContext; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public AbstractScopeContext(EventContext eventContext) { - assert (eventContext != null) : "Event context was null"; - this.eventContext = eventContext; - } - - // ---------------------------------- - // Lifecycle methods - // --------------------------_-------- - - public synchronized void start() { - } - - public synchronized void stop() { - } - - - // ---------------------------------- - // Scope methods - // ---------------------------------- - - public void registerConfigurations(List> configurations) { - for (RuntimeConfiguration configuration : configurations) { - runtimeConfigurations.put(configuration.getName(), configuration); - } - } - - public Object getInstance(QualifiedName qName) throws TargetException { - Object instance = null; - InstanceContext context = getContext(qName.getPartName()); - if (context == null) { - TargetException e = new TargetException("Target not found"); - e.setIdentifier(qName.getQualifiedName()); - throw e; - } - return context.getInstance(qName); - } - - public Object getInstance(QualifiedName qName, boolean notify) throws TargetException { - return getInstance(qName); - } - - //---------------------------------- - // InstanceContext methods - //---------------------------------- - - public Object getImplementationInstance() throws TargetException{ - return this; - } - - public Object getImplementationInstance(boolean notify) throws TargetException{ - return this; - } - - // ---------------------------------- - // Protected methods - // ---------------------------------- - - protected EventContext getEventContext() { - return eventContext; - } - - /** - * Notfies instances that are associated with a context and configured to receive callbacks that the context is - * being destroyed in reverse order - * - * @param key the context key - */ - protected void notifyInstanceShutdown(Object key) { - InstanceContext[] contexts = getShutdownContexts(key); - if ((contexts == null) || (contexts.length < 1)) { - return; - } - // shutdown destroyable instances in reverse instantiation order - for (int i = contexts.length - 1; i >= 0; i--) { - InstanceContext context = contexts[i]; - - if (context.getLifecycleState() == Context.RUNNING) { - synchronized (context) { - context.setLifecycleState(Context.STOPPING); - removeContextByKey(context.getName(), key); - try { - context.stop(); - } catch (TargetException e) { - // TODO send a monitoring event - // log.error("Error releasing instance [" + context.getName() + "]",e); - } - } - } - } - } - - protected void checkInit() { - if (lifecycleState != RUNNING) { - throw new IllegalStateException("Scope not running [" + lifecycleState + "]"); - } - } - - /** - * Returns an array of contexts that need to be notified of scope shutdown. The array must be in the order in which - * component contexts were created - */ - protected abstract InstanceContext[] getShutdownContexts(Object key); - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/AbstractScopeStrategy.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/AbstractScopeStrategy.java deleted file mode 100644 index f89d09196d..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/AbstractScopeStrategy.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context.scope; - -import org.apache.tuscany.core.context.ScopeStrategy; -import org.apache.tuscany.model.assembly.Scope; - -/** - * Implements basic scope strategy functionality - * - * @version $Rev$ $Date$ - */ -public abstract class AbstractScopeStrategy implements ScopeStrategy { - - public AbstractScopeStrategy() { - } - - /** - * Determines legal scope references according to standard SCA scope rules - * - * @param pReferrer the scope of the component making the reference - * @param pReferee the scope of the component being referred to - */ - public boolean downScopeReference(Scope pReferrer, Scope pReferee) { - if (pReferrer == Scope.UNDEFINED || pReferee == Scope.UNDEFINED) { - return false; - } - if (pReferee == pReferrer){ - return false; - }else if(pReferrer == Scope.INSTANCE){ - return false; - }else if(pReferee == Scope.INSTANCE){ - return true; - }else if (pReferrer == Scope.REQUEST && pReferee == Scope.SESSION){ - return false; - }else if (pReferrer == Scope.REQUEST && pReferee == Scope.MODULE){ - return false; -// }else if (pReferrer == Scope.SESSION && pReferee == Scope.REQUEST){ -// return true; - }else if (pReferrer == Scope.SESSION && pReferee == Scope.MODULE){ - return false; -// }else if (pReferrer == Scope.MODULE){ -// return true; - }else{ - return true; - } - //FIXME Jim this does not work with enumerations, what does it mean to have a scope <0? -// } else if ((pReferrer < 0) || (pReferee < 0)) { -// return false; -// } -// -// return (pReferrer > pReferee); -// return pReferrer != pReferee; - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/AggregateScopeContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/AggregateScopeContext.java deleted file mode 100644 index 19f554a625..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/AggregateScopeContext.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context.scope; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.AbstractContext; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.EventException; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.context.ScopeInitializationException; -import org.apache.tuscany.core.context.ScopeRuntimeException; -import org.apache.tuscany.core.context.TargetException; - -/** - * Manages the lifecycle of aggregate component contexts, i.e. contexts which contain child contexts - * - * @see org.apache.tuscany.core.context.AggregateContext - * @version $Rev$ $Date$ - */ -public class AggregateScopeContext extends AbstractContext implements ScopeContext { - - // ---------------------------------- - // Fields - // ---------------------------------- - - private EventContext eventContext; - - private List> configs = new ArrayList(); - - // Aggregate component contexts in this scope keyed by name - private Map contexts = new ConcurrentHashMap(); - - // indicates if a module start event has been previously propagated so child contexts added after can be notified - private boolean moduleScopeStarted; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public AggregateScopeContext(EventContext eventContext) { - assert (eventContext != null) : "Event context was null"; - this.eventContext = eventContext; - name = "Aggregate Scope"; - } - - // ---------------------------------- - // Lifecycle methods - // ---------------------------------- - - public void start() throws ScopeInitializationException { - for (RuntimeConfiguration configuration : configs) { - InstanceContext context = configuration.createInstanceContext(); - if (!(context instanceof AggregateContext)) { - ScopeInitializationException e = new ScopeInitializationException("Context not an aggregate type"); - e.addContextName(context.getName()); - throw e; - } - AggregateContext aggregateCtx = (AggregateContext) context; - aggregateCtx.start(); - contexts.put(aggregateCtx.getName(), aggregateCtx); - } - lifecycleState = RUNNING; - } - - public void stop() throws ScopeRuntimeException { - for (AggregateContext context : contexts.values()) { - context.stop(); - } - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public void registerConfigurations(List> configurations) { - this.configs = configurations; - } - - public void registerConfiguration(RuntimeConfiguration configuration) { - assert (configuration != null) : "Configuration was null"; - configs.add(configuration); - if (lifecycleState == RUNNING) { - InstanceContext context = configuration.createInstanceContext(); - if (!(context instanceof AggregateContext)) { - ScopeInitializationException e = new ScopeInitializationException("Context not an aggregate type"); - e.setIdentifier(context.getName()); - throw e; - } - AggregateContext aggregateCtx = (AggregateContext) context; - aggregateCtx.start(); - if (moduleScopeStarted) { - aggregateCtx.fireEvent(EventContext.MODULE_START, null); - } - contexts.put(aggregateCtx.getName(), aggregateCtx); - } - } - - public boolean isCacheable() { - return false; - } - - public Object getInstance(QualifiedName qName) throws TargetException { - Object instance = null; - InstanceContext context = getContext(qName.getPartName()); - if (context == null) { - TargetException e = new TargetException("Component not found"); - e.setIdentifier(qName.getQualifiedName()); - throw e; - } - return context.getInstance(qName); - } - - public Object getInstance(QualifiedName qName, boolean notify) throws TargetException { - return getInstance(qName); - } - - public InstanceContext getContext(String ctxName) { - checkInit(); - return contexts.get(ctxName); - } - - public InstanceContext getContextByKey(String ctxName, Object key) { - return getContext(ctxName); - } - - public void removeContext(String ctxName) throws ScopeRuntimeException { - InstanceContext context = contexts.remove(ctxName); - if (context != null) { - context.stop(); - } - } - - public void removeContextByKey(String ctxName, Object key) throws ScopeRuntimeException { - } - - public void onEvent(int type, Object message) throws EventException { - if (type == EventContext.MODULE_START) { - // track module starting so that aggregate contexts registered after the event are notified properly - moduleScopeStarted = true; - } else if (type == EventContext.MODULE_STOP) { - moduleScopeStarted = false; - } - // propagate events to child contexts - for (AggregateContext context : contexts.values()) { - context.fireEvent(type, message); - } - } - - public Object getImplementationInstance() throws TargetException{ - return this; - } - - public Object getImplementationInstance(boolean notify) throws TargetException{ - return this; - } - - private void checkInit() { - if (lifecycleState != RUNNING) { - throw new IllegalStateException("Scope not running [" + lifecycleState + "]"); - } - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/DefaultScopeStrategy.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/DefaultScopeStrategy.java deleted file mode 100644 index 509eb7941f..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/DefaultScopeStrategy.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context.scope; - -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.model.assembly.Scope; - -/** - * Implements a {@link org.apache.tuscany.core.context.ScopeStrategy} for the default module scopes: stateless, request, session, - * and module. - * - * @version $Rev$ $Date$ - */ -public class DefaultScopeStrategy extends AbstractScopeStrategy { - - public DefaultScopeStrategy() { - } - - public Map createScopes(EventContext eventContext) { - ScopeContext moduleScope = new ModuleScopeContext(eventContext); - ScopeContext sessionScope = new HttpSessionScopeContext(eventContext); - ScopeContext requestScope = new RequestScopeContext(eventContext); - ScopeContext statelessScope = new StatelessScopeContext(eventContext); - ScopeContext aggregrateScope = new AggregateScopeContext(eventContext); - Map scopes = new HashMap(); - scopes.put(Scope.MODULE,moduleScope); - scopes.put(Scope.SESSION,sessionScope); - scopes.put(Scope.REQUEST,requestScope); - scopes.put(Scope.INSTANCE,statelessScope); - scopes.put(Scope.AGGREGATE,aggregrateScope); - return scopes; - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/HttpSessionScopeContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/HttpSessionScopeContext.java deleted file mode 100644 index e1fcc4ab70..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/HttpSessionScopeContext.java +++ /dev/null @@ -1,254 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context.scope; - -import java.util.Map; -import java.util.Queue; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentLinkedQueue; - -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.core.context.CoreRuntimeException; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.LifecycleEventListener; -import org.apache.tuscany.core.context.RuntimeEventListener; -import org.apache.tuscany.core.context.ScopeRuntimeException; -import org.apache.tuscany.core.context.SimpleComponentContext; - -/** - * An implementation of an HTTP session-scoped component container where each HTTP session is mapped to a context in the scope - * - * @version $Rev$ $Date$ - */ -public class HttpSessionScopeContext extends AbstractScopeContext implements RuntimeEventListener, LifecycleEventListener { - - // The collection of service component contexts keyed by session - private Map> contexts; - - // Stores ordered lists of contexts to shutdown keyed by session - private Map> destroyableContexts; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public HttpSessionScopeContext(EventContext eventContext) { - super(eventContext); - setName("Http Session Scope"); - } - - // ---------------------------------- - // Lifecycle methods - // ---------------------------------- - - public synchronized void start() { - if (lifecycleState != UNINITIALIZED) { - throw new IllegalStateException("Scope container must be in UNINITIALIZED state"); - } - super.start(); - contexts = new ConcurrentHashMap(); - destroyableContexts = new ConcurrentHashMap(); - lifecycleState = RUNNING; - } - - public synchronized void stop() { - if (lifecycleState != RUNNING) { - throw new IllegalStateException("Scope container in wrong state"); - } - super.stop(); - contexts = null; - contexts = null; - destroyableContexts = null; - lifecycleState = STOPPED; - } - - // ---------------------------------- - // Listener methods - // ---------------------------------- - - public void onEvent(int type, Object key) { - checkInit(); - if (key == null) { - return; - } - if (type == EventContext.SESSION_END) { - notifyInstanceShutdown(key); - destroyComponentContext(key); - } - } - - // ---------------------------------- - // Scope methods - // ---------------------------------- - - public boolean isCacheable() { - return true; - } - - public void registerConfiguration(RuntimeConfiguration configuration) { - runtimeConfigurations.put(configuration.getName(), configuration); - } - - public InstanceContext getContext(String ctxName) { - checkInit(); - if (ctxName == null) { - return null; - } - // try{ - Map ctxs = getSessionContext(); - if (ctxs == null) { - return null; - } - InstanceContext ctx = ctxs.get(ctxName); - if (ctx == null) { - // the configuration was added after the session had started, so create a context now and start it - RuntimeConfiguration configuration = runtimeConfigurations.get(ctxName); - if (configuration != null) { - ctx = configuration.createInstanceContext(); - ctx.addContextListener(this); - ctx.start(); - ctxs.put(ctx.getName(), ctx); - } - } - return ctx; - } - - public InstanceContext getContextByKey(String ctxName, Object key) { - checkInit(); - if (key == null && ctxName == null) { - return null; - } - Map components = (Map) contexts.get(key); - if (components == null) { - return null; - } - return (InstanceContext) components.get(ctxName); - } - - public void removeContext(String ctxName) { - checkInit(); - Object key = getEventContext().getIdentifier(EventContext.HTTP_SESSION); - removeContextByKey(ctxName, key); - } - - public void removeContextByKey(String ctxName, Object key) { - checkInit(); - if (key == null || ctxName == null) { - return; - } - Map components = (Map) contexts.get(key); - if (components == null) { - return; - } - components.remove(ctxName); - Map definitions = contexts.get(key); - InstanceContext meta = (InstanceContext) definitions.get(ctxName); - destroyableContexts.get(key).remove(meta); - definitions.remove(ctxName); - } - - public void onInstanceCreate(Context context) throws ScopeRuntimeException { - checkInit(); - if (context instanceof SimpleComponentContext) { - // if destroyable, queue the context to have its component implementation instance released - if (((SimpleComponentContext) context).isDestroyable()) { - Object key = getEventContext().getIdentifier(EventContext.HTTP_SESSION); - Queue comps = destroyableContexts.get(key); - if (comps == null) { - ScopeRuntimeException e = new ScopeRuntimeException("Shutdown queue not found for key"); - e.setIdentifier(key.toString()); - throw e; - } - comps.add(context); - } - } - } - - /** - * Returns an array of {@link SimpleComponentContext}s representing components that need to be notified of scope shutdown or - * null if none found. - */ - protected InstanceContext[] getShutdownContexts(Object key) { - /* - * This method will be called from the Listener which is associated with a different thread than the request. So, just - * grab the key directly - */ - Queue queue = destroyableContexts.get(key); - if (queue != null) { - // create 0-length array since Queue.size() has O(n) traversal - return (InstanceContext[]) queue.toArray(new InstanceContext[0]); - } else { - return null; - } - } - - // ---------------------------------- - // Private methods - // ---------------------------------- - - /** - * Returns and, if necessary, creates a context for the current sesion - */ - private Map getSessionContext() throws CoreRuntimeException { - Object key = getEventContext().getIdentifier(EventContext.HTTP_SESSION); - if (key == null) { - throw new ScopeRuntimeException("Session key not set in request context"); - } - Map m = contexts.get(key); - if (m != null) { - return m; // already created, return - } - Map sessionContext = new ConcurrentHashMap(runtimeConfigurations.size()); - for (RuntimeConfiguration config : runtimeConfigurations.values()) { - InstanceContext context = null; - context = config.createInstanceContext(); - context.addContextListener(this); - context.start(); - sessionContext.put(context.getName(), context); - } - - Queue shutdownQueue = new ConcurrentLinkedQueue(); - contexts.put(key, sessionContext); - destroyableContexts.put(key, shutdownQueue); - // initialize eager components. Note this cannot be done when we initially create each context since a component may - // contain a forward reference to a component which has not been instantiated - for (InstanceContext context : sessionContext.values()) { - if (context instanceof SimpleComponentContext) { - SimpleComponentContext simpleCtx = (SimpleComponentContext) context; - if (simpleCtx.isEagerInit()) { - // Get the instance and perform manual shutdown registration to avoid a map lookup - context.getInstance(null, false); - if (simpleCtx.isDestroyable()) { - shutdownQueue.add(context); - } - } - } - } - return sessionContext; - } - - /** - * Removes the components associated with an expiring context - */ - private void destroyComponentContext(Object key) { - contexts.remove(key); - destroyableContexts.remove(key); - } - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/ModuleScopeContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/ModuleScopeContext.java deleted file mode 100644 index 00f2747fae..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/ModuleScopeContext.java +++ /dev/null @@ -1,182 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context.scope; - -import java.util.Map; -import java.util.Queue; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentLinkedQueue; - -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.core.context.CoreRuntimeException; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.LifecycleEventListener; -import org.apache.tuscany.core.context.RuntimeEventListener; -import org.apache.tuscany.core.context.SimpleComponentContext; - -/** - * Manages component contexts whose implementations are module scoped - * - * @version $Rev$ $Date$ - */ -public class ModuleScopeContext extends AbstractScopeContext implements RuntimeEventListener, LifecycleEventListener { - - // ---------------------------------- - // Fields - // ---------------------------------- - - // Component contexts in this scope keyed by name - private Map componentContexts; - - private Queue destroyableContexts; - - // ---------------------------------- - // Constructor - // ---------------------------------- - - public ModuleScopeContext(EventContext eventContext) { - super(eventContext); - setName("Module Scope"); - } - - // ---------------------------------- - // Listener methods - // ---------------------------------- - - public void onEvent(int type, Object key) { - if (type == EventContext.MODULE_START) { - lifecycleState = RUNNING; - initComponentContexts(); - } else if (type == EventContext.MODULE_STOP) { - notifyInstanceShutdown(key); - } - } - - // ---------------------------------- - // Lifecycle methods - // ---------------------------------- - - public synchronized void start() { - if (lifecycleState != UNINITIALIZED) { - throw new IllegalStateException("Scope must be in UNINITIALIZED state [" + lifecycleState + "]"); - } - } - - public synchronized void stop() { - if (lifecycleState != RUNNING) { - throw new IllegalStateException("Scope in wrong state [" + lifecycleState + "]"); - } - super.stop(); - componentContexts = null; - destroyableContexts = null; - lifecycleState = STOPPED; - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public boolean isCacheable() { - return true; - } - - public void registerConfiguration(RuntimeConfiguration configuration) { - runtimeConfigurations.put(configuration.getName(), configuration); - if (lifecycleState == RUNNING) { - componentContexts.put(configuration.getName(), configuration.createInstanceContext()); - } - } - - public InstanceContext getContext(String ctxName) { - checkInit(); - return componentContexts.get(ctxName); - } - - public InstanceContext getContextByKey(String ctxName, Object key) { - checkInit(); - return componentContexts.get(ctxName); - } - - public void removeContext(String ctxName) { - checkInit(); - Object component = componentContexts.remove(ctxName); - if (component != null) { - destroyableContexts.remove(component); - } - } - - public void removeContextByKey(String ctxName, Object key) { - checkInit(); - removeContext(ctxName); - } - - public void onInstanceCreate(Context context) { - checkInit(); - if (context instanceof SimpleComponentContext) { - SimpleComponentContext serviceContext = (SimpleComponentContext) context; - // Queue the context to have its implementation instance released if destroyable - if (serviceContext.isDestroyable()) { - destroyableContexts.add(serviceContext); - } - } - } - - /** - * Returns an array of {@link SimpleComponentContext}s representing components that need to be notified of scope shutdown. - */ - protected InstanceContext[] getShutdownContexts(Object key) { - if (destroyableContexts != null) { - // create 0-length array since Queue.size() has O(n) traversal - return (InstanceContext[]) destroyableContexts.toArray(new InstanceContext[0]); - } else { - return null; - } - } - - // ---------------------------------- - // Private methods - // ---------------------------------- - - private synchronized void initComponentContexts() throws CoreRuntimeException { - if (componentContexts == null) { - componentContexts = new ConcurrentHashMap(); - destroyableContexts = new ConcurrentLinkedQueue(); - for (RuntimeConfiguration config : runtimeConfigurations.values()) { - InstanceContext context = config.createInstanceContext(); - context.addContextListener(this); - context.start(); - componentContexts.put(context.getName(), context); - } - // Initialize eager contexts. Note this cannot be done when we initially create each context since a component may - // contain a forward reference to a component which has not been instantiated - for (InstanceContext context : componentContexts.values()) { - if (context instanceof SimpleComponentContext) { - SimpleComponentContext simpleCtx = (SimpleComponentContext) context; - if (simpleCtx.isEagerInit()) { - // perform silent creation and manual shutdown registration - simpleCtx.getInstance(null, false); - if (simpleCtx.isDestroyable()) { - destroyableContexts.add(simpleCtx); - } - } - } - } - } - } -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/RequestScopeContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/RequestScopeContext.java deleted file mode 100644 index deed3e2dee..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/RequestScopeContext.java +++ /dev/null @@ -1,224 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context.scope; - -import java.util.Map; -import java.util.Queue; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentLinkedQueue; - -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.core.context.LifecycleEventListener; -import org.apache.tuscany.core.context.CoreRuntimeException; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.RuntimeEventListener; -import org.apache.tuscany.core.context.SimpleComponentContext; - -/** - * An implementation of a request-scoped component container. - * - * @version $Rev$ $Date$ - */ -public class RequestScopeContext extends AbstractScopeContext implements RuntimeEventListener, LifecycleEventListener { - - // ---------------------------------- - // Fields - // ---------------------------------- - - // A collection of service component contexts keyed by thread. Note this could have been implemented with a ThreadLocal but - // using a Map allows finer-grained concurrency. - private Map> contextMap; - - // stores ordered lists of contexts to shutdown for each thread. - private Map destroyComponents; - - // ---------------------------------- - // Constructor - // ---------------------------------- - - public RequestScopeContext(EventContext eventContext) { - super(eventContext); - setName("Request Scope"); - } - - // ---------------------------------- - // Listener methods - // ---------------------------------- - - public void onEvent(int type, Object key) { - checkInit(); - /* clean up current context for pooled threads */ - if (type == EventContext.REQUEST_END) { - getEventContext().clearIdentifier(EventContext.HTTP_SESSION); - notifyInstanceShutdown(Thread.currentThread()); - destroyContext(); - } - } - - // ---------------------------------- - // Lifecycle methods - // ---------------------------------- - - public synchronized void start() { - if (lifecycleState != UNINITIALIZED) { - throw new IllegalStateException("Scope must be in UNINITIALIZED state [" + lifecycleState + "]"); - } - super.start(); - contextMap = new ConcurrentHashMap(); - destroyComponents = new ConcurrentHashMap(); - lifecycleState = RUNNING; - - } - - public synchronized void stop() { - if (lifecycleState != RUNNING) { - throw new IllegalStateException("Scope in wrong state [" + lifecycleState + "]"); - } - super.stop(); - contextMap = null; - destroyComponents = null; - lifecycleState = STOPPED; - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public boolean isCacheable() { - return true; - } - - public void registerConfiguration(RuntimeConfiguration configuration) { - runtimeConfigurations.put(configuration.getName(), configuration); - } - - public InstanceContext getContext(String ctxName) { - checkInit(); - Map contexts = getComponentContexts(); - InstanceContext ctx = contexts.get(ctxName); - if (ctx == null){ - // check to see if the configuration was added after the request was started - RuntimeConfiguration configuration = runtimeConfigurations.get(ctxName); - if (configuration != null) { - ctx = configuration.createInstanceContext(); - ctx.addContextListener(this); - ctx.start(); - contexts.put(ctx.getName(), ctx); - } - } - return ctx; - } - - public InstanceContext getContextByKey(String ctxName, Object key) { - checkInit(); - if (key == null) { - return null; - } - Map components = (Map) contextMap.get(key); - if (components == null) { - return null; - } - return components.get(ctxName); - } - - public void removeContext(String ctxName) { - checkInit(); - removeContextByKey(ctxName, Thread.currentThread()); - } - - public void removeContextByKey(String ctxName, Object key) { - checkInit(); - if (key == null || ctxName == null) { - return; - } - Map components = (Map) contextMap.get(key); - if (components == null) { - return; - } - components.remove(ctxName); - Map contexts = (Map) contextMap.get(key); - // no synchronization for the following two operations since the request - // context will not be shutdown before the second call is processed - InstanceContext context = contexts.get(ctxName); - destroyComponents.get(key).remove(context); - } - - public void onInstanceCreate(Context context) { - checkInit(); - if (context instanceof SimpleComponentContext) { - // Queue the context to have its implementation instance released if destroyable - if (((SimpleComponentContext) context).isDestroyable()) { - Queue collection = destroyComponents.get(Thread.currentThread()); - collection.add(context); - } - } - } - - /** - * Returns an array of {@link SimpleComponentContext}s representing components that need to be notified of scope shutdown. - */ - protected InstanceContext[] getShutdownContexts(Object key) { - checkInit(); - Queue queue = destroyComponents.get(Thread.currentThread()); - if (queue != null) { - // create 0-length array since Queue.size() has O(n) traversal - return (InstanceContext[]) queue.toArray(new InstanceContext[0]); - } else { - return null; - } - } - - // ---------------------------------- - // Private methods - // ---------------------------------- - - private void destroyContext() { - // TODO uninitialize all request-scoped components - contextMap.remove(Thread.currentThread()); - destroyComponents.remove(Thread.currentThread()); - } - - /** - * Initializes ServiceComponentContexts for the current request. - *

- * TODO This eagerly creates all component contexts, even if the component is never accessed during the request. This method - * should be profiled to determine if lazy initialization is more performant - *

- * TODO Eager initialization is not performed for request-scoped components - */ - - private Map getComponentContexts() throws CoreRuntimeException { - Map contexts = (Map) contextMap.get(Thread.currentThread()); - if (contexts == null) { - contexts = new ConcurrentHashMap(); - Queue shutdownQueue = new ConcurrentLinkedQueue(); - for (RuntimeConfiguration config : runtimeConfigurations.values()) { - InstanceContext context = null; - context = config.createInstanceContext(); - context.addContextListener(this); - context.start(); - contexts.put(context.getName(), context); - } - contextMap.put(Thread.currentThread(), contexts); - destroyComponents.put(Thread.currentThread(), shutdownQueue); - } - return contexts; - } - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/StatelessScopeContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/StatelessScopeContext.java deleted file mode 100644 index 8b12f8b183..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/scope/StatelessScopeContext.java +++ /dev/null @@ -1,145 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context.scope; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.core.context.LifecycleEventListener; -import org.apache.tuscany.core.context.CoreRuntimeException; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.RuntimeEventListener; - -/** - * A container that manages stateless components. - * - * @version $Rev$ $Date$ - */ -public class StatelessScopeContext extends AbstractScopeContext implements RuntimeEventListener, LifecycleEventListener { - - // ---------------------------------- - // Fields - // ---------------------------------- - - // Component contexts keyed by name - private Map contextMap; - - // ---------------------------------- - // Constructor - // ---------------------------------- - - public StatelessScopeContext(EventContext eventContext) { - super(eventContext); - setName("Stateless Scope"); - } - - // ---------------------------------- - // Lifecycle methods - // ---------------------------------- - - public synchronized void start() { - if (lifecycleState != UNINITIALIZED) { - throw new IllegalStateException("Scope must be in UNINITIALIZED state [" + lifecycleState + "]"); - } - super.start(); - lifecycleState = RUNNING; - prepare(); - } - - public synchronized void stop() { - if (lifecycleState != RUNNING) { - throw new IllegalStateException("Scope in wrong state [" + lifecycleState + "]"); - } - super.stop(); - contextMap = null; - lifecycleState = STOPPED; - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public void registerConfiguration(RuntimeConfiguration configuration) { - runtimeConfigurations.put(configuration.getName(), configuration); - if (lifecycleState == RUNNING) { - contextMap.put(configuration.getName(), configuration.createInstanceContext()); - } - - } - - public void onEvent(int type, Object key) { - // do nothing - } - - public boolean isCacheable() { - return true; - } - - public InstanceContext getContext(String ctxName) { - return contextMap.get(ctxName); - } - - public InstanceContext getContextByKey(String ctxName, Object key) { - return getContext(ctxName); - } - - public void removeContext(String ctxName) { - removeContextByKey(ctxName, null); - } - - public void removeContextByKey(String ctxName, Object key) { - contextMap.remove(ctxName); - } - - /** - * Always returns null since stateless components cannot be shutdown - */ - protected InstanceContext[] getShutdownContexts(Object key) { - return null; - } - - // ---------------------------------- - // Private methods - // ---------------------------------- - - public void onInstanceCreate(Context component) { - // do nothing - } - - private void prepare() throws CoreRuntimeException { - if (lifecycleState != RUNNING) { - throw new IllegalStateException("Scope not in INITIALIZED state [" + lifecycleState + "]"); - } - if (contextMap == null) { - contextMap = new ConcurrentHashMap(); - for (RuntimeConfiguration config : runtimeConfigurations.values()) { - for (int i = 0; i < runtimeConfigurations.size(); i++) { - InstanceContext context = null; - context = config.createInstanceContext(); - context.addContextListener(this); - context.start(); - contextMap.put(context.getName(), context); - } - - } - } - } - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/webapp/HTTPSessionExpirationListener.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/webapp/HTTPSessionExpirationListener.java deleted file mode 100644 index 923b9fb941..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/webapp/HTTPSessionExpirationListener.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context.webapp; - -import javax.servlet.http.HttpSessionEvent; -import javax.servlet.http.HttpSessionListener; - -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EventContext; - -/** - * Cleans up resources used by expired sessions - * - * @version $Rev$ $Date$ - */ -public class HTTPSessionExpirationListener implements HttpSessionListener { - // ---------------------------------- - // Constructors - // ---------------------------------- - - public HTTPSessionExpirationListener() { - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public void sessionCreated(HttpSessionEvent event) { - // do nothing since sessions are lazily created in {@link - // org.apache.tuscany.tomcat.webapp.listener.RequestFilter} - } - - public void sessionDestroyed(HttpSessionEvent event) { - TuscanyWebAppRuntime tuscanyRuntime = null; - try { - tuscanyRuntime = (TuscanyWebAppRuntime) event.getSession().getServletContext().getAttribute( - TuscanyWebAppRuntime.class.getName()); - tuscanyRuntime.start(); - - // End the session - AggregateContext context = tuscanyRuntime.getModuleComponentContext(); - context.fireEvent(EventContext.SESSION_END, event.getSession()); - } finally { - if (tuscanyRuntime != null) - tuscanyRuntime.stop(); - } - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/webapp/LazyHTTPSessionId.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/webapp/LazyHTTPSessionId.java deleted file mode 100644 index 186f35df14..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/webapp/LazyHTTPSessionId.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context.webapp; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.tuscany.core.context.ScopeIdentifier; - -/** - * Implements a ScopeIdentifier for a Servlet-based transport. - * Wraps an HttpServletRequest so that the session id associated - * with the current request may be lazily retrieved by the module context - i.e. - * if a session context or session-scoped component is not accessed, no session - * is created. - * - * @version $Rev$ $Date$ - */ -public class LazyHTTPSessionId implements ScopeIdentifier { - - private HttpServletRequest request; - - //---------------------------------- - // Constructors - //---------------------------------- - - public LazyHTTPSessionId(HttpServletRequest request) { - this.request = request; - } - - //---------------------------------- - // Methods - //---------------------------------- - - /** - * Returns the session identifier - * - * @see org.apache.tuscany.core.context.ScopeIdentifier#getIdentifier() - */ - public Object getIdentifier() { - return request.getSession(true); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/webapp/TuscanyRequestFilter.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/webapp/TuscanyRequestFilter.java deleted file mode 100644 index 8e92c9ebd4..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/webapp/TuscanyRequestFilter.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context.webapp; - -import java.io.IOException; - -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; - -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EventContext; - -/** - * Notifies the {@link org.apache.tuscany.core.context.AggregateContext} of web request start and end events as well as setting up the - * current session context. The latter is done using lazy Servlet-based session retrieval. The filter fires a session - * start event, passing a LazyServletSessionId as the session id. The LazyServletSessionId is a - * wrapper for the servlet request which may be called by the ModuleContext to retrieve the session id - * lazily. - * - * @version $Rev$ $Date$ - */ -public class TuscanyRequestFilter implements Filter { - private TuscanyWebAppRuntime tuscanyRuntime; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public TuscanyRequestFilter() { - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public void init(FilterConfig filterConfig) throws ServletException { - - // Get the Tuscany runtime from the servlet context - tuscanyRuntime = (TuscanyWebAppRuntime) filterConfig.getServletContext().getAttribute( - TuscanyWebAppRuntime.class.getName()); - } - - public void destroy() { - } - - public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws ServletException, - IOException { - // Get the module component context from the tuscany runtime - AggregateContext context = tuscanyRuntime.getModuleComponentContext(); - try { - - // Start the SCA implementation - tuscanyRuntime.start(); - - // Handle a request - if (request instanceof HttpServletRequest) { - if (((HttpServletRequest) request).getSession(false) != null) { - - // A session is already active - context.fireEvent(EventContext.SESSION_NOTIFY, ((HttpServletRequest) request).getSession(true)); - } else { - // Create a lazy wrapper since a session is not yet active - context.fireEvent(EventContext.SESSION_NOTIFY, new LazyHTTPSessionId((HttpServletRequest) request)); - } - } else { - context.fireEvent(EventContext.SESSION_NOTIFY, request); - } - // Start processing the request - context.fireEvent(EventContext.REQUEST_START, request); - // Dispatch to the next filter - filterChain.doFilter(request, response); - } catch (Exception e) { - throw new ServletException(e); - - } finally { - try { - // End processing the request - context.fireEvent(EventContext.REQUEST_END, request); - // Stop the SCA implementation - tuscanyRuntime.stop(); - } catch (Exception e) { - throw new ServletException(e); - } - } - - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/webapp/TuscanyWebAppRuntime.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/webapp/TuscanyWebAppRuntime.java deleted file mode 100644 index 3b9801a811..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/context/webapp/TuscanyWebAppRuntime.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context.webapp; - -import org.apache.tuscany.core.context.AggregateContext; -import org.osoa.sca.ModuleContext; -import org.osoa.sca.SCA; - -/** - * An implementation of the SCA runtime for use in a Web app - * - * @version $Rev$ $Date$ - */ -public class TuscanyWebAppRuntime extends SCA { - private AggregateContext moduleComponentContext; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public TuscanyWebAppRuntime(AggregateContext moduleComponentContext) { - this.moduleComponentContext = moduleComponentContext; - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - /** - * Returns the module component context associated with this runtime - */ - public AggregateContext getModuleComponentContext() { - return moduleComponentContext; - } - - public void start() { - // Associate it with the current thread - setModuleContext((ModuleContext) moduleComponentContext); - } - - public void stop() { - setModuleContext(null); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/EventInvoker.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/EventInvoker.java deleted file mode 100644 index d2b95ae70e..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/EventInvoker.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.apache.tuscany.core.injection; - -/** - * Performs an invocation on an instance - * - * @version $Rev$ $Date$ - * @see MethodEventInvoker - */ -public interface EventInvoker { - - /** - * Performs the invocation on a given instance - * - * @throws ObjectCallbackException - */ - void invokeEvent(T instance) throws ObjectCallbackException; -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/FactoryInitException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/FactoryInitException.java deleted file mode 100644 index e9573d4a4e..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/FactoryInitException.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.apache.tuscany.core.injection; - -/** - * Denotes an exception initializing an object factory - * - * @version $Rev$ $Date$ - */ -public class FactoryInitException extends InjectionRuntimeException { - - public FactoryInitException(String message, Throwable cause) { - super(message, cause); - } - - public FactoryInitException(String message) { - super(message); - } - - public FactoryInitException(Throwable cause) { - super(cause); - } - - public FactoryInitException() { - super(); - } - -} - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/FieldInjector.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/FieldInjector.java deleted file mode 100644 index c48f620a3f..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/FieldInjector.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.apache.tuscany.core.injection; - -import java.lang.reflect.Field; - -import org.apache.tuscany.core.builder.ObjectFactory; - -/** - * Injects a value created by an {@link ObjectFactory} on a given field - * - * @version $Rev$ $Date$ - */ -public class FieldInjector implements Injector { - - private final Field field; - - private final ObjectFactory objectFactory; - - // //---------------------------------- - // Constructors - // ---------------------------------- - - /** - * Create an injector and have it use the given ObjectFactory - * to inject a value on the instance using the reflected Field - */ - public FieldInjector(Field field, ObjectFactory objectFactory) { - this.field = field; - this.objectFactory = objectFactory; - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - /** - * Inject a new value on the given isntance - */ - public void inject(T instance) throws ObjectCreationException { - try { - field.set(instance, objectFactory.getInstance()); - } catch (IllegalAccessException e) { - throw new AssertionError("Field is not accessible [" + field + "]"); - } - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/InjectionRuntimeException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/InjectionRuntimeException.java deleted file mode 100644 index ac8b09eab2..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/InjectionRuntimeException.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.apache.tuscany.core.injection; - -import org.apache.tuscany.common.TuscanyRuntimeException; - -/** - * Root unchecked exception for the injection package - * - * @version $Rev$ $Date$ - */ -public abstract class InjectionRuntimeException extends TuscanyRuntimeException { - - public InjectionRuntimeException() { - super(); - } - - public InjectionRuntimeException(String message) { - super(message); - } - - public InjectionRuntimeException(String message, Throwable cause) { - super(message, cause); - } - - public InjectionRuntimeException(Throwable cause) { - super(cause); - } - -} - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/Injector.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/Injector.java deleted file mode 100644 index 013b1c5874..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/Injector.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.apache.tuscany.core.injection; - -/** - * Implementations inject a pre-configured value on an instance - * - * @version $Rev$ $Date$ - * @see MethodInjector - * @see FieldInjector - */ -public interface Injector { - - /** - * Inject a value on the given instance - */ - void inject(T instance) throws ObjectCreationException; - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/MethodEventInvoker.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/MethodEventInvoker.java deleted file mode 100644 index 08dd4cd124..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/MethodEventInvoker.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.apache.tuscany.core.injection; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -/** - * Performs an invocation on a method of a given instance - * - * @version $Rev$ $Date$ - */ -public class MethodEventInvoker implements EventInvoker { - private final Method method; - - //---------------------------------- - // Constructors - //---------------------------------- - - /** - * Intantiates an invoker for the given method - */ - public MethodEventInvoker(Method method) { - this.method = method; - } - - //---------------------------------- - // Methods - //---------------------------------- - - public void invokeEvent(T instance) throws ObjectCallbackException { - try { - method.invoke(instance, (Object[]) null); - } catch (IllegalAccessException e) { - throw new AssertionError("Method is not accessible [" + method + "]"); - } catch (InvocationTargetException e) { - throw new ObjectCallbackException("Exception thrown by callback method [" + method + "]", e); - } - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/MethodInjector.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/MethodInjector.java deleted file mode 100644 index 55ea7bae5f..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/MethodInjector.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.apache.tuscany.core.injection; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import org.apache.tuscany.core.builder.ObjectFactory; - -/** - * Injects a value created by an {@link ObjectFactory} using a given method - * @version $Rev$ $Date$ - */ -public class MethodInjector implements Injector { - private final Method method; - private final ObjectFactory objectFactory; - - public MethodInjector(Method method, ObjectFactory objectFactory) { - this.method = method; - this.objectFactory = objectFactory; - } - - public void inject(T instance) throws ObjectCreationException { - try { - method.invoke(instance, new Object[]{objectFactory.getInstance()}); - } catch (IllegalAccessException e) { - throw new AssertionError("Method is not accessible [" + method + "]"); - } catch (InvocationTargetException e) { - throw new ObjectCreationException("Exception thrown by setter [" + method + "]", e); - } - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/NullEventInvoker.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/NullEventInvoker.java deleted file mode 100644 index 23599bae0e..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/NullEventInvoker.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.apache.tuscany.core.injection; - -/** - * A no-op invoker - * - * @version $Rev$ $Date$ - */ -public final class NullEventInvoker implements EventInvoker { - public static final EventInvoker NULL_INVOKER = new NullEventInvoker(); - - public void invokeEvent(T instance) { - // does nothing - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/ObjectCallbackException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/ObjectCallbackException.java deleted file mode 100644 index b428c31f4f..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/ObjectCallbackException.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.apache.tuscany.core.injection; - -/** - * Denotes an error when invoking on an object - * - * @version $Rev$ $Date$ - */ -public class ObjectCallbackException extends InjectionRuntimeException { - - public ObjectCallbackException() { - super(); - } - - public ObjectCallbackException(String message) { - super(message); - } - - public ObjectCallbackException(String message, Throwable cause) { - super(message, cause); - } - - public ObjectCallbackException(Throwable cause) { - super(cause); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/ObjectCreationException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/ObjectCreationException.java deleted file mode 100644 index 338b841c49..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/ObjectCreationException.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.apache.tuscany.core.injection; - -/** - * Denotes an error creating a new object instance - * - * @version $Rev$ $Date$ - */ -public class ObjectCreationException extends InjectionRuntimeException { - - public ObjectCreationException() { - super(); - } - - public ObjectCreationException(String message) { - super(message); - } - - public ObjectCreationException(String message, Throwable cause) { - super(message, cause); - } - - public ObjectCreationException(Throwable cause) { - super(cause); - } - -} - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/PojoObjectFactory.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/PojoObjectFactory.java deleted file mode 100644 index e3e1874b1e..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/PojoObjectFactory.java +++ /dev/null @@ -1,75 +0,0 @@ -package org.apache.tuscany.core.injection; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.Collections; -import java.util.List; - -import org.apache.tuscany.core.builder.ObjectFactory; - -/** - * Creates new instances of a Java class, calling a given set of injectors to configure the instance - * - * @version $Rev$ $Date$ - * @see Injector - */ -public class PojoObjectFactory implements ObjectFactory { - - // ---------------------------------- - // Constants - // ---------------------------------- - - private static final ObjectFactory[] NO_INIT_PARAM = {}; - - private static final List NO_SETTER_PARAM = Collections.EMPTY_LIST; - - // ---------------------------------- - // Fields - // ---------------------------------- - - private final Constructor ctr; - - private final ObjectFactory[] initParamsArray; - - private final List setters; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public PojoObjectFactory(Constructor ctr, List initParams, List setters) { - this.ctr = ctr; - if (initParams != null && initParams.size() > 0) { - initParamsArray = initParams.toArray(new ObjectFactory[initParams.size()]); - } else { - initParamsArray = NO_INIT_PARAM; - } - this.setters = setters != null ? setters : NO_SETTER_PARAM; - } // ---------------------------------- - - // Methods - // ---------------------------------- - - public T getInstance() throws ObjectCreationException { - Object[] initargs = new Object[initParamsArray.length]; - // create the constructor arg array - for (int i = 0; i < initParamsArray.length; i++) { - ObjectFactory objectFactory = initParamsArray[i]; - initargs[i] = objectFactory.getInstance(); - } - try { - T instance = ctr.newInstance(initargs); - // interate through the injectors and inject the instance - for (Injector setter : setters) { - setter.inject(instance); - } - return instance; - } catch (InstantiationException e) { - throw new AssertionError("Class is not instantiable [" + ctr.getDeclaringClass().getName() + "]"); - } catch (IllegalAccessException e) { - throw new AssertionError("Constructor is not accessible [" + ctr + "]"); - } catch (InvocationTargetException e) { - throw new ObjectCreationException("Exception thrown by constructor [" + ctr + "]", e); - } - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/ReferenceTargetFactory.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/ReferenceTargetFactory.java deleted file mode 100644 index f84c5b7ed1..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/ReferenceTargetFactory.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.injection; - -import org.apache.tuscany.core.builder.ObjectFactory; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.TargetException; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.ConfiguredReference; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.ExternalService; - -/** - * Returns a direct reference to a target service, i.e. the factory avoids creating proxies and returns the actual - * target instance - * - * @version $Rev$ $Date$ - */ -public class ReferenceTargetFactory implements ObjectFactory { - - private AggregateContext parentContext; - - // the SCDL name of the target component/service for this reference - private String targetName; - - private QualifiedName targetComponentName; - - // the reference target is in another module - private boolean interModule; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - /** - * Constructs a reference object factory from a configured reference on a type - */ - public ReferenceTargetFactory(ConfiguredReference reference, AggregateContext parentContext) - throws FactoryInitException { - // FIXME how to handle a reference that is a list - may take different proxy factories for each entry - assert (reference != null) : "Reference was null"; - assert (parentContext != null) : "Parent context was null"; - - this.parentContext = parentContext; - // targetName = reference.getReference().getName(); - ConfiguredService targetService = reference.getTargetConfiguredServices().get(0); - if (targetService.getAggregatePart() instanceof ExternalService) { - targetName = ((ExternalService) targetService.getAggregatePart()).getName(); - } else if (targetService.getAggregatePart() instanceof Component) { - Component targetComponent = (Component) targetService.getAggregatePart(); - targetName = targetComponent.getName(); - } else if (targetService.getAggregatePart() instanceof EntryPoint) { - targetName = ((EntryPoint) targetService.getAggregatePart()).getName(); - } else if (targetService.getAggregatePart() == null) { - // FIXME not correct - if (targetService.getService() == null) { - throw new FactoryInitException("No target service specified"); - } - targetName = targetService.getService().getName(); - } else { - FactoryInitException fie = new FactoryInitException("Unknown reference target type"); - fie.setIdentifier(reference.getReference().getName()); - throw fie; - } - } - - /** - * Reference source is an external service, target is in another module - * - * @param service - * @param parentContext - * @throws FactoryInitException - */ - public ReferenceTargetFactory(String targetName, AggregateContext parentContext) throws FactoryInitException { - //assert (service != null) : "Service was null"; - assert (parentContext != null) : "Parent context was null"; - interModule = true; // an external service with a reference target in another module - this.targetName = targetName;// service.getAggregatePart().getName(); - targetComponentName = new QualifiedName(targetName); - this.parentContext = parentContext; - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public T getInstance() throws ObjectCreationException { - if (interModule) { - // only return entry points since this is an inter-module wire - Object o = parentContext.getInstance(targetComponentName); - if (o != null) { - return (T) o; - } else { - // walk up the hierarchy of aggregate contexts - AggregateContext ctx = parentContext; - do { - if (ctx == null) { - break; // reached top of context hierarchy - } - InstanceContext compContext = ctx.getContext(targetComponentName.getPartName()); - if (compContext != null) { - o = compContext.getInstance(targetComponentName); - if (o != null) { - return (T) o; - } - } - ctx = ctx.getParent(); - } while (ctx != null); - TargetException e= new TargetException("Target reference not found"); - e.setIdentifier(targetName); - throw e; - } - } else { - // the target is in the same module, so just locate it - return (T) parentContext.locateInstance(targetName); - } - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/SDOObjectFactory.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/SDOObjectFactory.java deleted file mode 100644 index 8147fa0d51..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/SDOObjectFactory.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.apache.tuscany.core.injection; - -import org.apache.tuscany.core.builder.ObjectFactory; - -import commonj.sdo.DataObject; -import commonj.sdo.helper.CopyHelper; - -/** - * Creates new instances of an SDO - * - * @version $Rev$ $Date$ - */ -public class SDOObjectFactory implements ObjectFactory { - - private DataObject dataObject; - - //---------------------------------- - // Constructors - //---------------------------------- - - public SDOObjectFactory(DataObject dataObject) { - this.dataObject = dataObject; - } - - //---------------------------------- - // Methods - //---------------------------------- - - public DataObject getInstance() throws ObjectCreationException { - return CopyHelper.INSTANCE.copy(dataObject); - } - - public void releaseInstance(DataObject instance) { - } - -} - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/SingletonObjectFactory.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/SingletonObjectFactory.java deleted file mode 100644 index 9f46357086..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/injection/SingletonObjectFactory.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.apache.tuscany.core.injection; - -import org.apache.tuscany.core.builder.ObjectFactory; - -/** - * Implementation of ObjectFactory that returns a single instance, typically an immutable type. - * - * @version $Rev$ $Date$ - */ -public class SingletonObjectFactory implements ObjectFactory { - private final T instance; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public SingletonObjectFactory(T instance) { - this.instance = instance; - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public T getInstance() { - return instance; - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/Interceptor.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/Interceptor.java deleted file mode 100644 index 40137f9b10..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/Interceptor.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation; - -import org.apache.tuscany.core.message.Message; - -/** - * Synchronous, around-style mediation associated with a client- or target- side invocation. - * - * @version $Rev$ $Date$ - */ -public interface Interceptor { - - /** - * Process a synchronous invocation. - * - * @param msg the request Message for the invocation - * @return the response Message from the invocation - */ - Message invoke(Message msg); - - /** - * Sets the next interceptor. - * - * @param next - */ - void setNext(Interceptor next); -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/InvocationConfiguration.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/InvocationConfiguration.java deleted file mode 100644 index 2c5e61a8a1..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/InvocationConfiguration.java +++ /dev/null @@ -1,279 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation; - -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.core.invocation.impl.MessageChannelImpl; -import org.apache.tuscany.core.invocation.impl.MessageDispatcher; -import org.apache.tuscany.core.invocation.impl.RequestResponseInterceptor; - -/** - * Contains a source- or target-side invocation pipeline for a service operation. Source and target invocation pipelines - * are "bridged" together by a set of wire builders with the source-side holding references to the target. - *

- * A set of invocation configurations are used by a {@link org.apache.tuscany.core.invocation.spi.ProxyFactory} to - * create service proxies. - *

- * Invocation configurations must contain at least one interceptor and may have 0 to N handlers. Handlers process an - * invocation request or response in a one-way fashion. A typical invocation sequence where interceptors and handlers - * are configured for both the source and target-side will proceed as follows: - *

    - *
  1. The first source interceptor will be called with a message, which will in turn invoke the next interceptor in - * the chain - *
  2. The last source interceptor, which must be of type - * {@link org.apache.tuscany.core.invocation.impl.RequestResponseInterceptor} if there are handlers present, will be - * invoked. The RR interceptor will in turn pass the message to a - * {@link org.apache.tuscany.core.invocation.MessageChannel} which will invoke all source-side request handlers. - *
  3. The RR interceptor will then invoke the target-side request MessageChannel. - *
  4. The last source-side handler, an instance of - * {@link org.apache.tuscany.core.invocation.impl.MessageDispatcher}, will invoke the first source-side - * interceptor, which in turn will pass the message down the target-side interceptor chain. - *
  5. If the target is a component instance the last target-side interceptor, an instance of - * {@link org.apache.tuscany.core.invocation.impl.InvokerInterceptor} will retrieve the - * {@link org.apache.tuscany.core.invocation.TargetInvoker} from the message and call it to invoke the operation on a - * target instance. TargetInvokers are help by the source proxy to enable optimizations such as caching of - * target instances. - *
  6. The response is returned up the invocation stack until it reaches the source-side - * RequestResponseInterceptor, which invokes the target and source-side response channels respectively. - *
  7. The response is then passed back up the rest of the invocation stack. - *
- *

- * The source-to-target bridge may be constructed in any of the following ways: - *

    - *
  • Source handler-to-target handler - *
  • Source handler-to-target interceptor - *
  • Source interceptor-to-target handler - *
  • Source interceptor-to-target interceptor - *
- *

- * In some scenarios, a service proxy may only contain target-side invocaton chains, for example, when a service is - * resolved through a locate operation by a non-component client. In this case, there will be no source-side invocation - * chains and the target invoker will be held by the target-side and passed down the pipeline. - * - * @see org.apache.tuscany.core.builder.WireBuilder - * @see org.apache.tuscany.core.invocation.spi.ProxyFactory - * @see org.apache.tuscany.core.invocation.TargetInvoker - * @see org.apache.tuscany.core.invocation.impl.MessageDispatcher - * - * @version $Rev$ $Date$ - */ -public class InvocationConfiguration { - - // the operation on the target that will utlimately be invoked - private Method operation; - - // responsible for invoking a target instance - private TargetInvoker targetInvoker; - - private Interceptor sourceInterceptorChainHead; - - private Interceptor sourceInterceptorChainTail; - - private Interceptor targetInterceptorChainHead; - - private Interceptor targetInterceptorChainTail; - - private List requestHandlers; - - private List responseHandlers; - - // a source-side pointer to target request handlers, if the exist - private MessageChannel targetRequestChannel; - - // a source-side pointer to target response handlers, if the exist - private MessageChannel targetResponseChannel; - - /** - * Creates an new invocation configuration for the given target operation - */ - public InvocationConfiguration(Method operation) { - assert (operation != null) : "No operation type specified"; - this.operation = operation; - } - - /** - * Returns the target operation for the invocation configuration - */ - public Method getMethod() { - return operation; - } - - /** - * Used by source-side configurations, sets a pointer to the target-side request channel. This may be null when no - * target request handlers exist. - */ - public void setTargetRequestChannel(MessageChannel channel) { - targetRequestChannel = channel; - } - - /** - * Used by source-side configurations, sets a pointer to the target-side response channel. This may be null when no - * target response handlers exist. - */ - public void setTargetResponseChannel(MessageChannel channel) { - targetResponseChannel = channel; - } - - /** - * Adds an interceptor to the invocation chain for source-side configurations - */ - public void addSourceInterceptor(Interceptor interceptor) { - if (sourceInterceptorChainHead == null) { - sourceInterceptorChainHead = interceptor; - } else { - sourceInterceptorChainTail.setNext(interceptor); - } - sourceInterceptorChainTail = interceptor; - } - - /** - * Adds an interceptor to the invocation chain for target-side configurations - */ - public void addTargetInterceptor(Interceptor interceptor) { - if (targetInterceptorChainHead == null) { - targetInterceptorChainHead = interceptor; - } else { - targetInterceptorChainTail.setNext(interceptor); - } - targetInterceptorChainTail = interceptor; - } - - /** - * Adds an request handler to the invocation chain for either a source- or target-side configuration - */ - public void addRequestHandler(MessageHandler handler) { - if (requestHandlers == null) { - requestHandlers = new ArrayList(); - } - requestHandlers.add(handler); - } - - /** - * Adds an response handler to the invocation chain for either a source- or target-side configuration - */ - public void addResponseHandler(MessageHandler handler) { - if (responseHandlers == null) { - responseHandlers = new ArrayList(); - } - responseHandlers.add(handler); - } - - /** - * Returns the request handler chain for either a source- or target-side configuration - */ - public List getRequestHandlers() { - return requestHandlers; - } - - /** - * Returns the response handler chain for either a source- or target-side configuration - */ - public List getResponseHandlers() { - return responseHandlers; - } - - /** - * Returns the head source-side interceptor. This will be null for target-side configurations - */ - public Interceptor getSourceInterceptor() { - return sourceInterceptorChainHead; - } - - /** - * Returns the head target-side interceptor. On source-side configurations, this will be the head interceptor of the - * "bridged" target configuration. - */ - public Interceptor getTargetInterceptor() { - return targetInterceptorChainHead; - } - - - public Interceptor getLastTargetInterceptor() { - return targetInterceptorChainTail; - } - - /** - * Sets the target invoker to pass down the invocation pipeline. When a service proxy represents a wire, - * the target invoker is set on the source-side. - */ - public void setTargetInvoker(TargetInvoker invoker) { - this.targetInvoker = invoker; - } - - /** - * Returns the target invoker that is passed down the invocation pipeline. When a service proxy represents a wire, - * the target invoker is cached on the source-side. - */ - public TargetInvoker getTargetInvoker() { - return targetInvoker; - } - - /** - * Prepares the configuration by linking interceptors and handlers - */ - public void build() { - - if (requestHandlers != null && targetInterceptorChainHead != null) { - // on target-side, connect existing handlers and interceptors - MessageHandler messageDispatcher = new MessageDispatcher(targetInterceptorChainHead); - requestHandlers.add(messageDispatcher); - } - - if (requestHandlers != null) { - MessageChannel requestChannel = new MessageChannelImpl(requestHandlers); - MessageChannel responseChannel = new MessageChannelImpl(responseHandlers); - Interceptor channelInterceptor = new RequestResponseInterceptor(requestChannel, targetRequestChannel, - responseChannel, targetResponseChannel); - - if (sourceInterceptorChainHead != null) { - sourceInterceptorChainTail.setNext(channelInterceptor); - } else { - sourceInterceptorChainHead = channelInterceptor; - } - - } else { - // no request handlers - if (sourceInterceptorChainHead != null) { - if (targetInterceptorChainHead != null) { - // Connect source interceptor chain directly to target interceptor chain - sourceInterceptorChainTail.setNext(targetInterceptorChainHead); - // sourceInterceptorChainTail = targetInterceptorChainHead; - } else { - // Connect source interceptor chain to the target request channel - Interceptor channelInterceptor = new RequestResponseInterceptor(null, targetRequestChannel, null, - targetResponseChannel); - sourceInterceptorChainTail.setNext(channelInterceptor); - } - } else { - // no source interceptor chain or source handlers, conntect to target interceptor chain or channel - if (targetInterceptorChainHead != null) { - sourceInterceptorChainHead = targetInterceptorChainHead; - sourceInterceptorChainTail = targetInterceptorChainHead; - } else { - Interceptor channelInterceptor = new RequestResponseInterceptor(null, targetRequestChannel, null, - targetResponseChannel); - sourceInterceptorChainHead = channelInterceptor; - sourceInterceptorChainTail = channelInterceptor; - } - } - } - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/InvocationException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/InvocationException.java deleted file mode 100644 index d089b45d76..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/InvocationException.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.apache.tuscany.core.invocation; - -import org.apache.tuscany.common.TuscanyException; - -/** - * The root checked exception for the invocation framework - * - * @version $Rev$ $Date$ - */ -public abstract class InvocationException extends TuscanyException { - - public InvocationException() { - super(); - } - - public InvocationException(String message) { - super(message); - } - - public InvocationException(String message, Throwable cause) { - super(message, cause); - } - - public InvocationException(Throwable cause) { - super(cause); - } - -} - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/InvocationRuntimeException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/InvocationRuntimeException.java deleted file mode 100644 index ddb7b5f74b..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/InvocationRuntimeException.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation; - -import org.osoa.sca.ServiceRuntimeException; - -/** - * Denotes an exception thrown during invocation processing - * - * @version $Rev$ $Date$ - */ -public class InvocationRuntimeException extends ServiceRuntimeException { - - public InvocationRuntimeException() { - super(); - } - - public InvocationRuntimeException(String message) { - super(message); - } - - public InvocationRuntimeException(String message, Throwable cause) { - super(message, cause); - } - - public InvocationRuntimeException(Throwable cause) { - super(cause); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/MessageChannel.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/MessageChannel.java deleted file mode 100644 index 4a5e8a1f87..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/MessageChannel.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation; - -import org.apache.tuscany.core.message.Message; - -/** - * Represents a one-way pipeline through which messages are sent during an invocation - * - * @see org.apache.tuscany.core.message.Message - */ -public interface MessageChannel { - - /** - * Sends a message - */ - void send(Message message); - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/MessageHandler.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/MessageHandler.java deleted file mode 100644 index 4719fbae81..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/MessageHandler.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation; - -import org.apache.tuscany.core.message.Message; - - -/** - * Performs a uni-directional mediation on a message - * - * @see org.apache.tuscany.core.message.Message - */ -public interface MessageHandler { - - /** - * Process a message. - */ - boolean processMessage(Message message); - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/MethodHashMap.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/MethodHashMap.java deleted file mode 100644 index 183cb5ecbb..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/MethodHashMap.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation; - -import java.lang.reflect.Method; -import java.util.HashMap; - -import org.apache.tuscany.core.config.JavaIntrospectionHelper; - -/** - * A HashMap keyed by method - */ -public class MethodHashMap extends HashMap { - - /** - * Constructs a new MethodHashMap. - */ - public MethodHashMap() { - super(); - } - - /** - * Constructs a new MethodHashMap. - */ - public MethodHashMap(int size) { - super(size); - } - - /** - * @see java.util.HashMap#get(java.lang.Object) - */ - public Object get(Object key) { - Method method=(Method)key; - //FIXME find a more efficient way to find a matching method - Method closestMethod=JavaIntrospectionHelper.findClosestMatchingMethod(method.getName(), method.getParameterTypes(), super.keySet()); - return super.get(closestMethod); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/ProxyConfiguration.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/ProxyConfiguration.java deleted file mode 100644 index 11fc4768f3..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/ProxyConfiguration.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation; - -import java.lang.reflect.Method; -import java.util.Map; - -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.message.MessageFactory; - -/** - * Represents configuration information for creating a service proxy. When a client component implementation is injected - * with a service proxy representing a wire, source- and target-side proxy configurations are "bridged" together. This - * concatenated configuration may then be used to generate a proxy implemented a particular business interface required - * by the client. - * - * @version $Rev$ $Date$ - */ -public class ProxyConfiguration { - - private Map configurations; - - private ClassLoader proxyClassLoader; - - private MessageFactory messageFactory; - - private QualifiedName serviceName; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - /** - * Creates a configuration used to generate proxies representing a service. - * - * @param serviceName the qualified name of the service represented by this configuration - * @param invocationConfigs a collection of operation-to-invocation configuration mappings for the service - * @param proxyClassLoader the classloader to use when creating a proxy - * @param messageFactory the factory used to create invocation messages - */ - public ProxyConfiguration(QualifiedName serviceName, Map invocationConfigs, - ClassLoader proxyClassLoader, MessageFactory messageFactory) { - assert (invocationConfigs != null) : "No invocation configuration map specified"; - this.serviceName = serviceName; - configurations = invocationConfigs; - this.messageFactory = messageFactory; - if (proxyClassLoader == null) { - this.proxyClassLoader = Thread.currentThread().getContextClassLoader(); - } else { - this.proxyClassLoader = proxyClassLoader; - } - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - /** - * Returns the qualified service name the configuration is associated with - */ - public QualifiedName getTargetName() { - return serviceName; - } - - /** - * Returns a collection of operation types to {@link InvocationConfiguration} mappings that represent the specific - * proxy configuration information for particular operations - */ - public Map getInvocationConfigurations() { - return configurations; - } - - /** - * Returns the classloader to use in creating proxies - */ - public ClassLoader getProxyClassLoader() { - return proxyClassLoader; - } - - /** - * Returns the factory used to create invocation messages - */ - public MessageFactory getMessageFactory() { - return messageFactory; - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/TargetInvoker.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/TargetInvoker.java deleted file mode 100644 index e0a85d0b6e..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/TargetInvoker.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation; - -import java.lang.reflect.InvocationTargetException; - -/** - * Implementations are responsible for resolving a target and performing the actual invocation on it, for example, a - * service component implementation instance or an external service client. - * - * @version $Rev$ $Date$ - */ -public interface TargetInvoker extends Interceptor, Cloneable{ - - /** - * Responsible for invoking an operation on a target with the given payload - * - * @param payload the parameters of the target operation or null - * @throws InvocationTargetException if the target operation itself throws an exception. The root cause will be set - * to that exception - */ - public Object invokeTarget(Object payload) throws InvocationTargetException; - - /** - * Determines whether the proxy can be cached on the client/source side - */ - public boolean isCacheable(); - - public Object clone(); -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/InvokerInterceptor.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/InvokerInterceptor.java deleted file mode 100644 index 7b9dc1c86f..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/InvokerInterceptor.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation.impl; - -import org.apache.tuscany.core.invocation.Interceptor; -import org.apache.tuscany.core.invocation.InvocationRuntimeException; -import org.apache.tuscany.core.invocation.TargetInvoker; -import org.apache.tuscany.core.message.Message; - -/** - * Serves as a tail interceptor on a target invocation chain. This implementation dispatches to the target invoker - * passed inside the invocation message. Target invokers are passed from the source in order to allow for caching of - * target instances. - * - * @see org.apache.tuscany.core.invocation.TargetInvoker - * @version $Rev$ $Date$ - */ -public class InvokerInterceptor implements Interceptor { - - public InvokerInterceptor() { - } - - public Message invoke(Message msg) throws InvocationRuntimeException { - TargetInvoker invoker = msg.getTargetInvoker(); - if (invoker == null) { - throw new InvocationRuntimeException("No target invoker specified on message"); - } - return invoker.invoke(msg); - } - - public void setNext(Interceptor next) { - throw new IllegalStateException("This interceptor must be the last one in an target interceptor chain"); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/MessageChannelImpl.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/MessageChannelImpl.java deleted file mode 100644 index 6c0b15a823..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/MessageChannelImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation.impl; - -import java.util.List; - -import org.apache.tuscany.core.invocation.MessageChannel; -import org.apache.tuscany.core.invocation.MessageHandler; -import org.apache.tuscany.core.message.Message; - -/** - * A channel comprising an ordered collection of message handlers. - * - *@see org.apache.tuscany.core.message.Message - * @version $Rev$ $Date$ - */ -public class MessageChannelImpl implements MessageChannel { - - private final List pipeline; - - //---------------------------------- - // Constructors - //---------------------------------- - - /** - * Construct a new channel comprising the supplied list of handlers. - * - * @param pipeline the Handlers in the channel - */ - public MessageChannelImpl(List pipeline) { - this.pipeline = pipeline; - } - - //---------------------------------- - // Methods - //---------------------------------- - - /** - * Send a message down the channel. The message will be processed by all handlers - * in order until one returns false to indicate processing is complete or all - * handlers have been called. - * - * @param msg a Message to send down the channel - */ - public void send(Message msg) { - if (pipeline!=null) { - for (MessageHandler handler : pipeline) { - if (!handler.processMessage(msg)) { - break; - } - } - } - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/MessageDispatcher.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/MessageDispatcher.java deleted file mode 100644 index a162962717..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/MessageDispatcher.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation.impl; - -import org.apache.tuscany.core.invocation.Interceptor; -import org.apache.tuscany.core.invocation.MessageHandler; -import org.apache.tuscany.core.message.Message; - -/** - * A message handler that dispatches the message through an interceptor stack and the uses the response channel to - * return the invocation result. - * - * @version $Rev$ $Date$ - */ -public class MessageDispatcher implements MessageHandler { - private final Interceptor head; - - /** - * Construct a handler that dispatches messages to an Interceptor stack. - * - * @param head the interceptor at the head of the stack - */ - public MessageDispatcher(Interceptor head) { - this.head = head; - } - - public boolean processMessage(Message msg) { - Message resp = head.invoke(msg); - msg.getCallbackChannel().send(resp); - return false; - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/NullProxyFactory.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/NullProxyFactory.java deleted file mode 100644 index fa4297ef00..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/NullProxyFactory.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.apache.tuscany.core.invocation.impl; - -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.invocation.ProxyConfiguration; -import org.apache.tuscany.core.invocation.spi.ProxyCreationException; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.invocation.spi.ProxyInitializationException; - -/** - * Returns an actual implementation instance as opposed to a proxy. Used in cases where proxying may be optimized away. - * - * @version $Rev: 379957 $ $Date: 2006-02-22 14:58:24 -0800 (Wed, 22 Feb 2006) $ - */ -public class NullProxyFactory implements ProxyFactory { - - private AggregateContext parentContext; - - private String targetName; - - public NullProxyFactory(String componentName, AggregateContext parentContext) { - assert (parentContext != null) : "Parent context was null"; - this.targetName = componentName; - this.parentContext = parentContext; - } - - public void initialize(Class businessInterface, ProxyConfiguration config) throws ProxyInitializationException { - } - - public Object createProxy() throws ProxyCreationException { - return parentContext.getContext(targetName); - } - - public void initialize() throws ProxyInitializationException { - } - - public ProxyConfiguration getProxyConfiguration() { - return null; - } - - public void setProxyConfiguration(ProxyConfiguration config) { - } - - public void setBusinessInterface(Class interfaze) { - } - - public Class getBusinessInterface() { - return null; - } - - public void addInterface(Class claz) { - } - - public Class[] getImplementatedInterfaces() { - return null; - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/OneWayInterceptor.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/OneWayInterceptor.java deleted file mode 100644 index 71d324e032..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/OneWayInterceptor.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation.impl; - -import org.apache.tuscany.core.invocation.Interceptor; -import org.apache.tuscany.core.invocation.MessageChannel; -import org.apache.tuscany.core.message.Message; - -/** - * An interceptor that sends the invocation Message down its request channel and does not expect a response. - * - * @version $Rev$ $Date$ - */ -public class OneWayInterceptor implements Interceptor { - private MessageChannel requestChannel; - - /** - * Construct an interceptor that sends messages down the supplied channel. - * - * @param requestChannel the channel to send messages down - */ - public OneWayInterceptor(MessageChannel requestChannel) { - this.requestChannel = requestChannel; - } - - public Message invoke(Message message) { - requestChannel.send(message); - return null; - } - - public void setNext(Interceptor next) { - throw new IllegalStateException("This interceptor must be the last one in an interceptor chain"); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/RequestResponseInterceptor.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/RequestResponseInterceptor.java deleted file mode 100644 index 03122f0992..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/impl/RequestResponseInterceptor.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation.impl; - -import org.apache.tuscany.core.invocation.Interceptor; -import org.apache.tuscany.core.invocation.MessageChannel; -import org.apache.tuscany.core.message.Message; - -/** - * An interceptor that first sends the invocation Message down its request channel then extracts the response from the - * message and sends it down the response channel before returning it up the interceptor stack. - * - * @version $Rev$ $Date$ - */ -public class RequestResponseInterceptor implements Interceptor { - - private MessageChannel sourceRequestChannel; - - private MessageChannel sourceResponseChannel; - - private MessageChannel targetRequestChannel; - - private MessageChannel targetResponseChannel; - - /** - * Construct an interceptor that sends messages down the supplied channels. - * - * @param targetRequestChannel the channel to send request messages down - * @param targetResponseChannel the channel to sent response messages down - */ - public RequestResponseInterceptor(MessageChannel sourceRequestChannel, MessageChannel targetRequestChannel, - MessageChannel sourceResponseChannel, MessageChannel targetResponseChannel) { - this.sourceRequestChannel = sourceRequestChannel; - this.sourceResponseChannel = sourceResponseChannel; - this.targetRequestChannel = targetRequestChannel; - this.targetResponseChannel = targetResponseChannel; - } - - public Message invoke(Message requestMessage) { - if (sourceRequestChannel != null) { - sourceRequestChannel.send(requestMessage); - } - if (targetRequestChannel != null) { - targetRequestChannel.send(requestMessage); - } - Message responseMessage = requestMessage.getRelatedCallbackMessage(); - if (targetResponseChannel != null) { - targetResponseChannel.send(responseMessage); - } - if (sourceResponseChannel != null) { - sourceResponseChannel.send(responseMessage); - } - return responseMessage; - } - - public void setNext(Interceptor next) { - throw new IllegalStateException("This interceptor must be the last one in an interceptor chain"); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/jdk/JDKInvocationHandler.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/jdk/JDKInvocationHandler.java deleted file mode 100644 index 2f27698d6b..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/jdk/JDKInvocationHandler.java +++ /dev/null @@ -1,143 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation.jdk; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.core.context.TargetException; -import org.apache.tuscany.core.invocation.Interceptor; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.TargetInvoker; -import org.apache.tuscany.core.message.Message; -import org.apache.tuscany.core.message.MessageFactory; - -/** - * Receives a request from a JDK proxy and dispatches it to a target invoker or source interceptor stack - * - * @version $Rev$ $Date$ - */ -public class JDKInvocationHandler implements InvocationHandler { - - private MessageFactory messageFactory; - - /* - * an association of an operation to configuration holder. The holder contains the master invocation configuration - * and a locale clone of the master TargetInvoker. TargetInvokers will be cloned by the handler and placed in the - * holder if they are cacheable. This allows optimizations such as avoiding target resolution when a source refers - * to a target of greater scope since the target reference can be maintained by the invoker. When a target invoker - * is not cacheable, the master associated with the invocation configuration will be used. - */ - private Map configuration; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public JDKInvocationHandler(MessageFactory messageFactory, Map configuration) { - assert (configuration != null) : "Configuration not specified"; - this.configuration = new HashMap(configuration.size()); - for (Map.Entry entry : configuration.entrySet()) { - this.configuration.put(entry.getKey(), new ConfigHolder(entry.getValue())); - } - // this.configuration = configuration; - this.messageFactory = messageFactory; - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - /** - * Dispatches a client request made on a proxy - */ - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - Interceptor headInterceptor = null; - ConfigHolder holder = configuration.get(method); - if (holder == null) { - TargetException e = new TargetException("Operation not configured"); - e.setIdentifier(method.getName()); - throw e; - } - InvocationConfiguration config = holder.config; - if (config != null) { - headInterceptor = config.getSourceInterceptor(); - } - - TargetInvoker invoker = null; - - if (holder.cachedInvoker == null) { - if(config.getTargetInvoker() == null){ - TargetException e= new TargetException("No target invoker configured for operation"); - e.setIdentifier(config.getMethod().getName()); - throw e; - } - if (config.getTargetInvoker().isCacheable()) { - // clone and store the invoker locally - holder.cachedInvoker = (TargetInvoker) config.getTargetInvoker().clone(); - invoker = holder.cachedInvoker; - } else { - invoker = config.getTargetInvoker(); - } - } else { - invoker = config.getTargetInvoker(); - } - if (headInterceptor == null) { - try { - // short-circuit the dispatch and invoke the target directly - if (config.getTargetInvoker() == null) { - throw new AssertionError("No target invoker [" + method.getName() + "]"); - } - return config.getTargetInvoker().invokeTarget(args); - } catch (InvocationTargetException e) { - // the cause was thrown by the target so throw it - throw e.getCause(); - } - } else { - Message msg = messageFactory.createMessage(); - msg.setTargetInvoker(invoker);// config.getTargetInvoker()); - msg.setBody(args); - // dispatch the invocation down the chain and get the response - Message resp = headInterceptor.invoke(msg); - - Object body = resp.getBody(); - if (body instanceof Throwable) { - throw (Throwable) body; - } - return body; - } - } - - /** - * A holder used to associate an invocation configuration with a local copy of a target invoker that was previously - * cloned from the configuration master - */ - private class ConfigHolder { - - public ConfigHolder(InvocationConfiguration config) { - this.config = config; - } - - InvocationConfiguration config; - - TargetInvoker cachedInvoker; - } - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/jdk/JDKProxyFactory.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/jdk/JDKProxyFactory.java deleted file mode 100644 index 75137ffa36..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/jdk/JDKProxyFactory.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation.jdk; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; -import java.util.Map; - -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.MethodHashMap; -import org.apache.tuscany.core.invocation.ProxyConfiguration; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.invocation.spi.ProxyInitializationException; - -/** - * Creates proxies for handling invocations using JDK dynamic proxies - * - * @version $Rev$ $Date$ - */ -public class JDKProxyFactory implements ProxyFactory { - - private static final int UNINITIALIZED = 0; - - private static final int INITIALIZED = 1; - - private static final int ERROR = -1; - - private int state = UNINITIALIZED; - - private Class[] businessInterfaceArray; - - private Map methodToInvocationConfig; - - private ProxyConfiguration configuration; - - public void initialize() throws ProxyInitializationException { - if (state != UNINITIALIZED) { - throw new IllegalStateException("Proxy factory in wrong state [" + state + "]"); - } - Map invocationConfigs = configuration.getInvocationConfigurations(); - methodToInvocationConfig = new MethodHashMap(invocationConfigs.size()); - for (Map.Entry entry : invocationConfigs.entrySet()) { - Method method = (Method) entry.getKey(); - methodToInvocationConfig.put(method, (InvocationConfiguration) entry.getValue()); - } - state = INITIALIZED; - } - - public Object createProxy() { - if (state != INITIALIZED) { - throw new IllegalStateException("Proxy factory not INITIALIZED [" + state + "]"); - } - InvocationHandler handler = new JDKInvocationHandler(configuration.getMessageFactory(), methodToInvocationConfig); - return Proxy.newProxyInstance(configuration.getProxyClassLoader(), businessInterfaceArray, handler); - } - - public ProxyConfiguration getProxyConfiguration() { - return configuration; - } - - public void setProxyConfiguration(ProxyConfiguration config) { - configuration = config; - } - - public void setBusinessInterface(Class interfaze) { - businessInterfaceArray = new Class[] { interfaze }; - } - - public Class getBusinessInterface() { - return businessInterfaceArray[0]; - } - - public void addInterface(Class claz) { - throw new UnsupportedOperationException("Additional proxy interfaces not yet supported"); - } - - public Class[] getImplementatedInterfaces() { - return businessInterfaceArray; - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/jdk/JDKProxyFactoryFactory.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/jdk/JDKProxyFactoryFactory.java deleted file mode 100644 index 81458e4178..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/jdk/JDKProxyFactoryFactory.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation.jdk; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Proxy; - -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.invocation.spi.ProxyFactoryFactory; - -/** - * Creates JDK Dynamic Proxy-based proxy factories - * - * @version $Rev$ $Date$ - */ -public class JDKProxyFactoryFactory implements ProxyFactoryFactory { - - public JDKProxyFactoryFactory() { - } - - public ProxyFactory createProxyFactory() { - return new JDKProxyFactory(); - } - - public boolean isProxy(Object object) { - if (object == null) { - return false; - } else { - return Proxy.isProxyClass(object.getClass()); - } - } - - public InvocationHandler getHandler(Object proxy) { - if (proxy == null) { - return null; - } else { - return Proxy.getInvocationHandler(proxy); - } - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/spi/ProxyCreationException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/spi/ProxyCreationException.java deleted file mode 100644 index 2a97975bf9..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/spi/ProxyCreationException.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation.spi; - -/** - * Denotes an error creating a proxy instance - * - * @version $Rev$ $Date$ - */ -public class ProxyCreationException extends ProxyException { - - public ProxyCreationException() { - super(); - } - - public ProxyCreationException(String message, Throwable cause) { - super(message, cause); - } - - public ProxyCreationException(String message) { - super(message); - } - - public ProxyCreationException(Throwable cause) { - super(cause); - } - -} - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/spi/ProxyException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/spi/ProxyException.java deleted file mode 100644 index 843a90d341..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/spi/ProxyException.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation.spi; - -import org.apache.tuscany.core.invocation.InvocationException; - -public class ProxyException extends InvocationException { - - public ProxyException() { - super(); - } - - public ProxyException(String message) { - super(message); - } - - public ProxyException(String message, Throwable cause) { - super(message, cause); - } - - public ProxyException(Throwable cause) { - super(cause); - } - -} - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/spi/ProxyFactory.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/spi/ProxyFactory.java deleted file mode 100644 index aef98a0b4c..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/spi/ProxyFactory.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation.spi; - -import org.apache.tuscany.core.invocation.ProxyConfiguration; - -/** - * Implementations are responsible for creating service proxies using a particular proxy strategy. Service proxies may - * represent a wire between two components or a reference to a service resolved through a locate operation. When - * representing a wire, a proxy is injected on reference in a component implementation. In this case the proxy will - * implement the interface required by the reference and pass invocation messages down source- and target-side - * invocation chains for processing. These source- and target-side invocation chains will be derived from metadata - * decorating the source reference and target service definition and implementation respectively. - *

- * The second type of proxy will be generated when non-component client code (such as a JSP) locates a service. In this - * case, the proxy will implement the requested service interface but will only contain a target-side invocation chain. - * - * @version $Rev$ $Date$ - */ -public interface ProxyFactory { - - /** - * Prepares the factory for generating the proxy of a particular reference type. This will typically be called when - * construction of the proxy configuration is complete, including linking of source and target invocation chains. - * - * @throws ProxyInitializationException if an error is encountered during initialization - */ - public void initialize() throws ProxyInitializationException; - - /** - * Returns a proxy for a service reference - */ - public T createProxy() throws ProxyCreationException; - - /** - * Returns the configuration information used to create a proxy - */ - public ProxyConfiguration getProxyConfiguration(); - - /** - * Sets the configuration information used to create a proxy - */ - public void setProxyConfiguration(ProxyConfiguration config); - - /** - * Sets the primary interface type generated proxies should implement - */ - public void setBusinessInterface(Class interfaze); - - /** - * Returns the primary interface type implemented by generated proxies - */ - public Class getBusinessInterface(); - - /** - * Adds an interface type generated proxies should implement - */ - public void addInterface(Class claz); - - /** - * Returns an array of all interfaces implemented by generated proxies - */ - public Class[] getImplementatedInterfaces(); - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/spi/ProxyFactoryFactory.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/spi/ProxyFactoryFactory.java deleted file mode 100644 index 8e4c2ee589..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/spi/ProxyFactoryFactory.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation.spi; - -import java.lang.reflect.InvocationHandler; - -/** - * Creates proxy factories which may be subsequently configured to generate proxies - * - * @version $Rev$ $Date$ - */ -public interface ProxyFactoryFactory { - - /** - * Returns a new proxy factory - */ - public ProxyFactory createProxyFactory(); - - /** - * Determines whether the given object is a proxy - */ - public boolean isProxy(Object object); - - /** - * Returns an invocation handler fronting the invocation chains used by the proxy. Note that should SCA define a - * DII, this could return such an interface. - * - * @throws IllegalArgumentException if the class is not a proxy - */ - public InvocationHandler getHandler(Object proxy) throws IllegalArgumentException; -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/spi/ProxyInitializationException.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/spi/ProxyInitializationException.java deleted file mode 100644 index d8c8e64614..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/invocation/spi/ProxyInitializationException.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation.spi; - -/** - * Denotes an error initializing a proxy factory - * - * @version $Rev$ $Date$ - */ -public class ProxyInitializationException extends ProxyException { - - public ProxyInitializationException() { - super(); - } - - public ProxyInitializationException(String message) { - super(message); - } - - public ProxyInitializationException(String message, Throwable cause) { - super(message, cause); - } - - public ProxyInitializationException(Throwable cause) { - super(cause); - } - -} - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/loader/SCDLModelLoaderRegistry.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/loader/SCDLModelLoaderRegistry.java deleted file mode 100644 index 0205c1350e..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/loader/SCDLModelLoaderRegistry.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.core.loader; - -import java.util.List; - -import org.apache.tuscany.model.scdl.loader.SCDLModelLoader; - -/** - * A ModelLoaderRegistry maintains a list of SCDLModelLoaders that have been contributed - * to the system by various extension components (such as implementations or bindings). - * - * - * @version $Rev$ $Date$ - */ -public interface SCDLModelLoaderRegistry { - /** - * Returns the list of registered model loaders. - * - * @return the list of registered model loaders - */ - List getLoaders(); - - /** - * Register a model loader. - * - * @param loader the loader being contributed by the extension component - */ - void registerLoader(SCDLModelLoader loader); - - /** - * Unregister a model loader. - * - * @param loader the loader previously contributed by the extension component - */ - void unregisterLoader(SCDLModelLoader loader); -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/loader/impl/SCDLModelLoaderRegistryImpl.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/loader/impl/SCDLModelLoaderRegistryImpl.java deleted file mode 100644 index 2f0ba73252..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/loader/impl/SCDLModelLoaderRegistryImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.core.loader.impl; - -import java.util.List; -import java.util.ArrayList; -import java.util.Collections; - -import org.apache.tuscany.core.loader.SCDLModelLoaderRegistry; -import org.apache.tuscany.model.scdl.loader.SCDLModelLoader; - -/** - * @version $Rev$ $Date$ - */ -public class SCDLModelLoaderRegistryImpl implements SCDLModelLoaderRegistry { - private final List loaders; - private final List registry; - - public SCDLModelLoaderRegistryImpl() { - registry = new ArrayList(); - loaders = Collections.unmodifiableList(registry); - } - - public List getLoaders() { - return loaders; - } - - public void registerLoader(SCDLModelLoader loader) { - registry.add(loader); - } - - public void unregisterLoader(SCDLModelLoader loader) { - registry.remove(loader); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/message/Message.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/message/Message.java deleted file mode 100644 index e316050511..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/message/Message.java +++ /dev/null @@ -1,182 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.message; - -import java.util.Map; - -import org.apache.tuscany.core.addressing.EndpointReference; -import org.apache.tuscany.core.invocation.MessageChannel; -import org.apache.tuscany.core.invocation.TargetInvoker; - -/** - * Represents a request, response, or exception for an invocation - */ -public interface Message { - - /** - * Return any message headers associated with the invocation. - */ - Map getHeaders(); - - /** - * Returns the body of the message, which will be the payload or parameters - * associated with the invocation - * FIXME what is different w/ getPayload()? - */ - Object getBody(); - - /** - * Sets the body of the message. - */ - void setBody(Object body); - - /** - * Returns true if the message is a request message - * FIXME is this still used? - */ - boolean isRequest(); - - /** - * Returns true if the message is an inbound message - * FIXME is this still used? - */ - boolean isResponse(); - - /** - * Sets the To header - * FIXME Javadoc - */ - void setTo(EndpointReference to); - - /** - * Returns the To header - * FIXME Javadoc - */ - EndpointReference getTo(); - - /** - * Sets the From header - * FIXME Javadoc - */ - void setFrom(EndpointReference from); - - /** - * Returns the From header - * FIXME Javadoc - */ - EndpointReference getFrom(); - - /** - * Sets the message ID - */ - void setMessageID(String messageID); - - /** - * Returns the message ID - */ - String getMessageID(); - - /** - * Sets the Action header - * FIXME Javadoc - */ - void setAction(String action); - - /** - * Returns the Action header - * FIXME Javadoc - */ - String getAction(); - - /** - * Sets the ReplyTo header - * FIXME Javadoc - */ - void setReplyTo(EndpointReference replyTo); - - /** - * Returns the ReplyTo header - * FIXME Javadoc - */ - EndpointReference getReplyTo(); - - /** - * Sets the RelatesTo header - * FIXME Javadoc - */ - void setRelatesTo(String relatesTo); - - /** - * Returns the RelatesTo header - * FIXME Javadoc - */ - String getRelatesTo(); - - /** - * Sets the FaultTo header - * FIXME Javadoc - */ - void setFaultTo(EndpointReference faultTo); - - /** - * Returns the FaultTo header - * FIXME Javadoc - */ - EndpointReference getFaultTo(); - - /** - * Sets the EndpointReference header - * FIXME Javadoc - */ - void setEndpointReference(EndpointReference endpointReference); - - /** - * Returns the EndpointReference header - * FIXME Javadoc - */ - EndpointReference getEndpointReference(); - - /** - * Sets the operation name - * FIXME Javadoc - */ - void setOperationName(String operationName); - - /** - * Returns the operation name - * FIXME Javadoc - */ - String getOperationName(); - - /** - * Returns the callback channel - * FIXME Javadoc - */ - MessageChannel getCallbackChannel(); - - /** - * Returns the related callback message - * FIXME Javadoc - */ - Message getRelatedCallbackMessage(); - - //ADDED - public void setTargetInvoker(TargetInvoker invoker); - - public TargetInvoker getTargetInvoker(); - -} // Message diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/message/MessageFactory.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/message/MessageFactory.java deleted file mode 100644 index 74b0e85848..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/message/MessageFactory.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.message; - -/** - * The Factory for messages - * - * @see org.apache.tuscany.core.message.Message - */ -public interface MessageFactory { - - /** - * Returns a new message. - */ - Message createMessage(); - -} // MessageFactory diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/message/impl/MessageFactoryImpl.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/message/impl/MessageFactoryImpl.java deleted file mode 100644 index 43787bbe67..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/message/impl/MessageFactoryImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.message.impl; - -import org.apache.tuscany.core.message.Message; -import org.apache.tuscany.core.message.MessageFactory; - -/** - * The default message factory - * - * @version $Rev$ $Date$ - */ -public class MessageFactoryImpl implements MessageFactory { - - /** - * Constructor - */ - public MessageFactoryImpl() { - super(); - } - - public Message createMessage() { - return new MessageImpl(); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/message/impl/MessageImpl.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/message/impl/MessageImpl.java deleted file mode 100644 index b67c7e227e..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/message/impl/MessageImpl.java +++ /dev/null @@ -1,249 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.message.impl; - -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.core.addressing.EndpointReference; -import org.apache.tuscany.core.invocation.MessageChannel; -import org.apache.tuscany.core.invocation.TargetInvoker; -import org.apache.tuscany.core.message.Message; - -/** - */ -public class MessageImpl implements Message, MessageChannel { - - private String action; - private Object body; - private EndpointReference endpointReference; - private EndpointReference faultTo; - private EndpointReference from; - private Map headers; - private String messageID; - private String operationName; - private Message relatedCallbackMessage; - private String relatesTo; - private EndpointReference replyTo; - private TargetInvoker invoker; - private EndpointReference to; - - /** - * Constructor - */ - protected MessageImpl() { - super(); - } - - /** - * @see org.apache.tuscany.core.message.Message#getAction() - */ - public String getAction() { - return action; - } - - /** - * @see org.apache.tuscany.core.message.Message#getBody() - */ - public Object getBody() { - return body; - } - - /** - * @see org.apache.tuscany.core.message.Message#getEndpointReference() - */ - public EndpointReference getEndpointReference() { - return endpointReference; - } - - /** - * @see org.apache.tuscany.core.message.Message#getFaultTo() - */ - public EndpointReference getFaultTo() { - return faultTo; - } - - /** - * @see org.apache.tuscany.core.message.Message#getFrom() - */ - public EndpointReference getFrom() { - return from; - } - - /** - * @see org.apache.tuscany.core.message.Message#getHeaders() - */ - public Map getHeaders() { - if (headers==null) - headers=new HashMap(); - return headers; - } - - /** - * @see org.apache.tuscany.core.message.Message#getMessageID() - */ - public String getMessageID() { - return messageID; - } - - /** - * @see org.apache.tuscany.core.message.Message#getOperationName() - */ - public String getOperationName() { - return operationName; - } - - /** - * @see org.apache.tuscany.core.message.Message#getRelatesTo() - */ - public String getRelatesTo() { - return relatesTo; - } - - /** - * @see org.apache.tuscany.core.message.Message#getReplyTo() - */ - public EndpointReference getReplyTo() { - return replyTo; - } - - /** - * @see org.apache.tuscany.core.message.Message#getTo() - */ - public EndpointReference getTo() { - return to; - } - - /** - * @see org.apache.tuscany.core.message.Message#isRequest() - */ - public boolean isRequest() { - return relatesTo==null; - } - - /** - * @see org.apache.tuscany.core.message.Message#isResponse() - */ - public boolean isResponse() { - return relatesTo!=null; - } - - /** - * @see org.apache.tuscany.core.message.Message#setAction(java.lang.String) - */ - public void setAction(String action) { - this.action=action; - } - - /** - * @see org.apache.tuscany.core.message.Message#setBody(java.lang.Object) - */ - public void setBody(Object body) { - this.body=body; - } - - /** - * @see org.apache.tuscany.core.message.Message#setEndpointReference(org.apache.tuscany.core.client.runtime.addressing.sdo.EndpointReference) - */ - public void setEndpointReference(EndpointReference endpointReference) { - this.endpointReference=endpointReference; - } - - /** - * @see org.apache.tuscany.core.message.Message#setFaultTo(org.apache.tuscany.core.client.runtime.addressing.sdo.EndpointReference) - */ - public void setFaultTo(EndpointReference faultTo) { - this.faultTo=faultTo; - } - - /** - * @see org.apache.tuscany.core.message.Message#setFrom(org.apache.tuscany.core.client.runtime.addressing.sdo.EndpointReference) - */ - public void setFrom(EndpointReference from) { - this.from=from; - } - - /** - * @see org.apache.tuscany.core.message.Message#setMessageID(java.lang.String) - */ - public void setMessageID(String messageID) { - this.messageID=messageID; - } - - /** - * @see org.apache.tuscany.core.message.Message#setOperationName(java.lang.String) - */ - public void setOperationName(String operationName) { - this.operationName=operationName; - } - - /** - * @see org.apache.tuscany.core.message.Message#setRelatesTo(java.lang.String) - */ - public void setRelatesTo(String relatesTo) { - this.relatesTo=relatesTo; - } - - /** - * @see org.apache.tuscany.core.message.Message#setReplyTo(org.apache.tuscany.core.client.runtime.addressing.sdo.EndpointReference) - */ - public void setReplyTo(EndpointReference replyTo) { - this.replyTo=replyTo; - } - - /** - * @see org.apache.tuscany.core.message.Message#setTo(org.apache.tuscany.core.client.runtime.addressing.sdo.EndpointReference) - */ - public void setTo(EndpointReference to) { - this.to=to; - } - - /** - * @see org.apache.tuscany.core.message.Message#getCallbackChannel() - */ - public MessageChannel getCallbackChannel() { - return this; - } - - /** - * @see org.apache.tuscany.core.invocation.MessageChannel#send(org.apache.tuscany.core.message.Message) - */ - public void send(Message message) { - relatedCallbackMessage = message; - } - - /** - * @see org.apache.tuscany.core.message.Message#getRelatedCallbackMessage() - */ - public Message getRelatedCallbackMessage() { - return relatedCallbackMessage; - } - - /** - * @see org.apache.tuscany.core.message.Message#setTargetInvoker(org.apache.tuscany.core.invocation.TargetInvoker) - */ - public void setTargetInvoker(TargetInvoker invoker){ - this.invoker = invoker; - } - - /** - * @see org.apache.tuscany.core.message.Message#getTargetInvoker() - */ - public TargetInvoker getTargetInvoker(){ - return invoker; - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeContext.java deleted file mode 100644 index 5bf71a09f9..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeContext.java +++ /dev/null @@ -1,83 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.runtime; - -import org.apache.tuscany.common.monitor.MonitorFactory; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.builder.WireBuilder; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.AutowireContext; -import org.apache.tuscany.core.context.ConfigurationContext; -import org.apache.tuscany.core.context.SystemAggregateContext; -import org.apache.tuscany.model.scdl.loader.SCDLModelLoader; - -/** - * Represents a top-level component context in the runtime, that is the bootstrap context. - * This context serves as the ultimate root of the context hierarchy. Under it are two - * separate trees: the rootContext for user components and the systemContext for - * system components (those that comprise the runtime itself). - * - * @version $Rev$ $Date$ - */ -public interface RuntimeContext extends AutowireContext, ConfigurationContext { - - /* the symbolic name of the runtime bootstrap context */ - public static final String RUNTIME = "tuscany.runtime"; - - /* the symbolic name of the aggregate context containing all system components in the runtime */ - public static final String SYSTEM = "tuscany.system"; - - /* the symbolic name of the aggregate context containing all user components in the runtime */ - public static final String ROOT = "tuscany.root"; - - /** - * Returns the context that forms the root of the user component tree. - * All user components will managed by contexts that are children of this root. - * @return the root of the user component tree - */ - public AggregateContext getRootContext(); - - /** - * Returns the context that forms the root of the system component tree. - * All system components, components that provide system services needed by the - * Tuscany runtime itself, will be managed by contexts that are children of this root. - * @return the root of the system component tree - */ - public SystemAggregateContext getSystemContext(); - - /** - * Adds a configuration builder to the runtime - */ - @Deprecated - public void addBuilder(RuntimeConfigurationBuilder builder); - - /** - * Adds a wire builder to the runtime - */ - @Deprecated - public void addBuilder(WireBuilder builder); - - /** - * Adds an SCDL model loader to the runtime - */ - @Deprecated - public void addLoader(SCDLModelLoader loader); - - /** - * Returns the monitor factory in use by the runtime - */ - @Deprecated - public MonitorFactory getMonitorFactory(); - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeContextImpl.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeContextImpl.java deleted file mode 100644 index 044958b9bf..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeContextImpl.java +++ /dev/null @@ -1,286 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.runtime; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.common.monitor.MonitorFactory; -import org.apache.tuscany.common.monitor.impl.NullMonitorFactory; -import org.apache.tuscany.core.builder.BuilderConfigException; -import org.apache.tuscany.core.builder.HierarchicalWireBuilder; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.builder.WireBuilder; -import org.apache.tuscany.core.builder.impl.AssemblyVisitor; -import org.apache.tuscany.core.builder.impl.DefaultWireBuilder; -import org.apache.tuscany.core.config.ConfigurationException; -import org.apache.tuscany.core.context.AbstractContext; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.AutowireContext; -import org.apache.tuscany.core.context.AutowireResolutionException; -import org.apache.tuscany.core.context.ConfigurationContext; -import org.apache.tuscany.core.context.CoreRuntimeException; -import org.apache.tuscany.core.context.EventException; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.RuntimeEventListener; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.context.SystemAggregateContext; -import org.apache.tuscany.core.context.TargetException; -import org.apache.tuscany.core.context.impl.AggregateContextImpl; -import org.apache.tuscany.core.context.impl.EventContextImpl; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.system.context.SystemAggregateContextImpl; -import org.apache.tuscany.core.system.context.SystemScopeStrategy; -import org.apache.tuscany.model.assembly.Aggregate; -import org.apache.tuscany.model.assembly.Extensible; -import org.apache.tuscany.model.scdl.loader.SCDLModelLoader; - -/** - * Implementation of a RuntimeContext that forms the foundation for a Tuscany environment. - * - * @version $Rev$ $Date$ - */ -public class RuntimeContextImpl extends AbstractContext implements RuntimeContext { - - private final List builders; - - private final List loaders; - - // the top-level wire builder in the runtime - private final HierarchicalWireBuilder wireBuilder; - - private final List listeners = new ArrayList(1); - - private final AggregateContext rootContext; - - private final SystemAggregateContext systemContext; - - private final MonitorFactory monitorFactory; - - /** - * Default constructor that creates a runtime with a NullMonitorFactory and no builders. - */ - public RuntimeContextImpl() { - this(new NullMonitorFactory(), null, null, null); - } - - /** - * Constructor for creating a runtime with a specified MonitorFactory and pre-defined builders. - * - * @param monitorFactory the default {@link MonitorFactory} for this runtime - * @param builders a list of builders automatically made available; may be null - * @param wireBuilder the top-level hierarchical wire builder for the runtime; if not specified, a default - * implementation will be used - */ - public RuntimeContextImpl(MonitorFactory monitorFactory, List loaders, - List builders, HierarchicalWireBuilder wireBuilder) { - super(RUNTIME); - this.monitorFactory = monitorFactory; - this.builders = (builders == null) ? new ArrayList(1) : builders; - this.loaders = (loaders == null) ? new ArrayList(1) : loaders; - this.wireBuilder = (wireBuilder == null) ? new DefaultWireBuilder() : wireBuilder; - - rootContext = new AggregateContextImpl(ROOT, this, this, new RuntimeScopeStrategy(), new EventContextImpl(), this, monitorFactory); - systemContext = new SystemAggregateContextImpl(SYSTEM, this, this, new SystemScopeStrategy(), new EventContextImpl(), this, monitorFactory); - } - - /** - * Specialized constructor that allows the default implementations of the root and system contexts to be - * overridden. - * - * @param monitorFactory the default {@link MonitorFactory} for this runtime - * @param rootContext the context to use for the root of the user context tree - * @param systemContext the context to use for the root of the system context tree - * @param builders a list of builders automatically made available; may be null - * @param wireBuilder the top-level hierarchical wire builder for the runtime; if not specified, a default - * implementation will be used - */ - public RuntimeContextImpl(MonitorFactory monitorFactory, AggregateContext rootContext, SystemAggregateContext systemContext, - List loaders, List builders, HierarchicalWireBuilder wireBuilder) { - super(RUNTIME); - this.rootContext = rootContext; - this.systemContext = systemContext; - this.monitorFactory = monitorFactory; - this.loaders = (loaders == null) ? new ArrayList(1) : loaders; - this.builders = (builders == null) ? new ArrayList(1) : builders; - this.wireBuilder = (wireBuilder == null) ? new DefaultWireBuilder() : wireBuilder; - } - - public void start() throws CoreRuntimeException { - if (lifecycleState == RUNNING) { - return; - } - systemContext.start(); - rootContext.start(); - lifecycleState = RUNNING; - } - - public void stop() throws CoreRuntimeException { - if (lifecycleState == STOPPED) { - return; - } - rootContext.stop(); - systemContext.stop(); - lifecycleState = STOPPED; - } - - public void addBuilder(RuntimeConfigurationBuilder builder) { - assert (builder != null) : "Builder was null"; - builders.add(builder); - } - - public void addBuilder(WireBuilder builder) { - assert (builder != null) : "Builder was null"; - wireBuilder.addWireBuilder(builder); - } - - public void addLoader(SCDLModelLoader loader) { - assert (loader != null) : "Loader was null"; - loaders.add(loader); - } - - public AggregateContext getContext(String ctxName) { - checkRunning(); - if (ROOT.equals(ctxName)) { - return rootContext; - } else if (SYSTEM.equals(ctxName)) { - return systemContext; - } - return (AggregateContext) rootContext.getContext(ctxName); - } - - public AggregateContext getRootContext() { - checkRunning(); - return rootContext; - } - - public SystemAggregateContext getSystemContext() { - checkRunning(); - return systemContext; - } - - public MonitorFactory getMonitorFactory() { - return monitorFactory; - } - - public void registerModelObject(Extensible model) throws ConfigurationException { - assert (model != null) : "Model was null"; - // note do not configure or build model object since the root context will perform a call back - rootContext.registerModelObject(model); - } - - public void registerModelObjects(List models) throws ConfigurationException { - for (Extensible model : models) { - registerModelObject(model); - } - } - - public void registerListener(RuntimeEventListener listener) { - assert (listener != null) : "Listener cannot be null"; - listeners.add(listener); - } - - public void fireEvent(int eventType, Object message) throws EventException { - checkRunning(); - for (RuntimeEventListener listener : listeners) { - listener.onEvent(eventType, message); - } - } - - public AggregateContext getParent() { - return null; // there is no parent - } - - public Object locateService(String serviceName) { - return null; - } - - public Object locateInstance(String serviceName) { - return null; - } - - public Object getInstance(QualifiedName qName) throws TargetException { - return getSystemContext().getInstance(qName); - } - - public Object getInstance(QualifiedName qName, boolean notify) throws TargetException { - return getInstance(qName); - } - - // ---------------------------------- - // ConfigurationContext methods - // ---------------------------------- - - public synchronized void build(AggregateContext parent, Extensible model) throws BuilderConfigException { - AssemblyVisitor visitor = new AssemblyVisitor(parent, builders); - visitor.start(model); - } - - public void configure(Extensible model) throws ConfigurationException { - } - - public void wire(ProxyFactory sourceFactory, ProxyFactory targetFactory, Class targetType, boolean downScope, - ScopeContext targetScopeContext) throws BuilderConfigException { - wireBuilder.connect(sourceFactory, targetFactory, targetType, downScope, targetScopeContext); - } - - public void wire(ProxyFactory targetFactory, Class targetType, ScopeContext targetScopeContext) throws BuilderConfigException { - wireBuilder.completeTargetChain(targetFactory, targetType, targetScopeContext); - } - - // ---------------------------------- - // AutowireContext methods - // ---------------------------------- - - public T resolveInstance(Class instanceInterface) throws AutowireResolutionException { - if (MonitorFactory.class.equals(instanceInterface)) { - return instanceInterface.cast(monitorFactory); - } else if (ConfigurationContext.class.equals(instanceInterface)) { - return instanceInterface.cast(this); - } else if (AutowireContext.class.equals(instanceInterface)) { - return instanceInterface.cast(this); - } else if (RuntimeContext.class.equals(instanceInterface)) { - return instanceInterface.cast(this); - } else { - // autowire to system components - return instanceInterface.cast(getSystemContext().resolveInstance(instanceInterface)); - } - } - - // ---------------------------------- - // InstanceContext methods - // ---------------------------------- - - public Object getImplementationInstance() throws TargetException { - return this; - } - - public Object getImplementationInstance(boolean notify) throws TargetException { - return this; - } - - public Aggregate getAggregate() { - return systemContext.getAggregate(); - } - - // ---------------------------------- - // Private methods - // ---------------------------------- - - private void checkRunning() { - if (lifecycleState != RUNNING) { - throw new IllegalStateException("Context must be in RUNNING state"); - } - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeMonitor.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeMonitor.java deleted file mode 100644 index c1b87d6a13..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeMonitor.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.runtime; - -import org.apache.tuscany.common.TuscanyException; -import org.apache.tuscany.common.TuscanyRuntimeException; - - -/** - * Serves as a top-level error logging monitor - * - * @version $Rev$ $Date$ - */ -public interface RuntimeMonitor { - - public void log(TuscanyRuntimeException e); - - public void log(TuscanyException e); - -} - diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeScopeStrategy.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeScopeStrategy.java deleted file mode 100644 index 77ddd78d15..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeScopeStrategy.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.runtime; - -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.context.scope.AbstractScopeStrategy; -import org.apache.tuscany.core.context.scope.AggregateScopeContext; -import org.apache.tuscany.model.assembly.Scope; - -/** - * Implements a {@link org.apache.tuscany.core.context.ScopeStrategy} for a runtime context. Specifically, a runtime - * context has only one scope, {@link org.apache.tuscany.model.assembly.Scope#AGGREGATE} - * - * @version $Rev$ $Date$ - */ -public class RuntimeScopeStrategy extends AbstractScopeStrategy { - - public RuntimeScopeStrategy() { - } - - public Map createScopes(EventContext eventContext) { - ScopeContext aggregrateScope = new AggregateScopeContext(eventContext); - Map scopes = new HashMap(); - scopes.put(Scope.AGGREGATE, aggregrateScope); - return scopes; - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/annotation/Autowire.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/annotation/Autowire.java deleted file mode 100644 index bcb06812e8..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/annotation/Autowire.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.apache.tuscany.core.system.annotation; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * A system annotation to inject an autowired instance - * - * @version $Rev$ $Date$ - */ -@Target( { METHOD, FIELD }) -@Retention(RUNTIME) -public @interface Autowire { - - public boolean required() default true; - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/annotation/ParentContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/annotation/ParentContext.java deleted file mode 100644 index f3d2c0216b..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/annotation/ParentContext.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.annotation; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * A system annotation to inject the parent context - * - * @version $Rev$ $Date$ - */ - -@Target( { METHOD, FIELD }) -@Retention(RUNTIME) -public @interface ParentContext { - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/SystemAssemblyFactory.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/SystemAssemblyFactory.java deleted file mode 100644 index d230df8dd7..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/SystemAssemblyFactory.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.assembly; - -import org.apache.tuscany.model.assembly.AssemblyFactory; - -/** - * A factory for building system assembly model artifacts - * - * @version $Rev$ $Date$ - */ -public interface SystemAssemblyFactory extends AssemblyFactory { - - /** - * Returns an assembly model artifact representing a system component implementation - */ - SystemImplementation createSystemImplementation(); - - /** - * Returns an assembly model artifact representing a system binding - */ - SystemBinding createSystemBinding(); - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/SystemBinding.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/SystemBinding.java deleted file mode 100644 index edc7c87c85..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/SystemBinding.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.assembly; - -import org.apache.tuscany.model.assembly.Binding; - -/** - * Represents a system binding - * - * @version $Rev$ $Date$ - */ -public interface SystemBinding extends Binding { - - /** - * Returns the qualified name of the wire target the binding is associated with in component/service form - */ - public String getTargetName(); - - /** - * Sets the qualified name of the wire target the binding is associated with in component/service form - */ - public void setTargetName(String name); -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/SystemImplementation.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/SystemImplementation.java deleted file mode 100644 index 7fae0ebad3..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/SystemImplementation.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.assembly; - -import org.apache.tuscany.model.assembly.ComponentImplementation; - -/** - * Represents a system component implementation - * - * @version $Rev$ $Date$ - */ -public interface SystemImplementation extends ComponentImplementation { - - /** - * Returns the implementation class of the system component - */ - Class getImplementationClass(); - - /** - * Sets the implementation class of the system component - */ - void setImplementationClass(Class value); - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/impl/SystemAssemblyFactoryImpl.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/impl/SystemAssemblyFactoryImpl.java deleted file mode 100644 index 668b7dd8b1..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/impl/SystemAssemblyFactoryImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.assembly.impl; - -import org.apache.tuscany.core.system.assembly.SystemAssemblyFactory; -import org.apache.tuscany.core.system.assembly.SystemBinding; -import org.apache.tuscany.core.system.assembly.SystemImplementation; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; - -/** - * The default implementation of the system assembly factory - * - * @version $Rev$ $Date$ - */ -public class SystemAssemblyFactoryImpl extends AssemblyFactoryImpl implements SystemAssemblyFactory { - - public SystemAssemblyFactoryImpl() { - } - - public SystemImplementation createSystemImplementation() { - return new SystemImplementationImpl(); - } - - public SystemBinding createSystemBinding() { - return new SystemBindingImpl(); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/impl/SystemBindingImpl.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/impl/SystemBindingImpl.java deleted file mode 100644 index a9996065e2..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/impl/SystemBindingImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.assembly.impl; - -import org.apache.tuscany.core.system.assembly.SystemBinding; -import org.apache.tuscany.model.assembly.impl.BindingImpl; - -/** - * The default implementation of the system binding assembly artifact - * - * @version $Rev$ $Date$ - */ -public class SystemBindingImpl extends BindingImpl implements SystemBinding { - - protected SystemBindingImpl() { - } - - private String name; - - public String getTargetName() { - return name; - } - - public void setTargetName(String name) { - this.name = name; - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/impl/SystemImplementationImpl.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/impl/SystemImplementationImpl.java deleted file mode 100644 index 5d54132464..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/impl/SystemImplementationImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.assembly.impl; - -import java.net.URL; - -import org.apache.tuscany.core.config.ComponentTypeIntrospector; -import org.apache.tuscany.core.config.ConfigurationException; -import org.apache.tuscany.core.config.JavaIntrospectionHelper; -import org.apache.tuscany.core.config.impl.Java5ComponentTypeIntrospector; -import org.apache.tuscany.core.system.assembly.SystemImplementation; -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.ComponentType; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.Service; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.impl.ComponentImplementationImpl; - -/** - * The default implementation of the system implementation assembly artifact - * - * @version $Rev$ $Date$ - */ -public class SystemImplementationImpl extends ComponentImplementationImpl implements SystemImplementation { - - private Class implementationClass; - - private AssemblyModelContext modelContext; - - protected SystemImplementationImpl() { - } - - public Class getImplementationClass() { - return implementationClass; - } - - public void setImplementationClass(Class value) { - checkNotFrozen(); - implementationClass = value; - } - - public void initialize(AssemblyModelContext context) { - if (isInitialized()) - return; - this.modelContext = context; - // Initialize the component type - ComponentType componentType = getComponentType(); - if (componentType == null) { - componentType = createComponentType(implementationClass); - setComponentType(componentType); - } - super.initialize(modelContext); - } - - /** - * Creates the component type - */ - private ComponentType createComponentType(Class implClass) { - ComponentType componentType; - String baseName = JavaIntrospectionHelper.getBaseName(implClass); - URL componentTypeFile = implClass.getResource(baseName + ".componentType"); - if (componentTypeFile != null) { - componentType = modelContext.getAssemblyLoader().loadComponentType(componentTypeFile.toString()); - // FIXME workaround for TUSCANY-46 where the scope is not read - default system implementations to MODULE scope - for (Service service : componentType.getServices()) { - service.getServiceContract().setScope(Scope.MODULE); - } - } else { - AssemblyFactory factory = new AssemblyFactoryImpl(); - ComponentTypeIntrospector introspector = new Java5ComponentTypeIntrospector(factory); - try { - componentType = introspector.introspect(implClass); - } catch (ConfigurationException e) { - throw new IllegalArgumentException("Unable to introspect implementation class: " + implClass.getName(), e); - } - } - return componentType; - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/builder/SystemComponentContextBuilder.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/builder/SystemComponentContextBuilder.java deleted file mode 100644 index ac65a3de49..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/builder/SystemComponentContextBuilder.java +++ /dev/null @@ -1,383 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.builder; - -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import org.apache.tuscany.common.monitor.MonitorFactory; -import org.apache.tuscany.core.builder.BuilderConfigException; -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.NoAccessorException; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.builder.UnknownTypeException; -import org.apache.tuscany.core.config.JavaIntrospectionHelper; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.AutowireContext; -import org.apache.tuscany.core.context.ConfigurationContext; -import org.apache.tuscany.core.context.SystemAggregateContext; -import org.apache.tuscany.core.context.impl.AggregateContextImpl; -import org.apache.tuscany.core.injection.EventInvoker; -import org.apache.tuscany.core.injection.FieldInjector; -import org.apache.tuscany.core.injection.Injector; -import org.apache.tuscany.core.injection.MethodEventInvoker; -import org.apache.tuscany.core.injection.MethodInjector; -import org.apache.tuscany.core.injection.ObjectCreationException; -import org.apache.tuscany.core.injection.ReferenceTargetFactory; -import org.apache.tuscany.core.injection.SDOObjectFactory; -import org.apache.tuscany.core.injection.SingletonObjectFactory; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.apache.tuscany.core.system.annotation.ParentContext; -import org.apache.tuscany.core.system.assembly.SystemImplementation; -import org.apache.tuscany.core.system.config.SystemComponentRuntimeConfiguration; -import org.apache.tuscany.core.system.context.SystemAggregateContextImpl; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.ComponentImplementation; -import org.apache.tuscany.model.assembly.ConfiguredProperty; -import org.apache.tuscany.model.assembly.ConfiguredReference; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.Scope; -import org.osoa.sca.annotations.ComponentName; -import org.osoa.sca.annotations.Context; -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Init; - -import commonj.sdo.DataObject; - -/** - * Decorates components whose implementation type is a - * {@link org.apache.tuscany.core.system.assembly.SystemImplementation} with the appropriate runtime configuration. - * System components are not proxied. - * - * @version $Rev$ $Date$ - */ -public class SystemComponentContextBuilder implements RuntimeConfigurationBuilder { - // ---------------------------------- - // Constructors - // ---------------------------------- - - public SystemComponentContextBuilder() { - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public void build(AssemblyModelObject modelObject, AggregateContext parentContext) throws BuilderException { - if (!(modelObject instanceof Component)) { - return; - } - Component component = (Component) modelObject; - - Class implClass = null; - Scope scope = null; - - // Get the component implementation - ComponentImplementation componentImplementation = component.getComponentImplementation(); - if (componentImplementation instanceof SystemImplementation - && componentImplementation.getRuntimeConfiguration() == null) { - - // The component is a system component, implemented by a Java class - SystemImplementation javaImpl = (SystemImplementation) componentImplementation; - scope = componentImplementation.getComponentType().getServices().get(0).getServiceContract().getScope(); - implClass = javaImpl.getImplementationClass(); - - } else if (componentImplementation instanceof Module) { - if (((Module)componentImplementation).getName().startsWith("org.apache.tuscany.core.system")) { - - // The component is a system module component, fix the implementation class to our implementation - // of system module component context - implClass=SystemAggregateContextImpl.class; - scope = Scope.AGGREGATE; - - } else { - - // The component is an app module component, fix the implementation class to our implementation - // of app module component context - implClass=AggregateContextImpl.class; - scope = Scope.AGGREGATE; - - } - - } else { - return; - } - - // FIXME scope - Set fields; - Set methods; - try { - fields = JavaIntrospectionHelper.getAllFields(implClass); - methods = JavaIntrospectionHelper.getAllUniqueMethods(implClass); - String name = component.getName(); - Constructor ctr = implClass.getConstructor((Class[]) null); - - List injectors = new ArrayList(); - - // handle properties - List configuredProperties = component.getConfiguredProperties(); - if (configuredProperties != null) { - for (ConfiguredProperty property : configuredProperties) { - Injector injector = createPropertyInjector(property, fields, methods); - injectors.add(injector); - } - } - - //FIXME do not inject references on an application module yet - if (implClass!=AggregateContextImpl.class) { - // handle references - List configuredReferences = component.getConfiguredReferences(); - if (configuredReferences != null) { - for (ConfiguredReference reference : configuredReferences) { - Injector injector = createReferenceInjector(parentContext.getName(), component.getName(), parentContext, - reference, fields, methods); - injectors.add(injector); - } - } - } - - // create factory for the component implementation type - EventInvoker initInvoker = null; - boolean eagerInit = false; - EventInvoker destroyInvoker = null; - for (Field field : fields) { - ComponentName compName = field.getAnnotation(ComponentName.class); - if (compName != null) { - Injector injector = new FieldInjector(field, new SingletonObjectFactory(name)); - injectors.add(injector); - } - Context context = field.getAnnotation(Context.class); - if (context != null) { - Injector injector = new FieldInjector(field, new SingletonObjectFactory(parentContext)); - injectors.add(injector); - } - ParentContext parentField = field.getAnnotation(ParentContext.class); - if (parentField != null) { - if (!(parentContext instanceof AggregateContext)) { - BuilderConfigException e = new BuilderConfigException("Component must be a child of"); - e.setIdentifier(AggregateContext.class.getName()); - throw e; - } - Injector injector = new FieldInjector(field, new SingletonObjectFactory((parentContext))); - injectors.add(injector); - } - Autowire autowire = field.getAnnotation(Autowire.class); - if (autowire != null) { - if (!(parentContext instanceof AutowireContext)) { - BuilderConfigException e = new BuilderConfigException("Parent context must implement"); - e.setIdentifier(AutowireContext.class.getName()); - throw e; - } - AutowireContext ctx = (AutowireContext) parentContext; - // for system aggregate context types, only allow autowire of certain types, otherwise we have a - // chicken-and-egg problem - if (SystemAggregateContext.class.isAssignableFrom(implClass) - && !(field.getType().equals(ConfigurationContext.class) - || field.getType().equals(MonitorFactory.class) - || field.getType().equals(RuntimeContext.class) || field.getType().equals( - AutowireContext.class))) { - BuilderConfigException e = new BuilderConfigException("Illegal autowire type for system context"); - e.setIdentifier(field.getType().getName()); - throw e; - } - - Object o = ctx.resolveInstance(field.getType()); - if (autowire.required() && o == null) { - BuilderConfigException e = new BuilderConfigException("No autowire found for field"); - e.setIdentifier(field.getName()); - throw e; - } - Injector injector = new FieldInjector(field, new SingletonObjectFactory(o)); - injectors.add(injector); - } - } - for (Method method : methods) { - Init init = method.getAnnotation(Init.class); - if (init != null && initInvoker == null) { - initInvoker = new MethodEventInvoker(method); - eagerInit = init.eager(); - continue; - } - Destroy destroy = method.getAnnotation(Destroy.class); - if (destroy != null && destroyInvoker == null) { - destroyInvoker = new MethodEventInvoker(method); - continue; - } - ComponentName compName = method.getAnnotation(ComponentName.class); - if (compName != null) { - Injector injector = new MethodInjector(method, new SingletonObjectFactory(name)); - injectors.add(injector); - } - Context context = method.getAnnotation(Context.class); - if (context != null) { - Injector injector = new MethodInjector(method, new SingletonObjectFactory(parentContext)); - injectors.add(injector); - } - ParentContext parentMethod = method.getAnnotation(ParentContext.class); - if (parentMethod != null) { - if (!(parentContext instanceof AggregateContext)) { - BuilderConfigException e = new BuilderConfigException("Component must be a child of "); - e.setIdentifier(AggregateContext.class.getName()); - throw e; - } - Injector injector = new MethodInjector(method, new SingletonObjectFactory((parentContext))); - injectors.add(injector); - } - Autowire autowire = method.getAnnotation(Autowire.class); - if (autowire != null) { - if (!(parentContext instanceof AutowireContext)) { - BuilderConfigException e = new BuilderConfigException("Parent context must implement)"); - e.setIdentifier(AutowireContext.class.getName()); - throw e; - } - if (method.getParameterTypes() == null || method.getParameterTypes().length != 1) { - BuilderConfigException e = new BuilderConfigException( - "Autowire setter methods must take one parameter"); - e.setIdentifier(method.getName()); - throw e; - } - AutowireContext ctx = (AutowireContext) parentContext; - Class paramType = method.getParameterTypes()[0]; - // for system aggregate context types, only allow autowire of certain types, otherwise we have a - // chicken-and-egg problem - if (SystemAggregateContext.class.isAssignableFrom(implClass) - && !(paramType.equals(ConfigurationContext.class) || paramType.equals(MonitorFactory.class) - || paramType.equals(RuntimeContext.class) || paramType.equals(AutowireContext.class))) { - BuilderConfigException e = new BuilderConfigException("Illegal autowire type for system context"); - e.setIdentifier(paramType.getName()); - throw e; - } - Object o = ctx.resolveInstance(paramType); - if (autowire.required() && o == null) { - BuilderConfigException e = new BuilderConfigException("No autowire found for method "); - e.setIdentifier(method.getName()); - throw e; - } - - Injector injector = new MethodInjector(method, new SingletonObjectFactory(o)); - injectors.add(injector); - } - } - // decorate the logical model - SystemComponentRuntimeConfiguration config = new SystemComponentRuntimeConfiguration(name, - JavaIntrospectionHelper.getDefaultConstructor(implClass), injectors, eagerInit, initInvoker, - destroyInvoker, scope); - componentImplementation.setRuntimeConfiguration(config); - } catch (BuilderConfigException e) { - e.addContextName(component.getName()); - e.addContextName(parentContext.getName()); - throw e; - } catch (NoSuchMethodException e) { - BuilderConfigException ce = new BuilderConfigException("Class does not have a no-arg constructor", e); - ce.setIdentifier(implClass.getName()); - throw ce; - } - } - - // ---------------------------------- - // Private methods - // ---------------------------------- - - /** - * Creates an Injector for component properties - */ - private Injector createPropertyInjector(ConfiguredProperty property, Set fields, Set methods) - throws NoAccessorException { - Object value = property.getValue(); - String propName = property.getProperty().getName(); - // @FIXME is this how to get property type of object - Class type = value.getClass(); - - // There is no efficient way to do this - Method method = null; - Field field = JavaIntrospectionHelper.findClosestMatchingField(propName, type, fields); - if (field == null) { - method = JavaIntrospectionHelper.findClosestMatchingMethod(propName, new Class[] { type }, methods); - if (method == null) { - throw new NoAccessorException(propName); - } - } - Injector injector = null; - // FIXME support types other than String - if (value instanceof DataObject) { - if (field != null) { - injector = new FieldInjector(field, new SDOObjectFactory((DataObject) value)); - } else { - injector = new MethodInjector(method, new SDOObjectFactory((DataObject) value)); - } - } else if (JavaIntrospectionHelper.isImmutable(type)) { - if (field != null) { - injector = new FieldInjector(field, new SingletonObjectFactory(value)); - } else { - injector = new MethodInjector(method, new SingletonObjectFactory(value)); - } - } else { - if (field != null) { - throw new UnknownTypeException(field.getName()); - } else { - throw new UnknownTypeException(method.getName()); - } - } - return injector; - - } - - /** - * Creates an Injector for service references - */ - private Injector createReferenceInjector(String moduleName, String componentName, AggregateContext parentContext, - ConfiguredReference reference, Set fields, Set methods) throws NoAccessorException, - BuilderConfigException { - String refName = reference.getReference().getName(); - List services = reference.getTargetConfiguredServices(); - Class type; - if (services.size() == 1) { - // get the interface - type = reference.getReference().getServiceContract().getInterface(); - } else { - // FIXME do we support arrays? - type = List.class; - } - Method method = null; - Field field = JavaIntrospectionHelper.findClosestMatchingField(refName, type, fields); - if (field == null) { - method = JavaIntrospectionHelper.findClosestMatchingMethod(refName, new Class[] { type }, methods); - if (method == null) { - throw new NoAccessorException(refName); - } - } - Injector injector; - try { - if (field != null) { - injector = new FieldInjector(field, new ReferenceTargetFactory(reference, parentContext)); - } else { - injector = new MethodInjector(method, new ReferenceTargetFactory(reference, parentContext)); - } - } catch (ObjectCreationException e) { - BuilderConfigException ce = new BuilderConfigException("Error configuring reference", e); - ce.setIdentifier(refName); - throw ce; - } - return injector; - - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/builder/SystemEntryPointBuilder.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/builder/SystemEntryPointBuilder.java deleted file mode 100644 index 6520fc0557..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/builder/SystemEntryPointBuilder.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.builder; - -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.injection.FactoryInitException; -import org.apache.tuscany.core.injection.ReferenceTargetFactory; -import org.apache.tuscany.core.system.assembly.SystemBinding; -import org.apache.tuscany.core.system.config.SystemEntryPointRuntimeConfiguration; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.assembly.EntryPoint; - -/** - * Decorates the logical model with entry point context configuration builders - * - * @version $Rev$ $Date$ - */ -public class SystemEntryPointBuilder implements RuntimeConfigurationBuilder { - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public SystemEntryPointBuilder() { - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public void build(AssemblyModelObject modelObject, AggregateContext context) throws BuilderException { - if (!(modelObject instanceof EntryPoint)) { - return; - } - EntryPoint entryPoint = (EntryPoint) modelObject; - if (!(entryPoint.getBindings().get(0) instanceof SystemBinding) - || entryPoint.getConfiguredReference().getRuntimeConfiguration() != null) { - return; - } - try { - SystemEntryPointRuntimeConfiguration config = new SystemEntryPointRuntimeConfiguration(entryPoint.getName(), - new ReferenceTargetFactory(entryPoint.getConfiguredReference(), context)); - entryPoint.getConfiguredReference().setRuntimeConfiguration(config); - } catch (FactoryInitException e) { - e.addContextName(entryPoint.getName()); - e.addContextName(context.getName()); - throw e; - } - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/builder/SystemExternalServiceBuilder.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/builder/SystemExternalServiceBuilder.java deleted file mode 100644 index dc00e6505f..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/builder/SystemExternalServiceBuilder.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.builder; - -import org.apache.tuscany.core.builder.BuilderConfigException; -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.AutowireContext; -import org.apache.tuscany.core.injection.ReferenceTargetFactory; -import org.apache.tuscany.core.system.assembly.SystemBinding; -import org.apache.tuscany.core.system.config.SystemExternalServiceRuntimeConfiguration; -import org.apache.tuscany.core.system.injection.AutowireFactory; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.assembly.ExternalService; - -/** - * Creates runtime configurations for system type external services - * - * @version $Rev$ $Date$ - */ -public class SystemExternalServiceBuilder implements RuntimeConfigurationBuilder { - // ---------------------------------- - // Constructors - // ---------------------------------- - - public SystemExternalServiceBuilder() { - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public void build(AssemblyModelObject modelObject, AggregateContext context) throws BuilderException { - if (!(modelObject instanceof ExternalService)) { - return; - } - ExternalService externalService = (ExternalService) modelObject; - if (externalService.getConfiguredService() != null - && externalService.getConfiguredService().getRuntimeConfiguration() != null) { - return; - } else if (externalService.getBindings() == null || externalService.getBindings().size() < 1 - || !(externalService.getBindings().get(0) instanceof SystemBinding)) { - return; - } - SystemBinding binding = (SystemBinding)externalService.getBindings().get(0); - if (binding.getTargetName() != null) { - SystemExternalServiceRuntimeConfiguration config = new SystemExternalServiceRuntimeConfiguration(externalService - .getName(), new ReferenceTargetFactory(binding.getTargetName(), context)); - externalService.getConfiguredService().setRuntimeConfiguration(config); - } else if (externalService.getConfiguredService().getService().getServiceContract().getInterface() != null) { - // autowire - Class claz = externalService.getConfiguredService().getService().getServiceContract().getInterface(); - if (claz == null) { - BuilderException e = new BuilderConfigException("Interface type not specified"); - e.setIdentifier(externalService.getName()); - e.addContextName(externalService.getName()); - e.addContextName(context.getName()); - throw e; - } - SystemExternalServiceRuntimeConfiguration config = new SystemExternalServiceRuntimeConfiguration(externalService - .getName(), new AutowireFactory(claz, (AutowireContext) context)); - externalService.getConfiguredService().setRuntimeConfiguration(config); - } - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemComponentRuntimeConfiguration.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemComponentRuntimeConfiguration.java deleted file mode 100644 index cf05059b90..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemComponentRuntimeConfiguration.java +++ /dev/null @@ -1,140 +0,0 @@ -package org.apache.tuscany.core.system.config; - -import java.lang.reflect.Constructor; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.core.builder.ContextCreationException; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.injection.EventInvoker; -import org.apache.tuscany.core.injection.Injector; -import org.apache.tuscany.core.injection.PojoObjectFactory; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.system.context.SystemComponentContext; -import org.apache.tuscany.model.assembly.Scope; - -/** - * A RuntimeConfiguration that handles system component implementation types - * - * @version $Rev$ $Date$ - */ -public class SystemComponentRuntimeConfiguration implements RuntimeConfiguration { - - // the component name as configured in the hosting module - private String name; - - // the implementation type constructor - private Constructor ctr; - - // injectors for properties, references and other metadata values such as @Context - private List setters; - - // an invoker for a method decorated with @Init - private EventInvoker init; - - // whether the component should be eagerly initialized when its scope starts - private boolean eagerInit; - - // an invoker for a method decorated with @Destroy - private EventInvoker destroy; - - // the scope of the implementation instance - private Scope scope; - - // if the component implementation scope is stateless - private boolean stateless; - - // if the component implementation is an aggregate context - private boolean isAggregate; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - /** - * Creates the runtime configuration - * - * @param name the SCDL name of the component the context refers to - * @param ctr the implementation type constructor - * @param setters a collection of Injectors used to configure properties, references and other meta - * data values on implementation instances - * @param eagerInit whether the component should be eagerly initialized - * @param init an Invoker pointing to a method on the implementation type decorated with - * @Init - * @param destroy an Invoker pointing to a method on the implementation type decorated with - * @Destroy - * @param scope the scope of the component implementation type - */ - public SystemComponentRuntimeConfiguration(String name, Constructor ctr, List setters, boolean eagerInit, - EventInvoker init, EventInvoker destroy, Scope scope) { - assert (name != null) : "Name was null"; - assert (ctr != null) : "Constructor was null"; - assert (setters != null) : "Setters were null"; - this.name = name; - this.ctr = ctr; - this.isAggregate = AggregateContext.class.isAssignableFrom(ctr.getDeclaringClass()); - this.setters = setters; - this.eagerInit = eagerInit; - this.init = init; - this.destroy = destroy; - this.scope = scope; - stateless = (scope == Scope.INSTANCE); - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public String getName() { - return name; - } - - public Scope getScope() { - return scope; - } - - public InstanceContext createInstanceContext() throws ContextCreationException { - if (isAggregate) { - // aggregate context types are themselves an instance context - PojoObjectFactory objectFactory = new PojoObjectFactory(ctr, null, setters); - AggregateContext ctx = (AggregateContext) objectFactory.getInstance(); - ctx.setName(name); - return ctx; - } else { - PojoObjectFactory objectFactory = new PojoObjectFactory(ctr, null, setters); - return new SystemComponentContext(name, objectFactory, eagerInit, init, destroy, stateless); - } - } - - // -- Proxy - - public void prepare() { - } - - public void addTargetProxyFactory(String serviceName, ProxyFactory factory) { - throw new UnsupportedOperationException(); - } - - public ProxyFactory getTargetProxyFactory(String serviceName) { - return null; - } - - public Map getTargetProxyFactories() { - return null; - } - - public void addSourceProxyFactory(String referenceName, ProxyFactory factory) { - throw new UnsupportedOperationException(); - } - - public ProxyFactory getSourceProxyFactory(String referenceName) { - return null; - } - - public Map getSourceProxyFactories() { - return null; - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemEntryPointRuntimeConfiguration.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemEntryPointRuntimeConfiguration.java deleted file mode 100644 index f6c25e9b86..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemEntryPointRuntimeConfiguration.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.config; - -import java.util.Map; - -import org.apache.tuscany.core.builder.ContextCreationException; -import org.apache.tuscany.core.builder.ObjectFactory; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.EntryPointContext; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.system.context.SystemEntryPointContext; -import org.apache.tuscany.model.assembly.Scope; - -/** - * Creates {@link SystemEntryPointContext} instances based on an entry point configuration in an assembly model - * - * @version $Rev$ $Date$ - */ -public class SystemEntryPointRuntimeConfiguration implements RuntimeConfiguration { - - // the name of the entry point - private String name; - - // the factory for returning a reference to the implementation instance of the component exposed by the entry point - private ObjectFactory factory; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public SystemEntryPointRuntimeConfiguration(String name, ObjectFactory factory) { - this.name = name; - this.factory = factory; - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public EntryPointContext createInstanceContext() throws ContextCreationException { - return new SystemEntryPointContext(name, factory); - } - - public Scope getScope() { - return Scope.MODULE; - } - - public String getName() { - return name; - } - - // -- Proxy - public void prepare() { - } - - public void addTargetProxyFactory(String serviceName, ProxyFactory pFactory) { - throw new UnsupportedOperationException(); - } - - public ProxyFactory getTargetProxyFactory(String serviceName) { - return null; - } - - public Map getTargetProxyFactories() { - return null; - } - - public void addSourceProxyFactory(String referenceName, ProxyFactory pFactory) { - throw new UnsupportedOperationException(); - } - - public ProxyFactory getSourceProxyFactory(String referenceName) { - return null; - } - - public Map getSourceProxyFactories() { - return null; - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemExternalServiceRuntimeConfiguration.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemExternalServiceRuntimeConfiguration.java deleted file mode 100644 index 789982bdcf..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemExternalServiceRuntimeConfiguration.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.config; - -import java.util.Map; - -import org.apache.tuscany.core.builder.ContextCreationException; -import org.apache.tuscany.core.builder.ObjectFactory; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.ExternalServiceContext; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.system.context.SystemExternalServiceContext; -import org.apache.tuscany.model.assembly.Scope; - -/** - * Creates system type external service contexts - * - * @see org.apache.tuscany.core.context.ExternalServiceContext - * @see org.apache.tuscany.core.system.context.SystemExternalServiceContext - * - * @version $Rev$ $Date$ - */ -public class SystemExternalServiceRuntimeConfiguration implements RuntimeConfiguration { - - // the name of the external service - private String name; - - // the factory for returning a reference to the implementation instance of the component represented by the external service - private ObjectFactory factory; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public SystemExternalServiceRuntimeConfiguration(String name, ObjectFactory factory) { - assert (name != null) : "Name was null"; - assert (factory != null) : "Object factory was null"; - this.name = name; - this.factory = factory; - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public Scope getScope() { - return Scope.MODULE; - } - - public String getName() { - return name; - } - - public ExternalServiceContext createInstanceContext() throws ContextCreationException { - return new SystemExternalServiceContext(name, factory); - } - - // -- Proxy - public void prepare() { - } - - public void addTargetProxyFactory(String serviceName, ProxyFactory pFactory) { - throw new UnsupportedOperationException(); - } - - public ProxyFactory getTargetProxyFactory(String serviceName) { - return null; - } - - public Map getTargetProxyFactories() { - return null; - } - - public void addSourceProxyFactory(String referenceName, ProxyFactory pFactory) { - throw new UnsupportedOperationException(); - } - - public ProxyFactory getSourceProxyFactory(String referenceName) { - return null; - } - - public Map getSourceProxyFactories() { - return null; - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemObjectRuntimeConfiguration.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemObjectRuntimeConfiguration.java deleted file mode 100644 index 06acb12deb..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemObjectRuntimeConfiguration.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * - * Copyright 2005 BEA Systems Inc. - * Copyright 2005 International Business Machines Corporation - * - * 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. - */ -package org.apache.tuscany.core.system.config; - -import java.util.Map; - -import org.apache.tuscany.core.builder.ContextCreationException; -import org.apache.tuscany.core.builder.ObjectFactory; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.core.injection.SingletonObjectFactory; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.system.context.SystemComponentContext; -import org.apache.tuscany.model.assembly.Scope; - -/** - * A RuntimeConfiguration that contains the configuration needed to convert a simple - * Java Object into a component. The object is assumed to be fully initialized and - * will always be added with MODULE scope. - * - * @version $Rev$ $Date$ - */ -public class SystemObjectRuntimeConfiguration implements RuntimeConfiguration { - private final String name; - private final ObjectFactory objectFactory; - - /** - * Construct a RuntimeConfiguration for the supplied Java Object. - * - * @param name the name to be assigned to the resulting component - * @param instance the Java Object that provides the implementation - */ - public SystemObjectRuntimeConfiguration(String name, Object instance) { - this.name = name; - objectFactory = new SingletonObjectFactory(instance); - } - - public Context createInstanceContext() throws ContextCreationException { - return new SystemComponentContext(name, objectFactory, false, null, null, false); - } - - public Scope getScope() { - return Scope.MODULE; - } - - public String getName() { - return name; - } - - public void prepare() { - throw new UnsupportedOperationException(); - } - - public void addTargetProxyFactory(String serviceName, ProxyFactory factory) { - throw new UnsupportedOperationException(); - } - - public ProxyFactory getTargetProxyFactory(String serviceName) { - throw new UnsupportedOperationException(); - } - - public Map getTargetProxyFactories() { - throw new UnsupportedOperationException(); - } - - public void addSourceProxyFactory(String referenceName, ProxyFactory factory) { - throw new UnsupportedOperationException(); - } - - public ProxyFactory getSourceProxyFactory(String referenceName) { - throw new UnsupportedOperationException(); - } - - public Map getSourceProxyFactories() { - throw new UnsupportedOperationException(); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemAggregateContextImpl.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemAggregateContextImpl.java deleted file mode 100644 index a2efc35ac1..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemAggregateContextImpl.java +++ /dev/null @@ -1,666 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.context; - -import static org.apache.tuscany.core.context.EventContext.HTTP_SESSION; -import static org.apache.tuscany.core.context.EventContext.REQUEST_END; -import static org.apache.tuscany.core.context.EventContext.SESSION_NOTIFY; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; - -import org.apache.tuscany.common.monitor.MonitorFactory; -import org.apache.tuscany.core.builder.BuilderConfigException; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.config.ConfigurationException; -import org.apache.tuscany.core.context.AbstractContext; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.AutowireContext; -import org.apache.tuscany.core.context.AutowireResolutionException; -import org.apache.tuscany.core.context.ConfigurationContext; -import org.apache.tuscany.core.context.ContextInitException; -import org.apache.tuscany.core.context.CoreRuntimeException; -import org.apache.tuscany.core.context.DuplicateNameException; -import org.apache.tuscany.core.context.EntryPointContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.EventException; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.LifecycleEventListener; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.RuntimeEventListener; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.context.ScopeRuntimeException; -import org.apache.tuscany.core.context.ScopeStrategy; -import org.apache.tuscany.core.context.SimpleComponentContext; -import org.apache.tuscany.core.context.SystemAggregateContext; -import org.apache.tuscany.core.context.TargetException; -import org.apache.tuscany.core.context.impl.EventContextImpl; -import org.apache.tuscany.core.invocation.jdk.JDKProxyFactoryFactory; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.invocation.spi.ProxyFactoryFactory; -import org.apache.tuscany.core.message.MessageFactory; -import org.apache.tuscany.core.message.impl.MessageFactoryImpl; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.apache.tuscany.core.system.annotation.ParentContext; -import org.apache.tuscany.core.system.assembly.SystemBinding; -import org.apache.tuscany.core.system.config.SystemObjectRuntimeConfiguration; -import org.apache.tuscany.model.assembly.Aggregate; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.Extensible; -import org.apache.tuscany.model.assembly.ExternalService; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.AggregatePart; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; - -/** - * Implements an aggregate context for system components. By default a system context uses the scopes specified by - * {@link org.apache.tuscany.core.system.context.SystemScopeStrategy}. In addition, it implements an autowire policy - * where entry points configured with a {@link org.apache.tuscany.core.system.assembly.SystemBinding} are matched - * according to their exposed interface. A system context may contain child aggregate contexts but an entry point in a - * child context will only be outwardly accessible if there is an entry point that exposes it configured in the - * top-level system context. - * - * @version $Rev$ $Date$ - */ -public class SystemAggregateContextImpl extends AbstractContext implements SystemAggregateContext { - - public static final int DEFAULT_WAIT = 1000 * 60; - - // ---------------------------------- - // Fields - // ---------------------------------- - - // The parent context, if one exists - @ParentContext - protected AggregateContext parentContext; - - // The parent configuration context, if one exists - @Autowire(required = false) - protected ConfigurationContext configurationContext; - - // The system monitor factory - @Autowire(required = false) - protected MonitorFactory monitorFactory; - - // The logical model representing the module assembly - // protected ModuleComponent moduleComponent; - protected Module module; - - protected List> configurations = new ArrayList(); - - protected ScopeStrategy scopeStrategy; - - // The event context for associating context events to threads - protected EventContext eventContext; - - // The scopes for this context - protected Map scopeContexts; - - protected Map immutableScopeContexts; - - // A component context name to scope context index - protected Map scopeIndex; - - // Listeners for context events - protected List listeners = new CopyOnWriteArrayList(); - - // Blocking latch to ensure the module is initialized exactly once prior to servicing requests - protected CountDownLatch initializeLatch = new CountDownLatch(1); - - // Indicates whether the module context has been initialized - protected boolean initialized; - - // a mapping of service type to component name - private Map autowireIndex = new ConcurrentHashMap(); - - @Autowire(required = false) - private AutowireContext autowireContext; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public SystemAggregateContextImpl() { - super(); - scopeIndex = new ConcurrentHashMap(); - // FIXME the assembly factory should be injected here - module = new AssemblyFactoryImpl().createModule(); - eventContext = new EventContextImpl(); - scopeStrategy = new SystemScopeStrategy(); - } - - public SystemAggregateContextImpl(String name, AggregateContext parent, AutowireContext autowire, ScopeStrategy strategy, - EventContext ctx, ConfigurationContext configCtx, MonitorFactory factory) { - super(name); - this.parentContext = parent; - this.autowireContext = autowire; - this.scopeStrategy = strategy; - this.eventContext = ctx; - this.configurationContext = configCtx; - this.monitorFactory = factory; - scopeIndex = new ConcurrentHashMap(); - // FIXME the assembly factory should be injected here - module = new AssemblyFactoryImpl().createModule(); - } - - // ---------------------------------- - // Lifecycle methods - // ---------------------------------- - - public void start() { - synchronized (initializeLatch) { - try { - if (lifecycleState != UNINITIALIZED && lifecycleState != STOPPED) { - throw new IllegalStateException("Context not in UNINITIALIZED state"); - } - - lifecycleState = INITIALIZING; - initializeScopes(); - - Map>> configurationsByScope = new HashMap(); - if (configurations != null) { - for (RuntimeConfiguration config : configurations) { - // FIXME scopes are defined at the interface level - Scope scope = config.getScope(); - // ensure duplicate names were not added before the context was started - if (scopeIndex.get(config.getName()) != null) { - throw new DuplicateNameException(config.getName()); - } - scopeIndex.put(config.getName(), scopeContexts.get(scope)); - List> list = configurationsByScope.get(scope); - if (list == null) { - list = new ArrayList(); - configurationsByScope.put(scope, list); - } - list.add(config); - } - } - for (EntryPoint ep : module.getEntryPoints()) { - registerAutowire(ep); - } - for (Component component : module.getComponents()) { - registerAutowire(component); - } - for (ExternalService es : module.getExternalServices()) { - registerAutowire(es); - } - for (Map.Entry entries : configurationsByScope.entrySet()) { - // register configurations with scope contexts - ScopeContext scope = scopeContexts.get(entries.getKey()); - scope.registerConfigurations((List>) entries.getValue()); - } - for (ScopeContext scope : scopeContexts.values()) { - // register scope contexts as a listeners for events in the aggregate context - registerListener(scope); - scope.start(); - } - lifecycleState = RUNNING; - } catch (ConfigurationException e) { - lifecycleState = ERROR; - throw new ContextInitException(e); - } catch (CoreRuntimeException e) { - lifecycleState = ERROR; - e.addContextName(getName()); - throw e; - } finally { - initialized = true; - // release the latch and allow requests to be processed - initializeLatch.countDown(); - } - } - } - - public void stop() { - if (lifecycleState == STOPPED) { - return; - } - // need to block a start until reset is complete - initializeLatch = new CountDownLatch(2); - lifecycleState = STOPPING; - initialized = false; - if (scopeContexts != null) { - for (ScopeContext scope : scopeContexts.values()) { - try { - if (scope.getLifecycleState() == ScopeContext.RUNNING) { - scope.stop(); - } - } catch (ScopeRuntimeException e) { - // log.error("Error stopping scope container [" + scopeContainers[i].getName() + "]", e); - } - } - } - scopeContexts = null; - scopeIndex.clear(); - // allow initialized to be called - initializeLatch.countDown(); - lifecycleState = STOPPED; - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public void setModule(Module module) { - assert (module != null) : "Module cannot be null"; - name = module.getName(); - this.module = module; - } - - public void addContextListener(LifecycleEventListener listener) { - super.addContextListener(listener); - } - - public void setEventContext(EventContext eventContext) { - this.eventContext = eventContext; - } - - public void setMonitorFactory(MonitorFactory factory) { - this.monitorFactory = factory; - } - - public AggregateContext getParent() { - return parentContext; - } - - public void registerModelObjects(List models) throws ConfigurationException { - assert (models != null) : "Model object collection was null"; - for (Extensible model : models) { - registerModelObject(model); - } - } - - public void registerModelObject(Extensible model) throws ConfigurationException { - assert (model != null) : "Model object was null"; - initializeScopes(); - if (configurationContext != null) { - try { - configurationContext.configure(model); - configurationContext.build(this, model); - } catch (ConfigurationException e) { - e.addContextName(getName()); - throw e; - } catch (BuilderConfigException e) { - e.addContextName(getName()); - throw e; - } - } - RuntimeConfiguration configuration = null; - if (model instanceof Module) { - // merge new module definition with the existing one - Module oldModule = module; - Module newModule = (Module) model; - module = newModule; - for (Component component : newModule.getComponents()) { - configuration = (RuntimeConfiguration) component.getComponentImplementation() - .getRuntimeConfiguration(); - if (configuration == null) { - ConfigurationException e = new ConfigurationException("Runtime configuration not set"); - e.addContextName(component.getName()); - e.addContextName(getName()); - throw e; - } - registerConfiguration(configuration); - registerAutowire(component); - } - for (EntryPoint ep : newModule.getEntryPoints()) { - configuration = (RuntimeConfiguration) ep.getConfiguredReference().getRuntimeConfiguration(); - if (configuration == null) { - ConfigurationException e = new ConfigurationException("Runtime configuration not set"); - e.setIdentifier(ep.getName()); - e.addContextName(getName()); - throw e; - } - registerConfiguration(configuration); - registerAutowire(ep); - } - for (ExternalService service : newModule.getExternalServices()) { - configuration = (RuntimeConfiguration) service.getConfiguredService().getRuntimeConfiguration(); - if (configuration == null) { - ConfigurationException e = new ConfigurationException("Runtime configuration not set"); - e.setIdentifier(service.getName()); - e.addContextName(getName()); - throw e; - } - registerConfiguration(configuration); - registerAutowire(service); - } - // merge existing module component assets - module.getComponents().addAll(oldModule.getComponents()); - module.getEntryPoints().addAll(oldModule.getEntryPoints()); - module.getExternalServices().addAll(oldModule.getExternalServices()); - } else { - if (model instanceof Component) { - Component component = (Component) model; - module.getComponents().add(component); - configuration = (RuntimeConfiguration) component.getComponentImplementation() - .getRuntimeConfiguration(); - } else if (model instanceof EntryPoint) { - EntryPoint ep = (EntryPoint) model; - module.getEntryPoints().add(ep); - configuration = (RuntimeConfiguration) ep.getConfiguredReference().getRuntimeConfiguration(); - } else if (model instanceof ExternalService) { - ExternalService service = (ExternalService) model; - module.getExternalServices().add(service); - configuration = (RuntimeConfiguration) service.getConfiguredService().getRuntimeConfiguration(); - } else { - BuilderConfigException e = new BuilderConfigException("Unknown model type"); - e.setIdentifier(model.getClass().getName()); - e.addContextName(getName()); - throw e; - } - if (configuration == null) { - ConfigurationException e = new ConfigurationException( - "Runtime configuration not set. Ensure a runtime configuration builder is registered for the component implementation type"); - if (model instanceof AggregatePart) { - e.setIdentifier(((AggregatePart) model).getName()); - } - e.addContextName(getName()); - throw e; - } - registerConfiguration(configuration); - registerAutowire(model); - } - } - - public void registerJavaObject(String componentName, Object instance) throws ConfigurationException { - registerConfiguration(new SystemObjectRuntimeConfiguration(componentName, instance)); - } - - protected void registerConfiguration(RuntimeConfiguration configuration) throws ConfigurationException { - if (lifecycleState == RUNNING) { - if (scopeIndex.get(configuration.getName()) != null) { - throw new DuplicateNameException(configuration.getName()); - } - ScopeContext scope = scopeContexts.get(configuration.getScope()); - if (scope == null) { - ConfigurationException e = new ConfigurationException("Component has an unknown scope"); - e.addContextName(configuration.getName()); - e.addContextName(getName()); - throw e; - } - scope.registerConfiguration(configuration); - scopeIndex.put(configuration.getName(), scope); - } else { - configurations.add(configuration); - } - - } - - public void registerListener(RuntimeEventListener listener) { - assert (listener != null) : "Listener cannot be null"; - listeners.add(listener); - } - - public void fireEvent(int eventType, Object message) throws EventException { - checkInit(); - if (eventType == SESSION_NOTIFY) { - // update context - eventContext.setIdentifier(HTTP_SESSION, message); - } else if (eventType == REQUEST_END) { - // be very careful with pooled threads, ensuring threadlocals are cleaned up - eventContext.clearIdentifier(HTTP_SESSION); - } - for (RuntimeEventListener listener : listeners) { - listener.onEvent(eventType, message); - } - } - - public InstanceContext getContext(String componentName) { - checkInit(); - assert (componentName != null) : "Name was null"; - ScopeContext scope = scopeIndex.get(componentName); - if (scope == null) { - return null; - } - return scope.getContext(componentName); - - } - - /** - * @see org.apache.tuscany.core.context.AggregateContext#getAggregate() - */ - public Aggregate getAggregate() { - return module; - } - - public Object getInstance(QualifiedName qName) throws TargetException { - return getInstance(qName, true); - } - - public Object getInstance(QualifiedName qName, boolean notify) throws TargetException { - assert (qName != null) : "Name was null "; - // use the port name to get the context since entry points ports - ScopeContext scope = scopeIndex.get(qName.getPortName()); - if (scope == null) { - return null; - } - InstanceContext ctx = scope.getContext(qName.getPortName()); - if (!(ctx instanceof EntryPointContext)) { - TargetException e = new TargetException("Target not an entry point"); - e.setIdentifier(qName.getQualifiedName()); - e.addContextName(name); - throw e; - } - return ctx.getInstance(null, notify); - } - - public Object locateInstance(String qualifiedName) throws TargetException { - checkInit(); - QualifiedName qName = new QualifiedName(qualifiedName); - ScopeContext scope = scopeIndex.get(qName.getPartName()); - if (scope == null) { - TargetException e = new TargetException("Component not found"); - e.setIdentifier(qualifiedName); - e.addContextName(getName()); - throw e; - } - InstanceContext ctx = scope.getContext(qName.getPartName()); - try { - return ctx.getInstance(qName, true); - } catch (TargetException e) { - e.addContextName(getName()); - throw e; - } - } - - // ---------------------------------- - // InstanceContext methods - // ---------------------------------- - - public Object getImplementationInstance() throws TargetException { - return this; - } - - public Object getImplementationInstance(boolean notify) throws TargetException { - return this; - } - - public Map getScopeContexts() { - initializeScopes(); - return immutableScopeContexts; - } - - // ---------------------------------- - // Protected methods - // ---------------------------------- - - /** - * Blocks until the module context has been initialized - */ - protected void checkInit() { - if (!initialized) { - try { - /* block until the module has initialized */ - boolean success = initializeLatch.await(DEFAULT_WAIT, TimeUnit.MILLISECONDS); - if (!success) { - throw new ContextInitException("Timeout waiting for module context to initialize"); - } - } catch (InterruptedException e) { // should not happen - } - } - - } - - protected void initializeScopes() { - if (scopeContexts == null) { - scopeContexts = scopeStrategy.createScopes(eventContext); - immutableScopeContexts = Collections.unmodifiableMap(scopeContexts); - } - } - - // //////////////////////////// - - // ---------------------------------- - // AutowireContext methods - // ---------------------------------- - - // FIXME These should be removed and configured - private static final MessageFactory messageFactory = new MessageFactoryImpl(); - - private static final ProxyFactoryFactory proxyFactoryFactory = new JDKProxyFactoryFactory(); - - public T resolveInstance(Class instanceInterface) throws AutowireResolutionException { - if (RuntimeContext.class.equals(instanceInterface)) { - return autowireContext.resolveInstance(instanceInterface); - } else if (MonitorFactory.class.equals(instanceInterface)) { - return instanceInterface.cast(monitorFactory); - } else if (ConfigurationContext.class.equals(instanceInterface)) { - return instanceInterface.cast(this); - } else if (AggregateContext.class.equals(instanceInterface)) { - return instanceInterface.cast(this); - } else if (AutowireContext.class.equals(instanceInterface)) { - return instanceInterface.cast(this); - } else if (MessageFactory.class.equals(instanceInterface)) { - return instanceInterface.cast(messageFactory); - } else if (ProxyFactoryFactory.class.equals(instanceInterface)) { - return instanceInterface.cast(proxyFactoryFactory); - } - - NameToScope mapping = autowireIndex.get(instanceInterface); - if (mapping != null) { - try { - return instanceInterface.cast(mapping.getScopeContext().getInstance(mapping.getName())); - } catch (TargetException e) { - AutowireResolutionException ae = new AutowireResolutionException("Autowire instance not found", e); - ae.addContextName(getName()); - throw ae; - } - } - return null; - } - - private void registerAutowire(Extensible model) throws ConfigurationException { - if (lifecycleState == INITIALIZING || lifecycleState == INITIALIZED || lifecycleState == RUNNING) { - // only autowire entry points with system bindings - if (model instanceof EntryPoint) { - EntryPoint ep = (EntryPoint) model; - if (ep.getBindings() != null) { - if (ep.getBindings().get(0) instanceof SystemBinding) { - ScopeContext scope = scopeContexts.get(((RuntimeConfiguration) ep.getConfiguredReference() - .getRuntimeConfiguration()).getScope()); - if (scope == null) { - ConfigurationException ce = new ConfigurationException("Scope not found for entry point"); - ce.setIdentifier(ep.getName()); - ce.addContextName(getName()); - throw ce; - } - NameToScope mapping = new NameToScope(new QualifiedName(ep.getName()), scope); - autowireIndex.put(ep.getConfiguredService().getService().getServiceContract().getInterface(), mapping); - } - } - } - } - } - - // ---------------------------------- - // ConfigurationContext methods - // ---------------------------------- - - public void configure(Extensible model) throws ConfigurationException { - if (configurationContext != null) { - configurationContext.configure(model); - } - } - - public void build(AggregateContext parent, Extensible model) throws BuilderConfigException { - if (configurationContext != null) { - configurationContext.build(parent, model); - } - } - - public void wire(ProxyFactory sourceFactory, ProxyFactory targetFactory, Class targetType, boolean downScope, - ScopeContext targetScopeContext) throws BuilderConfigException { - if (configurationContext != null) { - try { - configurationContext.wire(sourceFactory, targetFactory, targetType, downScope, targetScopeContext); - } catch (BuilderConfigException e) { - e.addContextName(getName()); - throw e; - } - } - } - - public void wire(ProxyFactory targetFactory, Class targetType, ScopeContext targetScopeContext) throws BuilderConfigException { - if (configurationContext != null) { - try { - configurationContext.wire(targetFactory, targetType, targetScopeContext); - } catch (BuilderConfigException e) { - e.addContextName(getName()); - throw e; - } - } - } - - // ---------------------------------- - // Inner classes - // ---------------------------------- - - /** - * Maps a context name to a scope - */ - private class NameToScope { - - private QualifiedName epName; - - private ScopeContext scope; - - public NameToScope(QualifiedName epName, ScopeContext scope) { - this.epName = epName; - this.scope = scope; - } - - public QualifiedName getName() { - return epName; - } - - public ScopeContext getScopeContext() { - return scope; - } - - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemComponentContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemComponentContext.java deleted file mode 100644 index 4418f52e19..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemComponentContext.java +++ /dev/null @@ -1,198 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.context; - -import java.util.Iterator; - -import org.apache.tuscany.core.builder.ObjectFactory; -import org.apache.tuscany.core.context.AbstractContext; -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.core.context.ContextInitException; -import org.apache.tuscany.core.context.LifecycleEventListener; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.SimpleComponentContext; -import org.apache.tuscany.core.context.TargetException; -import org.apache.tuscany.core.injection.EventInvoker; -import org.apache.tuscany.core.injection.Injector; -import org.apache.tuscany.core.injection.ObjectCallbackException; -import org.apache.tuscany.core.injection.ObjectCreationException; - -/** - * Manages system component implementation instances - * - * @version $Rev$ $Date$ - */ -public class SystemComponentContext extends AbstractContext implements SimpleComponentContext { - - private boolean eagerInit; - - private EventInvoker initInvoker; - - private EventInvoker destroyInvoker; - - private Injector componentName; - - private Injector moduleContext; - - private boolean stateless; - - // the cached target instance - private Object cachedTargetInstance; - - // responsible for creating a new implementation instance with injected references and properties - private ObjectFactory objectFactory; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public SystemComponentContext(String name, ObjectFactory objectFactory, boolean eagerInit, EventInvoker initInvoker, - EventInvoker destroyInvoker, boolean stateless) { - super(name); - assert (objectFactory != null) : "Object factory was null"; - if (eagerInit == true && initInvoker == null) { - throw new AssertionError("No intialization method found for eager init implementation"); - } - this.objectFactory = objectFactory; - - this.eagerInit = eagerInit; - this.initInvoker = initInvoker; - this.destroyInvoker = destroyInvoker; - this.stateless = stateless; - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public void setName(String name) { - super.setName(name); - } - - protected int type; - - public int getType() { - return type; - } - - public void setType(int type) { - this.type = type; - } - - public synchronized Object getInstance(QualifiedName qName) throws TargetException { - return getInstance(qName, true); - } - - public synchronized Object getInstance(QualifiedName qName, boolean notify) throws TargetException { - if (cachedTargetInstance != null) { - return cachedTargetInstance; // already cached, just return - } - - if (getLifecycleState() == ERROR || getLifecycleState() == CONFIG_ERROR) { - return null; - } - synchronized (this) { - try { - Object instance = objectFactory.getInstance(); - startInstance(instance); - if (notify) { - for (Iterator iter = contextListener.iterator(); iter.hasNext();) { - LifecycleEventListener listener = (LifecycleEventListener) iter.next(); - listener.onInstanceCreate(this); - } - } - setLifecycleState(RUNNING); - if (stateless) { - return instance; - } else { - // cache the actual instance - cachedTargetInstance = instance; - return cachedTargetInstance; - } - } catch (ObjectCreationException e) { - setLifecycleState(Context.ERROR); - TargetException te = new TargetException("Error creating instance for component", e); - te.setIdentifier(getName()); - throw te; - } - } - - } - - public Object getImplementationInstance() throws TargetException { - return getInstance(null); - } - - public Object getImplementationInstance(boolean notify) throws TargetException { - return getInstance(null, notify); - } - - public boolean isEagerInit() { - return eagerInit; - } - - public boolean isDestroyable() { - return (destroyInvoker != null); - } - - // ---------------------------------- - // Lifecycle methods - // ---------------------------------- - - public void start() throws ContextInitException { - if (getLifecycleState() != UNINITIALIZED && getLifecycleState() != STOPPED) { - throw new IllegalStateException("Component must be in UNINITIALIZED state [" + getLifecycleState() + "]"); - } - if (objectFactory == null) { - setLifecycleState(ERROR); - ContextInitException e = new ContextInitException("Object factory not found "); - e.setIdentifier(getName()); - throw e; - } - setLifecycleState(INITIALIZED); - } - - public void stop() { - if (cachedTargetInstance != null) { - if (destroyInvoker != null) { - try { - destroyInvoker.invokeEvent(cachedTargetInstance); - } catch (ObjectCallbackException e) { - throw new TargetException(e.getCause()); - } - } - } - setLifecycleState(STOPPED); - } - - // ---------------------------------- - // Private methods - // ---------------------------------- - private void startInstance(Object instance) throws TargetException { - try { - // handle @Init - if (initInvoker != null) { - initInvoker.invokeEvent(instance); - } - } catch (ObjectCallbackException e) { - TargetException te = new TargetException("Error initializing instance", e); - te.setIdentifier(getName()); - throw te; - } - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemEntryPointContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemEntryPointContext.java deleted file mode 100644 index 5533424334..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemEntryPointContext.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.context; - -import org.apache.tuscany.core.builder.ObjectFactory; -import org.apache.tuscany.core.context.AbstractContext; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.CoreRuntimeException; -import org.apache.tuscany.core.context.EntryPointContext; -import org.apache.tuscany.core.context.TargetException; - -/** - * Manages an entry point into a system module. System entry points cache a direct (i.e. non-proxied) reference to a - * component instance. - * - * @version $Rev$ $Date$ - */ -public class SystemEntryPointContext extends AbstractContext implements EntryPointContext { - - // responsible for resolving the component implementation instance exposed by the entry point - private ObjectFactory factory; - - // a reference to the component's implementation instance exposed by the entry point - private Object cachedInstance; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public SystemEntryPointContext(String name, ObjectFactory factory) { - super(name); - assert (factory != null) : "Object factory was null"; - this.factory = factory; - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public Object getInstance(QualifiedName qName) throws TargetException { - return getInstance(qName, true); - } - - public Object getInstance(QualifiedName qName, boolean notify) throws TargetException { - try { - if (cachedInstance == null) { - cachedInstance = factory.getInstance(); - } - return cachedInstance; - } catch (TargetException e) { - e.addContextName(getName()); - throw e; - } - } - - public void start() throws CoreRuntimeException { - lifecycleState = RUNNING; - } - - public void stop() throws CoreRuntimeException { - lifecycleState = STOPPED; - } - - public Object getImplementationInstance() throws TargetException{ - return getInstance(null); - } - - public Object getImplementationInstance(boolean notify) throws TargetException{ - return getInstance(null,notify); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemExternalServiceContext.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemExternalServiceContext.java deleted file mode 100644 index 9b09cea082..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemExternalServiceContext.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.context; - -import org.apache.tuscany.core.builder.ObjectFactory; -import org.apache.tuscany.core.context.AbstractContext; -import org.apache.tuscany.core.context.ExternalServiceContext; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.TargetException; - -/** - * An implementation of an external service for system wiring. As system components are not proxied and the system - * binding is by-reference, the implementation caches a reference to its configured target. - * - * @version $Rev$ $Date$ - */ -public class SystemExternalServiceContext extends AbstractContext implements ExternalServiceContext { - - // a factory for retrieving the target of the external service wire - private ObjectFactory factory; - - // the cached target - private Object cachedInstance; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public SystemExternalServiceContext(String name, ObjectFactory factory) { - super(name); - assert (factory != null) : "Object factory was null"; - this.factory = factory; - } - - // ---------------------------------- - // Methods - // ---------------------------------- - - public Object getInstance(QualifiedName qName) throws TargetException { - return getInstance(qName, false); - } - - public Object getInstance(QualifiedName qName, boolean notify) throws TargetException { - try { - if (cachedInstance == null) { - cachedInstance = factory.getInstance(); - } - return cachedInstance; - } catch (TargetException e) { - e.addContextName(getName()); - throw e; - } - - } - - public void start() { - lifecycleState = RUNNING; - } - - public void stop() { - lifecycleState = STOPPED; - } - - public Object getImplementationInstance() throws TargetException { - return this; - } - - public Object getImplementationInstance(boolean notify) throws TargetException { - return this; - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemScopeStrategy.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemScopeStrategy.java deleted file mode 100644 index 0dbd75da19..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemScopeStrategy.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.context; - -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.context.scope.AbstractScopeStrategy; -import org.apache.tuscany.core.context.scope.AggregateScopeContext; -import org.apache.tuscany.core.context.scope.ModuleScopeContext; -import org.apache.tuscany.core.context.scope.StatelessScopeContext; -import org.apache.tuscany.model.assembly.Scope; - -/** - * Implements a {@link org.apache.tuscany.core.context.ScopeStrategy} for a system aggregate context with the following scopes: - *

    - *
  • {@link org.apache.tuscany.model.assembly.Scope#AGGREGATE
  • - *
  • {@link org.apache.tuscany.model.assembly.Scope#MODULE
  • - *
  • {@link org.apache.tuscany.model.assembly.Scope#INSTANCE
  • - *
- * - * @version $Rev$ $Date$ - */ -public class SystemScopeStrategy extends AbstractScopeStrategy { - - public SystemScopeStrategy() { - } - - public Map createScopes(EventContext eventContext) { - ScopeContext aggregrateScope = new AggregateScopeContext(eventContext); - ScopeContext moduleScoper = new ModuleScopeContext(eventContext); - ScopeContext statelessScope = new StatelessScopeContext(eventContext); - Map scopes = new HashMap(); - scopes.put(Scope.AGGREGATE, aggregrateScope); - scopes.put(Scope.MODULE, moduleScoper); - scopes.put(Scope.INSTANCE, statelessScope); - return scopes; - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/injection/AutowireFactory.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/injection/AutowireFactory.java deleted file mode 100644 index 3bde49dbbe..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/injection/AutowireFactory.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.injection; - -import org.apache.tuscany.core.builder.ObjectFactory; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.AutowireContext; -import org.apache.tuscany.core.injection.FactoryInitException; -import org.apache.tuscany.core.injection.ObjectCreationException; - -/** - * Implementation of ObjectFactory that returns an instance by resolving against an AutowireContext. - * - * @version $Rev$ $Date$ - */ -public class AutowireFactory implements ObjectFactory { - - private AutowireContext autoWireContext; - - private Class implementationType; - - /** - * Constructor specifying the context to wire against and the type of service required. - * - * @param implementationType the type of service required - * @param autoWireContext the context to wire against - */ - public AutowireFactory(Class implementationType, AutowireContext autoWireContext) { - assert (implementationType != null) : "Implementation type was null"; - assert (autoWireContext != null) : "Autowire context was null"; - this.implementationType = implementationType; - this.autoWireContext = autoWireContext; - } - - public T getInstance() throws ObjectCreationException { - // todo what about required? should this just return null? - return autoWireContext.resolveInstance(implementationType); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/loader/SystemSCDLModelLoader.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/loader/SystemSCDLModelLoader.java deleted file mode 100644 index f49efe3ebc..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/loader/SystemSCDLModelLoader.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.apache.tuscany.core.system.loader; - -import org.apache.tuscany.core.system.assembly.SystemAssemblyFactory; -import org.apache.tuscany.core.system.assembly.impl.SystemAssemblyFactoryImpl; -import org.apache.tuscany.core.system.scdl.ScdlFactory; -import org.apache.tuscany.core.system.scdl.SystemImplementation; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.scdl.loader.SCDLModelLoader; -import org.apache.tuscany.sdo.util.SDOUtil; - -/** - * Populates the assembly model from an SCDL model - */ -public class SystemSCDLModelLoader implements SCDLModelLoader { - - private SystemAssemblyFactory systemFactory; - - static { - // Register the system SCDL model - SDOUtil.registerStaticTypes(ScdlFactory.class); - } - - /** - * Constructs a new JavaSCDLModelLoader. - */ - public SystemSCDLModelLoader() { - this.systemFactory=new SystemAssemblyFactoryImpl(); - } - - /** - * @see org.apache.tuscany.model.scdl.loader.SCDLModelLoader#load(org.apache.tuscany.model.assembly.AssemblyModelContext, java.lang.Object) - */ - public AssemblyModelObject load(AssemblyModelContext modelContext, Object object) { - if (object instanceof SystemImplementation) { - SystemImplementation scdlImplementation=(SystemImplementation)object; - org.apache.tuscany.core.system.assembly.SystemImplementation implementation=systemFactory.createSystemImplementation(); - Class implementationClass; - try { - implementationClass=modelContext.getSystemResourceLoader().loadClass(scdlImplementation.getClass_()); - } catch (ClassNotFoundException e) { - throw new IllegalArgumentException(e); - } - implementation.setImplementationClass(implementationClass); - return implementation; - } else - return null; - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/webapp/ContextBinder.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/webapp/ContextBinder.java deleted file mode 100644 index 690d03ac36..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/webapp/ContextBinder.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.core.webapp; - -import org.osoa.sca.SCA; -import org.osoa.sca.ModuleContext; - -/** - * @version $Rev$ $Date$ - */ -class ContextBinder extends SCA { - static final ContextBinder BINDER = new ContextBinder(); - - public void setContext(ModuleContext context) { - setModuleContext(context); - } - - public void start() { - throw new AssertionError(); - } - - public void stop() { - throw new AssertionError(); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/webapp/TuscanyRequestFilter.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/webapp/TuscanyRequestFilter.java deleted file mode 100644 index b72c546bf6..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/webapp/TuscanyRequestFilter.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.webapp; - -import java.io.IOException; - -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; - -import org.osoa.sca.ModuleContext; -import org.osoa.sca.CurrentModuleContext; - -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.webapp.LazyHTTPSessionId; - -/** - * Notifies the {@link org.apache.tuscany.core.context.AggregateContext} of web request start and end events as well as setting up the - * current session context. The latter is done using lazy Servlet-based session retrieval. The filter fires a session - * start event, passing a LazyServletSessionId as the session id. The LazyServletSessionId is a - * wrapper for the servlet request which may be called by the ModuleContext to retrieve the session id - * lazily. - * - * @version $Rev: 379957 $ $Date: 2006-02-22 14:58:24 -0800 (Wed, 22 Feb 2006) $ - */ -public class TuscanyRequestFilter implements Filter { - private AggregateContext moduleContext; - - public TuscanyRequestFilter() { - } - - public void init(FilterConfig filterConfig) throws ServletException { - ServletContext servletContext = filterConfig.getServletContext(); - moduleContext = (AggregateContext) servletContext.getAttribute(TuscanyServletListener.MODULE_COMPONENT_NAME); - } - - public void destroy() { - } - - public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws ServletException, IOException { - ModuleContext oldContext = CurrentModuleContext.getContext(); - try { - // Set the current module context - ContextBinder.BINDER.setContext((ModuleContext) moduleContext); - - // Handle a request - if (request instanceof HttpServletRequest) { - if (((HttpServletRequest) request).getSession(false) != null) { - - // A session is already active - moduleContext.fireEvent(EventContext.SESSION_NOTIFY, ((HttpServletRequest) request).getSession(true)); - } else { - // Create a lazy wrapper since a session is not yet active - moduleContext.fireEvent(EventContext.SESSION_NOTIFY, new LazyHTTPSessionId((HttpServletRequest) request)); - } - } else { - moduleContext.fireEvent(EventContext.SESSION_NOTIFY, request); - } - // Start processing the request - moduleContext.fireEvent(EventContext.REQUEST_START, request); - // Dispatch to the next filter - filterChain.doFilter(request, response); - } catch (Exception e) { - throw new ServletException(e); - - } finally { - try { - // End processing the request - moduleContext.fireEvent(EventContext.REQUEST_END, request); - } catch (Exception e) { - throw new ServletException(e); - } - ContextBinder.BINDER.setContext(oldContext); - } - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/webapp/TuscanyServletListener.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/webapp/TuscanyServletListener.java deleted file mode 100644 index 56b4b52495..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/webapp/TuscanyServletListener.java +++ /dev/null @@ -1,168 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.webapp; - -import java.util.ArrayList; -import java.util.List; -import javax.servlet.ServletContext; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; -import javax.servlet.http.HttpSessionEvent; -import javax.servlet.http.HttpSessionListener; - -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; - -import org.apache.tuscany.common.monitor.MonitorFactory; -import org.apache.tuscany.common.monitor.impl.NullMonitorFactory; -import org.apache.tuscany.common.resource.ResourceLoader; -import org.apache.tuscany.common.resource.impl.ResourceLoaderImpl; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.builder.impl.DefaultWireBuilder; -import org.apache.tuscany.core.config.ConfigurationException; -import org.apache.tuscany.core.config.ModuleComponentConfigurationLoader; -import org.apache.tuscany.core.config.impl.ModuleComponentConfigurationLoaderImpl; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.runtime.RuntimeContextImpl; -import org.apache.tuscany.core.system.builder.SystemComponentContextBuilder; -import org.apache.tuscany.core.system.builder.SystemEntryPointBuilder; -import org.apache.tuscany.core.system.builder.SystemExternalServiceBuilder; -import org.apache.tuscany.core.system.loader.SystemSCDLModelLoader; -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.ModuleComponent; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; -import org.apache.tuscany.model.assembly.loader.AssemblyModelLoader; -import org.apache.tuscany.model.scdl.loader.SCDLModelLoader; -import org.apache.tuscany.model.scdl.loader.impl.SCDLAssemblyModelLoaderImpl; - -/** - * ServletContextListener that can be added to a standard web application to boot - * a Tuscany runtime inside that application. All implementation classes should - * be located in the web application itself. - * - * @version $Rev: 380792 $ $Date: 2006-02-24 11:25:11 -0800 (Fri, 24 Feb 2006) $ - */ -public class TuscanyServletListener implements ServletContextListener, HttpSessionListener { - public static final String SCA_COMPONENT_NAME = "org.apache.tuscany.core.webapp.ModuleComponentName"; - public static final String MODULE_COMPONENT_NAME = "org.apache.tuscany.core.webapp.ModuleComponentContext"; - public static final String TUSCANY_RUNTIME_NAME = RuntimeContext.class.getName(); - - private final Object sessionKey = new Object(); - - private RuntimeContext runtimeContext; - private AggregateContext systemModuleComponentContext; - private AggregateContext moduleContext; - - private static final String SYSTEM_MODULE_COMPONENT = "org.apache.tuscany.core.system"; - - public void contextInitialized(ServletContextEvent servletContextEvent) { - ServletContext servletContext = servletContextEvent.getServletContext(); - String name = servletContext.getInitParameter(SCA_COMPONENT_NAME); - String uri = name; // todo get from context path - MonitorFactory monitorFactory = new NullMonitorFactory(); // todo have one that writes to the servlet log - - try { - bootRuntime(name, uri, monitorFactory); - } catch (ConfigurationException e) { - throw new RuntimeException(e.getMessage(), e); - } - - servletContext.setAttribute(TUSCANY_RUNTIME_NAME, runtimeContext); - servletContext.setAttribute(MODULE_COMPONENT_NAME, moduleContext); - } - - public void contextDestroyed(ServletContextEvent servletContextEvent) { - moduleContext.fireEvent(EventContext.MODULE_STOP, null); - moduleContext.stop(); - systemModuleComponentContext.fireEvent(EventContext.MODULE_STOP, null); - systemModuleComponentContext.stop(); - runtimeContext.stop(); - servletContextEvent.getServletContext().removeAttribute(MODULE_COMPONENT_NAME); - servletContextEvent.getServletContext().removeAttribute(TUSCANY_RUNTIME_NAME); - } - - public void sessionCreated(HttpSessionEvent event) { - // do nothing since sessions are lazily created in {@link TuscanyRequestFilter} - } - - public void sessionDestroyed(HttpSessionEvent event) { - // todo do we actually need to bind the module context to the thread to fire this event? - ModuleContext oldContext = CurrentModuleContext.getContext(); - try { - ContextBinder.BINDER.setContext((ModuleContext) moduleContext); - moduleContext.fireEvent(EventContext.SESSION_END, event.getSession()); - } finally{ - ContextBinder.BINDER.setContext(oldContext); - } - } - - private void bootRuntime(String name, String uri, MonitorFactory monitorFactory) throws ConfigurationException { - // Create a resource loader from the current classloader - ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); - ResourceLoader resourceLoader = new ResourceLoaderImpl(classLoader); - - // Create an assembly model factory - AssemblyFactory modelFactory=new AssemblyFactoryImpl(); - - // Create an assembly model loader - List scdlLoaders=new ArrayList(); - scdlLoaders.add(new SystemSCDLModelLoader()); - AssemblyModelLoader modelLoader=new SCDLAssemblyModelLoaderImpl(scdlLoaders); - - // Create an assembly model context - AssemblyModelContext modelContext = new AssemblyModelContextImpl(modelFactory, modelLoader, resourceLoader); - - // Create system configuration builders - List configBuilders = new ArrayList(); - configBuilders.add((new SystemComponentContextBuilder())); - configBuilders.add(new SystemEntryPointBuilder()); - configBuilders.add(new SystemExternalServiceBuilder()); - - // Create a runtime context and start it - runtimeContext = new RuntimeContextImpl(monitorFactory, scdlLoaders, configBuilders,new DefaultWireBuilder()); - runtimeContext.start(); - - // Get the system context - AggregateContext systemContext = runtimeContext.getSystemContext(); - - // Load the system module component - ModuleComponentConfigurationLoader loader = new ModuleComponentConfigurationLoaderImpl(modelContext); - ModuleComponent systemModuleComponent = loader.loadSystemModuleComponent(SYSTEM_MODULE_COMPONENT, SYSTEM_MODULE_COMPONENT); - - // Register it with the system context - systemContext.registerModelObject(systemModuleComponent); - - // Get the aggregate context representing the system module component - systemModuleComponentContext = (AggregateContext) systemContext.getContext(SYSTEM_MODULE_COMPONENT); - systemModuleComponentContext.registerModelObject(systemModuleComponent.getComponentImplementation()); - systemModuleComponentContext.fireEvent(EventContext.MODULE_START, null); - - // Load the SCDL configuration of the application module - ModuleComponent moduleComponent = loader.loadModuleComponent(name, uri); - - // Register it under the root application context - runtimeContext.getRootContext().registerModelObject(moduleComponent); - moduleContext=(AggregateContext)runtimeContext.getContext(moduleComponent.getName()); - moduleContext.registerModelObject(moduleComponent.getComponentImplementation()); - - moduleContext.fireEvent(EventContext.MODULE_START, null); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/main/resources/META-INF/services/org.apache.tuscany.core.runtime.proxy.ServiceProxyFactory b/tags/java-stable-20060304/sca/core/src/main/resources/META-INF/services/org.apache.tuscany.core.runtime.proxy.ServiceProxyFactory deleted file mode 100644 index 9b2d05d734..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/resources/META-INF/services/org.apache.tuscany.core.runtime.proxy.ServiceProxyFactory +++ /dev/null @@ -1 +0,0 @@ -org.apache.tuscany.core.runtime.proxy.impl.ServiceProxyFactoryImpl \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/core/src/main/resources/model/anyobject.xsd b/tags/java-stable-20060304/sca/core/src/main/resources/model/anyobject.xsd deleted file mode 100644 index 47f45d61d7..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/resources/model/anyobject.xsd +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/core/src/main/resources/model/tuscany-system.xsd b/tags/java-stable-20060304/sca/core/src/main/resources/model/tuscany-system.xsd deleted file mode 100644 index 7bd45320b9..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/resources/model/tuscany-system.xsd +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/core/src/main/resources/org/apache/tuscany/core/Messages.properties b/tags/java-stable-20060304/sca/core/src/main/resources/org/apache/tuscany/core/Messages.properties deleted file mode 100644 index 4581e44bff..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/resources/org/apache/tuscany/core/Messages.properties +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable. -# -# 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. -# ==================================================================== -# To code developer: -# Do NOT change the properties between this line and the -# "%%% END OF TRANSLATED PROPERTIES %%%" line. -# Make a new property name, append to the end of the file and change -# the code to use the new property. -# ==================================================================== - -# ===================================================================== -# %%% END OF TRANSLATED PROPERTIES %%% -# ===================================================================== -# NLS_MESSAGEFORMAT_ALL diff --git a/tags/java-stable-20060304/sca/core/src/main/resources/system.module b/tags/java-stable-20060304/sca/core/src/main/resources/system.module deleted file mode 100644 index 65ed9da82c..0000000000 --- a/tags/java-stable-20060304/sca/core/src/main/resources/system.module +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/builder/impl/DefaultWireBuilderTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/builder/impl/DefaultWireBuilderTestCase.java deleted file mode 100644 index 6eaac60eaa..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/builder/impl/DefaultWireBuilderTestCase.java +++ /dev/null @@ -1,447 +0,0 @@ -package org.apache.tuscany.core.builder.impl; - -import java.lang.reflect.Method; -import java.util.Map; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.MethodHashMap; -import org.apache.tuscany.core.invocation.ProxyConfiguration; -import org.apache.tuscany.core.invocation.impl.InvokerInterceptor; -import org.apache.tuscany.core.invocation.jdk.JDKProxyFactory; -import org.apache.tuscany.core.invocation.mock.MockHandler; -import org.apache.tuscany.core.invocation.mock.MockStaticInvoker; -import org.apache.tuscany.core.invocation.mock.MockSyncInterceptor; -import org.apache.tuscany.core.invocation.mock.SimpleTarget; -import org.apache.tuscany.core.invocation.mock.SimpleTargetImpl; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.message.Message; -import org.apache.tuscany.core.message.MessageFactory; -import org.apache.tuscany.core.message.impl.MessageFactoryImpl; - -public class DefaultWireBuilderTestCase extends TestCase { - - private Method hello; - - private Method goodbye; - - public DefaultWireBuilderTestCase() { - super(); - } - - public DefaultWireBuilderTestCase(String arg0) { - super(arg0); - } - - public void setUp() throws Exception { - hello = SimpleTarget.class.getMethod("hello", new Class[] { String.class }); - goodbye = SimpleTarget.class.getMethod("goodbye", new Class[] { String.class }); - } - - public void testWireWithInterceptorsAndHandlers() throws Exception { - MessageFactory msgFactory = new MessageFactoryImpl(); - - InvocationConfiguration source = new InvocationConfiguration(hello); - MockHandler sourceRequestHandler = new MockHandler(); - MockHandler sourceResponseHandler = new MockHandler(); - MockSyncInterceptor sourceInterceptor = new MockSyncInterceptor(); - source.addRequestHandler(sourceRequestHandler); - source.addResponseHandler(sourceResponseHandler); - source.addSourceInterceptor(sourceInterceptor); - - ProxyFactory sourceFactory = new JDKProxyFactory(); - Map sourceInvocationConfigs = new MethodHashMap(); - sourceInvocationConfigs.put(hello, source); - ProxyConfiguration sourceConfig = new ProxyConfiguration(new QualifiedName("target/SimpleTarget"), - sourceInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory); - sourceFactory.setProxyConfiguration(sourceConfig); - sourceFactory.setBusinessInterface(SimpleTarget.class); - - InvocationConfiguration target = new InvocationConfiguration(hello); - MockHandler targetRequestHandler = new MockHandler(); - MockHandler targetResponseHandler = new MockHandler(); - MockSyncInterceptor targetInterceptor = new MockSyncInterceptor(); - target.addRequestHandler(targetRequestHandler); - target.addResponseHandler(targetResponseHandler); - target.addTargetInterceptor(targetInterceptor); - target.addTargetInterceptor(new InvokerInterceptor()); - - ProxyFactory targetFactory = new JDKProxyFactory(); - Map targetInvocationConfigs = new MethodHashMap(); - targetInvocationConfigs.put(hello, target); - ProxyConfiguration targetConfig = new ProxyConfiguration(new QualifiedName("target/SimpleTarget"), - targetInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory); - targetFactory.setProxyConfiguration(targetConfig); - targetFactory.setBusinessInterface(SimpleTarget.class); - - // connect the source to the target - DefaultWireBuilder builder = new DefaultWireBuilder(); - // no need for scopes since we use a static invoker - builder.connect(sourceFactory, targetFactory, null, true, null); - // source.build(); - target.build(); - // set a static invoker - MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl()); - source.setTargetInvoker(invoker); - - Message msg = msgFactory.createMessage(); - msg.setBody("foo"); - msg.setTargetInvoker(invoker); - Message response = (Message) source.getSourceInterceptor().invoke(msg); - Assert.assertEquals("foo", response.getBody()); - Assert.assertEquals(1, sourceRequestHandler.getCount()); - Assert.assertEquals(1, sourceResponseHandler.getCount()); - Assert.assertEquals(1, sourceInterceptor.getCount()); - Assert.assertEquals(1, targetRequestHandler.getCount()); - Assert.assertEquals(1, targetResponseHandler.getCount()); - Assert.assertEquals(1, targetInterceptor.getCount()); - } - - public void testWireWithSourceInterceptorTargetHandlersAndTargetInterceptor() throws Exception { - MessageFactory msgFactory = new MessageFactoryImpl(); - - InvocationConfiguration source = new InvocationConfiguration(hello); - MockSyncInterceptor sourceInterceptor = new MockSyncInterceptor(); - source.addSourceInterceptor(sourceInterceptor); - - ProxyFactory sourceFactory = new JDKProxyFactory(); - Map sourceInvocationConfigs = new MethodHashMap(); - sourceInvocationConfigs.put(hello, source); - ProxyConfiguration sourceConfig = new ProxyConfiguration(new QualifiedName("target/SimpleTarget"), - sourceInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory); - sourceFactory.setProxyConfiguration(sourceConfig); - sourceFactory.setBusinessInterface(SimpleTarget.class); - - InvocationConfiguration target = new InvocationConfiguration(hello); - MockHandler targetRequestHandler = new MockHandler(); - MockHandler targetResponseHandler = new MockHandler(); - MockSyncInterceptor targetInterceptor = new MockSyncInterceptor(); - target.addRequestHandler(targetRequestHandler); - target.addResponseHandler(targetResponseHandler); - target.addTargetInterceptor(targetInterceptor); - target.addTargetInterceptor(new InvokerInterceptor()); - - ProxyFactory targetFactory = new JDKProxyFactory(); - Map targetInvocationConfigs = new MethodHashMap(); - targetInvocationConfigs.put(hello, target); - ProxyConfiguration targetConfig = new ProxyConfiguration(new QualifiedName("target/SimpleTarget"), - targetInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory); - targetFactory.setProxyConfiguration(targetConfig); - targetFactory.setBusinessInterface(SimpleTarget.class); - - // connect the source to the target - DefaultWireBuilder builder = new DefaultWireBuilder(); - // no need for scopes since we use a static invoker - builder.connect(sourceFactory, targetFactory, null, true, null); - // source.build(); - target.build(); - // set a static invoker - MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl()); - source.setTargetInvoker(invoker); - - Message msg = msgFactory.createMessage(); - msg.setBody("foo"); - msg.setTargetInvoker(invoker); - Message response = (Message) source.getSourceInterceptor().invoke(msg); - Assert.assertEquals("foo", response.getBody()); - Assert.assertEquals(1, sourceInterceptor.getCount()); - Assert.assertEquals(1, targetRequestHandler.getCount()); - Assert.assertEquals(1, targetResponseHandler.getCount()); - Assert.assertEquals(1, targetInterceptor.getCount()); - } - - public void testWireWithInterceptorsAndRequestHandlers() throws Exception { - MessageFactory msgFactory = new MessageFactoryImpl(); - - InvocationConfiguration source = new InvocationConfiguration(hello); - MockHandler sourceRequestHandler = new MockHandler(); - MockSyncInterceptor sourceInterceptor = new MockSyncInterceptor(); - source.addRequestHandler(sourceRequestHandler); - source.addSourceInterceptor(sourceInterceptor); - - ProxyFactory sourceFactory = new JDKProxyFactory(); - Map sourceInvocationConfigs = new MethodHashMap(); - sourceInvocationConfigs.put(hello, source); - ProxyConfiguration sourceConfig = new ProxyConfiguration(new QualifiedName("target/SimpleTarget"), - sourceInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory); - sourceFactory.setProxyConfiguration(sourceConfig); - sourceFactory.setBusinessInterface(SimpleTarget.class); - - InvocationConfiguration target = new InvocationConfiguration(hello); - MockHandler targetRequestHandler = new MockHandler(); - MockSyncInterceptor targetInterceptor = new MockSyncInterceptor(); - target.addRequestHandler(targetRequestHandler); - target.addTargetInterceptor(targetInterceptor); - target.addTargetInterceptor(new InvokerInterceptor()); - - ProxyFactory targetFactory = new JDKProxyFactory(); - Map targetInvocationConfigs = new MethodHashMap(); - targetInvocationConfigs.put(hello, target); - ProxyConfiguration targetConfig = new ProxyConfiguration(new QualifiedName("target/SimpleTarget"), - targetInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory); - targetFactory.setProxyConfiguration(targetConfig); - targetFactory.setBusinessInterface(SimpleTarget.class); - - // connect the source to the target - DefaultWireBuilder builder = new DefaultWireBuilder(); - // no need for scopes since we use a static invoker - builder.connect(sourceFactory, targetFactory, null, true, null); - // source.build(); - target.build(); - // set a static invoker - MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl()); - source.setTargetInvoker(invoker); - - Message msg = msgFactory.createMessage(); - msg.setBody("foo"); - msg.setTargetInvoker(invoker); - Message response = (Message) source.getSourceInterceptor().invoke(msg); - Assert.assertEquals("foo", response.getBody()); - Assert.assertEquals(1, sourceRequestHandler.getCount()); - Assert.assertEquals(1, sourceInterceptor.getCount()); - Assert.assertEquals(1, targetRequestHandler.getCount()); - Assert.assertEquals(1, targetInterceptor.getCount()); - } - - public void testWireWithSourceAndTargetInterceptors() throws Exception { - MessageFactory msgFactory = new MessageFactoryImpl(); - - InvocationConfiguration source = new InvocationConfiguration(hello); - MockSyncInterceptor sourceInterceptor = new MockSyncInterceptor(); - source.addSourceInterceptor(sourceInterceptor); - - ProxyFactory sourceFactory = new JDKProxyFactory(); - Map sourceInvocationConfigs = new MethodHashMap(); - sourceInvocationConfigs.put(hello, source); - ProxyConfiguration sourceConfig = new ProxyConfiguration(new QualifiedName("target/SimpleTarget"), - sourceInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory); - sourceFactory.setProxyConfiguration(sourceConfig); - sourceFactory.setBusinessInterface(SimpleTarget.class); - - InvocationConfiguration target = new InvocationConfiguration(hello); - MockSyncInterceptor targetInterceptor = new MockSyncInterceptor(); - target.addTargetInterceptor(targetInterceptor); - target.addTargetInterceptor(new InvokerInterceptor()); - - ProxyFactory targetFactory = new JDKProxyFactory(); - Map targetInvocationConfigs = new MethodHashMap(); - targetInvocationConfigs.put(hello, target); - ProxyConfiguration targetConfig = new ProxyConfiguration(new QualifiedName("target/SimpleTarget"), - targetInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory); - targetFactory.setProxyConfiguration(targetConfig); - targetFactory.setBusinessInterface(SimpleTarget.class); - - // connect the source to the target - DefaultWireBuilder builder = new DefaultWireBuilder(); - // no need for scopes since we use a static invoker - builder.connect(sourceFactory, targetFactory, null, true, null); - // source.build(); - target.build(); - // set a static invoker - MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl()); - source.setTargetInvoker(invoker); - - Message msg = msgFactory.createMessage(); - msg.setBody("foo"); - msg.setTargetInvoker(invoker); - Message response = (Message) source.getSourceInterceptor().invoke(msg); - Assert.assertEquals("foo", response.getBody()); - Assert.assertEquals(1, sourceInterceptor.getCount()); - Assert.assertEquals(1, targetInterceptor.getCount()); - } - - public void testWireWithSourceInterceptorSourceHandlersAndTargetInterceptor() throws Exception { - MessageFactory msgFactory = new MessageFactoryImpl(); - - InvocationConfiguration source = new InvocationConfiguration(hello); - MockHandler sourceRequestHandler = new MockHandler(); - MockHandler sourceResponseHandler = new MockHandler(); - MockSyncInterceptor sourceInterceptor = new MockSyncInterceptor(); - source.addRequestHandler(sourceRequestHandler); - source.addResponseHandler(sourceResponseHandler); - source.addSourceInterceptor(sourceInterceptor); - - ProxyFactory sourceFactory = new JDKProxyFactory(); - Map sourceInvocationConfigs = new MethodHashMap(); - sourceInvocationConfigs.put(hello, source); - ProxyConfiguration sourceConfig = new ProxyConfiguration(new QualifiedName("target/SimpleTarget"), - sourceInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory); - sourceFactory.setProxyConfiguration(sourceConfig); - sourceFactory.setBusinessInterface(SimpleTarget.class); - - InvocationConfiguration target = new InvocationConfiguration(hello); - MockSyncInterceptor targetInterceptor = new MockSyncInterceptor(); - target.addTargetInterceptor(targetInterceptor); - target.addTargetInterceptor(new InvokerInterceptor()); - - ProxyFactory targetFactory = new JDKProxyFactory(); - Map targetInvocationConfigs = new MethodHashMap(); - targetInvocationConfigs.put(hello, target); - ProxyConfiguration targetConfig = new ProxyConfiguration(new QualifiedName("target/SimpleTarget"), - targetInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory); - targetFactory.setProxyConfiguration(targetConfig); - targetFactory.setBusinessInterface(SimpleTarget.class); - - // connect the source to the target - DefaultWireBuilder builder = new DefaultWireBuilder(); - // no need for scopes since we use a static invoker - builder.connect(sourceFactory, targetFactory, null, true, null); - // source.build(); - target.build(); - // set a static invoker - MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl()); - source.setTargetInvoker(invoker); - - Message msg = msgFactory.createMessage(); - msg.setBody("foo"); - msg.setTargetInvoker(invoker); - Message response = (Message) source.getSourceInterceptor().invoke(msg); - Assert.assertEquals("foo", response.getBody()); - Assert.assertEquals(1, sourceRequestHandler.getCount()); - Assert.assertEquals(1, sourceResponseHandler.getCount()); - Assert.assertEquals(1, sourceInterceptor.getCount()); - Assert.assertEquals(1, targetInterceptor.getCount()); - } - - public void testWireWithTargetInterceptorAndTargetHandlers() throws Exception { - MessageFactory msgFactory = new MessageFactoryImpl(); - - InvocationConfiguration source = new InvocationConfiguration(hello); - - ProxyFactory sourceFactory = new JDKProxyFactory(); - Map sourceInvocationConfigs = new MethodHashMap(); - sourceInvocationConfigs.put(hello, source); - ProxyConfiguration sourceConfig = new ProxyConfiguration(new QualifiedName("target/SimpleTarget"), - sourceInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory); - sourceFactory.setProxyConfiguration(sourceConfig); - sourceFactory.setBusinessInterface(SimpleTarget.class); - - InvocationConfiguration target = new InvocationConfiguration(hello); - MockHandler targetRequestHandler = new MockHandler(); - MockHandler targetResponseHandler = new MockHandler(); - MockSyncInterceptor targetInterceptor = new MockSyncInterceptor(); - target.addRequestHandler(targetRequestHandler); - target.addResponseHandler(targetResponseHandler); - target.addTargetInterceptor(targetInterceptor); - target.addTargetInterceptor(new InvokerInterceptor()); - - ProxyFactory targetFactory = new JDKProxyFactory(); - Map targetInvocationConfigs = new MethodHashMap(); - targetInvocationConfigs.put(hello, target); - ProxyConfiguration targetConfig = new ProxyConfiguration(new QualifiedName("target/SimpleTarget"), - targetInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory); - targetFactory.setProxyConfiguration(targetConfig); - targetFactory.setBusinessInterface(SimpleTarget.class); - - // connect the source to the target - DefaultWireBuilder builder = new DefaultWireBuilder(); - // no need for scopes since we use a static invoker - builder.connect(sourceFactory, targetFactory, null, true, null); - // source.build(); - target.build(); - // set a static invoker - MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl()); - source.setTargetInvoker(invoker); - - Message msg = msgFactory.createMessage(); - msg.setBody("foo"); - msg.setTargetInvoker(invoker); - Message response = (Message) source.getSourceInterceptor().invoke(msg); - Assert.assertEquals("foo", response.getBody()); - Assert.assertEquals(1, targetRequestHandler.getCount()); - Assert.assertEquals(1, targetResponseHandler.getCount()); - Assert.assertEquals(1, targetInterceptor.getCount()); - } - - public void testWireWithTargetInterceptor() throws Exception { - MessageFactory msgFactory = new MessageFactoryImpl(); - - InvocationConfiguration source = new InvocationConfiguration(hello); - - ProxyFactory sourceFactory = new JDKProxyFactory(); - Map sourceInvocationConfigs = new MethodHashMap(); - sourceInvocationConfigs.put(hello, source); - ProxyConfiguration sourceConfig = new ProxyConfiguration(new QualifiedName("target/SimpleTarget"), - sourceInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory); - sourceFactory.setProxyConfiguration(sourceConfig); - sourceFactory.setBusinessInterface(SimpleTarget.class); - - InvocationConfiguration target = new InvocationConfiguration(hello); - MockSyncInterceptor targetInterceptor = new MockSyncInterceptor(); - target.addTargetInterceptor(targetInterceptor); - target.addTargetInterceptor(new InvokerInterceptor()); - - ProxyFactory targetFactory = new JDKProxyFactory(); - Map targetInvocationConfigs = new MethodHashMap(); - targetInvocationConfigs.put(hello, target); - ProxyConfiguration targetConfig = new ProxyConfiguration(new QualifiedName("target/SimpleTarget"), - targetInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory); - targetFactory.setProxyConfiguration(targetConfig); - targetFactory.setBusinessInterface(SimpleTarget.class); - - // connect the source to the target - DefaultWireBuilder builder = new DefaultWireBuilder(); - // no need for scopes since we use a static invoker - builder.connect(sourceFactory, targetFactory, null, true, null); - target.build(); - // set a static invoker - MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl()); - source.setTargetInvoker(invoker); - - Message msg = msgFactory.createMessage(); - msg.setBody("foo"); - msg.setTargetInvoker(invoker); - Message response = (Message) source.getSourceInterceptor().invoke(msg); - Assert.assertEquals("foo", response.getBody()); - Assert.assertEquals(1, targetInterceptor.getCount()); - } - - /** - * When there are only {@link InvokerInterceptor}s in the source and target chain, we need to bypass one during - * wire up so they are not chained together - */ - public void testWireWithOnlyInvokerInterceptors() throws Exception { - MessageFactory msgFactory = new MessageFactoryImpl(); - - InvocationConfiguration source = new InvocationConfiguration(hello); - source.addTargetInterceptor(new InvokerInterceptor()); - - ProxyFactory sourceFactory = new JDKProxyFactory(); - Map sourceInvocationConfigs = new MethodHashMap(); - sourceInvocationConfigs.put(hello, source); - ProxyConfiguration sourceConfig = new ProxyConfiguration(new QualifiedName("target/SimpleTarget"), - sourceInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory); - sourceFactory.setProxyConfiguration(sourceConfig); - sourceFactory.setBusinessInterface(SimpleTarget.class); - - InvocationConfiguration target = new InvocationConfiguration(hello); - target.addTargetInterceptor(new InvokerInterceptor()); - - ProxyFactory targetFactory = new JDKProxyFactory(); - Map targetInvocationConfigs = new MethodHashMap(); - targetInvocationConfigs.put(hello, target); - ProxyConfiguration targetConfig = new ProxyConfiguration(new QualifiedName("target/SimpleTarget"), - targetInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory); - targetFactory.setProxyConfiguration(targetConfig); - targetFactory.setBusinessInterface(SimpleTarget.class); - - // connect the source to the target - DefaultWireBuilder builder = new DefaultWireBuilder(); - // no need for scopes since we use a static invoker - builder.connect(sourceFactory, targetFactory, null, true, null); - target.build(); - // set a static invoker - MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl()); - source.setTargetInvoker(invoker); - - Message msg = msgFactory.createMessage(); - msg.setBody("foo"); - msg.setTargetInvoker(invoker); - Message response = (Message) source.getSourceInterceptor().invoke(msg); - Assert.assertEquals("foo", response.getBody()); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/builder/impl/NegativeDefaultWireBuilderTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/builder/impl/NegativeDefaultWireBuilderTestCase.java deleted file mode 100644 index bf83bca5cb..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/builder/impl/NegativeDefaultWireBuilderTestCase.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.apache.tuscany.core.builder.impl; - -import java.lang.reflect.Method; -import java.util.Map; - -import junit.framework.TestCase; - -import org.apache.tuscany.core.builder.BuilderConfigException; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.MethodHashMap; -import org.apache.tuscany.core.invocation.ProxyConfiguration; -import org.apache.tuscany.core.invocation.jdk.JDKProxyFactory; -import org.apache.tuscany.core.invocation.mock.SimpleTarget; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.core.message.MessageFactory; -import org.apache.tuscany.core.message.impl.MessageFactoryImpl; - -public class NegativeDefaultWireBuilderTestCase extends TestCase { - - private Method hello; - - private Method goodbye; - - public NegativeDefaultWireBuilderTestCase() { - super(); - } - - public NegativeDefaultWireBuilderTestCase(String arg0) { - super(arg0); - } - - public void setUp() throws Exception { - hello = SimpleTarget.class.getMethod("hello", new Class[] { String.class }); - goodbye = SimpleTarget.class.getMethod("goodbye", new Class[] { String.class }); - } - - public void testNoTargetInterceptorOrHandler() throws Exception { - MessageFactory msgFactory = new MessageFactoryImpl(); - - InvocationConfiguration source = new InvocationConfiguration(hello); - - ProxyFactory sourceFactory = new JDKProxyFactory(); - Map sourceInvocationConfigs = new MethodHashMap(); - sourceInvocationConfigs.put(hello, source); - ProxyConfiguration sourceConfig = new ProxyConfiguration(new QualifiedName("target/SimpleTarget"), - sourceInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory); - sourceFactory.setProxyConfiguration(sourceConfig); - sourceFactory.setBusinessInterface(SimpleTarget.class); - - InvocationConfiguration target = new InvocationConfiguration(hello); - - ProxyFactory targetFactory = new JDKProxyFactory(); - Map targetInvocationConfigs = new MethodHashMap(); - targetInvocationConfigs.put(hello, target); - ProxyConfiguration targetConfig = new ProxyConfiguration(new QualifiedName("target/SimpleTarget"), - targetInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory); - targetFactory.setProxyConfiguration(targetConfig); - targetFactory.setBusinessInterface(SimpleTarget.class); - - // connect the source to the target - DefaultWireBuilder builder = new DefaultWireBuilder(); - try { - builder.connect(sourceFactory, targetFactory, null, true, null); - fail("Expected " + BuilderConfigException.class.getName()); - } catch (BuilderConfigException e) { - // success - } - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/config/JavaIntrospectionHelperTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/config/JavaIntrospectionHelperTestCase.java deleted file mode 100644 index 9cd7a40e59..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/config/JavaIntrospectionHelperTestCase.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.config; - -import java.lang.reflect.Constructor; - -import org.apache.tuscany.core.config.JavaIntrospectionHelper; - -import junit.framework.TestCase; - -/** - * @version $Rev$ $Date$ - */ -public class JavaIntrospectionHelperTestCase extends TestCase { - public void testDefaultConstructor() throws Exception { - Constructor ctr = JavaIntrospectionHelper.getDefaultConstructor(SomeClass.class); - assertEquals(ctr, SomeClass.class.getConstructor(new Class[]{})); - assertTrue(SomeClass.class == ctr.newInstance((Object[]) null).getClass()); - } - - public static class SomeClass { - } -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/config/ModuleComponentConfigurationLoaderTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/config/ModuleComponentConfigurationLoaderTestCase.java deleted file mode 100644 index df4cace0f9..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/config/ModuleComponentConfigurationLoaderTestCase.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.config; - -import java.net.URL; -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.common.resource.impl.ResourceLoaderImpl; -import org.apache.tuscany.core.config.impl.ModuleComponentConfigurationLoaderImpl; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.ComponentImplementation; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.ModuleComponent; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; -import org.apache.tuscany.model.scdl.loader.impl.SCDLAssemblyModelLoaderImpl; - -/** - * @version $Rev: 379641 $ $Date: 2006-02-21 16:50:58 -0800 (Tue, 21 Feb 2006) $ - */ -public class ModuleComponentConfigurationLoaderTestCase extends TestCase { - private ModuleComponentConfigurationLoader loader; - - public void testFoo() throws ConfigurationException { - URL xml = ModuleComponentConfigurationLoaderTestCase.class.getResource("ModuleComponentLoaderTest1.module"); - ModuleComponent moduleComponent = loader.loadModuleComponent("test", "test", xml.toString()); - Assert.assertEquals("test", moduleComponent.getName()); - Module module = moduleComponent.getModuleImplementation(); - Assert.assertEquals("ModuleComponentLoaderTest1", module.getName()); - List components = module.getComponents(); - Assert.assertEquals(1,components.size()); - Component component = components.get(0); - Assert.assertEquals("HelloWorldServiceComponent", component.getName()); - - component = module.getComponent("HelloWorldServiceComponent"); - Assert.assertEquals("HelloWorldServiceComponent", component.getName()); - - ComponentImplementation implementation = component.getComponentImplementation(); - Assert.assertNull(implementation); - } - - protected void setUp() throws Exception { - super.setUp(); - Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); - AssemblyModelContext modelContext=new AssemblyModelContextImpl( - new AssemblyFactoryImpl(), new SCDLAssemblyModelLoaderImpl(null), - new ResourceLoaderImpl(this.getClass().getClassLoader())); - loader = new ModuleComponentConfigurationLoaderImpl(modelContext); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/context/AbstractAggregateHierarchyTests.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/context/AbstractAggregateHierarchyTests.java deleted file mode 100644 index 87e8d091ce..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/context/AbstractAggregateHierarchyTests.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.common.monitor.impl.NullMonitorFactory; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.context.impl.AggregateContextImpl; -import org.apache.tuscany.core.context.impl.EventContextImpl; -import org.apache.tuscany.core.context.scope.DefaultScopeStrategy; -import org.apache.tuscany.core.mock.MockConfigContext; -import org.apache.tuscany.core.mock.MockFactory; -import org.apache.tuscany.core.mock.component.ModuleScopeSystemComponent; -import org.apache.tuscany.core.mock.component.ModuleScopeSystemComponentImpl; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.Scope; -import org.osoa.sca.ModuleContext; - -/** - * Performs testing of various hierarchical scenarios - * - * @version $Rev$ $Date$ - */ -public abstract class AbstractAggregateHierarchyTests extends TestCase { - protected List builders; - - public void testParentContextIsolation() throws Exception { - AggregateContext parent = createContextHierachy(); - AggregateContext child = (AggregateContext) parent.getContext("test.child"); - Component component = MockFactory.createSystemComponent("TestService1", ModuleScopeSystemComponentImpl.class, - Scope.MODULE); - parent.registerModelObject(component); - EntryPoint ep = MockFactory.createEPSystemBinding("TestService1EP", ModuleScopeSystemComponent.class, "TestService1", - component); - parent.registerModelObject(ep); - parent.fireEvent(EventContext.MODULE_START, null); - child.fireEvent(EventContext.MODULE_START, null); - Assert.assertNotNull(parent.locateInstance("TestService1EP")); - try { - ((ModuleContext) child).locateService("TestService1EP"); - fail("Expexcted " + ServiceNotFoundException.class.getName()); - } catch (ServiceNotFoundException e) { - // expect exception to be thrown - } - parent.fireEvent(EventContext.MODULE_STOP, null); - child.fireEvent(EventContext.MODULE_STOP, null); - parent.stop(); - - } - - /** - * Checks that registration of duplicate named model objects before context start throws an exception - */ - public void testRegisterSameName() throws Exception { - AggregateContext parent = new AggregateContextImpl("test.parent", null, new DefaultScopeStrategy(), - new EventContextImpl(), new MockConfigContext(builders), new NullMonitorFactory()); - parent.registerModelObject(MockFactory.createSystemAggregateComponent("test.child")); - try { - parent.registerModelObject(MockFactory.createSystemAggregateComponent("test.child")); - parent.start(); - fail("Expected " + DuplicateNameException.class.getName()); - } catch (DuplicateNameException e) { - // expected - } - } - - /** - * Checks that registration of duplicate named model objects after context start throws an exception - */ - public void testRegisterSameNameAfterStart() throws Exception { - AggregateContext parent = new AggregateContextImpl("test.parent", null, new DefaultScopeStrategy(), - new EventContextImpl(), new MockConfigContext(builders), new NullMonitorFactory()); - parent.registerModelObject(MockFactory.createSystemAggregateComponent("test.child")); - parent.start(); - AggregateContext child = (AggregateContext) parent.getContext("test.child"); - Assert.assertNotNull(child); - try { - parent.registerModelObject(MockFactory.createSystemAggregateComponent("test.child")); - fail("Expected " + DuplicateNameException.class.getName()); - } catch (DuplicateNameException e) { - // expected - } - } - - protected abstract AggregateContext createContextHierachy() throws Exception; - - protected void setUp() throws Exception { - super.setUp(); - builders = MockFactory.createSystemBuilders(); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/context/AggregateComponentContextRegisterTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/context/AggregateComponentContextRegisterTestCase.java deleted file mode 100644 index 924ce57939..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/context/AggregateComponentContextRegisterTestCase.java +++ /dev/null @@ -1,130 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.common.monitor.impl.NullMonitorFactory; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.context.impl.AggregateContextImpl; -import org.apache.tuscany.core.context.impl.EventContextImpl; -import org.apache.tuscany.core.context.scope.DefaultScopeStrategy; -import org.apache.tuscany.core.mock.MockConfigContext; -import org.apache.tuscany.core.mock.MockFactory; -import org.apache.tuscany.core.mock.component.GenericSystemComponent; -import org.apache.tuscany.core.mock.component.ModuleScopeSystemComponent; -import org.apache.tuscany.core.mock.component.ModuleScopeSystemComponentImpl; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.Scope; - -/** - * Tests registration of model objects for an aggregate context - * - * @version $Rev$ $Date$ - */ -public class AggregateComponentContextRegisterTestCase extends TestCase { - - public void testModuleRegistration() throws Exception { - AggregateContext moduleContext = createContext(); - Module module = MockFactory.createSystemModule(); - moduleContext.registerModelObject(module); - moduleContext.start(); - moduleContext.fireEvent(EventContext.MODULE_START, null); - GenericSystemComponent component = (GenericSystemComponent) moduleContext.locateInstance("TestService1"); - Assert.assertNotNull(component); - GenericSystemComponent ep = (GenericSystemComponent) moduleContext.locateInstance("TestService1EP"); - Assert.assertNotNull(ep); - moduleContext.fireEvent(EventContext.MODULE_STOP, null); - moduleContext.stop(); - } - - public void testModuleRegistrationAfterStart() throws Exception { - AggregateContext moduleContext = createContext(); - moduleContext.start(); - Module module = MockFactory.createSystemModule(); - moduleContext.registerModelObject(module); - moduleContext.fireEvent(EventContext.MODULE_START, null); - GenericSystemComponent component = (GenericSystemComponent) moduleContext.locateInstance("TestService1"); - Assert.assertNotNull(component); - GenericSystemComponent ep = (GenericSystemComponent) moduleContext.locateInstance("TestService1EP"); - Assert.assertNotNull(ep); - moduleContext.fireEvent(EventContext.MODULE_STOP, null); - moduleContext.stop(); - } - - public void testRegistration() throws Exception { - AggregateContext moduleContext = createContext(); - Component component = MockFactory.createSystemComponent("TestService1", ModuleScopeSystemComponentImpl.class, - Scope.MODULE); - moduleContext.registerModelObject(component); - EntryPoint ep = MockFactory.createEPSystemBinding("TestService1EP", ModuleScopeSystemComponent.class, "TestService1", - component); - moduleContext.registerModelObject(ep); - moduleContext.start(); - moduleContext.fireEvent(EventContext.MODULE_START, null); - GenericSystemComponent test = (GenericSystemComponent) moduleContext.locateInstance("TestService1"); - Assert.assertNotNull(test); - GenericSystemComponent testEP = (GenericSystemComponent) moduleContext.locateInstance("TestService1EP"); - Assert.assertNotNull(testEP); - moduleContext.fireEvent(EventContext.MODULE_STOP, null); - moduleContext.stop(); - } - - public void testRegistrationAfterStart() throws Exception { - AggregateContext moduleContext = createContext(); - Component component = MockFactory.createSystemComponent("TestService1", ModuleScopeSystemComponentImpl.class, - Scope.MODULE); - moduleContext.start(); - moduleContext.registerModelObject(component); - EntryPoint ep = MockFactory.createEPSystemBinding("TestService1EP", ModuleScopeSystemComponent.class, "TestService1", - component); - moduleContext.registerModelObject(ep); - moduleContext.fireEvent(EventContext.MODULE_START, null); - GenericSystemComponent test = (GenericSystemComponent) moduleContext.locateInstance("TestService1"); - Assert.assertNotNull(test); - GenericSystemComponent testEP = (GenericSystemComponent) moduleContext.locateInstance("TestService1EP"); - Assert.assertNotNull(testEP); - moduleContext.fireEvent(EventContext.MODULE_STOP, null); - moduleContext.stop(); - } - - public void testEPRegistrationAfterModuleStart() throws Exception { - AggregateContext moduleContext = createContext(); - Component component = MockFactory.createSystemComponent("TestService1", ModuleScopeSystemComponentImpl.class, - Scope.MODULE); - moduleContext.start(); - moduleContext.registerModelObject(component); - moduleContext.fireEvent(EventContext.MODULE_START, null); - GenericSystemComponent test = (GenericSystemComponent) moduleContext.locateInstance("TestService1"); - Assert.assertNotNull(test); - EntryPoint ep = MockFactory.createEPSystemBinding("TestService1EP", ModuleScopeSystemComponent.class, "TestService1", - component); - moduleContext.registerModelObject(ep); - GenericSystemComponent testEP = (GenericSystemComponent) moduleContext.locateInstance("TestService1EP"); - Assert.assertNotNull(testEP); - moduleContext.fireEvent(EventContext.MODULE_STOP, null); - moduleContext.stop(); - } - - protected AggregateContext createContext() { - List builders = MockFactory.createSystemBuilders(); - return new AggregateContextImpl("test.context", null, new DefaultScopeStrategy(), new EventContextImpl(), - new MockConfigContext(builders), new NullMonitorFactory()); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/context/AggregateHierarchyTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/context/AggregateHierarchyTestCase.java deleted file mode 100644 index 51d315e1cf..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/context/AggregateHierarchyTestCase.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -import java.util.List; - -import junit.framework.Assert; - -import org.apache.tuscany.common.monitor.impl.NullMonitorFactory; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.context.impl.AggregateContextImpl; -import org.apache.tuscany.core.context.impl.EventContextImpl; -import org.apache.tuscany.core.context.scope.DefaultScopeStrategy; -import org.apache.tuscany.core.mock.MockConfigContext; -import org.apache.tuscany.core.mock.MockFactory; -import org.apache.tuscany.core.mock.component.ModuleScopeSystemComponent; -import org.apache.tuscany.core.mock.component.ModuleScopeSystemComponentImpl; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.Scope; -import org.osoa.sca.ModuleContext; -import org.osoa.sca.ServiceUnavailableException; - -/** - * Performs testing of various hierarchical scenarios - * - * @version $Rev$ $Date$ - */ -public class AggregateHierarchyTestCase extends AbstractAggregateHierarchyTests { - - /** - * FIXME model Tests adding a component, accessing it and then exposing it as an entry point after the first access - * - * @throws Exception - */ - public void testChildContextIsolation() throws Exception { - AggregateContext parent = createContextHierachy(); - AggregateContext child = (AggregateContext) parent.getContext("test.child"); - Component component = MockFactory.createSystemInitializedComponent("TestService1", ModuleScopeSystemComponentImpl.class, - Scope.MODULE); - child.registerModelObject(component); - parent.fireEvent(EventContext.MODULE_START, null); - child.fireEvent(EventContext.MODULE_START, null); - Assert.assertNotNull(child.locateInstance("TestService1")); - try { - ((ModuleContext) parent).locateService("test.child/TestService1"); - fail("Expected " + ServiceUnavailableException.class.getName() - + " since [test.child/TestService1] is not an entry point"); - } catch (ServiceUnavailableException e) { - // should throw an exception since it is not an entry point - } - - // now expose the service as an entry point - // FIXME hack to get around initialization of component - just create another one ;-) - component = MockFactory.createSystemComponent("TestService1", ModuleScopeSystemComponentImpl.class, Scope.MODULE); - EntryPoint ep = MockFactory.createEPSystemBinding("TestService1EP", ModuleScopeSystemComponent.class, "TestService1", - component); - child.registerModelObject(ep); - Assert.assertNotNull(child.locateInstance("TestService1EP")); - Assert.assertNotNull(parent.locateInstance("test.child/TestService1EP")); - - // now expose the child entry point from the parent context - EntryPoint parentEp = MockFactory.createEntryPointWithStringRef("TestService1EP", ModuleScopeSystemComponent.class, - "TestService1", "test.child/TestService1EP"); - parent.registerModelObject(parentEp); - Assert.assertNotNull(parent.locateInstance("TestService1EP")); - - parent.fireEvent(EventContext.MODULE_STOP, null); - child.fireEvent(EventContext.MODULE_STOP, null); - parent.stop(); - } - - protected AggregateContext createContextHierachy() throws Exception { - List systemBuilders = MockFactory.createSystemBuilders(); - AggregateContext parent = new AggregateContextImpl("test.parent", null, new DefaultScopeStrategy(), - new EventContextImpl(), new MockConfigContext(systemBuilders), new NullMonitorFactory()); - Component component = MockFactory.createAggregateComponent("test.child"); - parent.registerModelObject(component); - parent.start(); - AggregateContext child = (AggregateContext) parent.getContext("test.child"); - Assert.assertNotNull(child); - return parent; - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/context/QualifiedNameTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/context/QualifiedNameTestCase.java deleted file mode 100644 index 4f86d1aed5..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/context/QualifiedNameTestCase.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context; - -import junit.framework.TestCase; - -/** - * Tests parsing of naming patters - * - * @version $Rev$ $Date$ - */ -public class QualifiedNameTestCase extends TestCase { - - public void testSimpleName() throws Exception { - QualifiedName name = new QualifiedName("Foo"); - assertEquals("Foo", name.getPartName()); - assertEquals(null, name.getPortName()); - } - - public void testCompoundName() throws Exception { - QualifiedName name = new QualifiedName("Foo/Bar"); - assertEquals("Foo", name.getPartName()); - assertEquals("Bar", name.getPortName()); - } - - public void testCompoundMultiName() throws Exception { - QualifiedName name = new QualifiedName("Foo/Bar/Baz"); - assertEquals("Foo", name.getPartName()); - assertEquals("Bar/Baz", name.getPortName()); - } - - public void testInvalidName() throws Exception { - try { - QualifiedName name = new QualifiedName("/Foo/Bar"); - fail("Invalid name exception not thrown"); - } catch (InvalidNameException e) { - - } - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/context/scope/DefaultScopeStrategyTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/context/scope/DefaultScopeStrategyTestCase.java deleted file mode 100644 index 2460d32793..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/context/scope/DefaultScopeStrategyTestCase.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.context.scope; - -import org.apache.tuscany.model.assembly.Scope; - -import junit.framework.Assert; -import junit.framework.TestCase; - -/** - * Basic scope strategy tests, including downscope referencing - * - * @version $Rev$ $Date$ - */ -public class DefaultScopeStrategyTestCase extends TestCase { - - public void testDownScopeReferences() throws Exception{ - DefaultScopeStrategy strategy = new DefaultScopeStrategy(); - - Assert.assertTrue(!strategy.downScopeReference(Scope.MODULE,Scope.MODULE)); - Assert.assertTrue(strategy.downScopeReference(Scope.MODULE,Scope.SESSION)); - Assert.assertTrue(strategy.downScopeReference(Scope.MODULE,Scope.REQUEST)); - Assert.assertTrue(strategy.downScopeReference(Scope.MODULE,Scope.INSTANCE)); - - Assert.assertTrue(!strategy.downScopeReference(Scope.SESSION,Scope.MODULE)); - Assert.assertTrue(!strategy.downScopeReference(Scope.SESSION,Scope.SESSION)); - Assert.assertTrue(strategy.downScopeReference(Scope.SESSION,Scope.REQUEST)); - Assert.assertTrue(strategy.downScopeReference(Scope.SESSION,Scope.INSTANCE)); - - Assert.assertTrue(!strategy.downScopeReference(Scope.REQUEST,Scope.MODULE)); - Assert.assertTrue(!strategy.downScopeReference(Scope.REQUEST,Scope.SESSION)); - Assert.assertTrue(!strategy.downScopeReference(Scope.REQUEST,Scope.REQUEST)); - Assert.assertTrue(strategy.downScopeReference(Scope.REQUEST,Scope.INSTANCE)); - - Assert.assertTrue(!strategy.downScopeReference(Scope.REQUEST,Scope.MODULE)); - Assert.assertTrue(!strategy.downScopeReference(Scope.REQUEST,Scope.SESSION)); - Assert.assertTrue(!strategy.downScopeReference(Scope.REQUEST,Scope.REQUEST)); - Assert.assertTrue(!strategy.downScopeReference(Scope.INSTANCE,Scope.INSTANCE)); - } -} - diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/injection/Bean1.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/injection/Bean1.java deleted file mode 100644 index b9bc3a1660..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/injection/Bean1.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.apache.tuscany.core.injection; - - -public class Bean1 extends SuperBean { - - public static final int ALL_BEAN1_FIELDS = 3 + ALL_SUPER_FIELDS; - - public static final int ALL__BEAN1_METHODS = 4 + ALL_SUPER_METHODS - 1; - - private String field1; - - public void setMethod1(String param) { - } - - public void setMethod1(int param) { - } - - public void override(String param) throws Exception { - } - - - public void noOverride(String param) throws Exception { - } - - -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/injection/ReflectionHelperTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/injection/ReflectionHelperTestCase.java deleted file mode 100644 index ca1f2012a5..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/injection/ReflectionHelperTestCase.java +++ /dev/null @@ -1,74 +0,0 @@ -package org.apache.tuscany.core.injection; - -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.Set; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.core.config.JavaIntrospectionHelper; - -public class ReflectionHelperTestCase extends TestCase { - - public ReflectionHelperTestCase() { - super(); - } - - public ReflectionHelperTestCase(String arg0) { - super(arg0); - } - - public void testGetSuperAllFields() throws Exception { - Set superBeanFields = JavaIntrospectionHelper.getAllFields(SuperBean.class); - Assert.assertEquals(SuperBean.ALL_SUPER_FIELDS, superBeanFields.size()); - } - - public void testBean1AllFields() throws Exception { - Set beanFields = JavaIntrospectionHelper.getAllFields(Bean1.class); - Assert.assertEquals(Bean1.ALL_BEAN1_FIELDS, beanFields.size()); - } - - public void testGetSuperAllMethods() throws Exception { - Set superBeanMethods = JavaIntrospectionHelper.getAllUniqueMethods(SuperBean.class); - Assert.assertEquals(SuperBean.ALL_SUPER_METHODS, superBeanMethods.size()); - } - - public void testGetBean1AllMethods() throws Exception { - Set beanMethods = JavaIntrospectionHelper.getAllUniqueMethods(Bean1.class); - Assert.assertEquals(Bean1.ALL__BEAN1_METHODS, beanMethods.size()); - } - - public void testOverrideMethod() throws Exception { - Set beanFields = JavaIntrospectionHelper.getAllUniqueMethods(Bean1.class); - boolean invoked = false; - for (Method method : beanFields) { - if (method.getName().equals("override")) { - method.invoke(new Bean1(), new Object[]{"foo"}); - invoked = true; - } - } - if (!invoked) { - throw new Exception("Override never invoked"); - } - } - - public void testNoOverrideMethod() throws Exception { - Set beanFields = JavaIntrospectionHelper.getAllUniqueMethods(Bean1.class); - boolean found = false; - for (Method method : beanFields) { - if (method.getName().equals("noOverride") && method.getParameterTypes().length == 0) { - found = true; - } - } - if (!found) { - throw new Exception("No override not found"); - } - } - - public void testGetBean1AllFields() throws Exception { - Set bean1 = JavaIntrospectionHelper.getAllFields(Bean1.class); - Assert.assertEquals(Bean1.ALL_BEAN1_FIELDS, bean1.size()); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/injection/SuperBean.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/injection/SuperBean.java deleted file mode 100644 index 5d88aeb1a8..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/injection/SuperBean.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.apache.tuscany.core.injection; - -/** - * @version $Rev$ $Date$ - */ -public class SuperBean { - - public static final int ALL_SUPER_FIELDS = 3; - - public static final int ALL_SUPER_METHODS = 4; - - private String superField1; - - public void setSuperMethod1(String param) { - } - - public void setSuperMethod1(int param) { - } - - public void override(String param) throws Exception { - throw new Exception("Override not handled"); - } - - public void noOverride() throws Exception { - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/InvocationConfigurationErrorTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/InvocationConfigurationErrorTestCase.java deleted file mode 100644 index 3d2fe482f1..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/InvocationConfigurationErrorTestCase.java +++ /dev/null @@ -1,158 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation; - -import java.lang.reflect.Method; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.core.invocation.impl.InvokerInterceptor; -import org.apache.tuscany.core.invocation.impl.MessageChannelImpl; -import org.apache.tuscany.core.invocation.mock.MockHandler; -import org.apache.tuscany.core.invocation.mock.MockStaticInvoker; -import org.apache.tuscany.core.invocation.mock.MockSyncInterceptor; -import org.apache.tuscany.core.invocation.mock.SimpleTarget; -import org.apache.tuscany.core.invocation.mock.SimpleTargetImpl; -import org.apache.tuscany.core.message.Message; -import org.apache.tuscany.core.message.MessageFactory; -import org.apache.tuscany.core.message.impl.MessageFactoryImpl; - -/** - * Tests error propagation through an innvocation - * - * @version $Rev$ $Date$ - */ -public class InvocationConfigurationErrorTestCase extends TestCase { - - - private Method hello; - private Method goodbye; - - private MessageFactory factory = new MessageFactoryImpl(); - - public InvocationConfigurationErrorTestCase() { - super(); - } - - public InvocationConfigurationErrorTestCase(String arg0) { - super(arg0); - } - - public void setUp() throws Exception { - hello = SimpleTarget.class.getMethod("hello", new Class[]{String.class}); - goodbye = SimpleTarget.class.getMethod("goodbye", new Class[]{String.class}); - } - - public void testInvokeWithHandlers() throws Exception{ - InvocationConfiguration source = new InvocationConfiguration(hello); - MockHandler sourceRequestHandler = new MockHandler(); - MockHandler sourceResponseHandler = new MockHandler(); - MockSyncInterceptor sourceInterceptor = new MockSyncInterceptor(); - source.addRequestHandler(sourceRequestHandler); - source.addResponseHandler(sourceResponseHandler); - source.addSourceInterceptor(sourceInterceptor); - - InvocationConfiguration target = new InvocationConfiguration(hello); - MockHandler targetRequestHandler = new MockHandler(); - MockHandler targetResponseHandler = new MockHandler(); - MockSyncInterceptor targetInterceptor = new MockSyncInterceptor(); - target.addRequestHandler(targetRequestHandler); - target.addResponseHandler(targetResponseHandler); - target.addTargetInterceptor(targetInterceptor); - target.addTargetInterceptor(new InvokerInterceptor()); - - // connect the source to the target - source.setTargetRequestChannel(new MessageChannelImpl(target.getRequestHandlers())); - source.setTargetResponseChannel(new MessageChannelImpl(target.getResponseHandlers())); - source.build(); - target.build(); - MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl()); - source.setTargetInvoker(invoker); - - Message msg = factory.createMessage(); - msg.setTargetInvoker(invoker); - Message response = (Message) source.getSourceInterceptor().invoke(msg); - Assert.assertTrue(response.getBody() instanceof IllegalArgumentException); - Assert.assertEquals(1,sourceRequestHandler.getCount()); - Assert.assertEquals(1,sourceResponseHandler.getCount()); - Assert.assertEquals(1,sourceInterceptor.getCount()); - Assert.assertEquals(1,targetRequestHandler.getCount()); - Assert.assertEquals(1,targetResponseHandler.getCount()); - Assert.assertEquals(1,targetInterceptor.getCount()); - } - - public void testInvokeWithRequestHandlers() throws Exception{ - InvocationConfiguration source = new InvocationConfiguration(hello); - MockHandler sourceRequestHandler = new MockHandler(); - MockSyncInterceptor sourceInterceptor = new MockSyncInterceptor(); - source.addRequestHandler(sourceRequestHandler); - source.addSourceInterceptor(sourceInterceptor); - - InvocationConfiguration target = new InvocationConfiguration(hello); - MockHandler targetRequestHandler = new MockHandler(); - MockSyncInterceptor targetInterceptor = new MockSyncInterceptor(); - target.addRequestHandler(targetRequestHandler); - target.addTargetInterceptor(targetInterceptor); - target.addTargetInterceptor(new InvokerInterceptor()); - - // connect the source to the target - source.setTargetRequestChannel(new MessageChannelImpl(target.getRequestHandlers())); - source.setTargetResponseChannel(new MessageChannelImpl(target.getResponseHandlers())); - source.build(); - target.build(); - MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl()); - source.setTargetInvoker(invoker); - - Message msg = factory.createMessage(); - msg.setTargetInvoker(invoker); - Message response = (Message) source.getSourceInterceptor().invoke(msg); - Assert.assertTrue(response.getBody() instanceof IllegalArgumentException); - Assert.assertEquals(1,sourceRequestHandler.getCount()); - Assert.assertEquals(1,sourceInterceptor.getCount()); - Assert.assertEquals(1,targetRequestHandler.getCount()); - Assert.assertEquals(1,targetInterceptor.getCount()); - } - - /** - * Tests basic wiring of a source to a target, including handlers and interceptors - */ - public void testInvokeWithInterceptorsOnly() throws Exception{ - InvocationConfiguration source = new InvocationConfiguration(hello); - MockSyncInterceptor sourceInterceptor = new MockSyncInterceptor(); - source.addSourceInterceptor(sourceInterceptor); - - InvocationConfiguration target = new InvocationConfiguration(hello); - MockSyncInterceptor targetInterceptor = new MockSyncInterceptor(); - target.addTargetInterceptor(targetInterceptor); - target.addTargetInterceptor(new InvokerInterceptor()); - - // connect the source to the target - source.addTargetInterceptor(target.getTargetInterceptor()); - source.build(); - target.build(); - MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl()); - source.setTargetInvoker(invoker); - - Message msg = factory.createMessage(); - msg.setTargetInvoker(invoker); - Message response = (Message) source.getSourceInterceptor().invoke(msg); - Assert.assertTrue(response.getBody() instanceof IllegalArgumentException); - Assert.assertEquals(1,sourceInterceptor.getCount()); - Assert.assertEquals(1,targetInterceptor.getCount()); - - } - -} - diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/InvocationConfigurationTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/InvocationConfigurationTestCase.java deleted file mode 100644 index 9e5fb80cad..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/InvocationConfigurationTestCase.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation; - -import java.lang.reflect.Method; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.core.invocation.impl.InvokerInterceptor; -import org.apache.tuscany.core.invocation.impl.MessageChannelImpl; -import org.apache.tuscany.core.invocation.mock.MockHandler; -import org.apache.tuscany.core.invocation.mock.MockStaticInvoker; -import org.apache.tuscany.core.invocation.mock.MockSyncInterceptor; -import org.apache.tuscany.core.invocation.mock.SimpleTarget; -import org.apache.tuscany.core.invocation.mock.SimpleTargetImpl; -import org.apache.tuscany.core.message.Message; -import org.apache.tuscany.core.message.MessageFactory; -import org.apache.tuscany.core.message.impl.MessageFactoryImpl; - -public class InvocationConfigurationTestCase extends TestCase { - - private Method hello; - - private Method goodbye; - - private MessageFactory factory = new MessageFactoryImpl(); - - public InvocationConfigurationTestCase() { - super(); - } - - public InvocationConfigurationTestCase(String arg0) { - super(arg0); - } - - public void setUp() throws Exception { - hello = SimpleTarget.class.getMethod("hello", new Class[] { String.class }); - goodbye = SimpleTarget.class.getMethod("goodbye", new Class[] { String.class }); - } - - /** - * Tests basic wiring of a source to a target, including handlers and interceptors - */ - public void testInvokeWithHandlers() throws Exception { - InvocationConfiguration source = new InvocationConfiguration(hello); - MockHandler sourceRequestHandler = new MockHandler(); - MockHandler sourceResponseHandler = new MockHandler(); - MockSyncInterceptor sourceInterceptor = new MockSyncInterceptor(); - source.addRequestHandler(sourceRequestHandler); - source.addResponseHandler(sourceResponseHandler); - source.addSourceInterceptor(sourceInterceptor); - - InvocationConfiguration target = new InvocationConfiguration(hello); - MockHandler targetRequestHandler = new MockHandler(); - MockHandler targetResponseHandler = new MockHandler(); - MockSyncInterceptor targetInterceptor = new MockSyncInterceptor(); - target.addRequestHandler(targetRequestHandler); - target.addResponseHandler(targetResponseHandler); - target.addTargetInterceptor(targetInterceptor); - target.addTargetInterceptor(new InvokerInterceptor()); - - // connect the source to the target - source.setTargetRequestChannel(new MessageChannelImpl(target.getRequestHandlers())); - source.setTargetResponseChannel(new MessageChannelImpl(target.getResponseHandlers())); - source.build(); - target.build(); - MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl()); - source.setTargetInvoker(invoker); - - Message msg = factory.createMessage(); - msg.setBody("foo"); - msg.setTargetInvoker(invoker); - Message response = (Message) source.getSourceInterceptor().invoke(msg); - Assert.assertEquals("foo", response.getBody()); - Assert.assertEquals(1, sourceRequestHandler.getCount()); - Assert.assertEquals(1, sourceResponseHandler.getCount()); - Assert.assertEquals(1, sourceInterceptor.getCount()); - Assert.assertEquals(1, targetRequestHandler.getCount()); - Assert.assertEquals(1, targetResponseHandler.getCount()); - Assert.assertEquals(1, targetInterceptor.getCount()); - } - - public void testInvokeWithRequestHandlers() throws Exception { - InvocationConfiguration source = new InvocationConfiguration(hello); - MockHandler sourceRequestHandler = new MockHandler(); - MockSyncInterceptor sourceInterceptor = new MockSyncInterceptor(); - source.addRequestHandler(sourceRequestHandler); - source.addSourceInterceptor(sourceInterceptor); - - InvocationConfiguration target = new InvocationConfiguration(hello); - MockHandler targetRequestHandler = new MockHandler(); - MockSyncInterceptor targetInterceptor = new MockSyncInterceptor(); - target.addRequestHandler(targetRequestHandler); - target.addTargetInterceptor(targetInterceptor); - target.addTargetInterceptor(new InvokerInterceptor()); - - // connect the source to the target - source.setTargetRequestChannel(new MessageChannelImpl(target.getRequestHandlers())); - source.setTargetResponseChannel(new MessageChannelImpl(target.getResponseHandlers())); - source.build(); - target.build(); - MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl()); - source.setTargetInvoker(invoker); - - Message msg = factory.createMessage(); - msg.setBody("foo"); - msg.setTargetInvoker(invoker); - Message response = (Message) source.getSourceInterceptor().invoke(msg); - Assert.assertEquals("foo", response.getBody()); - Assert.assertEquals(1, sourceRequestHandler.getCount()); - Assert.assertEquals(1, sourceInterceptor.getCount()); - Assert.assertEquals(1, targetRequestHandler.getCount()); - Assert.assertEquals(1, targetInterceptor.getCount()); - } - - /** - * Tests basic wiring of a source to a target, including handlers and interceptors - */ - public void testInvokeWithInterceptorsOnly() throws Exception { - InvocationConfiguration source = new InvocationConfiguration(hello); - MockSyncInterceptor sourceInterceptor = new MockSyncInterceptor(); - source.addSourceInterceptor(sourceInterceptor); - - InvocationConfiguration target = new InvocationConfiguration(hello); - MockSyncInterceptor targetInterceptor = new MockSyncInterceptor(); - target.addTargetInterceptor(targetInterceptor); - target.addTargetInterceptor(new InvokerInterceptor()); - - // connect the source to the target - source.addTargetInterceptor(target.getTargetInterceptor()); - source.build(); - target.build(); - MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl()); - source.setTargetInvoker(invoker); - - Message msg = factory.createMessage(); - msg.setBody("foo"); - msg.setTargetInvoker(invoker); - Message response = (Message) source.getSourceInterceptor().invoke(msg); - Assert.assertEquals("foo", response.getBody()); - Assert.assertEquals(1, sourceInterceptor.getCount()); - Assert.assertEquals(1, targetInterceptor.getCount()); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/InvocationErrorTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/InvocationErrorTestCase.java deleted file mode 100644 index 02929c9193..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/InvocationErrorTestCase.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; -import java.util.HashMap; -import java.util.Map; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.core.invocation.impl.InvokerInterceptor; -import org.apache.tuscany.core.invocation.jdk.JDKInvocationHandler; -import org.apache.tuscany.core.invocation.mock.MockHandler; -import org.apache.tuscany.core.invocation.mock.MockStaticInvoker; -import org.apache.tuscany.core.invocation.mock.MockSyncInterceptor; -import org.apache.tuscany.core.message.impl.MessageFactoryImpl; - -/** - * Tests handling of exceptions thrown during an invocation - * - * @version $Rev: 377006 $ $Date: 2006-02-11 09:41:59 -0800 (Sat, 11 Feb 2006) $ - */ -public class InvocationErrorTestCase extends TestCase { - - private Method checkedMethod; - private Method runtimeMethod; - - public InvocationErrorTestCase() { - super(); - } - - public InvocationErrorTestCase(String arg0) { - super(arg0); - } - - public void setUp() throws Exception { - checkedMethod = TestBean.class.getDeclaredMethod("checkedException", (Class[]) null); - runtimeMethod = TestBean.class.getDeclaredMethod("runtimeException", (Class[]) null); - Assert.assertNotNull(checkedMethod); - Assert.assertNotNull(runtimeMethod); - } - - public void testCheckedException() throws Exception { - Map config = new MethodHashMap(); - config.put(checkedMethod, getConfiguration(checkedMethod)); - InvocationHandler handler = new JDKInvocationHandler(new MessageFactoryImpl(), config); - try { - TestBean proxy = (TestBean) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), - new Class[]{TestBean.class}, handler); - proxy.checkedException(); - } catch (TestException e) { - return; - } - Assert.fail(TestException.class.getName() + " should have been thrown"); - } - - public void testRuntimeException() throws Exception { - Map config = new MethodHashMap(); - config.put(runtimeMethod, getConfiguration(runtimeMethod)); - InvocationHandler handler = new JDKInvocationHandler(new MessageFactoryImpl(), config); - try { - TestBean proxy = (TestBean) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), - new Class[]{TestBean.class}, handler); - proxy.runtimeException(); - } catch (TestRuntimeException e) { - return; - } - Assert.fail(TestException.class.getName() + " should have been thrown"); - } - - private InvocationConfiguration getConfiguration(Method m) { - MockStaticInvoker invoker = new MockStaticInvoker(m, new TestBeanImpl()); - InvocationConfiguration invocationConfiguration=new InvocationConfiguration(m); - invocationConfiguration.addSourceInterceptor(new MockSyncInterceptor()); - invocationConfiguration.addRequestHandler(new MockHandler()); - invocationConfiguration.setTargetInvoker(invoker); - invocationConfiguration.addTargetInterceptor(new InvokerInterceptor()); - invocationConfiguration.build(); - return invocationConfiguration; - } - - public interface TestBean { - - public void checkedException() throws TestException; - - public void runtimeException() throws TestRuntimeException; - - } - - public class TestBeanImpl implements TestBean { - - public void checkedException() throws TestException { - throw new TestException(); - } - - public void runtimeException() throws TestRuntimeException { - throw new TestRuntimeException(); - } - } - - public class TestException extends Exception { - } - - public class TestRuntimeException extends RuntimeException { - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/jdk/JDKInvocationHandlerTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/jdk/JDKInvocationHandlerTestCase.java deleted file mode 100644 index 758134fbba..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/jdk/JDKInvocationHandlerTestCase.java +++ /dev/null @@ -1,112 +0,0 @@ -package org.apache.tuscany.core.invocation.jdk; - -import java.lang.reflect.Method; -import java.util.Map; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.MethodHashMap; -import org.apache.tuscany.core.invocation.impl.InvokerInterceptor; -import org.apache.tuscany.core.invocation.impl.MessageChannelImpl; -import org.apache.tuscany.core.invocation.mock.MockHandler; -import org.apache.tuscany.core.invocation.mock.MockStaticInvoker; -import org.apache.tuscany.core.invocation.mock.MockSyncInterceptor; -import org.apache.tuscany.core.invocation.mock.SimpleTarget; -import org.apache.tuscany.core.invocation.mock.SimpleTargetImpl; -import org.apache.tuscany.core.message.impl.MessageFactoryImpl; - -public class JDKInvocationHandlerTestCase extends TestCase { - - private Method hello; - - private Method goodbye; - - public JDKInvocationHandlerTestCase() { - super(); - } - - public JDKInvocationHandlerTestCase(String arg0) { - super(arg0); - } - - public void setUp() throws Exception { - hello = SimpleTarget.class.getMethod("hello", new Class[] { String.class }); - goodbye = SimpleTarget.class.getMethod("goodbye", new Class[] { String.class }); - } - - public void testBasicInvoke() throws Throwable { - Map configs = new MethodHashMap(); - configs.put(hello, getInvocationHandler(hello)); - JDKInvocationHandler handler = new JDKInvocationHandler(new MessageFactoryImpl(), configs); - Assert.assertEquals("foo", handler.invoke(null, hello, new Object[] { "foo" })); - } - - public void testErrorInvoke() throws Throwable { - Map configs = new MethodHashMap(); - configs.put(hello, getInvocationHandler(hello)); - JDKInvocationHandler handler = new JDKInvocationHandler(new MessageFactoryImpl(), configs); - try { - Assert.assertEquals("foo", handler.invoke(null, hello, new Object[] {})); - fail("Expected " + IllegalArgumentException.class.getName()); - } catch (IllegalArgumentException e) { - // should throw - } - } - - public void testDirectErrorInvoke() throws Throwable { - InvocationConfiguration source = new InvocationConfiguration(hello); - MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl()); - source.setTargetInvoker(invoker); - - Map configs = new MethodHashMap(); - configs.put(hello, source); - JDKInvocationHandler handler = new JDKInvocationHandler(new MessageFactoryImpl(), configs); - try { - Assert.assertEquals("foo", handler.invoke(null, hello, new Object[] {})); - fail("Expected " + IllegalArgumentException.class.getName()); - } catch (IllegalArgumentException e) { - // should throw - } - } - - public void testDirectInvoke() throws Throwable { - InvocationConfiguration source = new InvocationConfiguration(hello); - MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl()); - source.setTargetInvoker(invoker); - - Map configs = new MethodHashMap(); - configs.put(hello, source); - JDKInvocationHandler handler = new JDKInvocationHandler(new MessageFactoryImpl(), configs); - Assert.assertEquals("foo", handler.invoke(null, hello, new Object[] { "foo" })); - } - - private InvocationConfiguration getInvocationHandler(Method m) { - InvocationConfiguration source = new InvocationConfiguration(m); - MockHandler sourceRequestHandler = new MockHandler(); - MockHandler sourceResponseHandler = new MockHandler(); - MockSyncInterceptor sourceInterceptor = new MockSyncInterceptor(); - source.addRequestHandler(sourceRequestHandler); - source.addResponseHandler(sourceResponseHandler); - source.addSourceInterceptor(sourceInterceptor); - - InvocationConfiguration target = new InvocationConfiguration(m); - MockHandler targetRequestHandler = new MockHandler(); - MockHandler targetResponseHandler = new MockHandler(); - MockSyncInterceptor targetInterceptor = new MockSyncInterceptor(); - target.addRequestHandler(targetRequestHandler); - target.addResponseHandler(targetResponseHandler); - target.addTargetInterceptor(targetInterceptor); - target.addTargetInterceptor(new InvokerInterceptor()); - - // connect the source to the target - source.setTargetRequestChannel(new MessageChannelImpl(target.getRequestHandlers())); - source.setTargetResponseChannel(new MessageChannelImpl(target.getResponseHandlers())); - source.build(); - target.build(); - MockStaticInvoker invoker = new MockStaticInvoker(m, new SimpleTargetImpl()); - source.setTargetInvoker(invoker); - return source; - } -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/jdk/JDKProxyFactoryTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/jdk/JDKProxyFactoryTestCase.java deleted file mode 100644 index 98853a1469..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/jdk/JDKProxyFactoryTestCase.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation.jdk; - -import java.lang.reflect.Method; -import java.util.Map; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.invocation.InvocationConfiguration; -import org.apache.tuscany.core.invocation.MethodHashMap; -import org.apache.tuscany.core.invocation.ProxyConfiguration; -import org.apache.tuscany.core.invocation.impl.InvokerInterceptor; -import org.apache.tuscany.core.invocation.mock.MockStaticInvoker; -import org.apache.tuscany.core.invocation.mock.MockSyncInterceptor; -import org.apache.tuscany.core.invocation.mock.SimpleTarget; -import org.apache.tuscany.core.invocation.mock.SimpleTargetImpl; -import org.apache.tuscany.core.message.impl.MessageFactoryImpl; - -public class JDKProxyFactoryTestCase extends TestCase { - - private Method hello; - - private Method goodbye; - - public JDKProxyFactoryTestCase(String arg0) { - super(arg0); - } - - public void setUp() throws Exception { - hello = SimpleTarget.class.getMethod("hello", new Class[] { String.class }); - goodbye = SimpleTarget.class.getMethod("goodbye", new Class[] { String.class }); - } - - public void testProxyFactory() throws Exception { - InvocationConfiguration source = new InvocationConfiguration(hello); - MockSyncInterceptor sourceInterceptor = new MockSyncInterceptor(); - source.addSourceInterceptor(sourceInterceptor); - source.addTargetInterceptor(new InvokerInterceptor()); - source.setTargetInvoker(new MockStaticInvoker(hello, new SimpleTargetImpl())); - source.build(); - Map configs = new MethodHashMap(); - configs.put(hello, source); - ProxyConfiguration config = new ProxyConfiguration(new QualifiedName("foo"), configs, Thread.currentThread() - .getContextClassLoader(), new MessageFactoryImpl()); - JDKProxyFactory factory = new JDKProxyFactory(); - factory.setProxyConfiguration(config); - factory.setBusinessInterface(SimpleTarget.class); - factory.initialize(); - SimpleTarget instance = (SimpleTarget) factory.createProxy(); - Assert.assertEquals("foo",instance.hello("foo")); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/MockHandler.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/MockHandler.java deleted file mode 100644 index ec52bee002..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/MockHandler.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - */ -package org.apache.tuscany.core.invocation.mock; - -import org.apache.tuscany.core.invocation.MessageHandler; -import org.apache.tuscany.core.message.Message; - -/** - * - */ -public class MockHandler implements MessageHandler { - - private int count =0; - - public boolean processMessage(Message message) { - //System.out.println("Invoking handler"); - count++; - return true; - } - - public int getCount(){ - return count; - } -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/MockScopeContext.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/MockScopeContext.java deleted file mode 100644 index ec8a95d4be..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/MockScopeContext.java +++ /dev/null @@ -1,136 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation.mock; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.EventException; -import org.apache.tuscany.core.context.QualifiedName; -import org.apache.tuscany.core.context.LifecycleEventListener; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.context.ScopeRuntimeException; -import org.apache.tuscany.core.context.SimpleComponentContext; -import org.apache.tuscany.core.context.TargetException; -import org.apache.tuscany.model.assembly.SimpleComponent; - -public class MockScopeContext implements ScopeContext { - - Map components; - - public MockScopeContext() { - components = new HashMap(); - components.put("foo", new SimpleTargetImpl()); - components.put("bar", new SimpleTargetImpl()); - } - - public MockScopeContext(Map instances) { - components = instances; - } - - - public void start() { - } - - public void stop() { - } - - public String getName() { - return "Mock Scope Container"; - } - - public boolean isCacheable() { - return false; - } - - public int[] getEventTypes() { - return null; - } - - public SimpleComponentContext getContext(String name) { - return null; - } - - public Object getInstance(QualifiedName name) throws ScopeRuntimeException { - return components.get(name.getPartName()); - } - - public Object getInstance(QualifiedName componentName, boolean notify) throws TargetException { - return getInstance(componentName); - } - - public SimpleComponentContext getContextByKey(String name, Object key) { - return null; - } - - public void setComponent(SimpleComponent component) throws ScopeRuntimeException { - } - - public void removeContext(String name) throws ScopeRuntimeException { - } - - public void removeContextByKey(String name, Object key) throws ScopeRuntimeException { - } - - public SimpleComponent[] getComponents() { - return null; - } - - public void onEvent(int type, Object message) throws EventException { - } - - - public void registerConfigurations(List> configurations) { - } - - public void registerConfiguration(RuntimeConfiguration configuration) { - } - - public int getLifecycleState(){ - return RUNNING; - } - - - public void setLifecycleState(int state) { - } - - - public void setName(String name) { - } - - - public void addContextListener(LifecycleEventListener listener) { - } - - - public void removeContextListener(LifecycleEventListener listener) { - } - - public Object getImplementationInstance() throws TargetException{ - return this; - } - - public Object getImplementationInstance(boolean notify) throws TargetException{ - return this; - } - - -} - diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/MockStaticInvoker.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/MockStaticInvoker.java deleted file mode 100644 index 27b3594ab7..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/MockStaticInvoker.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.apache.tuscany.core.invocation.mock; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import org.apache.tuscany.core.invocation.Interceptor; -import org.apache.tuscany.core.invocation.InvocationRuntimeException; -import org.apache.tuscany.core.invocation.TargetInvoker; -import org.apache.tuscany.core.message.Message; - -/** - * Caches component instances that do not need to be resolved for every invocation, e.g. an invocation originating from - * a lesser scope intended for a target with a wider scope - * - * @version $Rev: 377006 $ $Date: 2006-02-11 09:41:59 -0800 (Sat, 11 Feb 2006) $ - */ -public class MockStaticInvoker implements TargetInvoker { - - private Object instance; - - private Method operation; - - public MockStaticInvoker(Method operation, Object instance) { - this.operation = operation; - this.instance = instance; - } - - public boolean isCacheable() { - return true; - } - - public Object invokeTarget(Object payload) throws InvocationTargetException { - try { - if (payload != null && !payload.getClass().isArray()) { - return operation.invoke(instance, payload); - } else { - return operation.invoke(instance, (Object[]) payload); - } - } catch (IllegalAccessException e) { - throw new InvocationRuntimeException(e); - } - } - - public Message invoke(Message msg) { - try { - Object resp = invokeTarget(msg.getBody()); - msg.setBody(resp); - } catch (InvocationTargetException e) { - msg.setBody(e.getCause()); - } catch (Throwable e) { - msg.setBody(e); - } - return msg; - } - - public void setNext(Interceptor next) { - throw new IllegalStateException("This interceptor must be the last interceptor in an interceptor chain"); - } - - public Object clone() { - try { - MockStaticInvoker invoker = (MockStaticInvoker) super.clone(); - invoker.instance = this.instance; - invoker.operation = this.operation; - return invoker; - } catch (CloneNotSupportedException e) { - return null; // will not happen - } - } -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/MockSyncInterceptor.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/MockSyncInterceptor.java deleted file mode 100644 index 120b7654cd..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/MockSyncInterceptor.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation.mock; - -import org.apache.tuscany.core.invocation.Interceptor; -import org.apache.tuscany.core.message.Message; - -public class MockSyncInterceptor implements Interceptor { - - private int count; - - private Interceptor next; - - public MockSyncInterceptor() { - } - - public Message invoke(Message msg) { - ++count; - //System.out.println("Invoking interceptor"); - return next.invoke(msg); - } - - public int getCount() { - return count; - } - - public void setNext(Interceptor next) { - this.next=next; - } -} - diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/SimpleSource.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/SimpleSource.java deleted file mode 100644 index 5a68024f2a..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/SimpleSource.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation.mock; - -public interface SimpleSource { - - public void invokeHello() throws Exception; - - public void invokeGoodbye() throws Exception; -} - diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/SimpleSourceImpl.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/SimpleSourceImpl.java deleted file mode 100644 index 51025ba3a0..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/SimpleSourceImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation.mock; - -public class SimpleSourceImpl implements SimpleSource { - - private SimpleTarget proxy; - - public SimpleSourceImpl(SimpleTarget proxy) { - this.proxy = proxy; - } - - public void invokeHello() throws Exception { - proxy.hello("hello"); - } - - public void invokeGoodbye() throws Exception { - proxy.goodbye("hello"); - } - -} - diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/SimpleTarget.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/SimpleTarget.java deleted file mode 100644 index e4aabd72a2..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/SimpleTarget.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation.mock; - -public interface SimpleTarget { - - public String hello(String message) throws Exception; - - public String goodbye(String message) throws Exception; - - public String echo(String message) throws Exception; - -} - diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/SimpleTargetImpl.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/SimpleTargetImpl.java deleted file mode 100644 index 16f70c020f..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/SimpleTargetImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.invocation.mock; - -public class SimpleTargetImpl implements SimpleTarget { - - public SimpleTargetImpl() { - super(); - } - - public String hello(String message) throws Exception { - return message; - } - - public String goodbye(String message) throws Exception { - return message; - } - - public String echo(String message) throws Exception { - return message; - } - - -} - diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/mock/MockConfigContext.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/mock/MockConfigContext.java deleted file mode 100644 index f7ed7654d6..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/mock/MockConfigContext.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.mock; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.core.builder.BuilderConfigException; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.builder.impl.AssemblyVisitor; -import org.apache.tuscany.core.config.ConfigurationException; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.ConfigurationContext; -import org.apache.tuscany.core.context.ScopeContext; -import org.apache.tuscany.core.invocation.spi.ProxyFactory; -import org.apache.tuscany.model.assembly.Extensible; - -/** - * A mock configuration context - * - * @version $Rev$ $Date$ - */ -public class MockConfigContext implements ConfigurationContext { - - private List builders = new ArrayList(); - - public MockConfigContext(List builders) { - this.builders=builders; - } - - public void configure(Extensible model) throws ConfigurationException { - } - - public void build(AggregateContext parent, Extensible model) throws BuilderConfigException { - AssemblyVisitor visitor = new AssemblyVisitor(parent, builders); - visitor.start(model); - } - - public void wire(ProxyFactory sourceFactory, ProxyFactory targetFactory, Class targetType, boolean downScope, ScopeContext targetScopeContext) throws BuilderConfigException { - } - - public void wire(ProxyFactory targetFactory, Class targetType, ScopeContext targetScopeContext) throws BuilderConfigException { - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/mock/MockFactory.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/mock/MockFactory.java deleted file mode 100644 index dca6e337f1..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/mock/MockFactory.java +++ /dev/null @@ -1,329 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.mock; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.impl.AggregateContextImpl; -import org.apache.tuscany.core.mock.component.ModuleScopeSystemComponent; -import org.apache.tuscany.core.mock.component.ModuleScopeSystemComponentImpl; -import org.apache.tuscany.core.system.assembly.SystemAssemblyFactory; -import org.apache.tuscany.core.system.assembly.SystemBinding; -import org.apache.tuscany.core.system.assembly.SystemImplementation; -import org.apache.tuscany.core.system.assembly.impl.SystemAssemblyFactoryImpl; -import org.apache.tuscany.core.system.builder.SystemComponentContextBuilder; -import org.apache.tuscany.core.system.builder.SystemEntryPointBuilder; -import org.apache.tuscany.core.system.builder.SystemExternalServiceBuilder; -import org.apache.tuscany.core.system.context.SystemAggregateContextImpl; -import org.apache.tuscany.model.assembly.AggregatePart; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.ConfiguredReference; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.ExternalService; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.Reference; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.Service; -import org.apache.tuscany.model.assembly.SimpleComponent; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; -import org.apache.tuscany.model.types.java.JavaServiceContract; - -/** - * Generates test components, modules, and runtime artifacts - * - * @version $Rev$ $Date$ - */ -public class MockFactory { - - private static SystemAssemblyFactory systemFactory = new SystemAssemblyFactoryImpl(); - - private static AssemblyModelContext assemblyContext = new AssemblyModelContextImpl(systemFactory, null, null); - - private MockFactory() { - } - - - /** - * Creates a system component of the given type with the given name and scope - */ - public static Component createSystemComponent(String name, Class type, Scope scope) { - - Component sc = null; - if (AggregateContext.class.isAssignableFrom(type)) { - sc = systemFactory.createModuleComponent(); - } else { - sc = systemFactory.createSimpleComponent(); - } - SystemImplementation impl = systemFactory.createSystemImplementation(); - impl.setImplementationClass(type); - sc.setComponentImplementation(impl); - Service s = systemFactory.createService(); - JavaServiceContract ji = systemFactory.createJavaServiceContract(); - s.setServiceContract(ji); - ji.setScope(scope); - impl.setComponentType(systemFactory.createComponentType()); - impl.getComponentType().getServices().add(s); - sc.setName(name); - sc.setComponentImplementation(impl); - return sc; - } - - /** - * Creates an aggregate component with the given name - */ - public static Component createAggregateComponent(String name) { - Component sc = sc = systemFactory.createModuleComponent(); - SystemImplementation impl = systemFactory.createSystemImplementation(); - impl.setImplementationClass(AggregateContextImpl.class); - sc.setComponentImplementation(impl); - Service s = systemFactory.createService(); - JavaServiceContract ji = systemFactory.createJavaServiceContract(); - s.setServiceContract(ji); - ji.setScope(Scope.AGGREGATE); - impl.setComponentType(systemFactory.createComponentType()); - impl.getComponentType().getServices().add(s); - sc.setName(name); - sc.setComponentImplementation(impl); - return sc; - } - - /** - * Creates an aggregate component with the given name - */ - public static Component createSystemAggregateComponent(String name) { - Component sc = sc = systemFactory.createModuleComponent(); - SystemImplementation impl = systemFactory.createSystemImplementation(); - impl.setImplementationClass(SystemAggregateContextImpl.class); - sc.setComponentImplementation(impl); - Service s = systemFactory.createService(); - JavaServiceContract ji = systemFactory.createJavaServiceContract(); - s.setServiceContract(ji); - ji.setScope(Scope.AGGREGATE); - impl.setComponentType(systemFactory.createComponentType()); - impl.getComponentType().getServices().add(s); - sc.setName(name); - sc.setComponentImplementation(impl); - return sc; - } - - /** - * Creates and initializes a system component of the given type with the given name and scope - */ - public static Component createSystemInitializedComponent(String name, Class type, Scope scope) { - Component sc = createSystemComponent(name,type,scope); - sc.initialize(assemblyContext); - return sc; - } - - /** - * Creates a basic entry point with no configured reference using the system binding - * - * @param name the name of the entry point - * @param interfaz the inteface exposed by the entry point - * @param refName the name of the entry point reference - */ - public static EntryPoint createEPSystemBinding(String name, Class interfaz, String refName) { - return createEPSystemBinding(name, interfaz, refName, null); - } - - /** - * Creates an entry point wired to the given target (e.g. component, external service) using the system binding - * - * @param name the name of the entry point - * @param interfaz the inteface exposed by the entry point - * @param refName the name of the entry point reference - * @param target the target the entry point is wired to - */ - public static EntryPoint createEPSystemBinding(String name, Class interfaz, String refName, AggregatePart target) { - JavaServiceContract contract = systemFactory.createJavaServiceContract(); - contract.setInterface(interfaz); - - EntryPoint ep = systemFactory.createEntryPoint(); - ep.setName(name); - - Reference ref = systemFactory.createReference(); - ref.setName(refName); - ref.setServiceContract(contract); - ConfiguredReference configuredReference = systemFactory.createConfiguredReference(); - configuredReference.setReference(ref); - Service service = systemFactory.createService(); - service.setServiceContract(contract); - - ConfiguredService cService = systemFactory.createConfiguredService(); - cService.setService(service); - cService.initialize(assemblyContext); - - configuredReference.getTargetConfiguredServices().add(cService); - ep.setConfiguredReference(configuredReference); - - Service epService = systemFactory.createService(); - epService.setServiceContract(contract); - - ConfiguredService epCService = systemFactory.createConfiguredService(); - epCService.initialize(assemblyContext); - epCService.setService(epService); - - ep.setConfiguredService(epCService); - SystemBinding binding = systemFactory.createSystemBinding(); - ep.getBindings().add(binding); - if (target != null) { - if (target instanceof Component) { - ((Component) target).getConfiguredServices().add(cService); - // cService. - } else if (target instanceof ExternalService) { - ((ExternalService) target).setConfiguredService(cService); - } - target.initialize(assemblyContext); - } - ep.initialize(null); - return ep; - } - - /** - * Creates an entry point that should be wired to the given target (e.g. component, external service) using the - * system binding. The system assembly process should resolve the target name to an actual target configuration. - * - * @param name the name of the entry point - * @param interfaz the inteface exposed by the entry point - * @param refName the name of the entry point reference - * @param componentName the name of the target to resolve - */ - public static EntryPoint createEntryPointWithStringRef(String name, Class interfaz, String refName, String componentName) { - EntryPoint ep = createEPSystemBinding(name, interfaz, refName, null); - ConfiguredReference cRef = systemFactory.createConfiguredReference(); - Reference ref = systemFactory.createReference(); - cRef.setReference(ref); - Service service = systemFactory.createService(); - service.setName(componentName); - ConfiguredService cService = systemFactory.createConfiguredService(); - cService.setService(service); - cRef.getTargetConfiguredServices().add(cService); - cRef.initialize(assemblyContext); - cService.initialize(assemblyContext); - ep.setConfiguredReference(cRef); - ep.initialize(assemblyContext); - return ep; - } - - /** - * Creates an external service configured with a {@link SystemBinding} - */ - public static ExternalService createESSystemBinding(String name, String refName) { - ExternalService es = systemFactory.createExternalService(); - es.setName(name); - ConfiguredService configuredService = systemFactory.createConfiguredService(); - es.setConfiguredService(configuredService); - SystemBinding binding = systemFactory.createSystemBinding(); - binding.setTargetName(refName); - es.getBindings().add(binding); - es.initialize(null); - return es; - } - - /** - * Creates an external service that specifies an autowire of the given type - */ - public static ExternalService createAutowirableExternalService(String name, Class type) { - ExternalService es = systemFactory.createExternalService(); - es.setName(name); - JavaServiceContract inter = systemFactory.createJavaServiceContract(); - inter.setInterface(type); - Service service = systemFactory.createService(); - service.setServiceContract(inter); - ConfiguredService cService = systemFactory.createConfiguredService(); - cService.setService(service); - cService.initialize(assemblyContext); - es.setConfiguredService(cService); - es.getBindings().add(systemFactory.createSystemBinding()); - es.initialize(null); - return es; - } - - /** - * Creates a test system module component with a module-scoped component and entry point - */ - public static Module createSystemModule(){ - Module module = systemFactory.createModule(); - module.setName("system.module"); - - // create test component - SimpleComponent component = systemFactory.createSimpleComponent(); - component.setName("TestService1"); - SystemImplementation impl = systemFactory.createSystemImplementation(); - impl.setComponentType(systemFactory.createComponentType()); - impl.setImplementationClass(ModuleScopeSystemComponentImpl.class); - component.setComponentImplementation(impl); - Service s = systemFactory.createService(); - JavaServiceContract contract = systemFactory.createJavaServiceContract(); - s.setServiceContract(contract); - contract.setScope(Scope.MODULE); - impl.getComponentType().getServices().add(s); - component.setComponentImplementation(impl); - - // create the entry point - EntryPoint ep = createEPSystemBinding("TestService1EP", ModuleScopeSystemComponent.class, "target", component); - - module.getEntryPoints().add(ep); - module.getComponents().add(component); - module.initialize(assemblyContext); - return module; - } - - /** - * Creates a test system module component with a module-scoped component and entry point - */ - public static Module createSystemChildModule() { - Module module = systemFactory.createModule(); - module.setName("system.test.module"); - - // create test component - SimpleComponent component = systemFactory.createSimpleComponent(); - component.setName("TestService2"); - SystemImplementation impl = systemFactory.createSystemImplementation(); - impl.setImplementationClass(ModuleScopeSystemComponentImpl.class); - component.setComponentImplementation(impl); - Service s = systemFactory.createService(); - JavaServiceContract ji = systemFactory.createJavaServiceContract(); - s.setServiceContract(ji); - ji.setScope(Scope.MODULE); - impl.setComponentType(systemFactory.createComponentType()); - impl.getComponentType().getServices().add(s); - component.setComponentImplementation(impl); - - // create the entry point - EntryPoint ep = createEPSystemBinding("TestService2EP", ModuleScopeSystemComponent.class, "target", component); - - module.getEntryPoints().add(ep); - module.getComponents().add(component); - module.initialize(assemblyContext); - return module; - } - - /** - * Returns a collection of bootstrap configuration builders - */ - public static List createSystemBuilders() { - List builders = new ArrayList(); - builders.add((new SystemComponentContextBuilder())); - builders.add(new SystemEntryPointBuilder()); - builders.add(new SystemExternalServiceBuilder()); - return builders; - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/mock/component/GenericSystemComponent.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/mock/component/GenericSystemComponent.java deleted file mode 100644 index 99aeb1b8f3..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/mock/component/GenericSystemComponent.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.apache.tuscany.core.mock.component; - -public interface GenericSystemComponent { - -} - diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/mock/component/ModuleScopeSystemComponent.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/mock/component/ModuleScopeSystemComponent.java deleted file mode 100644 index dabbd9e4ef..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/mock/component/ModuleScopeSystemComponent.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.mock.component; - -import org.osoa.sca.annotations.Scope; - -/** - * @version $Rev$ $Date$ - */ -@Scope("MODULE") -public interface ModuleScopeSystemComponent extends GenericSystemComponent { - -} - diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/mock/component/ModuleScopeSystemComponentImpl.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/mock/component/ModuleScopeSystemComponentImpl.java deleted file mode 100644 index 58afde9354..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/mock/component/ModuleScopeSystemComponentImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.mock.component; - -/** - * @version $Rev$ $Date$ - */ -public class ModuleScopeSystemComponentImpl implements ModuleScopeSystemComponent { - - -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeBootTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeBootTestCase.java deleted file mode 100644 index a0af27f563..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeBootTestCase.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.runtime; - -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.common.monitor.impl.NullMonitorFactory; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.mock.MockFactory; - -/** - * Tests runtime boot scenarios - * - * @version $Rev$ $Date$ - */ -public class RuntimeBootTestCase extends TestCase { - private RuntimeContext runtime; - - public void testContextParents() { - AggregateContext rootContext = runtime.getRootContext(); - assertNotNull(rootContext); - assertEquals("tuscany.root", rootContext.getName()); - assertSame(runtime, rootContext.getParent()); - assertSame(rootContext, runtime.getContext("tuscany.root")); - - AggregateContext systemContext = runtime.getSystemContext(); - assertNotNull(systemContext); - assertEquals("tuscany.system", systemContext.getName()); - assertSame(runtime, systemContext.getParent()); - assertSame(systemContext, runtime.getContext("tuscany.system")); - } - - public void testRuntimeLifecycle() { - assertEquals(Context.RUNNING, runtime.getLifecycleState()); - runtime.stop(); - - assertEquals(Context.STOPPED, runtime.getLifecycleState()); - - runtime.start(); - assertEquals(Context.RUNNING, runtime.getLifecycleState()); - } - - public void testIncrementalBoot() throws Exception{ - - List builders = MockFactory.createSystemBuilders(); - // start the runtime context - RuntimeContext runtimeContext = new RuntimeContextImpl(new NullMonitorFactory(), null, builders, null); - runtimeContext.start(); - - AggregateContext system = runtimeContext.getSystemContext(); - Assert.assertNotNull(system); - // register system components - system.registerModelObject(MockFactory.createSystemModule()); - // start the module scope - system.fireEvent(EventContext.MODULE_START, null); - // register the first module - - // register the second module - - // start the modules - - system.fireEvent(EventContext.MODULE_STOP, null); - runtimeContext.stop(); - Assert.assertEquals(Context.STOPPED,system.getLifecycleState()); - } - - protected void setUp() throws Exception { - super.setUp(); - - runtime = new RuntimeContextImpl(); - runtime.start(); - } - - protected void tearDown() throws Exception { - runtime.stop(); - super.tearDown(); - } -} - diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeContextImplTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeContextImplTestCase.java deleted file mode 100644 index 0ea1ad7bb8..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeContextImplTestCase.java +++ /dev/null @@ -1,305 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.runtime; - -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.common.monitor.impl.NullMonitorFactory; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.config.ConfigurationException; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.impl.AggregateContextImpl; -import org.apache.tuscany.core.mock.MockFactory; -import org.apache.tuscany.core.mock.component.ModuleScopeSystemComponent; -import org.apache.tuscany.core.mock.component.ModuleScopeSystemComponentImpl; -import org.apache.tuscany.core.system.assembly.SystemAssemblyFactory; -import org.apache.tuscany.core.system.assembly.impl.SystemAssemblyFactoryImpl; -import org.apache.tuscany.core.system.context.TestBuilder; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.ExternalService; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.Service; -import org.apache.tuscany.model.types.java.JavaServiceContract; -import org.osoa.sca.ServiceUnavailableException; - -/** - * Performs basic tests on the runtime context - * - * @version $Rev$ $Date$ - */ -public class RuntimeContextImplTestCase extends TestCase { - - private SystemAssemblyFactory systemFactory = new SystemAssemblyFactoryImpl(); - - private List builders; - - /** - * Tests explicit wiring of an external service to a system entry point that is wired to a child system module entry - * point - */ - public void testSystemExplicitWiring() throws Exception { - RuntimeContext runtime = new RuntimeContextImpl(new NullMonitorFactory(), null, builders, null); - runtime.start(); - - AggregateContext root = runtime.getRootContext(); - Assert.assertNotNull(root); - Assert.assertTrue(root.getLifecycleState() == Context.RUNNING); - - AggregateContext system = runtime.getSystemContext(); - Assert.assertNotNull(system); - system.registerModelObject(MockFactory.createSystemModule()); - - // register a child system context - system.registerModelObject(MockFactory.createSystemAggregateComponent("system.child")); - AggregateContext systemChild = (AggregateContext) system.getContext("system.child"); - systemChild.registerModelObject(MockFactory.createSystemChildModule()); - - // register a top-level system entry point that exposes the child entry point - EntryPoint ep = MockFactory.createEPSystemBinding("TestService2EP", ModuleScopeSystemComponent.class, "ref"); - ep.getBindings().add(systemFactory.createSystemBinding()); - Service service = systemFactory.createService(); - service.setName("system.child/TestService2EP"); - ((ConfiguredService) ep.getConfiguredReference().getTargetConfiguredServices().get(0)).setService(service); - JavaServiceContract inter = systemFactory.createJavaServiceContract(); - inter.setInterface(ModuleScopeSystemComponentImpl.class); - service.setServiceContract(inter); - system.registerModelObject(ep); - system.fireEvent(EventContext.MODULE_START, null); - Assert.assertNotNull(system.locateInstance("TestService1")); - Assert.assertNotNull(system.locateInstance("TestService2EP")); - - // create a test module and wire an external service to the system entry point - Component moduleComponent = MockFactory.createAggregateComponent("test.module"); - runtime.registerModelObject(moduleComponent); - AggregateContextImpl moduleContext = (AggregateContextImpl) runtime.getContext("test.module"); - Assert.assertNotNull(moduleContext); - ExternalService es = MockFactory.createESSystemBinding("TestService2ES", "tuscany.system/TestService2EP"); - moduleContext.registerModelObject(es); - moduleContext.fireEvent(EventContext.MODULE_START, null); - Assert.assertNotNull(moduleContext.locateInstance("TestService2ES")); - - moduleContext.fireEvent(EventContext.MODULE_STOP, null); - system.fireEvent(EventContext.MODULE_STOP, null); - runtime.stop(); - } - - /** - * Tests autowiring an external service to a system entry point - */ - public void testSystemAutoWiring() throws Exception { - RuntimeContext runtime = new RuntimeContextImpl(new NullMonitorFactory(), null, builders, null); - runtime.start(); - - AggregateContext root = runtime.getRootContext(); - Assert.assertNotNull(root); - Assert.assertTrue(root.getLifecycleState() == Context.RUNNING); - - AggregateContext system = runtime.getSystemContext(); - Assert.assertNotNull(system); - system.registerModelObject(MockFactory.createSystemModule()); - - // create a test module and wire an external service to the system entry point - Component moduleComponent = MockFactory.createAggregateComponent("test.module"); - runtime.registerModelObject(moduleComponent); - AggregateContextImpl moduleContext = (AggregateContextImpl) runtime.getContext("test.module"); - Assert.assertNotNull(moduleContext); - ExternalService es = MockFactory.createAutowirableExternalService("TestService2ES", ModuleScopeSystemComponent.class); - moduleContext.registerModelObject(es); - - system.fireEvent(EventContext.MODULE_START, null); - moduleContext.fireEvent(EventContext.MODULE_START, null); - // test that the autowire was resolved - Assert.assertNotNull(moduleContext.locateInstance("TestService2ES")); - - moduleContext.fireEvent(EventContext.MODULE_STOP, null); - system.fireEvent(EventContext.MODULE_STOP, null); - runtime.stop(); - } - - public void testServiceNotFound() throws Exception { - RuntimeContext runtime = new RuntimeContextImpl(new NullMonitorFactory(), null, builders, null); - runtime.start(); - - // create a test module - Component moduleComponent = MockFactory.createAggregateComponent("module"); - runtime.registerModelObject(moduleComponent); - AggregateContextImpl moduleContext = (AggregateContextImpl) runtime.getContext("module"); - moduleContext.fireEvent(EventContext.MODULE_START, null); - try { - moduleContext.locateService("TestService"); - fail("Expected " + ServiceUnavailableException.class.getName()); - } catch (ServiceUnavailableException e) { - // expected - } - moduleContext.fireEvent(EventContext.MODULE_STOP, null); - runtime.stop(); - } - - public void testExternalServiceReferenceNotFound() throws Exception { - RuntimeContext runtime = new RuntimeContextImpl(new NullMonitorFactory(), null, builders, null); - runtime.start(); - AggregateContext system = runtime.getSystemContext(); - - // create a test module - Component moduleComponent = MockFactory.createAggregateComponent("module"); - runtime.registerModelObject(moduleComponent); - AggregateContextImpl moduleContext = (AggregateContextImpl) runtime.getContext("module"); - ExternalService es = MockFactory.createESSystemBinding("TestServiceES", "tuscany.system/TestService1xEP"); - moduleContext.registerModelObject(es); - - // start the modules and test inter-module system wires - system.fireEvent(EventContext.MODULE_START, null); - moduleContext.fireEvent(EventContext.MODULE_START, null); - try { - moduleContext.locateService("TestServiceES"); - fail("Expected " + ServiceUnavailableException.class.getName()); - } catch (ServiceUnavailableException e) { - // expected - } - moduleContext.fireEvent(EventContext.MODULE_STOP, null); - system.fireEvent(EventContext.MODULE_STOP, null); - runtime.stop(); - } - - public void testEntryPointReferenceNotFound() throws Exception { - RuntimeContext runtime = new RuntimeContextImpl(new NullMonitorFactory(), null, builders, null); - runtime.start(); - - // create a test module - Component moduleComponent = MockFactory.createAggregateComponent("module"); - runtime.registerModelObject(moduleComponent); - - Component component = MockFactory.createSystemComponent("NoService", ModuleScopeSystemComponentImpl.class, Scope.MODULE); - // do not register the above component! - - AggregateContextImpl moduleContext = (AggregateContextImpl) runtime.getContext("module"); - moduleContext.registerModelObject(MockFactory.createEPSystemBinding("TestServiceEP", ModuleScopeSystemComponent.class, - "NoReference", component)); - - moduleContext.fireEvent(EventContext.MODULE_START, null); - try { - moduleContext.locateService("TestServiceEP"); - fail("Expected " + ServiceUnavailableException.class.getName()); - } catch (ServiceUnavailableException e) { - // expected - } - moduleContext.fireEvent(EventContext.MODULE_STOP, null); - runtime.stop(); - } - - /** - * Test two module components that have external services wired to entry points contained in each - */ - public void testCircularWires() throws Exception { - RuntimeContext runtime = new RuntimeContextImpl(new NullMonitorFactory(), null, builders, null); - runtime.start(); - - // create a test modules - Component module1 = MockFactory.createAggregateComponent("module1"); - runtime.registerModelObject(module1); - Component module2 = MockFactory.createAggregateComponent("module2"); - runtime.registerModelObject(module2); - - AggregateContextImpl moduleContext1 = (AggregateContextImpl) runtime.getContext("module1"); - AggregateContextImpl moduleContext2 = (AggregateContextImpl) runtime.getContext("module2"); - - Component component1 = MockFactory.createSystemComponent("Component1", ModuleScopeSystemComponentImpl.class, - Scope.MODULE); - EntryPoint entryPoint1 = MockFactory.createEPSystemBinding("EntryPoint1", ModuleScopeSystemComponent.class, "Component1", - component1); - ExternalService externalService1 = MockFactory.createESSystemBinding("ExternalService1", "module2/EntryPoint2"); - moduleContext1.registerModelObject(component1); - moduleContext1.registerModelObject(entryPoint1); - moduleContext1.registerModelObject(externalService1); - - Component component2 = MockFactory.createSystemComponent("Component2", ModuleScopeSystemComponentImpl.class, - Scope.MODULE); - EntryPoint entryPoint2 = MockFactory.createEPSystemBinding("EntryPoint2", ModuleScopeSystemComponent.class, "Component2", - component2); - ExternalService externalService2 = MockFactory.createESSystemBinding("ExternalService2", "module1/EntryPoint1"); - moduleContext2.registerModelObject(component2); - moduleContext2.registerModelObject(entryPoint2); - moduleContext2.registerModelObject(externalService2); - - moduleContext1.fireEvent(EventContext.MODULE_START, null); - moduleContext2.fireEvent(EventContext.MODULE_START, null); - Assert.assertNotNull(moduleContext2.locateInstance("ExternalService2")); - Assert.assertNotNull(moduleContext1.locateInstance("ExternalService1")); - runtime.stop(); - } - - /** - * Tests that a circular reference between an external service in one module and an entry point in another is caught - * as an error condition FIXME this must be implemented - */ - public void testInterModuleCircularReference() throws Exception { - RuntimeContext runtime = new RuntimeContextImpl(new NullMonitorFactory(), null, builders, null); - runtime.start(); - - // create a test modules - Component module1 = MockFactory.createAggregateComponent("module1"); - runtime.registerModelObject(module1); - Component module2 = MockFactory.createAggregateComponent("module2"); - runtime.registerModelObject(module2); - - AggregateContextImpl moduleContext1 = (AggregateContextImpl) runtime.getContext("module1"); - AggregateContextImpl moduleContext2 = (AggregateContextImpl) runtime.getContext("module2"); - ExternalService externalService1 = MockFactory.createESSystemBinding("ExternalService1", "module2/EntryPoint2"); - EntryPoint entryPoint1 = MockFactory.createEPSystemBinding("EntryPoint1", ModuleScopeSystemComponent.class, - "ExternalService1", externalService1); - ExternalService externalService2 = MockFactory.createESSystemBinding("ExternalService2", "module1/EntryPoint1"); - EntryPoint entryPoint2 = MockFactory.createEPSystemBinding("EntryPoint2", ModuleScopeSystemComponent.class, - "ExternalService2", externalService2); - try { - // FIXME this should throw a circular reference exception - moduleContext1.registerModelObject(externalService1); - moduleContext1.registerModelObject(entryPoint1); - moduleContext2.registerModelObject(externalService2); - moduleContext2.registerModelObject(entryPoint2); - // FIXME implement fail("Expected " + ConfigurationException.class.getName()); - } catch (ConfigurationException e) { - // expected - } - } - - public void testRuntimeBuilderAutowire() throws Exception { - - RuntimeContext runtime = new RuntimeContextImpl(new NullMonitorFactory(), null, builders, null); - runtime.start(); - - AggregateContext system = runtime.getSystemContext(); - Component builder = MockFactory.createSystemComponent("TestBuilder", TestBuilder.class, Scope.MODULE); - system.registerModelObject(builder); - system.fireEvent(EventContext.MODULE_START, null); - Component module1 = MockFactory.createAggregateComponent("module1"); - runtime.registerModelObject(module1); - runtime.getContext("module1"); - Assert.assertTrue(((TestBuilder) system.locateInstance("TestBuilder")).invoked()); - system.fireEvent(EventContext.MODULE_STOP, null); - runtime.stop(); - - } - - protected void setUp() throws Exception { - super.setUp(); - builders = MockFactory.createSystemBuilders(); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/builder/SystemComponentContextBuilderTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/builder/SystemComponentContextBuilderTestCase.java deleted file mode 100644 index c73554a1df..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/builder/SystemComponentContextBuilderTestCase.java +++ /dev/null @@ -1,137 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.builder; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.common.monitor.impl.NullMonitorFactory; -import org.apache.tuscany.core.builder.RuntimeConfiguration; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.InstanceContext; -import org.apache.tuscany.core.context.impl.AggregateContextImpl; -import org.apache.tuscany.core.context.impl.EventContextImpl; -import org.apache.tuscany.core.context.scope.DefaultScopeStrategy; -import org.apache.tuscany.core.mock.MockConfigContext; -import org.apache.tuscany.core.mock.MockFactory; -import org.apache.tuscany.core.system.assembly.SystemAssemblyFactory; -import org.apache.tuscany.core.system.assembly.impl.SystemAssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.ConfiguredProperty; -import org.apache.tuscany.model.assembly.Property; -import org.apache.tuscany.model.assembly.Scope; - -/** - * Tests to that system components are built properly - * - * @version $Rev$ $Date$ - */ -public class SystemComponentContextBuilderTestCase extends TestCase { - - private SystemAssemblyFactory factory = new SystemAssemblyFactoryImpl(); - - public void testComponentContextBuilder() throws Exception { - SystemComponentContextBuilder builder = new SystemComponentContextBuilder(); - Component component = MockFactory.createSystemComponent("test", SystemComponentImpl.class, - Scope.AGGREGATE); - - ConfiguredProperty cProp = factory.createConfiguredProperty(); - Property prop = factory.createProperty(); - prop.setName("testInt"); - cProp.setValue(1); - cProp.setProperty(prop); - component.getConfiguredProperties().add(cProp); - - cProp = factory.createConfiguredProperty(); - prop = factory.createProperty(); - prop.setName("testString"); - cProp.setValue("test"); - cProp.setProperty(prop); - component.getConfiguredProperties().add(cProp); - - cProp = factory.createConfiguredProperty(); - prop = factory.createProperty(); - prop.setName("testDouble"); - cProp.setValue(1d); - cProp.setProperty(prop); - component.getConfiguredProperties().add(cProp); - - cProp = factory.createConfiguredProperty(); - prop = factory.createProperty(); - prop.setName("testFloat"); - cProp.setValue(1f); - cProp.setProperty(prop); - component.getConfiguredProperties().add(cProp); - - cProp = factory.createConfiguredProperty(); - prop = factory.createProperty(); - prop.setName("testShort"); - cProp.setValue((short) 1); - cProp.setProperty(prop); - component.getConfiguredProperties().add(cProp); - - cProp = factory.createConfiguredProperty(); - prop = factory.createProperty(); - prop.setName("testByte"); - cProp.setValue((byte) 1); - cProp.setProperty(prop); - component.getConfiguredProperties().add(cProp); - - cProp = factory.createConfiguredProperty(); - prop = factory.createProperty(); - prop.setName("testBoolean"); - cProp.setValue(Boolean.TRUE); - cProp.setProperty(prop); - component.getConfiguredProperties().add(cProp); - - cProp = factory.createConfiguredProperty(); - prop = factory.createProperty(); - prop.setName("testChar"); - cProp.setValue('1'); - cProp.setProperty(prop); - component.getConfiguredProperties().add(cProp); - - builder.build(component, createContext()); - RuntimeConfiguration config = (RuntimeConfiguration) component.getComponentImplementation().getRuntimeConfiguration(); - Assert.assertNotNull(config); - InstanceContext ctx = (InstanceContext) config.createInstanceContext(); - - ctx.start(); - SystemComponentImpl instance = (SystemComponentImpl) ctx.getInstance(null); - Assert.assertNotNull(instance.getConfigContext()); - Assert.assertNotNull(instance.getParentContext()); - Assert.assertNotNull(instance.getAutowireContext()); - Assert.assertNotNull(instance.getConfigContextSetter()); - Assert.assertNotNull(instance.getParentContextSetter()); - Assert.assertNotNull(instance.getAutowireContextSetter()); - Assert.assertEquals(1, instance.getTestInt()); - Assert.assertEquals(1d, instance.getTestDouble()); - Assert.assertEquals(1f, instance.getTestFloat()); - Assert.assertEquals((short) 1, instance.getTestShort()); - Assert.assertTrue(instance.getTestBoolean()); - Assert.assertEquals('1', instance.getTestChar()); - Assert.assertEquals((byte) 1, instance.getTestByte()); - Assert.assertEquals("test", instance.getTestString()); - - Assert.assertTrue(instance.initialized()); - ctx.stop(); - Assert.assertTrue(instance.destroyed()); - } - - private static AggregateContext createContext() { - return new AggregateContextImpl("test.parent", null, new DefaultScopeStrategy(), new EventContextImpl(), - new MockConfigContext(null), new NullMonitorFactory()); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/builder/SystemComponentImpl.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/builder/SystemComponentImpl.java deleted file mode 100644 index b86f79e504..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/builder/SystemComponentImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.builder; - -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.AutowireContext; -import org.apache.tuscany.core.context.ConfigurationContext; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.apache.tuscany.core.system.annotation.ParentContext; -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Property; - -/** - * A system component used for unit testing - * - * @version $Rev$ $Date$ - */ -public class SystemComponentImpl { - - @Autowire - private ConfigurationContext ctx; - - @ParentContext - private AggregateContext parent; - - @Autowire - private AutowireContext autowireCtx; - - private ConfigurationContext ctxSetter; - - private AggregateContext parentSetter; - - private AutowireContext autowireCtxSetter; - - public ConfigurationContext getConfigContext() { - return ctx; - } - - public AggregateContext getParentContext() { - return parent; - } - - public AutowireContext getAutowireContext() { - return autowireCtx; - } - - @Autowire - public void setConfigContext(ConfigurationContext configCtx) { - ctxSetter = configCtx; - } - - public ConfigurationContext getConfigContextSetter() { - return ctxSetter; - } - - @ParentContext - public void setParentContex(AggregateContext ctx) { - parentSetter = ctx; - } - - public AggregateContext getParentContextSetter() { - return parentSetter; - } - - @Autowire - public void setAutowireContext(AutowireContext ctx) { - autowireCtxSetter = ctx; - } - - public AutowireContext getAutowireContextSetter() { - return autowireCtx; - } - - private boolean inited; - - @Init - public void init(){ - inited=true; - } - - public boolean initialized(){ - return (inited == true); - } - - private boolean destroyed; - - @Destroy - public void destroy(){ - destroyed=true; - } - - public boolean destroyed(){ - return (destroyed == true); - } - - @Property - private int testInt; - - public int getTestInt(){ - return testInt; - } - - @Property - private double testDouble; - - public double getTestDouble(){ - return testDouble; - } - - @Property - private float testFloat; - - public float getTestFloat(){ - return testFloat; - } - - @Property - private short testShort; - - public short getTestShort(){ - return testShort; - } - - @Property - private boolean testBoolean; - - public boolean getTestBoolean(){ - return testBoolean; - } - - @Property - private byte testByte; - - public byte getTestByte(){ - return testByte; - } - - @Property - private char testChar; - - public char getTestChar(){ - return testChar; - } - - @Property - private String testString; - - public String getTestString(){ - return testString; - } - - -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/builder/impl/AssemblyVisitorTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/builder/impl/AssemblyVisitorTestCase.java deleted file mode 100644 index fe3d7f222b..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/builder/impl/AssemblyVisitorTestCase.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.builder.impl; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.common.resource.ResourceLoader; -import org.apache.tuscany.common.resource.impl.ResourceLoaderImpl; -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.builder.impl.AssemblyVisitor; -import org.apache.tuscany.core.context.Context; -import org.apache.tuscany.core.mock.component.ModuleScopeSystemComponent; -import org.apache.tuscany.core.system.assembly.SystemAssemblyFactory; -import org.apache.tuscany.core.system.assembly.SystemBinding; -import org.apache.tuscany.core.system.assembly.SystemImplementation; -import org.apache.tuscany.core.system.assembly.impl.SystemAssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.ConfiguredPort; -import org.apache.tuscany.model.assembly.ConfiguredReference; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.Reference; -import org.apache.tuscany.model.assembly.RuntimeConfigurationHolder; -import org.apache.tuscany.model.assembly.Service; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; -import org.apache.tuscany.model.assembly.loader.AssemblyModelLoader; -import org.apache.tuscany.model.scdl.loader.impl.SCDLAssemblyModelLoaderImpl; -import org.apache.tuscany.model.types.java.JavaServiceContract; - -/** - * Tests decorating a logical configuration model - * - * @version $Rev$ $Date$ - */ -public class AssemblyVisitorTestCase extends TestCase { - - private static final Object MARKER = new Object(); - - private SystemAssemblyFactory factory = new SystemAssemblyFactoryImpl(); - private AssemblyModelContext assemblyContext = new AssemblyModelContextImpl(factory, null, null); - - public void testModelVisit() throws Exception { - - Component component = factory.createSimpleComponent(); - SystemImplementation impl = factory.createSystemImplementation(); - impl.setComponentType(factory.createComponentType()); - component.setComponentImplementation(impl); - ConfiguredReference cRef = factory.createConfiguredReference(); - Reference ref = factory.createReference(); - cRef.setReference(ref); - component.getConfiguredReferences().add(cRef); - - EntryPoint ep = factory.createEntryPoint(); - JavaServiceContract contract = factory.createJavaServiceContract(); - contract.setInterface(ModuleScopeSystemComponent.class); - Service service = factory.createService(); - service.setServiceContract(contract); - ConfiguredService cService = factory.createConfiguredService(); - cService.setService(service); - cService.initialize(assemblyContext); - ep.setConfiguredService(cService); - SystemBinding binding = factory.createSystemBinding(); - ep.getBindings().add(binding); - ConfiguredReference cEpRef = factory.createConfiguredReference(); - Reference epRef = factory.createReference(); - cEpRef.setReference(epRef); - ep.setConfiguredReference(cEpRef); - - ep.initialize(assemblyContext); - Module module = factory.createModule(); - module.getComponents().add(component); - module.getEntryPoints().add(ep); - - List builders = new ArrayList(); - builders.add(new TestBuilder()); - AssemblyVisitor visitor = new AssemblyVisitor(null, builders); - module.initialize(assemblyContext); - visitor.start(module); - - Assert.assertSame(MARKER, impl.getRuntimeConfiguration()); - Assert.assertSame(MARKER, cRef.getRuntimeConfiguration()); - Assert.assertSame(MARKER, cRef.getProxyFactory()); - Assert.assertSame(MARKER, binding.getRuntimeConfiguration()); - Assert.assertSame(MARKER, cEpRef.getRuntimeConfiguration()); - Assert.assertSame(MARKER, cEpRef.getProxyFactory()); - Assert.assertSame(MARKER, module.getRuntimeConfiguration()); - - } - - private static class TestBuilder implements RuntimeConfigurationBuilder { - public void build(AssemblyModelObject model, Context context) throws BuilderException { - if (model instanceof ConfiguredPort) { - ((ConfiguredPort) model).setProxyFactory(MARKER); - } - if (model instanceof RuntimeConfigurationHolder) { - ((RuntimeConfigurationHolder) model).setRuntimeConfiguration(MARKER); - } - } - - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/SystemAggregateComponentContextRegisterTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/SystemAggregateComponentContextRegisterTestCase.java deleted file mode 100644 index 40feca3b7c..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/SystemAggregateComponentContextRegisterTestCase.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.context; - -import java.util.List; - -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.context.AggregateComponentContextRegisterTestCase; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.impl.EventContextImpl; -import org.apache.tuscany.core.context.scope.DefaultScopeStrategy; -import org.apache.tuscany.core.mock.MockConfigContext; -import org.apache.tuscany.core.mock.MockFactory; -import org.apache.tuscany.common.monitor.impl.NullMonitorFactory; - -/** - * Tests registration of model objects for an system aggregate context - * - * @version $Rev$ $Date$ - */ -public class SystemAggregateComponentContextRegisterTestCase extends AggregateComponentContextRegisterTestCase { - - protected AggregateContext createContext() { - List builders = MockFactory.createSystemBuilders(); - AggregateContext moduleContext = new SystemAggregateContextImpl("test.context", null, - null, new DefaultScopeStrategy(), new EventContextImpl(), new MockConfigContext(builders), new NullMonitorFactory()); - return moduleContext; - } -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/SystemAggregateComponentContextTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/SystemAggregateComponentContextTestCase.java deleted file mode 100644 index 55fd6502f0..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/SystemAggregateComponentContextTestCase.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.context; - -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.common.monitor.impl.NullMonitorFactory; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.impl.EventContextImpl; -import org.apache.tuscany.core.mock.MockConfigContext; -import org.apache.tuscany.core.mock.MockFactory; -import org.apache.tuscany.core.mock.component.ModuleScopeSystemComponent; -import org.apache.tuscany.core.mock.component.ModuleScopeSystemComponentImpl; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.Scope; - -/** - * Tests the system aggregate context - * - * @version $Rev$ $Date$ - */ -public class SystemAggregateComponentContextTestCase extends TestCase { - - public void testChildLocate() throws Exception { - List builders = MockFactory.createSystemBuilders(); - - SystemAggregateContextImpl system = new SystemAggregateContextImpl("system", null, null, new SystemScopeStrategy(), - new EventContextImpl(), new MockConfigContext(builders), new NullMonitorFactory()); - system.start(); - - Component aggregateComponent = MockFactory.createAggregateComponent("system.child"); - system.registerModelObject(aggregateComponent); - AggregateContext childContext = (AggregateContext) system.getContext("system.child"); - Assert.assertNotNull(childContext); - - Component component = MockFactory.createSystemComponent("TestService1", ModuleScopeSystemComponentImpl.class, - Scope.MODULE); - EntryPoint ep = MockFactory.createEPSystemBinding("TestService1EP", ModuleScopeSystemComponent.class, "TestService1", - component); - childContext.registerModelObject(component); - childContext.registerModelObject(ep); - childContext.fireEvent(EventContext.MODULE_START, null); - Assert.assertNotNull(system.locateInstance("system.child/TestService1EP")); - childContext.fireEvent(EventContext.MODULE_STOP, null); - system.stop(); - } - - public void testAutowire() throws Exception { - List builders = MockFactory.createSystemBuilders(); - SystemAggregateContextImpl system = new SystemAggregateContextImpl("system", null, null, new SystemScopeStrategy(), - new EventContextImpl(), new MockConfigContext(builders), new NullMonitorFactory()); - - Component component = MockFactory.createSystemComponent("TestService1", ModuleScopeSystemComponentImpl.class, - Scope.MODULE); - EntryPoint ep = MockFactory.createEPSystemBinding("TestService1EP", ModuleScopeSystemComponent.class, "TestService1", - component); - system.registerModelObject(component); - system.registerModelObject(ep); - system.start(); - system.fireEvent(EventContext.MODULE_START, null); - Assert.assertSame(system.locateInstance("TestService1EP"), system.resolveInstance(ModuleScopeSystemComponent.class)); - system.fireEvent(EventContext.MODULE_STOP, null); - system.stop(); - } - - public void testAutowireRegisterAfterStart() throws Exception { - List builders = MockFactory.createSystemBuilders(); - - SystemAggregateContextImpl system = new SystemAggregateContextImpl("system", null, null, new SystemScopeStrategy(), - new EventContextImpl(), new MockConfigContext(builders), new NullMonitorFactory()); - - Component component = MockFactory.createSystemComponent("TestService1", ModuleScopeSystemComponentImpl.class, - Scope.MODULE); - system.registerModelObject(component); - system.start(); - system.fireEvent(EventContext.MODULE_START, null); - EntryPoint ep = MockFactory.createEPSystemBinding("TestService1EP", ModuleScopeSystemComponent.class, "TestService1", - component); - system.registerModelObject(ep); - Assert.assertSame(system.locateInstance("TestService1EP"), system.resolveInstance(ModuleScopeSystemComponent.class)); - system.fireEvent(EventContext.MODULE_STOP, null); - system.stop(); - } - - public void testAutowireModuleRegister() throws Exception { - List builders = MockFactory.createSystemBuilders(); - - SystemAggregateContextImpl system = new SystemAggregateContextImpl("system", null, null, new SystemScopeStrategy(), - new EventContextImpl(), new MockConfigContext(builders), new NullMonitorFactory()); - system.registerModelObject(MockFactory.createSystemModule()); - system.start(); - system.fireEvent(EventContext.MODULE_START, null); - Assert.assertSame(system.locateInstance("TestService1EP"), system.resolveInstance(ModuleScopeSystemComponent.class)); - system.fireEvent(EventContext.MODULE_STOP, null); - system.stop(); - } - - public void testAutowireModuleRegisterAfterStart() throws Exception { - List builders = MockFactory.createSystemBuilders(); - SystemAggregateContextImpl system = new SystemAggregateContextImpl("system", null, null, new SystemScopeStrategy(), - new EventContextImpl(), new MockConfigContext(builders), new NullMonitorFactory()); - system.start(); - system.fireEvent(EventContext.MODULE_START, null); - system.registerModelObject(MockFactory.createSystemModule()); - Assert.assertSame(system.locateInstance("TestService1EP"), system.resolveInstance(ModuleScopeSystemComponent.class)); - system.fireEvent(EventContext.MODULE_STOP, null); - system.stop(); - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/SystemAggregateHierarchyTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/SystemAggregateHierarchyTestCase.java deleted file mode 100644 index 39dd0c050a..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/SystemAggregateHierarchyTestCase.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.context; - -import java.util.List; - -import junit.framework.Assert; - -import org.apache.tuscany.common.monitor.impl.NullMonitorFactory; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.context.AbstractAggregateHierarchyTests; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.impl.EventContextImpl; -import org.apache.tuscany.core.context.scope.DefaultScopeStrategy; -import org.apache.tuscany.core.mock.MockConfigContext; -import org.apache.tuscany.core.mock.MockFactory; - -/** - * Performs testing of various hierarchical scenarios - * - * @version $Rev$ $Date$ - */ -public class SystemAggregateHierarchyTestCase extends AbstractAggregateHierarchyTests { - - - - protected AggregateContext createContextHierachy() throws Exception { - List mockBuilders = MockFactory.createSystemBuilders(); - AggregateContext parent = new SystemAggregateContextImpl("test.parent", null, null, new DefaultScopeStrategy(), - new EventContextImpl(), new MockConfigContext(mockBuilders), new NullMonitorFactory()); - parent.registerModelObject(MockFactory.createAggregateComponent("test.child")); - parent.start(); - AggregateContext child = (AggregateContext) parent.getContext("test.child"); - Assert.assertNotNull(child); - return parent; - } - -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/SystemBootstrapTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/SystemBootstrapTestCase.java deleted file mode 100644 index 62f4b689c3..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/SystemBootstrapTestCase.java +++ /dev/null @@ -1,130 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.core.system.context; - -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.common.monitor.impl.NullMonitorFactory; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.AutowireContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.impl.AggregateContextImpl; -import org.apache.tuscany.core.mock.MockFactory; -import org.apache.tuscany.core.mock.component.GenericSystemComponent; -import org.apache.tuscany.core.mock.component.ModuleScopeSystemComponent; -import org.apache.tuscany.core.mock.component.ModuleScopeSystemComponentImpl; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.runtime.RuntimeContextImpl; -import org.apache.tuscany.core.system.assembly.SystemAssemblyFactory; -import org.apache.tuscany.core.system.assembly.impl.SystemAssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.ExternalService; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.Service; -import org.apache.tuscany.model.types.java.JavaServiceContract; - -/** - * Tests bootstrapping a system module - * - * @version $Rev$ $Date$ - */ -public class SystemBootstrapTestCase extends TestCase { - private List builders; - - private SystemAssemblyFactory factory = new SystemAssemblyFactoryImpl(); - - /** - * Simulates booting a runtime process - */ - public void testBoot() throws Exception { - RuntimeContext runtimeContext = new RuntimeContextImpl(new NullMonitorFactory(), null, builders,null); - runtimeContext.start(); - - AggregateContext systemContext = runtimeContext.getSystemContext(); - Assert.assertNotNull(systemContext); - Module systemModule = MockFactory.createSystemModule(); - // MockSystemAssemblyFactory.buildModule(systemModule, systemContext); - systemContext.registerModelObject(systemModule); - - // create a test module - Component moduleComponent = MockFactory.createAggregateComponent("module"); - runtimeContext.registerModelObject(moduleComponent); - AggregateContextImpl moduleContext = (AggregateContextImpl) runtimeContext.getContext("module"); - Assert.assertNotNull(moduleContext); - ExternalService es = MockFactory.createESSystemBinding("TestServiceES", "tuscany.system/TestService1EP"); - moduleContext.registerModelObject(es); - - // start the modules and test inter-module system wires - systemContext.fireEvent(EventContext.MODULE_START, null); - moduleContext.fireEvent(EventContext.MODULE_START, null); - - Assert.assertNotNull(systemContext.locateInstance("TestService1EP")); - GenericSystemComponent testService = (GenericSystemComponent) systemContext.locateInstance("TestService1"); - Assert.assertNotNull(testService); - GenericSystemComponent testES = (GenericSystemComponent) moduleContext.locateInstance("TestServiceES"); - Assert.assertNotNull(testES); - Assert.assertSame(testService, testES); - } - - public void testRuntimeBoot() throws Exception { - RuntimeContext runtime = new RuntimeContextImpl(new NullMonitorFactory(), null, builders,null); - runtime.start(); - runtime.getRootContext(); - - AggregateContext system = runtime.getSystemContext(); - system.registerModelObject(MockFactory.createSystemModule()); - system.registerModelObject(MockFactory.createSystemAggregateComponent("module2")); - AggregateContext systemModule2 = (AggregateContext) system.getContext("module2"); - systemModule2.registerModelObject(MockFactory.createSystemChildModule()); - - EntryPoint ep = MockFactory.createEPSystemBinding("TestService2EP", ModuleScopeSystemComponent.class, "ref"); - ep.getBindings().add(factory.createSystemBinding()); - Service service = factory.createService(); - service.setName("module2/TestService2EP"); - JavaServiceContract inter = factory.createJavaServiceContract(); - inter.setInterface(ModuleScopeSystemComponentImpl.class); - service.setServiceContract(inter); - ((ConfiguredService) ep.getConfiguredReference().getTargetConfiguredServices().get(0)).setService(service); - system.registerModelObject(ep); - system.fireEvent(EventContext.MODULE_START, null); - Assert.assertNotNull(system.locateInstance("TestService1")); - Assert.assertNotNull(system.locateInstance("TestService2EP")); - - Assert.assertNotNull(((AutowireContext) system).resolveInstance(ModuleScopeSystemComponent.class)); - // create a test module - Component moduleComponent = MockFactory.createAggregateComponent("test.module"); - runtime.registerModelObject(moduleComponent); - AggregateContextImpl moduleContext = (AggregateContextImpl) runtime.getContext("test.module"); - Assert.assertNotNull(moduleContext); - ExternalService es = MockFactory.createESSystemBinding("TestService2ES", "tuscany.system/TestService2EP"); - moduleContext.registerModelObject(es); - moduleContext.fireEvent(EventContext.MODULE_START, null); - Assert.assertNotNull(moduleContext.locateInstance("TestService2ES")); - - moduleContext.fireEvent(EventContext.MODULE_STOP, null); - system.fireEvent(EventContext.MODULE_STOP, null); - runtime.stop(); - } - - protected void setUp() throws Exception { - super.setUp(); - builders = MockFactory.createSystemBuilders(); - } -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/SystemObjectRegistrationTestCase.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/SystemObjectRegistrationTestCase.java deleted file mode 100644 index 3c9aadac45..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/SystemObjectRegistrationTestCase.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * - * Copyright 2005 BEA Systems Inc. - * Copyright 2005 International Business Machines Corporation - * - * 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. - */ -package org.apache.tuscany.core.system.context; - -import junit.framework.TestCase; - -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.runtime.RuntimeContextImpl; -import org.apache.tuscany.core.context.SystemAggregateContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.config.ConfigurationException; - -/** - * @version $Rev$ $Date$ - */ -public class SystemObjectRegistrationTestCase extends TestCase { - private RuntimeContext runtime; - private SystemAggregateContext systemContext; - - public void testRegistration() throws ConfigurationException { - MockComponent instance = new MockComponent(); - systemContext.registerJavaObject("foo", instance); - assertSame(instance, systemContext.locateInstance("foo")); - } - - protected void setUp() throws Exception { - super.setUp(); - runtime = new RuntimeContextImpl(); - runtime.start(); - systemContext = runtime.getSystemContext(); - systemContext.fireEvent(EventContext.MODULE_START, null); - } - - protected void tearDown() throws Exception { - runtime.stop(); - super.tearDown(); - } - - private static class MockComponent { - public String hello(String message) { - return message; - } - } -} diff --git a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/TestBuilder.java b/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/TestBuilder.java deleted file mode 100644 index 6bdcd896a1..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/java/org/apache/tuscany/core/system/context/TestBuilder.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.apache.tuscany.core.system.context; - -import org.apache.tuscany.core.builder.BuilderException; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.system.annotation.Autowire; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -@Scope("MODULE") -public class TestBuilder implements RuntimeConfigurationBuilder { - - @Autowire - private RuntimeContext runtime; - - private boolean invoked = false; - - public TestBuilder() { - super(); - } - - @Init(eager = true) - public void init() { - runtime.addBuilder(this); - } - - public void build(AssemblyModelObject object, AggregateContext context) throws BuilderException { - invoked = true; - } - - public boolean invoked() { - return invoked; - } -} diff --git a/tags/java-stable-20060304/sca/core/src/test/resources/org/apache/tuscany/core/config/ModuleComponentLoaderTest1.module b/tags/java-stable-20060304/sca/core/src/test/resources/org/apache/tuscany/core/config/ModuleComponentLoaderTest1.module deleted file mode 100644 index b261cbe6c0..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/resources/org/apache/tuscany/core/config/ModuleComponentLoaderTest1.module +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - diff --git a/tags/java-stable-20060304/sca/core/src/test/resources/system.fragment b/tags/java-stable-20060304/sca/core/src/test/resources/system.fragment deleted file mode 100644 index 74d04561cd..0000000000 --- a/tags/java-stable-20060304/sca/core/src/test/resources/system.fragment +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/tags/java-stable-20060304/sca/model/LICENSE.txt b/tags/java-stable-20060304/sca/model/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/tags/java-stable-20060304/sca/model/LICENSE.txt +++ /dev/null @@ -1,202 +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/tags/java-stable-20060304/sca/model/pom.xml b/tags/java-stable-20060304/sca/model/pom.xml deleted file mode 100644 index 91ae36c3a4..0000000000 --- a/tags/java-stable-20060304/sca/model/pom.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - org.apache.tuscany - tuscany-sca - SNAPSHOT - - 4.0.0 - tuscany-model - Tuscany Assembly Model - Data model for the Assembly model defined by the SCA specification. - SNAPSHOT - - - - org.osoa - sca-api - ${pom.version} - compile - - - org.apache.tuscany - tuscany-common - ${pom.version} - compile - - - - commonj - sdo-api - SNAPSHOT - compile - - - org.apache.tuscany - tuscany-sdo-impl - SNAPSHOT - compile - - - - axis - axis-wsdl4j - 1.2 - compile - - - - asm - asm - 2.2 - compile - - - - junit - junit - 3.8.1 - test - - - - - - - org.apache.tuscany - tuscany-sdo-plugin - - - - ${basedir}/src/main/resources/model/sca.xsd - true - true - true - true - - - generate - - - - - - - - diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/ModelRuntimeException.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/ModelRuntimeException.java deleted file mode 100644 index ba361fab89..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/ModelRuntimeException.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model; - -import org.apache.tuscany.common.TuscanyRuntimeException; - -/** - * The root runtime exception for the model. - * - * @version $Rev$ $Date$ - */ -public abstract class ModelRuntimeException extends TuscanyRuntimeException { - - public ModelRuntimeException() { - super(); - } - - public ModelRuntimeException(String message) { - super(message); - } - - public ModelRuntimeException(String message, Throwable cause) { - super(message, cause); - } - - public ModelRuntimeException(Throwable cause) { - super(cause); - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Aggregate.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Aggregate.java deleted file mode 100644 index d313a087d0..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Aggregate.java +++ /dev/null @@ -1,117 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -import java.util.List; - -import javax.wsdl.Import; - -/** - * A model object that describes a container for other module objects, which must be {@link AggregatePart}s. - */ -public interface Aggregate extends Extensible { - - /** - * Returns the name of the aggregate. - * @return the name of the aggregate - */ - String getName(); - - /** - * Sets the name of the aggregate. - * @param name the name of the aggregate - */ - void setName(String name); - - /** - * Returns the AggregatePart objects that are contained in this aggregate. - * @return the AggregatePart objects that are contained in this aggregate - */ - List getAggregateParts(); - - /** - * Helper method that returns all entry points contained in this aggregate. - * @return a list of all EntryPoint model objects driectly contained in this aggregate - */ - List getEntryPoints(); - - /** - * Returns the named entry point. - * @param name - * @return - */ - EntryPoint getEntryPoint(String name); - - /** - * Helper method that returns all entry points contained in this aggregate. - * @return - */ - List getComponents(); - - /** - * Returns the named component. - * @param name - * @return - */ - Component getComponent(String name); - - /** - * Returns external services contained in this aggregate. - * @return - */ - List getExternalServices(); - - /** - * Returns the named external service. - * @param name - * @return - */ - ExternalService getExternalService(String name); - - /** - * Returns the configured service at the given address. - * @param address - * @return - */ - ConfiguredService getConfiguredService(ServiceURI address); - - /** - * Returns the wires. - * @return - */ - List getWires(); - - /** - * Returns the WSDL imports. - * @return - */ - List getWSDLImports(); - - /** - * Returns the WSDL imports for the given namespace. - * @param namespace - * @return - */ - List getWSDLImports(String namespace); - - /** - * Returns the assembly model context used by this aggregate. - * @return - */ - AssemblyModelContext getAssemblyModelContext(); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/AggregatePart.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/AggregatePart.java deleted file mode 100644 index f88458eaa8..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/AggregatePart.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -/** - * A configured object that is contained inside an {@link Aggregate}. - */ -public interface AggregatePart extends AssemblyModelObject { - /** - * Returns the name that uniquely identifies this part within its containing aggregate. - * @return the name that uniquely identifies this part within its containing aggregate - */ - String getName(); - - /** - * Sets the name that uniquely identifies this part within its containing aggregate. - * @param value the name that uniquely identifies this part within its containing aggregate - */ - void setName(String value); - - /** - * Returns the aggregate that contains this part. - * @return the aggregate that contains this part - */ - Aggregate getAggregate(); -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/AssemblyFactory.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/AssemblyFactory.java deleted file mode 100644 index 2f5715bd4e..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/AssemblyFactory.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.model.types.java.JavaServiceContract; -import org.apache.tuscany.model.types.wsdl.WSDLServiceContract; - -/** - * The Factory for the assembly model. - * Provides a create method for each non-abstract class of the model. - */ -public interface AssemblyFactory { - - /** - * Returns a new SimpleComponent. - * @return - */ - SimpleComponent createSimpleComponent(); - - /** - * Returns a new ComponentType. - * @return - */ - ComponentType createComponentType(); - - /** - * Returns a new EntryPoint. - * @return - */ - EntryPoint createEntryPoint(); - - /** - * Returns a new ExternalService. - * @return - */ - ExternalService createExternalService(); - - /** - * Returns a new JavaServiceContract. - * @return - */ - JavaServiceContract createJavaServiceContract(); - - /** - * Returns a new Module. - * @return - */ - Module createModule(); - - /** - * Returns a new ModuleComponent. - * @return - */ - ModuleComponent createModuleComponent(); - - /** - * Returns a new ModuleFragment. - * @return - */ - ModuleFragment createModuleFragment(); - - /** - * Returns a new Reference. - * @return - */ - Reference createReference(); - - /** - * Returns a new ConfiguredReference. - * @return - */ - ConfiguredReference createConfiguredReference(); - - /** - * Returns a new Service. - * @return - */ - Service createService(); - - /** - * Returns a new ConfiguredService. - * @return - */ - ConfiguredService createConfiguredService(); - - /** - * Returns a new Subsystem. - * @return - */ - Subsystem createSubsystem(); - - /** - * Returns Property. - * @return - */ - Property createProperty(); - - /** - * Returns a new ConfiguredProperty. - * @return - */ - ConfiguredProperty createConfiguredProperty(); - - /** - * Returns a new WSDLServiceContract. - * @return - */ - WSDLServiceContract createWSDLServiceContract(); - - /** - * Create a new ServiceURI from the given uri string. - * @param uri - * @return - */ - ServiceURI createServiceURI(String uri); - - /** - * Creates a new ServiceURI from a module component and a service name. - * @param moduleComponent - * @param serviceName - * @return - */ - ServiceURI createServiceURI(ModuleComponent moduleComponent, String serviceName); - - /** - * Creates a new ServiceURI from a module component and configured port. - * @param moduleComponent - * @param aggregatePart - * @param configuredPort - * @return - */ - ServiceURI createServiceURI(ModuleComponent moduleComponent, AggregatePart aggregatePart, ConfiguredPort configuredPort); - - /** - * Create a qname from a URI - * @param uri - * @return - */ - QName createQName(String uri); - - /** - * Create a wire - * @return - */ - Wire createWire(); -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/AssemblyModelContext.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/AssemblyModelContext.java deleted file mode 100644 index 43e6766b8b..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/AssemblyModelContext.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -import org.apache.tuscany.common.resource.ResourceLoader; -import org.apache.tuscany.model.assembly.loader.AssemblyModelLoader; - -import commonj.sdo.helper.TypeHelper; - -/** - * Context object supplied by visitors that are processing the model. - */ -public interface AssemblyModelContext { - - /** - * Returns a factory that can be used to create other model objects - * - * @return a factory for model objects - */ - AssemblyFactory getAssemblyFactory(); - - /** - * Returns a loader for resources in the system environment - * - * @return a resource loader - */ - ResourceLoader getSystemResourceLoader(); - - /** - * Returns a loader for resources in the application environment. - * - * @return a loader for resources in the system environment - */ - ResourceLoader getApplicationResourceLoader(); - - /** - * Returns a loader that can be used to load sub-models. - * - * @return a loader for sub-models - */ - AssemblyModelLoader getAssemblyLoader(); - - /** - * Returns an SDO type helper. - * - * @return an SDO type helper - */ - TypeHelper getTypeHelper(); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/AssemblyModelObject.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/AssemblyModelObject.java deleted file mode 100644 index e9a32ed4ce..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/AssemblyModelObject.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -/** - * Base interface for all assembly model objects providing methods for managing the model itself. - */ -public interface AssemblyModelObject { - - /** - * Initialize this model object. - * - * @param modelContext context providing access to the environment in which this model is being used - * @throws ModelInitException if an error ocurrs initializing the artifact - */ - void initialize(AssemblyModelContext modelContext) throws ModelInitException; - - /** - * Freeze this model object preventing any additional changes. - */ - void freeze(); - - /** - * Accept a visitor - * - * @param visitor a visitor that is visiting the model - * @return true if processing is complete and the visitor should stop traversing the model - */ - boolean accept(AssemblyModelVisitor visitor); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/AssemblyModelVisitor.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/AssemblyModelVisitor.java deleted file mode 100644 index 9f3153e953..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/AssemblyModelVisitor.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -/** - * A visitor that traverses the model performing some operation. - */ -public interface AssemblyModelVisitor { - - /** - * Visit the given model object. - * - * @param modelObject the assembly model object to visit - * @return true if processing is complete - */ - boolean visit(AssemblyModelObject modelObject); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Binding.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Binding.java deleted file mode 100644 index 61207186e3..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Binding.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - - -/** - * The binding of an entry point or external service to a transport. - * This model object will typically by extended by binding implementations to allow - * specification of binding/transport specific information. - */ -public interface Binding extends AssemblyModelObject, RuntimeConfigurationHolder { - /** - * Returns the binding URI. - * @return the binding uri - * todo do we need this? - */ - String getURI(); - - /** - * Sets binding URI. - * @param value the binding uri - * todo do we need this? - */ - void setURI(String value); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Component.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Component.java deleted file mode 100644 index 86dd1c5f12..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Component.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -import java.util.List; - - -/** - * A component is a configured instance of a generic {@link ComponentImplementation}. - */ -public interface Component extends Extensible, AggregatePart { - - /** - * Returns the ComponentImplementation for this configured instance. - * @return the ComponentImplementation for this configured instance - */ - ComponentImplementation getComponentImplementation(); - - /** - * Sets the ComponentImplementation for this configured instance - * @param value the ComponentImplementation for this configured instance - */ - void setComponentImplementation(ComponentImplementation value); - - /** - * Returns a list of configured property values for this configured instance. - * These values will be used to initialize the component when it is activated. - * @return a list of ConfiguredProperty values - */ - List getConfiguredProperties(); - - /** - * Returns the ConfiguredProperty value for the specified property. - * - * @param name the name of the Property - * @return the configured property value for the named property - */ - ConfiguredProperty getConfiguredProperty(String name); - - /** - * Returns a list of configured reference values for the configured instance. - * @return a list of configured reference values for the configured instance - */ - List getConfiguredReferences(); - - /** - * Returns the ConfiguredReference value for the specified reference. - * @param name the name of the Property - * @return the configured reference value for the named reference - */ - ConfiguredReference getConfiguredReference(String name); - - /** - * Returns the configured services for the configured instance. - * @return the configured services for the configured instance - */ - List getConfiguredServices(); - - /** - * Returns the ConfiguredService value for the specified property. - * @param name the name of the Property - * @return the configured service value for the named service - */ - ConfiguredService getConfiguredService(String name); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ComponentImplementation.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ComponentImplementation.java deleted file mode 100644 index 9bae24522e..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ComponentImplementation.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - - -/** - * The implementation for a specific component instance. - * This interface will typically be extended by component type implementations to indicate the - * specific implementation to be used by a runtime and to allow for additional runtime configuration - * properties. - */ -public interface ComponentImplementation extends Extensible, RuntimeConfigurationHolder { - - /** - * Returns the generic component type corresponding to this implementation. - * @return the generic component type corresponding to this implementation - */ - ComponentType getComponentType(); - - /** - * Sets the generic component type corresponding to this implementation. - * @param componentType the generic component type corresponding to this implementation - */ - void setComponentType(ComponentType componentType); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ComponentType.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ComponentType.java deleted file mode 100644 index 58ac9bc9de..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ComponentType.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -import java.util.List; - - -/** - * A logical definition of a type of component separate from any specific implementation. - */ -public interface ComponentType extends Extensible { - - /** - * Returns a list of services exposed by this component type. - * @return a list of services exposed by this component type - */ - List getServices(); - - /** - * Returns the specfied service if exposed by this component type. - * @param name the name of the service - * @return the service identified by the supplied name, or null if there is no service with that name - */ - Service getService(String name); - - /** - * Returns the list of references this component type consumes. - * @return the list of references this component type consumes - */ - List getReferences(); - - /** - * Returns the specified reference. - * @param name the name of the reference - * @return the reference identified by the supplied name, or null if there is no reference with that name - */ - Reference getReference(String name); - - /** - * Returns the list of properties that can be used to configure components with this component type. - * @return the list of properties that can be used to configure components with this component type - */ - List getProperties(); - - /** - * Returns the specified property - * @param name the name of the property - * @return the property with the supplied name, or null if there is no property with that name - */ - Property getProperty(String name); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredPort.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredPort.java deleted file mode 100644 index d40e852e88..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredPort.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - - -/** - * Represents a configured port (e.g. a configured reference or configured service). - */ -public interface ConfiguredPort extends AssemblyModelObject, RuntimeConfigurationHolder { - - /** - * Returns the port that is being configured. - * @return the port that is being configured - */ - Port getPort(); - - /** - * Sets the port that is being configured. - * @param port the port that is being configured - */ - void setPort(Port port); - - /** - * Returns the aggregate part containing this port. - * @return the aggregate part that contains this port - */ - AggregatePart getAggregatePart(); - - /** - * Returns the port's proxy factory - * @return the port's proxy factory - * todo should this be here or should it be provided in a sub-interface? - */ - Object getProxyFactory(); - - /** - * Sets the port's proxy factory - * @param proxyFactory the port's proxy factory - * todo should this be here or should it be provided in a sub-interface? - */ - void setProxyFactory(Object proxyFactory); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredProperty.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredProperty.java deleted file mode 100644 index 0a28c0a7bf..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredProperty.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -/** - * The configured value of a {@link Property}. - */ -public interface ConfiguredProperty extends AssemblyModelObject { - - /** - * Returns the {@link Property} whose value is being set. - * @return the {@link Property} whose value is being set - */ - Property getProperty(); - - /** - * Sets the {@link Property} whose value is being set. - * @param property the {@link Property} whose value is being set - */ - void setProperty(Property property); - - /** - * Returns the value being set for this usage of the {@link Property}. - * @return the value being set for this usage of the {@link Property} - */ - Object getValue(); - - /** - * Sets the value being set for this usage of the {@link Property}. - * @param value the value being set for this usage of the {@link Property} - */ - void setValue(Object value); - - /** - * Returns the override option that determines if any configuration for this property - * that is contained in this aggregate can be overridden by configuration supplied from outside. - */ - OverrideOption getOverrideOption(); - - /** - * Set the override option that determines if any configuration for this property - * that is contained in this aggregate can be overridden by configuration supplied from outside. - * - * @param value the option that determines how property configuration can be overriden - */ - void setOverrideOption(OverrideOption value); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredReference.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredReference.java deleted file mode 100644 index 972c6812d8..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredReference.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -import java.util.List; - -/** - * A configured reference associated with a particular usage. - */ -public interface ConfiguredReference extends ConfiguredPort { - - /** - * Returns the {@link Reference} that is being configured. - * @return the {@link Reference} that is being configured - */ - Reference getReference(); - - /** - * Sets the {@link Reference} that is being configured. - * @param reference the {@link Reference} that is being configured - */ - void setReference(Reference reference); - - /** - * Returns the list of configured services that are wired to this configured reference. - * @return the list of configured services that are wired to this configured reference - */ - List getTargetConfiguredServices(); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredService.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredService.java deleted file mode 100644 index 14b1c0abbe..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredService.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - - -/** - * A configured service associated with a particular usage. - */ -public interface ConfiguredService extends ConfiguredPort { - /** - * Returns the {@link Service} that is being configured. - * @return the {@link Service} that is being configured - */ - Service getService(); - - /** - * Sets the {@link Service} that is being configured. - * @param service the {@link Service} that is being configured - */ - void setService(Service service); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/EntryPoint.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/EntryPoint.java deleted file mode 100644 index 718ae996c5..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/EntryPoint.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -import java.util.List; - - -/** - * An entry point exposed by its containing {@link Aggregate}. - * References from outside the Aggregate can only be connected to its entry points. - */ -public interface EntryPoint extends AggregatePart, Extensible { - - /** - * Returns the bindings supported by this entry point. - * A single entry point may be bound to multiple transports. - * - * @return a list of bindings supported by this entry point - */ - List getBindings(); - - /** - * Returns the configured service exposed by this entry point. - * - * @return the configured service exposed by this entry point - */ - ConfiguredService getConfiguredService(); - - /** - * Sets the configured service exposed by this entry point. - * - * @param configuredService the configured service exposed by this entry point - */ - void setConfiguredService(ConfiguredService configuredService); - - /** - * Returns the configured reference that wires this entry point to the published service inside the aggregate. - * - * @return the reference that wires this entry point to the published service - */ - ConfiguredReference getConfiguredReference(); - - /** - * Sets the configured reference that wires this entry point to the published service inside the aggregate. - * - * @param configuredReference the configured reference that wires this entry point to the published service inside the aggregate - */ - void setConfiguredReference(ConfiguredReference configuredReference); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Extensible.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Extensible.java deleted file mode 100644 index 2a5b5878f8..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Extensible.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -import java.util.List; - -/** - * An extensible model object. - * TODO do we actually need this given we have the ability to load specializations of individual model objects - * TODO is this the bext interface for this? - */ -public interface Extensible extends AssemblyModelObject { - - /** - * Returns the extensibility elements. - */ - List getExtensibilityElements(); - - /** - * Returns the extensibility attributes. - */ - List getExtensibilityAttributes(); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ExternalService.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ExternalService.java deleted file mode 100644 index a30000f387..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ExternalService.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -import java.util.List; - - -/** - * An external service consumed by its containing {@link Aggregate}. - * All references used by the aggregate are specified as external services. - */ -public interface ExternalService extends AggregatePart, Extensible { - - /** - * Returns the bindings that can be used by operations on this external service. - * A single external service may be bound to multiple transports. - */ - List getBindings(); - - /** - * Returns the override option that determines if any wiring for this external service - * that is contained in this aggregate can be overridden by wired supplied from outside. - */ - OverrideOption getOverrideOption(); - - /** - * Set the override option that determines if any wiring for this external service - * that is contained in this aggregate can be overridden by wired supplied from outside. - * - * @param value the option that determines how wires can be overriden - */ - void setOverrideOption(OverrideOption value); - - /** - * Returns the configured service that this external service provides to other parts of the containing aggregate. - * @return the configured service that this external service provides to other parts of the containing aggregate - */ - ConfiguredService getConfiguredService(); - - /** - * Sets the configured service that this external service provides to other parts of the containing aggregate - * @param configuredService the configured service that this external service provides to other parts of the containing aggregate - */ - void setConfiguredService(ConfiguredService configuredService); -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModelInitException.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModelInitException.java deleted file mode 100644 index 4af3737a5d..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModelInitException.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -import org.apache.tuscany.model.ModelRuntimeException; - -/** - * Denotes an exception initializing an assembly model artifact - * - * @version $Rev$ $Date$ - */ -public class ModelInitException extends ModelRuntimeException { - // todo serialuid - - public ModelInitException() { - super(); - } - - public ModelInitException(String message) { - super(message); - } - - public ModelInitException(String message, Throwable cause) { - super(message, cause); - } - - public ModelInitException(Throwable cause) { - super(cause); - } - -} - diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Module.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Module.java deleted file mode 100644 index 90f9fbf9b2..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Module.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -import java.util.List; - -/** - * A specialized {@link ComponentImplementation} that defines a modular unit of assembly. - * A Module denotes the extent of assembly in which pass-by-reference semantics are supported. - */ -public interface Module extends Aggregate, ComponentImplementation { - /** - * Returns a list of assembly fragments that combine to form a single module. - * @return a list of assembly fragments that combine to form a single module - */ - List getModuleFragments(); - - /** - * Returns the specified assembly fragment. - * @param name the name of the fragment - * @return the fragment with the specified name, or null if there is no fragment with that name - */ - ModuleFragment getModuleFragment(String name); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModuleComponent.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModuleComponent.java deleted file mode 100644 index 13125076ea..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModuleComponent.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -/** - * Specialization of Component that represents a configured {@link Module}. - */ -public interface ModuleComponent extends Component { - // todo do we need this or can we just override getComponentImplementation() ? - /** - * Returns the module implementing this module component. - * @return the module implementing this module component - */ - Module getModuleImplementation(); - - /** - * Set the module implementing this module component. - * @param module the module implementing this module component - */ - void setModuleImplementation(Module module); - - /** - * Returns the uri that uniquely identifies this module component. - * @return the uri that uniquely identifies this module component - */ - String getURI(); - - /** - * Sets the uri that uniquely identifies this module component. - * @param uri the uri that uniquely identifies this module component - */ - void setURI(String uri); -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModuleFragment.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModuleFragment.java deleted file mode 100644 index f268524c3f..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModuleFragment.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -/** - * A fragment of assembly configuration within a module. - * To support flexibility and reuse, modules can be defined in multiple fragments that are - * then combined by the runtime to form the complete module definition. - */ -public interface ModuleFragment extends Aggregate { -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Multiplicity.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Multiplicity.java deleted file mode 100644 index 78ff6ede2f..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Multiplicity.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * - * Copyright 2005 BEA Systems Inc. - * Copyright 2005 International Business Machines Corporation - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -/** - * Enumeration for multiplicity. - */ -public enum Multiplicity { - /** - * Indicates a relationship that is optionally connected to the requestor and which, if supplied, - * must be connected to exactly one provider. - */ - ZERO_ONE, - - /** - * Indicates a relationship that must be connected between exactly one requestor and - * exactly one provider. - */ - ONE_ONE, - - /** - * Indicates a relationship that is optionally connects the requestor to zero to unbounded providers. - */ - ZERO_N, - - /** - * Indicates a relationship that must be connected at the requestor and which connects it to - * zero to unbounded providers. - */ - ONE_N - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/OverrideOption.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/OverrideOption.java deleted file mode 100644 index 62c7b3fb7a..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/OverrideOption.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - * Copyright 2005 BEA Systems Inc. - * Copyright 2005 International Business Machines Corporation - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -/** - * Enumeration for override options that are used to control whether configuration information - * can be overridden by larger grained definitions. - */ -public enum OverrideOption { - /** - * Indicates that the supplied configuration cannot be overridden. - */ - NO, - - /** - * Indicates that the supplied configuration may be overriden. - */ - MAY, - - /** - * Indicates that the supplied configuration must be overriden. - */ - MUST - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Port.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Port.java deleted file mode 100644 index 5dadfa0d63..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Port.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -/** - * Abstraction for the association of a service contract with a requestor or provider. - */ -public interface Port extends AssemblyModelObject { - /** - * Returns the contract for invocations of a service using this port. - * @return the oontract for invocations of a service using this port - */ - ServiceContract getServiceContract(); - - /** - * Set the contract for invocations of a service using this port. - * @param contract the contract for invocations of a service using this port - */ - void setServiceContract(ServiceContract contract); - - /** - * Returns the name of the port where it is associated with a requestor or provider. - * @return the name of the port - */ - String getName(); - - /** - * Sets the name of the port where it is associated with a requestor or provider. - * @param name the name of the port where it is associated with a requestor or provider - */ - void setName(String name); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Property.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Property.java deleted file mode 100644 index cd6a918686..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Property.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - - - -/** - * A description of a property that can be used to configure a component. - */ -public interface Property extends Extensible { - // todo should we decalre this as Property where T would be the type of this Property? - - /** - * Returns the property name. - * @return the property name - */ - String getName(); - - /** - * Sets the property name. - * @param name the property name - */ - void setName(String name); - - /** - * Returns the default value of the property. - * @return the default value of ths property - */ - Object getDefaultValue(); - - /** - * Sets the default value of the property. - * @param value the default value of ths property - */ - void setDefaultValue(Object value); - - /** - * Returns true if the property allows multiple values. - * @return true if the property allows multiple values - */ - boolean isMany(); - - /** - * Sets whether or not the property allows multiple values. - * @param value true if the property should allow multiple values - */ - void setMany(boolean value); - - /** - * Returns true if a value must be supplied for the property. - * @return true is a value must be supplied for the property - */ - boolean isRequired(); - - /** - * Sets whether a value must be supplied for the property. - * For ease of use, it is recommended that a meaningful default value should - * be supplied for all properties; users should only be required to specify - * a value if there is no reasonable default. - * - * @param value set to true to require that a value be supplied for uses of this property - */ - void setRequired(boolean value); - - /** - * Returns the type of this property as used by the runtime. - * @return the type of this property as used by the runtime - */ - Class getType(); - - /** - * Sets the type of this property as used by the runtime - * @param value the type of this property as used by the runtime - */ - void setType(Class value); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Reference.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Reference.java deleted file mode 100644 index 8cc13e98ec..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Reference.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - - -/** - * The association of a port with a requestor. - */ -public interface Reference extends Port { - /** - * Returns the multiplicity allowed for wires connected to this reference. - * @return the multiplicity allowed for wires connected to this reference - */ - Multiplicity getMultiplicity(); - - /** - * Sets the multiplicity allowed for wires connected to this reference. - * @param multiplicity the multiplicity allowed for wires connected to this reference - */ - void setMultiplicity(Multiplicity multiplicity); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/RuntimeConfigurationHolder.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/RuntimeConfigurationHolder.java deleted file mode 100644 index 7b20f2db21..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/RuntimeConfigurationHolder.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -/** - * A model object that can hold a runtime configuration object. - */ -public interface RuntimeConfigurationHolder { - - /** - * Sets the runtime configuration object. - * @param configuration the runtime configuration object - */ - void setRuntimeConfiguration(Object configuration); - - /** - * Returns the runtime configuration object. - * @return the runtime configuration object - */ - Object getRuntimeConfiguration(); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Scope.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Scope.java deleted file mode 100644 index e5209d05b5..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Scope.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 BEA Systems Inc. - * Copyright 2005 International Business Machines Corporation - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -/** - * The types of scope supported by assemblies. - */ -public enum Scope { - // todo define what these are - INSTANCE, - REQUEST, - SESSION, - MODULE, - AGGREGATE, - UNDEFINED - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Service.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Service.java deleted file mode 100644 index c73002efba..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Service.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - - -/** - * The association of a port with a provider. - */ -public interface Service extends Port { -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceContract.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceContract.java deleted file mode 100644 index 3284755ddb..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceContract.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -/** - * The contract specified by a requestor or provider for invocations across a port. - */ -public interface ServiceContract extends Extensible { - - /** - * Returns the interface for invocations from the requestor to the provider. - * @return the interface for invocations from the requestor to the provider - */ - Class getInterface(); - - /** - * Sets the interface for invocations from the requestor to the provider. - * @param value the interface for invocations from the requestor to the provider - */ - void setInterface(Class value); - - /** - * Returns the callback interface for invocation from the provider back to its requestor. - * @return the callback interface for invocation from the provider back to its requestor - */ - Class getCallbackInterface(); - - /** - * Sets the callback interface for invocation from the provider back to its requestor. - * @param value the callback interface for invocation from the provider back to its requestor - */ - void setCallbackInterface(Class value); - - /** - * Returns the scope of this service contract. - * @return - * todo missing javadoc - */ - Scope getScope(); - - /** - * Sets the scope. - * @param scope of this service contract. - * todo missing javadoc - */ - void setScope(Scope scope); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceURI.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceURI.java deleted file mode 100644 index 3b9c1ec2a7..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceURI.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - -/** - * Represents a service URI. - */ -public interface ServiceURI { - - /** - * Returns true if the address scheme is sca - * @return - */ - public boolean isSCAScheme(); - - /** - * @return Returns the address. - */ - public String getAddress(); - - /** - * Returns the module component name - * @return - */ - public String getModuleComponentName(); - - /** - * Returns the part name - * @return - */ - public String getPartName(); - - /** - * Returns the service name - * @return - */ - public String getServiceName(); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/SimpleComponent.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/SimpleComponent.java deleted file mode 100644 index 059c6dbf2d..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/SimpleComponent.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - - -/** - * A simple component, specifically not an {@link Aggregate}. - */ -public interface SimpleComponent extends Component { -} - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Subsystem.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Subsystem.java deleted file mode 100644 index 7a14847353..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Subsystem.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - - - -/** - * Represents a subsystem. - */ -public interface Subsystem extends Aggregate { - - /** - * Returns the subsystem uri. - * @return - */ - String getURI(); - - /** - * Sets the subsystem uri. - * @param value - */ - void setURI(String value); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Wire.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Wire.java deleted file mode 100644 index dfe553210a..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/Wire.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly; - - -/** - * A connection between a requestor (source) and a provider (target). - */ -public interface Wire extends Extensible { - /** - * Returns the URI for the source of the request. - * @return the URI for the source of the request - */ - ServiceURI getSource(); - - /** - * Sets the URI for the source of the request. - * @param uri the URI for the source of the request - */ - void setSource(ServiceURI uri); - - /** - * Returns the URI for the target of the request. - * @return the URI for the target of the request - */ - ServiceURI getTarget(); - - /** - * Sets the URI for the target of the request. - * @param uri the URI for the target of the request - */ - void setTarget(ServiceURI uri); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AggregateImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AggregateImpl.java deleted file mode 100644 index 234fff6600..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AggregateImpl.java +++ /dev/null @@ -1,305 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import java.io.IOException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.wsdl.Definition; -import javax.wsdl.Import; - -import org.apache.tuscany.common.resource.ResourceLoader; -import org.apache.tuscany.model.assembly.Aggregate; -import org.apache.tuscany.model.assembly.AggregatePart; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelVisitor; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.ExternalService; -import org.apache.tuscany.model.assembly.ServiceURI; -import org.apache.tuscany.model.assembly.Wire; -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.helper.XSDHelper; - -/** - * An implementation of Aggregate. - */ -public abstract class AggregateImpl extends ExtensibleImpl implements Aggregate { - - private String name; - private List components=new ArrayList(); - private Map componentsMap; - private List entryPoints=new ArrayList(); - private Map entryPointsMap; - private List externalServices=new ArrayList(); - private Map externalServicesMap; - private List aggregateParts; - private List wires=new ArrayList(); - private List wsdlImports=new ArrayList(); - private Map> wsdlImportsMap; - private AssemblyModelContext modelContext; - - /** - * Constructor - */ - protected AggregateImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.Aggregate#getName() - */ - public String getName() { - return name; - } - - /** - * @see org.apache.tuscany.model.assembly.Aggregate#setName(java.lang.String) - */ - public void setName(String newName) { - checkNotFrozen(); - name=newName; - } - - /** - * @see org.apache.tuscany.model.assembly.Aggregate#getComponents() - */ - public List getComponents() { - return components; - } - - /** - * @see org.apache.tuscany.model.assembly.Aggregate#getComponent(java.lang.String) - */ - public Component getComponent(String name) { - checkInitialized(); - return componentsMap.get(name); - } - - /** - * @see org.apache.tuscany.model.assembly.Aggregate#getEntryPoints() - */ - public List getEntryPoints() { - return entryPoints; - } - - /** - * @see org.apache.tuscany.model.assembly.Aggregate#getEntryPoint(java.lang.String) - */ - public EntryPoint getEntryPoint(String name) { - checkInitialized(); - return entryPointsMap.get(name); - } - - /** - * @see org.apache.tuscany.model.assembly.Aggregate#getExternalServices() - */ - public List getExternalServices() { - return externalServices; - } - - /** - * @see org.apache.tuscany.model.assembly.Aggregate#getExternalService(java.lang.String) - */ - public ExternalService getExternalService(String name) { - checkInitialized(); - return externalServicesMap.get(name); - } - - /** - * @see org.apache.tuscany.model.assembly.Aggregate#getAggregateParts() - */ - public List getAggregateParts() { - checkInitialized(); - return aggregateParts; - } - - /** - * @see org.apache.tuscany.model.assembly.Aggregate#getWires() - */ - public List getWires() { - return wires; - } - - /** - * @see org.apache.tuscany.model.assembly.Aggregate#getWSDLImports() - */ - public List getWSDLImports() { - return wsdlImports; - } - - /** - * @see org.apache.tuscany.model.assembly.Aggregate#getWSDLImports(java.lang.String) - */ - public List getWSDLImports(String namespace) { - checkInitialized(); - return wsdlImportsMap.get(namespace); - } - - /** - * @see org.apache.tuscany.model.assembly.Aggregate#getAssemblyModelContext() - */ - public AssemblyModelContext getAssemblyModelContext() { - checkInitialized(); - return modelContext; - } - - /** - * @see org.apache.tuscany.model.assembly.Aggregate#getConfiguredService(org.apache.tuscany.model.assembly.ServiceURI) - */ - public ConfiguredService getConfiguredService(ServiceURI address) { - String partName = address.getPartName(); - String serviceName = address.getServiceName(); - Component component = getComponent(partName); - if (component != null) { - if (serviceName != null) { - return component.getConfiguredService(serviceName); - } else { - if (!component.getConfiguredServices().isEmpty()) { - return component.getConfiguredServices().get(0); - } else { - return null; - } - } - - } else { - ExternalService externalService = getExternalService(partName); - if (externalService != null) { - return externalService.getConfiguredService(); - } else { - return null; - } - } - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) - */ - public void initialize(AssemblyModelContext modelContext) { - if (isInitialized()) - return; - super.initialize(modelContext); - - // Save the model context - this.modelContext=modelContext; - - // Populate map of WSDL imports - ResourceLoader resourceLoader=modelContext.getApplicationResourceLoader(); - wsdlImportsMap = new HashMap>(); - for (Import wsdlImport : wsdlImports) { - String namespace=wsdlImport.getNamespaceURI(); - List list=wsdlImportsMap.get(namespace); - if (list==null) { - list=new ArrayList(); - wsdlImportsMap.put(namespace, list); - } - list.add(wsdlImport); - - // Load the WSDL definition if necessary - if (wsdlImport.getDefinition()==null) { - String location=wsdlImport.getLocationURI(); - Definition definition; - ClassLoader ccl=Thread.currentThread().getContextClassLoader(); - try { - URL url=resourceLoader.getResource(location); - if (url==null) - throw new IllegalArgumentException("Cannot find "+location); - definition = modelContext.getAssemblyLoader().loadDefinition(url.toString()); - Thread.currentThread().setContextClassLoader(modelContext.getApplicationResourceLoader().getClassLoader()); - XSDHelper xsdHelper=SDOUtil.createXSDHelper(modelContext.getTypeHelper()); - xsdHelper.define (url.openStream(), null); - } catch (IOException e) { - throw new IllegalArgumentException(e); - } finally { - Thread.currentThread().setContextClassLoader(ccl); - } - wsdlImport.setDefinition(definition); - } - } - - // Populate maps of components, entry points and external services - aggregateParts = new ArrayList(); - componentsMap = new HashMap(); - for (Component component : components) { - componentsMap.put(component.getName(), component); - aggregateParts.add(component); - component.initialize(modelContext); - ((AggregatePartImpl)component).setAggregate(this); - } - entryPointsMap = new HashMap(); - for (EntryPoint entryPoint : entryPoints) { - entryPointsMap.put(entryPoint.getName(), entryPoint); - aggregateParts.add(entryPoint); - entryPoint.initialize(modelContext); - ((AggregatePartImpl)entryPoint).setAggregate(this); - } - externalServicesMap = new HashMap(); - for (ExternalService externalService : externalServices) { - externalServicesMap.put(externalService.getName(), externalService); - aggregateParts.add(externalService); - externalService.initialize(modelContext); - ((AggregatePartImpl)externalService).setAggregate(this); - } - for (Wire wire : wires) { - wire.initialize(modelContext); - } - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#freeze() - */ - public void freeze() { - if (isFrozen()) - return; - super.freeze(); - - // Freeze lists - wsdlImports=Collections.unmodifiableList(wsdlImports); - freeze(wsdlImports); - components=Collections.unmodifiableList(components); - freeze(components); - entryPoints=Collections.unmodifiableList(entryPoints); - freeze(entryPoints); - externalServices=Collections.unmodifiableList(externalServices); - freeze(externalServices); - wires=Collections.unmodifiableList(wires); - freeze(wires); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor) - */ - public boolean accept(AssemblyModelVisitor visitor) { - if (!super.accept(visitor)) - return false; - - if (!accept(aggregateParts, visitor)) - return false; - - if (!accept(wires, visitor)) - return false; - - return true; - } - -} //ModuleImpl diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AggregatePartImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AggregatePartImpl.java deleted file mode 100644 index b9a4434c58..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AggregatePartImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import org.apache.tuscany.model.assembly.Aggregate; -import org.apache.tuscany.model.assembly.AggregatePart; - -/** - * Implementation of AggregatePart. - */ -public abstract class AggregatePartImpl extends ExtensibleImpl implements AggregatePart { - private Aggregate aggregate; - private String name; - - /** - * Constructor - */ - protected AggregatePartImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.AggregatePart#getName() - */ - public String getName() { - return name; - } - - /** - * @see org.apache.tuscany.model.assembly.AggregatePart#setName(java.lang.String) - */ - public void setName(String value) { - checkNotFrozen(); - name=value; - } - - /** - * @see org.apache.tuscany.model.assembly.AggregatePart#getAggregate() - */ - public Aggregate getAggregate() { - checkInitialized(); - return aggregate; - } - - /** - * Sets the aggregate containing this aggregate part. - * @param aggregate - */ - protected void setAggregate(Aggregate aggregate) { - checkNotFrozen(); - this.aggregate=aggregate; - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyFactoryImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyFactoryImpl.java deleted file mode 100644 index 0c2550ab10..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyFactoryImpl.java +++ /dev/null @@ -1,204 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.model.assembly.AggregatePart; -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.ComponentType; -import org.apache.tuscany.model.assembly.ConfiguredPort; -import org.apache.tuscany.model.assembly.ConfiguredProperty; -import org.apache.tuscany.model.assembly.ConfiguredReference; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.ExternalService; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.ModuleComponent; -import org.apache.tuscany.model.assembly.ModuleFragment; -import org.apache.tuscany.model.assembly.Property; -import org.apache.tuscany.model.assembly.Reference; -import org.apache.tuscany.model.assembly.Service; -import org.apache.tuscany.model.assembly.ServiceURI; -import org.apache.tuscany.model.assembly.SimpleComponent; -import org.apache.tuscany.model.assembly.Subsystem; -import org.apache.tuscany.model.assembly.Wire; -import org.apache.tuscany.model.types.java.JavaServiceContract; -import org.apache.tuscany.model.types.java.impl.JavaServiceContractImpl; -import org.apache.tuscany.model.types.wsdl.WSDLServiceContract; -import org.apache.tuscany.model.types.wsdl.impl.WSDLServiceContractImpl; - -/** - * Default implementation of AssemblyFactory - */ -public class AssemblyFactoryImpl implements AssemblyFactory { - - /** - * Constructor - */ - public AssemblyFactoryImpl() { - super(); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createSimpleComponent() - */ - public SimpleComponent createSimpleComponent() { - return new SimpleComponentImpl(); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createComponentType() - */ - public ComponentType createComponentType() { - return new ComponentTypeImpl(); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createEntryPoint() - */ - public EntryPoint createEntryPoint() { - return new EntryPointImpl(); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createExternalService() - */ - public ExternalService createExternalService() { - return new ExternalServiceImpl(); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createJavaServiceContract() - */ - public JavaServiceContract createJavaServiceContract() { - return new JavaServiceContractImpl(); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createModule() - */ - public Module createModule() { - return new ModuleImpl(); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createModuleFragment() - */ - public ModuleFragment createModuleFragment() { - return new ModuleFragmentImpl(); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createModuleComponent() - */ - public ModuleComponent createModuleComponent() { - return new ModuleComponentImpl(); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createProperty() - */ - public Property createProperty() { - return new PropertyImpl(); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createConfiguredProperty() - */ - public ConfiguredProperty createConfiguredProperty() { - return new ConfiguredPropertyImpl(); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createReference() - */ - public Reference createReference() { - return new ReferenceImpl(); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createConfiguredReference() - */ - public ConfiguredReference createConfiguredReference() { - return new ConfiguredReferenceImpl(); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createService() - */ - public Service createService() { - return new ServiceImpl(); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createConfiguredService() - */ - public ConfiguredService createConfiguredService() { - return new ConfiguredServiceImpl(); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createSubsystem() - */ - public Subsystem createSubsystem() { - return new SubsystemImpl(); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createWSDLServiceContract() - */ - public WSDLServiceContract createWSDLServiceContract() { - return new WSDLServiceContractImpl(); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createServiceURI(java.lang.String) - */ - public ServiceURI createServiceURI(String uri) { - return new ServiceURIImpl(uri); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createServiceURI(org.apache.tuscany.model.assembly.ModuleComponent, java.lang.String) - */ - public ServiceURI createServiceURI(ModuleComponent moduleComponent, String serviceName) { - return new ServiceURIImpl(moduleComponent, serviceName); - } - - /* - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createServiceURI(org.apache.tuscany.model.assembly.ModuleComponent, org.apache.tuscany.model.assembly.AggregatePart, org.apache.tuscany.model.assembly.ConfiguredPort) - */ - public ServiceURI createServiceURI(ModuleComponent moduleComponent, AggregatePart aggregatePart, ConfiguredPort configuredPort) { - return new ServiceURIImpl(moduleComponent, aggregatePart, configuredPort); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createQName(java.lang.String) - */ - public QName createQName(String uri) { - int h = uri.indexOf('#'); - return new QName(uri.substring(0, h), uri.substring(h + 1)); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyFactory#createWire() - */ - public Wire createWire() { - return new WireImpl(); - } -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyModelContextImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyModelContextImpl.java deleted file mode 100644 index 221b3e0af6..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyModelContextImpl.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import org.apache.tuscany.common.resource.ResourceLoader; -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.loader.AssemblyModelLoader; -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.helper.TypeHelper; - -/** - */ -public class AssemblyModelContextImpl implements AssemblyModelContext { - - private final AssemblyFactory assemblyFactory; - private final AssemblyModelLoader assemblyLoader; - private final ResourceLoader systemResourceLoader; - private final ResourceLoader applicationResourceLoader; - private final TypeHelper typeHelper; - - public AssemblyModelContextImpl(AssemblyModelLoader assemblyLoader, ResourceLoader resourceLoader) { - this(new AssemblyFactoryImpl(), assemblyLoader, resourceLoader, resourceLoader); - } - - public AssemblyModelContextImpl(AssemblyFactory assemblyFactory, AssemblyModelLoader assemblyLoader, ResourceLoader resourceLoader) { - this(assemblyFactory, assemblyLoader, resourceLoader, resourceLoader); - } - - public AssemblyModelContextImpl(AssemblyFactory assemblyFactory, AssemblyModelLoader assemblyLoader, ResourceLoader resourceLoader, ResourceLoader artifactLoader) { - this(assemblyFactory, assemblyLoader, resourceLoader, artifactLoader, SDOUtil.createTypeHelper()); - } - - public AssemblyModelContextImpl(AssemblyFactory assemblyFactory, AssemblyModelLoader assemblyLoader, ResourceLoader resourceLoader, ResourceLoader artifactLoader, TypeHelper typeHelper) { - this.assemblyFactory = assemblyFactory; - this.assemblyLoader = assemblyLoader; - this.systemResourceLoader = resourceLoader; - this.applicationResourceLoader = artifactLoader; - this.typeHelper=typeHelper; - - //FIXME the caller should configure the assemblyLoader himself - if (assemblyLoader!=null) - assemblyLoader.setModelContext(this); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelContext#getAssemblyFactory() - */ - public AssemblyFactory getAssemblyFactory() { - return assemblyFactory; - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelContext#getSystemResourceLoader() - */ - public ResourceLoader getSystemResourceLoader() { - return systemResourceLoader; - } - - public ResourceLoader getApplicationResourceLoader() { - return applicationResourceLoader; - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelContext#getAssemblyLoader() - */ - public AssemblyModelLoader getAssemblyLoader() { - return assemblyLoader; - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelContext#getTypeHelper() - */ - public TypeHelper getTypeHelper() { - return typeHelper; - } -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyModelObjectImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyModelObjectImpl.java deleted file mode 100644 index 356fc4f0a9..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyModelObjectImpl.java +++ /dev/null @@ -1,132 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import java.util.Collection; - -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelObject; -import org.apache.tuscany.model.assembly.AssemblyModelVisitor; - -/** - * A base class for assembly model objects. - */ -public abstract class AssemblyModelObjectImpl implements AssemblyModelObject { - - private boolean frozen; - private boolean initialized; - - /** - * Constructor - */ - protected AssemblyModelObjectImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor) - */ - public boolean accept(AssemblyModelVisitor visitor) { - return visitor.visit(this); - } - - /** - * Walk a visitor through a collection of model objects. - * @param collection - * @param visitor - * @return - */ - protected boolean accept(Collection collection, AssemblyModelVisitor visitor) { - for (Object member : collection) { - if (member instanceof AssemblyModelObject) { - if (!((AssemblyModelObject)member).accept(visitor)) - return false; - } - } - return true; - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#freeze() - */ - public void freeze() { - if (!frozen) - frozen=true; - } - - /** - * Returns true if the object is frozen - */ - protected boolean isFrozen() { - return frozen; - } - - /** - * Freeze members of a collection - */ - protected void freeze(Collection collection) { - for (Object member : collection) { - if (member instanceof AssemblyModelObject) { - ((AssemblyModelObject)member).freeze(); - } - } - } - - /** - * Check that the current model object can be modified. - * @throws IllegalStateException - */ - protected void checkNotFrozen() { - if (frozen) - throw new IllegalStateException("Attempt to modify a frozen assembly model"); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) - */ - public void initialize(AssemblyModelContext modelContext) { - if (!initialized) - initialized=true; - } - - /** - * Returns true if the object is initialized - */ - protected boolean isInitialized() { - return initialized; - } - - /** - * Initialize members of a collection - */ - protected void initialize(Collection collection, AssemblyModelContext modelContext) { - for (Object member : collection) { - if (member instanceof AssemblyModelObject) { - ((AssemblyModelObject)member).initialize(modelContext); - } - } - } - - /** - * Check that the current model object is initialized. - * @throws IllegalStateException - */ - protected void checkInitialized() { - if (!initialized) - throw new IllegalStateException("Attempt to use an uninitialized assembly model"); - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/BindingImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/BindingImpl.java deleted file mode 100644 index cd1f0e2cb4..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/BindingImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelVisitor; -import org.apache.tuscany.model.assembly.Binding; - -/** - * An implementation of Binding. - */ -public class BindingImpl extends ExtensibleImpl implements Binding { - - private String uri; - private Object runtimeConfiguration; - - /** - * Constructor - */ - protected BindingImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.Binding#getURI() - */ - public String getURI() { - return uri; - } - - /** - * @see org.apache.tuscany.model.assembly.Binding#setURI(java.lang.String) - */ - public void setURI(String value) { - checkNotFrozen(); - uri=value; - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) - */ - public void initialize(AssemblyModelContext modelContext) { - if (isInitialized()) - return; - super.initialize(modelContext); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#freeze() - */ - public void freeze() { - if (isFrozen()) - return; - super.freeze(); - - } - - /** - * @see org.apache.tuscany.model.assembly.RuntimeConfigurationHolder#getRuntimeConfiguration() - */ - public Object getRuntimeConfiguration() { - return runtimeConfiguration; - } - - /** - * @see org.apache.tuscany.model.assembly.RuntimeConfigurationHolder#setRuntimeConfiguration(java.lang.Object) - */ - public void setRuntimeConfiguration(Object configuration) { - checkNotFrozen(); - this.runtimeConfiguration = configuration; - } - - /** - * @see org.apache.tuscany.model.assembly.impl.AggregateImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor) - */ - public boolean accept(AssemblyModelVisitor visitor) { - if (!super.accept(visitor)) - return false; - - return true; - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentImpl.java deleted file mode 100644 index 2033ebe7f7..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentImpl.java +++ /dev/null @@ -1,222 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelVisitor; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.ComponentImplementation; -import org.apache.tuscany.model.assembly.ConfiguredProperty; -import org.apache.tuscany.model.assembly.ConfiguredReference; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.Property; -import org.apache.tuscany.model.assembly.Reference; -import org.apache.tuscany.model.assembly.Service; - -/** - * An implementation of Component. - */ -public abstract class ComponentImpl extends AggregatePartImpl implements Component { - - private List configuredReferences=new ArrayList(); - private Map configuredReferencesMap; - private List configuredServices=new ArrayList(); - private Map configuredServicesMap; - private List configuredProperties=new ArrayList(); - private Map configuredPropertiesMap; - private ComponentImplementation implementation; - - /** - * @see org.apache.tuscany.model.assembly.Component#getComponentImplementation() - */ - public ComponentImplementation getComponentImplementation() { - return implementation; - } - - /** - * @see org.apache.tuscany.model.assembly.Component#setComponentImplementation(org.apache.tuscany.model.assembly.ComponentImplementation) - */ - public void setComponentImplementation(ComponentImplementation value) { - checkNotFrozen(); - implementation=value; - } - - /** - * @see org.apache.tuscany.model.assembly.Component#getConfiguredServices() - */ - public List getConfiguredServices() { - return configuredServices; - } - - public ConfiguredService getConfiguredService(String name) { - checkInitialized(); - return configuredServicesMap.get(name); - } - - /** - * @see org.apache.tuscany.model.assembly.Component#getConfiguredReferences() - */ - public List getConfiguredReferences() { - return configuredReferences; - } - - /** - * @see org.apache.tuscany.model.assembly.Component#getConfiguredReference(java.lang.String) - */ - public ConfiguredReference getConfiguredReference(String name) { - checkInitialized(); - return configuredReferencesMap.get(name); - } - - /** - * @see org.apache.tuscany.model.assembly.Component#getConfiguredProperties() - */ - public List getConfiguredProperties() { - return configuredProperties; - } - - /** - * @see org.apache.tuscany.model.assembly.Component#getConfiguredProperty(java.lang.String) - */ - public ConfiguredProperty getConfiguredProperty(String name) { - checkInitialized(); - return configuredPropertiesMap.get(name); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) - */ - public void initialize(AssemblyModelContext modelContext) { - if (isInitialized()) - return; - super.initialize(modelContext); - - // Initialize the implementation - ComponentImplementation implementation = getComponentImplementation(); - if (implementation != null) { - implementation.initialize(modelContext); - } - - // Derive the configured services, references and properties from the component implementation - //FIXME we have two options here: either just index the configured services, references and properties - // that we find in the corresponding lists, or derive them from the services, references and properties on - // the component type, for now just check if the lists are empty or not to determine which option to go with - configuredServicesMap = new HashMap(); - configuredReferencesMap = new HashMap(); - configuredPropertiesMap = new HashMap(); - if (configuredServices.isEmpty() && configuredReferences.isEmpty() && configuredProperties.isEmpty()) { - if (implementation != null) { - AssemblyFactory factory = modelContext.getAssemblyFactory(); - for (Service service : implementation.getComponentType().getServices()) { - ConfiguredService configuredService = factory.createConfiguredService(); - configuredService.setPort(service); - configuredServices.add(configuredService); - configuredServicesMap.put(service.getName(), configuredService); - ((ConfiguredPortImpl)configuredService).setAggregatePart(this); - configuredService.initialize(modelContext); - } - - for (Reference reference : implementation.getComponentType().getReferences()) { - ConfiguredReference configuredReference = factory.createConfiguredReference(); - configuredReference.setPort(reference); - configuredReferences.add(configuredReference); - configuredReferencesMap.put(reference.getName(), configuredReference); - ((ConfiguredPortImpl)configuredReference).setAggregatePart(this); - configuredReference.initialize(modelContext); - } - - // Derive configured properties from the properties on the component type - for (Property property : implementation.getComponentType().getProperties()) { - ConfiguredProperty configuredProperty = factory.createConfiguredProperty(); - configuredProperty.setProperty(property); - configuredProperties.add(configuredProperty); - configuredPropertiesMap.put(property.getName(), configuredProperty); - configuredProperty.initialize(modelContext); - } - - } - } else { - - // Just populate the maps of services, references and properties from the contents of - // the corresponding lists - for (ConfiguredService configuredService : configuredServices) { - configuredServicesMap.put(configuredService.getService().getName(), configuredService); - ((ConfiguredPortImpl)configuredService).setAggregatePart(this); - configuredService.initialize(modelContext); - } - - for (ConfiguredReference configuredReference : configuredReferences) { - configuredReferencesMap.put(configuredReference.getReference().getName(), configuredReference); - ((ConfiguredPortImpl)configuredReference).setAggregatePart(this); - configuredReference.initialize(modelContext); - } - - for (ConfiguredProperty configuredProperty : configuredProperties) { - configuredPropertiesMap.put(configuredProperty.getProperty().getName(), configuredProperty); - configuredProperty.initialize(modelContext); - } - } - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#freeze() - */ - public void freeze() { - if (isFrozen()) - return; - super.freeze(); - - // Freeze configured services, references and properties - configuredServices=Collections.unmodifiableList(configuredServices); - freeze(configuredServices); - configuredReferences=Collections.unmodifiableList(configuredReferences); - freeze(configuredReferences); - configuredProperties=Collections.unmodifiableList(configuredProperties); - freeze(configuredProperties); - if (implementation!=null) - implementation.freeze(); - } - - /** - * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor) - */ - public boolean accept(AssemblyModelVisitor visitor) { - if (!super.accept(visitor)) - return false; - - if (!accept(configuredServices, visitor)) - return false; - if (!accept(configuredReferences, visitor)) - return false; - if (!accept(configuredProperties, visitor)) - return false; - if (implementation!=null) { - if (!implementation.accept(visitor)) - return false; - } - - return true; - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentImplementationImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentImplementationImpl.java deleted file mode 100644 index f14a86c713..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentImplementationImpl.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelVisitor; -import org.apache.tuscany.model.assembly.ComponentImplementation; -import org.apache.tuscany.model.assembly.ComponentType; - -/** - * An implementation of ComponentImplementation. - */ -public class ComponentImplementationImpl extends ExtensibleImpl implements ComponentImplementation { - - private ComponentType componentType; - private Object runtimeConfiguration; - - /** - * Constructor - */ - protected ComponentImplementationImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.ComponentImplementation#getComponentType() - */ - public ComponentType getComponentType() { - return componentType; - } - - /** - * @see org.apache.tuscany.model.assembly.ComponentImplementation#setComponentType(org.apache.tuscany.model.assembly.ComponentType) - */ - public void setComponentType(ComponentType componentType) { - checkNotFrozen(); - this.componentType=componentType; - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) - */ - public void initialize(AssemblyModelContext modelContext) { - if (isInitialized()) - return; - super.initialize(modelContext); - - if (componentType!=null) - componentType.initialize(modelContext); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#freeze() - */ - public void freeze() { - if (isFrozen()) - return; - super.freeze(); - - // Freeze component type - if (componentType!=null) - componentType.freeze(); - } - - /** - * @see org.apache.tuscany.model.assembly.RuntimeConfigurationHolder#getRuntimeConfiguration() - */ - public Object getRuntimeConfiguration() { - return runtimeConfiguration; - } - - /** - * @see org.apache.tuscany.model.assembly.RuntimeConfigurationHolder#setRuntimeConfiguration(java.lang.Object) - */ - public void setRuntimeConfiguration(Object configuration) { - checkNotFrozen(); - this.runtimeConfiguration = configuration; - } - - /** - * @see org.apache.tuscany.model.assembly.impl.AggregateImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor) - */ - public boolean accept(AssemblyModelVisitor visitor) { - if (!super.accept(visitor)) - return false; - - if (componentType!=null) { - if (!componentType.accept(visitor)) - return false; - } - - return true; - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentTypeImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentTypeImpl.java deleted file mode 100644 index baef2e9b2a..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentTypeImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelVisitor; -import org.apache.tuscany.model.assembly.ComponentType; -import org.apache.tuscany.model.assembly.Property; -import org.apache.tuscany.model.assembly.Reference; -import org.apache.tuscany.model.assembly.Service; - -/** - * An implementation of ComponentType. - */ -public class ComponentTypeImpl extends ExtensibleImpl implements ComponentType { - - private List references=new ArrayList(); - private Map referencesMap; - private List services=new ArrayList(); - private Map servicesMap; - private List properties=new ArrayList(); - private Map propertiesMap; - - /** - * Constructor - */ - protected ComponentTypeImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.ComponentType#getReferences() - */ - public List getReferences() { - return references; - } - - /** - * @see org.apache.tuscany.model.assembly.ComponentType#getReference(java.lang.String) - */ - public Reference getReference(String name) { - checkInitialized(); - return referencesMap.get(name); - } - - /** - * @see org.apache.tuscany.model.assembly.ComponentType#getServices() - */ - public List getServices() { - return services; - } - - /** - * @see org.apache.tuscany.model.assembly.ComponentType#getService(java.lang.String) - */ - public Service getService(String name) { - checkInitialized(); - return servicesMap.get(name); - } - - /** - * @see org.apache.tuscany.model.assembly.ComponentType#getProperties() - */ - public List getProperties() { - return properties; - } - - /** - * @see org.apache.tuscany.model.assembly.ComponentType#getProperty(java.lang.String) - */ - public Property getProperty(String name) { - checkInitialized(); - return propertiesMap.get(name); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) - */ - public void initialize(AssemblyModelContext modelContext) { - if (isInitialized()) - return; - super.initialize(modelContext); - - // Populate maps of references, properties and services - referencesMap = new HashMap(); - for (Reference reference : references) { - referencesMap.put(reference.getName(), reference); - reference.initialize(modelContext); - } - propertiesMap = new HashMap(); - for (Property property : properties) { - propertiesMap.put(property.getName(), property); - property.initialize(modelContext); - } - servicesMap = new HashMap(); - for (Service service : services) { - servicesMap.put(service.getName(), service); - service.initialize(modelContext); - } - } - - public void freeze() { - if (isFrozen()) - return; - super.freeze(); - - // Freeze lists of services, references and properties - services=Collections.unmodifiableList(services); - freeze(services); - references=Collections.unmodifiableList(references); - freeze(references); - properties=Collections.unmodifiableList(properties); - freeze(properties); - } - - /** - * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor) - */ - public boolean accept(AssemblyModelVisitor visitor) { - if (!super.accept(visitor)) - return false; - - if (!accept(services, visitor)) - return false; - if (!accept(references, visitor)) - return false; - if (!accept(properties, visitor)) - return false; - - return true; - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPortImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPortImpl.java deleted file mode 100644 index 9662d13dc7..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPortImpl.java +++ /dev/null @@ -1,142 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import org.apache.tuscany.model.assembly.AggregatePart; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelVisitor; -import org.apache.tuscany.model.assembly.ConfiguredPort; -import org.apache.tuscany.model.assembly.Port; - -/** - * Implementation of ConfiguredPort. - */ -public abstract class ConfiguredPortImpl extends AssemblyModelObjectImpl implements ConfiguredPort { - private AggregatePart aggregatePart; - private Port port; - - private Object runtimeConfiguration; - private Object proxyFactory; - - /** - * Constructor - */ - protected ConfiguredPortImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.ConfiguredPort#getPort() - */ - public Port getPort() { - return port; - } - - /** - * @see org.apache.tuscany.model.assembly.ConfiguredPort#setPort(org.apache.tuscany.model.assembly.Port) - */ - public void setPort(Port port) { - checkNotFrozen(); - this.port = port; - } - - /** - * @see org.apache.tuscany.model.assembly.ConfiguredPort#getAggregatePart() - */ - public AggregatePart getAggregatePart() { - checkInitialized(); - return aggregatePart; - } - - /** - * Sets the aggregate part containing this configured port. - * @param aggregatePart - */ - protected void setAggregatePart(AggregatePart aggregatePart) { - checkNotFrozen(); - this.aggregatePart=aggregatePart; - } - - /** - * @see org.apache.tuscany.model.assembly.ConfiguredPort#getProxyFactory() - */ - public Object getProxyFactory() { - return proxyFactory; - } - - /** - * @see org.apache.tuscany.model.assembly.ConfiguredPort#setProxyFactory(java.lang.Object) - */ - public void setProxyFactory(Object proxyFactory) { - checkNotFrozen(); - this.proxyFactory = proxyFactory; - } - - /** - * @see org.apache.tuscany.model.assembly.RuntimeConfigurationHolder#getRuntimeConfiguration() - */ - public Object getRuntimeConfiguration() { - return runtimeConfiguration; - } - - /** - * @see org.apache.tuscany.model.assembly.RuntimeConfigurationHolder#setRuntimeConfiguration(java.lang.Object) - */ - public void setRuntimeConfiguration(Object configuration) { - checkNotFrozen(); - runtimeConfiguration = configuration; - } - - /** - * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) - */ - public void initialize(AssemblyModelContext modelContext) { - if (isInitialized()) - return; - super.initialize(modelContext); - - if (port!=null) - port.initialize(modelContext); - } - - /** - * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#freeze() - */ - public void freeze() { - if (isFrozen()) - return; - super.freeze(); - - if (port!=null) - port.freeze(); - } - - /** - * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor) - */ - public boolean accept(AssemblyModelVisitor visitor) { - if (!super.accept(visitor)) - return false; - - if (port!=null) { - if (!port.accept(visitor)) - return false; - } - - return true; - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPropertyImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPropertyImpl.java deleted file mode 100644 index 477c62ad44..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPropertyImpl.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelVisitor; -import org.apache.tuscany.model.assembly.ConfiguredProperty; -import org.apache.tuscany.model.assembly.OverrideOption; -import org.apache.tuscany.model.assembly.Property; - -/** - * Implementation of ConfiguredProperty - */ -public class ConfiguredPropertyImpl extends AssemblyModelObjectImpl implements ConfiguredProperty { - private Property property; - private OverrideOption overrideOption; - private Object value; - - /** - * Constructor - */ - protected ConfiguredPropertyImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.ConfiguredProperty#getProperty() - */ - public Property getProperty() { - return property; - } - - /** - * @see org.apache.tuscany.model.assembly.ConfiguredProperty#setProperty(org.apache.tuscany.model.assembly.Property) - */ - public void setProperty(Property property) { - checkNotFrozen(); - this.property = property; - } - - /** - * @see org.apache.tuscany.model.assembly.ConfiguredProperty#getValue() - */ - public Object getValue() { - return value; - } - - /** - * @see org.apache.tuscany.model.assembly.ConfiguredProperty#setValue(java.lang.Object) - */ - public void setValue(Object value) { - checkNotFrozen(); - this.value = value; - } - - /* - * @see org.apache.tuscany.model.assembly.ConfiguredProperty#getOverrideOption() - */ - public OverrideOption getOverrideOption() { - return overrideOption; - } - - /* - * @see org.apache.tuscany.model.assembly.ConfiguredProperty#setOverrideOption(org.apache.tuscany.model.assembly.OverrideOption) - */ - public void setOverrideOption(OverrideOption value) { - checkNotFrozen(); - this.overrideOption=value; - } - - /** - * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) - */ - public void initialize(AssemblyModelContext modelContext) { - if (isInitialized()) - return; - super.initialize(modelContext); - - if (property!=null) - property.initialize(modelContext); - } - - /** - * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#freeze() - */ - public void freeze() { - if (isFrozen()) - return; - super.freeze(); - - if (property!=null) - property.freeze(); - } - - /** - * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor) - */ - public boolean accept(AssemblyModelVisitor visitor) { - if (!super.accept(visitor)) - return false; - - if (property!=null) { - if (!property.accept(visitor)) - return false; - } - - return true; - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredReferenceImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredReferenceImpl.java deleted file mode 100644 index c9bc9b332f..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredReferenceImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.apache.tuscany.model.assembly.ConfiguredReference; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.Reference; - -/** - * An implementation of ConfiguredReference. - */ -public class ConfiguredReferenceImpl extends ConfiguredPortImpl implements ConfiguredReference { - - private List targetConfiguredServices = new ArrayList(); - - /** - * Constructor - */ - protected ConfiguredReferenceImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.ConfiguredReference#getReference() - */ - public Reference getReference() { - return (Reference) super.getPort(); - } - - /** - * @see org.apache.tuscany.model.assembly.ConfiguredReference#setReference(org.apache.tuscany.model.assembly.Reference) - */ - public void setReference(Reference reference) { - checkNotFrozen(); - super.setPort(reference); - } - - /** - * @see org.apache.tuscany.model.assembly.ConfiguredReference#getTargetConfiguredServices() - */ - public List getTargetConfiguredServices() { - return targetConfiguredServices; - } - - /** - * @see org.apache.tuscany.model.assembly.impl.ConfiguredPortImpl#freeze() - */ - public void freeze() { - super.freeze(); - - // Freeze list of configured services - targetConfiguredServices=Collections.unmodifiableList(targetConfiguredServices); - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredServiceImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredServiceImpl.java deleted file mode 100644 index 3e5d1a9cf5..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredServiceImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.Service; - -/** - * An implementation of ConfiguredService. - */ -public class ConfiguredServiceImpl extends ConfiguredPortImpl implements ConfiguredService { - - /** - * Constructor - */ - protected ConfiguredServiceImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.ConfiguredService#getService() - */ - public Service getService() { - return (Service) super.getPort(); - } - - /** - * @see org.apache.tuscany.model.assembly.ConfiguredService#setService(org.apache.tuscany.model.assembly.Service) - */ - public void setService(Service service) { - checkNotFrozen(); - super.setPort(service); - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/EntryPointImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/EntryPointImpl.java deleted file mode 100644 index 0d39089be9..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/EntryPointImpl.java +++ /dev/null @@ -1,145 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelVisitor; -import org.apache.tuscany.model.assembly.Binding; -import org.apache.tuscany.model.assembly.ConfiguredReference; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.EntryPoint; - -/** - * An implementation of EntryPoint. - */ -public class EntryPointImpl extends AggregatePartImpl implements EntryPoint { - - private ConfiguredService configuredService; - private ConfiguredReference configuredReference; - private List bindings=new ArrayList(); - - /** - * Constructor - */ - protected EntryPointImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.EntryPoint#getConfiguredReference() - */ - public ConfiguredReference getConfiguredReference() { - return configuredReference; - } - - /** - * @see org.apache.tuscany.model.assembly.EntryPoint#setConfiguredReference(org.apache.tuscany.model.assembly.ConfiguredReference) - */ - public void setConfiguredReference(ConfiguredReference configuredReference) { - checkNotFrozen(); - this.configuredReference=configuredReference; - } - - /** - * @see org.apache.tuscany.model.assembly.EntryPoint#getConfiguredService() - */ - public ConfiguredService getConfiguredService() { - return configuredService; - } - - /** - * @see org.apache.tuscany.model.assembly.EntryPoint#setConfiguredService(org.apache.tuscany.model.assembly.ConfiguredService) - */ - public void setConfiguredService(ConfiguredService configuredService) { - checkNotFrozen(); - this.configuredService=configuredService; - } - - /** - * @see org.apache.tuscany.model.assembly.EntryPoint#getBindings() - */ - public List getBindings() { - return bindings; - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) - */ - public void initialize(AssemblyModelContext modelContext) { - if (isInitialized()) - return; - super.initialize(modelContext); - - // Initialize the service contract and reference to the published service - if (configuredReference != null) { - ((ConfiguredPortImpl)configuredReference).setAggregatePart(this); - configuredReference.initialize(modelContext); - } - if (configuredService != null) { - ((ConfiguredPortImpl)configuredService).setAggregatePart(this); - configuredService.initialize(modelContext); - } - - // Initialize the bindings - initialize(bindings, modelContext); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#freeze() - */ - public void freeze() { - if (isFrozen()) - return; - super.freeze(); - - // Freeze the service contract and configured reference - if (configuredReference != null) - configuredReference.freeze(); - if (configuredService != null) - configuredService.freeze(); - - // Freeze the bindings - bindings=Collections.unmodifiableList(bindings); - freeze(bindings); - } - - /** - * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor) - */ - public boolean accept(AssemblyModelVisitor visitor) { - if (!super.accept(visitor)) - return false; - - if (configuredReference!=null) { - if (!configuredReference.accept(visitor)) - return false; - } - - if (configuredService!=null) { - if (!configuredService.accept(visitor)) - return false; - } - - if (!accept(bindings, visitor)) - return false; - - return true; - } -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExtensibleImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExtensibleImpl.java deleted file mode 100644 index 05f2082ced..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExtensibleImpl.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelVisitor; -import org.apache.tuscany.model.assembly.Extensible; - -/** - * An implementation of Extensible. - */ -public abstract class ExtensibleImpl extends AssemblyModelObjectImpl implements Extensible { - - private List extensibilityElements=new ArrayList(); - private List extensibilityAttributes=new ArrayList(); - - /** - * Constructor - */ - protected ExtensibleImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.Extensible#getExtensibilityElements() - */ - public List getExtensibilityElements() { - return extensibilityElements; - } - - /** - * @see org.apache.tuscany.model.assembly.Extensible#getExtensibilityAttributes() - */ - public List getExtensibilityAttributes() { - return extensibilityAttributes; - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) - */ - public void initialize(AssemblyModelContext modelContext) { - if (isInitialized()) - return; - super.initialize(modelContext); - - // Initialize extensibility elements and attributes - initialize(extensibilityElements, modelContext); - initialize(extensibilityAttributes, modelContext); - } - - public void freeze() { - if (isFrozen()) - return; - super.freeze(); - - // Freeze extensibility elements and attributes - freeze(extensibilityElements); - freeze(extensibilityAttributes); - } - - /** - * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor) - */ - public boolean accept(AssemblyModelVisitor visitor) { - if (!super.accept(visitor)) - return false; - - if (!accept(extensibilityElements, visitor)) - return false; - if (!accept(extensibilityAttributes, visitor)) - return false; - - return true; - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExternalServiceImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExternalServiceImpl.java deleted file mode 100644 index 33eced7e1f..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExternalServiceImpl.java +++ /dev/null @@ -1,135 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelVisitor; -import org.apache.tuscany.model.assembly.Binding; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.ExternalService; -import org.apache.tuscany.model.assembly.OverrideOption; - -/** - * An implementation ExternalService. - */ -public class ExternalServiceImpl extends AggregatePartImpl implements ExternalService { - - private ConfiguredService configuredService; - private OverrideOption overrideOption; - private List bindings=new ArrayList(); - - /** - * Constructor - */ - protected ExternalServiceImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.sdo.impl.ExternalServiceImpl#getOverrideOption() - */ - public OverrideOption getOverrideOption() { - return overrideOption; - } - - /** - * @see org.apache.tuscany.model.assembly.ExternalService#setOverrideOption(org.apache.tuscany.model.assembly.OverrideOption) - */ - public void setOverrideOption(OverrideOption newOverridable) { - checkNotFrozen(); - overrideOption=newOverridable; - } - - /** - * @see org.apache.tuscany.model.assembly.ExternalService#getBindings() - */ - public List getBindings() { - return bindings; - } - - /** - * @see org.apache.tuscany.model.assembly.ExternalService#getConfiguredService() - */ - public ConfiguredService getConfiguredService() { - return configuredService; - } - - /** - * @see org.apache.tuscany.model.assembly.ExternalService#setConfiguredService(org.apache.tuscany.model.assembly.ConfiguredService) - */ - public void setConfiguredService(ConfiguredService configuredService) { - checkNotFrozen(); - this.configuredService=configuredService; - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) - */ - public void initialize(AssemblyModelContext modelContext) { - if (isInitialized()) - return; - super.initialize(modelContext); - - // Initialize the configured service - if (configuredService != null) { - ((ConfiguredPortImpl)configuredService).setAggregatePart(this); - configuredService.initialize(modelContext); - } - - // Initialize the bindings - initialize(bindings, modelContext); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#freeze() - */ - public void freeze() { - if (isFrozen()) - return; - super.freeze(); - - // Freeze the configured service - if (configuredService!= null) - configuredService.freeze(); - - // Freeze the bindings - bindings=Collections.unmodifiableList(bindings); - freeze(bindings); - } - - /** - * @see org.apache.tuscany.model.assembly.impl.ExtensibleImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor) - */ - public boolean accept(AssemblyModelVisitor visitor) { - if (!super.accept(visitor)) - return false; - - if (configuredService!=null) { - if (!configuredService.accept(visitor)) - return false; - } - - if (!accept(bindings, visitor)) - return false; - - return true; - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleComponentImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleComponentImpl.java deleted file mode 100644 index d830c5c8d8..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleComponentImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.ModuleComponent; - -/** - * An implementation of ModuleComponent. - */ -public class ModuleComponentImpl extends ComponentImpl implements ModuleComponent { - - private String uri; - - /** - * Constructor - */ - protected ModuleComponentImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.ModuleComponent#setModuleImplementation(org.apache.tuscany.model.assembly.Module) - */ - public void setModuleImplementation(Module module) { - checkNotFrozen(); - super.setComponentImplementation(module); - } - - /** - * @see org.apache.tuscany.model.assembly.ModuleComponent#getModuleImplementation() - */ - public Module getModuleImplementation() { - return (Module)super.getComponentImplementation(); - } - - /** - * @see org.apache.tuscany.model.assembly.ModuleComponent#getURI() - */ - public String getURI() { - return uri; - } - - /** - * @see org.apache.tuscany.model.assembly.ModuleComponent#setURI(java.lang.String) - */ - public void setURI(String value) { - checkNotFrozen(); - uri=value; - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleFragmentImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleFragmentImpl.java deleted file mode 100644 index a36935dbfb..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleFragmentImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import org.apache.tuscany.model.assembly.ModuleFragment; - -/** - * An implementation of ModuleFragment. - */ -public class ModuleFragmentImpl extends AggregateImpl implements ModuleFragment { - - /** - * Constructor - */ - protected ModuleFragmentImpl() { - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleImpl.java deleted file mode 100644 index 8d89590225..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleImpl.java +++ /dev/null @@ -1,243 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelVisitor; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.ComponentType; -import org.apache.tuscany.model.assembly.ConfiguredProperty; -import org.apache.tuscany.model.assembly.ConfiguredReference; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.ExternalService; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.ModuleFragment; -import org.apache.tuscany.model.assembly.Multiplicity; -import org.apache.tuscany.model.assembly.OverrideOption; -import org.apache.tuscany.model.assembly.Reference; -import org.apache.tuscany.model.assembly.Service; -import org.apache.tuscany.model.assembly.ServiceContract; -import org.apache.tuscany.model.assembly.ServiceURI; -import org.apache.tuscany.model.assembly.Wire; - -/** - * An implementation of Module. - */ -public class ModuleImpl extends AggregateImpl implements Module { - - private List moduleFragments = new ArrayList(); - private Map moduleFragmentsMap; - private ComponentType componentType; - private Object runtimeConfiguration; - - /** - * Constructor - */ - protected ModuleImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.ComponentImplementation#getComponentType() - */ - public ComponentType getComponentType() { - return componentType; - } - - /** - * @see org.apache.tuscany.model.assembly.ComponentImplementation#setComponentType(org.apache.tuscany.model.assembly.ComponentType) - */ - public void setComponentType(ComponentType componentType) { - checkNotFrozen(); - this.componentType=componentType; - } - - /** - * @see org.apache.tuscany.model.assembly.Module#getModuleFragments() - */ - public List getModuleFragments() { - return moduleFragments; - } - - /** - * @see org.apache.tuscany.model.assembly.Module#getModuleFragment(java.lang.String) - */ - public ModuleFragment getModuleFragment(String name) { - checkInitialized(); - return moduleFragmentsMap.get(name); - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) - */ - public void initialize(AssemblyModelContext modelContext) { - if (isInitialized()) - return; - - // Populate map of module fragments - moduleFragmentsMap = new HashMap(); - for (ModuleFragment moduleFragment : moduleFragments) { - moduleFragmentsMap.put(moduleFragment.getName(), moduleFragment); - - // Add all WSDL imports, components, entry points and external services from the module fragments - getWSDLImports().addAll(moduleFragment.getWSDLImports()); - getComponents().addAll(moduleFragment.getComponents()); - getEntryPoints().addAll(moduleFragment.getEntryPoints()); - getExternalServices().addAll(moduleFragment.getExternalServices()); - - // Add all the wires from the module fragments - getWires().addAll(moduleFragment.getWires()); - - moduleFragment.initialize(modelContext); - } - - // Initialize the aggregate - super.initialize(modelContext); - - // Derive the component type from the entry points and external services in the module - // Also derive properties from the overridable properties of the components in the module - if (componentType==null) { - AssemblyFactory factory = modelContext.getAssemblyFactory(); - componentType = factory.createComponentType(); - for (EntryPoint entryPoint : getEntryPoints()) { - Service service = factory.createService(); - service.setName(entryPoint.getName()); - ServiceContract serviceContract = entryPoint.getConfiguredService().getService().getServiceContract(); - if (serviceContract != null) - service.setServiceContract(serviceContract); - componentType.getServices().add(service); - } - for (ExternalService externalService : getExternalServices()) { - if (externalService.getOverrideOption()==null || externalService.getOverrideOption()==OverrideOption.NO) - continue; - Reference reference = factory.createReference(); - reference.setName(externalService.getName()); - ServiceContract serviceContract = externalService.getConfiguredService().getService().getServiceContract(); - if (serviceContract != null) - reference.setServiceContract(serviceContract); - componentType.getReferences().add(reference); - } - for (Component component : getComponents()) { - for (ConfiguredProperty configuredProperty : component.getConfiguredProperties()) { - if (configuredProperty.getOverrideOption()==null || configuredProperty.getOverrideOption()==OverrideOption.NO) - continue; - componentType.getProperties().add(configuredProperty.getProperty()); - } - } - } - componentType.initialize(modelContext); - - - // Wire the module parts - for (Wire wire : getWires()) { - - // Get the source reference - ServiceURI sourceURI=wire.getSource(); - ConfiguredReference configuredReference = null; - String partName = sourceURI.getPartName(); - String referenceName = sourceURI.getServiceName(); - if (referenceName != null) { - Component component = getComponent(partName); - if (component != null) { - configuredReference = component.getConfiguredReference(referenceName); - } - } else { - EntryPoint entryPoint = getEntryPoint(partName); - if (entryPoint != null) { - configuredReference = entryPoint.getConfiguredReference(); - } - } - if (configuredReference == null) { - throw new IllegalArgumentException("Cannot find wire source " + sourceURI.getAddress()); - } else { - - // Resolve the target service endpoint - ServiceURI targetURI = wire.getTarget(); - ConfiguredService configuredService = getConfiguredService(targetURI); - if (configuredService != null) { - - // Wire the reference to the target - Multiplicity multiplicity=configuredReference.getReference().getMultiplicity(); - if (multiplicity==Multiplicity.ZERO_N || multiplicity==Multiplicity.ONE_N) { - configuredReference.getTargetConfiguredServices().add(configuredService); - } else { - configuredReference.getTargetConfiguredServices().clear(); - configuredReference.getTargetConfiguredServices().add(configuredService); - } - } else { - throw new IllegalArgumentException("Cannot find service for " + targetURI.getAddress()); - } - } - } - } - - /** - * @see org.apache.tuscany.model.assembly.AssemblyModelObject#freeze() - */ - public void freeze() { - if (isFrozen()) - return; - super.freeze(); - - // Freeze component type and module fragments - if (componentType!=null) - componentType.freeze(); - moduleFragments=Collections.unmodifiableList(moduleFragments); - freeze(moduleFragments); - } - - /** - * @see org.apache.tuscany.model.assembly.RuntimeConfigurationHolder#getRuntimeConfiguration() - */ - public Object getRuntimeConfiguration() { - return runtimeConfiguration; - } - - /** - * @see org.apache.tuscany.model.assembly.RuntimeConfigurationHolder#setRuntimeConfiguration(java.lang.Object) - */ - public void setRuntimeConfiguration(Object configuration) { - checkNotFrozen(); - this.runtimeConfiguration = configuration; - } - - /** - * @see org.apache.tuscany.model.assembly.impl.AggregateImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor) - */ - public boolean accept(AssemblyModelVisitor visitor) { - if (!super.accept(visitor)) - return false; - - if (componentType!=null) { - if (!componentType.accept(visitor)) - return false; - } - - if (!accept(moduleFragments, visitor)) - return false; - - return true; - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/PortImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/PortImpl.java deleted file mode 100644 index ae92300d4e..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/PortImpl.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelVisitor; -import org.apache.tuscany.model.assembly.Port; -import org.apache.tuscany.model.assembly.ServiceContract; - -/** - * An implementation of Port. - */ -public abstract class PortImpl extends AssemblyModelObjectImpl implements Port { - - private ServiceContract serviceContract; - private String name; - - /** - * Constructor - */ - protected PortImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.Port#getName() - */ - public String getName() { - return name; - } - - /** - * @see org.apache.tuscany.model.assembly.Port#setName(java.lang.String) - */ - public void setName(String value) { - checkNotFrozen(); - name=value; - } - - /** - * @see org.apache.tuscany.model.assembly.Port#getServiceContract() - */ - public ServiceContract getServiceContract() { - return serviceContract; - } - - /** - * @see org.apache.tuscany.model.assembly.Port#setServiceContract(org.apache.tuscany.model.assembly.ServiceContract) - */ - public void setServiceContract(ServiceContract value) { - checkNotFrozen(); - serviceContract=value; - } - - /** - * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) - */ - public void initialize(AssemblyModelContext modelContext) { - if (isInitialized()) - return; - super.initialize(modelContext); - - if (serviceContract!=null) - serviceContract.initialize(modelContext); - } - - /** - * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#freeze() - */ - public void freeze() { - if (isFrozen()) - return; - super.freeze(); - - if (serviceContract!=null) - serviceContract.freeze(); - } - - /** - * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor) - */ - public boolean accept(AssemblyModelVisitor visitor) { - if (!super.accept(visitor)) - return false; - - if (serviceContract!=null) { - if (!serviceContract.accept(visitor)) - return false; - } - - return true; - } -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/PropertyImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/PropertyImpl.java deleted file mode 100644 index f79ad2df3b..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/PropertyImpl.java +++ /dev/null @@ -1,178 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.Property; -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.Type; - -/** - * An implementation of Property. - */ -public class PropertyImpl extends ExtensibleImpl implements Property { - - private Object defaultValue; - private String name; - private boolean many; - private boolean required; - private Class type; - - private Type sdoType; - - /** - * Constructor - */ - protected PropertyImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.Property#getDefaultValue() - */ - public Object getDefaultValue() { - return defaultValue; - } - - /** - * @see org.apache.tuscany.model.assembly.Property#getName() - */ - public String getName() { - return name; - } - - /** - * @see org.apache.tuscany.model.assembly.Property#getType() - */ - public Class getType() { - return type; - } - - /** - * @see org.apache.tuscany.model.assembly.Property#isMany() - */ - public boolean isMany() { - return many; - } - - /** - * @see org.apache.tuscany.model.assembly.Property#isRequired() - */ - public boolean isRequired() { - return required; - } - - /** - * @see org.apache.tuscany.model.assembly.Property#setDefaultValue(java.lang.Object) - */ - public void setDefaultValue(Object value) { - defaultValue=value; - } - - /** - * @see org.apache.tuscany.model.assembly.Property#setMany(boolean) - */ - public void setMany(boolean value) { - checkNotFrozen(); - many=value; - } - - /** - * @see org.apache.tuscany.model.assembly.Property#setName(java.lang.String) - */ - public void setName(String value) { - checkNotFrozen(); - name=value; - } - - /** - * @see org.apache.tuscany.model.assembly.Property#setRequired(boolean) - */ - public void setRequired(boolean value) { - checkNotFrozen(); - required=value; - } - - /** - * @see org.apache.tuscany.model.assembly.Property#setType(java.lang.Class) - */ - public void setType(Class value) { - checkNotFrozen(); - type=value; - } - - /** - * @param sdoType The sdoType to set. - */ - public void setSDOType(Type sdoType) { - checkNotFrozen(); - this.sdoType = sdoType; - } - - /** - * @return Returns the sdoType. - */ - public Type getSDOType() { - return sdoType; - } - - private final static Map typeMapping=new HashMap(); - - static { - typeMapping.put(BigDecimal.class, SDOUtil.getXSDSDOType("decimal")); - typeMapping.put(BigInteger.class, SDOUtil.getXSDSDOType("integer")); - typeMapping.put(boolean.class, SDOUtil.getXSDSDOType("boolean")); - typeMapping.put(Boolean.class, SDOUtil.getXSDSDOType("boolean")); - typeMapping.put(byte.class, SDOUtil.getXSDSDOType("byte")); - typeMapping.put(Byte.class, SDOUtil.getXSDSDOType("Byte")); - typeMapping.put(byte[].class, SDOUtil.getXSDSDOType("hexBinary")); - typeMapping.put(char.class, SDOUtil.getXSDSDOType("string")); - typeMapping.put(Character.class, SDOUtil.getXSDSDOType("string")); - typeMapping.put(Date.class, SDOUtil.getXSDSDOType("dateTime")); - typeMapping.put(double.class, SDOUtil.getXSDSDOType("double")); - typeMapping.put(Double.class, SDOUtil.getXSDSDOType("double")); - typeMapping.put(float.class, SDOUtil.getXSDSDOType("float")); - typeMapping.put(Float.class, SDOUtil.getXSDSDOType("float")); - typeMapping.put(int.class, SDOUtil.getXSDSDOType("int")); - typeMapping.put(Integer.class, SDOUtil.getXSDSDOType("int")); - typeMapping.put(long.class, SDOUtil.getXSDSDOType("long")); - typeMapping.put(Long.class, SDOUtil.getXSDSDOType("long")); - typeMapping.put(short.class, SDOUtil.getXSDSDOType("short")); - typeMapping.put(Short.class, SDOUtil.getXSDSDOType("short")); - typeMapping.put(String.class, SDOUtil.getXSDSDOType("string")); - } - - /* - * @see org.apache.tuscany.model.assembly.impl.ExtensibleImpl#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) - */ - public void initialize(AssemblyModelContext modelContext) { - if (isInitialized()) - return; - super.initialize(modelContext); - - // Get the SDO type corresponding to the property's Java type - if (sdoType==null) { - sdoType=typeMapping.get(type); - } - } -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ReferenceImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ReferenceImpl.java deleted file mode 100644 index 8a2d348edc..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ReferenceImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import org.apache.tuscany.model.assembly.Multiplicity; -import org.apache.tuscany.model.assembly.Reference; - -/** - * An implementation of Reference. - */ -public class ReferenceImpl extends PortImpl implements Reference { - - private Multiplicity multiplicity; - - /** - * Constructor - */ - protected ReferenceImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.Reference#getMultiplicity() - */ - public Multiplicity getMultiplicity() { - return multiplicity; - } - - /** - * @see org.apache.tuscany.model.assembly.Reference#setMultiplicity(org.apache.tuscany.model.assembly.Multiplicity) - */ - public void setMultiplicity(Multiplicity multiplicity) { - checkNotFrozen(); - this.multiplicity=multiplicity; - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceContractImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceContractImpl.java deleted file mode 100644 index c9fe9b269d..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceContractImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.ServiceContract; - -/** - * An implementation of ServiceContract. - */ -public class ServiceContractImpl extends ExtensibleImpl implements ServiceContract { - - private Class interface_; - private Class callbackInterface; - private Scope scope; - - /** - * Constructor - */ - protected ServiceContractImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.ServiceContract#getCallbackInterface() - */ - public Class getCallbackInterface() { - return callbackInterface; - } - - /** - * @see org.apache.tuscany.model.assembly.ServiceContract#getInterface() - */ - public Class getInterface() { - return interface_; - } - - /** - * @see org.apache.tuscany.model.assembly.ServiceContract#getScope() - */ - public Scope getScope() { - return scope; - } - - /** - * @see org.apache.tuscany.model.assembly.ServiceContract#setCallbackInterface(java.lang.Class) - */ - public void setCallbackInterface(Class value) { - checkNotFrozen(); - callbackInterface=value; - } - - /** - * @see org.apache.tuscany.model.assembly.ServiceContract#setInterface(java.lang.Class) - */ - public void setInterface(Class value) { - checkNotFrozen(); - interface_=value; - } - - /** - * @see org.apache.tuscany.model.assembly.ServiceContract#setScope(org.apache.tuscany.model.assembly.Scope) - */ - public void setScope(Scope scope) { - checkNotFrozen(); - this.scope=scope; - } -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceImpl.java deleted file mode 100644 index 230d89e373..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import org.apache.tuscany.model.assembly.Service; - -/** - * An implementation of Service. - */ -public class ServiceImpl extends PortImpl implements Service { - - /** - * Constructor - */ - protected ServiceImpl() { - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceURIImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceURIImpl.java deleted file mode 100644 index 6d2972fb7d..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceURIImpl.java +++ /dev/null @@ -1,198 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import org.eclipse.emf.common.util.URI; - -import org.apache.tuscany.model.assembly.ConfiguredPort; -import org.apache.tuscany.model.assembly.ConfiguredReference; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.ModuleComponent; -import org.apache.tuscany.model.assembly.AggregatePart; -import org.apache.tuscany.model.assembly.Service; -import org.apache.tuscany.model.assembly.ServiceURI; - -/** - * An implementation of ServiceURI. - */ -public class ServiceURIImpl implements ServiceURI { - - private String address; - private Boolean isSCAScheme; - private boolean isParsed; - private String moduleComponentName; - private String partName; - private String serviceName; - - /** - * Constructor - */ - protected ServiceURIImpl(String address) { - this.address = address; - } - - /** - * Constructor - * - * @param moduleComponent - * @param configuredPort - */ - protected ServiceURIImpl(ModuleComponent moduleComponent, AggregatePart aggregatePart, ConfiguredPort configuredPort) { - if (moduleComponent != null) - moduleComponentName = moduleComponent.getName(); - else - moduleComponentName = ""; - if (configuredPort instanceof ConfiguredService) { - partName = aggregatePart.getName(); - ConfiguredService configuredService = (ConfiguredService) configuredPort; - Service service = configuredService.getService(); - if (service != null) { - serviceName = configuredService.getService().getName(); - address = "sca:///" + moduleComponentName + '/' + partName + '/' + serviceName; - } else { - address = "sca:///" + moduleComponentName + '/' + partName; - } - - } else if (configuredPort instanceof ConfiguredReference) { - ConfiguredReference configuredReference = (ConfiguredReference) configuredPort; - partName = aggregatePart.getName(); - serviceName = configuredReference.getReference().getName(); - if (serviceName!=null) - address = "sca:///" + moduleComponentName + '/' + partName + '/' + serviceName; - else - address = "sca:///" + moduleComponentName + '/' + partName; - } - - isSCAScheme = Boolean.TRUE; - isParsed = true; - } - - /** - * Constructor - * - * @param moduleComponent - * @param service - */ - protected ServiceURIImpl(ModuleComponent moduleComponent, String targetServiceName) { - if (moduleComponent != null) - moduleComponentName = moduleComponent.getName(); - else - moduleComponentName = ""; - int s = targetServiceName.indexOf('/'); - if (s == -1) { - partName = targetServiceName; - address = "sca:///" + moduleComponentName + '/' + partName; - } else { - partName = targetServiceName.substring(0, s); - this.serviceName = targetServiceName.substring(s + 1); - address = "sca:///" + moduleComponentName + '/' + partName + '/' + this.serviceName; - } - isSCAScheme = Boolean.TRUE; - isParsed = true; - } - - /** - * Returns true if the address scheme is sca: - * - * @return - */ - public boolean isSCAScheme() { - if (isSCAScheme == null) { - if (address.startsWith("sca://")) { - isSCAScheme = Boolean.TRUE; - } else { - isSCAScheme = Boolean.FALSE; - } - } - return isSCAScheme.booleanValue(); - } - - /** - * Returns a URI for this address - * - * @return - */ - public URI getURI() { - return URI.createURI(address); - } - - /** - * @return Returns the address. - */ - public String getAddress() { - return address; - } - - /** - * Parse the address. - */ - private void parse() { - isParsed = true; - if (isSCAScheme()) { - int s1 = address.indexOf('/', 6); - if (s1 == -1) - return; - s1++; - int s2 = address.indexOf('/', s1); - if (s2 == -1) - return; - moduleComponentName = address.substring(s1, s2); - s2++; - int s3 = address.indexOf('/', s2); - if (s3 == -1) { - partName = address.substring(s2); - return; - } - partName = address.substring(s2, s3); - s3++; - serviceName = address.substring(s3); - } - } - - /** - * Returns the module component name - * - * @return - */ - public String getModuleComponentName() { - if (!isParsed) - parse(); - return moduleComponentName; - } - - /** - * Returns the part name - * - * @return - */ - public String getPartName() { - if (!isParsed) - parse(); - return partName; - } - - /** - * Returns the service name - * @return - */ - public String getServiceName() { - if (!isParsed) - parse(); - return serviceName; - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/SimpleComponentImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/SimpleComponentImpl.java deleted file mode 100644 index 6de56e0806..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/SimpleComponentImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import org.apache.tuscany.model.assembly.SimpleComponent; - -/** - * An implementation of SimpleComponent. - */ -public class SimpleComponentImpl extends ComponentImpl implements SimpleComponent { - - /** - * Constructor - */ - protected SimpleComponentImpl() { - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/SubsystemImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/SubsystemImpl.java deleted file mode 100644 index 7dc78ee1e6..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/SubsystemImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import org.apache.tuscany.model.assembly.Subsystem; - -/** - * An implementation of Subsystem. - */ -public class SubsystemImpl extends AggregateImpl implements Subsystem { - - private String uri; - - /** - * Constructor - */ - protected SubsystemImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.Subsystem#getURI() - */ - public String getURI() { - return uri; - } - - /** - * @see org.apache.tuscany.model.assembly.Subsystem#setURI(java.lang.String) - */ - public void setURI(String value) { - checkNotFrozen(); - uri=value; - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/WireImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/WireImpl.java deleted file mode 100644 index 6cbf34334f..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/WireImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.impl; - -import org.apache.tuscany.model.assembly.ServiceURI; -import org.apache.tuscany.model.assembly.Wire; - -/** - * An implementation of Wire. - */ -public class WireImpl extends ExtensibleImpl implements Wire { - - private ServiceURI source; - private ServiceURI target; - - /** - * Constructor - */ - protected WireImpl() { - } - - /** - * @see org.apache.tuscany.model.assembly.Wire#getSource() - */ - public ServiceURI getSource() { - return source; - } - - /** - * @see org.apache.tuscany.model.assembly.Wire#setSource(org.apache.tuscany.model.assembly.ServiceURI) - */ - public void setSource(ServiceURI uri) { - checkNotFrozen(); - source=uri; - } - - /** - * @see org.apache.tuscany.model.assembly.Wire#getTarget() - */ - public ServiceURI getTarget() { - return target; - } - - /** - * @see org.apache.tuscany.model.assembly.Wire#setTarget(org.apache.tuscany.model.assembly.ServiceURI) - */ - public void setTarget(ServiceURI uri) { - checkNotFrozen(); - target=uri; - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/loader/AssemblyModelLoader.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/loader/AssemblyModelLoader.java deleted file mode 100644 index 6b0895e56f..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/assembly/loader/AssemblyModelLoader.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.loader; - -import java.util.List; - -import javax.wsdl.Definition; -import javax.wsdl.PortType; - -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.ComponentType; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.ModuleFragment; -import org.apache.tuscany.model.assembly.Subsystem; - -/** - * An assembly model loader. - */ -public interface AssemblyModelLoader { - - /** - * Sets the model context to use. - * @param modelContext - */ - void setModelContext(AssemblyModelContext modelContext); - - /** - * Returns the module at the given uri - * @param uri - * @return - */ - Module loadModule(String uri); - - /** - * Returns the module at the given uri - * @param uri - * @return - */ - ModuleFragment loadModuleFragment(String uri); - - /** - * Returns the component type at the given uri - * @param uri - * @return - */ - ComponentType loadComponentType(String uri); - - /** - * Returns the subsystem at the given uri. - * @param uri - * @return - */ - Subsystem loadSubsystem(String uri); - - /** - * Load a WSDL definition - */ - Definition loadDefinition(String uri); - - /** - * Load definitions by namespace - * @param uri - * @return - */ - List loadDefinitions(String namespace); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/SCDLModelLoader.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/SCDLModelLoader.java deleted file mode 100644 index f8fdab2c6c..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/SCDLModelLoader.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.scdl.loader; - -import org.apache.tuscany.model.assembly.Aggregate; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.AssemblyModelObject; - -/** - * An SCDL model loader. - */ -public interface SCDLModelLoader { - - /** - * Load an SCDL model object into an assembly model. - * @param modelContext - * @param object - * @return - */ - AssemblyModelObject load(AssemblyModelContext modelContext, Object object); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/impl/AssemblyModelLoadException.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/impl/AssemblyModelLoadException.java deleted file mode 100644 index db2ad2ff86..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/impl/AssemblyModelLoadException.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.scdl.loader.impl; - -import org.apache.tuscany.common.TuscanyRuntimeException; - -/** - * The root runtime exception for the model loader. - * - * @version $Rev$ $Date$ - */ -public class AssemblyModelLoadException extends TuscanyRuntimeException { - - public AssemblyModelLoadException() { - super(); - } - - public AssemblyModelLoadException(String message) { - super(message); - } - - public AssemblyModelLoadException(String message, Throwable cause) { - super(message, cause); - } - - public AssemblyModelLoadException(Throwable cause) { - super(cause); - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/impl/SCDLAssemblyModelLoaderImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/impl/SCDLAssemblyModelLoaderImpl.java deleted file mode 100644 index cfe8b260ee..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/impl/SCDLAssemblyModelLoaderImpl.java +++ /dev/null @@ -1,198 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.scdl.loader.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.wsdl.Definition; -import javax.wsdl.WSDLException; -import javax.wsdl.factory.WSDLFactory; -import javax.wsdl.xml.WSDLReader; - -import org.apache.tuscany.common.resource.ResourceLoader; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.ComponentType; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.ModuleFragment; -import org.apache.tuscany.model.assembly.Subsystem; -import org.apache.tuscany.model.assembly.loader.AssemblyModelLoader; -import org.apache.tuscany.model.scdl.loader.SCDLModelLoader; -import org.apache.tuscany.model.util.ModelTransformer; -import org.apache.tuscany.model.util.ModelTransformerImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; - -/** - */ -public class SCDLAssemblyModelLoaderImpl implements AssemblyModelLoader { - - private SCDLXMLReader xmlReader=new SCDLXMLReader(); - private WSDLReader wsdlReader; - private AssemblyModelContext modelContext; - - private List scdlModelLoaders; - - private Map componentTypes=new HashMap(); - private Map modules=new HashMap(); - private Map moduleFragments=new HashMap(); - private Map subsystems=new HashMap(); - private Map definitions=new HashMap(); - private Map> definitionsByNamespace=new HashMap>(); - - /** - * Constructor - */ - public SCDLAssemblyModelLoaderImpl(List loaders) { - scdlModelLoaders=loaders!=null? loaders:new ArrayList(); - } - - /** - * @param modelContext The modelContext to set. - */ - public void setModelContext(AssemblyModelContext modelContext) { - this.modelContext = modelContext; - } - - /** - * @see org.apache.tuscany.model.assembly.loader.AssemblyModelLoader#loadComponentType(java.lang.String) - */ - public ComponentType loadComponentType(String uri) { - ComponentType componentType=componentTypes.get(uri); - if (componentType!=null) - return componentType; - - // Load the SCDL component type - org.apache.tuscany.model.scdl.ComponentType scdlComponentType=xmlReader.getComponentType(uri); - - // Transform it to an assembly component type - componentType=transform(scdlComponentType).getComponentType(); - - componentTypes.put(uri, componentType); - return componentType; - } - - /** - * @see org.apache.tuscany.model.assembly.loader.AssemblyModelLoader#loadModule(java.lang.String) - */ - public Module loadModule(String uri) { - Module module=modules.get(uri); - if (module!=null) - return module; - - // Load the SCDL module - org.apache.tuscany.model.scdl.Module scdlModule=xmlReader.getModule(uri); - - // Transform it to an assembly module - module=transform(scdlModule).getModule(); - - modules.put(uri, module); - return module; - } - - /** - * @see org.apache.tuscany.model.assembly.loader.AssemblyModelLoader#loadModuleFragment(java.lang.String) - */ - public ModuleFragment loadModuleFragment(String uri) { - ModuleFragment moduleFragment=moduleFragments.get(uri); - if (moduleFragment!=null) - return moduleFragment; - - // Load the SCDL module fragment - org.apache.tuscany.model.scdl.ModuleFragment scdlFragment=xmlReader.getModuleFragment(uri); - - // Transform it to an assembly module fragment - moduleFragment=transform(scdlFragment).getModuleFragment(); - - moduleFragments.put(uri, moduleFragment); - return moduleFragment; - } - - /** - * @see org.apache.tuscany.model.assembly.loader.AssemblyModelLoader#loadSubsystem(java.lang.String) - */ - public Subsystem loadSubsystem(String uri) { - Subsystem subsystem=subsystems.get(uri); - if (subsystem!=null) - return subsystem; - - // Load the SCDL subsystem - org.apache.tuscany.model.scdl.Subsystem scdlSubsystem=xmlReader.getSubsystem(uri); - - subsystem=transform(scdlSubsystem).getSubsystem(); - - subsystems.put(uri, subsystem); - return subsystem; - } - - /** - * @see org.apache.tuscany.model.assembly.loader.AssemblyModelLoader#loadDefinition(java.lang.String) - */ - public Definition loadDefinition(String uri) { - Definition definition=definitions.get(uri); - if (definition!=null) - return definition; - - try { - if (wsdlReader==null) - wsdlReader=WSDLFactory.newInstance().newWSDLReader(); - definition = wsdlReader.readWSDL(uri); - } catch (WSDLException e) { - throw new IllegalArgumentException(e); - } - if (definition==null) - throw new IllegalArgumentException("Could not load WSDL definition at "+uri); - - definitions.put(uri, definition); - - String namespace=definition.getTargetNamespace(); - List list=definitionsByNamespace.get(namespace); - if (list==null) { - list=new ArrayList(); - definitionsByNamespace.put(namespace, list); - } - list.add(definition); - - return definition; - } - - /** - * @see org.apache.tuscany.model.assembly.loader.AssemblyModelLoader#loadDefinitions(java.lang.String) - */ - public List loadDefinitions(String namespace) { - return definitionsByNamespace.get(namespace); - } - - /** - * Transform a model and return the handler containing the result of the transformation. - * @param object - * @return - */ - private SCDLModelContentHandlerImpl transform(Object object) { - //FIXME Remove this dependency on EMF - Iterator contents=EcoreUtil.getAllContents(Collections.singleton(object), true); - - ModelTransformer transformer=new ModelTransformerImpl(); - SCDLModelContentHandlerImpl handler=new SCDLModelContentHandlerImpl(modelContext, scdlModelLoaders); - transformer.transform(contents, handler); - return handler; - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/impl/SCDLModelContentHandlerImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/impl/SCDLModelContentHandlerImpl.java deleted file mode 100644 index f4f1f857e6..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/impl/SCDLModelContentHandlerImpl.java +++ /dev/null @@ -1,708 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.scdl.loader.impl; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import javax.wsdl.Definition; -import javax.wsdl.Import; -import javax.wsdl.WSDLException; -import javax.wsdl.factory.WSDLFactory; - -import org.apache.tuscany.model.assembly.Aggregate; -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.ComponentImplementation; -import org.apache.tuscany.model.assembly.ConfiguredProperty; -import org.apache.tuscany.model.assembly.ConfiguredReference; -import org.apache.tuscany.model.assembly.ConfiguredService; -import org.apache.tuscany.model.assembly.OverrideOption; -import org.apache.tuscany.model.assembly.Scope; -import org.apache.tuscany.model.assembly.ServiceContract; -import org.apache.tuscany.model.assembly.ServiceURI; -import org.apache.tuscany.model.assembly.SimpleComponent; -import org.apache.tuscany.model.assembly.Wire; -import org.apache.tuscany.model.assembly.impl.PropertyImpl; -import org.apache.tuscany.model.scdl.Binding; -import org.apache.tuscany.model.scdl.Component; -import org.apache.tuscany.model.scdl.ComponentType; -import org.apache.tuscany.model.scdl.EntryPoint; -import org.apache.tuscany.model.scdl.ExternalService; -import org.apache.tuscany.model.scdl.Implementation; -import org.apache.tuscany.model.scdl.JavaInterface; -import org.apache.tuscany.model.scdl.Module; -import org.apache.tuscany.model.scdl.ModuleComponent; -import org.apache.tuscany.model.scdl.ModuleFragment; -import org.apache.tuscany.model.scdl.ModuleWire; -import org.apache.tuscany.model.scdl.Multiplicity; -import org.apache.tuscany.model.scdl.OverrideOptions; -import org.apache.tuscany.model.scdl.Property; -import org.apache.tuscany.model.scdl.PropertyValues; -import org.apache.tuscany.model.scdl.Reference; -import org.apache.tuscany.model.scdl.Service; -import org.apache.tuscany.model.scdl.Subsystem; -import org.apache.tuscany.model.scdl.SystemWire; -import org.apache.tuscany.model.scdl.WSDLImport; -import org.apache.tuscany.model.scdl.WSDLPortType; -import org.apache.tuscany.model.scdl.loader.SCDLModelLoader; -import org.apache.tuscany.model.scdl.util.ScdlSwitch; -import org.apache.tuscany.model.types.java.JavaServiceContract; -import org.apache.tuscany.model.types.java.impl.JavaServiceContractImpl; -import org.apache.tuscany.model.types.wsdl.WSDLServiceContract; -import org.apache.tuscany.model.types.wsdl.impl.WSDLServiceContractImpl; -import org.apache.tuscany.model.util.ModelContentHandler; -import org.apache.tuscany.sdo.util.SDOUtil; -import org.eclipse.emf.ecore.EObject; - -import commonj.sdo.DataObject; -import commonj.sdo.Sequence; -import commonj.sdo.Type; - -/** - * A model content handler that transforms an SCDL model into an assembly model. - */ -public class SCDLModelContentHandlerImpl extends ScdlSwitch implements ModelContentHandler { - - private List contents; - private List linkers; - private Map targets; - - private List scdlModelLoaders; - - private AssemblyModelContext modelContext; - private AssemblyFactory factory; - private org.apache.tuscany.model.assembly.ComponentType currentComponentType; - private org.apache.tuscany.model.assembly.Service currentService; - private org.apache.tuscany.model.assembly.Reference currentReference; - private org.apache.tuscany.model.assembly.Module currentModule; - private Aggregate currentAggregate; - private SimpleComponent currentComponent; - private org.apache.tuscany.model.assembly.ExternalService currentExternalService; - private org.apache.tuscany.model.assembly.EntryPoint currentEntryPoint; - private org.apache.tuscany.model.assembly.ModuleFragment currentModuleFragment; - private org.apache.tuscany.model.assembly.Subsystem currentSubsystem; - private org.apache.tuscany.model.assembly.ModuleComponent currentModuleComponent; - private Definition definition; - - /** - * Constructor - */ - public SCDLModelContentHandlerImpl(AssemblyModelContext modelContext, List scdlModelLoaders) { - this.modelContext=modelContext; - this.factory=modelContext.getAssemblyFactory(); - this.scdlModelLoaders=scdlModelLoaders; - } - - /** - * @see org.apache.tuscany.model.util.ModelContentHandler#doSwitch(java.lang.Object) - */ - public Object doSwitch(Object object) { - return super.doSwitch((EObject)object); - } - - /** - * @see org.apache.tuscany.model.util.ModelContentHandler#startModel() - */ - public void startModel() { - } - - /** - * @see org.apache.tuscany.model.util.ModelContentHandler#endModel() - */ - public void endModel() { - } - - /** - * @see org.apache.tuscany.model.util.ModelContentHandler#setContents(java.util.List) - */ - public void setContents(List contents) { - this.contents=contents; - } - - /** - * @see org.apache.tuscany.model.util.ModelContentHandler#setLinkers(java.util.List) - */ - public void setLinkers(List linkers) { - this.linkers=linkers; - } - - /** - * @see org.apache.tuscany.model.util.ModelContentHandler#setTargets(java.util.Map) - */ - public void setTargets(Map targets) { - this.targets=targets; - } - - /** - * @return Returns the componentType. - */ - public org.apache.tuscany.model.assembly.ComponentType getComponentType() { - return currentComponentType; - } - - /** - * @return Returns the module. - */ - public org.apache.tuscany.model.assembly.Module getModule() { - return currentModule; - } - - /** - * @return Returns the subsystem. - */ - public org.apache.tuscany.model.assembly.Subsystem getSubsystem() { - return currentSubsystem; - } - - /** - * @return Returns the moduleFragment. - */ - public org.apache.tuscany.model.assembly.ModuleFragment getModuleFragment() { - return currentModuleFragment; - } - - /** - * @see org.apache.tuscany.model.scdl.util.ScdlSwitch#caseComponentType(org.apache.tuscany.model.scdl.ComponentType) - */ - public Object caseComponentType(ComponentType object) { - org.apache.tuscany.model.assembly.ComponentType componentType=factory.createComponentType(); - contents.add(componentType); - currentComponentType=componentType; - return componentType; - } - - /** - * @see org.apache.tuscany.model.scdl.util.ScdlSwitch#caseService(org.apache.tuscany.model.scdl.Service) - */ - public Object caseService(Service object) { - final org.apache.tuscany.model.assembly.Service service=factory.createService(); - service.setName(object.getName()); - - linkers.add(new Runnable() { - public void run() { - currentComponentType.getServices().add(service); - }; - }); - - currentService=service; - return service; - } - - /** - * @see org.apache.tuscany.model.scdl.util.ScdlSwitch#caseReference(org.apache.tuscany.model.scdl.Reference) - */ - public Object caseReference(Reference object) { - final org.apache.tuscany.model.assembly.Reference reference=factory.createReference(); - reference.setName(object.getName()); - reference.setMultiplicity(transformMultiplicity(object.getMultiplicity())); - - linkers.add(new Runnable() { - public void run() { - currentComponentType.getReferences().add(reference); - }; - }); - - currentReference=reference; - return reference; - } - - /** - * Transforms an SCDL multiplicity into an assembly model multiplicity. - * @param multiplicity - * @return - */ - private org.apache.tuscany.model.assembly.Multiplicity transformMultiplicity(Multiplicity multiplicity) { - if (multiplicity==Multiplicity._01_LITERAL) - return org.apache.tuscany.model.assembly.Multiplicity.ZERO_ONE; - else if (multiplicity==Multiplicity._0N_LITERAL) - return org.apache.tuscany.model.assembly.Multiplicity.ZERO_N; - else if (multiplicity==Multiplicity._11_LITERAL) - return org.apache.tuscany.model.assembly.Multiplicity.ONE_ONE; - else if (multiplicity==Multiplicity._1N_LITERAL) - return org.apache.tuscany.model.assembly.Multiplicity.ONE_N; - else - return org.apache.tuscany.model.assembly.Multiplicity.ONE_ONE; - } - - /** - * @see org.apache.tuscany.model.scdl.util.ScdlSwitch#caseJavaInterface(org.apache.tuscany.model.scdl.JavaInterface) - */ - public Object caseJavaInterface(JavaInterface object) { - final JavaServiceContract serviceContract=factory.createJavaServiceContract(); - serviceContract.setScope(Scope.INSTANCE); - - ((JavaServiceContractImpl)serviceContract).setInterfaceName(object.getInterface()); - ((JavaServiceContractImpl)serviceContract).setCallbackInterfaceName(object.getCallbackInterface()); - - linkServiceContract(object, serviceContract); - - return serviceContract; - } - - /** - * @see org.apache.tuscany.model.scdl.util.ScdlSwitch#caseWSDLPortType(org.apache.tuscany.model.scdl.WSDLPortType) - */ - public Object caseWSDLPortType(WSDLPortType object) { - final WSDLServiceContract serviceContract=factory.createWSDLServiceContract(); - serviceContract.setScope(Scope.INSTANCE); - - ((WSDLServiceContractImpl)serviceContract).setPortTypeURI(object.getInterface()); - ((WSDLServiceContractImpl)serviceContract).setCallbackPortTypeURI(object.getCallbackInterface()); - - linkServiceContract(object, serviceContract); - - return serviceContract; - } - - /** - * @see org.apache.tuscany.model.scdl.util.ScdlSwitch#caseWSDLImport(org.apache.tuscany.model.scdl.WSDLImport) - */ - public Object caseWSDLImport(WSDLImport object) { - if (definition==null) { - try { - WSDLFactory wsdlFactory=WSDLFactory.newInstance(); - definition=wsdlFactory.newDefinition(); - } catch (WSDLException e) { - throw new IllegalStateException(e); - } - - } - final Import wsdlImport=definition.createImport(); - wsdlImport.setNamespaceURI(object.getNamespace()); - wsdlImport.setLocationURI(object.getLocation()); - - linkers.add(new Runnable() { - public void run() { - currentAggregate.getWSDLImports().add(wsdlImport); - }; - }); - - return wsdlImport; - } - - /** - * Link a service contract with the correct owner. - * @param object - * @param serviceContract - */ - private void linkServiceContract(Object object, final ServiceContract serviceContract) { - Object container=((DataObject)object).getContainer(); - if (container instanceof Service) { - - // Set a service contract on a service - final org.apache.tuscany.model.assembly.Service service=currentService; - linkers.add(new Runnable() { - public void run() { - service.setServiceContract(serviceContract); - } - }); - } - else if (container instanceof Reference) { - - // Set a service contract on a reference - final org.apache.tuscany.model.assembly.Reference reference=currentReference; - linkers.add(new Runnable() { - public void run() { - reference.setServiceContract(serviceContract); - } - }); - } else if (container instanceof ExternalService) { - - // Set a service contract on an external service - final org.apache.tuscany.model.assembly.ExternalService externalService=currentExternalService; - linkers.add(new Runnable() { - public void run() { - externalService.getConfiguredService().getService().setServiceContract(serviceContract); - } - }); - } else if (container instanceof EntryPoint) { - - // Set a service contract on an entry point - final org.apache.tuscany.model.assembly.EntryPoint entryPoint=currentEntryPoint; - linkers.add(new Runnable() { - public void run() { - entryPoint.getConfiguredService().getService().setServiceContract(serviceContract); - entryPoint.getConfiguredReference().getReference().setServiceContract(serviceContract); - } - }); - } - } - - /** - * @see org.apache.tuscany.model.scdl.util.ScdlSwitch#caseProperty(org.apache.tuscany.model.scdl.Property) - */ - public Object caseProperty(Property object) { - final org.apache.tuscany.model.assembly.Property property=factory.createProperty(); - property.setName(object.getName()); - property.setDefaultValue(object.getDefault()); - property.setMany(object.isMany()); - property.setRequired(object.isRequired()); - - Object dataType=object.getDataType(); - if (dataType!=null) { - String typeName=dataType.toString(); - typeName=typeName.substring(typeName.indexOf(':')+1); - Type type=SDOUtil.getXSDSDOType(typeName); - ((PropertyImpl)property).setSDOType(type); - property.setType(type.getInstanceClass()); - } else { - property.setType(String.class); - } - - linkers.add(new Runnable() { - public void run() { - currentComponentType.getProperties().add(property); - }; - }); - - return property; - } - - /** - * @see org.apache.tuscany.model.scdl.util.ScdlSwitch#caseModule(org.apache.tuscany.model.scdl.Module) - */ - public Object caseModule(Module object) { - org.apache.tuscany.model.assembly.Module module=factory.createModule(); - module.setName(object.getName()); - contents.add(module); - currentModule=module; - currentAggregate=module; - return module; - } - - /** - * @see org.apache.tuscany.model.scdl.util.ScdlSwitch#caseModuleFragment(org.apache.tuscany.model.scdl.ModuleFragment) - */ - public Object caseModuleFragment(ModuleFragment object) { - org.apache.tuscany.model.assembly.ModuleFragment moduleFragment=factory.createModuleFragment(); - moduleFragment.setName(object.getName()); - contents.add(moduleFragment); - currentModuleFragment=moduleFragment; - currentAggregate=moduleFragment; - return moduleFragment; - } - - /** - * @see org.apache.tuscany.model.scdl.util.ScdlSwitch#caseComponent(org.apache.tuscany.model.scdl.Component) - */ - public Object caseComponent(Component object) { - final SimpleComponent component=factory.createSimpleComponent(); - component.setName(object.getName()); - linkers.add(new Runnable() { - public void run() { - currentAggregate.getComponents().add(component); - component.initialize(modelContext); - }; - }); - currentComponent=component; - return component; - } - - /** - * @see org.apache.tuscany.model.scdl.util.ScdlSwitch#casePropertyValues(org.apache.tuscany.model.scdl.PropertyValues) - */ - public Object casePropertyValues(final PropertyValues object) { - - // Grab the current component - final SimpleComponent component=currentComponent; - linkers.add(new Runnable() { - public void run() { - - // Initialize the component's configured properties - Sequence sequence = object.getAny(); - for (int p = 0, n = sequence.size(); p < n; p++) { - - // Get each property value element - commonj.sdo.Property propertyElementDef = sequence.getProperty(p); - DataObject propertyElement = (DataObject) sequence.getValue(p); - - // Get the corresponding property definition - String propertyName = propertyElementDef.getName(); - ConfiguredProperty configuredProperty=component.getConfiguredProperty(propertyName); - if (configuredProperty == null) { - throw new IllegalArgumentException("Undefined property " + propertyName); - } - - // Check if the property is overridable - Sequence attrs=propertyElement.getSequence("anyAttribute"); - if (attrs!=null && attrs.size()!=0) { - commonj.sdo.Property attr=attrs.getProperty(0); - if (attr!=null && attr.getName().equals("overridable")) { - Object overridable=attrs.getValue(0); - if ("may".equals(overridable)) - configuredProperty.setOverrideOption(OverrideOption.MAY); - else if ("must".equals(overridable)) - configuredProperty.setOverrideOption(OverrideOption.MUST); - else if ("no".equals(overridable)) - configuredProperty.setOverrideOption(OverrideOption.NO); - } - } - - // Get the property value text and convert to the expected java type - Sequence text = propertyElement.getSequence("any"); - if (text != null && text.size() != 0) { - String rawValue = text.getValue(0).toString(); - Type type=((PropertyImpl)configuredProperty.getProperty()).getSDOType(); - Object value; - if (type!=null) { - value=SDOUtil.createFromString(type, rawValue); - } else { - value=rawValue; - } - configuredProperty.setValue(value); - } - } - } - }); - - return object; - } - - /** - * @see org.apache.tuscany.model.scdl.util.ScdlSwitch#caseReferenceValues(org.apache.tuscany.model.scdl.ReferenceValues) - */ - public Object caseReferenceValues(final org.apache.tuscany.model.scdl.ReferenceValues object) { - - // Grab the current component - final SimpleComponent component=this.currentComponent; - - linkers.add(new Runnable() { - public void run() { - - // Initialize the component's configured references - Sequence sequence = object.getAny(); - for (int r = 0, n = sequence.size(); r < n; r++) { - - // Get each reference value element - commonj.sdo.Property referenceElementDef = sequence.getProperty(r); - DataObject referenceElement = (DataObject) sequence.getValue(r); - - // Get the corresponding reference definition - String referenceName = referenceElementDef.getName(); - ConfiguredReference configuredReference=component.getConfiguredReference(referenceName); - if (configuredReference == null) { - throw new IllegalArgumentException("Undefined reference " + referenceName); - } - ServiceURI referenceURI=factory.createServiceURI(null, component, configuredReference); - - // Get the reference value text - Sequence text = referenceElement.getSequence(0); - if (text != null && text.size() != 0) { - String uri = text.getValue(0).toString(); - ServiceURI serviceURI=factory.createServiceURI(null, uri); - - // Create a wire - Wire wire=factory.createWire(); - wire.setSource(referenceURI); - wire.setTarget(serviceURI); - currentAggregate.getWires().add(wire); - } - } - } - }); - - return object; - } - - /** - * @see org.apache.tuscany.model.scdl.util.ScdlSwitch#caseEntryPoint(org.apache.tuscany.model.scdl.EntryPoint) - */ - public Object caseEntryPoint(final EntryPoint object) { - final org.apache.tuscany.model.assembly.EntryPoint entryPoint=factory.createEntryPoint(); - entryPoint.setName(object.getName()); - - // Create a configured service and a configured reference for this entry point - org.apache.tuscany.model.assembly.Service service=factory.createService(); - service.setName(entryPoint.getName()); - ConfiguredService configuredService=factory.createConfiguredService(); - configuredService.setService(service); - entryPoint.setConfiguredService(configuredService); - org.apache.tuscany.model.assembly.Reference reference=factory.createReference(); - reference.setName(null); - reference.setMultiplicity(transformMultiplicity(object.getMultiplicity())); - final ConfiguredReference configuredReference=factory.createConfiguredReference(); - configuredReference.setReference(reference); - entryPoint.setConfiguredReference(configuredReference); - - linkers.add(new Runnable() { - public void run() { - currentAggregate.getEntryPoints().add(entryPoint); - - // Create wires to the target service - final Listwires=new ArrayList(); - ServiceURI referenceURI=factory.createServiceURI(null, entryPoint, configuredReference); - for (String uri : (List)object.getReference()) { - ServiceURI serviceURI=factory.createServiceURI(null, uri); - final Wire wire=factory.createWire(); - wire.setSource(referenceURI); - wire.setTarget(serviceURI); - wires.add(wire); - } - - currentAggregate.getWires().addAll(wires); - }; - }); - - currentEntryPoint=entryPoint; - return entryPoint; - } - - /** - * @see org.apache.tuscany.model.scdl.util.ScdlSwitch#caseExternalService(org.apache.tuscany.model.scdl.ExternalService) - */ - public Object caseExternalService(ExternalService object) { - final org.apache.tuscany.model.assembly.ExternalService externalService=factory.createExternalService(); - externalService.setName(object.getName()); - - OverrideOptions overrideOptions=object.getOverridable(); - if (overrideOptions==OverrideOptions.MAY_LITERAL) - externalService.setOverrideOption(OverrideOption.MAY); - else if (overrideOptions==OverrideOptions.MUST_LITERAL) - externalService.setOverrideOption(OverrideOption.MUST); - else if (overrideOptions==OverrideOptions.NO_LITERAL) - externalService.setOverrideOption(OverrideOption.NO); - else - externalService.setOverrideOption(OverrideOption.NO); - - // Create a configured service for this external service - org.apache.tuscany.model.assembly.Service service=factory.createService(); - service.setName(externalService.getName()); - ConfiguredService configuredService=factory.createConfiguredService(); - configuredService.setService(service); - externalService.setConfiguredService(configuredService); - - linkers.add(new Runnable() { - public void run() { - currentAggregate.getExternalServices().add(externalService); - }; - }); - currentExternalService=externalService; - return externalService; - } - - /** - * @see org.apache.tuscany.model.scdl.util.ScdlSwitch#caseSubsystem(org.apache.tuscany.model.scdl.Subsystem) - */ - public Object caseSubsystem(Subsystem object) { - org.apache.tuscany.model.assembly.Subsystem subsystem=factory.createSubsystem(); - subsystem.setName(object.getName()); - subsystem.setURI(object.getUri()); - currentSubsystem=subsystem; - currentAggregate=subsystem; - return subsystem; - } - - /** - * @see org.apache.tuscany.model.scdl.util.ScdlSwitch#caseModuleComponent(org.apache.tuscany.model.scdl.ModuleComponent) - */ - public Object caseModuleComponent(ModuleComponent object) { - final org.apache.tuscany.model.assembly.ModuleComponent moduleComponent=factory.createModuleComponent(); - moduleComponent.setName(object.getName()); - moduleComponent.setURI(object.getUri()); - - linkers.add(new Runnable() { - public void run() { - currentAggregate.getComponents().add(moduleComponent); - }; - }); - - currentModuleComponent=moduleComponent; - return moduleComponent; - } - - /** - * @see org.apache.tuscany.model.scdl.util.ScdlSwitch#caseModuleWire(org.apache.tuscany.model.scdl.ModuleWire) - */ - public Object caseModuleWire(ModuleWire object) { - final Wire wire=factory.createWire(); - wire.setSource(factory.createServiceURI(null, object.getSourceUri())); - wire.setTarget(factory.createServiceURI(null, object.getTargetUri())); - - linkers.add(new Runnable() { - public void run() { - currentAggregate.getWires().add(wire); - }; - }); - - return wire; - } - - /** - * @see org.apache.tuscany.model.scdl.util.ScdlSwitch#caseSystemWire(org.apache.tuscany.model.scdl.SystemWire) - */ - public Object caseSystemWire(SystemWire object) { - final Wire wire=factory.createWire(); - wire.setSource(factory.createServiceURI(object.getSource().toString())); - wire.setTarget(factory.createServiceURI(object.getTarget().toString())); - - linkers.add(new Runnable() { - public void run() { - currentAggregate.getWires().add(wire); - }; - }); - - return wire; - } - - /** - * @see org.apache.tuscany.model.scdl.util.ScdlSwitch#caseImplementation(org.apache.tuscany.model.scdl.Implementation) - */ - public Object caseImplementation(Implementation object) { - final SimpleComponent component=currentComponent; - - for (SCDLModelLoader scdlModelLoader : scdlModelLoaders) { - - // Invoke an SCDL loader to handle the specific implementation type - final ComponentImplementation implementation=(ComponentImplementation)scdlModelLoader.load(modelContext, object); - if (implementation!=null) { - component.setComponentImplementation(implementation); - return implementation; - } - - } - return null; - } - - /** - * @see org.apache.tuscany.model.scdl.util.ScdlSwitch#caseBinding(org.apache.tuscany.model.scdl.Binding) - */ - public Object caseBinding(Binding object) { - - final List bindings; - Object container=((DataObject)object).getContainer(); - if (container instanceof EntryPoint) { - bindings=currentEntryPoint.getBindings(); - } else if (container instanceof ExternalService) { - bindings=currentExternalService.getBindings(); - } else - bindings=null; - - for (SCDLModelLoader scdlModelLoader : scdlModelLoaders) { - - // Invoke an SCDL loader to handle the specific binding type - final org.apache.tuscany.model.assembly.Binding binding=(org.apache.tuscany.model.assembly.Binding)scdlModelLoader.load(modelContext, object); - if (binding!=null) { - bindings.add(binding); - return binding; - } - - } - return null; - } -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/impl/SCDLXMLReader.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/impl/SCDLXMLReader.java deleted file mode 100644 index 6fa426b2f8..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/scdl/loader/impl/SCDLXMLReader.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.scdl.loader.impl; - -import java.io.IOException; -import java.net.URL; -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.model.scdl.ComponentType; -import org.apache.tuscany.model.scdl.Module; -import org.apache.tuscany.model.scdl.ModuleFragment; -import org.apache.tuscany.model.scdl.ScdlFactory; -import org.apache.tuscany.model.scdl.Subsystem; -import org.apache.tuscany.model.scdl.impl.ScdlPackageImpl; -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.apache.tuscany.sdo.util.SDOUtil; -import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; - -import commonj.sdo.helper.XMLDocument; -import commonj.sdo.helper.XMLHelper; - -/** - */ -public class SCDLXMLReader extends ResourceSetImpl { - - private Map cache=new HashMap(); - - // Initialize the SDO runtime and register the SCDL model - static { - DataObjectUtil.initRuntime(); - SDOUtil.registerStaticTypes(ScdlFactory.class); - } - - /** - * Constructor - */ - public SCDLXMLReader() { - } - - /** - * Returns an SCDL module. - * @param uri - * @return - */ - public Module getModule(String uri) { - return (Module)getRootObject(uri); - } - - /** - * Returns an SCDL module fragment. - * @param uri - * @return - */ - public ModuleFragment getModuleFragment(String uri) { - return (ModuleFragment)getRootObject(uri); - } - - /** - * Returns an SCDL component type. - * @param uri - * @return - */ - public ComponentType getComponentType(String uri) { - return (ComponentType)getRootObject(uri); - } - - /** - * Returns an SCDL subsystem. - * @param uri - * @return - */ - public Subsystem getSubsystem(String uri) { - return (Subsystem)getRootObject(uri); - } - - /** - * Returns the root object at the given URI. - * @param uri - * @return - */ - private Object getRootObject(String uri) { - Object object = cache.get(uri); - if (object==null) { - try { - XMLDocument document=XMLHelper.INSTANCE.load(new URL(uri).openStream()); - return document.getRootObject(); - } catch (IOException e) { - throw new RuntimeException(uri, e); - } - } - return object; - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/types/java/JavaServiceContract.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/types/java/JavaServiceContract.java deleted file mode 100644 index 0a4ea54947..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/types/java/JavaServiceContract.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.types.java; - -import org.apache.tuscany.model.assembly.ServiceContract; - - -/** - * Represents a Java service contract. - */ -public interface JavaServiceContract extends ServiceContract { - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/types/java/impl/JavaServiceContractImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/types/java/impl/JavaServiceContractImpl.java deleted file mode 100644 index 589678acbb..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/types/java/impl/JavaServiceContractImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.types.java.impl; - -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.impl.ServiceContractImpl; -import org.apache.tuscany.model.types.java.JavaServiceContract; - -/** - * An implementation of JavaServiceContract. - */ -public class JavaServiceContractImpl extends ServiceContractImpl implements JavaServiceContract { - - private String interfaceName; - private String callbackInterfaceName; - - /** - * Constructor - */ - public JavaServiceContractImpl() { - } - - /** - * @param interfaceName The interfaceName to set. - */ - public void setInterfaceName(String interfaceName) { - this.interfaceName = interfaceName; - } - - /** - * @param callbackInterfaceName The callbackInterfaceName to set. - */ - public void setCallbackInterfaceName(String callbackInterfaceName) { - this.callbackInterfaceName = callbackInterfaceName; - } - - /** - * @see org.apache.tuscany.model.assembly.impl.ExtensibleImpl#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) - */ - public void initialize(AssemblyModelContext modelContext) { - if (isInitialized()) - return; - - // Load the interface - if (getInterface()==null && interfaceName!=null) { - try { - Class interfaceClass=modelContext.getApplicationResourceLoader().loadClass(interfaceName); - setInterface(interfaceClass); - } catch (ClassNotFoundException e) { - throw new IllegalArgumentException(e); - } - } - - // Load the callback interface - if (getCallbackInterface()==null && callbackInterfaceName!=null) { - try { - Class callbackInterfaceClass=modelContext.getApplicationResourceLoader().loadClass(callbackInterfaceName); - setInterface(callbackInterfaceClass); - } catch (ClassNotFoundException e) { - throw new IllegalArgumentException(e); - } - } - - super.initialize(modelContext); - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/types/wsdl/WSDLServiceContract.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/types/wsdl/WSDLServiceContract.java deleted file mode 100644 index 6133e4a02b..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/types/wsdl/WSDLServiceContract.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.types.wsdl; - -import javax.wsdl.PortType; - -import org.apache.tuscany.model.assembly.ServiceContract; - -/** - * A WSDL service contract. - */ -public interface WSDLServiceContract extends ServiceContract { - - /** - * Returns the WSDL portType. - * @return - */ - PortType getPortType(); - - /** - * Sets the WSDL portType. - * @param portType - */ - void setPortType(PortType portType); - - /** - * Returns the callback WSDL portType. - * @return - */ - PortType getCallbackPortType(); - - /** - * Sets the callback WSDL portType. - * @param portType - */ - void setCallbackPortType(PortType portType); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/types/wsdl/impl/WSDLServiceContractImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/types/wsdl/impl/WSDLServiceContractImpl.java deleted file mode 100644 index 262503feb0..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/types/wsdl/impl/WSDLServiceContractImpl.java +++ /dev/null @@ -1,212 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.types.wsdl.impl; - -import static org.objectweb.asm.Opcodes.ACC_ABSTRACT; -import static org.objectweb.asm.Opcodes.ACC_INTERFACE; -import static org.objectweb.asm.Opcodes.ACC_PUBLIC; -import static org.objectweb.asm.Opcodes.V1_5; - -import java.util.List; - -import javax.wsdl.Definition; -import javax.wsdl.Operation; -import javax.wsdl.PortType; -import javax.xml.namespace.QName; - -import org.apache.tuscany.common.resource.ResourceLoader; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.impl.ServiceContractImpl; -import org.apache.tuscany.model.assembly.loader.AssemblyModelLoader; -import org.apache.tuscany.model.types.wsdl.WSDLServiceContract; -import org.apache.tuscany.model.util.XMLNameUtil; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.Type; - -import commonj.sdo.DataObject; - -/** - * An implementation of WSDLServiceContract. - */ -public class WSDLServiceContractImpl extends ServiceContractImpl implements WSDLServiceContract { - - private PortType portType; - private PortType callbackPortType; - private String portTypeURI; - private String callbackPortTypeURI; - - /** - * Constructor - */ - public WSDLServiceContractImpl() { - } - - /** - * @see org.apache.tuscany.model.types.wsdl.WSDLServiceContract#getPortType() - */ - public PortType getPortType() { - return portType; - } - - /** - * @see org.apache.tuscany.model.types.wsdl.WSDLServiceContract#setPortType(javax.wsdl.PortType) - */ - public void setPortType(PortType portType) { - checkNotFrozen(); - this.portType=portType; - } - - /** - * @see org.apache.tuscany.model.types.wsdl.WSDLServiceContract#getCallbackPortType() - */ - public PortType getCallbackPortType() { - return callbackPortType; - } - - /** - * @see org.apache.tuscany.model.types.wsdl.WSDLServiceContract#setCallbackPortType(javax.wsdl.PortType) - */ - public void setCallbackPortType(PortType portType) { - checkNotFrozen(); - callbackPortType=portType; - } - - /** - * @param portTypeURI The portTypeURI to set. - */ - public void setPortTypeURI(String portTypeURI) { - this.portTypeURI = portTypeURI; - } - - /** - * @param callbackPortTypeURI The callbackPortTypeURI to set. - */ - public void setCallbackPortTypeURI(String callbackPortTypeURI) { - this.callbackPortTypeURI = callbackPortTypeURI; - } - - /** - * @see org.apache.tuscany.model.assembly.impl.ExtensibleImpl#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) - */ - public void initialize(AssemblyModelContext modelContext) { - if (isInitialized()) - return; - super.initialize(modelContext); - - // Resolve the WSDL portType and callback portType - AssemblyModelLoader modelLoader=modelContext.getAssemblyLoader(); - if (portTypeURI!=null && portType==null) { - portType=getPortType(modelLoader, portTypeURI); - } - if (callbackPortTypeURI!=null && callbackPortType==null) { - callbackPortType=getPortType(modelLoader, callbackPortTypeURI); - } - - // Load the Java interface for the portType - if (portType!=null && getInterface()==null) { - QName qname=portType.getQName(); - String interfaceName=XMLNameUtil.getFullyQualifiedClassNameFromQName(qname.getNamespaceURI(), qname.getLocalPart()); - Class interfaceClass; - try { - // Load the interface - interfaceClass=modelContext.getApplicationResourceLoader().loadClass(interfaceName); - } catch (ClassNotFoundException e) { - // Generate the interface on the fly - interfaceClass=generateJavaInterface(modelContext.getApplicationResourceLoader(), portType, interfaceName); - } - super.setInterface(interfaceClass); - } - - // Load the Java interface for the callback portType - if (callbackPortType!=null && getCallbackInterface()==null) { - QName qname=callbackPortType.getQName(); - String interfaceName=XMLNameUtil.getFullyQualifiedClassNameFromQName(qname.getNamespaceURI(), qname.getLocalPart()); - Class interfaceClass; - try { - // Load the interface - interfaceClass=modelContext.getApplicationResourceLoader().loadClass(interfaceName); - } catch (ClassNotFoundException e) { - // Generate the interface on the fly - interfaceClass=generateJavaInterface(modelContext.getApplicationResourceLoader(), portType, interfaceName); - } - super.setCallbackInterface(interfaceClass); - } - } - - /** - * Get a portType from the given uri - * @param loader - * @param uri - * @return - */ - private PortType getPortType(AssemblyModelLoader loader, String uri) { - - // Get the WSDL port namespace and name - int h=uri.indexOf('#'); - String namespace=uri.substring(0,h); - String name=uri.substring(h+1); - QName qname=new QName(namespace, name); - - // Load the WSDL definitions for the given namespace - List definitions=loader.loadDefinitions(namespace); - if (definitions==null) - throw new IllegalArgumentException("Cannot find WSDL definition for "+namespace); - for (Definition definition: definitions) { - - // Find the port with the given name - PortType portType=definition.getPortType(qname); - return portType; - } - throw new IllegalArgumentException("Cannot find WSDL portType "+uri); - } - - /** - * Generate a Java interface from a WSDL portType. - * @param portType - * @param interfaceName - * @return - */ - private Class generateJavaInterface(ResourceLoader resourceLoader, PortType portType, String interfaceName) { - ClassWriter cw=new ClassWriter(false); - - // Generate the interface - interfaceName=interfaceName.replace('.', '/'); - cw.visit(V1_5, ACC_PUBLIC + ACC_ABSTRACT + ACC_INTERFACE, interfaceName, null, "java/lang/Object", new String[0]); - - - // Generate methods from the WSDL operations - for (Operation operation : (List)portType.getOperations()) { - String methodName=XMLNameUtil.getJavaNameFromXMLName(operation.getName(), false); - - //FIXME integrate XSD to Java type mapping here - String inputType = Type.getDescriptor(String.class); - String outputType = Type.getDescriptor(String.class); - - cw.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, methodName, "("+inputType+")"+outputType, null, null).visitEnd(); - } - - // Generate the bytecodes - cw.visitEnd(); - byte[] bytes=cw.toByteArray(); - - // Add the class to the resource loader - Class interfaceClass=(Class)resourceLoader.addClass(bytes); - - return interfaceClass; - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/util/ModelContentHandler.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/util/ModelContentHandler.java deleted file mode 100644 index 515d2128ec..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/util/ModelContentHandler.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.util; - -import java.util.List; -import java.util.Map; - -/** - * A model content handler. This mimics a SAX content handler for models and - * receives notification of the content of a model. A model content handler is - * responsible for handling model content notifications. As part of the handling - * the handler can produce new contents. - */ -public interface ModelContentHandler { - - /** - * Starts handling of a model. - */ - public void startModel(); - - /** - * Ends handling of a model. - */ - public void endModel(); - - /** - * Sets the contents list, where the content handler should store - * the contents that it produces. - * @param contents The contents to set - */ - public void setContents(List contents); - - /** - * Sets the linkers list. A content handler can add linker objects to this - * list. Linker objects must implement java.lang.Runnable. They are - * run as part of the endModel notification processing. - * Typically linker objects are used to resolve model forward references - * or establish model relationships after the model content has been - * handled. - * @param linkers The linkers to set - */ - public void setLinkers(List linkers); - - /** - * Sets the targets map. This map keeps track of the objects returned by - * the content handler for each object passed to its doSwitch method. - * @param targets The targets to set - */ - public void setTargets(Map targets); - - /** - * This method dispatches handling of the given object (XYZ for example) to a - * corresponding "caseXYZ()" method on the content handler. - */ - public Object doSwitch(Object object); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/util/ModelTransformer.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/util/ModelTransformer.java deleted file mode 100644 index 2a6fbe2f8a..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/util/ModelTransformer.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.util; - -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -/** - * A model transformer. Invokes a model content handler to perform the actual transformation. - */ -public interface ModelTransformer { - - /** - * Uses a ModelContentHandler to transform a model. - */ - public List transform(Iterator iterator, ModelContentHandler handler); - - /** - * Uses a ModelContentHandler to transform a model. Performs the first - * transform pass. - */ - public List transformPass1(Iterator iterator, ModelContentHandler handler, List deferredHandlers); - - /** - * Uses a ModelContentHandler to transform a model. Performs the first - * transform pass. - */ - public List transformPass1(Iterator iterator, final ModelContentHandler handler, List deferredHandlers, Map targets, List contents); - - /** - * Uses a ModelContentHandler to transform a model. Performs the second - * transform pass. - */ - public void transformPass2(List deferredHandlers); - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/util/ModelTransformerImpl.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/util/ModelTransformerImpl.java deleted file mode 100644 index 85458b03ef..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/util/ModelTransformerImpl.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.util; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - - -/** - * @author jsdelfino - * - * Base implementation for a model transformer. - * Invokes a model content handler to perform the actual transformation. - */ -public class ModelTransformerImpl implements ModelTransformer { - - /** - * Uses a ModelContentHandler to transform a model. - */ - public List transform(Iterator iterator, ModelContentHandler handler) { - - // Pass 1: visit the source model and create target model objects - List linkers=new ArrayList(); - List contents=transformPass1(iterator, handler, linkers); - - // Pass 2: resolve the links between the target model objects - transformPass2(linkers); - - // Return the target model contents - return contents; - } - - /** - * Uses a ModelContentHandler to transform a model. - */ - public List transformPass1(Iterator iterator, final ModelContentHandler handler, List deferredHandlers, Map targets, List contents) { - - // Initialize the handler - handler.setTargets(targets); - handler.setLinkers(deferredHandlers); - handler.setContents(contents); - - // This runnable will invoke endModel and clean up the handler - Runnable cleanup=new Runnable() { - public void run() { - - // Cleanup - handler.endModel(); - - handler.setTargets(null); - handler.setLinkers(null); - handler.setContents(null); - } - }; - - // Run the handler - try { - handler.startModel(); - - // Pass 1: compile, visit the source model and create target model objects - for (; iterator.hasNext(); ) { - Object source=iterator.next(); - if (source==null) - System.out.println("Ooops"); - Object target=handler.doSwitch(source); - - // Record source to target associations - targets.put(source,target); - } - - // Add the cleanup runnable - deferredHandlers.add(cleanup); - - } catch (Exception e) { - - // An exception occurred, run the cleanup now - cleanup.run(); - throw new RuntimeException(e); - } - - // return the target model contents - // note that this list may actually be populated in pass2 - return contents; - } - - /** - * Uses a ModelContentHandler to transform a model. - */ - public List transformPass1(Iterator iterator, final ModelContentHandler handler, List deferredHandlers) { - Map targets=new HashMap(); - List contents=new ArrayList(); - return transformPass1(iterator,handler,deferredHandlers,targets,contents); - } - - /** - * Uses a ModelContentHandler to transform a model. - */ - public void transformPass2(List deferredHandlers) { - - // Pass 2: link, resolve the links between the target model objects - for (Iterator i=deferredHandlers.iterator(); i.hasNext(); ) { - Runnable runnable=(Runnable)i.next(); - runnable.run(); - } - - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/util/XMLNameUtil.java b/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/util/XMLNameUtil.java deleted file mode 100644 index be707dbb9c..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/java/org/apache/tuscany/model/util/XMLNameUtil.java +++ /dev/null @@ -1,227 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.util; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.emf.common.util.URI; - -/** - * A utility class that converts between XML names and Java names. - */ -public class XMLNameUtil { - - private static final List domains = Arrays.asList(new String[]{"COM", "com", "ORG", "org"}); - - /** - * Constructor - */ - private XMLNameUtil() { - super(); - } - - /** - * Return an EPackage name for the given namespace. - * - * @param namespace - * @return - */ - public static String getPackageNameFromNamespace(String namespace) { - - URI uri = URI.createURI(namespace); - List parsedName; - if (uri.isHierarchical()) { - String host = uri.host(); - if (host != null && host.startsWith("www.")) { - host = host.substring(4); - } - parsedName = parseName(host, '.'); - Collections.reverse(parsedName); - if (!parsedName.isEmpty()) { - parsedName.set(0, ((String) parsedName.get(0)).toLowerCase()); - } - - parsedName.addAll(parseName(uri.trimFileExtension().path(), '/')); - - } else { - String opaquePart = uri.opaquePart(); - int index = opaquePart.indexOf(":"); - if (index != -1 && "urn".equalsIgnoreCase(uri.scheme())) { - parsedName = parseName(opaquePart.substring(0, index), '-'); - if (parsedName.size() > 0 && domains.contains(parsedName.get(parsedName.size() - 1))) { - Collections.reverse(parsedName); - parsedName.set(0, ((String) parsedName.get(0)).toLowerCase()); - } - parsedName.addAll(parseName(opaquePart.substring(index + 1), '/')); - - } else { - parsedName = parseName(opaquePart, '/'); - } - } - - StringBuffer qualifiedPackageName = new StringBuffer(); - for (Iterator i = parsedName.iterator(); i.hasNext();) { - String packageName = (String) i.next(); - if (packageName.length() > 0) { - if (qualifiedPackageName.length() > 0) { - qualifiedPackageName.append('.'); - } - qualifiedPackageName.append(getJavaNameFromXMLName(packageName, false)); - } - } - return qualifiedPackageName.toString(); - - } - - /** - * Returns a namespace prefix for the given package Name - * - * @param packageName - * @return - */ - public static String getNSPrefixFromPackageName(String packageName) { - String nsPrefix = packageName; - int index = nsPrefix.lastIndexOf('.'); - return index == -1 ? nsPrefix : nsPrefix.substring(index + 1); - } - - /** - * Parse the given name. - * - * @param sourceName - * @param separator - * @return - */ - private static List parseName(String sourceName, char separator) { - List result = new ArrayList(); - if (sourceName != null) { - StringBuffer currentWord = new StringBuffer(); - boolean lastIsLower = false; - for (int index = 0, length = sourceName.length(); index < length; ++index) { - char curChar = sourceName.charAt(index); - if (!Character.isJavaIdentifierPart(curChar)) { - curChar = separator; - } - if (Character.isUpperCase(curChar) || (!lastIsLower && Character.isDigit(curChar)) || curChar == separator) { - if (lastIsLower && currentWord.length() > 1 || curChar == separator && currentWord.length() > 0) { - result.add(currentWord.toString()); - currentWord = new StringBuffer(); - } - lastIsLower = false; - } else { - if (!lastIsLower) { - int currentWordLength = currentWord.length(); - if (currentWordLength > 1) { - char lastChar = currentWord.charAt(--currentWordLength); - currentWord.setLength(currentWordLength); - result.add(currentWord.toString()); - currentWord = new StringBuffer(); - currentWord.append(lastChar); - } - } - lastIsLower = true; - } - - if (curChar != separator) { - currentWord.append(curChar); - } - } - - result.add(currentWord.toString()); - } - return result; - } - - /** - * Returns a valid Java name from an XML Name - * - * @param name - * @param isUpperCase - * @return - */ - public static String getJavaNameFromXMLName(String name, boolean isUpperCase) { - List parsedName = parseName(name, '_'); - StringBuffer result = new StringBuffer(); - for (Iterator i = parsedName.iterator(); i.hasNext();) { - String nameComponent = (String) i.next(); - if (nameComponent.length() > 0) { - if (result.length() > 0 || isUpperCase) { - result.append(Character.toUpperCase(nameComponent.charAt(0))); - result.append(nameComponent.substring(1)); - } else { - result.append(nameComponent); - } - } - } - - return result.length() == 0 ? "_" : Character.isJavaIdentifierStart(result.charAt(0)) ? isUpperCase ? result.toString() : decapitalizeName(result.toString()) : "_" + result; - } - - /** - * Returns a valid fully qualified class name from a QName - * @param namespace - * @param name - * @return - */ - public static String getFullyQualifiedClassNameFromQName(String namespace, String name) { - return XMLNameUtil.getPackageNameFromNamespace(namespace)+'.'+XMLNameUtil.getJavaNameFromXMLName(name, true); - } - - /** - * Decapitalize a name. - * @param name - * @return - */ - public static String decapitalizeName(String name) { - if (name.length() == 0) { - return name; - } else { - String lowerName = name.toLowerCase(); - int i; - for (i = 0; i < name.length(); i++) { - if (name.charAt(i) == lowerName.charAt(i)) { - break; - } - } - if (i > 1 && i < name.length()) { - --i; - } - return name.substring(0, i).toLowerCase() + name.substring(i); - } - } - - /** - * Capitalize a name. - * @param name - * @return - */ - public static String capitalizeName(String name) { - int l=name.length(); - if (l == 0) { - return name; - } else if (l==1) { - return name.toUpperCase(); - } else { - return name.substring(0, 1).toUpperCase() + name.substring(1); - } - } - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/model/src/main/resources/model/assembly.mdl b/tags/java-stable-20060304/sca/model/src/main/resources/model/assembly.mdl deleted file mode 100644 index 63349ead08..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/resources/model/assembly.mdl +++ /dev/null @@ -1,6092 +0,0 @@ - -(object Petal - version 42 - _written "Rose 4.5.8163.3" - charSet 0) - -(object Design "Logical View" - is_unit TRUE - is_loaded TRUE - defaults (object defaults - rightMargin 0.250000 - leftMargin 0.250000 - topMargin 0.250000 - bottomMargin 0.500000 - pageOverlap 0.250000 - clipIconLabels TRUE - autoResize FALSE - snapToGrid FALSE - gridX 16 - gridY 16 - defaultFont (object Font - size 10 - face "Arial" - bold FALSE - italics FALSE - underline FALSE - strike FALSE - color 0 - default_color TRUE) - showMessageNum 1 - showClassOfObject TRUE - notation "Unified") - root_usecase_package (object Class_Category "Use Case View" - quid "4367BF7F0006" - exportControl "Public" - global TRUE - logical_models (list unit_reference_list) - logical_presentations (list unit_reference_list - (object UseCaseDiagram "Main" - quid "4367BF7F0037" - title "Main" - zoom 100 - max_height 28350 - max_width 21600 - origin_x 0 - origin_y 0 - items (list diagram_item_list)))) - root_category (object Class_Category "Logical View" - quid "4367BF7F0005" - exportControl "Public" - global TRUE - subsystem "Component View" - quidu "4367BF7F0007" - logical_models (list unit_reference_list - (object Class_Category "Assembly" - quid "4367BFA901F9" - exportControl "Public" - logical_models (list unit_reference_list - (object Class "Aggregate" - quid "4367BFB702AD" - class_attributes (list class_attribute_list - (object ClassAttribute "name" - quid "4367C06602E1"))) - (object Class "Part" - quid "4367BFD202AC" - class_attributes (list class_attribute_list - (object ClassAttribute "name" - quid "4367C07801CE"))) - (object Class "Component" - quid "4367C00800BF" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "4367C286003A" - supplier "Logical View::Assembly::Part" - quidu "4367BFD202AC"))) - (object Class "ExternalService" - quid "4367C00E009F" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "4367C289032D" - supplier "Logical View::Assembly::Part" - quidu "4367BFD202AC")) - class_attributes (list class_attribute_list - (object ClassAttribute "overridable" - quid "4367C3ED00C2"))) - (object Class "EntryPoint" - quid "4367C0210101" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "4367C27E030A" - supplier "Logical View::Assembly::Part" - quidu "4367BFD202AC"))) - (object Class "Binding" - quid "4367C18A02C3" - class_attributes (list class_attribute_list - (object ClassAttribute "uri" - quid "4367C191020E")) - abstract TRUE) - (object Class "ConfiguredImplementation" - quid "4367C1D70165" - abstract TRUE) - (object Class "ConfiguredService" - quid "4367C1E10105" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "4367C5EB01DE" - supplier "Logical View::Assembly::ConfiguredPort" - quidu "4367C5D400C3"))) - (object Class "ConfiguredReference" - quid "4367C1EC0011" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "4367C5EE02D3" - supplier "Logical View::Assembly::ConfiguredPort" - quidu "4367C5D400C3"))) - (object Class "ConfiguredProperty" - quid "4367C205012F" - class_attributes (list class_attribute_list - (object ClassAttribute "value" - quid "4367CBD8024E"))) - (object Class "ComponentType" - quid "4367C2A20289") - (object Class "Service" - quid "4367C2B1014A" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "4367C5A80001" - supplier "Logical View::Assembly::Port" - quidu "4367C58302CF")) - class_attributes (list class_attribute_list - (object ClassAttribute "name" - quid "4367C81C022B"))) - (object Class "Reference" - quid "4367C2B90318" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "4367C5AB00EC" - supplier "Logical View::Assembly::Port" - quidu "4367C58302CF")) - class_attributes (list class_attribute_list - (object ClassAttribute "multiplicity" - quid "4367C69F01AB"))) - (object Class "Property" - quid "4367C2C30381" - class_attributes (list class_attribute_list - (object ClassAttribute "default" - quid "4367C61B02A5") - (object ClassAttribute "many" - quid "4367C620007C") - (object ClassAttribute "name" - quid "4367C6230225") - (object ClassAttribute "required" - quid "4367C626025B"))) - (object Class "Interface" - quid "4367C4260179" - abstract TRUE) - (object Class "InterfaceType" - quid "4367C43900EA") - (object Class "Module" - quid "4367C4C90079" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "4367C4CF001D" - supplier "Logical View::Assembly::Implementation" - quidu "436833C300FA") - (object Inheritance_Relationship - quid "4367C4D4009D" - supplier "Logical View::Assembly::Aggregate" - quidu "4367BFB702AD"))) - (object Class "ModuleComponent" - quid "4367C4EA0315" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "4367C4FA01C4" - supplier "Logical View::Assembly::Component" - quidu "4367C00800BF"))) - (object Class "ModuleFragment" - quid "4367C50C038C" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "4367C52000D8" - supplier "Logical View::Assembly::Aggregate" - quidu "4367BFB702AD"))) - (object Class "Port" - quid "4367C58302CF") - (object Class "ConfiguredPort" - quid "4367C5D400C3") - (object Class "OperationType" - quid "4367C64601FD") - (object Class "Type" - quid "4367C65D0124") - (object Class "Subsystem" - quid "4367C757032C" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "4367C76B03AD" - supplier "Logical View::Assembly::Aggregate" - quidu "4367BFB702AD")) - class_attributes (list class_attribute_list - (object ClassAttribute "uri" - quid "4367C763003A"))) - (object Class "Implementation" - quid "436833C300FA" - abstract TRUE) - (object Class "ConfiguredModule" - quid "436836780038" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "436836C701A4" - supplier "Logical View::Assembly::ConfiguredImplementation" - quidu "4367C1D70165"))) - (object Association "$UNNAMED$0" - quid "4367C02A0050" - roles (list role_list - (object Role "$UNNAMED$1" - quid "4367C02A03D5" - supplier "Logical View::Assembly::Aggregate" - quidu "4367BFB702AD" - is_navigable TRUE - is_aggregate TRUE) - (object Role "entryPoints" - quid "4367C02A03D6" - label "entryPoints" - supplier "Logical View::Assembly::EntryPoint" - quidu "4367C0210101" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$2" - quid "4367C02C025B" - roles (list role_list - (object Role "$UNNAMED$3" - quid "4367C02D022B" - supplier "Logical View::Assembly::Aggregate" - quidu "4367BFB702AD" - is_navigable TRUE - is_aggregate TRUE) - (object Role "components" - quid "4367C02D022C" - label "components" - supplier "Logical View::Assembly::Component" - quidu "4367C00800BF" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$4" - quid "4367C02F02C4" - roles (list role_list - (object Role "$UNNAMED$5" - quid "4367C03002ED" - supplier "Logical View::Assembly::Aggregate" - quidu "4367BFB702AD" - is_navigable TRUE - is_aggregate TRUE) - (object Role "externalServices" - quid "4367C03002EE" - label "externalServices" - supplier "Logical View::Assembly::ExternalService" - quidu "4367C00E009F" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$6" - quid "4367C10E0314" - roles (list role_list - (object Role "aggregate" - quid "4367C10F0348" - label "aggregate" - supplier "Logical View::Assembly::Aggregate" - quidu "4367BFB702AD" - is_navigable TRUE - is_aggregate TRUE) - (object Role "parts" - quid "4367C10F0349" - label "parts" - supplier "Logical View::Assembly::Part" - quidu "4367BFD202AC" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$7" - quid "4367C265015F" - roles (list role_list - (object Role "$UNNAMED$8" - quid "4367C2660110" - supplier "Logical View::Assembly::Component" - quidu "4367C00800BF" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$9" - quid "4367C2660111" - supplier "Logical View::Assembly::ConfiguredService" - quidu "4367C1E10105" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$10" - quid "4367C269025F" - roles (list role_list - (object Role "$UNNAMED$11" - quid "4367C26A026B" - supplier "Logical View::Assembly::Component" - quidu "4367C00800BF" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$12" - quid "4367C26A026C" - supplier "Logical View::Assembly::ConfiguredReference" - quidu "4367C1EC0011" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$13" - quid "4367C26D0297" - roles (list role_list - (object Role "$UNNAMED$14" - quid "4367C26E037F" - supplier "Logical View::Assembly::Component" - quidu "4367C00800BF" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$15" - quid "4367C26E0380" - supplier "Logical View::Assembly::ConfiguredProperty" - quidu "4367C205012F" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$16" - quid "4367C29500DC" - roles (list role_list - (object Role "$UNNAMED$17" - quid "4367C296021E" - supplier "Logical View::Assembly::Component" - quidu "4367C00800BF" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$18" - quid "4367C296021F" - supplier "Logical View::Assembly::ConfiguredImplementation" - quidu "4367C1D70165" - client_cardinality (value cardinality "1..1") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$19" - quid "4367C2D50200" - roles (list role_list - (object Role "$UNNAMED$20" - quid "4367C2D60099" - supplier "Logical View::Assembly::ComponentType" - quidu "4367C2A20289" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$21" - quid "4367C2D6009A" - supplier "Logical View::Assembly::Service" - quidu "4367C2B1014A" - client_cardinality (value cardinality "1..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$22" - quid "4367C2D8018C" - roles (list role_list - (object Role "$UNNAMED$23" - quid "4367C2D9015C" - supplier "Logical View::Assembly::ComponentType" - quidu "4367C2A20289" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$24" - quid "4367C2D9015D" - supplier "Logical View::Assembly::Reference" - quidu "4367C2B90318" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$25" - quid "4367C2DC002A" - roles (list role_list - (object Role "$UNNAMED$26" - quid "4367C2DD0035" - supplier "Logical View::Assembly::ComponentType" - quidu "4367C2A20289" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$27" - quid "4367C2DD0036" - supplier "Logical View::Assembly::Property" - quidu "4367C2C30381" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$28" - quid "4367C2E901EB" - roles (list role_list - (object Role "$UNNAMED$29" - quid "4367C2EA020A" - supplier "Logical View::Assembly::Property" - quidu "4367C2C30381" - client_cardinality (value cardinality "1..1") - is_navigable TRUE) - (object Role "$UNNAMED$30" - quid "4367C2EA020B" - supplier "Logical View::Assembly::ConfiguredProperty" - quidu "4367C205012F"))) - (object Association "$UNNAMED$31" - quid "4367C2F00000" - roles (list role_list - (object Role "$UNNAMED$32" - quid "4367C2F10174" - supplier "Logical View::Assembly::ComponentType" - quidu "4367C2A20289" - client_cardinality (value cardinality "1..1") - is_navigable TRUE) - (object Role "$UNNAMED$33" - quid "4367C2F10175" - supplier "Logical View::Assembly::ConfiguredImplementation" - quidu "4367C1D70165"))) - (object Association "$UNNAMED$34" - quid "4367C3170350" - roles (list role_list - (object Role "$UNNAMED$35" - quid "4367C319008C" - supplier "Logical View::Assembly::ExternalService" - quidu "4367C00E009F" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$36" - quid "4367C319008D" - supplier "Logical View::Assembly::ConfiguredService" - quidu "4367C1E10105" - client_cardinality (value cardinality "1..1") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$37" - quid "4367C396015E" - roles (list role_list - (object Role "$UNNAMED$38" - quid "4367C39700D3" - supplier "Logical View::Assembly::EntryPoint" - quidu "4367C0210101" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$39" - quid "4367C39700D4" - supplier "Logical View::Assembly::Binding" - quidu "4367C18A02C3" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$40" - quid "4367C39A0240" - roles (list role_list - (object Role "$UNNAMED$41" - quid "4367C39B01AB" - supplier "Logical View::Assembly::ExternalService" - quidu "4367C00E009F" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$42" - quid "4367C39B01AC" - supplier "Logical View::Assembly::Binding" - quidu "4367C18A02C3" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$43" - quid "4367C39F021F" - roles (list role_list - (object Role "$UNNAMED$44" - quid "4367C3A0031B" - supplier "Logical View::Assembly::EntryPoint" - quidu "4367C0210101" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$45" - quid "4367C3A0031C" - supplier "Logical View::Assembly::ConfiguredReference" - quidu "4367C1EC0011" - client_cardinality (value cardinality "1..1") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$46" - quid "4367C4330286" - roles (list role_list - (object Role "$UNNAMED$47" - quid "4367C4340327" - supplier "Logical View::Assembly::Port" - quidu "4367C58302CF" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$48" - quid "4367C4340328" - supplier "Logical View::Assembly::Interface" - quidu "4367C4260179" - client_cardinality (value cardinality "1..1") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$49" - quid "4367C4440168" - roles (list role_list - (object Role "$UNNAMED$50" - quid "4367C44500FB" - supplier "Logical View::Assembly::InterfaceType" - quidu "4367C43900EA" - client_cardinality (value cardinality "0..1") - is_navigable TRUE) - (object Role "$UNNAMED$51" - quid "4367C44500FC" - supplier "Logical View::Assembly::Interface" - quidu "4367C4260179"))) - (object Association "$UNNAMED$52" - quid "4367C44A01DF" - roles (list role_list - (object Role "$UNNAMED$53" - quid "4367C44C0155" - supplier "Logical View::Assembly::InterfaceType" - quidu "4367C43900EA" - client_cardinality (value cardinality "1..1") - is_navigable TRUE) - (object Role "$UNNAMED$54" - quid "4367C44C0156" - supplier "Logical View::Assembly::Interface" - quidu "4367C4260179"))) - (object Association "$UNNAMED$55" - quid "4367C52701D2" - roles (list role_list - (object Role "$UNNAMED$56" - quid "4367C52801FC" - supplier "Logical View::Assembly::Module" - quidu "4367C4C90079" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$57" - quid "4367C52801FD" - supplier "Logical View::Assembly::ModuleFragment" - quidu "4367C50C038C" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$58" - quid "4367C5E00369" - roles (list role_list - (object Role "$UNNAMED$59" - quid "4367C5E10342" - supplier "Logical View::Assembly::Port" - quidu "4367C58302CF" - client_cardinality (value cardinality "1..1") - is_navigable TRUE) - (object Role "$UNNAMED$60" - quid "4367C5E10343" - supplier "Logical View::Assembly::ConfiguredPort" - quidu "4367C5D400C3"))) - (object Association "$UNNAMED$61" - quid "4367C65601D8" - roles (list role_list - (object Role "$UNNAMED$62" - quid "4367C65701A7" - supplier "Logical View::Assembly::InterfaceType" - quidu "4367C43900EA" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$63" - quid "4367C65701A8" - supplier "Logical View::Assembly::OperationType" - quidu "4367C64601FD" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$64" - quid "4367C66702F5" - roles (list role_list - (object Role "$UNNAMED$65" - quid "4367C6680328" - supplier "Logical View::Assembly::OperationType" - quidu "4367C64601FD") - (object Role "exceptionTypes" - quid "4367C6680329" - label "exceptionTypes" - supplier "Logical View::Assembly::Type" - quidu "4367C65D0124" - client_cardinality (value cardinality "0..n") - is_navigable TRUE))) - (object Association "$UNNAMED$66" - quid "4367C66B039B" - roles (list role_list - (object Role "$UNNAMED$67" - quid "4367C66C02FC" - supplier "Logical View::Assembly::OperationType" - quidu "4367C64601FD") - (object Role "outputType" - quid "4367C66C02FD" - label "outputType" - supplier "Logical View::Assembly::Type" - quidu "4367C65D0124" - client_cardinality (value cardinality "0..1") - is_navigable TRUE))) - (object Association "$UNNAMED$68" - quid "4367C671033F" - roles (list role_list - (object Role "$UNNAMED$69" - quid "4367C6730202" - supplier "Logical View::Assembly::OperationType" - quidu "4367C64601FD") - (object Role "inputType" - quid "4367C6730203" - label "inputType" - supplier "Logical View::Assembly::Type" - quidu "4367C65D0124" - client_cardinality (value cardinality "1..1") - is_navigable TRUE))) - (object Association "$UNNAMED$70" - quid "4367C6790391" - roles (list role_list - (object Role "$UNNAMED$71" - quid "4367C67B0073" - supplier "Logical View::Assembly::Type" - quidu "4367C65D0124" - is_navigable TRUE) - (object Role "$UNNAMED$72" - quid "4367C67B007D" - supplier "Logical View::Assembly::Property" - quidu "4367C2C30381"))) - (object Association "$UNNAMED$73" - quid "4367C6C10222" - roles (list role_list - (object Role "serviceEndpoints" - quid "4367C6C20129" - label "serviceEndpoints" - supplier "Logical View::Assembly::ConfiguredService" - quidu "4367C1E10105" - client_cardinality (value cardinality "0..n") - is_navigable TRUE) - (object Role "$UNNAMED$74" - quid "4367C6C2012A" - supplier "Logical View::Assembly::ConfiguredReference" - quidu "4367C1EC0011"))) - (object Association "$UNNAMED$75" - quid "4367C73A0384" - roles (list role_list - (object Role "$UNNAMED$76" - quid "4367C73C0020" - supplier "Logical View::Assembly::Service" - quidu "4367C2B1014A" - client_cardinality (value cardinality "1..1") - is_navigable TRUE) - (object Role "$UNNAMED$77" - quid "4367C73C0021" - supplier "Logical View::Assembly::ConfiguredService" - quidu "4367C1E10105"))) - (object Association "$UNNAMED$78" - quid "4367C740038D" - roles (list role_list - (object Role "$UNNAMED$79" - quid "4367C7420001" - supplier "Logical View::Assembly::Reference" - quidu "4367C2B90318" - client_cardinality (value cardinality "1..1") - is_navigable TRUE) - (object Role "$UNNAMED$80" - quid "4367C7420002" - supplier "Logical View::Assembly::ConfiguredReference" - quidu "4367C1EC0011"))) - (object Association "$UNNAMED$81" - quid "43682F4B0394" - roles (list role_list - (object Role "$UNNAMED$82" - quid "43682F4D0076" - supplier "Logical View::Assembly::ModuleComponent" - quidu "4367C4EA0315" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$83" - quid "43682F4D0077" - supplier "Logical View::Assembly::ConfiguredModule" - quidu "436836780038" - client_cardinality (value cardinality "1..1") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$84" - quid "436834860263" - roles (list role_list - (object Role "$UNNAMED$85" - quid "436834870246" - supplier "Logical View::Assembly::Subsystem" - quidu "4367C757032C" - is_navigable TRUE - is_aggregate TRUE) - (object Role "$UNNAMED$86" - quid "436834870247" - supplier "Logical View::Assembly::ModuleComponent" - quidu "4367C4EA0315" - client_cardinality (value cardinality "0..n") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$87" - quid "436835A101A2" - roles (list role_list - (object Role "$UNNAMED$88" - quid "436835A20289" - supplier "Logical View::Assembly::Implementation" - quidu "436833C300FA" - client_cardinality (value cardinality "0..1") - is_navigable TRUE) - (object Role "$UNNAMED$89" - quid "436835A2028A" - supplier "Logical View::Assembly::ConfiguredImplementation" - quidu "4367C1D70165"))) - (object Association "$UNNAMED$90" - quid "436836850218" - roles (list role_list - (object Role "$UNNAMED$91" - quid "43683686027D" - supplier "Logical View::Assembly::ConfiguredModule" - quidu "436836780038") - (object Role "$UNNAMED$92" - quid "43683686027E" - supplier "Logical View::Assembly::Module" - quidu "4367C4C90079" - client_cardinality (value cardinality "1..1") - is_navigable TRUE))) - (object Association "$UNNAMED$93" - quid "43683779039F" - roles (list role_list - (object Role "$UNNAMED$94" - quid "4368377C0082" - supplier "Logical View::Assembly::ComponentType" - quidu "4367C2A20289" - client_cardinality (value cardinality "1..1") - is_navigable TRUE) - (object Role "$UNNAMED$95" - quid "4368377C0083" - supplier "Logical View::Assembly::Component" - quidu "4367C00800BF")))) - logical_presentations (list unit_reference_list - (object ClassDiagram "Main" - quid "4367BFB001D1" - title "Main" - zoom 65 - max_height 28350 - max_width 21600 - origin_x 1596 - origin_y 0 - items (list diagram_item_list - (object ClassView "Class" "Logical View::Assembly::ConfiguredPort" @1 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (2634, 1211) - label (object ItemLabel - Parent_View @1 - location (2456, 1142) - fill_color 13434879 - nlines 1 - max_width 356 - justify 0 - label "ConfiguredPort") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C5D400C3" - width 374 - height 163 - annotation 8) - (object ClassView "Class" "Logical View::Assembly::Port" @2 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (3441, 1216) - label (object ItemLabel - Parent_View @2 - location (3311, 1147) - fill_color 13434879 - nlines 1 - max_width 261 - justify 0 - label "Port") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C58302CF" - width 279 - height 163 - annotation 8) - (object AssociationViewNew "$UNNAMED$58" @3 - location (3061, 1212) - stereotype TRUE - line_color 3342489 - quidu "4367C5E00369" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$59" @4 - Parent_View @3 - location (1135, 341) - stereotype TRUE - line_color 3342489 - quidu "4367C5E10342" - client @3 - supplier @2 - line_style 0 - label (object SegLabel @5 - Parent_View @4 - location (3243, 1254) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "1..1" - pctDist 0.763992 - height 40 - orientation 1)) - (object RoleView "$UNNAMED$60" @6 - Parent_View @3 - location (1135, 341) - stereotype TRUE - line_color 3342489 - quidu "4367C5E10343" - client @3 - supplier @1 - line_style 0))) - (object ClassView "Class" "Logical View::Assembly::Interface" @7 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (3955, 1139) - font (object Font - italics TRUE) - label (object ItemLabel - Parent_View @7 - location (3825, 1066) - fill_color 13434879 - nlines 1 - max_width 261 - justify 0 - label "Interface") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C4260179" - width 279 - height 173 - annotation 8) - (object AssociationViewNew "$UNNAMED$46" @8 - location (3697, 1176) - stereotype TRUE - line_color 3342489 - quidu "4367C4330286" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$47" @9 - Parent_View @8 - location (1011, 170) - stereotype TRUE - line_color 3342489 - quidu "4367C4340327" - client @8 - supplier @2 - line_style 0) - (object RoleView "$UNNAMED$48" @10 - Parent_View @8 - location (1011, 170) - stereotype TRUE - line_color 3342489 - quidu "4367C4340328" - client @8 - supplier @7 - line_style 0 - label (object SegLabel @11 - Parent_View @10 - location (3799, 1203) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "1..1" - pctDist 0.813510 - height 41 - orientation 1)))) - (object ClassView "Class" "Logical View::Assembly::InterfaceType" @12 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (3955, 1643) - label (object ItemLabel - Parent_View @12 - location (3764, 1590) - fill_color 13434879 - nlines 1 - max_width 382 - justify 0 - label "InterfaceType") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C43900EA" - width 400 - height 131 - annotation 8) - (object AssociationViewNew "$UNNAMED$49" @13 - location (3866, 1367) - stereotype TRUE - line_color 3342489 - quidu "4367C4440168" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$50" @14 - Parent_View @13 - location (1180, 361) - label (object SegLabel @15 - Parent_View @14 - location (3863, 1554) - hidden TRUE - anchor 1 - anchor_loc 1 - nlines 1 - max_width 60 - justify 0 - label "" - pctDist 0.800000 - height 42 - orientation 1) - stereotype TRUE - line_color 3342489 - quidu "4367C44500FB" - client @13 - supplier @12 - vertices (list Points - (3866, 1367) - (3845, 1423) - (3921, 1577)) - line_style 0 - label (object SegLabel @16 - Parent_View @14 - location (3857, 1543) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..1" - pctDist 0.746635 - height 43 - orientation 1)) - (object RoleView "$UNNAMED$51" @17 - Parent_View @13 - location (1180, 361) - stereotype TRUE - line_color 3342489 - quidu "4367C44500FC" - client @13 - supplier @7 - line_style 0))) - (object AssociationViewNew "$UNNAMED$52" @18 - location (4002, 1388) - stereotype TRUE - line_color 3342489 - quidu "4367C44A01DF" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$53" @19 - Parent_View @18 - location (1316, 382) - label (object SegLabel @20 - Parent_View @19 - location (3945, 1529) - hidden TRUE - anchor 1 - anchor_loc 1 - nlines 1 - max_width 60 - justify 0 - label "" - pctDist 0.800000 - height 42 - orientation 1) - stereotype TRUE - line_color 3342489 - quidu "4367C44C0155" - client @18 - supplier @12 - vertices (list Points - (4002, 1388) - (4013, 1447) - (3973, 1577)) - line_style 0 - label (object SegLabel @21 - Parent_View @19 - location (4036, 1548) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "1..1" - pctDist 0.769913 - height 51 - orientation 0)) - (object RoleView "$UNNAMED$54" @22 - Parent_View @18 - location (1316, 382) - stereotype TRUE - line_color 3342489 - quidu "4367C44C0156" - client @18 - supplier @7 - line_style 0))) - (object ClassView "Class" "Logical View::Assembly::OperationType" @23 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (3960, 1960) - label (object ItemLabel - Parent_View @23 - location (3774, 1891) - fill_color 13434879 - nlines 1 - max_width 372 - justify 0 - label "OperationType") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C64601FD" - width 390 - height 162 - annotation 8) - (object AssociationViewNew "$UNNAMED$61" @24 - location (3956, 1793) - stereotype TRUE - line_color 3342489 - quidu "4367C65601D8" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$62" @25 - Parent_View @24 - location (975, 69) - stereotype TRUE - line_color 3342489 - quidu "4367C65701A7" - client @24 - supplier @12 - line_style 0) - (object RoleView "$UNNAMED$63" @26 - Parent_View @24 - location (975, 69) - stereotype TRUE - line_color 3342489 - quidu "4367C65701A8" - client @24 - supplier @23 - line_style 0 - label (object SegLabel @27 - Parent_View @26 - location (4005, 1843) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.583172 - height 48 - orientation 0)))) - (object ClassView "Class" "Logical View::Assembly::Binding" @28 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (1659, 2077) - font (object Font - italics TRUE) - label (object ItemLabel - Parent_View @28 - location (1505, 2008) - fill_color 13434879 - nlines 1 - max_width 308 - justify 0 - label "Binding") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C18A02C3" - compartment (object Compartment - Parent_View @28 - location (1505, 2071) - icon_style "Icon" - fill_color 13434879 - anchor 2 - nlines 2 - max_width 103) - width 326 - height 163 - annotation 8) - (object NoteView @29 - location (4165, 2265) - label (object ItemLabel - Parent_View @29 - location (3990, 2190) - fill_color 13434879 - nlines 3 - max_width 315 - label "input, output and exception types") - line_color 3342489 - fill_color 13434879 - width 375 - height 163) - (object NoteView @30 - location (4268, 1394) - label (object ItemLabel - Parent_View @30 - location (4083, 1323) - fill_color 13434879 - nlines 3 - max_width 334 - label "interface and callback interface") - line_color 3342489 - fill_color 13434879 - width 394 - height 154) - (object ClassView "Class" "Logical View::Assembly::ModuleFragment" @31 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (1370, 557) - label (object ItemLabel - Parent_View @31 - location (1185, 477) - fill_color 13434879 - nlines 1 - max_width 371 - justify 0 - label "ModuleFragment") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C50C038C" - width 389 - height 184 - annotation 8) - (object ClassView "Class" "Logical View::Assembly::Subsystem" @32 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (322, 207) - label (object ItemLabel - Parent_View @32 - location (86, 119) - fill_color 13434879 - nlines 1 - max_width 472 - justify 0 - label "Subsystem") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C757032C" - compartment (object Compartment - Parent_View @32 - location (86, 177) - icon_style "Icon" - fill_color 13434879 - anchor 2 - nlines 2 - max_width 103) - width 490 - height 201 - annotation 8) - (object ClassView "Class" "Logical View::Assembly::Module" @33 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (2484, 221) - label (object ItemLabel - Parent_View @33 - location (2277, 123) - fill_color 13434879 - nlines 1 - max_width 414 - justify 0 - label "Module") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C4C90079" - width 432 - height 221 - annotation 8) - (object AssociationViewNew "$UNNAMED$55" @34 - location (1915, 391) - stereotype TRUE - line_color 3342489 - quidu "4367C52701D2" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$56" @35 - Parent_View @34 - location (89, -1440) - stereotype TRUE - line_color 3342489 - quidu "4367C52801FC" - client @34 - supplier @33 - line_style 0) - (object RoleView "$UNNAMED$57" @36 - Parent_View @34 - location (89, -1440) - stereotype TRUE - line_color 3342489 - quidu "4367C52801FD" - client @34 - supplier @31 - line_style 0 - label (object SegLabel @37 - Parent_View @36 - location (1890, 443) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.110588 - height 43 - orientation 0)))) - (object ClassView "Class" "Logical View::Assembly::ModuleComponent" @38 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (970, 216) - label (object ItemLabel - Parent_View @38 - location (739, 132) - fill_color 13434879 - nlines 1 - max_width 463 - justify 0 - label "ModuleComponent") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C4EA0315" - width 481 - height 193 - annotation 8) - (object AssociationViewNew "$UNNAMED$84" @39 - location (648, 211) - stereotype TRUE - line_color 12632256 - quidu "436834860263" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$85" @40 - Parent_View @39 - location (-443, -183) - stereotype TRUE - line_color 3342489 - quidu "436834870246" - client @39 - supplier @32 - line_style 0) - (object RoleView "$UNNAMED$86" @41 - Parent_View @39 - location (-443, -183) - stereotype TRUE - line_color 3342489 - quidu "436834870247" - client @39 - supplier @38 - line_style 0 - label (object SegLabel @42 - Parent_View @41 - location (693, 255) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.549832 - height 43 - orientation 1)))) - (object ClassView "Class" "Logical View::Assembly::ConfiguredModule" @43 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (1686, 216) - label (object ItemLabel - Parent_View @43 - location (1484, 146) - fill_color 13434879 - nlines 1 - max_width 405 - justify 0 - label "ConfiguredModule") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "436836780038" - width 423 - height 164 - annotation 8) - (object AssociationViewNew "$UNNAMED$90" @44 - location (2082, 217) - stereotype TRUE - line_color 3342489 - quidu "436836850218" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$91" @45 - Parent_View @44 - location (-369, -23) - stereotype TRUE - line_color 3342489 - quidu "43683686027D" - client @44 - supplier @43 - line_style 0) - (object RoleView "$UNNAMED$92" @46 - Parent_View @44 - location (-369, -23) - stereotype TRUE - line_color 3342489 - quidu "43683686027E" - client @44 - supplier @33 - line_style 0 - label (object SegLabel @47 - Parent_View @46 - location (2201, 251) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "1..1" - pctDist 0.649262 - height 33 - orientation 1)))) - (object AssociationViewNew "$UNNAMED$81" @48 - location (1342, 216) - stereotype TRUE - line_color 12632256 - quidu "43682F4B0394" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$82" @49 - Parent_View @48 - location (-566, -5) - stereotype TRUE - line_color 3342489 - quidu "43682F4D0076" - client @48 - supplier @38 - line_style 0) - (object RoleView "$UNNAMED$83" @50 - Parent_View @48 - location (-566, -5) - stereotype TRUE - line_color 3342489 - quidu "43682F4D0077" - client @48 - supplier @43 - line_style 0 - label (object SegLabel @51 - Parent_View @50 - location (1431, 183) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "1..1" - pctDist 0.677064 - height 34 - orientation 0)))) - (object ClassView "Class" "Logical View::Assembly::Part" @52 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (282, 1734) - label (object ItemLabel - Parent_View @52 - location (144, 1652) - fill_color 13434879 - nlines 1 - max_width 276 - justify 0 - label "Part") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367BFD202AC" - compartment (object Compartment - Parent_View @52 - location (144, 1710) - icon_style "Icon" - fill_color 13434879 - anchor 2 - nlines 2 - max_width 159) - width 294 - height 188 - annotation 8) - (object ClassView "Class" "Logical View::Assembly::ExternalService" @53 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (1065, 2289) - label (object ItemLabel - Parent_View @53 - location (887, 2205) - fill_color 13434879 - nlines 1 - max_width 357 - justify 0 - label "ExternalService") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C00E009F" - compartment (object Compartment - Parent_View @53 - location (887, 2263) - icon_style "Icon" - fill_color 13434879 - anchor 2 - nlines 2 - max_width 250) - width 375 - height 192 - annotation 8) - (object AssociationViewNew "$UNNAMED$40" @54 - location (1373, 2177) - stereotype TRUE - line_color 3342489 - quidu "4367C39A0240" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$41" @55 - Parent_View @54 - location (749, 499) - stereotype TRUE - line_color 3342489 - quidu "4367C39B01AB" - client @54 - supplier @53 - line_style 0) - (object RoleView "$UNNAMED$42" @56 - Parent_View @54 - location (749, 499) - stereotype TRUE - line_color 3342489 - quidu "4367C39B01AC" - client @54 - supplier @28 - line_style 0 - label (object SegLabel @57 - Parent_View @56 - location (1484, 2184) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.781968 - height 45 - orientation 1)))) - (object InheritView "" @58 - stereotype TRUE - line_color 3342489 - quidu "4367C289032D" - client @53 - supplier @52 - vertices (list Points - (877, 2266) - (659, 2241) - (352, 1828)) - line_style 0) - (object ClassView "Class" "Logical View::Assembly::EntryPoint" @59 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (1024, 1697) - label (object ItemLabel - Parent_View @59 - location (865, 1618) - fill_color 13434879 - nlines 1 - max_width 319 - justify 0 - label "EntryPoint") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C0210101" - width 337 - height 183 - annotation 8) - (object AssociationViewNew "$UNNAMED$37" @60 - location (1349, 1891) - stereotype TRUE - line_color 3342489 - quidu "4367C396015E" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$38" @61 - Parent_View @60 - location (725, 213) - stereotype TRUE - line_color 3342489 - quidu "4367C39700D3" - client @60 - supplier @59 - line_style 0) - (object RoleView "$UNNAMED$39" @62 - Parent_View @60 - location (725, 213) - stereotype TRUE - line_color 3342489 - quidu "4367C39700D4" - client @60 - supplier @28 - line_style 0 - label (object SegLabel @63 - Parent_View @62 - location (1533, 1950) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.928105 - height 44 - orientation 0)))) - (object InheritView "" @64 - stereotype TRUE - line_color 3342489 - quidu "4367C27E030A" - client @59 - supplier @52 - line_style 0) - (object ClassView "Class" "Logical View::Assembly::Type" @65 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (3664, 2296) - label (object ItemLabel - Parent_View @65 - location (3557, 2247) - fill_color 13434879 - nlines 1 - max_width 214 - justify 0 - label "Type") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C65D0124" - width 232 - height 122 - annotation 8) - (object AssociationViewNew "$UNNAMED$64" @66 - location (3881, 2120) - stereotype TRUE - line_color 3342489 - quidu "4367C66702F5" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$65" @67 - Parent_View @66 - location (1247, 106) - stereotype TRUE - line_color 3342489 - quidu "4367C6680328" - client @66 - supplier @23 - line_style 0) - (object RoleView "exceptionTypes" @68 - Parent_View @66 - location (1247, 106) - stereotype TRUE - line_color 3342489 - quidu "4367C6680329" - client @66 - supplier @65 - vertices (list Points - (3881, 2120) - (3855, 2174) - (3760, 2234)) - line_style 0 - label (object SegLabel @69 - Parent_View @68 - location (3833, 2235) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.653401 - height 40 - orientation 0)))) - (object AttachView "" @70 - stereotype TRUE - line_color 3342489 - client @29 - supplier @66 - line_style 0) - (object AssociationViewNew "$UNNAMED$66" @71 - location (3802, 2137) - stereotype TRUE - line_color 3342489 - quidu "4367C66B039B" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$67" @72 - Parent_View @71 - location (1168, 123) - stereotype TRUE - line_color 3342489 - quidu "4367C66C02FC" - client @71 - supplier @23 - line_style 0) - (object RoleView "outputType" @73 - Parent_View @71 - location (1168, 123) - stereotype TRUE - line_color 3342489 - quidu "4367C66C02FD" - client @71 - supplier @65 - line_style 0 - label (object SegLabel @74 - Parent_View @73 - location (3759, 2156) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..1" - pctDist 0.329806 - height 21 - orientation 1)))) - (object AttachView "" @75 - stereotype TRUE - line_color 3342489 - client @29 - supplier @71 - line_style 0) - (object AssociationViewNew "$UNNAMED$68" @76 - location (3770, 2078) - stereotype TRUE - line_color 3342489 - quidu "4367C671033F" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$69" @77 - Parent_View @76 - location (1136, 64) - stereotype TRUE - line_color 3342489 - quidu "4367C6730202" - client @76 - supplier @23 - line_style 0) - (object RoleView "inputType" @78 - Parent_View @76 - location (1136, 64) - stereotype TRUE - line_color 3342489 - quidu "4367C6730203" - client @76 - supplier @65 - vertices (list Points - (3770, 2078) - (3720, 2111) - (3682, 2234)) - line_style 0 - label (object SegLabel @79 - Parent_View @78 - location (3659, 2182) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "1..1" - pctDist 0.773759 - height 39 - orientation 1)))) - (object AttachView "" @80 - stereotype TRUE - line_color 3342489 - client @29 - supplier @76 - line_style 0) - (object ClassView "Class" "Logical View::Assembly::Property" @81 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (2790, 1913) - label (object ItemLabel - Parent_View @81 - location (2645, 1756) - fill_color 13434879 - nlines 1 - max_width 290 - justify 0 - label "Property") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C2C30381" - compartment (object Compartment - Parent_View @81 - location (2645, 1814) - icon_style "Icon" - fill_color 13434879 - anchor 2 - nlines 5 - max_width 203) - width 308 - height 338 - annotation 8) - (object AssociationViewNew "$UNNAMED$70" @82 - location (3245, 2112) - stereotype TRUE - line_color 3342489 - quidu "4367C6790391" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$71" @83 - Parent_View @82 - location (1168, 892) - stereotype TRUE - line_color 3342489 - quidu "4367C67B0073" - client @82 - supplier @65 - line_style 0) - (object RoleView "$UNNAMED$72" @84 - Parent_View @82 - location (1168, 892) - stereotype TRUE - line_color 3342489 - quidu "4367C67B007D" - client @82 - supplier @81 - line_style 0))) - (object ClassView "Class" "Logical View::Assembly::Service" @85 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (3340, 846) - label (object ItemLabel - Parent_View @85 - location (3167, 776) - fill_color 13434879 - nlines 1 - max_width 347 - justify 0 - label "Service") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C2B1014A" - compartment (object Compartment - Parent_View @85 - location (3167, 834) - icon_style "Icon" - fill_color 13434879 - anchor 2 - nlines 2 - max_width 164) - width 365 - height 164 - annotation 8) - (object InheritView "" @86 - stereotype TRUE - line_color 3342489 - quidu "4367C5A80001" - client @85 - supplier @2 - line_style 0) - (object ClassView "Class" "Logical View::Assembly::Reference" @87 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (3350, 1567) - label (object ItemLabel - Parent_View @87 - location (3167, 1488) - fill_color 13434879 - nlines 1 - max_width 367 - justify 0 - label "Reference") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C2B90318" - compartment (object Compartment - Parent_View @87 - location (3167, 1546) - icon_style "Icon" - fill_color 13434879 - anchor 2 - nlines 2 - max_width 253) - width 385 - height 183 - annotation 8) - (object InheritView "" @88 - stereotype TRUE - line_color 3342489 - quidu "4367C5AB00EC" - client @87 - supplier @2 - line_style 0) - (object ClassView "Class" "Logical View::Assembly::Aggregate" @89 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (419, 815) - label (object ItemLabel - Parent_View @89 - location (194, 733) - fill_color 13434879 - nlines 1 - max_width 451 - justify 0 - label "Aggregate") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367BFB702AD" - compartment (object Compartment - Parent_View @89 - location (194, 791) - icon_style "Icon" - fill_color 13434879 - anchor 2 - nlines 2 - max_width 159) - width 469 - height 188 - annotation 8) - (object AssociationViewNew "$UNNAMED$6" @90 - location (212, 1248) - stereotype TRUE - line_color 12632256 - quidu "4367C10E0314" - roleview_list (list RoleViews - (object RoleView "aggregate" @91 - Parent_View @90 - location (-1159, 723) - stereotype TRUE - line_color 3342489 - quidu "4367C10F0348" - client @90 - supplier @89 - vertices (list Points - (212, 1248) - (174, 981) - (278, 909)) - line_style 0) - (object RoleView "parts" @92 - Parent_View @90 - location (-1159, 723) - stereotype TRUE - line_color 3342489 - quidu "4367C10F0349" - client @90 - supplier @52 - line_style 0 - label (object SegLabel @93 - Parent_View @92 - location (214, 1579) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.833230 - height 45 - orientation 1)))) - (object AssociationViewNew "$UNNAMED$4" @94 - location (651, 1575) - stereotype TRUE - line_color 3342489 - quidu "4367C02F02C4" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$5" @95 - Parent_View @94 - location (-451, 638) - stereotype TRUE - line_color 3342489 - quidu "4367C03002ED" - client @94 - supplier @89 - vertices (list Points - (651, 1575) - (510, 1332) - (434, 909)) - line_style 0) - (object RoleView "externalServices" @96 - Parent_View @94 - location (-451, 638) - stereotype TRUE - line_color 3342489 - quidu "4367C03002EE" - client @94 - supplier @53 - line_style 0 - label (object SegLabel @97 - Parent_View @96 - location (914, 2131) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.858067 - height 51 - orientation 1)))) - (object AssociationViewNew "$UNNAMED$0" @98 - location (678, 1277) - stereotype TRUE - line_color 3342489 - quidu "4367C02A0050" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$1" @99 - Parent_View @98 - location (297, 346) - stereotype TRUE - line_color 3342489 - quidu "4367C02A03D5" - client @98 - supplier @89 - line_style 0) - (object RoleView "entryPoints" @100 - Parent_View @98 - location (297, 346) - stereotype TRUE - line_color 3342489 - quidu "4367C02A03D6" - client @98 - supplier @59 - vertices (list Points - (678, 1277) - (741, 1390) - (939, 1605)) - line_style 0 - label (object SegLabel @101 - Parent_View @100 - location (973, 1554) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.965692 - height 60 - orientation 0)))) - (object InheritView "" @102 - stereotype TRUE - line_color 3342489 - quidu "4367C76B03AD" - client @32 - supplier @89 - line_style 0) - (object InheritView "" @103 - stereotype TRUE - line_color 3342489 - quidu "4367C52000D8" - client @31 - supplier @89 - line_style 0) - (object ClassView "Class" "Logical View::Assembly::ConfiguredProperty" @104 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (2239, 1836) - label (object ItemLabel - Parent_View @104 - location (2047, 1771) - fill_color 13434879 - nlines 1 - max_width 385 - justify 0 - label "ConfiguredProperty") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C205012F" - compartment (object Compartment - Parent_View @104 - location (2047, 1829) - icon_style "Icon" - fill_color 13434879 - anchor 2 - nlines 2 - max_width 150) - width 403 - height 154 - annotation 8) - (object AssociationViewNew "$UNNAMED$28" @105 - location (2537, 1876) - stereotype TRUE - line_color 3342489 - quidu "4367C2E901EB" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$29" @106 - Parent_View @105 - location (1178, 683) - stereotype TRUE - line_color 3342489 - quidu "4367C2EA020A" - client @105 - supplier @81 - line_style 0 - label (object SegLabel @107 - Parent_View @106 - location (2608, 1941) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "1..1" - pctDist 0.806972 - height 55 - orientation 1)) - (object RoleView "$UNNAMED$30" @108 - Parent_View @105 - location (1178, 683) - stereotype TRUE - line_color 3342489 - quidu "4367C2EA020B" - client @105 - supplier @104 - line_style 0))) - (object ClassView "Class" "Logical View::Assembly::ConfiguredService" @109 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (1925, 1197) - label (object ItemLabel - Parent_View @109 - location (1697, 1138) - fill_color 13434879 - nlines 1 - max_width 457 - justify 0 - label "ConfiguredService") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C1E10105" - width 475 - height 143 - annotation 8) - (object AssociationViewNew "$UNNAMED$34" @110 - location (1503, 1730) - stereotype TRUE - line_color 3342489 - quidu "4367C3170350" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$35" @111 - Parent_View @110 - location (223, 968) - stereotype TRUE - line_color 3342489 - quidu "4367C319008C" - client @110 - supplier @53 - line_style 0) - (object RoleView "$UNNAMED$36" @112 - Parent_View @110 - location (223, 968) - stereotype TRUE - line_color 3342489 - quidu "4367C319008D" - client @110 - supplier @109 - line_style 0 - label (object SegLabel @113 - Parent_View @112 - location (1790, 1305) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "1..1" - pctDist 0.870036 - height 39 - orientation 0)))) - (object InheritView "" @114 - stereotype TRUE - line_color 3342489 - quidu "4367C5EB01DE" - client @109 - supplier @1 - line_style 0) - (object AssociationViewNew "$UNNAMED$75" @115 - location (2659, 1013) - stereotype TRUE - line_color 12632256 - quidu "4367C73A0384" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$76" @116 - Parent_View @115 - location (1257, 535) - stereotype TRUE - line_color 3342489 - quidu "4367C73C0020" - client @115 - supplier @85 - line_style 0 - label (object SegLabel @117 - Parent_View @116 - location (3121, 954) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "1..1" - pctDist 0.900000 - height 54 - orientation 1)) - (object RoleView "$UNNAMED$77" @118 - Parent_View @115 - location (1257, 535) - stereotype TRUE - line_color 3342489 - quidu "4367C73C0021" - client @115 - supplier @109 - line_style 0))) - (object ClassView "Class" "Logical View::Assembly::ConfiguredReference" @119 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (2109, 1507) - label (object ItemLabel - Parent_View @119 - location (1906, 1444) - fill_color 13434879 - nlines 1 - max_width 407 - justify 0 - label "ConfiguredReference") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C1EC0011" - width 425 - height 150 - annotation 8) - (object AssociationViewNew "$UNNAMED$43" @120 - location (1544, 1605) - stereotype TRUE - line_color 3342489 - quidu "4367C39F021F" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$44" @121 - Parent_View @120 - location (211, 636) - stereotype TRUE - line_color 3342489 - quidu "4367C3A0031B" - client @120 - supplier @59 - line_style 0) - (object RoleView "$UNNAMED$45" @122 - Parent_View @120 - location (211, 636) - stereotype TRUE - line_color 3342489 - quidu "4367C3A0031C" - client @120 - supplier @119 - line_style 0 - label (object SegLabel @123 - Parent_View @122 - location (1842, 1587) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "1..1" - pctDist 0.831865 - height 35 - orientation 1)))) - (object InheritView "" @124 - stereotype TRUE - line_color 3342489 - quidu "4367C5EE02D3" - client @119 - supplier @1 - line_style 0) - (object AssociationViewNew "$UNNAMED$73" @125 - location (2015, 1349) - stereotype TRUE - line_color 3342489 - quidu "4367C6C10222" - roleview_list (list RoleViews - (object RoleView "serviceEndpoints" @126 - Parent_View @125 - location (728, 561) - stereotype TRUE - line_color 3342489 - quidu "4367C6C20129" - client @125 - supplier @109 - line_style 0 - label (object SegLabel @127 - Parent_View @126 - location (2032, 1282) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.540799 - height 49 - orientation 1)) - (object RoleView "$UNNAMED$74" @128 - Parent_View @125 - location (728, 561) - stereotype TRUE - line_color 3342489 - quidu "4367C6C2012A" - client @125 - supplier @119 - line_style 0))) - (object AssociationViewNew "$UNNAMED$78" @129 - location (2739, 1537) - stereotype TRUE - line_color 12632256 - quidu "4367C740038D" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$79" @130 - Parent_View @129 - location (1452, 749) - stereotype TRUE - line_color 3342489 - quidu "4367C7420001" - client @129 - supplier @87 - line_style 0 - label (object SegLabel @131 - Parent_View @130 - location (3112, 1609) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "1..1" - pctDist 0.900000 - height 54 - orientation 1)) - (object RoleView "$UNNAMED$80" @132 - Parent_View @129 - location (1452, 749) - stereotype TRUE - line_color 3342489 - quidu "4367C7420002" - client @129 - supplier @119 - line_style 0))) - (object NoteView @133 - location (3319, 207) - label (object ItemLabel - Parent_View @133 - location (2990, 107) - fill_color 13434879 - nlines 4 - max_width 623 - label "Relationships marked grey are specialized relationships derived from relationships on the base classes") - line_color 3342489 - fill_color 13434879 - width 683 - height 212) - (object ClassView "Class" "Logical View::Assembly::Implementation" @134 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (2382, 572) - font (object Font - italics TRUE) - label (object ItemLabel - Parent_View @134 - location (2170, 483) - fill_color 13434879 - nlines 1 - max_width 424 - justify 0 - label "Implementation") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "436833C300FA" - width 442 - height 202 - annotation 8) - (object ClassView "Class" "Logical View::Assembly::Component" @135 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (1048, 1236) - label (object ItemLabel - Parent_View @135 - location (889, 1128) - fill_color 13434879 - nlines 1 - max_width 318 - justify 0 - label "Component") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C00800BF" - width 336 - height 240 - annotation 8) - (object AssociationViewNew "$UNNAMED$2" @136 - location (720, 1015) - stereotype TRUE - line_color 3342489 - quidu "4367C02C025B" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$3" @137 - Parent_View @136 - location (-4, 75) - stereotype TRUE - line_color 3342489 - quidu "4367C02D022B" - client @136 - supplier @89 - line_style 0) - (object RoleView "components" @138 - Parent_View @136 - location (-4, 75) - stereotype TRUE - line_color 3342489 - quidu "4367C02D022C" - client @136 - supplier @135 - line_style 0 - label (object SegLabel @139 - Parent_View @138 - location (792, 1130) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.647499 - height 55 - orientation 1)))) - (object AssociationViewNew "$UNNAMED$13" @140 - location (1651, 1539) - stereotype TRUE - line_color 3342489 - quidu "4367C26D0297" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$14" @141 - Parent_View @140 - location (292, 346) - stereotype TRUE - line_color 3342489 - quidu "4367C26E037F" - client @140 - supplier @135 - line_style 0) - (object RoleView "$UNNAMED$15" @142 - Parent_View @140 - location (292, 346) - stereotype TRUE - line_color 3342489 - quidu "4367C26E0380" - client @140 - supplier @104 - line_style 0 - label (object SegLabel @143 - Parent_View @142 - location (2108, 1709) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.989365 - height 54 - orientation 0)))) - (object InheritView "" @144 - stereotype TRUE - line_color 3342489 - quidu "4367C4FA01C4" - client @38 - supplier @135 - line_style 0) - (object AssociationViewNew "$UNNAMED$7" @145 - location (1451, 1216) - stereotype TRUE - line_color 3342489 - quidu "4367C265015F" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$8" @146 - Parent_View @145 - location (171, 454) - stereotype TRUE - line_color 3342489 - quidu "4367C2660110" - client @145 - supplier @135 - line_style 0) - (object RoleView "$UNNAMED$9" @147 - Parent_View @145 - location (171, 454) - stereotype TRUE - line_color 3342489 - quidu "4367C2660111" - client @145 - supplier @109 - line_style 0 - label (object SegLabel @148 - Parent_View @147 - location (1623, 1246) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.721799 - height 37 - orientation 1)))) - (object AssociationViewNew "$UNNAMED$10" @149 - location (1556, 1364) - stereotype TRUE - line_color 3342489 - quidu "4367C269025F" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$11" @150 - Parent_View @149 - location (223, 395) - stereotype TRUE - line_color 3342489 - quidu "4367C26A026B" - client @149 - supplier @135 - line_style 0) - (object RoleView "$UNNAMED$12" @151 - Parent_View @149 - location (223, 395) - stereotype TRUE - line_color 3342489 - quidu "4367C26A026C" - client @149 - supplier @119 - line_style 0 - label (object SegLabel @152 - Parent_View @151 - location (1882, 1409) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.932217 - height 38 - orientation 0)))) - (object InheritView "" @153 - stereotype TRUE - line_color 3342489 - quidu "4367C286003A" - client @135 - supplier @52 - vertices (list Points - (879, 1242) - (347, 1265) - (294, 1639)) - line_style 0) - (object ClassView "Class" "Logical View::Assembly::ComponentType" @154 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (3024, 567) - label (object ItemLabel - Parent_View @154 - location (2843, 492) - fill_color 13434879 - nlines 1 - max_width 363 - justify 0 - label "ComponentType") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C2A20289" - width 381 - height 175 - annotation 8) - (object AssociationViewNew "$UNNAMED$25" @155 - location (2913, 1198) - stereotype TRUE - line_color 3342489 - quidu "4367C2DC002A" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$26" @156 - Parent_View @155 - location (861, 27) - stereotype TRUE - line_color 3342489 - quidu "4367C2DD0035" - client @155 - supplier @154 - line_style 0) - (object RoleView "$UNNAMED$27" @157 - Parent_View @155 - location (861, 27) - stereotype TRUE - line_color 3342489 - quidu "4367C2DD0036" - client @155 - supplier @81 - line_style 0 - label (object SegLabel @158 - Parent_View @157 - location (2881, 1698) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.900000 - height 54 - orientation 0)))) - (object AssociationViewNew "$UNNAMED$19" @159 - location (3185, 708) - stereotype TRUE - line_color 3342489 - quidu "4367C2D50200" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$20" @160 - Parent_View @159 - location (1142, -35) - stereotype TRUE - line_color 3342489 - quidu "4367C2D60099" - client @159 - supplier @154 - line_style 0) - (object RoleView "$UNNAMED$21" @161 - Parent_View @159 - location (1142, -35) - stereotype TRUE - line_color 3342489 - quidu "4367C2D6009A" - client @159 - supplier @85 - line_style 0 - label (object SegLabel @162 - Parent_View @161 - location (3277, 719) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "1..*" - pctDist 0.900000 - height 54 - orientation 0)))) - (object AssociationViewNew "$UNNAMED$22" @163 - location (3096, 1115) - stereotype TRUE - line_color 3342489 - quidu "4367C2D8018C" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$23" @164 - Parent_View @163 - location (1050, 159) - stereotype TRUE - line_color 3342489 - quidu "4367C2D9015C" - client @163 - supplier @154 - vertices (list Points - (3096, 1115) - (3067, 1063) - (3030, 654)) - line_style 0) - (object RoleView "$UNNAMED$24" @165 - Parent_View @163 - location (1050, 159) - stereotype TRUE - line_color 3342489 - quidu "4367C2D9015D" - client @163 - supplier @87 - line_style 0 - label (object SegLabel @166 - Parent_View @165 - location (3324, 1414) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..*" - pctDist 0.900000 - height 54 - orientation 0)))) - (object AssociationViewNew "$UNNAMED$93" @167 - location (2110, 983) - stereotype TRUE - line_color 12632256 - quidu "43683779039F" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$94" @168 - Parent_View @167 - location (1062, -253) - stereotype TRUE - line_color 3342489 - quidu "4368377C0082" - client @167 - supplier @154 - vertices (list Points - (2110, 983) - (2771, 827) - (2938, 654)) - line_style 0 - label (object SegLabel @169 - Parent_View @168 - location (2844, 689) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "1..1" - pctDist 0.902899 - height 44 - orientation 0)) - (object RoleView "$UNNAMED$95" @170 - Parent_View @167 - location (1062, -253) - stereotype TRUE - line_color 3342489 - quidu "4368377C0083" - client @167 - supplier @135 - line_style 0))) - (object ClassView "Class" "Logical View::Assembly::ConfiguredImplementation" @171 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (1696, 889) - font (object Font - italics TRUE) - label (object ItemLabel - Parent_View @171 - location (1441, 815) - fill_color 13434879 - nlines 1 - max_width 511 - justify 0 - label "ConfiguredImplementation") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367C1D70165" - width 529 - height 173 - annotation 8) - (object AssociationViewNew "$UNNAMED$87" @172 - location (1985, 627) - stereotype TRUE - line_color 3342489 - quidu "436835A101A2" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$88" @173 - Parent_View @172 - location (-331, -195) - stereotype TRUE - line_color 3342489 - quidu "436835A20289" - client @172 - supplier @134 - line_style 0 - label (object SegLabel @174 - Parent_View @173 - location (2149, 657) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "0..1" - pctDist 0.900000 - height 54 - orientation 1)) - (object RoleView "$UNNAMED$89" @175 - Parent_View @172 - location (-331, -195) - stereotype TRUE - line_color 3342489 - quidu "436835A2028A" - client @172 - supplier @171 - vertices (list Points - (1985, 627) - (1926, 635) - (1773, 802)) - line_style 0))) - (object AssociationViewNew "$UNNAMED$16" @176 - location (1375, 1060) - stereotype TRUE - line_color 3342489 - quidu "4367C29500DC" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$17" @177 - Parent_View @176 - location (4, -362) - stereotype TRUE - line_color 3342489 - quidu "4367C296021E" - client @176 - supplier @135 - line_style 0) - (object RoleView "$UNNAMED$18" @178 - Parent_View @176 - location (4, -362) - stereotype TRUE - line_color 3342489 - quidu "4367C296021F" - client @176 - supplier @171 - line_style 0 - label (object SegLabel @179 - Parent_View @178 - location (1393, 996) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "1..1" - pctDist 0.257075 - height 49 - orientation 0)))) - (object AssociationViewNew "$UNNAMED$31" @180 - location (2407, 787) - stereotype TRUE - line_color 3342489 - quidu "4367C2F00000" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$32" @181 - Parent_View @180 - location (1074, -669) - stereotype TRUE - line_color 3342489 - quidu "4367C2F10174" - client @180 - supplier @154 - vertices (list Points - (2407, 787) - (2603, 760) - (2833, 653)) - line_style 0 - label (object SegLabel @182 - Parent_View @181 - location (2672, 679) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "1..1" - pctDist 0.652556 - height 46 - orientation 0)) - (object RoleView "$UNNAMED$33" @183 - Parent_View @180 - location (1074, -669) - stereotype TRUE - line_color 3342489 - quidu "4367C2F10175" - client @180 - supplier @171 - line_style 0))) - (object InheritView "" @184 - stereotype TRUE - line_color 3342489 - quidu "4367C4D4009D" - client @33 - supplier @89 - vertices (list Points - (2267, 255) - (787, 500) - (528, 720)) - line_style 0) - (object InheritView "" @185 - stereotype TRUE - line_color 3342489 - quidu "4367C4CF001D" - client @33 - supplier @134 - line_style 0) - (object InheritView "" @186 - stereotype TRUE - line_color 3342489 - quidu "436836C701A4" - client @43 - supplier @171 - line_style 0) - (object AttachView "" @187 - stereotype TRUE - line_color 3342489 - client @30 - supplier @18 - line_style 0) - (object AttachView "" @188 - stereotype TRUE - line_color 3342489 - client @30 - supplier @13 - vertices (list Points - (4070, 1360) - (3941, 1341) - (3866, 1367)) - line_style 0)))))) - logical_presentations (list unit_reference_list - (object ClassDiagram "Main" - quid "4367BF7F000E" - title "Main" - zoom 100 - max_height 28350 - max_width 21600 - origin_x 0 - origin_y 0 - items (list diagram_item_list - (object CategoryView "Logical View::Assembly" @189 - location (216, 375) - label (object ItemLabel - Parent_View @189 - location (72, 291) - fill_color 13434879 - nlines 2 - max_width 288 - justify 0 - label "Assembly") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4367BFA901F9" - width 300 - height 180))))) - root_subsystem (object SubSystem "Component View" - quid "4367BF7F0007" - physical_models (list unit_reference_list) - physical_presentations (list unit_reference_list - (object Module_Diagram "Main" - quid "4367BF7F0036" - title "Main" - zoom 100 - max_height 28350 - max_width 21600 - origin_x 0 - origin_y 0 - items (list diagram_item_list)))) - process_structure (object Processes - quid "4367BF7F0008" - ProcsNDevs (list - (object Process_Diagram "Deployment View" - quid "4367BF7F000A" - title "Deployment View" - zoom 100 - max_height 28350 - max_width 21600 - origin_x 0 - origin_y 0 - items (list diagram_item_list)))) - properties (object Properties - attributes (list Attribute_Set - (object Attribute - tool "DDL" - name "propertyId" - value "809135966") - (object Attribute - tool "DDL" - name "default__Project" - value (list Attribute_Set - (object Attribute - tool "DDL" - name "Directory" - value "AUTO GENERATE") - (object Attribute - tool "DDL" - name "DataBase" - value ("DataBaseSet" 800)) - (object Attribute - tool "DDL" - name "DataBaseSet" - value (list Attribute_Set - (object Attribute - tool "DDL" - name "ANSI" - value 800) - (object Attribute - tool "DDL" - name "Oracle" - value 801) - (object Attribute - tool "DDL" - name "SQLServer" - value 802) - (object Attribute - tool "DDL" - name "Sybase" - value 803) - (object Attribute - tool "DDL" - name "Watcom" - value 804))) - (object Attribute - tool "DDL" - name "PrimaryKeyColumnName" - value "Id") - (object Attribute - tool "DDL" - name "PrimaryKeyColumnType" - value "NUMBER(5)") - (object Attribute - tool "DDL" - name "ViewName" - value "V_") - (object Attribute - tool "DDL" - name "TableName" - value "T_") - (object Attribute - tool "DDL" - name "InheritSuffix" - value "_V") - (object Attribute - tool "DDL" - name "DropClause" - value FALSE) - (object Attribute - tool "DDL" - name "BaseViews" - value FALSE) - (object Attribute - tool "DDL" - name "DDLScriptFilename" - value "DDL1.SQL"))) - (object Attribute - tool "DDL" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "DDL" - name "ColumnType" - value "VARCHAR") - (object Attribute - tool "DDL" - name "Length" - value "") - (object Attribute - tool "DDL" - name "NullsOK" - value TRUE) - (object Attribute - tool "DDL" - name "PrimaryKey" - value FALSE) - (object Attribute - tool "DDL" - name "Unique" - value FALSE) - (object Attribute - tool "DDL" - name "CompositeUnique" - value FALSE) - (object Attribute - tool "DDL" - name "CheckConstraint" - value ""))) - (object Attribute - tool "DDL" - name "HiddenTool" - value FALSE) - (object Attribute - tool "framework" - name "HiddenTool" - value FALSE) - (object Attribute - tool "IDL" - name "propertyId" - value "809135966") - (object Attribute - tool "IDL" - name "default__Project" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "CreateMissingDirectories" - value TRUE) - (object Attribute - tool "IDL" - name "StopOnError" - value TRUE) - (object Attribute - tool "IDL" - name "Directory" - value "AUTO GENERATE") - (object Attribute - tool "IDL" - name "GeneratePreserveRegions" - value TRUE))) - (object Attribute - tool "IDL" - name "default__Class" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "ImplementationType" - value "") - (object Attribute - tool "IDL" - name "ConstValue" - value "") - (object Attribute - tool "IDL" - name "GenerateDefaultSpecifier" - value FALSE) - (object Attribute - tool "IDL" - name "DefaultSpecifier" - value "") - (object Attribute - tool "IDL" - name "IDLElement" - value TRUE) - (object Attribute - tool "IDL" - name "IDLSpecificationType" - value ("IDLSpecSet" 22)) - (object Attribute - tool "IDL" - name "IDLSpecSet" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "Interface" - value 22) - (object Attribute - tool "IDL" - name "Typedef" - value 54) - (object Attribute - tool "IDL" - name "Enumeration" - value 8) - (object Attribute - tool "IDL" - name "Const" - value 71) - (object Attribute - tool "IDL" - name "Exception" - value 61) - (object Attribute - tool "IDL" - name "Struct" - value 51) - (object Attribute - tool "IDL" - name "Union" - value 81))))) - (object Attribute - tool "IDL" - name "default__Module-Spec" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "Generate" - value TRUE) - (object Attribute - tool "IDL" - name "CmIdentification" - value (value Text " %X% %Q% %Z% %W%")) - (object Attribute - tool "IDL" - name "CopyrightNotice" - value (value Text "")) - (object Attribute - tool "IDL" - name "FileName" - value "AUTO GENERATE") - (object Attribute - tool "IDL" - name "GenerateIDLModule" - value FALSE) - (object Attribute - tool "IDL" - name "InclusionProtectionSymbol" - value "AUTO GENERATE") - (object Attribute - tool "IDL" - name "AdditionalIncludes" - value (value Text "")) - (object Attribute - tool "IDL" - name "IncludeBySimpleName" - value FALSE))) - (object Attribute - tool "IDL" - name "default__Module-Body" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "CmIdentification" - value (value Text " %X% %Q% %Z% %W%")) - (object Attribute - tool "IDL" - name "CopyrightNotice" - value (value Text "")) - (object Attribute - tool "IDL" - name "FileName" - value "AUTO GENERATE") - (object Attribute - tool "IDL" - name "AdditionalIncludes" - value (value Text "")) - (object Attribute - tool "IDL" - name "IncludeBySimpleName" - value FALSE))) - (object Attribute - tool "IDL" - name "default__Operation" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "OperationIsOneWay" - value FALSE) - (object Attribute - tool "IDL" - name "Context" - value "") - (object Attribute - tool "IDL" - name "Raises" - value ""))) - (object Attribute - tool "IDL" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "CaseSpecifier" - value "") - (object Attribute - tool "IDL" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "IDL" - name "DataMemberName" - value "$relationship") - (object Attribute - tool "IDL" - name "IsReadOnly" - value FALSE) - (object Attribute - tool "IDL" - name "IsConst" - value FALSE) - (object Attribute - tool "IDL" - name "ConstValue" - value ""))) - (object Attribute - tool "IDL" - name "default__Has" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "NameIfUnlabeled" - value "the_$supplier") - (object Attribute - tool "IDL" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "IDL" - name "DataMemberName" - value "$relationship") - (object Attribute - tool "IDL" - name "GenerateForwardReference" - value FALSE) - (object Attribute - tool "IDL" - name "IsReadOnly" - value FALSE) - (object Attribute - tool "IDL" - name "BoundedHasRelType" - value ("HasRelTypeSet" 47)) - (object Attribute - tool "IDL" - name "HasRelTypeSet" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "Array" - value 24) - (object Attribute - tool "IDL" - name "Sequence" - value 47))))) - (object Attribute - tool "IDL" - name "default__Role" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "NameIfUnlabeled" - value "the_$supplier") - (object Attribute - tool "IDL" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "IDL" - name "DataMemberName" - value "$relationship") - (object Attribute - tool "IDL" - name "GenerateForwardReference" - value FALSE) - (object Attribute - tool "IDL" - name "IsReadOnly" - value FALSE) - (object Attribute - tool "IDL" - name "BoundedRoleType" - value ("AssocTypeSet" 47)) - (object Attribute - tool "IDL" - name "AssocTypeSet" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "Array" - value 24) - (object Attribute - tool "IDL" - name "Sequence" - value 47))))) - (object Attribute - tool "IDL" - name "default__Uses" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "GenerateForwardReference" - value FALSE))) - (object Attribute - tool "IDL" - name "default__Subsystem" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "Directory" - value "AUTO GENERATE"))) - (object Attribute - tool "IDL" - name "HiddenTool" - value FALSE) - (object Attribute - tool "Java" - name "propertyId" - value "809135966") - (object Attribute - tool "Java" - name "default__Project" - value (list Attribute_Set - (object Attribute - tool "Java" - name "CreateMissingDirectories" - value TRUE) - (object Attribute - tool "Java" - name "StopOnError" - value FALSE) - (object Attribute - tool "Java" - name "Directory" - value "AUTO GENERATE") - (object Attribute - tool "Java" - name "UsePrefixes" - value FALSE) - (object Attribute - tool "Java" - name "InstanceVariablePrefix" - value "m_") - (object Attribute - tool "Java" - name "ClassVariablePrefix" - value "s_") - (object Attribute - tool "Java" - name "DefaultAttributeDataType" - value "int") - (object Attribute - tool "Java" - name "DefaultOperationReturnType" - value "void"))) - (object Attribute - tool "Java" - name "default__Class" - value (list Attribute_Set - (object Attribute - tool "Java" - name "Final" - value FALSE) - (object Attribute - tool "Java" - name "GenerateDefaultConstructor" - value TRUE) - (object Attribute - tool "Java" - name "ConstructorIs" - value ("Ctor_Set" 62)) - (object Attribute - tool "Java" - name "Ctor_Set" - value (list Attribute_Set - (object Attribute - tool "Java" - name "Public" - value 62) - (object Attribute - tool "Java" - name "Protected" - value 63) - (object Attribute - tool "Java" - name "Private" - value 64))) - (object Attribute - tool "Java" - name "GenerateFinalizer" - value FALSE) - (object Attribute - tool "Java" - name "GenerateStaticInitializer" - value FALSE) - (object Attribute - tool "Java" - name "GenerateInstanceInitializer" - value FALSE))) - (object Attribute - tool "Java" - name "default__Module-Spec" - value (list Attribute_Set - (object Attribute - tool "Java" - name "Generate" - value TRUE) - (object Attribute - tool "Java" - name "CmIdentification" - value (value Text "")) - (object Attribute - tool "Java" - name "CopyrightNotice" - value (value Text "")) - (object Attribute - tool "Java" - name "AdditionalImports" - value (value Text "")))) - (object Attribute - tool "Java" - name "default__Module-Body" - value (list Attribute_Set - (object Attribute - tool "Java" - name "Generate" - value TRUE) - (object Attribute - tool "Java" - name "CmIdentification" - value (value Text "")) - (object Attribute - tool "Java" - name "CopyrightNotice" - value (value Text "")) - (object Attribute - tool "Java" - name "AdditionalImports" - value (value Text "")))) - (object Attribute - tool "Java" - name "default__Operation" - value (list Attribute_Set - (object Attribute - tool "Java" - name "Abstract" - value FALSE) - (object Attribute - tool "Java" - name "Static" - value FALSE) - (object Attribute - tool "Java" - name "Final" - value FALSE) - (object Attribute - tool "Java" - name "Native" - value FALSE) - (object Attribute - tool "Java" - name "Synchronized" - value FALSE))) - (object Attribute - tool "Java" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "Java" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "Java" - name "Final" - value FALSE) - (object Attribute - tool "Java" - name "Transient" - value FALSE) - (object Attribute - tool "Java" - name "Volatile" - value FALSE))) - (object Attribute - tool "Java" - name "default__Role" - value (list Attribute_Set - (object Attribute - tool "Java" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "Java" - name "ContainerClass" - value "") - (object Attribute - tool "Java" - name "InitialValue" - value "") - (object Attribute - tool "Java" - name "Final" - value FALSE) - (object Attribute - tool "Java" - name "Transient" - value FALSE) - (object Attribute - tool "Java" - name "Volatile" - value FALSE))) - (object Attribute - tool "Java" - name "HiddenTool" - value FALSE) - (object Attribute - tool "Oracle8" - name "propertyId" - value "360000002") - (object Attribute - tool "Oracle8" - name "default__Project" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "DDLScriptFilename" - value "DDL1.SQL") - (object Attribute - tool "Oracle8" - name "DropClause" - value FALSE) - (object Attribute - tool "Oracle8" - name "PrimaryKeyColumnName" - value "_ID") - (object Attribute - tool "Oracle8" - name "PrimaryKeyColumnType" - value "NUMBER(5,0)") - (object Attribute - tool "Oracle8" - name "SchemaNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "SchemaNameSuffix" - value "") - (object Attribute - tool "Oracle8" - name "TableNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "TableNameSuffix" - value "") - (object Attribute - tool "Oracle8" - name "TypeNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "TypeNameSuffix" - value "") - (object Attribute - tool "Oracle8" - name "ViewNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "ViewNameSuffix" - value "") - (object Attribute - tool "Oracle8" - name "VarrayNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "VarrayNameSuffix" - value "") - (object Attribute - tool "Oracle8" - name "NestedTableNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "NestedTableNameSuffix" - value "") - (object Attribute - tool "Oracle8" - name "ObjectTableNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "ObjectTableNameSuffix" - value ""))) - (object Attribute - tool "Oracle8" - name "default__Module-Spec" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "IsSchema" - value FALSE))) - (object Attribute - tool "Oracle8" - name "default__Class" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "OID" - value "") - (object Attribute - tool "Oracle8" - name "WhereClause" - value "") - (object Attribute - tool "Oracle8" - name "CheckConstraint" - value "") - (object Attribute - tool "Oracle8" - name "CollectionTypeLength" - value "") - (object Attribute - tool "Oracle8" - name "CollectionTypePrecision" - value "") - (object Attribute - tool "Oracle8" - name "CollectionTypeScale" - value "") - (object Attribute - tool "Oracle8" - name "CollectionOfREFS" - value FALSE))) - (object Attribute - tool "Oracle8" - name "default__Operation" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "MethodKind" - value ("MethodKindSet" 1903)) - (object Attribute - tool "Oracle8" - name "OverloadID" - value "") - (object Attribute - tool "Oracle8" - name "OrderNumber" - value "") - (object Attribute - tool "Oracle8" - name "IsReadNoDataState" - value FALSE) - (object Attribute - tool "Oracle8" - name "IsReadNoProcessState" - value FALSE) - (object Attribute - tool "Oracle8" - name "IsWriteNoDataState" - value FALSE) - (object Attribute - tool "Oracle8" - name "IsWriteNoProcessState" - value FALSE) - (object Attribute - tool "Oracle8" - name "IsSelfish" - value FALSE) - (object Attribute - tool "Oracle8" - name "TriggerType" - value ("TriggerTypeSet" 1801)) - (object Attribute - tool "Oracle8" - name "TriggerEvent" - value ("TriggerEventSet" 1601)) - (object Attribute - tool "Oracle8" - name "TriggerText" - value "") - (object Attribute - tool "Oracle8" - name "TriggerReferencingNames" - value "") - (object Attribute - tool "Oracle8" - name "TriggerForEach" - value ("TriggerForEachSet" 1701)) - (object Attribute - tool "Oracle8" - name "TriggerWhenClause" - value "") - (object Attribute - tool "Oracle8" - name "MethodKindSet" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "MapMethod" - value 1901) - (object Attribute - tool "Oracle8" - name "OrderMethod" - value 1902) - (object Attribute - tool "Oracle8" - name "Function" - value 1903) - (object Attribute - tool "Oracle8" - name "Procedure" - value 1904) - (object Attribute - tool "Oracle8" - name "Operator" - value 1905) - (object Attribute - tool "Oracle8" - name "Constructor" - value 1906) - (object Attribute - tool "Oracle8" - name "Destructor" - value 1907) - (object Attribute - tool "Oracle8" - name "Trigger" - value 1908) - (object Attribute - tool "Oracle8" - name "Calculated" - value 1909))) - (object Attribute - tool "Oracle8" - name "TriggerTypeSet" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "AFTER" - value 1801) - (object Attribute - tool "Oracle8" - name "BEFORE" - value 1802) - (object Attribute - tool "Oracle8" - name "INSTEAD OF" - value 1803))) - (object Attribute - tool "Oracle8" - name "TriggerForEachSet" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "ROW" - value 1701) - (object Attribute - tool "Oracle8" - name "STATEMENT" - value 1702))) - (object Attribute - tool "Oracle8" - name "TriggerEventSet" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "INSERT" - value 1601) - (object Attribute - tool "Oracle8" - name "UPDATE" - value 1602) - (object Attribute - tool "Oracle8" - name "DELETE" - value 1603) - (object Attribute - tool "Oracle8" - name "INSERT OR UPDATE" - value 1604) - (object Attribute - tool "Oracle8" - name "INSERT OR DELETE" - value 1605) - (object Attribute - tool "Oracle8" - name "UPDATE OR DELETE" - value 1606) - (object Attribute - tool "Oracle8" - name "INSERT OR UPDATE OR DELETE" - value 1607))))) - (object Attribute - tool "Oracle8" - name "default__Role" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "OrderNumber" - value ""))) - (object Attribute - tool "Oracle8" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "OrderNumber" - value "") - (object Attribute - tool "Oracle8" - name "IsUnique" - value FALSE) - (object Attribute - tool "Oracle8" - name "NullsAllowed" - value TRUE) - (object Attribute - tool "Oracle8" - name "Length" - value "") - (object Attribute - tool "Oracle8" - name "Precision" - value "2") - (object Attribute - tool "Oracle8" - name "Scale" - value "6") - (object Attribute - tool "Oracle8" - name "IsIndex" - value FALSE) - (object Attribute - tool "Oracle8" - name "IsPrimaryKey" - value FALSE) - (object Attribute - tool "Oracle8" - name "CompositeUnique" - value FALSE) - (object Attribute - tool "Oracle8" - name "CheckConstraint" - value ""))) - (object Attribute - tool "Oracle8" - name "HiddenTool" - value FALSE) - (object Attribute - tool "cg" - name "propertyId" - value "809135966") - (object Attribute - tool "cg" - name "default__Project" - value (list Attribute_Set - (object Attribute - tool "cg" - name "UseMSVC" - value FALSE) - (object Attribute - tool "cg" - name "HeaderFileExtension" - value "h") - (object Attribute - tool "cg" - name "HeaderFileBackupExtension" - value "h~") - (object Attribute - tool "cg" - name "HeaderFileTemporaryExtension" - value "h#") - (object Attribute - tool "cg" - name "CodeFileExtension" - value "cpp") - (object Attribute - tool "cg" - name "CodeFileBackupExtension" - value "cp~") - (object Attribute - tool "cg" - name "CodeFileTemporaryExtension" - value "cp#") - (object Attribute - tool "cg" - name "CreateMissingDirectories" - value TRUE) - (object Attribute - tool "cg" - name "StopOnError" - value FALSE) - (object Attribute - tool "cg" - name "ErrorLimit" - value 30) - (object Attribute - tool "cg" - name "Directory" - value "$ROSECPP_SOURCE") - (object Attribute - tool "cg" - name "PathSeparator" - value "") - (object Attribute - tool "cg" - name "FileNameFormat" - value "128vx_b") - (object Attribute - tool "cg" - name "BooleanType" - value "int") - (object Attribute - tool "cg" - name "AllowTemplates" - value TRUE) - (object Attribute - tool "cg" - name "AllowExplicitInstantiations" - value TRUE) - (object Attribute - tool "cg" - name "AllowProtectedInheritance" - value TRUE) - (object Attribute - tool "cg" - name "CommentWidth" - value 60) - (object Attribute - tool "cg" - name "OneByValueContainer" - value "$targetClass") - (object Attribute - tool "cg" - name "OneByReferenceContainer" - value "$targetClass *") - (object Attribute - tool "cg" - name "OptionalByValueContainer" - value "OptionalByValue<$targetClass>") - (object Attribute - tool "cg" - name "OptionalByReferenceContainer" - value "$targetClass *") - (object Attribute - tool "cg" - name "FixedByValueContainer" - value "$targetClass[$limit]") - (object Attribute - tool "cg" - name "UnorderedFixedByValueContainer" - value "$targetClass[$limit]") - (object Attribute - tool "cg" - name "FixedByReferenceContainer" - value "$targetClass *[$limit]") - (object Attribute - tool "cg" - name "UnorderedFixedByReferenceContainer" - value "$targetClass *[$limit]") - (object Attribute - tool "cg" - name "BoundedByValueContainer" - value "BoundedListByValue<$targetClass,$limit>") - (object Attribute - tool "cg" - name "UnorderedBoundedByValueContainer" - value "BoundedSetByValue<$targetClass,$limit>") - (object Attribute - tool "cg" - name "BoundedByReferenceContainer" - value "BoundedListByReference<$targetClass,$limit>") - (object Attribute - tool "cg" - name "UnorderedBoundedByReferenceContainer" - value "BoundedSetByReference<$targetClass,$limit>") - (object Attribute - tool "cg" - name "UnboundedByValueContainer" - value "UnboundedListByValue<$targetClass>") - (object Attribute - tool "cg" - name "UnorderedUnboundedByValueContainer" - value "UnboundedSetByValue<$targetClass>") - (object Attribute - tool "cg" - name "UnboundedByReferenceContainer" - value "UnboundedListByReference<$targetClass>") - (object Attribute - tool "cg" - name "UnorderedUnboundedByReferenceContainer" - value "UnboundedSetByReference<$targetClass>") - (object Attribute - tool "cg" - name "QualifiedByValueContainer" - value "AssociationByValue<$qualtype, $qualcont>") - (object Attribute - tool "cg" - name "UnorderedQualifiedByValueContainer" - value "DictionaryByValue<$qualtype, $qualcont>") - (object Attribute - tool "cg" - name "QualifiedByReferenceContainer" - value "AssociationByReference<$qualtype, $qualcont>") - (object Attribute - tool "cg" - name "UnorderedQualifiedByReferenceContainer" - value "DictionaryByReference<$qualtype, $qualcont>") - (object Attribute - tool "cg" - name "GeneratePreserveRegions" - value TRUE))) - (object Attribute - tool "cg" - name "default__Class" - value (list Attribute_Set - (object Attribute - tool "cg" - name "CodeName" - value "") - (object Attribute - tool "cg" - name "ImplementationType" - value "") - (object Attribute - tool "cg" - name "ClassKey" - value "class") - (object Attribute - tool "cg" - name "GenerateEmptyRegions" - value ("GenerateEmptyRegionSet" 3)) - (object Attribute - tool "cg" - name "GenerateEmptyRegionSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "None" - value 0) - (object Attribute - tool "cg" - name "Preserved" - value 1) - (object Attribute - tool "cg" - name "Unpreserved" - value 2) - (object Attribute - tool "cg" - name "All" - value 3))) - (object Attribute - tool "cg" - name "PutBodiesInSpec" - value FALSE) - (object Attribute - tool "cg" - name "GenerateDefaultConstructor" - value ("GenerateSet" 199)) - (object Attribute - tool "cg" - name "DefaultConstructorVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "InlineDefaultConstructor" - value FALSE) - (object Attribute - tool "cg" - name "ExplicitDefaultConstructor" - value FALSE) - (object Attribute - tool "cg" - name "GenerateCopyConstructor" - value ("GenerateSet" 199)) - (object Attribute - tool "cg" - name "CopyConstructorVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "InlineCopyConstructor" - value FALSE) - (object Attribute - tool "cg" - name "ExplicitCopyConstructor" - value FALSE) - (object Attribute - tool "cg" - name "GenerateDestructor" - value TRUE) - (object Attribute - tool "cg" - name "DestructorVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "DestructorKind" - value ("ThreeKindSet" 200)) - (object Attribute - tool "cg" - name "InlineDestructor" - value FALSE) - (object Attribute - tool "cg" - name "GenerateAssignmentOperation" - value ("GenerateSet" 199)) - (object Attribute - tool "cg" - name "AssignmentVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "AssignmentKind" - value ("ThreeKindSet" 200)) - (object Attribute - tool "cg" - name "InlineAssignmentOperation" - value FALSE) - (object Attribute - tool "cg" - name "GenerateEqualityOperations" - value ("GenerateSet" 199)) - (object Attribute - tool "cg" - name "EqualityVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "EqualityKind" - value ("FriendKindSet" 200)) - (object Attribute - tool "cg" - name "InlineEqualityOperations" - value FALSE) - (object Attribute - tool "cg" - name "GenerateRelationalOperations" - value FALSE) - (object Attribute - tool "cg" - name "RelationalVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "RelationalKind" - value ("FriendKindSet" 200)) - (object Attribute - tool "cg" - name "InlineRelationalOperations" - value FALSE) - (object Attribute - tool "cg" - name "GenerateStorageMgmtOperations" - value FALSE) - (object Attribute - tool "cg" - name "StorageMgmtVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "InlineStorageMgmtOperations" - value FALSE) - (object Attribute - tool "cg" - name "GenerateSubscriptOperation" - value FALSE) - (object Attribute - tool "cg" - name "SubscriptVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "SubscriptKind" - value ("ThreeKindSet" 200)) - (object Attribute - tool "cg" - name "SubscriptResultType" - value "") - (object Attribute - tool "cg" - name "InlineSubscriptOperation" - value FALSE) - (object Attribute - tool "cg" - name "GenerateDereferenceOperation" - value FALSE) - (object Attribute - tool "cg" - name "DereferenceVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "DereferenceKind" - value ("ThreeKindSet" 200)) - (object Attribute - tool "cg" - name "DereferenceResultType" - value "") - (object Attribute - tool "cg" - name "InlineDereferenceOperation" - value FALSE) - (object Attribute - tool "cg" - name "GenerateIndirectionOperation" - value FALSE) - (object Attribute - tool "cg" - name "IndirectionVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "IndirectionKind" - value ("ThreeKindSet" 200)) - (object Attribute - tool "cg" - name "IndirectionResultType" - value "") - (object Attribute - tool "cg" - name "InlineIndirectionOperation" - value FALSE) - (object Attribute - tool "cg" - name "GenerateStreamOperations" - value FALSE) - (object Attribute - tool "cg" - name "StreamVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "InlineStreamOperations" - value FALSE) - (object Attribute - tool "cg" - name "ThreeKindSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202))) - (object Attribute - tool "cg" - name "KindSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202) - (object Attribute - tool "cg" - name "Static" - value 203))) - (object Attribute - tool "cg" - name "FriendKindSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202) - (object Attribute - tool "cg" - name "Friend" - value 204))) - (object Attribute - tool "cg" - name "GenerateSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "DeclareAndDefine" - value 199) - (object Attribute - tool "cg" - name "DeclareOnly" - value 205) - (object Attribute - tool "cg" - name "DoNotDeclare" - value 206))) - (object Attribute - tool "cg" - name "VisibilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Public" - value 45) - (object Attribute - tool "cg" - name "Protected" - value 44) - (object Attribute - tool "cg" - name "Private" - value 43) - (object Attribute - tool "cg" - name "Implementation" - value 14))) - (object Attribute - tool "cg" - name "ConstValue" - value "") - (object Attribute - tool "cg" - name "GenerateDefaultSpecifier" - value FALSE) - (object Attribute - tool "cg" - name "DefaultSpecifier" - value ""))) - (object Attribute - tool "cg" - name "default__Module-Spec" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Generate" - value TRUE) - (object Attribute - tool "cg" - name "GenerateEmptyRegions" - value ("GenerateEmptyRegionSet" 3)) - (object Attribute - tool "cg" - name "GenerateEmptyRegionSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "None" - value 0) - (object Attribute - tool "cg" - name "Preserved" - value 1) - (object Attribute - tool "cg" - name "Unpreserved" - value 2) - (object Attribute - tool "cg" - name "All" - value 3))) - (object Attribute - tool "cg" - name "CmIdentification" - value (value Text " %X% %Q% %Z% %W%")) - (object Attribute - tool "cg" - name "CopyrightNotice" - value (value Text "")) - (object Attribute - tool "cg" - name "FileName" - value "AUTO GENERATE") - (object Attribute - tool "cg" - name "AllowExtensionlessFileName" - value FALSE) - (object Attribute - tool "cg" - name "InclusionProtectionSymbol" - value "AUTO GENERATE") - (object Attribute - tool "cg" - name "IncludeFormat" - value (value Text -|// $package -|#include "$file" -| - )) - (object Attribute - tool "cg" - name "IncludeBySimpleName" - value FALSE) - (object Attribute - tool "cg" - name "IncludePrecompiledHeader" - value FALSE) - (object Attribute - tool "cg" - name "IncludeOrder" - value "AMIR") - (object Attribute - tool "cg" - name "AdditionalIncludes" - value (value Text "")) - (object Attribute - tool "cg" - name "InliningStyle" - value ("InliningStyleSet" 207)) - (object Attribute - tool "cg" - name "InliningStyleSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "InClassDeclaration" - value 208) - (object Attribute - tool "cg" - name "FollowingClassDeclaration" - value 207))) - (object Attribute - tool "cg" - name "TypesDefined" - value (value Text "")) - (object Attribute - tool "cg" - name "IncludeClosure" - value (value Text "")))) - (object Attribute - tool "cg" - name "default__Module-Body" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Generate" - value TRUE) - (object Attribute - tool "cg" - name "GenerateEmptyRegions" - value ("GenerateEmptyRegionSet" 3)) - (object Attribute - tool "cg" - name "GenerateEmptyRegionSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "None" - value 0) - (object Attribute - tool "cg" - name "Preserved" - value 1) - (object Attribute - tool "cg" - name "Unpreserved" - value 2) - (object Attribute - tool "cg" - name "All" - value 3))) - (object Attribute - tool "cg" - name "CmIdentification" - value (value Text " %X% %Q% %Z% %W%")) - (object Attribute - tool "cg" - name "CopyrightNotice" - value (value Text "")) - (object Attribute - tool "cg" - name "FileName" - value "AUTO GENERATE") - (object Attribute - tool "cg" - name "AllowExtensionlessFileName" - value FALSE) - (object Attribute - tool "cg" - name "IncludeFormat" - value (value Text -|// $package -|#include "$file" -| - )) - (object Attribute - tool "cg" - name "IncludeBySimpleName" - value FALSE) - (object Attribute - tool "cg" - name "IncludePrecompiledHeader" - value TRUE) - (object Attribute - tool "cg" - name "IncludeOrder" - value "AMIR") - (object Attribute - tool "cg" - name "AdditionalIncludes" - value (value Text "")) - (object Attribute - tool "cg" - name "InliningStyle" - value ("InliningStyleSet" 207)) - (object Attribute - tool "cg" - name "InliningStyleSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "InClassDeclaration" - value 208) - (object Attribute - tool "cg" - name "FollowingClassDeclaration" - value 207))) - (object Attribute - tool "cg" - name "TypesDefined" - value (value Text "")) - (object Attribute - tool "cg" - name "IncludeClosure" - value (value Text "")))) - (object Attribute - tool "cg" - name "default__Operation" - value (list Attribute_Set - (object Attribute - tool "cg" - name "CodeName" - value "") - (object Attribute - tool "cg" - name "OperationKind" - value ("OperationKindSet" 200)) - (object Attribute - tool "cg" - name "OperationKindSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202) - (object Attribute - tool "cg" - name "Static" - value 203) - (object Attribute - tool "cg" - name "Friend" - value 204))) - (object Attribute - tool "cg" - name "OperationIsConst" - value FALSE) - (object Attribute - tool "cg" - name "OperationIsExplicit" - value FALSE) - (object Attribute - tool "cg" - name "Inline" - value FALSE) - (object Attribute - tool "cg" - name "EntryCode" - value (value Text "")) - (object Attribute - tool "cg" - name "ExitCode" - value (value Text "")) - (object Attribute - tool "cg" - name "GenerateEmptyRegions" - value ("GenerateEmptyRegionSet" 3)) - (object Attribute - tool "cg" - name "GenerateEmptyRegionSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "None" - value 0) - (object Attribute - tool "cg" - name "Preserved" - value 1) - (object Attribute - tool "cg" - name "Unpreserved" - value 2) - (object Attribute - tool "cg" - name "All" - value 3))) - (object Attribute - tool "cg" - name "BodyAnnotations" - value "") - (object Attribute - tool "cg" - name "OperationIsOneWay" - value FALSE) - (object Attribute - tool "cg" - name "Context" - value "") - (object Attribute - tool "cg" - name "Raises" - value ""))) - (object Attribute - tool "cg" - name "default__Has" - value (list Attribute_Set - (object Attribute - tool "cg" - name "CodeName" - value "") - (object Attribute - tool "cg" - name "Ordered" - value TRUE) - (object Attribute - tool "cg" - name "NameIfUnlabeled" - value "the_$supplier") - (object Attribute - tool "cg" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "cg" - name "DataMemberName" - value "$relationship") - (object Attribute - tool "cg" - name "DataMemberVisibility" - value ("DataMemberVisibilitySet" 14)) - (object Attribute - tool "cg" - name "DataMemberVisibilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Public" - value 45) - (object Attribute - tool "cg" - name "Protected" - value 44) - (object Attribute - tool "cg" - name "Private" - value 43) - (object Attribute - tool "cg" - name "Implementation" - value 14) - (object Attribute - tool "cg" - name "AtRelationshipVisibility" - value 210))) - (object Attribute - tool "cg" - name "DataMemberMutability" - value ("DataMemberMutabilitySet" 0)) - (object Attribute - tool "cg" - name "DataMemberMutabilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Unrestricted" - value 0) - (object Attribute - tool "cg" - name "Mutable" - value 1) - (object Attribute - tool "cg" - name "Const" - value 2))) - (object Attribute - tool "cg" - name "DataMemberIsVolatile" - value FALSE) - (object Attribute - tool "cg" - name "DataMemberFieldSize" - value "") - (object Attribute - tool "cg" - name "InitialValue" - value (value Text "")) - (object Attribute - tool "cg" - name "GenerateGetOperation" - value TRUE) - (object Attribute - tool "cg" - name "GenerateSetOperation" - value TRUE) - (object Attribute - tool "cg" - name "GetName" - value "get_$relationship") - (object Attribute - tool "cg" - name "SetName" - value "set_$relationship") - (object Attribute - tool "cg" - name "GetSetKinds" - value ("GetSetKindsSet" 200)) - (object Attribute - tool "cg" - name "GetSetKindsSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202) - (object Attribute - tool "cg" - name "Static" - value 203) - (object Attribute - tool "cg" - name "Friend" - value 204))) - (object Attribute - tool "cg" - name "ContainerClass" - value "") - (object Attribute - tool "cg" - name "SelectorName" - value "") - (object Attribute - tool "cg" - name "SelectorType" - value "") - (object Attribute - tool "cg" - name "GetIsConst" - value TRUE) - (object Attribute - tool "cg" - name "GetResultIsConst" - value ("GetResultIsConstSet" 2)) - (object Attribute - tool "cg" - name "GetResultIsConstSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "False" - value 0) - (object Attribute - tool "cg" - name "True" - value 1) - (object Attribute - tool "cg" - name "Same_As_Function" - value 2))) - (object Attribute - tool "cg" - name "GetSetByReference" - value FALSE) - (object Attribute - tool "cg" - name "InlineGet" - value TRUE) - (object Attribute - tool "cg" - name "SetReturnsValue" - value FALSE) - (object Attribute - tool "cg" - name "InlineSet" - value TRUE) - (object Attribute - tool "cg" - name "ForwardReferenceOnly" - value FALSE) - (object Attribute - tool "cg" - name "GenerateForwardReference" - value FALSE) - (object Attribute - tool "cg" - name "IsReadOnly" - value FALSE) - (object Attribute - tool "cg" - name "BoundedHasRelType" - value ("HasRelTypeSet" 47)) - (object Attribute - tool "cg" - name "HasRelTypeSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Array" - value 24) - (object Attribute - tool "cg" - name "Sequence" - value 47))))) - (object Attribute - tool "cg" - name "default__Association" - value (list Attribute_Set - (object Attribute - tool "cg" - name "NameIfUnlabeled" - value "the_$targetClass"))) - (object Attribute - tool "cg" - name "default__Inherit" - value (list Attribute_Set - (object Attribute - tool "cg" - name "InstanceArguments" - value ""))) - (object Attribute - tool "cg" - name "default__Role" - value (list Attribute_Set - (object Attribute - tool "cg" - name "CodeName" - value "") - (object Attribute - tool "cg" - name "ForwardReferenceOnly" - value FALSE) - (object Attribute - tool "cg" - name "NameIfUnlabeled" - value "the_$targetClass") - (object Attribute - tool "cg" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "cg" - name "DataMemberName" - value "$target") - (object Attribute - tool "cg" - name "DataMemberVisibility" - value ("DataMemberVisibilitySet" 14)) - (object Attribute - tool "cg" - name "DataMemberVisibilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Public" - value 45) - (object Attribute - tool "cg" - name "Protected" - value 44) - (object Attribute - tool "cg" - name "Private" - value 43) - (object Attribute - tool "cg" - name "Implementation" - value 14) - (object Attribute - tool "cg" - name "AtRelationshipVisibility" - value 210))) - (object Attribute - tool "cg" - name "DataMemberMutability" - value ("DataMemberMutabilitySet" 0)) - (object Attribute - tool "cg" - name "DataMemberMutabilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Unrestricted" - value 0) - (object Attribute - tool "cg" - name "Mutable" - value 1) - (object Attribute - tool "cg" - name "Const" - value 2))) - (object Attribute - tool "cg" - name "DataMemberIsVolatile" - value FALSE) - (object Attribute - tool "cg" - name "DataMemberFieldSize" - value "") - (object Attribute - tool "cg" - name "InitialValue" - value (value Text "")) - (object Attribute - tool "cg" - name "ContainerClass" - value "") - (object Attribute - tool "cg" - name "ContainerGet" - value "$data.get($keys)") - (object Attribute - tool "cg" - name "ContainerSet" - value "$data.set($keys,$value)") - (object Attribute - tool "cg" - name "QualifiedContainer" - value "") - (object Attribute - tool "cg" - name "AssocClassContainer" - value "$supplier *") - (object Attribute - tool "cg" - name "AssocClassInitialValue" - value (value Text "")) - (object Attribute - tool "cg" - name "GetSetKinds" - value ("GetSetKindsSet" 200)) - (object Attribute - tool "cg" - name "GetSetKindsSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202) - (object Attribute - tool "cg" - name "Static" - value 203) - (object Attribute - tool "cg" - name "Friend" - value 204))) - (object Attribute - tool "cg" - name "GetSetByReference" - value FALSE) - (object Attribute - tool "cg" - name "GenerateGetOperation" - value TRUE) - (object Attribute - tool "cg" - name "GetName" - value "get_$target") - (object Attribute - tool "cg" - name "GetIsConst" - value TRUE) - (object Attribute - tool "cg" - name "GetResultIsConst" - value ("GetResultIsConstSet" 2)) - (object Attribute - tool "cg" - name "GetResultIsConstSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "False" - value 0) - (object Attribute - tool "cg" - name "True" - value 1) - (object Attribute - tool "cg" - name "Same_As_Function" - value 2))) - (object Attribute - tool "cg" - name "InlineGet" - value TRUE) - (object Attribute - tool "cg" - name "GenerateSetOperation" - value TRUE) - (object Attribute - tool "cg" - name "SetName" - value "set_$target") - (object Attribute - tool "cg" - name "SetReturnsValue" - value FALSE) - (object Attribute - tool "cg" - name "InlineSet" - value TRUE) - (object Attribute - tool "cg" - name "QualifiedGetSetByReference" - value ("QualifiedGetSetByReferenceSet" 2)) - (object Attribute - tool "cg" - name "QualifiedGetSetByReferenceSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "False" - value 0) - (object Attribute - tool "cg" - name "True" - value 1) - (object Attribute - tool "cg" - name "Same_As_GetSetByReference" - value 2))) - (object Attribute - tool "cg" - name "GenerateQualifiedGetOperation" - value TRUE) - (object Attribute - tool "cg" - name "QualifiedGetName" - value "get_$target") - (object Attribute - tool "cg" - name "QualifiedGetIsConst" - value TRUE) - (object Attribute - tool "cg" - name "QualifiedGetResultIsConst" - value ("GetResultIsConstSet" 2)) - (object Attribute - tool "cg" - name "InlineQualifiedGet" - value TRUE) - (object Attribute - tool "cg" - name "GenerateQualifiedSetOperation" - value TRUE) - (object Attribute - tool "cg" - name "QualifiedSetName" - value "set_$target") - (object Attribute - tool "cg" - name "QualifiedSetReturnsValue" - value FALSE) - (object Attribute - tool "cg" - name "InlineQualifiedSet" - value TRUE) - (object Attribute - tool "cg" - name "GenerateAssocClassDataMember" - value TRUE) - (object Attribute - tool "cg" - name "AssocClassDataMemberName" - value "$target") - (object Attribute - tool "cg" - name "AssocClassDataMemberVisibility" - value ("DataMemberVisibilitySet" 14)) - (object Attribute - tool "cg" - name "DataMemberVisibilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Public" - value 45) - (object Attribute - tool "cg" - name "Protected" - value 44) - (object Attribute - tool "cg" - name "Private" - value 43) - (object Attribute - tool "cg" - name "Implementation" - value 14) - (object Attribute - tool "cg" - name "AtRelationshipVisibility" - value 210))) - (object Attribute - tool "cg" - name "AssocClassDataMemberMutability" - value ("DataMemberMutabilitySet" 0)) - (object Attribute - tool "cg" - name "DataMemberMutabilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Unrestricted" - value 0) - (object Attribute - tool "cg" - name "Mutable" - value 1) - (object Attribute - tool "cg" - name "Const" - value 2))) - (object Attribute - tool "cg" - name "AssocClassDataMemberIsVolatile" - value FALSE) - (object Attribute - tool "cg" - name "AssocClassGetSetKinds" - value ("GetSetKindsSet" 200)) - (object Attribute - tool "cg" - name "GenerateAssocClassGetOperation" - value TRUE) - (object Attribute - tool "cg" - name "AssocClassGetName" - value "get_$target") - (object Attribute - tool "cg" - name "AssocClassGetIsConst" - value TRUE) - (object Attribute - tool "cg" - name "AssocClassGetResultIsConst" - value ("GetResultIsConstSet" 2)) - (object Attribute - tool "cg" - name "InlineAssocClassGet" - value TRUE) - (object Attribute - tool "cg" - name "GenerateAssocClassSetOperation" - value TRUE) - (object Attribute - tool "cg" - name "AssocClassSetName" - value "set_$target") - (object Attribute - tool "cg" - name "AssocClassSetReturnsValue" - value FALSE) - (object Attribute - tool "cg" - name "InlineAssocClassSet" - value TRUE) - (object Attribute - tool "cg" - name "AssocClassForwardReferenceOnly" - value TRUE) - (object Attribute - tool "cg" - name "GenerateForwardReference" - value FALSE) - (object Attribute - tool "cg" - name "IsReadOnly" - value FALSE) - (object Attribute - tool "cg" - name "BoundedRoleType" - value ("AssocTypeSet" 47)) - (object Attribute - tool "cg" - name "AssocTypeSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Array" - value 24) - (object Attribute - tool "cg" - name "Sequence" - value 47))))) - (object Attribute - tool "cg" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "cg" - name "CodeName" - value "") - (object Attribute - tool "cg" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "cg" - name "DataMemberName" - value "$attribute") - (object Attribute - tool "cg" - name "DataMemberVisibility" - value ("DataMemberVisibilitySet" 14)) - (object Attribute - tool "cg" - name "DataMemberVisibilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Public" - value 45) - (object Attribute - tool "cg" - name "Protected" - value 44) - (object Attribute - tool "cg" - name "Private" - value 43) - (object Attribute - tool "cg" - name "Implementation" - value 14) - (object Attribute - tool "cg" - name "AtAttributeVisibility" - value 211))) - (object Attribute - tool "cg" - name "DataMemberMutability" - value ("DataMemberMutabilitySet" 0)) - (object Attribute - tool "cg" - name "DataMemberMutabilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Unrestricted" - value 0) - (object Attribute - tool "cg" - name "Mutable" - value 1) - (object Attribute - tool "cg" - name "Const" - value 2))) - (object Attribute - tool "cg" - name "DataMemberIsVolatile" - value FALSE) - (object Attribute - tool "cg" - name "DataMemberFieldSize" - value "") - (object Attribute - tool "cg" - name "GenerateGetOperation" - value TRUE) - (object Attribute - tool "cg" - name "GenerateSetOperation" - value TRUE) - (object Attribute - tool "cg" - name "GetName" - value "get_$attribute") - (object Attribute - tool "cg" - name "SetName" - value "set_$attribute") - (object Attribute - tool "cg" - name "GetSetKinds" - value ("GetSetKindsSet" 200)) - (object Attribute - tool "cg" - name "GetSetKindsSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202) - (object Attribute - tool "cg" - name "Static" - value 203) - (object Attribute - tool "cg" - name "Friend" - value 204))) - (object Attribute - tool "cg" - name "GetIsConst" - value TRUE) - (object Attribute - tool "cg" - name "GetResultIsConst" - value ("GetResultIsConstSet" 2)) - (object Attribute - tool "cg" - name "GetResultIsConstSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "False" - value 0) - (object Attribute - tool "cg" - name "True" - value 1) - (object Attribute - tool "cg" - name "Same_As_Function" - value 2))) - (object Attribute - tool "cg" - name "GetSetByReference" - value FALSE) - (object Attribute - tool "cg" - name "InlineGet" - value TRUE) - (object Attribute - tool "cg" - name "SetReturnsValue" - value FALSE) - (object Attribute - tool "cg" - name "InlineSet" - value TRUE) - (object Attribute - tool "cg" - name "CaseSpecifier" - value "") - (object Attribute - tool "cg" - name "IsReadOnly" - value FALSE))) - (object Attribute - tool "cg" - name "default__Uses" - value (list Attribute_Set - (object Attribute - tool "cg" - name "ForwardReferenceOnly" - value FALSE) - (object Attribute - tool "cg" - name "BodyReferenceOnly" - value FALSE) - (object Attribute - tool "cg" - name "GenerateForwardReference" - value FALSE))) - (object Attribute - tool "cg" - name "default__Subsystem" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Directory" - value "AUTO GENERATE") - (object Attribute - tool "cg" - name "DirectoryIsOnSearchList" - value FALSE) - (object Attribute - tool "cg" - name "PrecompiledHeader" - value ""))) - (object Attribute - tool "cg" - name "default__Category" - value (list Attribute_Set - (object Attribute - tool "cg" - name "IsNamespace" - value FALSE) - (object Attribute - tool "cg" - name "Indent" - value 2) - (object Attribute - tool "cg" - name "CodeName" - value "") - (object Attribute - tool "cg" - name "GenerateEmptyRegions" - value ("GenerateEmptyRegionSet" 3)) - (object Attribute - tool "cg" - name "GenerateEmptyRegionSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "None" - value 0) - (object Attribute - tool "cg" - name "Preserved" - value 1) - (object Attribute - tool "cg" - name "Unpreserved" - value 2) - (object Attribute - tool "cg" - name "All" - value 3))))) - (object Attribute - tool "MSVC" - name "propertyId" - value "809135966") - (object Attribute - tool "MSVC" - name "default__Project" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Version" - value "5.0"))) - (object Attribute - tool "MSVC" - name "default__Class" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Type" - value ("MSVCClassTypeSet" 0)) - (object Attribute - tool "MSVC" - name "MSVCClassTypeSet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Normal" - value 0) - (object Attribute - tool "MSVC" - name "Interface_Part" - value 1) - (object Attribute - tool "MSVC" - name "Connection_Part" - value 2) - (object Attribute - tool "MSVC" - name "Class_Factory" - value 3))) - (object Attribute - tool "MSVC" - name "CObjectFunctionality" - value ("CObjectFunctionalitySet" 0)) - (object Attribute - tool "MSVC" - name "CObjectFunctionalitySet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "None" - value 0) - (object Attribute - tool "MSVC" - name "Dynamic" - value 1) - (object Attribute - tool "MSVC" - name "Dyncreate" - value 2) - (object Attribute - tool "MSVC" - name "Serial" - value 3))) - (object Attribute - tool "MSVC" - name "GenerateOverrideGroup" - value FALSE) - (object Attribute - tool "MSVC" - name "GenerateDataGroup" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_DATA_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateFieldGroup" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_FIELD_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateMessageGroup" - value FALSE) - (object Attribute - tool "MSVC" - name "GenerateMessageMap" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_MSG_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "MESSAGE_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "OLEFactory" - value ("OLEFactorySet" 0)) - (object Attribute - tool "MSVC" - name "OLEFactorySet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "None" - value 0) - (object Attribute - tool "MSVC" - name "Built_in" - value 1) - (object Attribute - tool "MSVC" - name "Simple" - value 2) - (object Attribute - tool "MSVC" - name "Licensed" - value 3))) - (object Attribute - tool "MSVC" - name "OLEName" - value "") - (object Attribute - tool "MSVC" - name "OLEClassID" - value "") - (object Attribute - tool "MSVC" - name "GenerateOLECtlType" - value FALSE) - (object Attribute - tool "MSVC" - name "OLECtlType" - value "") - (object Attribute - tool "MSVC" - name "GenerateOLETypeLib" - value FALSE) - (object Attribute - tool "MSVC" - name "OLETypeLibID" - value "") - (object Attribute - tool "MSVC" - name "OLETypeLibMajor" - value "") - (object Attribute - tool "MSVC" - name "OLETypeLibMinor" - value "") - (object Attribute - tool "MSVC" - name "GeneratePropPageIDs" - value FALSE) - (object Attribute - tool "MSVC" - name "OLEPropPageIDs" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateDispatchMap" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_DISPATCH_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "AFX_DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "StockProperties" - value (value Text "")) - (object Attribute - tool "MSVC" - name "StockFunctions" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DispatchDefValue" - value "") - (object Attribute - tool "MSVC" - name "GenerateDispIdEnum" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_DISP_ID_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateInterfaceMap" - value FALSE) - (object Attribute - tool "MSVC" - name "INTERFACE_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "InitInterface" - value "") - (object Attribute - tool "MSVC" - name "GenerateEventMap" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_EVENT_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "AFX_EVENT_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "EVENT_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "StockEvents" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateEventSinkMap" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_EVENTSINK_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "AFX_EVENTSINK_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "EVENTSINK_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "PropNotifySinks" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateConnectionMap" - value FALSE) - (object Attribute - tool "MSVC" - name "CONNECTION_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "ConnectionPointIID" - value "") - (object Attribute - tool "MSVC" - name "InheritanceType" - value "") - (object Attribute - tool "MSVC" - name "DeclSpec" - value "") - (object Attribute - tool "MSVC" - name "OLECommands" - value (value Text "")) - (object Attribute - tool "MSVC" - name "MFCDeclares" - value (value Text "")) - (object Attribute - tool "MSVC" - name "MFCImplements" - value (value Text "")) - (object Attribute - tool "MSVC" - name "ATL_Declares" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateCOMMap" - value FALSE) - (object Attribute - tool "MSVC" - name "COM_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateConnectionPointMap" - value FALSE) - (object Attribute - tool "MSVC" - name "CONNECTION_POINT_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateMsgMap" - value FALSE) - (object Attribute - tool "MSVC" - name "MSG_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GeneratePropertyMap" - value FALSE) - (object Attribute - tool "MSVC" - name "PROPERTY_MAP_Entries" - value (value Text "")))) - (object Attribute - tool "MSVC" - name "default__Operation" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Type" - value ("MSVCOperationTypeSet" 0)) - (object Attribute - tool "MSVC" - name "MSVCOperationTypeSet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Normal" - value 0) - (object Attribute - tool "MSVC" - name "Virtual_Override" - value 1) - (object Attribute - tool "MSVC" - name "Message_Handler" - value 2) - (object Attribute - tool "MSVC" - name "Dispatch_Handler" - value 3) - (object Attribute - tool "MSVC" - name "Event_Firing_Function" - value 4) - (object Attribute - tool "MSVC" - name "Event_Sink_Handler" - value 5) - (object Attribute - tool "MSVC" - name "Std_OLE_Method" - value 6) - (object Attribute - tool "MSVC" - name "Command_Parser" - value 7) - (object Attribute - tool "MSVC" - name "Property_Get_Function" - value 8) - (object Attribute - tool "MSVC" - name "Property_Set_Function" - value 9) - (object Attribute - tool "MSVC" - name "Property_Notify_Function" - value 10) - (object Attribute - tool "MSVC" - name "Macro_Generated_Function" - value 11))) - (object Attribute - tool "MSVC" - name "AFX_MSG_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "MESSAGE_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "AFX_DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "AFX_EVENT_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "EVENT_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "AFX_EVENTSINK_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "EVENTSINK_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "CallType" - value "") - (object Attribute - tool "MSVC" - name "DeclSpec" - value "") - (object Attribute - tool "MSVC" - name "BodyImage" - value (value Text "")))) - (object Attribute - tool "MSVC" - name "default__Role" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Type" - value ("MSVCAttributeTypeSet" 0)) - (object Attribute - tool "MSVC" - name "MSVCAttributeTypeSet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Normal" - value 0) - (object Attribute - tool "MSVC" - name "Member_Property" - value 1) - (object Attribute - tool "MSVC" - name "Get_Set_Property" - value 2) - (object Attribute - tool "MSVC" - name "Dialog_Data" - value 3) - (object Attribute - tool "MSVC" - name "Field_Data" - value 4) - (object Attribute - tool "MSVC" - name "Stock_Property" - value 5))) - (object Attribute - tool "MSVC" - name "AFX_DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DeclSpec" - value "") - (object Attribute - tool "MSVC" - name "PointerBase" - value "") - (object Attribute - tool "MSVC" - name "CallType" - value "") - (object Attribute - tool "MSVC" - name "StockPropertyImplementation" - value ""))) - (object Attribute - tool "MSVC" - name "default__Has" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Type" - value ("MSVCAttributeTypeSet" 0)) - (object Attribute - tool "MSVC" - name "MSVCAttributeTypeSet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Normal" - value 0) - (object Attribute - tool "MSVC" - name "Member_Property" - value 1) - (object Attribute - tool "MSVC" - name "Get_Set_Property" - value 2) - (object Attribute - tool "MSVC" - name "Dialog_Data" - value 3) - (object Attribute - tool "MSVC" - name "Field_Data" - value 4) - (object Attribute - tool "MSVC" - name "Stock_Property" - value 5))) - (object Attribute - tool "MSVC" - name "AFX_DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DeclSpec" - value "") - (object Attribute - tool "MSVC" - name "PointerBase" - value "") - (object Attribute - tool "MSVC" - name "CallType" - value "") - (object Attribute - tool "MSVC" - name "StockPropertyImplementation" - value ""))) - (object Attribute - tool "MSVC" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Type" - value ("MSVCAttributeTypeSet" 0)) - (object Attribute - tool "MSVC" - name "MSVCAttributeTypeSet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Normal" - value 0) - (object Attribute - tool "MSVC" - name "Member_Property" - value 1) - (object Attribute - tool "MSVC" - name "Get_Set_Property" - value 2) - (object Attribute - tool "MSVC" - name "Dialog_Data" - value 3) - (object Attribute - tool "MSVC" - name "Field_Data" - value 4) - (object Attribute - tool "MSVC" - name "Stock_Property" - value 5))) - (object Attribute - tool "MSVC" - name "AFX_DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DeclSpec" - value "") - (object Attribute - tool "MSVC" - name "PointerBase" - value "") - (object Attribute - tool "MSVC" - name "CallType" - value "") - (object Attribute - tool "MSVC" - name "StockPropertyImplementation" - value ""))) - (object Attribute - tool "MSVC" - name "default__Module-Spec" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "GenerateIncludesGroup" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_INCLUDES_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateInsertLocation" - value FALSE))) - (object Attribute - tool "MSVC" - name "default__Module-Body" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "GenerateIncludesGroup" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_INCLUDES_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateInsertLocation" - value FALSE))) - (object Attribute - tool "cg" - name "HiddenTool" - value FALSE) - (object Attribute - tool "TypeLibImporter" - name "HiddenTool" - value FALSE)) - quid "4367BF7F0009")) diff --git a/tags/java-stable-20060304/sca/model/src/main/resources/model/assembly.ppt b/tags/java-stable-20060304/sca/model/src/main/resources/model/assembly.ppt deleted file mode 100644 index 717f54a1ba..0000000000 Binary files a/tags/java-stable-20060304/sca/model/src/main/resources/model/assembly.ppt and /dev/null differ diff --git a/tags/java-stable-20060304/sca/model/src/main/resources/model/sca-binding-sca.xsd b/tags/java-stable-20060304/sca/model/src/main/resources/model/sca-binding-sca.xsd deleted file mode 100644 index 2e379cfa59..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/resources/model/sca-binding-sca.xsd +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/model/src/main/resources/model/sca-binding-webservice.xsd b/tags/java-stable-20060304/sca/model/src/main/resources/model/sca-binding-webservice.xsd deleted file mode 100644 index 51b6458958..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/resources/model/sca-binding-webservice.xsd +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/model/src/main/resources/model/sca-core.xsd b/tags/java-stable-20060304/sca/model/src/main/resources/model/sca-core.xsd deleted file mode 100644 index a9cb8582f0..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/resources/model/sca-core.xsd +++ /dev/null @@ -1,225 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/model/src/main/resources/model/sca-implementation-java.xsd b/tags/java-stable-20060304/sca/model/src/main/resources/model/sca-implementation-java.xsd deleted file mode 100644 index cf155e3dfb..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/resources/model/sca-implementation-java.xsd +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/model/src/main/resources/model/sca-interface-java.xsd b/tags/java-stable-20060304/sca/model/src/main/resources/model/sca-interface-java.xsd deleted file mode 100644 index b0f9aec48c..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/resources/model/sca-interface-java.xsd +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/model/src/main/resources/model/sca-interface-wsdl.xsd b/tags/java-stable-20060304/sca/model/src/main/resources/model/sca-interface-wsdl.xsd deleted file mode 100644 index dd06917da5..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/resources/model/sca-interface-wsdl.xsd +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/model/src/main/resources/model/sca.xsd b/tags/java-stable-20060304/sca/model/src/main/resources/model/sca.xsd deleted file mode 100644 index c2438bc1d4..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/resources/model/sca.xsd +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/model/src/main/resources/org/apache/tuscany/model/Messages.properties b/tags/java-stable-20060304/sca/model/src/main/resources/org/apache/tuscany/model/Messages.properties deleted file mode 100644 index 4581e44bff..0000000000 --- a/tags/java-stable-20060304/sca/model/src/main/resources/org/apache/tuscany/model/Messages.properties +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable. -# -# 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. -# ==================================================================== -# To code developer: -# Do NOT change the properties between this line and the -# "%%% END OF TRANSLATED PROPERTIES %%%" line. -# Make a new property name, append to the end of the file and change -# the code to use the new property. -# ==================================================================== - -# ===================================================================== -# %%% END OF TRANSLATED PROPERTIES %%% -# ===================================================================== -# NLS_MESSAGEFORMAT_ALL diff --git a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/SCDLAssemblyLoaderTestCase.java b/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/SCDLAssemblyLoaderTestCase.java deleted file mode 100644 index 482a10d0f4..0000000000 --- a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/SCDLAssemblyLoaderTestCase.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.tests; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.common.resource.ResourceLoader; -import org.apache.tuscany.common.resource.impl.ResourceLoaderImpl; -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.Component; -import org.apache.tuscany.model.assembly.EntryPoint; -import org.apache.tuscany.model.assembly.Module; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; -import org.apache.tuscany.model.assembly.loader.AssemblyModelLoader; -import org.apache.tuscany.model.scdl.loader.impl.SCDLAssemblyModelLoaderImpl; - -/** - */ -public class SCDLAssemblyLoaderTestCase extends TestCase { - - /** - * - */ - public SCDLAssemblyLoaderTestCase() { - super(); - } - - public void testLoader() { - - ResourceLoader resourceLoader=new ResourceLoaderImpl(Thread.currentThread().getContextClassLoader()); - AssemblyModelLoader assemblyLoader=new SCDLAssemblyModelLoaderImpl(null); - AssemblyFactory assemblyFactory=new AssemblyFactoryImpl(); - AssemblyModelContext modelContext=new AssemblyModelContextImpl(assemblyFactory, assemblyLoader, resourceLoader); - - Module module = assemblyLoader.loadModule(getClass().getResource("sca.module").toString()); - module.initialize(modelContext); - Assert.assertTrue(module.getName().equals("tuscany.model.assembly.tests.bigbank.account")); - - Component foundComponent=module.getComponent("AccountServiceComponent"); - Assert.assertTrue(foundComponent!= null); - - EntryPoint foundEntryPoint=module.getEntryPoint("AccountService"); - Assert.assertTrue(foundEntryPoint!= null); - } - - protected void setUp() throws Exception { - super.setUp(); - - Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/SCDLXMLReaderTestCase.java b/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/SCDLXMLReaderTestCase.java deleted file mode 100644 index c1beac4e9a..0000000000 --- a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/SCDLXMLReaderTestCase.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.tests; - -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.model.scdl.Component; -import org.apache.tuscany.model.scdl.EntryPoint; -import org.apache.tuscany.model.scdl.Module; -import org.apache.tuscany.model.scdl.loader.impl.SCDLXMLReader; - -/** - */ -public class SCDLXMLReaderTestCase extends TestCase { - - /** - * - */ - public SCDLXMLReaderTestCase() { - super(); - } - - public void testLoader() { - - SCDLXMLReader loader = new SCDLXMLReader(); - Module module = loader.getModule(getClass().getResource("sca.module").toString()); - Assert.assertTrue(module.getName().equals("tuscany.model.assembly.tests.bigbank.account")); - - Component foundComponent=null; - for (Component component : (List)module.getComponent()) { - if (component.getName().equals("AccountServiceComponent")) - foundComponent=component; - } - Assert.assertTrue(foundComponent!= null); - - EntryPoint foundEntryPoint=null; - for (EntryPoint entryPoint: (List)module.getEntryPoint()) { - if (entryPoint.getName().equals("AccountService")) - foundEntryPoint=entryPoint; - } - Assert.assertTrue(foundEntryPoint!= null); - } - - protected void setUp() throws Exception { - super.setUp(); - - Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/account/AccountReport.java b/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/account/AccountReport.java deleted file mode 100644 index b1b5913adc..0000000000 --- a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/account/AccountReport.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.tests.bigbank.account.services.account; - -import java.util.List; - -/** - * @model - */ - -public interface AccountReport { - - /** - * @model type="services.account.AccountSummary" - */ - - List getAccountSummaries(); -} diff --git a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/account/AccountService.java b/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/account/AccountService.java deleted file mode 100644 index 83df13439a..0000000000 --- a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/account/AccountService.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.tests.bigbank.account.services.account; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface AccountService { - - public AccountReport getAccountReport(String customerID); -} diff --git a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/account/AccountService.wsdl b/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/account/AccountService.wsdl deleted file mode 100644 index 921218c5b9..0000000000 --- a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/account/AccountService.wsdl +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/account/AccountServiceImpl.java b/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/account/AccountServiceImpl.java deleted file mode 100644 index a5619bb41e..0000000000 --- a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/account/AccountServiceImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.tests.bigbank.account.services.account; - -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Reference; - -import org.apache.tuscany.model.assembly.tests.bigbank.account.services.accountdata.AccountDataService; -import org.apache.tuscany.model.assembly.tests.bigbank.account.services.stockquote.StockQuoteService; - -public class AccountServiceImpl implements AccountService { - - @Property - public String currency = "USD"; - - @Reference - public AccountDataService accountDataService; - @Reference - public StockQuoteService stockQuoteService; - - public AccountServiceImpl() { - } - - public AccountReport getAccountReport(String customerID) { - return null; - } - -} diff --git a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/account/AccountSummary.java b/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/account/AccountSummary.java deleted file mode 100644 index c1650c79fa..0000000000 --- a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/account/AccountSummary.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.tests.bigbank.account.services.account; - -/** - * @model - */ - -public interface AccountSummary { - - /** - * @model - */ - String getAccountNumber(); - - void setAccountNumber(String accountNumber); - - /** - * @model - */ - String getAccountType(); - - void setAccountType(String accountType); - - /** - * @model - */ - float getBalance(); - - void setBalance(float balance); -} - diff --git a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java b/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java deleted file mode 100644 index 04ae8e5bd5..0000000000 --- a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.tests.bigbank.account.services.accountdata; - -public interface AccountDataService { - - CheckingAccount getCheckingAccount(String customerID); - - SavingsAccount getSavingsAccount(String customerID); - - StockAccount getStockAccount(String customerID); -} diff --git a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java b/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java deleted file mode 100644 index eaf4b9486e..0000000000 --- a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.tests.bigbank.account.services.accountdata; - -public class AccountDataServiceImpl implements AccountDataService { - - public CheckingAccount getCheckingAccount(String customerID) { - - CheckingAccount checkingAccount = new CheckingAccount(); - checkingAccount.setAccountNumber(customerID + "_" + "CHA12345"); - checkingAccount.setBalance(1500.0f); - - return checkingAccount; - } - - public SavingsAccount getSavingsAccount(String customerID) { - - SavingsAccount savingsAccount = new SavingsAccount(); - savingsAccount.setAccountNumber(customerID + "_" + "SAA12345"); - savingsAccount.setBalance(1500.0f); - - return savingsAccount; - } - - public StockAccount getStockAccount(String customerID) { - - StockAccount stockAccount = new StockAccount(); - stockAccount.setAccountNumber(customerID + "_" + "STA12345"); - stockAccount.setSymbol("IBM"); - stockAccount.setQuantity(100); - - return stockAccount; - } -} diff --git a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java b/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java deleted file mode 100644 index d4f2f8be6c..0000000000 --- a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.tests.bigbank.account.services.accountdata; - -public class CheckingAccount { - - private String accountNumber; - private float balance; - - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - - public float getBalance() { - return balance; - } - - public void setBalance(float balance) { - this.balance = balance; - } -} diff --git a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java b/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java deleted file mode 100644 index 73474585da..0000000000 --- a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.tests.bigbank.account.services.accountdata; - -public class SavingsAccount { - - private String accountNumber; - private float balance; - - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - - public float getBalance() { - return balance; - } - - public void setBalance(float balance) { - this.balance = balance; - } -} diff --git a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/accountdata/StockAccount.java b/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/accountdata/StockAccount.java deleted file mode 100644 index eeb7238abc..0000000000 --- a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/accountdata/StockAccount.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.tests.bigbank.account.services.accountdata; - -public class StockAccount { - - private String accountNumber; - private String symbol; - private int quantity; - - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - - public int getQuantity() { - return quantity; - } - - public void setQuantity(int quantity) { - this.quantity = quantity; - } - - public String getSymbol() { - return symbol; - } - - public void setSymbol(String symbol) { - this.symbol = symbol; - } -} diff --git a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java b/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java deleted file mode 100644 index 7545e9fbbb..0000000000 --- a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.tests.bigbank.account.services.stockquote; - -public interface StockQuoteService { - - public float getQuote(String symbol); -} - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/stockquote/StockQuoteServiceImpl.java b/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/stockquote/StockQuoteServiceImpl.java deleted file mode 100644 index 85f85340ec..0000000000 --- a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/stockquote/StockQuoteServiceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.model.assembly.tests.bigbank.account.services.stockquote; - -/* Dummy'd up StockQuoteService, override webservice for now */ - -public class StockQuoteServiceImpl implements StockQuoteService { - - public float getQuote(String symbol) { - // Just hardcode for now - return 83.00f; - } - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl b/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl deleted file mode 100644 index 9678d9d6ea..0000000000 --- a/tags/java-stable-20060304/sca/model/src/test/java/org/apache/tuscany/model/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/model/src/test/resources/org/apache/tuscany/model/assembly/tests/sca.module b/tags/java-stable-20060304/sca/model/src/test/resources/org/apache/tuscany/model/assembly/tests/sca.module deleted file mode 100644 index 7d81262730..0000000000 --- a/tags/java-stable-20060304/sca/model/src/test/resources/org/apache/tuscany/model/assembly/tests/sca.module +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/model/src/test/resources/org/apache/tuscany/model/assembly/tests/sca.subsystem b/tags/java-stable-20060304/sca/model/src/test/resources/org/apache/tuscany/model/assembly/tests/sca.subsystem deleted file mode 100644 index bff90f010d..0000000000 --- a/tags/java-stable-20060304/sca/model/src/test/resources/org/apache/tuscany/model/assembly/tests/sca.subsystem +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - diff --git a/tags/java-stable-20060304/sca/plugin/LICENSE.txt b/tags/java-stable-20060304/sca/plugin/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/tags/java-stable-20060304/sca/plugin/LICENSE.txt +++ /dev/null @@ -1,202 +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/tags/java-stable-20060304/sca/plugin/pom.xml b/tags/java-stable-20060304/sca/plugin/pom.xml deleted file mode 100644 index 3f3dbfcd1c..0000000000 --- a/tags/java-stable-20060304/sca/plugin/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - org.apache.tuscany - tuscany-sca - SNAPSHOT - - 4.0.0 - tuscany-sca-plugin - maven-plugin - SNAPSHOT - Tuscany SCA Maven Plugin - - - - org.apache.maven - maven-plugin-api - 2.0 - - - org.apache.tuscany - tuscany-sca-tools - ${pom.version} - compile - - - diff --git a/tags/java-stable-20060304/sca/plugin/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDL2JavaGeneratorMojo.java b/tags/java-stable-20060304/sca/plugin/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDL2JavaGeneratorMojo.java deleted file mode 100644 index b351982e13..0000000000 --- a/tags/java-stable-20060304/sca/plugin/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDL2JavaGeneratorMojo.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * - * Copyright 2005 BEA Systems Inc. - * Copyright 2005 International Business Machines Corporation - * - * 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. - */ -package org.apache.tuscany.tools.wsdl2java.plugin; - -import java.io.File; -import java.io.FileFilter; -import java.io.IOException; -import java.util.List; - -import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator; - -/** - * @version $Rev$ $Date$ - * @goal generate - * @phase generate-sources - * @description Generate SDO interface classes from an XML Schema - */ -public class WSDL2JavaGeneratorMojo extends AbstractMojo { - /** - * The directory containing wsdl files; defaults to ${basedir}/src/main/wsdl - * @parameter expression="${basedir}/src/main/wsdl" - */ - private String wsdlDir; - - /** - * Name of the wsdl file; if omitted all files in the directory are processed - * @parameter - */ - private File wsdlFile; - - /** - * The Java package to generate into. By default the value is derived from the schema URI. - * - * @parameter - */ - private String javaPackage; - - /** - * The directory to generate into; defaults to ${project.build.directory}/wsdl2java-source - * - * @parameter expression="${project.build.directory}/wsdl2java-source" - */ - private String targetDirectory; - - /** - * @parameter expression="${project.compileSourceRoots}" - * @readonly - */ - private List compilerSourceRoots; - - public void execute() throws MojoExecutionException { - File[] files; - if (wsdlFile == null) { - files = new File(wsdlDir).listFiles(FILTER); - } else { - files = new File[]{wsdlFile}; - } - - int genOptions = 0; - - for (int i = 0; i < files.length; i++) { - File file = files[i]; - File marker = new File(targetDirectory, ".gen#" + file.getName()); - if (file.lastModified() > marker.lastModified()) { - getLog().info("Generating Java service interfaces from " + file); - WSDL2JavaGenerator.generateFromWSDL(file.toString(), targetDirectory, javaPackage, null, genOptions); - } - try { - marker.createNewFile(); - } catch (IOException e) { - throw new MojoExecutionException(e.getMessage(), e); - } - marker.setLastModified(System.currentTimeMillis()); - } - - compilerSourceRoots.add(targetDirectory); - } - - private static final FileFilter FILTER = new FileFilter() { - public boolean accept(File pathname) { - return (pathname.isFile() || !pathname.isHidden()); - } - }; -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/pom.xml b/tags/java-stable-20060304/sca/pom.xml deleted file mode 100644 index f07e22f69e..0000000000 --- a/tags/java-stable-20060304/sca/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - org.apache.tuscany - tuscany-project - SNAPSHOT - - 4.0.0 - tuscany-sca - pom - Tuscany SCA Implementation Project - SNAPSHOT - - - common - model - core - - binding.axis2 - container.java - container.js - tomcat - tools - plugin - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*TestCase.java - - - - - - - src/test/java - - **/*.componentType - - - - src/test/resources - - **/* - - - - - diff --git a/tags/java-stable-20060304/sca/tomcat/LICENSE.txt b/tags/java-stable-20060304/sca/tomcat/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/LICENSE.txt +++ /dev/null @@ -1,202 +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/tags/java-stable-20060304/sca/tomcat/pom.xml b/tags/java-stable-20060304/sca/tomcat/pom.xml deleted file mode 100644 index 26e610c67a..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/pom.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - org.apache.tuscany - tuscany-sca - SNAPSHOT - - 4.0.0 - tuscany-tomcat - Tuscany Apache Tomcat Integration - Integration of the Tuscany runtime with Apache Tomcat. - SNAPSHOT - - - - org.apache.tuscany - tuscany-container-java - ${pom.version} - compile - - - org.apache.tuscany - tuscany-binding-axis2 - ${pom.version} - compile - - - - - tomcat - servlet-api - 5.0.18 - provided - - - tomcat - catalina - 5.5.15 - provided - - - tomcat - tomcat-util - 5.5.15 - provided - - - tomcat - tomcat-coyote - 5.5.15 - provided - - - tomcat - tomcat-http - 5.5.15 - provided - - - tomcat - naming-factory - 5.5.15 - provided - - - tomcat - naming-resources - 5.5.15 - provided - - - commons-logging - commons-logging - 1.0.4 - provided - - - commons-modeler - commons-modeler - 1.1M1 - provided - - - - junit - junit - 3.8.1 - test - - - diff --git a/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/ContainerLoader.java b/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/ContainerLoader.java deleted file mode 100644 index 60c9a7961f..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/ContainerLoader.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.tomcat; - -import java.beans.PropertyChangeListener; - -import org.apache.catalina.Container; -import org.apache.catalina.Loader; - -/** - * Implementation of a TomcatLoader that allows privileged servlets from the container - * classloader to be loaded into an unprivileged application. This allows the Tuscany - * integration code to add servlets to the application, for example, to handle web - * services requests. - * - * @version $Rev$ $Date$ - */ -public class ContainerLoader implements Loader { - private static final String INFO = ContainerLoader.class.getName() + "/SNAPSHOT"; - private final ClassLoader cl; - private Container container; - - /** - * Constructor specifying the classloader to be used. - * - * @param cl the classloader this Loader wraps, typically the container classloader - */ - public ContainerLoader(ClassLoader cl) { - this.cl = cl; - } - - public void backgroundProcess() { - } - - public ClassLoader getClassLoader() { - return cl; - } - - public Container getContainer() { - return container; - } - - public void setContainer(Container container) { - this.container = container; - } - - public boolean getDelegate() { - return false; - } - - public void setDelegate(boolean delegate) { - throw new UnsupportedOperationException(); - } - - public String getInfo() { - return INFO; - } - - public boolean getReloadable() { - return false; - } - - public void setReloadable(boolean reloadable) { - throw new UnsupportedOperationException(); - } - - public void addPropertyChangeListener(PropertyChangeListener listener) { - throw new UnsupportedOperationException(); - } - - public void addRepository(String repository) { - throw new UnsupportedOperationException(); - } - - public String[] findRepositories() { - throw new UnsupportedOperationException(); - } - - public boolean modified() { - throw new UnsupportedOperationException(); - } - - public void removePropertyChangeListener(PropertyChangeListener listener) { - throw new UnsupportedOperationException(); - } -} diff --git a/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/TuscanyContextListener.java b/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/TuscanyContextListener.java deleted file mode 100644 index 04977dbc27..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/TuscanyContextListener.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.tomcat; - -import java.io.IOException; - -import javax.servlet.ServletContext; - -import org.apache.catalina.Context; -import org.apache.catalina.Lifecycle; -import org.apache.catalina.LifecycleEvent; -import org.apache.catalina.LifecycleListener; -import org.apache.catalina.Valve; -import org.apache.catalina.core.StandardWrapper; - -import org.apache.tuscany.binding.axis2.handler.WebServiceEntryPointServlet; -import org.apache.tuscany.common.resource.ResourceLoader; -import org.apache.tuscany.common.resource.impl.ResourceLoaderImpl; -import org.apache.tuscany.core.config.ConfigurationException; -import org.apache.tuscany.core.config.ConfigurationLoadException; -import org.apache.tuscany.core.config.ModuleComponentConfigurationLoader; -import org.apache.tuscany.core.config.impl.ModuleComponentConfigurationLoaderImpl; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.ModuleComponent; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; -import org.apache.tuscany.model.assembly.loader.AssemblyModelLoader; - -/** - * @version $Rev$ $Date$ - */ -public class TuscanyContextListener implements LifecycleListener { - private static final String TUSCANY_RUNTIME_NAME = RuntimeContext.class.getName(); - public static final String MODULE_COMPONENT_NAME = "org.apache.tuscany.core.webapp.ModuleComponentContext"; - - private final AssemblyFactory modelFactory; - private final AssemblyModelLoader modelLoader; - private final RuntimeContext runtime; - private final ResourceLoader systemLoader; - private AggregateContext moduleContext; - - public TuscanyContextListener(RuntimeContext runtimeContext, AssemblyFactory modelFactory, AssemblyModelLoader modelLoader, ResourceLoader systemLoader) { - this.runtime = runtimeContext; - this.modelFactory = modelFactory; - this.modelLoader = modelLoader; - this.systemLoader = systemLoader; - } - - public void lifecycleEvent(LifecycleEvent event) { - String type = event.getType(); - if (Lifecycle.START_EVENT.equals(type)) { - startContext((Context) event.getLifecycle()); - } else if (Lifecycle.STOP_EVENT.equals(type)) { - stopContext((Context) event.getLifecycle()); - } - } - - private void startContext(Context ctx) { - ResourceLoader resourceLoader = new ResourceLoaderImpl(ctx.getLoader().getClassLoader()); - try { - if (resourceLoader.getResource("sca.module") == null) { - return; - } - } catch (IOException e) { - return; - } - ClassLoader oldCl = Thread.currentThread().getContextClassLoader(); - Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); - try { - AssemblyModelContext modelContext = new AssemblyModelContextImpl(modelFactory, modelLoader, systemLoader, resourceLoader); - ModuleComponentConfigurationLoader loader = new ModuleComponentConfigurationLoaderImpl(modelContext); - - try { - // Load the SCDL configuration of the application module - ModuleComponent moduleComponent = loader.loadModuleComponent(ctx.getName(), ctx.getPath()); - - // Register it under the root application context - AggregateContext rootContext = runtime.getRootContext(); - rootContext.registerModelObject(moduleComponent); - moduleContext = (AggregateContext)rootContext.getContext(moduleComponent.getName()); - moduleContext.registerModelObject(moduleComponent.getComponentImplementation()); - } catch (ConfigurationLoadException e) { - throw new UnsupportedOperationException(); - } catch (ConfigurationException e) { - throw new UnsupportedOperationException(); - } - } finally { - Thread.currentThread().setContextClassLoader(oldCl); - } - - moduleContext.fireEvent(EventContext.MODULE_START, null); - - // add a valve to this context's pipeline that will associate the request with the runtime - Valve valve = new TuscanyValve(moduleContext); - ctx.getPipeline().addValve(valve); - - // add the web service servlet wrapper - addWebServiceWrapper(ctx); - - // add the RuntimeContext in as a servlet context parameter - ServletContext servletContext = ctx.getServletContext(); - servletContext.setAttribute(TUSCANY_RUNTIME_NAME, runtime); - servletContext.setAttribute(MODULE_COMPONENT_NAME, moduleContext); - } - - private void stopContext(Context ctx) { - if (moduleContext!=null) { - moduleContext.fireEvent(EventContext.MODULE_START, null); - } - // todo unload module component from runtime - } - - private static void addWebServiceWrapper(Context ctx) { - // todo this should not depend on axis2, we need an API in the model for embedders - // todo should only add this servlet if we need it - // todo servlet implementation should be determined by the binding implementation - // todo should get path from entry point definition and not hard code to /services - - Class servletClass = WebServiceEntryPointServlet.class; - StandardWrapper wrapper = new StandardWrapper(); - wrapper.setName("TuscanyAxis2EntryPointServlet"); - wrapper.setLoader(new ContainerLoader(servletClass.getClassLoader())); - wrapper.setServletClass(servletClass.getName()); - ctx.addChild(wrapper); - ctx.addServletMapping("/services/*", wrapper.getName()); - } -} diff --git a/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/TuscanyHost.java b/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/TuscanyHost.java deleted file mode 100644 index b6e6db6da7..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/TuscanyHost.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.tomcat; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.catalina.Container; -import org.apache.catalina.LifecycleException; -import org.apache.catalina.core.StandardContext; -import org.apache.catalina.core.StandardHost; -import org.apache.catalina.util.StringManager; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import org.apache.tuscany.common.monitor.impl.NullMonitorFactory; -import org.apache.tuscany.common.resource.ResourceLoader; -import org.apache.tuscany.common.resource.impl.ResourceLoaderImpl; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.builder.impl.DefaultWireBuilder; -import org.apache.tuscany.core.config.ConfigurationLoadException; -import org.apache.tuscany.core.config.ModuleComponentConfigurationLoader; -import org.apache.tuscany.core.config.impl.ModuleComponentConfigurationLoaderImpl; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.SystemAggregateContext; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.runtime.RuntimeContextImpl; -import org.apache.tuscany.core.system.builder.SystemComponentContextBuilder; -import org.apache.tuscany.core.system.builder.SystemEntryPointBuilder; -import org.apache.tuscany.core.system.builder.SystemExternalServiceBuilder; -import org.apache.tuscany.core.system.loader.SystemSCDLModelLoader; -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.ModuleComponent; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; -import org.apache.tuscany.model.assembly.loader.AssemblyModelLoader; -import org.apache.tuscany.model.scdl.loader.SCDLModelLoader; -import org.apache.tuscany.model.scdl.loader.impl.SCDLAssemblyModelLoaderImpl; - -/** - * A Tomcat listener to be attached to a Host container to add SCA runtime functionality. - * The listener wraps a Tuscany runtime and listens for container events to detect the - * addition and removal of Context children. - * - * @version $Rev$ $Date$ - */ -public class TuscanyHost extends StandardHost { - private static final String SYSTEM_MODULE_COMPONENT = "org.apache.tuscany.core.system"; - private static final Log log = LogFactory.getLog(TuscanyHost.class); - private static final StringManager sm = StringManager.getManager("org.apache.tuscany.tomcat"); - - private RuntimeContext runtime; - private AssemblyModelLoader modelLoader; - private AssemblyFactory modelFactory; - private ResourceLoader systemLoader; - - public synchronized void start() throws LifecycleException { - startRuntime(); - super.start(); - } - - public synchronized void stop() throws LifecycleException { - super.stop(); - stopRuntime(); - } - - private void startRuntime() { - systemLoader = new ResourceLoaderImpl(getClass().getClassLoader()); - - // Create an assembly model factory - modelFactory = new AssemblyFactoryImpl(); - - // Create an assembly model loader - List scdlLoaders=new ArrayList(); - scdlLoaders.add(new SystemSCDLModelLoader()); - modelLoader = new SCDLAssemblyModelLoaderImpl(scdlLoaders); - - // Create an assembly model context - AssemblyModelContext modelContext = new AssemblyModelContextImpl(modelFactory, modelLoader, systemLoader); - - // Load the system module component - ModuleComponentConfigurationLoader loader = new ModuleComponentConfigurationLoaderImpl(modelContext); - ModuleComponent systemModuleComponent; - try { - systemModuleComponent = loader.loadSystemModuleComponent(SYSTEM_MODULE_COMPONENT, SYSTEM_MODULE_COMPONENT); - } catch (ConfigurationLoadException e) { - log.warn(sm.getString("runtime.loadSystemFailed"), e); - return; - } - - List configBuilders = new ArrayList(); - configBuilders.add((new SystemComponentContextBuilder())); - configBuilders.add(new SystemEntryPointBuilder()); - configBuilders.add(new SystemExternalServiceBuilder()); - - runtime = new RuntimeContextImpl(new NullMonitorFactory(), scdlLoaders, configBuilders, new DefaultWireBuilder()); - runtime.start(); - - try { - SystemAggregateContext systemContext = runtime.getSystemContext(); - systemContext.registerModelObject(systemModuleComponent); - - // Get the aggregate context representing the system module component - AggregateContext systemModuleComponentContext = (AggregateContext) systemContext.getContext(SYSTEM_MODULE_COMPONENT); - systemModuleComponentContext.registerModelObject(systemModuleComponent.getComponentImplementation()); - systemModuleComponentContext.fireEvent(EventContext.MODULE_START, null); - } catch (Exception e) { - log.warn(sm.getString("runtime.registerSystemFailed"), e); - runtime.stop(); - runtime = null; - return; - } - - log.info(sm.getString("runtime.started")); - } - - private void stopRuntime() { - if (runtime == null) { - return; - } - - runtime.stop(); - runtime = null; - log.info(sm.getString("runtime.stopped")); - } - - public synchronized void addChild(Container child) { - if (!(child instanceof StandardContext)) { - throw new IllegalArgumentException(sm.getString("tuscanyHost.notContext")); - } - StandardContext ctx = (StandardContext) child; - ctx.addLifecycleListener(new TuscanyContextListener(runtime, modelFactory, modelLoader, systemLoader)); - super.addChild(child); - } - - public String toString() { - - StringBuffer sb = new StringBuffer(132); - if (getParent() != null) { - sb.append(getParent().toString()).append('.'); - } - sb.append("TuscanyHost[").append(getName()).append(']'); - return (sb.toString()); - - } -} diff --git a/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/TuscanyValve.java b/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/TuscanyValve.java deleted file mode 100644 index d5383b64ea..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/TuscanyValve.java +++ /dev/null @@ -1,118 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.tomcat; - -import java.io.IOException; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; - -import org.apache.catalina.connector.Request; -import org.apache.catalina.connector.Response; -import org.apache.catalina.valves.ValveBase; -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; -import org.osoa.sca.SCA; - -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.EventException; -import org.apache.tuscany.core.context.webapp.LazyHTTPSessionId; - -/** - * Valve that can be added to a pipeline to automatically set the SCA environment as each request is processed. - * - * @version $Rev$ $Date$ - */ -public class TuscanyValve extends ValveBase { - /** - * Name of the note that contains the request id - */ - private static final String REQUEST_ID = "org.apache.tuscany.tomcat.REQUEST_ID"; - - private static final ContextBinder BINDER = new ContextBinder(); - - private final AggregateContext moduleComponentContext; - - public TuscanyValve(AggregateContext moduleComponentContext) { - this.moduleComponentContext = moduleComponentContext; - } - - public void invoke(Request request, Response response) throws IOException, ServletException { - Object oldRequestId = request.getNote(REQUEST_ID); - ModuleContext oldContext = CurrentModuleContext.getContext(); - - // bind the current module context to the thread for use by CurrentModuleContext - BINDER.setContext((ModuleContext) moduleComponentContext); - try { - if (oldRequestId != null) { - // the request has already been started, just invoke the next valve - next.invoke(request, response); - } else { - // tell the runtime a new request is starting - Object requestId = new Object(); - // jfm - if (request.getSession(false) != null) { - // A session is already active - moduleComponentContext - .fireEvent(EventContext.SESSION_NOTIFY, ((HttpServletRequest) request).getSession(true)); - } else { - // Create a lazy wrapper since a session is not yet active - moduleComponentContext.fireEvent(EventContext.SESSION_NOTIFY, new LazyHTTPSessionId( - (HttpServletRequest) request)); - } - // jfm - try { - moduleComponentContext.fireEvent(EventContext.REQUEST_START, requestId); - } catch (Exception e) { - throw new ServletException(e.getMessage(), e); - } - request.setNote(REQUEST_ID, requestId); - - try { - // invoke the next valve in the pipeline - next.invoke(request, response); - } finally { - // notify the runtime the request is ending - request.removeNote(REQUEST_ID); - try { - moduleComponentContext.fireEvent(EventContext.REQUEST_END, requestId); - } catch (Exception e) { - // the application already did its work, log and ignore - // todo log this exception - } - } - } - } finally { - // restore the previous module context onto the thread - BINDER.setContext(oldContext); - } - } - - private static class ContextBinder extends SCA { - public void setContext(ModuleContext context) { - setModuleContext(context); - } - - public void start() { - throw new AssertionError(); - } - - public void stop() { - throw new AssertionError(); - } - } -} diff --git a/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/lifecycle/listener/BootstrapConfigurationException.java b/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/lifecycle/listener/BootstrapConfigurationException.java deleted file mode 100644 index 39f24cba8f..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/lifecycle/listener/BootstrapConfigurationException.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.tomcat.lifecycle.listener; - -import org.apache.tuscany.common.TuscanyException; - -/** - * Signals an exception booting the Tuscany runtime hosted in a Tomcat instance - * - * @version $Rev$ $Date$ - */ -public class BootstrapConfigurationException extends TuscanyException { - - public BootstrapConfigurationException() { - super(); - } - - public BootstrapConfigurationException(String message) { - super(message); - } - - public BootstrapConfigurationException(String message, Throwable cause) { - super(message, cause); - } - - public BootstrapConfigurationException(Throwable cause) { - super(cause); - } - -} diff --git a/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/lifecycle/listener/RuntimeBootstrap.java b/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/lifecycle/listener/RuntimeBootstrap.java deleted file mode 100644 index 16cad1cb1b..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/lifecycle/listener/RuntimeBootstrap.java +++ /dev/null @@ -1,113 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.tomcat.lifecycle.listener; - -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.List; - -import javax.naming.Context; -import javax.naming.Name; -import javax.naming.RefAddr; -import javax.naming.Reference; -import javax.naming.spi.ObjectFactory; - -import org.apache.tuscany.common.monitor.MonitorFactory; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.config.ModuleComponentConfigurationLoader; -import org.apache.tuscany.core.config.JavaIntrospectionHelper; -import org.apache.tuscany.core.system.builder.SystemComponentContextBuilder; -import org.apache.tuscany.core.system.builder.SystemEntryPointBuilder; -import org.apache.tuscany.core.system.builder.SystemExternalServiceBuilder; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.runtime.RuntimeContextImpl; - -/** - * Bootstraps an SCA runtime hosted by a Tomcat instance. The runtime will be bound to JNDI and accessed by - * {@link org.apache.tuscany.tomcat.lifecycle.listener.WebAppLifecycleListener}s that deploy web archives as module - * components. - *

- * Tomcat is configured by adding the following to server.xml under the - * GlobalNamingResources element: - * - *

- *   <Resource name="TuscanyRuntime" auth="Container" type="org.apache.tuscany.core.runtime.RuntimeContext"
- *          description="Tuscany Runtime"
- *          factory=" org.apache.tuscany.tomcat.lifecycle.listener.RuntimeBootstrap"
- *          monitor="[monitor factory]" loader="[configuration loader]"/>
- * 
- * - * @version $Rev$ $Date$ - */ -public class RuntimeBootstrap implements ObjectFactory { - - public static final String RUNTIME_NAME = "TuscanyRuntime"; - - public RuntimeBootstrap() { - } - - public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable environment) - throws BootstrapConfigurationException { - if (!RUNTIME_NAME.equals(name)) { - throw new BootstrapConfigurationException("Tuscany Runtime must be configured with JNDI address of " + RUNTIME_NAME); - } - MonitorFactory monitorFactory = null; - ModuleComponentConfigurationLoader configurationLoader = null; - - Reference ref = (Reference) obj; - if (!RuntimeContext.class.getName().equals(ref.getClassName())) { - throw new BootstrapConfigurationException("Invalid runtime configuration"); - } - RefAddr monitorAddr = ref.get("monitor"); - RefAddr loaderAddr = ref.get("loader"); - if (loaderAddr == null) { - throw new BootstrapConfigurationException("No configuration laoder specified in Tomcat configuration"); - } - if (monitorAddr != null) { - try { - Class monitorFactoryClass = JavaIntrospectionHelper.loadClass(monitorAddr.getContent().toString()); - monitorFactory = (MonitorFactory) monitorFactoryClass.newInstance(); - } catch (ClassNotFoundException e) { - throw new BootstrapConfigurationException("Unable to find monitor factory class specified in Tomcat configuration", e); - } catch (InstantiationException e) { - throw new BootstrapConfigurationException("Error initializing monitor factory in Tomcat configuration", e); - } catch (IllegalAccessException e) { - throw new BootstrapConfigurationException("Error initializing monitor factory in Tomcat configuration", e); - } - } -// try { -// Class configurationLoaderClass = JavaIntrospectionHelper.loadClass(loaderAddr.getContent().toString()); -// configurationLoader = (ConfigurationLoader) configurationLoaderClass.newInstance(); -// } catch (ClassNotFoundException e) { -// throw new BootstrapConfigurationException("Unable to find configuration loader class specified in Tomcat configuration", e); -// } catch (InstantiationException e) { -// throw new BootstrapConfigurationException("Error initializing configuration loader in Tomcat configuration", e); -// } catch (IllegalAccessException e) { -// throw new BootstrapConfigurationException("Error initializing configuration loader in Tomcat configuration", e); -// } - // create the SCA Runtime and have it bound in the global JNDI context - return new RuntimeContextImpl(monitorFactory, null, createBuilders(),null); - } - - /** - * Creates a collection of bootstrap builders - */ - private List createBuilders() { - List builders = new ArrayList(); - builders.add((new SystemComponentContextBuilder())); - builders.add(new SystemEntryPointBuilder()); - builders.add(new SystemExternalServiceBuilder()); - return builders; - } -} diff --git a/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/lifecycle/listener/TomcatServerLifecycleListener.java b/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/lifecycle/listener/TomcatServerLifecycleListener.java deleted file mode 100644 index 0da95bde17..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/lifecycle/listener/TomcatServerLifecycleListener.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.tomcat.lifecycle.listener; - -import org.apache.catalina.LifecycleEvent; -import org.apache.catalina.LifecycleListener; - -/** - * This class manages the lifecycle of the SCA container in Tomcat. - * @deprecated - */ -public class TomcatServerLifecycleListener implements LifecycleListener { - //private CoreModuleContext containerModuleContext; - - /** - * Constructor - */ - public TomcatServerLifecycleListener() { - } - - /** - * @see org.apache.catalina.LifecycleListener#lifecycleEvent(org.apache.catalina.LifecycleEvent) - */ - public void lifecycleEvent(LifecycleEvent lifecycleEvent) { - } -} diff --git a/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/lifecycle/listener/TomcatWebAppLifecycleListener.java b/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/lifecycle/listener/TomcatWebAppLifecycleListener.java deleted file mode 100644 index d1e7d8de39..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/lifecycle/listener/TomcatWebAppLifecycleListener.java +++ /dev/null @@ -1,249 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.tomcat.lifecycle.listener; - -import java.io.IOException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import org.apache.catalina.Context; -import org.apache.catalina.Lifecycle; -import org.apache.catalina.LifecycleEvent; -import org.apache.catalina.LifecycleListener; -import org.apache.catalina.deploy.FilterDef; -import org.apache.catalina.deploy.FilterMap; -import org.apache.tuscany.common.monitor.impl.NullMonitorFactory; -import org.apache.tuscany.common.resource.ResourceLoader; -import org.apache.tuscany.common.resource.impl.ResourceLoaderImpl; -import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder; -import org.apache.tuscany.core.builder.impl.DefaultWireBuilder; -import org.apache.tuscany.core.config.ModuleComponentConfigurationLoader; -import org.apache.tuscany.core.config.impl.ModuleComponentConfigurationLoaderImpl; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.CoreRuntimeException; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.webapp.HTTPSessionExpirationListener; -import org.apache.tuscany.core.context.webapp.TuscanyRequestFilter; -import org.apache.tuscany.core.context.webapp.TuscanyWebAppRuntime; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.runtime.RuntimeContextImpl; -import org.apache.tuscany.core.system.builder.SystemComponentContextBuilder; -import org.apache.tuscany.core.system.builder.SystemEntryPointBuilder; -import org.apache.tuscany.core.system.builder.SystemExternalServiceBuilder; -import org.apache.tuscany.core.system.loader.SystemSCDLModelLoader; -import org.apache.tuscany.model.assembly.AssemblyFactory; -import org.apache.tuscany.model.assembly.AssemblyModelContext; -import org.apache.tuscany.model.assembly.ModuleComponent; -import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl; -import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl; -import org.apache.tuscany.model.assembly.loader.AssemblyModelLoader; -import org.apache.tuscany.model.scdl.loader.SCDLModelLoader; -import org.apache.tuscany.model.scdl.loader.impl.SCDLAssemblyModelLoaderImpl; -import org.osoa.sca.ServiceRuntimeException; - -//FIXME This is a temporary hack to bootstrap the runtime in a Tomcat environment and do some bringup testing, the real bootstrap code is -// still under construction - -/** - * Responsible for initializing web applications as module components in a - * Tomcat instance. When a web app is being loaded in Tomcat, this listener - * receives a callback to register a corresponding module component and set up - * the appropriate Servlet filters in the web context. - *

- * Note that Tomcat loads this class in the standard (common/lib) classloader - * even though the context classloader is that of the web app being loaded. - * Consequently, the transitive closure of class references must not include - * ModuleContext or ModuleManager - *

- * TODO decide if we want to set this up as a Tomcat listener or as a web app - * listener Setting this up as a web app listener allows users to set the - * context path, avoiding a performance hit for SCA event processing in contexts - * where it is not used. The downside is the potential for user error. For - * example, SCA event filters must be manually configured. We probably should - * provide both options - * FIXME fix the exception handling - */ -public class TomcatWebAppLifecycleListener implements LifecycleListener { - - private final static String SYSTEM_MODULE_COMPONENT = "org.apache.tuscany.core.system"; - - /** - * Constructor - */ - public TomcatWebAppLifecycleListener() { - } - - /** - * Callback for receiving web application events. When a web app containing - * an SCA configuration is initialized, a module component is created and - * appropriate SCA filters are set for in the web context. If a web app stop - * event is received, the corresponding module component is deregistered from - * the system. - */ - public void lifecycleEvent(LifecycleEvent event) { - String lifecycleEventType = event.getType(); - Object lifecycleEventSource = event.getSource(); - - if (Lifecycle.START_EVENT.equals(lifecycleEventType) && lifecycleEventSource instanceof Context) { - - // The web app is starting - Context context = (Context) lifecycleEventSource; - try { - - // Get the application classloader - ClassLoader applicationClassLoader = Thread.currentThread().getContextClassLoader(); - ResourceLoader resourceLoader = new ResourceLoaderImpl(applicationClassLoader); - - // Check if the web app contains an sca.module file - URL url; - try { - url = resourceLoader.getResource("sca.module"); - } catch (IOException e) { - url = null; - } - if (url != null) { - // The Web app has an sca.module file - // Get the module component name from the context - String moduleComponentName = context.getPath().substring(1); - try { - - // Create an assembly model factory - AssemblyFactory modelFactory=new AssemblyFactoryImpl(); - - // Create an assembly model loader - List scdlLoaders=new ArrayList(); - scdlLoaders.add(new SystemSCDLModelLoader()); - AssemblyModelLoader modelLoader=new SCDLAssemblyModelLoaderImpl(scdlLoaders); - - // Create an assembly model context - AssemblyModelContext modelContext = new AssemblyModelContextImpl(modelFactory, modelLoader, resourceLoader); - - // Create system configuration builders - List configBuilders = new ArrayList(); - configBuilders.add((new SystemComponentContextBuilder())); - configBuilders.add(new SystemEntryPointBuilder()); - configBuilders.add(new SystemExternalServiceBuilder()); - - // Create a runtime context and start it - RuntimeContext runtimeContext = new RuntimeContextImpl(new NullMonitorFactory(), scdlLoaders, configBuilders,new DefaultWireBuilder()); - runtimeContext.start(); - - // Get the system context - AggregateContext systemContext = runtimeContext.getSystemContext(); - - // Load the system module component - ModuleComponentConfigurationLoader loader = new ModuleComponentConfigurationLoaderImpl(modelContext); - ModuleComponent systemModuleComponent = loader.loadSystemModuleComponent(SYSTEM_MODULE_COMPONENT, SYSTEM_MODULE_COMPONENT); - - // Register it with the system context - systemContext.registerModelObject(systemModuleComponent); - - // Get the aggregate context representing the system module component - AggregateContext systemModuleComponentContext = (AggregateContext) systemContext.getContext(SYSTEM_MODULE_COMPONENT); - systemModuleComponentContext.registerModelObject(systemModuleComponent.getComponentImplementation()); - systemModuleComponentContext.fireEvent(EventContext.MODULE_START, null); - - // Load the SCDL configuration of the application module - String uri = context.getPath().substring(1); - ModuleComponent moduleComponent = loader.loadModuleComponent(moduleComponentName, uri); - - // Register it under the root application context - runtimeContext.getRootContext().registerModelObject(moduleComponent); - AggregateContext moduleContext=(AggregateContext)runtimeContext.getContext(moduleComponent.getName()); - moduleContext.registerModelObject(moduleComponent.getComponentImplementation()); - - // Create a Tuscany runtime and store it in the servlet - // context - TuscanyWebAppRuntime tuscanyRuntime = new TuscanyWebAppRuntime(moduleContext); - context.getServletContext().setAttribute(TuscanyWebAppRuntime.class.getName(), tuscanyRuntime); - - // Start the runtime and the module component context - tuscanyRuntime.start(); - try { - //moduleContext.start(); - - moduleContext.fireEvent(EventContext.MODULE_START, null); - - } finally { - tuscanyRuntime.stop(); - } - - // Set up the SCA web app filter and listener - FilterDef def = new FilterDef(); - def.setDescription("SCA Filter"); - def.setFilterClass(TuscanyRequestFilter.class.getName()); - def.setFilterName("__modContext"); - def.setDisplayName("SCA Filter"); - FilterMap map = new FilterMap(); - map.setFilterName("__modContext"); - map.setURLPattern("/*"); - context.addFilterDef(def); - context.addFilterMap(map); - context.addApplicationListener(HTTPSessionExpirationListener.class.getName()); - - } catch (CoreRuntimeException e) { - throw new ServiceRuntimeException(e); - } catch (Exception e) { - throw new ServiceRuntimeException(e); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } else if (Lifecycle.STOP_EVENT.equals(lifecycleEventType) && lifecycleEventSource instanceof Context) { - - // The web app is stopping - Context context = (Context) lifecycleEventSource; - try { - - // Get the tuscany runtime from the servlet context - // If the servlet context contains a tuscany runtime then this is a - // Tuscany app - TuscanyWebAppRuntime tuscanyRuntime = (TuscanyWebAppRuntime) context.getServletContext().getAttribute( - TuscanyWebAppRuntime.class.getName()); - if (tuscanyRuntime != null) { - - // Get the module component name from the servlet context - try { - // Start the runtime - tuscanyRuntime.start(); - try { - // Stop the module context - AggregateContext aggregateContext = tuscanyRuntime.getModuleComponentContext(); - aggregateContext.fireEvent(EventContext.MODULE_STOP, null); - aggregateContext.stop(); - } finally { - - // Stop the runtime - tuscanyRuntime.stop(); - - // Cleanup the servlet context - context.getServletContext().removeAttribute(TuscanyWebAppRuntime.class.getName()); - } - - } catch (Exception e) { - throw new RuntimeException(e); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } - -} diff --git a/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/lifecycle/listener/WebAppLifecycleListener.java b/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/lifecycle/listener/WebAppLifecycleListener.java deleted file mode 100644 index 0e9a80f13d..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/lifecycle/listener/WebAppLifecycleListener.java +++ /dev/null @@ -1,152 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.tomcat.lifecycle.listener; - -import javax.naming.InitialContext; -import javax.naming.NamingException; - -import org.apache.catalina.Context; -import org.apache.catalina.Lifecycle; -import org.apache.catalina.LifecycleEvent; -import org.apache.catalina.LifecycleListener; -import org.apache.catalina.deploy.FilterDef; -import org.apache.catalina.deploy.FilterMap; -import org.apache.tuscany.common.TuscanyRuntimeException; -import org.apache.tuscany.core.config.ConfigurationException; -import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.webapp.HTTPSessionExpirationListener; -import org.apache.tuscany.core.context.webapp.TuscanyRequestFilter; -import org.apache.tuscany.core.context.webapp.TuscanyWebAppRuntime; -import org.apache.tuscany.core.runtime.RuntimeContext; -import org.apache.tuscany.core.runtime.RuntimeMonitor; -import org.apache.tuscany.model.assembly.ModuleComponent; - -/** - * Responsible for initializing web applications as module components in a Tomcat instance. When a web app is being - * loaded in Tomcat, this listener receives a callback to register a corresponding module component and set up the - * appropriate Servlet filters in the web context. - *

- * Note that Tomcat loads this class in the standard (common/lib) classloader even though the context classloader is - * that of the web app being loaded. - */ -public class WebAppLifecycleListener implements LifecycleListener { - - private RuntimeContext runtime; - - private RuntimeMonitor monitor; - - // ---------------------------------- - // Constructors - // ---------------------------------- - - public WebAppLifecycleListener() { - // locate runtime in the global naming context - javax.naming.Context context = null; - try { - context = (javax.naming.Context) (new InitialContext()).lookup("java:/"); - runtime = (RuntimeContext) context.lookup(RuntimeBootstrap.RUNTIME_NAME); - monitor = runtime.getMonitorFactory().getMonitor(RuntimeMonitor.class); - } catch (NamingException e) { - // FIXME need bootstrap logging; - return; - } - } - - /** - * Callback for receiving web application events. When a web app containing an SCA configuration is initialized, a - * module component is created and appropriate SCA filters are set for in the web context. If a web app stop event - * is received, the corresponding module component is deregistered from the system. - */ - public void lifecycleEvent(LifecycleEvent event) { - String lifecycleEventType = event.getType(); - Object lifecycleEventSource = event.getSource(); - - if (Lifecycle.START_EVENT.equals(lifecycleEventType) && lifecycleEventSource instanceof Context) { - // The web app is starting - Context context = (Context) lifecycleEventSource; - String name = context.getPath().substring(1); - try { - ModuleComponent moduleComponent = null;// FIXME runtime.loadModuleComponent(name, "sca.module"); - if (moduleComponent == null) { - return; // not an SCA module component - } - // create the module component - runtime.registerModelObject(moduleComponent); - AggregateContext aggregateContext = (AggregateContext) runtime.getContext(moduleComponent.getName()); - TuscanyWebAppRuntime tuscanyRuntime = new TuscanyWebAppRuntime(aggregateContext); - context.getServletContext().setAttribute(TuscanyWebAppRuntime.class.getName(), tuscanyRuntime); - // Start the runtime and the module component context - tuscanyRuntime.start(); - try { - aggregateContext.start(); - aggregateContext.fireEvent(EventContext.MODULE_START, null); - } finally { - tuscanyRuntime.stop(); - } - // Set up the SCA web app filter and listener - FilterDef def = new FilterDef(); - def.setDescription("SCA Filter"); - def.setFilterClass(TuscanyRequestFilter.class.getName()); - def.setFilterName("__modContext"); - def.setDisplayName("SCA Filter"); - FilterMap map = new FilterMap(); - map.setFilterName("__modContext"); - map.setURLPattern("/*"); - context.addFilterDef(def); - context.addFilterMap(map); - context.addApplicationListener(HTTPSessionExpirationListener.class.getName()); - } catch (ConfigurationException e) { - e.addContextName(name); - monitor.log(e); - return; - } catch (TuscanyRuntimeException e) { - e.addContextName(name); - monitor.log(e); - return; - } - } else if (Lifecycle.STOP_EVENT.equals(lifecycleEventType) && lifecycleEventSource instanceof Context) { - // The web app is stopping - Context context = (Context) lifecycleEventSource; - // Get the tuscany runtime from the servlet context - TuscanyWebAppRuntime tuscanyRuntime = (TuscanyWebAppRuntime) context.getServletContext().getAttribute( - TuscanyWebAppRuntime.class.getName()); - if (tuscanyRuntime == null) { - return; // not an SCA module - } - try { - // Stop the module context - tuscanyRuntime.start(); - AggregateContext aggregateContext = tuscanyRuntime.getModuleComponentContext(); - aggregateContext.fireEvent(EventContext.MODULE_STOP, null); - aggregateContext.stop(); - } catch (TuscanyRuntimeException e) { - monitor.log(e); - } finally { - try { - tuscanyRuntime.stop(); - } catch (TuscanyRuntimeException e) { - monitor.log(e); - } finally { - // Cleanup the servlet context - context.getServletContext().removeAttribute(TuscanyWebAppRuntime.class.getName()); - } - } - - } - } -} diff --git a/tags/java-stable-20060304/sca/tomcat/src/main/resources/org/apache/tuscany/tomcat/LocalStrings.properties b/tags/java-stable-20060304/sca/tomcat/src/main/resources/org/apache/tuscany/tomcat/LocalStrings.properties deleted file mode 100644 index 213545ecee..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/main/resources/org/apache/tuscany/tomcat/LocalStrings.properties +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2006 The Apache Software Foundation or its licensors, as applicable. -# -# 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. - -runtime.loadSystemFailed = Error loading system configuration: -runtime.registerSystemFailed = Error registering system configuration: -runtime.started = Started Tuscany runtime -runtime.stopped = Stopped Tuscany runtime - -tuscanyHost.notContext = Child of a TuscanyHost must be a StandardContext \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/tomcat/src/main/resources/org/apache/tuscany/tomcat/Messages.properties b/tags/java-stable-20060304/sca/tomcat/src/main/resources/org/apache/tuscany/tomcat/Messages.properties deleted file mode 100644 index f926ca6488..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/main/resources/org/apache/tuscany/tomcat/Messages.properties +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable. -# -# 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. -# ==================================================================== -# To code developer: -# Do NOT change the properties between this line and the -# "%%% END OF TRANSLATED PROPERTIES %%%" line. -# Make a new property name, append to the end of the file and change -# the code to use the new property. -# ==================================================================== - -# ===================================================================== -# %%% END OF TRANSLATED PROPERTIES %%% -# ===================================================================== -# NLS_MESSAGEFORMAT_ALL - -SCA_STARTING =Tuscany: Starting SCA runtime. -SCA_STARTED =Tuscany: Started SCA runtime. -SCA_STOPPING =Tuscany: Stopping SCA runtime. -SCA_STOPPED =Tuscany: Stopped SCA runtime. -SCA_STARTING_MODULE =Tuscany: Starting SCA module component {0}. -SCA_LOADED_MODULE =Tuscany: Loaded SCA module {0}. -SCA_STARTED_MODULE =Tuscany: Started SCA module component {0}. -SCA_STOPPING_MODULE =Tuscany: Stopping SCA module component {0}. -SCA_STOPPED_MODULE =Tuscany: Stopped SCA module component {0}. -SCA_START_MODULE_FAILED =Tuscany: Error starting SCA module component {0}: {1}. -SCA_STOP_MODULE_FAILED =Tuscany: Error stopping SCA module component {0}: {1}. -SCA_START_WEBAPP_FAILED =Tuscany: Error starting Web application {0}: {1}. -SCA_STOP_WEBAPP_FAILED =Tuscany: Error stopping Web application {0}: {1}. \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/tomcat/src/test/java/org/apache/tuscany/tomcat/integration/AbstractTomcatTest.java b/tags/java-stable-20060304/sca/tomcat/src/test/java/org/apache/tuscany/tomcat/integration/AbstractTomcatTest.java deleted file mode 100644 index 1e9529b965..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/test/java/org/apache/tuscany/tomcat/integration/AbstractTomcatTest.java +++ /dev/null @@ -1,250 +0,0 @@ -/** - * - * Copyright 2006 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.tomcat.integration; - -import junit.framework.TestCase; -import org.apache.catalina.Host; -import org.apache.catalina.Globals; -import org.apache.catalina.connector.Connector; -import org.apache.catalina.connector.Request; -import org.apache.catalina.connector.Response; -import org.apache.catalina.core.StandardEngine; -import org.apache.catalina.core.ApplicationFilterFactory; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.ByteArrayOutputStream; -import java.io.OutputStream; -import java.util.Map; -import java.util.HashMap; -import java.util.Enumeration; -import java.util.Collections; -import javax.servlet.ServletInputStream; -import javax.servlet.ServletOutputStream; - -/** - * @version $Rev$ $Date$ - */ -public class AbstractTomcatTest extends TestCase { - protected Host host; - protected MockRequest request; - protected MockResponse response; - protected StandardEngine engine; - - protected void setupTomcat(File baseDir, Host host) throws Exception { - File appBase = new File(baseDir, "webapps").getCanonicalFile(); - - // Configure a Tomcat Engine - engine = new StandardEngine(); - engine.setName("Catalina"); - engine.setDefaultHost("localhost"); - engine.setBaseDir(baseDir.getAbsolutePath()); - - this.host = host; - host.setName("localhost"); - host.setAppBase(appBase.getAbsolutePath()); - engine.addChild(host); - - // build a empty request/response - Connector connector = new Connector("HTTP/1.1"); - request = new MockRequest(); - request.setConnector(connector); - response = new MockResponse(); - request.setResponse(response); - request.setMethod("POST"); - request.setScheme("http"); - } - - public static class MockRequest extends Request { - private String method; - private String scheme; - private String requestURI; - private String contentType; - private Map headers = new HashMap(); - private ServletInputStream inputStream; - - public void setScheme(String scheme) { - this.scheme = scheme; - } - - public void setMethod(String method) { - this.method = method; - } - - public void setRequestURI(String requestURI) { - this.requestURI = requestURI; - } - - public String getScheme() { - return scheme; - } - - public String getMethod() { - return method; - } - - public int getServerPort() { - return 80; - } - - public String getServerName() { - return "localhost"; - } - - public String getRequestURI() { - return requestURI; - } - - public void setAttribute(String name, Object value) { - if (name.startsWith("org.apache.tomcat.")) { - return; - } - super.setAttribute(name, value); - } - - public Object getAttribute(String name) { - if (name.equals(Globals.DISPATCHER_TYPE_ATTR)) { - return (dispatcherType == null) - ? ApplicationFilterFactory.REQUEST_INTEGER - : dispatcherType; - } else if (name.equals(Globals.DISPATCHER_REQUEST_PATH_ATTR)) { - return (requestDispatcherPath == null) - ? getRequestPathMB().toString() - : requestDispatcherPath.toString(); - } - - return attributes.get(name); - } - - public String getHeader(String name) { - return headers.get(name); - } - - public Enumeration getHeaderNames() { - return Collections.enumeration(headers.keySet()); - } - - public void setContentType(String contentType) { - this.contentType = contentType; - } - - public String getContentType() { - return contentType; - } - - public ServletInputStream getInputStream() throws IOException { - return inputStream; - } - - public InputStream getStream() { - return inputStream; - } - - public void setStream(ServletInputStream stream) { - inputStream = stream; - } - } - - public static class MockResponse extends Response { - private boolean suspended; - private String contentType; - private int status; - private Map headers = new HashMap(); - private ServletOutputStream outputStream = new MockOutputStream(); - - public boolean isCommitted() { - return false; - } - - public boolean isAppCommitted() { - return false; - } - - public void sendAcknowledgement() { - } - - public void setSuspended(boolean suspended) { - this.suspended = suspended; - } - - public boolean isSuspended() { - return suspended; - } - - public void setStatus(int status, String message) { - this.status = status; - } - - public int getStatus() { - return status; - } - - public void reset() { - } - - public void addHeader(String name, String value) { - headers.put(name, value); - } - - public String[] getHeaderNames() { - return (String[]) headers.keySet().toArray(new String[headers.size()]); - } - - public String getContentType() { - return contentType; - } - - public void setContentType(String contentType) { - this.contentType = contentType; - } - - public OutputStream getStream() { - return outputStream; - } - - public ServletOutputStream getOutputStream() throws IOException { - return outputStream; - } - } - - public static class MockInputStream extends ServletInputStream { - private final byte[] bytes; - private int index; - - public MockInputStream(byte[] bytes) { - this.bytes = bytes; - } - - public int read() throws IOException { - if (index == bytes.length) { - return -1; - } - else { - return bytes[index++]; - } - } - } - - public static class MockOutputStream extends ServletOutputStream { - private ByteArrayOutputStream os = new ByteArrayOutputStream(); - - public void write(int b) throws IOException { - os.write(b); - } - } -} diff --git a/tags/java-stable-20060304/sca/tomcat/src/test/java/org/apache/tuscany/tomcat/integration/TestServlet.java b/tags/java-stable-20060304/sca/tomcat/src/test/java/org/apache/tuscany/tomcat/integration/TestServlet.java deleted file mode 100644 index d81e6cc081..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/test/java/org/apache/tuscany/tomcat/integration/TestServlet.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.tomcat.integration; - -import java.io.IOException; -import javax.servlet.GenericServlet; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.ServletException; - -import org.osoa.sca.ModuleContext; -import org.osoa.sca.CurrentModuleContext; - -import org.apache.tuscany.core.runtime.RuntimeContext; - -/** - * @version $Rev$ $Date$ - */ -public class TestServlet extends GenericServlet { - - public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException { - ModuleContext moduleContext = CurrentModuleContext.getContext(); - if (moduleContext == null) { - throw new ServletException("No module context returned"); - } - String name = moduleContext.getName(); - if (!"testContext".equals(name)) { - throw new ServletException("Invalid module context name: " + name); - } - - Object runtime = getServletContext().getAttribute("org.apache.tuscany.core.runtime.RuntimeContext"); - if (!(runtime instanceof RuntimeContext)) { - throw new ServletException("Runtime not bound to org.apache.tuscany.core.runtime.RuntimeContext"); - } - } -} diff --git a/tags/java-stable-20060304/sca/tomcat/src/test/java/org/apache/tuscany/tomcat/integration/TomcatIntegrationTestCase.java b/tags/java-stable-20060304/sca/tomcat/src/test/java/org/apache/tuscany/tomcat/integration/TomcatIntegrationTestCase.java deleted file mode 100644 index 4c3b1516aa..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/test/java/org/apache/tuscany/tomcat/integration/TomcatIntegrationTestCase.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.tomcat.integration; - -import org.apache.catalina.Valve; -import org.apache.catalina.Loader; -import org.apache.catalina.Wrapper; -import org.apache.catalina.core.StandardContext; -import org.apache.catalina.core.StandardWrapper; -import org.apache.catalina.startup.ContextConfig; -import org.apache.tuscany.tomcat.TuscanyHost; -import org.apache.tuscany.tomcat.TuscanyValve; -import org.apache.tuscany.tomcat.ContainerLoader; - -import java.io.File; - -/** - * @version $Rev$ $Date$ - */ -public class TomcatIntegrationTestCase extends AbstractTomcatTest { - protected File app1; - - public void testComponentIntegration() throws Exception { - // create the webapp Context - StandardContext ctx = new StandardContext(); - ctx.addLifecycleListener(new ContextConfig()); - ctx.setName("testContext"); - ctx.setDocBase(app1.getAbsolutePath()); - - // define our test servlet - Loader loader = new ContainerLoader(TestServlet.class.getClassLoader()); - StandardWrapper wrapper = new StandardWrapper(); - wrapper.setServletClass(TestServlet.class.getName()); - wrapper.setLoader(loader); - ctx.addChild(wrapper); - - host.addChild(ctx); - boolean found = false; - for (Valve valve: ctx.getPipeline().getValves()) { - if (valve instanceof TuscanyValve) { - found = true; - break; - } - } - assertTrue("TuscanyValve not in pipeline", found); - - request.setContext(ctx); - request.setWrapper(wrapper); - host.invoke(request, response); - - host.removeChild(ctx); - } - - public void testWebServiceIntegration() throws Exception { - // create the webapp Context - StandardContext ctx = new StandardContext(); - ctx.addLifecycleListener(new ContextConfig()); - ctx.setName("testContext"); - ctx.setDocBase(app1.getAbsolutePath()); - - host.addChild(ctx); - - Wrapper wrapper = (Wrapper) ctx.findChild("TuscanyAxis2EntryPointServlet"); - assertNotNull("No webservice wrapper present", wrapper); - request.setContext(ctx); - request.setRequestURI("/services/epName"); - request.setWrapper(wrapper); - request.setContentType("text/xml"); - String xml = "\n" + - "\n" + - "\n" + - "hello\n" + - "\n" + - "\n" + - "\n"; - request.setStream(new MockInputStream(xml.getBytes("UTF-8"))); - host.invoke(request, response); - - host.removeChild(ctx); - } - - protected void setUp() throws Exception { - super.setUp(); - app1 = new File(getClass().getResource("/app1").toURI()); - File baseDir = new File(app1, "../../tomcat").getCanonicalFile(); - setupTomcat(baseDir, new TuscanyHost()); - engine.start(); - } - - protected void tearDown() throws Exception { - engine.stop(); - super.tearDown(); - } - -} diff --git a/tags/java-stable-20060304/sca/tomcat/src/test/java/org/apache/tuscany/tomcat/integration/TomcatStandaloneTestCase.java b/tags/java-stable-20060304/sca/tomcat/src/test/java/org/apache/tuscany/tomcat/integration/TomcatStandaloneTestCase.java deleted file mode 100644 index b623b2e7b5..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/test/java/org/apache/tuscany/tomcat/integration/TomcatStandaloneTestCase.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.apache.tuscany.tomcat.integration; - -import org.apache.catalina.core.StandardContext; -import org.apache.catalina.core.StandardWrapper; -import org.apache.catalina.core.StandardHost; -import org.apache.catalina.startup.ContextConfig; -import org.apache.catalina.Valve; -import org.apache.catalina.Wrapper; - -import org.apache.tuscany.tomcat.TuscanyValve; -import org.apache.tuscany.tomcat.TuscanyHost; - -import java.io.File; - -/** - * @version $Rev$ $Date$ - */ -public class TomcatStandaloneTestCase extends AbstractTomcatTest { - protected File app2; - - public void testRuntimeIntegration() throws Exception { - StandardContext ctx = new StandardContext(); - - // caution: this sets the parent of the webapp loader to the test classloader so it can find TestServlet - // anything that relies on the TCCL may not work correctly - ClassLoader cl = TestServlet.class.getClassLoader(); - ctx.setParentClassLoader(cl); - - ctx.addLifecycleListener(new ContextConfig()); - ctx.setName("testContext"); - ctx.setDocBase(app2.getAbsolutePath()); - - host.addChild(ctx); - boolean found = false; - for (Valve valve: ctx.getPipeline().getValves()) { - if (valve instanceof TuscanyValve) { - found = true; - break; - } - } - assertFalse("TuscanyValve in pipeline", found); - - request.setContext(ctx); - request.setWrapper((Wrapper) ctx.findChild("TestServlet")); - host.invoke(request, response); - - host.removeChild(ctx); - } - - protected void setUp() throws Exception { - super.setUp(); - app2 = new File(getClass().getResource("/app2").toURI()); - File baseDir = new File(app2, "../../tomcat").getCanonicalFile(); - setupTomcat(baseDir, new StandardHost()); - engine.start(); - } - - protected void tearDown() throws Exception { - engine.stop(); - super.tearDown(); - } - -} diff --git a/tags/java-stable-20060304/sca/tomcat/src/test/resources/app1/WEB-INF/axis2.xml b/tags/java-stable-20060304/sca/tomcat/src/test/resources/app1/WEB-INF/axis2.xml deleted file mode 100644 index a38cf9864a..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/test/resources/app1/WEB-INF/axis2.xml +++ /dev/null @@ -1,167 +0,0 @@ - - - - - false - false - false - - - - - admin - axis2 - - . - - 127.0.0.1 - 5555 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6060 - - - - - - - - - - - - - - - - - HTTP/1.1 - chunked - - - HTTP/1.1 - chunked - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sca/tomcat/src/test/resources/app1/WEB-INF/classes/sca.module b/tags/java-stable-20060304/sca/tomcat/src/test/resources/app1/WEB-INF/classes/sca.module deleted file mode 100644 index 4273a8171c..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/test/resources/app1/WEB-INF/classes/sca.module +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/tags/java-stable-20060304/sca/tomcat/src/test/resources/app1/WEB-INF/web.xml b/tags/java-stable-20060304/sca/tomcat/src/test/resources/app1/WEB-INF/web.xml deleted file mode 100644 index a363db8e12..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/test/resources/app1/WEB-INF/web.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/tomcat/src/test/resources/app1/index.html b/tags/java-stable-20060304/sca/tomcat/src/test/resources/app1/index.html deleted file mode 100644 index 55ecbd81ba..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/test/resources/app1/index.html +++ /dev/null @@ -1,3 +0,0 @@ - -Hello World - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/tomcat/src/test/resources/app2/WEB-INF/classes/sca.module b/tags/java-stable-20060304/sca/tomcat/src/test/resources/app2/WEB-INF/classes/sca.module deleted file mode 100644 index fd1d63a7a6..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/test/resources/app2/WEB-INF/classes/sca.module +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/tags/java-stable-20060304/sca/tomcat/src/test/resources/app2/WEB-INF/web.xml b/tags/java-stable-20060304/sca/tomcat/src/test/resources/app2/WEB-INF/web.xml deleted file mode 100644 index abf92d4ca7..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/test/resources/app2/WEB-INF/web.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - org.apache.tuscany.core.webapp.ModuleComponentName - testContext - - - org.apache.tuscany.core.webapp.TuscanyServletListener - - - TestServlet - org.apache.tuscany.tomcat.integration.TestServlet - - - TestServlet - /servlet - - - TuscanyFilter - org.apache.tuscany.core.webapp.TuscanyRequestFilter - - - TuscanyFilter - TestServlet - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/tomcat/src/test/resources/app2/index.html b/tags/java-stable-20060304/sca/tomcat/src/test/resources/app2/index.html deleted file mode 100644 index 55ecbd81ba..0000000000 --- a/tags/java-stable-20060304/sca/tomcat/src/test/resources/app2/index.html +++ /dev/null @@ -1,3 +0,0 @@ - -Hello World - \ No newline at end of file diff --git a/tags/java-stable-20060304/sca/tools/LICENSE.txt b/tags/java-stable-20060304/sca/tools/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/tags/java-stable-20060304/sca/tools/LICENSE.txt +++ /dev/null @@ -1,202 +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/tags/java-stable-20060304/sca/tools/pom.xml b/tags/java-stable-20060304/sca/tools/pom.xml deleted file mode 100644 index 5144519d67..0000000000 --- a/tags/java-stable-20060304/sca/tools/pom.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - org.apache.tuscany - tuscany-sca - SNAPSHOT - - 4.0.0 - tuscany-sca-tools - Tuscany SCA Tools - SCA Tools. - SNAPSHOT - - - - jeremy - http://people.apache.org/~jboynes/maven2 - - false - - - - - - - org.apache.tuscany - tuscany-sdo-impl - SNAPSHOT - compile - - - org.apache.tuscany - tuscany-model - SNAPSHOT - compile - - - - org.eclipse.emf - codegen - 2.2.0-I200602160000 - compile - - - - org.eclipse.emf - codegen-ecore - 2.2.0-I200602160000 - compile - - - - axis2 - axis2-core - 0.94 - compile - - - - axis2 - axis2-codegen - 0.94 - compile - - - - axis - axis-wsdl4j - 1.2 - compile - - - - commons-logging - commons-logging - 1.0.4 - compile - - - - log4j - log4j - 1.2.12 - compile - - - - junit - junit - 3.8.1 - test - - - - diff --git a/tags/java-stable-20060304/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceGenerator.java b/tags/java-stable-20060304/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceGenerator.java deleted file mode 100644 index 518f070ce4..0000000000 --- a/tags/java-stable-20060304/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceGenerator.java +++ /dev/null @@ -1,142 +0,0 @@ -/** - * - * Copyright 2005 BEA Systems Inc. - * Copyright 2005 International Business Machines Corporation - * - * 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. - */ -package org.apache.tuscany.tools.wsdl2java.generate; - -import java.io.File; -import java.io.FileOutputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.wsdl.WSDLException; -import javax.xml.namespace.QName; - -import org.apache.axis2.i18n.Messages; -import org.apache.axis2.util.FileWriter; -import org.apache.axis2.wsdl.builder.WOMBuilderFactory; -import org.apache.axis2.wsdl.codegen.CodeGenConfiguration; -import org.apache.axis2.wsdl.codegen.CodeGenerationException; -import org.apache.axis2.wsdl.codegen.emitter.JavaEmitter; -import org.apache.axis2.wsdl.codegen.extension.CodeGenExtension; -import org.apache.axis2.wsdl.codegen.extension.DefaultDatabindingExtension; -import org.apache.axis2.wsdl.codegen.extension.PackageFinder; -import org.apache.axis2.wsdl.codegen.extension.WSDLValidatorExtension; -import org.apache.axis2.wsdl.codegen.writer.InterfaceWriter; -import org.apache.axis2.wsdl.databinding.JavaTypeMapper; -import org.apache.axis2.wsdl.i18n.CodegenMessages; -import org.apache.tuscany.model.util.XMLNameUtil; -import org.apache.wsdl.WSDLDescription; -import org.w3c.dom.Document; - -public class JavaInterfaceGenerator { - - private List codegenExtensions = new ArrayList(); - private CodeGenConfiguration codegenConfiguration; - - public JavaInterfaceGenerator(String uri, String outputLocation, String packageName, Map typeMapping) throws CodeGenerationException { - WSDLDescription wom; - try { - wom = WOMBuilderFactory.getBuilder(org.apache.wsdl.WSDLConstants.WSDL_1_1).build(uri).getDescription(); - } catch (WSDLException e) { - throw new CodeGenerationException(CodegenMessages.getMessage("engine.wsdlParsingException"), e); - } - - if (packageName==null) - packageName=XMLNameUtil.getPackageNameFromNamespace(wom.getTargetNameSpace()); - - JavaTypeMapper typeMapper=new JavaTypeMapper(); - for (Map.Entry e : typeMapping.entrySet() ) { - typeMapper.addTypeMappingName(e.getKey(), e.getValue()); - } - - codegenConfiguration = new CodeGenConfiguration(wom, new HashMap()); - codegenConfiguration.setAdvancedCodeGenEnabled(false); - codegenConfiguration.setAsyncOn(false); - codegenConfiguration.setCodeGenerationStyle(0); - codegenConfiguration.setDatabindingType("sdo"); - codegenConfiguration.setGenerateAll(true); - codegenConfiguration.setGenerateDeployementDescriptor(false); - codegenConfiguration.setOutputLanguage("java"); - codegenConfiguration.setOutputLocation(new File(outputLocation)); - codegenConfiguration.setPackageName(packageName); - codegenConfiguration.setPackClasses(false); - codegenConfiguration.setPolicyMap(new HashMap()); - codegenConfiguration.setPortName(null); - codegenConfiguration.setServerSide(false); - codegenConfiguration.setServiceName(null); - codegenConfiguration.setSyncOn(true); - codegenConfiguration.setTypeMapper(typeMapper); - codegenConfiguration.setWriteMessageReceiver(false); - codegenConfiguration.setWriteTestCase(false); - - addExtension(new WSDLValidatorExtension()); - addExtension(new PackageFinder()); - addExtension(new SDODataBindingCodegenExtension(typeMapper)); - addExtension(new DefaultDatabindingExtension()); - } - - private void addExtension(CodeGenExtension ext) { - ext.init(codegenConfiguration); - codegenExtensions.add(ext); - } - - - public void generate() throws CodeGenerationException { - try { - for (int i = 0; i < codegenExtensions.size(); i++) { - ((CodeGenExtension) codegenExtensions.get(i)).engage(); - } - - class JavaInterfaceEmitter extends JavaEmitter { - - protected void writeInterface(boolean writeDatabinders) throws Exception { - Document interfaceModel = createDOMDocumentForInterface(writeDatabinders); - if (!configuration.getOutputLocation().exists()) { - configuration.getOutputLocation().mkdirs(); - } - InterfaceWriter interfaceWriter = - new InterfaceWriter(this.configuration.getOutputLocation(), - this.configuration.getOutputLanguage()); - - String packageName = interfaceModel.getDocumentElement().getAttribute("package"); - String className = interfaceModel.getDocumentElement().getAttribute("name"); - - System.out.println(">> Generating Java class "+packageName+"."+className); - File outputFile = FileWriter.createClassFile(this.configuration.getOutputLocation(), packageName, className, ".java"); - if (outputFile.exists()) - outputFile.delete(); - - writeClass(interfaceModel, interfaceWriter); - }; - - }; - - JavaInterfaceEmitter emitter=new JavaInterfaceEmitter(); - emitter.setCodeGenConfiguration(codegenConfiguration); - emitter.setMapper(codegenConfiguration.getTypeMapper()); - - emitter.writeInterface(false); - - } catch (Exception e) { - throw new CodeGenerationException(e); - } - } - - -} diff --git a/tags/java-stable-20060304/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingCodegenExtension.java b/tags/java-stable-20060304/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingCodegenExtension.java deleted file mode 100644 index f310fe0f8a..0000000000 --- a/tags/java-stable-20060304/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingCodegenExtension.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * - * Copyright 2005 BEA Systems Inc. - * Copyright 2005 International Business Machines Corporation - * - * 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. - */ -package org.apache.tuscany.tools.wsdl2java.generate; - -import org.apache.axis2.wsdl.codegen.extension.AbstractDBProcessingExtension; -import org.apache.axis2.wsdl.databinding.TypeMapper; - -/** - * SDO data binding codegen extension. - */ -public class SDODataBindingCodegenExtension extends AbstractDBProcessingExtension { - - private TypeMapper typeMapper; - - public SDODataBindingCodegenExtension(TypeMapper typeMapper) { - this.typeMapper=typeMapper; - } - - protected boolean testFallThrough(String dbFrameworkName) { - return !dbFrameworkName.equals("sdo"); - } - - public void engage() { - if (testFallThrough(configuration.getDatabindingType())) { - return; - } - - // Set the type mapper into the config - configuration.setTypeMapper(typeMapper); - - } - -} diff --git a/tags/java-stable-20060304/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGenerator.java b/tags/java-stable-20060304/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGenerator.java deleted file mode 100644 index 0be15181fb..0000000000 --- a/tags/java-stable-20060304/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGenerator.java +++ /dev/null @@ -1,319 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.tools.wsdl2java.generate; - - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.StringTokenizer; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sdo.helper.XSDHelperImpl; -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.eclipse.emf.codegen.ecore.genmodel.GenClass; -import org.eclipse.emf.codegen.ecore.genmodel.GenModel; -import org.eclipse.emf.codegen.ecore.genmodel.GenModelFactory; -import org.eclipse.emf.codegen.ecore.genmodel.GenPackage; -import org.eclipse.emf.codegen.util.CodeGenUtil; -import org.eclipse.emf.common.util.Diagnostic; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EClassifier; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.util.BasicExtendedMetaData; -import org.eclipse.emf.ecore.util.ExtendedMetaData; - -import commonj.sdo.helper.XSDHelper; - - -public class WSDL2JavaGenerator { - - /** - * Generate Java interfaces from WSDL - * - * Usage arguments: - * - * [ -targetDirectory ] - * [ -javaPackage ] - * - * - * For example: - * - * generate somedir/somefile.wsdl - * - * Basic options: - * - * -targetDirectory - * Generates the Java source code in the specified directory. By default, the code is generated - * in the same directory as the input wsdl file. - * -javaPackage - * Overrides the Java package for the generated classes. By default the package name is derived - * from the targetNamespace of the WSDL definition being generated. For example, if the targetNamespace is - * "http://www.example.com/simple", the default package will be "com.example.simple". - */ - public static void main(String args[]) - { - if (args.length == 0) - { - printUsage(); - return; - } - - - String targetDirectory = null; - String wsdlJavaPackage = null; - String xsdJavaPackage = null; - - int genOptions = 0; - - int index = 0; - for (; index < args.length && args[index].startsWith("-"); ++index) - { - if (args[index].equalsIgnoreCase("-targetDirectory")) - { - targetDirectory = args[++index]; - } - else if (args[index].equalsIgnoreCase("-javaPackage")) - { - wsdlJavaPackage = args[++index]; - } - //else if (...) - else - { - printUsage(); - return; - } - } - - String wsdlFileName = args[index]; - if (wsdlFileName==null || targetDirectory==null) { - printUsage(); - return; - } - - generateFromWSDL(wsdlFileName, targetDirectory, wsdlJavaPackage, xsdJavaPackage, 0); - - } - - public static void generateFromWSDL(String wsdlFileName, String targetDirectory, String wsdlJavaPackage, String xsdJavaPackage, int genOptions) - { - DataObjectUtil.initRuntime(); - EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE); - ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(packageRegistry); - XSDHelper xsdHelper = new XSDHelperImpl(extendedMetaData); - - try - { - File inputFile = new File(wsdlFileName).getAbsoluteFile(); - InputStream inputStream = new FileInputStream(inputFile); - xsdHelper.define(inputStream, inputFile.toURI().toString()); - - if (targetDirectory == null) - { - targetDirectory = new File(wsdlFileName).getCanonicalFile().getParent(); - } - else - { - targetDirectory = new File(targetDirectory).getCanonicalPath(); - } - - Map typeMapping=new HashMap(); - if (!packageRegistry.values().isEmpty()) - { - ResourceSet resourceSet = DataObjectUtil.createResourceSet(); - - List genPackages=new ArrayList(); - Map genClasses=new HashMap(); - - for (Iterator iter = packageRegistry.values().iterator(); iter.hasNext();) - { - EPackage currentEPackage = (EPackage)iter.next(); - String currentBasePackage = extractBasePackageName(currentEPackage, xsdJavaPackage); - String currentPrefix = CodeGenUtil.capName(currentEPackage.getName()); - - GenPackage currentGenPackage = createGenPackage(currentEPackage, currentBasePackage, currentPrefix, genOptions, resourceSet); - genPackages.add(currentGenPackage); - for (GenClass genClass : (List)currentGenPackage.getGenClasses()) { - genClasses.put(genClass.getEcoreClass(), genClass); - } - - } - - for (GenPackage currentGenPackage : genPackages) { - EPackage currentEPackage=currentGenPackage.getEcorePackage(); - for (GenClass genClass : (List)currentGenPackage.getGenClasses()) { - QName qname=new QName(extendedMetaData.getNamespace(currentEPackage), extendedMetaData.getName(genClass.getEcoreClass())); - String interfaceName=currentGenPackage.getInterfacePackageName()+'.'+genClass.getInterfaceName(); - typeMapping.put(qname, interfaceName); - } - - EClass documentRoot=extendedMetaData.getDocumentRoot(currentEPackage); - if (documentRoot!=null) { - for (EStructuralFeature element : (List)extendedMetaData.getElements(documentRoot)) { - EClassifier elementType=element.getEType(); - if (extendedMetaData.isAnonymous(elementType)) { - EClass eClass=(EClass)elementType; - EStructuralFeature feature=(EStructuralFeature)eClass.getEStructuralFeatures().get(0); - elementType=feature.getEType(); - } - if (elementType instanceof EClass) { - GenClass genClass=genClasses.get(elementType); - QName qname=new QName(extendedMetaData.getNamespace(currentEPackage), extendedMetaData.getName(element)); - String interfaceName=genClass.getGenPackage().getInterfacePackageName()+'.'+genClass.getInterfaceName(); - typeMapping.put(qname, interfaceName); - } else if (elementType instanceof EClassifier) { - QName qname=new QName(extendedMetaData.getNamespace(currentEPackage), extendedMetaData.getName(element)); - String interfaceName=elementType.getInstanceClass().getName(); - typeMapping.put(qname, interfaceName); - } - } - } - } - } - - try { - JavaInterfaceGenerator codeGenerator=new JavaInterfaceGenerator(wsdlFileName, targetDirectory, wsdlJavaPackage, typeMapping); - codeGenerator.generate(); - } catch (Exception e) { - throw new IllegalArgumentException(e); - } - - } - catch (IOException e) - { - throw new IllegalArgumentException(e); - } - } - - public static GenPackage createGenPackage(EPackage ePackage, String basePackage, String prefix, int genOptions, ResourceSet resourceSet) - { - GenModel genModel = ecore2GenModel(ePackage, basePackage, prefix, genOptions); - - URI ecoreURI = URI.createURI("file:///" + ePackage.getName() + ".ecore"); - URI genModelURI = ecoreURI.trimFileExtension().appendFileExtension("genmodel"); - - Resource ecoreResource = resourceSet.createResource(ecoreURI); - ecoreResource.getContents().add(ePackage); - - Resource genModelResource = resourceSet.createResource(genModelURI); - genModelResource.getContents().add(genModel); - - return (GenPackage)genModel.getGenPackages().get(0); - } - - public static GenModel ecore2GenModel(EPackage ePackage, String basePackage, String prefix, int genOptions) - { - GenModel genModel = GenModelFactory.eINSTANCE.createGenModel(); - genModel.initialize(Collections.singleton(ePackage)); - - genModel.setRootExtendsInterface(""); - genModel.setRootImplementsInterface("commonj.sdo.DataObject"); - genModel.setRootExtendsClass("org.apache.tuscany.sdo.impl.DataObjectImpl"); - genModel.setFeatureMapWrapperInterface("commonj.sdo.Sequence"); - genModel.setFeatureMapWrapperInternalInterface("org.apache.tuscany.sdo.util.BasicSequence"); - genModel.setFeatureMapWrapperClass("org.apache.tuscany.sdo.util.BasicSequence"); - genModel.setSuppressEMFTypes(true); - genModel.setSuppressEMFMetaData(true); - genModel.setSuppressEMFModelTags(true); - genModel.setCanGenerate(true); - //FIXME workaround java.lang.NoClassDefFoundError: org/eclipse/jdt/core/jdom/IDOMNode with 02162006 build - genModel.setFacadeHelperClass("Hack"); - genModel.setForceOverwrite(true); - - GenPackage genPackage = (GenPackage)genModel.getGenPackages().get(0); - - if (basePackage != null) - { - genPackage.setBasePackage(basePackage); - } - if (prefix != null) - { - genPackage.setPrefix(prefix); - } - - return genModel; - } - - public static String extractBasePackageName(EPackage ePackage, String javaPackage) - { - String qualifiedName = javaPackage != null ? javaPackage : ePackage.getName(); - String name = /*CodeGenUtil.*/shortName(qualifiedName); - String baseName = qualifiedName.substring(0, qualifiedName.length() - name.length()); - if (javaPackage != null || !name.equals(qualifiedName)) - { - ePackage.setName(name); - } - return baseName != null ? /*CodeGenUtil.*/safeQualifiedName(baseName) : null; - } - - public static String shortName(String qualifiedName) - { - int index = qualifiedName.lastIndexOf("."); - return index != -1 ? qualifiedName.substring(index + 1) : qualifiedName; - } - - public static String safeQualifiedName(String qualifiedName) - { - StringBuffer safeQualifiedName = new StringBuffer(); - for (StringTokenizer stringTokenizer = new StringTokenizer(qualifiedName, "."); stringTokenizer.hasMoreTokens();) - { - String name = stringTokenizer.nextToken(); - safeQualifiedName.append(CodeGenUtil.safeName(name)); - if (stringTokenizer.hasMoreTokens()) - { - safeQualifiedName.append('.'); - } - } - return safeQualifiedName.toString(); - } - - protected static void printDiagnostic(Diagnostic diagnostic, String indent) - { - System.out.print(indent); - System.out.println(diagnostic.getMessage()); - for (Iterator i = diagnostic.getChildren().iterator(); i.hasNext();) - { - printDiagnostic((Diagnostic)i.next(), indent + " "); - } - } - - protected static void printUsage() - { - System.out.println("Usage arguments:"); - System.out.println(" [ -targetDirectory ]"); - System.out.println(" [ -javaPackage ]"); - System.out.println(" "); - System.out.println(""); - System.out.println("For example:"); - System.out.println(""); - System.out.println(" generate somedir/somefile.wsdl"); - } - -} diff --git a/tags/java-stable-20060304/sdo/impl/LICENSE.txt b/tags/java-stable-20060304/sdo/impl/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/tags/java-stable-20060304/sdo/impl/LICENSE.txt +++ /dev/null @@ -1,202 +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/tags/java-stable-20060304/sdo/impl/model/SDO.ecore b/tags/java-stable-20060304/sdo/impl/model/SDO.ecore deleted file mode 100644 index dce261ecd2..0000000000 --- a/tags/java-stable-20060304/sdo/impl/model/SDO.ecore +++ /dev/null @@ -1,962 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- - - - - -
- - - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - - -
- - - - - -
- - - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - - - -
- - - - - - - -
- - - - - - -
- - - - -
- - - - -
- - - - -
- - - - - -
- - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - - diff --git a/tags/java-stable-20060304/sdo/impl/model/SDO.genmodel b/tags/java-stable-20060304/sdo/impl/model/SDO.genmodel deleted file mode 100644 index d28946204c..0000000000 --- a/tags/java-stable-20060304/sdo/impl/model/SDO.genmodel +++ /dev/null @@ -1,564 +0,0 @@ - - - SDO.mdl - VABASE_PLUGINS_PATH - ../.. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sdo/impl/model/SDO.mdl b/tags/java-stable-20060304/sdo/impl/model/SDO.mdl deleted file mode 100644 index 763c521204..0000000000 --- a/tags/java-stable-20060304/sdo/impl/model/SDO.mdl +++ /dev/null @@ -1,7670 +0,0 @@ - -(object Petal - version 42 - _written "Rose 4.5.8163.3" - charSet 0) - -(object Design "Logical View" - is_unit TRUE - is_loaded TRUE - defaults (object defaults - rightMargin 0.250000 - leftMargin 0.250000 - topMargin 0.250000 - bottomMargin 0.500000 - pageOverlap 0.250000 - clipIconLabels TRUE - autoResize FALSE - snapToGrid TRUE - gridX 16 - gridY 16 - defaultFont (object Font - size 10 - face "Arial" - bold FALSE - italics FALSE - underline FALSE - strike FALSE - color 0 - default_color TRUE) - showMessageNum 1 - showClassOfObject TRUE - notation "Unified") - root_usecase_package (object Class_Category "Use Case View" - quid "3FAA8E8700BE" - exportControl "Public" - global TRUE - logical_models (list unit_reference_list) - logical_presentations (list unit_reference_list - (object UseCaseDiagram "Main" - quid "3FAA8E8700EF" - title "Main" - zoom 100 - max_height 28350 - max_width 21600 - origin_x 0 - origin_y 0 - items (list diagram_item_list)))) - root_category (object Class_Category "Logical View" - quid "3FAA8E8700BD" - exportControl "Public" - global TRUE - subsystem "Component View" - quidu "3FAA8E8700BF" - logical_models (list unit_reference_list - (object Class_Category "sdo" - attributes (list Attribute_Set - (object Attribute - tool "Ecore" - name "nsPrefix" - value "sdo") - (object Attribute - tool "Ecore" - name "nsURI" - value "http://www.apache.org/tuscany/2005/SDO") - (object Attribute - tool "Ecore" - name "basePackage" - value "org.apache.tuscany") - (object Attribute - tool "Ecore" - name "prefix" - value "SDO")) - quid "3FAA8E8B0306" - exportControl "Public" - logical_models (list unit_reference_list - (object Class "ChangeSummary" - quid "3FAB7C360208" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "4361480602D8" - supplier "Logical View::change::ChangeDescription" - quidu "4FAB6F110198")) - operations (list Operations - (object Operation "beginLogging" - quid "3FAB8899003B" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "endLogging" - quid "3FAB88AB0145" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "isCreated" - quid "3FAB89650125" - parameters (list Parameters - (object Parameter "dataObject" - type "DataObject")) - result "boolean" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "isDeleted" - quid "3FAB896F0314" - parameters (list Parameters - (object Parameter "dataObject" - type "DataObject")) - result "boolean" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getOldValues" - quid "3FAB89A4039C" - parameters (list Parameters - (object Parameter "dataObject" - type "DataObject")) - result "EJavaList" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "isModified" - quid "435500FB024C" - parameters (list Parameters - (object Parameter "dataObject" - type "DataObject")) - result "boolean" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getOldValue" - quid "435501180185" - parameters (list Parameters - (object Parameter "dataObject" - type "DataObject") - (object Parameter "property" - type "Property")) - result "ChangeSummarySetting" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getOldContainer" - quid "43550265035B" - parameters (list Parameters - (object Parameter "dataObject" - type "DataObject")) - result "DataObject" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getOldContainmentProperty" - quid "4355027F01D2" - parameters (list Parameters - (object Parameter "dataObject" - type "DataObject")) - result "Property" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getOldSequence" - quid "4355029E03A3" - parameters (list Parameters - (object Parameter "dataObject" - type "DataObject")) - result "Sequence" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "undoChanges" - quid "435502B303D5" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "isLogging" - quid "435D2CB50354" - result "boolean" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getDataGraph" - quid "435D2CC200A0" - result "DataGraph" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getChangedObjects" - quid "435D2D2B001F" - result "EJavaList" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getRootObject" - quid "435D2D360151" - result "DataObject" - concurrency "Sequential" - opExportControl "Public" - uid 0)) - class_attributes (list class_attribute_list - (object ClassAttribute "commonj.sdo.ChangeSummary" - quid "3FAB7C4D0373" - stereotype "javaclass" - exportControl "Public"))) - (object Class "ChangeSummarySetting" - quid "3FAB8BF8005A" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "436134F001A6" - supplier "Logical View::change::FeatureChange" - quidu "4FC39D6D0177")) - operations (list Operations - (object Operation "isSet" - quid "3FD14B5800BD" - result "boolean" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getValue" - quid "3FDEF80600EA" - result "EJavaObject" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getProperty" - quid "435D2C440045" - result "Property" - concurrency "Sequential" - opExportControl "Public" - uid 0)) - class_attributes (list class_attribute_list - (object ClassAttribute "commonj.sdo.ChangeSummary$Setting" - quid "3FAB8C05003A" - stereotype "javaclass" - exportControl "Public"))) - (object Class "DataGraph" - quid "3FAB7BFE03C0" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "43612C7B0243" - supplier "Logical View::ecore::EObject" - quidu "3C4F1C860123")) - operations (list Operations - (object Operation "createRootObject" - quid "3FAB86D40102" - parameters (list Parameters - (object Parameter "namespaceURI" - type "String") - (object Parameter "typeName" - type "String")) - result "DataObject" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "createRootObject" - quid "3FAB87520135" - parameters (list Parameters - (object Parameter "type" - type "Type")) - result "DataObject" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getType" - quid "3FAB87E20024" - parameters (list Parameters - (object Parameter "namespaceURI" - type "String") - (object Parameter "typeName" - type "String")) - result "Type" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getRootObject" - quid "435D2C900120" - result "DataObject" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getChangeSummary" - quid "435D2C9B039D" - result "ChangeSummary" - concurrency "Sequential" - opExportControl "Public" - uid 0)) - class_attributes (list class_attribute_list - (object ClassAttribute "commonj.sdo.DataGraph" - quid "3FAB7C1A0171" - stereotype "javaclass" - exportControl "Public") - (object ClassAttribute "resourceSet" - attributes (list Attribute_Set - (object Attribute - tool "Ecore" - name "isTransient" - value TRUE)) - quid "436129AF0208" - type "EResourceSet" - exportControl "Public") - (object ClassAttribute "rootResource" - attributes (list Attribute_Set - (object Attribute - tool "Ecore" - name "isTransient" - value TRUE) - (object Attribute - tool "Ecore" - name "isVolatile" - value TRUE) - (object Attribute - tool "Ecore" - name "isChangeable" - value FALSE)) - quid "436129BF0016" - type "EResource" - exportControl "Public" - derived TRUE))) - (object Class "DataObject" - quid "3FAB6F7501C4" - operations (list Operations - (object Operation "get" - quid "3FAB8EF201A0" - parameters (list Parameters - (object Parameter "path" - type "String")) - result "EJavaObject" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.get(this, path);") - opExportControl "Public" - uid 0) - (object Operation "set" - quid "3FAB8FE502FE" - parameters (list Parameters - (object Parameter "path" - type "String") - (object Parameter "value" - type "EJavaObject")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.set(this, path, value);") - opExportControl "Public" - uid 0) - (object Operation "isSet" - quid "3FAB901001BF" - parameters (list Parameters - (object Parameter "path" - type "String")) - result "boolean" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.isSet(this, path);") - opExportControl "Public" - uid 0) - (object Operation "unset" - quid "3FAB901803B6" - parameters (list Parameters - (object Parameter "path" - type "String")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.unset(this, path);") - opExportControl "Public" - uid 0) - (object Operation "get" - quid "01EDEDEDEDED" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int")) - result "EJavaObject" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.get(this, propertyIndex);") - opExportControl "Public" - uid 0) - (object Operation "set" - quid "02EDEDEDEDED" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int") - (object Parameter "value" - type "EJavaObject")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.set(this, propertyIndex, value);") - opExportControl "Public" - uid 0) - (object Operation "isSet" - quid "03EDEDEDEDED" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int")) - result "boolean" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.isSet(this, propertyIndex);") - opExportControl "Public" - uid 0) - (object Operation "unset" - quid "04EDEDEDEDED" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.unset(this, propertyIndex);") - opExportControl "Public" - uid 0) - (object Operation "get" - quid "01ADEDEDEDED" - parameters (list Parameters - (object Parameter "property" - type "Property")) - result "EJavaObject" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.get(this, property);") - opExportControl "Public" - uid 0) - (object Operation "set" - quid "02ADEDEDEDED" - parameters (list Parameters - (object Parameter "property" - type "Property") - (object Parameter "value" - type "EJavaObject")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.set(this, property, value);") - opExportControl "Public" - uid 0) - (object Operation "isSet" - quid "03ADEDEDEDED" - parameters (list Parameters - (object Parameter "property" - type "Property")) - result "boolean" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.isSet(this, property);") - opExportControl "Public" - uid 0) - (object Operation "unset" - quid "04ADEDEDEDED" - parameters (list Parameters - (object Parameter "property" - type "Property")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.unset(this, property);") - opExportControl "Public" - uid 0) - (object Operation "getContainer" - quid "AAEDEDEDEDE0" - result "DataObject" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getContainer(this);") - opExportControl "Public" - uid 0) - (object Operation "getContainmentProperty" - quid "AAEDEDEDEDE2" - result "Property" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getContainmentProperty(this);") - opExportControl "Public" - uid 0) - (object Operation "getDataGraph" - quid "AAEDEDEDEDE3" - result "DataGraph" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getDataGraph(this);") - opExportControl "Public" - uid 0) - (object Operation "getType" - quid "AAEDEDEDEDE1" - result "Type" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getType(this);") - opExportControl "Public" - uid 0) - (object Operation "getBigDecimal" - quid "EDEDEDED0000" - parameters (list Parameters - (object Parameter "path" - type "String")) - result "EBigDecimal" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getBigDecimal(this, path);") - opExportControl "Public" - uid 0) - (object Operation "getBigInteger" - quid "EDEDEDED0001" - parameters (list Parameters - (object Parameter "path" - type "String")) - result "EBigInteger" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getBigInteger(this, path);") - opExportControl "Public" - uid 0) - (object Operation "getBoolean" - quid "EDEDEDED0002" - parameters (list Parameters - (object Parameter "path" - type "String")) - result "boolean" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getBoolean(this, path);") - opExportControl "Public" - uid 0) - (object Operation "getByte" - quid "EDEDEDED0003" - parameters (list Parameters - (object Parameter "path" - type "String")) - result "byte" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getByte(this, path);") - opExportControl "Public" - uid 0) - (object Operation "getBytes" - quid "EDEDEDED0004" - parameters (list Parameters - (object Parameter "path" - type "String")) - result "EByteArray" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getBytes(this, path);") - opExportControl "Public" - uid 0) - (object Operation "getChar" - quid "EDEDEDED0005" - parameters (list Parameters - (object Parameter "path" - type "String")) - result "char" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getChar(this, path);") - opExportControl "Public" - uid 0) - (object Operation "getDataObject" - quid "EDEDEDED0006" - parameters (list Parameters - (object Parameter "path" - type "String")) - result "DataObject" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getDataObject(this, path);") - opExportControl "Public" - uid 0) - (object Operation "getDate" - quid "EDEDEDED0007" - parameters (list Parameters - (object Parameter "path" - type "String")) - result "EDate" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getDate(this, path);") - opExportControl "Public" - uid 0) - (object Operation "getDouble" - quid "EDEDEDED0008" - parameters (list Parameters - (object Parameter "path" - type "String")) - result "double" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getDouble(this, path);") - opExportControl "Public" - uid 0) - (object Operation "getFloat" - quid "EDEDEDED0009" - parameters (list Parameters - (object Parameter "path" - type "String")) - result "float" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getFloat(this, path);") - opExportControl "Public" - uid 0) - (object Operation "getInt" - quid "EDEDEDED000A" - parameters (list Parameters - (object Parameter "path" - type "String")) - result "int" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getInt(this, path);") - opExportControl "Public" - uid 0) - (object Operation "getList" - quid "EDEDEDED000B" - parameters (list Parameters - (object Parameter "path" - type "String")) - result "EJavaList" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getList(this, path);") - opExportControl "Public" - uid 0) - (object Operation "getLong" - quid "EDEDEDED000C" - parameters (list Parameters - (object Parameter "path" - type "String")) - result "long" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getLong(this, path);") - opExportControl "Public" - uid 0) - (object Operation "getSequence" - quid "EDEDEDED000D" - parameters (list Parameters - (object Parameter "path" - type "String")) - result "Sequence" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getSequence(this, path);") - opExportControl "Public" - uid 0) - (object Operation "getShort" - quid "EDEDEDED000E" - parameters (list Parameters - (object Parameter "path" - type "String")) - result "short" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getShort(this, path);") - opExportControl "Public" - uid 0) - (object Operation "getString" - quid "EDEDEDED000F" - parameters (list Parameters - (object Parameter "path" - type "String")) - result "String" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getString(this, path);") - opExportControl "Public" - uid 0) - (object Operation "setBigDecimal" - quid "EDEDEDED1000" - parameters (list Parameters - (object Parameter "path" - type "String") - (object Parameter "value" - type "EBigDecimal")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setBigDecimal(this, path, value);") - opExportControl "Public" - uid 0) - (object Operation "setBigInteger" - quid "EDEDEDED1001" - parameters (list Parameters - (object Parameter "path" - type "String") - (object Parameter "value" - type "EBigInteger")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setBigInteger(this, path, value);") - opExportControl "Public" - uid 0) - (object Operation "setBoolean" - quid "EDEDEDED1002" - parameters (list Parameters - (object Parameter "path" - type "String") - (object Parameter "value" - type "boolean")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setBoolean(this, path, value);") - opExportControl "Public" - uid 0) - (object Operation "setByte" - quid "EDEDEDED1003" - parameters (list Parameters - (object Parameter "path" - type "String") - (object Parameter "value" - type "byte")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setByte(this, path, value);") - opExportControl "Public" - uid 0) - (object Operation "setBytes" - quid "EDEDEDED1004" - parameters (list Parameters - (object Parameter "path" - type "String") - (object Parameter "value" - type "EByteArray")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setBytes(this, path, value);") - opExportControl "Public" - uid 0) - (object Operation "setChar" - quid "EDEDEDED1005" - parameters (list Parameters - (object Parameter "path" - type "String") - (object Parameter "value" - type "char")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setChar(this, path, value);") - opExportControl "Public" - uid 0) - (object Operation "setDataObject" - quid "EDEDEDED1006" - parameters (list Parameters - (object Parameter "path" - type "String") - (object Parameter "value" - type "DataObject")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setDataObject(this, path, value);") - opExportControl "Public" - uid 0) - (object Operation "setDate" - quid "EDEDEDED1007" - parameters (list Parameters - (object Parameter "path" - type "String") - (object Parameter "value" - type "EDate")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setDate(this, path, value);") - opExportControl "Public" - uid 0) - (object Operation "setDouble" - quid "EDEDEDED1008" - parameters (list Parameters - (object Parameter "path" - type "String") - (object Parameter "value" - type "double")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setDouble(this, path, value);") - opExportControl "Public" - uid 0) - (object Operation "setFloat" - quid "EDEDEDED1009" - parameters (list Parameters - (object Parameter "path" - type "String") - (object Parameter "value" - type "float")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setFloat(this, path, value);") - opExportControl "Public" - uid 0) - (object Operation "setInt" - quid "EDEDEDED100A" - parameters (list Parameters - (object Parameter "path" - type "String") - (object Parameter "value" - type "int")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setInt(this, path, value);") - opExportControl "Public" - uid 0) - (object Operation "setList" - quid "EDEDEDED100B" - parameters (list Parameters - (object Parameter "path" - type "String") - (object Parameter "value" - type "EJavaList")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setList(this, path, value);") - opExportControl "Public" - uid 0) - (object Operation "setLong" - quid "EDEDEDED100C" - parameters (list Parameters - (object Parameter "path" - type "String") - (object Parameter "value" - type "long")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setLong(this, path, value);") - opExportControl "Public" - uid 0) - (object Operation "setShort" - quid "EDEDEDED100E" - parameters (list Parameters - (object Parameter "path" - type "String") - (object Parameter "value" - type "short")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setShort(this, path, value);") - opExportControl "Public" - uid 0) - (object Operation "setString" - quid "EDEDEDED100F" - parameters (list Parameters - (object Parameter "path" - type "String") - (object Parameter "value" - type "String")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setString(this, path, value);") - opExportControl "Public" - uid 0) - (object Operation "getBigDecimal" - quid "EDEDEDED2000" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int")) - result "EBigDecimal" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getBigDecimal(this, propertyIndex);") - opExportControl "Public" - uid 0) - (object Operation "getBigInteger" - quid "EDEDEDED2001" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int")) - result "EBigInteger" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getBigInteger(this, propertyIndex);") - opExportControl "Public" - uid 0) - (object Operation "getBoolean" - quid "EDEDEDED2002" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int")) - result "boolean" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getBoolean(this, propertyIndex);") - opExportControl "Public" - uid 0) - (object Operation "getByte" - quid "EDEDEDED2003" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int")) - result "byte" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getByte(this, propertyIndex);") - opExportControl "Public" - uid 0) - (object Operation "getBytes" - quid "EDEDEDED2004" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int")) - result "EByteArray" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getBytes(this, propertyIndex);") - opExportControl "Public" - uid 0) - (object Operation "getChar" - quid "EDEDEDED2005" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int")) - result "char" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getChar(this, propertyIndex);") - opExportControl "Public" - uid 0) - (object Operation "getDataObject" - quid "EDEDEDED2006" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int")) - result "DataObject" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getDataObject(this, propertyIndex);") - opExportControl "Public" - uid 0) - (object Operation "getDate" - quid "EDEDEDED2007" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int")) - result "EDate" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getDate(this, propertyIndex);") - opExportControl "Public" - uid 0) - (object Operation "getDouble" - quid "EDEDEDED2008" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int")) - result "double" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getDouble(this, propertyIndex);") - opExportControl "Public" - uid 0) - (object Operation "getFloat" - quid "EDEDEDED2009" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int")) - result "float" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getFloat(this, propertyIndex);") - opExportControl "Public" - uid 0) - (object Operation "getInt" - quid "EDEDEDED200A" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int")) - result "int" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getInt(this, propertyIndex);") - opExportControl "Public" - uid 0) - (object Operation "getList" - quid "EDEDEDED200B" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int")) - result "EJavaList" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getList(this, propertyIndex);") - opExportControl "Public" - uid 0) - (object Operation "getLong" - quid "EDEDEDED200C" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int")) - result "long" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getLong(this, propertyIndex);") - opExportControl "Public" - uid 0) - (object Operation "getSequence" - quid "EDEDEDED200D" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int")) - result "Sequence" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getSequence(this, propertyIndex);") - opExportControl "Public" - uid 0) - (object Operation "getShort" - quid "EDEDEDED200E" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int")) - result "short" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getShort(this, propertyIndex);") - opExportControl "Public" - uid 0) - (object Operation "getString" - quid "EDEDEDED200F" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int")) - result "String" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getString(this, propertyIndex);") - opExportControl "Public" - uid 0) - (object Operation "setBigDecimal" - quid "EDEDEDED3000" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int") - (object Parameter "value" - type "EBigDecimal")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setBigDecimal(this, propertyIndex, value);") - opExportControl "Public" - uid 0) - (object Operation "setBigInteger" - quid "EDEDEDED3001" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int") - (object Parameter "value" - type "EBigInteger")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setBigInteger(this, propertyIndex, value);") - opExportControl "Public" - uid 0) - (object Operation "setBoolean" - quid "EDEDEDED3002" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int") - (object Parameter "value" - type "boolean")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setBoolean(this, propertyIndex, value);") - opExportControl "Public" - uid 0) - (object Operation "setByte" - quid "EDEDEDED3003" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int") - (object Parameter "value" - type "byte")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setByte(this, propertyIndex, value);") - opExportControl "Public" - uid 0) - (object Operation "setBytes" - quid "EDEDEDED3004" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int") - (object Parameter "value" - type "EByteArray")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setBytes(this, propertyIndex, value);") - opExportControl "Public" - uid 0) - (object Operation "setChar" - quid "EDEDEDED3005" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int") - (object Parameter "value" - type "char")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setChar(this, propertyIndex, value);") - opExportControl "Public" - uid 0) - (object Operation "setDataObject" - quid "EDEDEDED3006" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int") - (object Parameter "value" - type "DataObject")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setDataObject(this, propertyIndex, value);") - opExportControl "Public" - uid 0) - (object Operation "setDate" - quid "EDEDEDED3007" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int") - (object Parameter "value" - type "EDate")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setDate(this, propertyIndex, value);") - opExportControl "Public" - uid 0) - (object Operation "setDouble" - quid "EDEDEDED3008" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int") - (object Parameter "value" - type "double")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setDouble(this, propertyIndex, value);") - opExportControl "Public" - uid 0) - (object Operation "setFloat" - quid "EDEDEDED3009" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int") - (object Parameter "value" - type "float")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setFloat(this, propertyIndex, value);") - opExportControl "Public" - uid 0) - (object Operation "setInt" - quid "EDEDEDED300A" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int") - (object Parameter "value" - type "int")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setInt(this, propertyIndex, value);") - opExportControl "Public" - uid 0) - (object Operation "setList" - quid "EDEDEDED300B" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int") - (object Parameter "value" - type "EJavaList")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setList(this, propertyIndex, value);") - opExportControl "Public" - uid 0) - (object Operation "setLong" - quid "EDEDEDED300C" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int") - (object Parameter "value" - type "long")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setLong(this, propertyIndex, value);") - opExportControl "Public" - uid 0) - (object Operation "setShort" - quid "EDEDEDED300E" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int") - (object Parameter "value" - type "short")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setShort(this, propertyIndex, value);") - opExportControl "Public" - uid 0) - (object Operation "setString" - quid "EDEDEDED300F" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int") - (object Parameter "value" - type "String")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setString(this, propertyIndex, value);") - opExportControl "Public" - uid 0) - (object Operation "getBigDecimal" - quid "EDEDEEEE2000" - parameters (list Parameters - (object Parameter "property" - type "Property")) - result "EBigDecimal" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getBigDecimal(this, property);") - opExportControl "Public" - uid 0) - (object Operation "getBigInteger" - quid "EDEDEEEE2001" - parameters (list Parameters - (object Parameter "property" - type "Property")) - result "EBigInteger" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getBigInteger(this, property);") - opExportControl "Public" - uid 0) - (object Operation "getBoolean" - quid "EDEDEEEE2002" - parameters (list Parameters - (object Parameter "property" - type "Property")) - result "boolean" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getBoolean(this, property);") - opExportControl "Public" - uid 0) - (object Operation "getByte" - quid "EDEDEEEE2003" - parameters (list Parameters - (object Parameter "property" - type "Property")) - result "byte" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getByte(this, property);") - opExportControl "Public" - uid 0) - (object Operation "getBytes" - quid "EDEDEEEE2004" - parameters (list Parameters - (object Parameter "property" - type "Property")) - result "EByteArray" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getBytes(this, property);") - opExportControl "Public" - uid 0) - (object Operation "getChar" - quid "EDEDEEEE2005" - parameters (list Parameters - (object Parameter "property" - type "Property")) - result "char" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getChar(this, property);") - opExportControl "Public" - uid 0) - (object Operation "getDataObject" - quid "EDEDEEEE2006" - parameters (list Parameters - (object Parameter "property" - type "Property")) - result "DataObject" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getDataObject(this, property);") - opExportControl "Public" - uid 0) - (object Operation "getDate" - quid "EDEDEEEE2007" - parameters (list Parameters - (object Parameter "property" - type "Property")) - result "EDate" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getDate(this, property);") - opExportControl "Public" - uid 0) - (object Operation "getDouble" - quid "EDEDEEEE2008" - parameters (list Parameters - (object Parameter "property" - type "Property")) - result "double" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getDouble(this, property);") - opExportControl "Public" - uid 0) - (object Operation "getFloat" - quid "EDEDEEEE2009" - parameters (list Parameters - (object Parameter "property" - type "Property")) - result "float" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getFloat(this, property);") - opExportControl "Public" - uid 0) - (object Operation "getInt" - quid "EDEDEEEE200A" - parameters (list Parameters - (object Parameter "property" - type "Property")) - result "int" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getInt(this, property);") - opExportControl "Public" - uid 0) - (object Operation "getList" - quid "EDEDEEEE200B" - parameters (list Parameters - (object Parameter "property" - type "Property")) - result "EJavaList" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getList(this, property);") - opExportControl "Public" - uid 0) - (object Operation "getLong" - quid "EDEDEEEE200C" - parameters (list Parameters - (object Parameter "property" - type "Property")) - result "long" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getLong(this, property);") - opExportControl "Public" - uid 0) - (object Operation "getSequence" - quid "EDEDEEEE200D" - parameters (list Parameters - (object Parameter "property" - type "Property")) - result "Sequence" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getSequence(this, property);") - opExportControl "Public" - uid 0) - (object Operation "getShort" - quid "EDEDEEEE200E" - parameters (list Parameters - (object Parameter "property" - type "Property")) - result "short" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getShort(this, property);") - opExportControl "Public" - uid 0) - (object Operation "getString" - quid "EDEDEEEE200F" - parameters (list Parameters - (object Parameter "property" - type "Property")) - result "String" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getString(this, property);") - opExportControl "Public" - uid 0) - (object Operation "setBigDecimal" - quid "EDEDEEEE3000" - parameters (list Parameters - (object Parameter "property" - type "Property") - (object Parameter "value" - type "EBigDecimal")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setBigDecimal(this, property, value);") - opExportControl "Public" - uid 0) - (object Operation "setBigInteger" - quid "EDEDEEEE3001" - parameters (list Parameters - (object Parameter "property" - type "Property") - (object Parameter "value" - type "EBigInteger")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setBigInteger(this, property, value);") - opExportControl "Public" - uid 0) - (object Operation "setBoolean" - quid "EDEDEEEE3002" - parameters (list Parameters - (object Parameter "property" - type "Property") - (object Parameter "value" - type "boolean")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setBoolean(this, property, value);") - opExportControl "Public" - uid 0) - (object Operation "setByte" - quid "EDEDEEEE3003" - parameters (list Parameters - (object Parameter "property" - type "Property") - (object Parameter "value" - type "byte")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setByte(this, property, value);") - opExportControl "Public" - uid 0) - (object Operation "setBytes" - quid "EDEDEEEE3004" - parameters (list Parameters - (object Parameter "property" - type "Property") - (object Parameter "value" - type "EByteArray")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setBytes(this, property, value);") - opExportControl "Public" - uid 0) - (object Operation "setChar" - quid "EDEDEEEE3005" - parameters (list Parameters - (object Parameter "property" - type "Property") - (object Parameter "value" - type "char")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setChar(this, property, value);") - opExportControl "Public" - uid 0) - (object Operation "setDataObject" - quid "EDEDEEEE3006" - parameters (list Parameters - (object Parameter "property" - type "Property") - (object Parameter "value" - type "DataObject")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setDataObject(this, property, value);") - opExportControl "Public" - uid 0) - (object Operation "setDate" - quid "EDEDEEEE3007" - parameters (list Parameters - (object Parameter "property" - type "Property") - (object Parameter "value" - type "EDate")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setDate(this, property, value);") - opExportControl "Public" - uid 0) - (object Operation "setDouble" - quid "EDEDEEEE3008" - parameters (list Parameters - (object Parameter "property" - type "Property") - (object Parameter "value" - type "double")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setDouble(this, property, value);") - opExportControl "Public" - uid 0) - (object Operation "setFloat" - quid "EDEDEEEE3009" - parameters (list Parameters - (object Parameter "property" - type "Property") - (object Parameter "value" - type "float")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setFloat(this, property, value);") - opExportControl "Public" - uid 0) - (object Operation "setInt" - quid "EDEDEEEE300A" - parameters (list Parameters - (object Parameter "property" - type "Property") - (object Parameter "value" - type "int")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setInt(this, property, value);") - opExportControl "Public" - uid 0) - (object Operation "setList" - quid "EDEDEEEE300B" - parameters (list Parameters - (object Parameter "property" - type "Property") - (object Parameter "value" - type "EJavaList")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setList(this, property, value);") - opExportControl "Public" - uid 0) - (object Operation "setLong" - quid "EDEDEEEE300C" - parameters (list Parameters - (object Parameter "property" - type "Property") - (object Parameter "value" - type "long")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setLong(this, property, value);") - opExportControl "Public" - uid 0) - (object Operation "setShort" - quid "EDEDEEEE300E" - parameters (list Parameters - (object Parameter "property" - type "Property") - (object Parameter "value" - type "short")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setShort(this, property, value);") - opExportControl "Public" - uid 0) - (object Operation "setString" - quid "EDEDEEEE300F" - parameters (list Parameters - (object Parameter "property" - type "Property") - (object Parameter "value" - type "String")) - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.setString(this, property, value);") - opExportControl "Public" - uid 0) - (object Operation "createDataObject" - quid "EDEDEEEEEEE0" - parameters (list Parameters - (object Parameter "propertyName" - type "String")) - result "DataObject" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, propertyName);") - opExportControl "Public" - uid 0) - (object Operation "createDataObject" - quid "EDEDEEEEEEE1" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int")) - result "DataObject" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, propertyIndex);") - opExportControl "Public" - uid 0) - (object Operation "createDataObject" - quid "EDEDEEEEEEE2" - parameters (list Parameters - (object Parameter "property" - type "Property")) - result "DataObject" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, property);") - opExportControl "Public" - uid 0) - (object Operation "createDataObject" - quid "EDEDEEEEEEE3" - parameters (list Parameters - (object Parameter "propertyName" - type "String") - (object Parameter "namespaceURI" - type "String") - (object Parameter "typeName" - type "String")) - result "DataObject" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, propertyName, namespaceURI, typeName);") - opExportControl "Public" - uid 0) - (object Operation "createDataObject" - quid "EDEDEEEEEEE4" - parameters (list Parameters - (object Parameter "propertyIndex" - type "int") - (object Parameter "namespaceURI" - type "String") - (object Parameter "typeName" - type "String")) - result "DataObject" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, propertyIndex, namespaceURI, typeName);") - opExportControl "Public" - uid 0) - (object Operation "createDataObject" - quid "EDEDEEEEEEE5" - parameters (list Parameters - (object Parameter "property" - type "Property") - (object Parameter "type" - type "Type")) - result "DataObject" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, property, type);") - opExportControl "Public" - uid 0) - (object Operation "delete" - quid "EDEDEEEEEEE6" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.delete(this);") - opExportControl "Public" - uid 0) - (object Operation "getSequence" - quid "4354FB2702D3" - result "Sequence" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getSequence(this);") - opExportControl "Public" - uid 0) - (object Operation "getInstanceProperties" - quid "4354FB9F00CC" - result "EJavaList" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getInstanceProperties(this);") - opExportControl "Public" - uid 0) - (object Operation "getProperty" - quid "4354FBB20369" - parameters (list Parameters - (object Parameter "propertyName" - type "String")) - result "Property" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getProperty(this, propertyName);") - opExportControl "Public" - uid 0) - (object Operation "getRootObject" - quid "4354FBDD01B2" - result "DataObject" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getRootObject(this);") - opExportControl "Public" - uid 0) - (object Operation "getChangeSummary" - quid "4354FC0400F0" - result "ChangeSummary" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "return <%org.apache.sdo.util.SDOUtil%>.getChangeSummary(this);") - opExportControl "Public" - uid 0) - (object Operation "detach" - quid "4354FC150068" - concurrency "Sequential" - semantics (object Semantic_Info - PDL "<%org.apache.sdo.util.SDOUtil%>.detach(this);") - opExportControl "Public" - uid 0)) - class_attributes (list class_attribute_list - (object ClassAttribute "commonj.sdo.DataObject" - quid "3FAB6F8B0284" - stereotype "javaclass" - exportControl "Public")) - abstract TRUE) - (object Class "Property" - quid "3FAB7CA1031A" - stereotype "Interface" - operations (list Operations - (object Operation "getName" - quid "4357B5A1009C" - result "String" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getType" - quid "4358FF1A0291" - result "Type" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "isMany" - quid "4357B64B019A" - result "boolean" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "isContainment" - quid "4357B76501FA" - result "boolean" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "isReadOnly" - quid "4358FF3501DC" - result "boolean" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getContainingType" - quid "4358FF3C03D1" - result "Type" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getAliasNames" - quid "4358FF4D02EF" - result "EJavaList" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getOpposite" - quid "4358FF59013D" - result "Property" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getDefault" - quid "4358FF66029B" - result "EJavaObject" - concurrency "Sequential" - opExportControl "Public" - uid 0)) - class_attributes (list class_attribute_list - (object ClassAttribute "commonj.sdo.Property" - quid "3FAB7CAB00E4" - stereotype "javaclass" - exportControl "Public"))) - (object Class "Sequence" - quid "3FAB7CC302B5" - stereotype "Interface" - operations (list Operations - (object Operation "size" - quid "3FD1F958017D" - result "int" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getProperty" - quid "3FAC32F4028D" - parameters (list Parameters - (object Parameter "index" - type "int")) - result "Property" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getValue" - quid "3FAC3318010E" - parameters (list Parameters - (object Parameter "index" - type "int")) - result "EJavaObject" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "setValue" - quid "3FAC33270259" - parameters (list Parameters - (object Parameter "index" - type "int") - (object Parameter "value" - type "EJavaObject")) - result "EJavaObject" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "add" - quid "3FAC333D017C" - parameters (list Parameters - (object Parameter "propertyName" - type "String") - (object Parameter "value" - type "EJavaObject")) - result "boolean" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "add" - quid "3FAC3371009F" - parameters (list Parameters - (object Parameter "propertIndex" - type "int") - (object Parameter "value" - type "EJavaObject")) - result "boolean" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "add" - quid "3FAC338C00CE" - parameters (list Parameters - (object Parameter "property" - type "Property") - (object Parameter "value" - type "EJavaObject")) - result "boolean" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "add" - quid "3FAC33AD02C6" - parameters (list Parameters - (object Parameter "index" - type "int") - (object Parameter "propertyName" - type "String") - (object Parameter "value" - type "EJavaObject")) - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "add" - quid "3FAC33C40263" - parameters (list Parameters - (object Parameter "index" - type "int") - (object Parameter "propertyIndex" - type "int") - (object Parameter "value" - type "EJavaObject")) - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "add" - quid "3FAC33C70375" - parameters (list Parameters - (object Parameter "index" - type "int") - (object Parameter "property" - type "Property") - (object Parameter "value" - type "EJavaObject")) - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "add" - quid "43550F7D01DE" - parameters (list Parameters - (object Parameter "text" - type "String")) - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "add" - quid "43550F930352" - parameters (list Parameters - (object Parameter "index" - type "int") - (object Parameter "text" - type "String")) - concurrency "Sequential" - opExportControl "Public" - uid 0)) - class_attributes (list class_attribute_list - (object ClassAttribute "commonj.sdo.Sequence" - quid "3FAB7CEB00D2" - stereotype "javaclass" - exportControl "Public"))) - (object Class "Type" - quid "3FAB7C7C0349" - stereotype "Interface" - operations (list Operations - (object Operation "getName" - quid "4357B56E012E" - result "String" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getURI" - quid "4358FE18013C" - result "String" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getInstanceClass" - quid "4357B6380265" - result "EJavaClass" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "isInstance" - quid "3FAB82AD0027" - parameters (list Parameters - (object Parameter "object" - type "EJavaObject")) - result "boolean" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "isDataType" - quid "4358FE26031D" - result "boolean" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "isSequenced" - quid "4358FE33020D" - result "boolean" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "isOpen" - quid "4358FE4000F3" - result "boolean" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "isAbstract" - quid "4357B7440365" - result "boolean" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getBaseTypes" - quid "4358FE4B0316" - result "EJavaList" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getAliasNames" - quid "4358FE740351" - result "EJavaList" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getProperties" - quid "4358FE8D0248" - result "EJavaList" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getDeclaredProperties" - quid "4358FE9C02A4" - result "EJavaList" - concurrency "Sequential" - opExportControl "Public" - uid 0) - (object Operation "getProperty" - quid "3FAB831701D8" - parameters (list Parameters - (object Parameter "propertyName" - type "String")) - result "Property" - concurrency "Sequential" - opExportControl "Public" - uid 0)) - class_attributes (list class_attribute_list - (object ClassAttribute "commonj.sdo.Type" - quid "3FAB7C8B0015" - stereotype "javaclass" - exportControl "Public"))) - (object Class "EJavaList" - quid "3FAB8A010237" - stereotype "datatype" - class_attributes (list class_attribute_list - (object ClassAttribute "java.util.List" - quid "3FAB8A0F01F1" - stereotype "javaclass" - exportControl "Public")) - abstract TRUE) - (object Class "EObjectStreamException" - quid "3FC352DE038F" - stereotype "datatype" - class_attributes (list class_attribute_list - (object ClassAttribute "java.io.ObjectStreamException" - quid "3FC352F90171" - stereotype "javaclass" - exportControl "Public")) - abstract TRUE) - (object Class "AnyTypeDataObject" - attributes (list Attribute_Set - (object Attribute - tool "Ecore" - name "xmlContentKind" - value ("ContentKind" 3))) - quid "4069645E0146" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "406964870375" - supplier "Logical View::type::AnyType" - quidu "40695FE40332") - (object Inheritance_Relationship - quid "436141F003E7" - stereotype "extend" - supplier "Logical View::sdo::DataObject" - quidu "3FAB6F7501C4"))) - (object Class "SimpleAnyTypeDataObject" - attributes (list Attribute_Set - (object Attribute - tool "Ecore" - name "xmlContentKind" - value ("ContentKind" 2))) - quid "406964710189" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "4069648302E3" - stereotype "extend" - supplier "Logical View::sdo::AnyTypeDataObject" - quidu "4069645E0146") - (object Inheritance_Relationship - quid "4069648D02E8" - supplier "Logical View::type::SimpleAnyType" - quidu "406961210099"))) - (object Class "Class" - quid "43559BB702E7" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "43559D3A01A3" - supplier "Logical View::ecore::EClass" - quidu "3903D5BF000A") - (object Inheritance_Relationship - quid "435901C600DC" - supplier "Logical View::sdo::Type" - quidu "3FAB7C7C0349")) - class_attributes (list class_attribute_list - (object ClassAttribute "commonj.sdo.Type" - quid "435900CF00F5" - stereotype "javaclass" - exportControl "Public"))) - (object Class "DataType" - quid "43559BE502F7" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "43590C6F016D" - supplier "Logical View::sdo::Type" - quidu "3FAB7C7C0349") - (object Inheritance_Relationship - quid "43590C73038F" - supplier "Logical View::ecore::EDataType" - quidu "3903D525033E")) - class_attributes (list class_attribute_list - (object ClassAttribute "commonj.sdo.Type" - quid "4358FFE30331" - stereotype "javaclass" - exportControl "Public"))) - (object Class "Attribute" - quid "43559E690004" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "43559ED801E4" - supplier "Logical View::ecore::EAttribute" - quidu "39238472039D") - (object Inheritance_Relationship - quid "43567DFD03B6" - supplier "Logical View::sdo::Property" - quidu "3FAB7CA1031A")) - class_attributes (list class_attribute_list - (object ClassAttribute "commonj.sdo.Property" - quid "4359014A0246" - stereotype "javaclass" - exportControl "Public"))) - (object Class "Reference" - quid "43559E86025E" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "43559EE0011D" - supplier "Logical View::ecore::EReference" - quidu "39238479039D") - (object Inheritance_Relationship - quid "43567DF9022A" - supplier "Logical View::sdo::Property" - quidu "3FAB7CA1031A")) - class_attributes (list class_attribute_list - (object ClassAttribute "commonj.sdo.Property" - quid "4359018E0226" - stereotype "javaclass" - exportControl "Public"))) - (object Class "Enum" - quid "4357B1010017" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "4357B1410218" - supplier "Logical View::sdo::Type" - quidu "3FAB7C7C0349") - (object Inheritance_Relationship - quid "4357B14701DA" - supplier "Logical View::ecore::EEnum" - quidu "39A473E901D4")) - class_attributes (list class_attribute_list - (object ClassAttribute "commonj.sdo.Type" - quid "4359006102CE" - stereotype "javaclass" - exportControl "Public"))) - (object Class "DynamicDataObject" - quid "435E94210124" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "435E9435008D" - supplier "Logical View::sdo::DataObject" - quidu "3FAB6F7501C4")) - class_attributes (list class_attribute_list - (object ClassAttribute "commonj.sdo.DataObject" - quid "435E9459021F" - stereotype "javaclass" - exportControl "Public"))) - (object Class "StoreDataObject" - quid "43621EBA03B4" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "43621F0B03A6" - supplier "Logical View::sdo::DataObject" - quidu "3FAB6F7501C4")) - class_attributes (list class_attribute_list - (object ClassAttribute "commonj.sdo.DataObject" - quid "43621EDF015E" - stereotype "javaclass" - exportControl "Public"))) - (object Class "DynamicStoreDataObject" - quid "43621F4203CD" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "43621F920242" - supplier "Logical View::sdo::StoreDataObject" - quidu "43621EBA03B4")) - class_attributes (list class_attribute_list - (object ClassAttribute "commonj.sdo.DataObject" - quid "43621F5701ED" - stereotype "javaclass" - exportControl "Public"))) - (object Association "$UNNAMED$0" - quid "3FAD10CA01D5" - roles (list role_list - (object Role "eDataGraph" - attributes (list Attribute_Set - (object Attribute - tool "Ecore" - name "isResolveProxies" - value FALSE) - (object Attribute - tool "Ecore" - name "isTransient" - value TRUE)) - quid "3FAD10CC001F" - label "eDataGraph" - supplier "Logical View::sdo::DataGraph" - quidu "3FAB7BFE03C0" - client_cardinality (value cardinality "1") - is_navigable TRUE) - (object Role "eChangeSummary" - attributes (list Attribute_Set - (object Attribute - tool "Ecore" - name "isResolveProxies" - value FALSE)) - quid "3FAD10CC0020" - label "eChangeSummary" - supplier "Logical View::sdo::ChangeSummary" - quidu "3FAB7C360208" - client_cardinality (value cardinality "1") - Containment "By Value" - is_navigable TRUE))) - (object Association "$UNNAMED$1" - quid "3FAD26E802F5" - roles (list role_list - (object Role "$UNNAMED$2" - quid "3FAD26ED00E9" - supplier "Logical View::sdo::DataGraph" - quidu "3FAB7BFE03C0") - (object Role "eRootObject" - attributes (list Attribute_Set - (object Attribute - tool "Ecore" - name "isResolveProxies" - value FALSE)) - quid "3FAD26ED00F3" - label "eRootObject" - supplier "Logical View::ecore::EObject" - quidu "3C4F1C860123" - client_cardinality (value cardinality "1") - is_navigable TRUE))) - (object Association "$UNNAMED$3" - quid "406962A200CF" - roles (list role_list - (object Role "$UNNAMED$4" - quid "406962A30076" - supplier "Logical View::type::SimpleAnyType" - quidu "406961210099") - (object Role "instanceType" - attributes (list Attribute_Set - (object Attribute - tool "Ecore" - name "isResolveProxies" - value FALSE)) - quid "406962A30077" - label "instanceType" - supplier "Logical View::ecore::EDataType" - quidu "3903D525033E" - client_cardinality (value cardinality "1") - is_navigable TRUE)))) - logical_presentations (list unit_reference_list - (object ClassDiagram "SDO Interfaces" - quid "3FAB8BAA0329" - title "SDO Interfaces" - zoom 100 - max_height 28350 - max_width 21600 - origin_x 0 - origin_y 0 - items (list diagram_item_list - (object ClassView "Class" "Logical View::sdo::Sequence" @1 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - ShowOperationSignature TRUE - location (2560, 2032) - label (object ItemLabel - Parent_View @1 - location (1999, 1673) - fill_color 13434879 - nlines 1 - max_width 1122 - justify 0 - label "Sequence") - stereotype (object ItemLabel - Parent_View @1 - location (1999, 1623) - fill_color 13434879 - anchor 10 - nlines 1 - max_width 1122 - justify 0 - label "<>") - icon "Interface" - icon_style "Label" - line_color 3342489 - fill_color 13434879 - quidu "3FAB7CC302B5" - compartment (object Compartment - Parent_View @1 - location (1999, 1733) - icon_style "Icon" - fill_color 16777215 - anchor 2 - nlines 14 - max_width 1128) - width 1140 - height 842 - annotation 8 - autoResize TRUE) - (object ClassView "Class" "Logical View::sdo::DataGraph" @2 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - ShowOperationSignature TRUE - location (768, 304) - label (object ItemLabel - Parent_View @2 - location (65, 48) - fill_color 13434879 - nlines 1 - max_width 1406 - justify 0 - label "DataGraph") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "3FAB7BFE03C0" - compartment (object Compartment - Parent_View @2 - location (65, 108) - icon_style "Icon" - fill_color 16777215 - anchor 2 - nlines 9 - max_width 1412) - width 1424 - height 536 - annotation 8 - autoResize TRUE) - (object ClassView "Class" "Logical View::sdo::DataObject" @3 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - ShowOperationSignature TRUE - location (976, 1280) - font (object Font - italics TRUE) - label (object ItemLabel - Parent_View @3 - location (62, 674) - fill_color 13434879 - nlines 1 - max_width 1828 - justify 0 - label "DataObject") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "3FAB6F7501C4" - compartment (object Compartment - Parent_View @3 - location (62, 734) - icon_style "Icon" - fill_color 13434879 - anchor 2 - nlines 23 - max_width 1834 - compartmentItems (list Compartment - "+ get(property : Property) : EJavaObject" - "+ set(property : Property, value : EJavaObject)" - "+ isSet(property : Property) : boolean" - "+ unset(property : Property)" - "+ getContainer() : DataObject" - "+ getContainmentProperty() : Property" - "+ getDataGraph() : DataGraph" - "+ getType() : Type" - "+ createDataObject(propertyName : String) : DataObject" - "+ createDataObject(propertyIndex : int) : DataObject" - "+ createDataObject(property : Property) : DataObject" - "+ createDataObject(propertyName : String, namespaceURI : String, typeName : String) : DataObject" - "+ createDataObject(propertyIndex : int, namespaceURI : String, typeName : String) : DataObject" - "+ createDataObject(property : Property, type : Type) : DataObject" - "+ delete()" - "+ getSequence() : Sequence" - "+ getInstanceProperties() : EJavaList" - "+ getProperty(propertyName : String) : Property" - "+ getRootObject() : DataObject" - "+ getChangeSummary() : ChangeSummary" - "+ detach()")) - width 1846 - height 1236 - annotation 8 - autoResize TRUE) - (object ClassView "Class" "Logical View::sdo::ChangeSummary" @4 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - ShowOperationSignature TRUE - location (2784, 560) - label (object ItemLabel - Parent_View @4 - location (1995, 76) - fill_color 13434879 - nlines 1 - max_width 1578 - justify 0 - label "ChangeSummary") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "3FAB7C360208" - compartment (object Compartment - Parent_View @4 - location (1995, 136) - icon_style "Icon" - fill_color 16777215 - anchor 2 - nlines 17 - max_width 1584) - width 1596 - height 992 - annotation 8 - autoResize TRUE) - (object ClassView "Class" "Logical View::sdo::Type" @5 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - ShowOperationSignature TRUE - location (512, 2448) - label (object ItemLabel - Parent_View @5 - location (75, 2064) - fill_color 13434879 - nlines 1 - max_width 874 - justify 0 - label "Type") - stereotype (object ItemLabel - Parent_View @5 - location (75, 2014) - fill_color 13434879 - anchor 10 - nlines 1 - max_width 874 - justify 0 - label "<>") - icon "Interface" - icon_style "Label" - line_color 3342489 - fill_color 13434879 - quidu "3FAB7C7C0349" - compartment (object Compartment - Parent_View @5 - location (75, 2124) - icon_style "Icon" - fill_color 16777215 - anchor 2 - nlines 15 - max_width 881) - width 892 - height 892 - annotation 8 - autoResize TRUE) - (object ClassView "Class" "Logical View::sdo::Property" @6 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - ShowOperationSignature TRUE - location (1424, 2352) - label (object ItemLabel - Parent_View @6 - location (1054, 2068) - fill_color 13434879 - nlines 1 - max_width 740 - justify 0 - label "Property") - stereotype (object ItemLabel - Parent_View @6 - location (1054, 2018) - fill_color 13434879 - anchor 10 - nlines 1 - max_width 740 - justify 0 - label "<>") - icon "Interface" - icon_style "Label" - line_color 3342489 - fill_color 13434879 - quidu "3FAB7CA1031A" - compartment (object Compartment - Parent_View @6 - location (1054, 2128) - icon_style "Icon" - fill_color 16777215 - anchor 2 - nlines 11 - max_width 746) - width 758 - height 692 - annotation 8 - autoResize TRUE) - (object ClassView "Class" "Logical View::sdo::ChangeSummarySetting" @7 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - ShowOperationSignature TRUE - location (2528, 1328) - label (object ItemLabel - Parent_View @7 - location (2003, 1144) - fill_color 13434879 - nlines 1 - max_width 1050 - justify 0 - label "ChangeSummarySetting") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "3FAB8BF8005A" - compartment (object Compartment - Parent_View @7 - location (2003, 1204) - icon_style "Icon" - fill_color 16777215 - anchor 2 - nlines 5 - max_width 1056) - width 1068 - height 392 - annotation 8 - autoResize TRUE))) - (object ClassDiagram "SDO DataObject Access" - quid "3FAC2D8D008D" - title "SDO DataObject Access" - zoom 100 - max_height 28350 - max_width 21600 - origin_x 0 - origin_y 0 - items (list diagram_item_list - (object ClassView "Class" "Logical View::sdo::DataObject" @8 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - ShowOperationSignature TRUE - location (528, 1360) - font (object Font - italics TRUE) - label (object ItemLabel - Parent_View @8 - location (53, 79) - fill_color 13434879 - nlines 1 - max_width 950 - justify 0 - label "DataObject") - icon_style "Icon" - line_color 3342489 - fill_color 16316638 - quidu "3FAB6F7501C4" - compartment (object Compartment - Parent_View @8 - location (53, 139) - icon_style "Icon" - fill_color 13434879 - anchor 2 - nlines 50 - max_width 0 - compartmentItems (list Compartment - "+ getBigDecimal(path : String) : EBigDecimal" - "+ getBigInteger(path : String) : EBigInteger" - "+ getBoolean(path : String) : boolean" - "+ getByte(path : String) : byte" - "+ getBytes(path : String) : EByteArray" - "+ getChar(path : String) : char" - "+ getDataObject(path : String) : DataObject" - "+ getDate(path : String) : EDate" - "+ getDouble(path : String) : double" - "+ getFloat(path : String) : float" - "+ getInt(path : String) : int" - "+ getList(path : String) : EJavaList" - "+ getLong(path : String) : long" - "+ getSequence(path : String) : Sequence" - "+ getShort(path : String) : short" - "+ getString(path : String) : String" - "+ getBigDecimal(propertyIndex : int) : EBigDecimal" - "+ getBigInteger(propertyIndex : int) : EBigInteger" - "+ getBoolean(propertyIndex : int) : boolean" - "+ getByte(propertyIndex : int) : byte" - "+ getBytes(propertyIndex : int) : EByteArray" - "+ getChar(propertyIndex : int) : char" - "+ getDataObject(propertyIndex : int) : DataObject" - "+ getDate(propertyIndex : int) : EDate" - "+ getDouble(propertyIndex : int) : double" - "+ getFloat(propertyIndex : int) : float" - "+ getInt(propertyIndex : int) : int" - "+ getList(propertyIndex : int) : EJavaList" - "+ getLong(propertyIndex : int) : long" - "+ getSequence(propertyIndex : int) : Sequence" - "+ getShort(propertyIndex : int) : short" - "+ getString(propertyIndex : int) : String" - "+ getBigDecimal(property : Property) : EBigDecimal" - "+ getBigInteger(property : Property) : EBigInteger" - "+ getBoolean(property : Property) : boolean" - "+ getByte(property : Property) : byte" - "+ getBytes(property : Property) : EByteArray" - "+ getChar(property : Property) : char" - "+ getDataObject(property : Property) : DataObject" - "+ getDate(property : Property) : EDate" - "+ getDouble(property : Property) : double" - "+ getFloat(property : Property) : float" - "+ getInt(property : Property) : int" - "+ getList(property : Property) : EJavaList" - "+ getLong(property : Property) : long" - "+ getSequence(property : Property) : Sequence" - "+ getShort(property : Property) : short" - "+ getString(property : Property) : String" - "<> + commonj.sdo.DataObject")) - width 968 - height 2586 - annotation 8 - autoResize TRUE) - (object ClassView "Class" "Logical View::sdo::DataObject" @9 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - ShowOperationSignature TRUE - location (1664, 1280) - font (object Font - italics TRUE) - label (object ItemLabel - Parent_View @9 - location (1131, 74) - fill_color 13434879 - nlines 1 - max_width 1066 - justify 0 - label "DataObject") - icon_style "Icon" - line_color 3342489 - fill_color 16316638 - quidu "3FAB6F7501C4" - compartment (object Compartment - Parent_View @9 - location (1131, 134) - icon_style "Icon" - fill_color 13434879 - anchor 2 - nlines 47 - max_width 0 - compartmentItems (list Compartment - "+ setBigDecimal(path : String, value : EBigDecimal)" - "+ setBigInteger(path : String, value : EBigInteger)" - "+ setBoolean(path : String, value : boolean)" - "+ setByte(path : String, value : byte)" - "+ setBytes(path : String, value : EByteArray)" - "+ setChar(path : String, value : char)" - "+ setDataObject(path : String, value : DataObject)" - "+ setDate(path : String, value : EDate)" - "+ setDouble(path : String, value : double)" - "+ setFloat(path : String, value : float)" - "+ setInt(path : String, value : int)" - "+ setList(path : String, value : EJavaList)" - "+ setLong(path : String, value : long)" - "+ setShort(path : String, value : short)" - "+ setString(path : String, value : String)" - "+ setBigDecimal(propertyIndex : int, value : EBigDecimal)" - "+ setBigInteger(propertyIndex : int, value : EBigInteger)" - "+ setBoolean(propertyIndex : int, value : boolean)" - "+ setByte(propertyIndex : int, value : byte)" - "+ setBytes(propertyIndex : int, value : EByteArray)" - "+ setChar(propertyIndex : int, value : char)" - "+ setDataObject(propertyIndex : int, value : DataObject)" - "+ setDate(propertyIndex : int, value : EDate)" - "+ setDouble(propertyIndex : int, value : double)" - "+ setFloat(propertyIndex : int, value : float)" - "+ setInt(propertyIndex : int, value : int)" - "+ setList(propertyIndex : int, value : EJavaList)" - "+ setLong(propertyIndex : int, value : long)" - "+ setShort(propertyIndex : int, value : short)" - "+ setString(propertyIndex : int, value : String)" - "+ setBigDecimal(property : Property, value : EBigDecimal)" - "+ setBigInteger(property : Property, value : EBigInteger)" - "+ setBoolean(property : Property, value : boolean)" - "+ setByte(property : Property, value : byte)" - "+ setBytes(property : Property, value : EByteArray)" - "+ setChar(property : Property, value : char)" - "+ setDataObject(property : Property, value : DataObject)" - "+ setDate(property : Property, value : EDate)" - "+ setDouble(property : Property, value : double)" - "+ setFloat(property : Property, value : float)" - "+ setInt(property : Property, value : int)" - "+ setList(property : Property, value : EJavaList)" - "+ setLong(property : Property, value : long)" - "+ setShort(property : Property, value : short)" - "+ setString(property : Property, value : String)" - "<> + commonj.sdo.DataObject")) - width 1084 - height 2436 - annotation 8 - autoResize TRUE))) - (object ClassDiagram "Ecore SDO" - quid "3FAC379A02D5" - title "Ecore SDO" - zoom 100 - max_height 28350 - max_width 21600 - origin_x 0 - origin_y 0 - items (list diagram_item_list - (object ClassView "Class" "Logical View::sdo::DataGraph" @10 - ShowCompartmentStereotypes TRUE - SuppressOperation TRUE - location (464, 160) - label (object ItemLabel - Parent_View @10 - location (74, 104) - fill_color 13434879 - nlines 1 - max_width 780 - justify 0 - label "DataGraph") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "3FAB7BFE03C0" - compartment (object Compartment - Parent_View @10 - location (74, 164) - icon_style "Icon" - fill_color 13434879 - anchor 2 - nlines 1 - max_width 0 - compartmentItems (list Compartment - "<> + commonj.sdo.DataGraph")) - width 798 - height 136 - annotation 8 - autoResize TRUE) - (object ClassView "Class" "Logical View::sdo::ChangeSummary" @11 - ShowCompartmentStereotypes TRUE - SuppressOperation TRUE - location (528, 400) - label (object ItemLabel - Parent_View @11 - location (78, 344) - fill_color 13434879 - nlines 1 - max_width 900 - justify 0 - label "ChangeSummary") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "3FAB7C360208" - compartment (object Compartment - Parent_View @11 - location (78, 404) - icon_style "Icon" - fill_color 13434879 - anchor 2 - nlines 1 - max_width 0 - compartmentItems (list Compartment - "<> + commonj.sdo.ChangeSummary")) - width 918 - height 136 - annotation 8 - autoResize TRUE) - (object ClassView "Class" "Logical View::sdo::Type" @12 - ShowCompartmentStereotypes TRUE - SuppressOperation TRUE - location (416, 1088) - label (object ItemLabel - Parent_View @12 - location (79, 1054) - fill_color 13434879 - nlines 1 - max_width 674 - justify 0 - label "Type") - stereotype (object ItemLabel - Parent_View @12 - location (79, 1004) - fill_color 13434879 - anchor 10 - nlines 1 - max_width 674 - justify 0 - label "<>") - icon "Interface" - icon_style "Label" - line_color 3342489 - fill_color 13434879 - quidu "3FAB7C7C0349" - compartment (object Compartment - Parent_View @12 - location (79, 1114) - icon_style "Icon" - fill_color 13434879 - anchor 2 - nlines 1 - max_width 0 - compartmentItems (list Compartment - "<> + commonj.sdo.Type")) - width 692 - height 192 - annotation 8 - autoResize TRUE) - (object ClassView "Class" "Logical View::sdo::Property" @13 - ShowCompartmentStereotypes TRUE - SuppressOperation TRUE - location (448, 1648) - label (object ItemLabel - Parent_View @13 - location (78, 1614) - fill_color 13434879 - nlines 1 - max_width 740 - justify 0 - label "Property") - stereotype (object ItemLabel - Parent_View @13 - location (78, 1564) - fill_color 13434879 - anchor 10 - nlines 1 - max_width 740 - justify 0 - label "<>") - icon "Interface" - icon_style "Label" - line_color 3342489 - fill_color 13434879 - quidu "3FAB7CA1031A" - compartment (object Compartment - Parent_View @13 - location (78, 1674) - icon_style "Icon" - fill_color 13434879 - anchor 2 - nlines 1 - max_width 0 - compartmentItems (list Compartment - "<> + commonj.sdo.Property")) - width 758 - height 192 - annotation 8 - autoResize TRUE) - (object ClassView "Class" "Logical View::sdo::ChangeSummarySetting" @14 - ShowCompartmentStereotypes TRUE - SuppressOperation TRUE - IncludeOperation TRUE - location (608, 640) - label (object ItemLabel - Parent_View @14 - location (83, 584) - fill_color 13434879 - nlines 1 - max_width 1050 - justify 0 - label "ChangeSummarySetting") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "3FAB8BF8005A" - compartment (object Compartment - Parent_View @14 - location (83, 644) - icon_style "Icon" - fill_color 13434879 - anchor 2 - nlines 1 - max_width 0 - compartmentItems (list Compartment - "<> + commonj.sdo.ChangeSummary$Setting")) - width 1068 - height 136 - annotation 8 - autoResize TRUE) - (object ClassView "Class" "Logical View::change::ChangeDescription" @15 - ShowCompartmentStereotypes TRUE - SuppressAttribute TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (2496, 400) - label (object ItemLabel - Parent_View @15 - location (2311, 350) - fill_color 13434879 - nlines 1 - max_width 370 - justify 0 - label "ChangeDescription") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4FAB6F110198" - width 388 - height 124 - annotation 8 - autoResize TRUE) - (object ClassView "Class" "Logical View::ecore::EObject" @16 - ShowCompartmentStereotypes TRUE - SuppressAttribute TRUE - SuppressOperation TRUE - location (2592, 160) - label (object ItemLabel - Parent_View @16 - location (2503, 110) - fill_color 13434879 - nlines 1 - max_width 178 - justify 0 - label "EObject") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "3C4F1C860123" - width 196 - height 124 - annotation 8 - autoResize TRUE) - (object ClassView "Class" "Logical View::change::FeatureChange" @17 - ShowCompartmentStereotypes TRUE - SuppressAttribute TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (2528, 640) - label (object ItemLabel - Parent_View @17 - location (2374, 590) - fill_color 13434879 - nlines 1 - max_width 308 - justify 0 - label "FeatureChange") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4FC39D6D0177" - width 326 - height 124 - annotation 8 - autoResize TRUE) - (object ClassView "Class" "Logical View::sdo::Class" @18 - ShowCompartmentStereotypes TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (1648, 1296) - label (object ItemLabel - Parent_View @18 - location (1311, 1241) - fill_color 13434879 - nlines 1 - max_width 674 - justify 0 - label "Class") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "43559BB702E7" - width 692 - height 134 - annotation 8) - (object ClassView "Class" "Logical View::sdo::DataType" @19 - ShowCompartmentStereotypes TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (1648, 880) - label (object ItemLabel - Parent_View @19 - location (1311, 825) - fill_color 13434879 - nlines 1 - max_width 674 - justify 0 - label "DataType") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "43559BE502F7" - width 692 - height 134 - annotation 8) - (object ClassView "Class" "Logical View::ecore::EClass" @20 - ShowCompartmentStereotypes TRUE - SuppressAttribute TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (2592, 1296) - label (object ItemLabel - Parent_View @20 - location (2502, 1246) - fill_color 13434879 - nlines 1 - max_width 181 - justify 0 - label "EClass") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "3903D5BF000A" - width 199 - height 124 - annotation 8) - (object ClassView "Class" "Logical View::ecore::EDataType" @21 - ShowCompartmentStereotypes TRUE - SuppressAttribute TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (2560, 880) - label (object ItemLabel - Parent_View @21 - location (2444, 830) - fill_color 13434879 - nlines 1 - max_width 232 - justify 0 - label "EDataType") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "3903D525033E" - width 250 - height 124 - annotation 8) - (object ClassView "Class" "Logical View::sdo::Attribute" @22 - ShowCompartmentStereotypes TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (1664, 1536) - label (object ItemLabel - Parent_View @22 - location (1294, 1481) - fill_color 13434879 - nlines 1 - max_width 740 - justify 0 - label "Attribute") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "43559E690004" - width 758 - height 134 - annotation 8) - (object ClassView "Class" "Logical View::sdo::Reference" @23 - ShowCompartmentStereotypes TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (1664, 1760) - label (object ItemLabel - Parent_View @23 - location (1294, 1705) - fill_color 13434879 - nlines 1 - max_width 740 - justify 0 - label "Reference") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "43559E86025E" - width 758 - height 134 - annotation 8) - (object ClassView "Class" "Logical View::ecore::EAttribute" @24 - ShowCompartmentStereotypes TRUE - SuppressAttribute TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (2576, 1536) - label (object ItemLabel - Parent_View @24 - location (2470, 1486) - fill_color 13434879 - nlines 1 - max_width 212 - justify 0 - label "EAttribute") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "39238472039D" - width 230 - height 124 - annotation 8) - (object ClassView "Class" "Logical View::ecore::EReference" @25 - ShowCompartmentStereotypes TRUE - SuppressAttribute TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (2576, 1760) - label (object ItemLabel - Parent_View @25 - location (2458, 1710) - fill_color 13434879 - nlines 1 - max_width 236 - justify 0 - label "EReference") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "39238479039D" - width 254 - height 124 - annotation 8) - (object InheritView "" @26 - stereotype TRUE - line_color 3342489 - quidu "43559ED801E4" - client @22 - supplier @24 - line_style 0) - (object InheritView "" @27 - stereotype TRUE - line_color 3342489 - quidu "43559EE0011D" - client @23 - supplier @25 - line_style 0) - (object InheritView "" @28 - stereotype TRUE - line_color 3342489 - quidu "43567DF9022A" - client @23 - supplier @13 - line_style 0) - (object InheritView "" @29 - stereotype TRUE - line_color 3342489 - quidu "43567DFD03B6" - client @22 - supplier @13 - line_style 0) - (object ClassView "Class" "Logical View::sdo::Enum" @30 - ShowCompartmentStereotypes TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (1648, 1088) - label (object ItemLabel - Parent_View @30 - location (1311, 1033) - fill_color 13434879 - nlines 1 - max_width 674 - justify 0 - label "Enum") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4357B1010017" - width 692 - height 134 - annotation 8) - (object ClassView "Class" "Logical View::ecore::EEnum" @31 - ShowCompartmentStereotypes TRUE - SuppressAttribute TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (2592, 1088) - label (object ItemLabel - Parent_View @31 - location (2502, 1038) - fill_color 13434879 - nlines 1 - max_width 181 - justify 0 - label "EEnum") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "39A473E901D4" - width 199 - height 124 - annotation 8) - (object InheritView "" @32 - stereotype TRUE - line_color 3342489 - quidu "4357B1410218" - client @30 - supplier @12 - line_style 0) - (object InheritView "" @33 - stereotype TRUE - line_color 3342489 - quidu "4357B14701DA" - client @30 - supplier @31 - line_style 0) - (object InheritView "" @34 - stereotype TRUE - line_color 3342489 - quidu "43559D3A01A3" - client @18 - supplier @20 - line_style 0) - (object InheritView "" @35 - stereotype TRUE - line_color 3342489 - quidu "435901C600DC" - client @18 - supplier @12 - line_style 0) - (object InheritView "" @36 - stereotype TRUE - line_color 3342489 - quidu "43590C6F016D" - client @19 - supplier @12 - line_style 0) - (object InheritView "" @37 - stereotype TRUE - line_color 3342489 - quidu "43590C73038F" - client @19 - supplier @21 - line_style 0) - (object InheritView "" @38 - stereotype TRUE - line_color 3342489 - quidu "43612C7B0243" - client @10 - supplier @16 - line_style 0) - (object InheritView "" @39 - stereotype TRUE - line_color 3342489 - quidu "436134F001A6" - client @14 - supplier @17 - line_style 0) - (object InheritView "" @40 - stereotype TRUE - line_color 3342489 - quidu "4361480602D8" - client @11 - supplier @15 - line_style 0))) - (object ClassDiagram "Ecore Data Graph" - quid "3FAD029E0142" - title "Ecore Data Graph" - zoom 100 - max_height 28350 - max_width 21600 - origin_x 0 - origin_y 0 - items (list diagram_item_list - (object ClassView "Class" "Logical View::ecore::EObject" @41 - ShowCompartmentStereotypes TRUE - SuppressAttribute TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (464, 832) - label (object ItemLabel - Parent_View @41 - location (375, 782) - fill_color 13434879 - nlines 1 - max_width 178 - justify 0 - label "EObject") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "3C4F1C860123" - width 196 - height 124 - annotation 8 - autoResize TRUE) - (object ClassView "Class" "Logical View::sdo::DataGraph" @42 - ShowCompartmentStereotypes TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (768, 256) - label (object ItemLabel - Parent_View @42 - location (378, 150) - fill_color 13434879 - nlines 1 - max_width 780 - justify 0 - label "DataGraph") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "3FAB7BFE03C0" - width 798 - height 236 - annotation 8) - (object AssociationViewNew "$UNNAMED$1" @43 - location (469, 572) - stereotype TRUE - quidu "3FAD26E802F5" - roleview_list (list RoleViews - (object RoleView "$UNNAMED$2" @44 - Parent_View @43 - location (-1067, -932) - stereotype TRUE - line_color 3342489 - quidu "3FAD26ED00E9" - client @43 - supplier @42 - line_style 3 - origin_attachment (469, 572) - terminal_attachment (469, 374)) - (object RoleView "eRootObject" @45 - Parent_View @43 - location (-1067, -932) - label (object SegLabel @46 - Parent_View @45 - location (324, 683) - anchor 1 - anchor_loc 1 - nlines 1 - max_width 252 - justify 0 - label "+eRootObject" - pctDist 0.567708 - height 146 - orientation 1) - stereotype TRUE - line_color 3342489 - quidu "3FAD26ED00F3" - client @43 - supplier @41 - line_style 3 - origin_attachment (469, 572) - terminal_attachment (469, 770) - label (object SegLabel @47 - Parent_View @45 - location (512, 690) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "1" - pctDist 0.598958 - height 43 - orientation 0)))) - (object ClassView "Class" "Logical View::sdo::ChangeSummary" @48 - ShowCompartmentStereotypes TRUE - SuppressAttribute TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (1072, 832) - label (object ItemLabel - Parent_View @48 - location (881, 782) - fill_color 13434879 - nlines 1 - max_width 382 - justify 0 - label "ChangeSummary") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "3FAB7C360208" - width 400 - height 125 - annotation 8) - (object AssociationViewNew "$UNNAMED$0" @49 - location (1078, 572) - stereotype TRUE - quidu "3FAD10CA01D5" - roleview_list (list RoleViews - (object RoleView "eDataGraph" @50 - Parent_View @49 - location (662, -692) - label (object SegLabel @51 - Parent_View @50 - location (929, 437) - anchor 1 - anchor_loc 1 - nlines 1 - max_width 240 - justify 0 - label "+eDataGraph" - pctDist 0.686170 - height 150 - orientation 0) - stereotype TRUE - line_color 3342489 - quidu "3FAD10CC001F" - client @49 - supplier @42 - line_style 3 - origin_attachment (1078, 572) - terminal_attachment (1078, 374) - label (object SegLabel @52 - Parent_View @50 - location (1115, 437) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "1" - pctDist 0.686170 - height 37 - orientation 1)) - (object RoleView "eChangeSummary" @53 - Parent_View @49 - location (662, -692) - label (object SegLabel @54 - Parent_View @53 - location (876, 692) - anchor 1 - anchor_loc 1 - nlines 1 - max_width 360 - justify 0 - label "+eChangeSummary" - pctDist 0.611702 - height 203 - orientation 1) - stereotype TRUE - line_color 3342489 - quidu "3FAD10CC0020" - client @49 - supplier @48 - line_style 3 - origin_attachment (1078, 572) - terminal_attachment (1078, 770) - label (object SegLabel @55 - Parent_View @53 - location (1114, 692) - anchor 2 - anchor_loc 1 - nlines 1 - max_width 15 - justify 0 - label "1" - pctDist 0.611702 - height 36 - orientation 0)))))) - (object ClassDiagram "External Types" - quid "3FAB907F00F7" - title "External Types" - zoom 100 - max_height 28350 - max_width 21600 - origin_x 0 - origin_y 0 - items (list diagram_item_list - (object ClassView "Class" "Logical View::sdo::EObjectStreamException" @56 - ShowCompartmentStereotypes TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - ShowOperationSignature TRUE - location (1184, 176) - font (object Font - italics TRUE) - label (object ItemLabel - Parent_View @56 - location (741, 142) - fill_color 13434879 - nlines 1 - max_width 886 - justify 0 - label "EObjectStreamException") - stereotype (object ItemLabel - Parent_View @56 - location (741, 92) - fill_color 13434879 - anchor 10 - nlines 1 - max_width 886 - justify 0 - label "<>") - icon_style "Icon" - line_color 3342489 - fill_color 12303359 - quidu "3FC352DE038F" - width 904 - height 192 - annotation 8 - autoResize TRUE) - (object ClassView "Class" "Logical View::sdo::EJavaList" @57 - ShowCompartmentStereotypes TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - ShowOperationSignature TRUE - location (352, 176) - font (object Font - italics TRUE) - label (object ItemLabel - Parent_View @57 - location (80, 142) - fill_color 13434879 - nlines 1 - max_width 544 - justify 0 - label "EJavaList") - stereotype (object ItemLabel - Parent_View @57 - location (80, 92) - fill_color 13434879 - anchor 10 - nlines 1 - max_width 544 - justify 0 - label "<>") - icon_style "Icon" - line_color 3342489 - fill_color 8963327 - quidu "3FAB8A010237" - width 562 - height 192 - annotation 8))) - (object ClassDiagram "SDO XML Type" - quid "406964270056" - title "SDO XML Type" - zoom 100 - max_height 28350 - max_width 21600 - origin_x 0 - origin_y 0 - items (list diagram_item_list - (object ClassView "Class" "Logical View::type::AnyType" @58 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - ShowOperationSignature TRUE - location (1488, 576) - label (object ItemLabel - Parent_View @58 - location (1075, 421) - fill_color 13434879 - nlines 1 - max_width 826 - justify 0 - label "AnyType") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "40695FE40332" - width 844 - height 334 - annotation 8) - (object ClassView "Class" "Logical View::type::SimpleAnyType" @59 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - ShowOperationSignature TRUE - location (1488, 1040) - label (object ItemLabel - Parent_View @59 - location (1272, 910) - fill_color 13434879 - nlines 1 - max_width 432 - justify 0 - label "SimpleAnyType") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "406961210099" - width 450 - height 284 - annotation 8) - (object ClassView "Class" "Logical View::sdo::AnyTypeDataObject" @60 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - ShowOperationSignature TRUE - location (448, 560) - label (object ItemLabel - Parent_View @60 - location (250, 509) - fill_color 13434879 - nlines 1 - max_width 396 - justify 0 - label "AnyTypeDataObject") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4069645E0146" - width 414 - height 126 - annotation 8 - autoResize TRUE) - (object ClassView "Class" "Logical View::sdo::SimpleAnyTypeDataObject" @61 - ShowCompartmentStereotypes TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - ShowOperationSignature TRUE - location (464, 1024) - label (object ItemLabel - Parent_View @61 - location (201, 973) - fill_color 13434879 - nlines 1 - max_width 526 - justify 0 - label "SimpleAnyTypeDataObject") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "406964710189" - width 544 - height 126 - annotation 8 - autoResize TRUE) - (object ClassView "Class" "Logical View::sdo::DataObject" @62 - ShowCompartmentStereotypes TRUE - SuppressAttribute TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (448, 208) - font (object Font - italics TRUE) - label (object ItemLabel - Parent_View @62 - location (328, 165) - fill_color 13434879 - nlines 1 - max_width 240 - justify 0 - label "DataObject") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "3FAB6F7501C4" - width 258 - height 110 - annotation 8) - (object InheritView "" @63 - stereotype (object SegLabel @64 - Parent_View @63 - location (298, 791) - anchor 10 - anchor_loc 1 - nlines 1 - max_width 450 - justify 0 - label "<>" - pctDist 0.502959 - height 150 - orientation 0) - line_color 3342489 - quidu "4069648302E3" - client @61 - supplier @60 - line_style 3 - origin_attachment (448, 961) - terminal_attachment (448, 623)) - (object InheritView "" @65 - stereotype TRUE - line_color 3342489 - quidu "4069648D02E8" - client @61 - supplier @59 - line_style 3 - origin_attachment (736, 1002) - terminal_attachment (1263, 1002)) - (object InheritView "" @66 - stereotype TRUE - line_color 3342489 - quidu "40696143020B" - client @59 - supplier @58 - line_style 3 - origin_attachment (1479, 898) - terminal_attachment (1479, 743)) - (object InheritView "" @67 - stereotype TRUE - line_color 3342489 - quidu "406964870375" - client @60 - supplier @58 - line_style 3 - origin_attachment (655, 561) - terminal_attachment (1066, 561)) - (object InheritView "" @68 - stereotype (object SegLabel @69 - Parent_View @68 - location (294, 403) - anchor 10 - anchor_loc 1 - nlines 1 - max_width 450 - justify 0 - label "<>" - pctDist 0.405229 - height 155 - orientation 0) - line_color 3342489 - quidu "436141F003E7" - client @60 - supplier @62 - line_style 0))) - (object ClassDiagram "SDO DataObject Implementations" - quid "43621DF90149" - title "SDO DataObject Implementations" - zoom 100 - max_height 28350 - max_width 21600 - origin_x 0 - origin_y 0 - items (list diagram_item_list - (object ClassView "Class" "Logical View::sdo::DataObject" @70 - ShowCompartmentStereotypes TRUE - SuppressOperation TRUE - location (1056, 368) - font (object Font - italics TRUE) - label (object ItemLabel - Parent_View @70 - location (661, 312) - fill_color 13434879 - nlines 1 - max_width 790 - justify 0 - label "DataObject") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "3FAB6F7501C4" - compartment (object Compartment - Parent_View @70 - location (661, 372) - icon_style "Icon" - fill_color 13434879 - anchor 2 - nlines 1 - max_width 0 - compartmentItems (list Compartment - "<> + commonj.sdo.DataObject")) - width 808 - height 136 - annotation 8 - autoResize TRUE) - (object ClassView "Class" "Logical View::sdo::DynamicDataObject" @71 - ShowCompartmentStereotypes TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (576, 720) - label (object ItemLabel - Parent_View @71 - location (181, 664) - fill_color 13434879 - nlines 1 - max_width 790 - justify 0 - label "DynamicDataObject") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "435E94210124" - width 808 - height 136 - annotation 8) - (object ClassView "Class" "Logical View::sdo::StoreDataObject" @72 - ShowCompartmentStereotypes TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (1680, 720) - label (object ItemLabel - Parent_View @72 - location (1285, 664) - fill_color 13434879 - nlines 1 - max_width 790 - justify 0 - label "StoreDataObject") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "43621EBA03B4" - width 808 - height 136 - annotation 8) - (object InheritTreeView "" @73 - location (1053, 559) - line_color 3342489 - fill_color 13434879 - supplier @70 - vertices (list Points - (1053, 559) - (1053, 436))) - (object InheritView "" @74 - stereotype TRUE - line_color 3342489 - quidu "435E9435008D" - client @71 - supplier @70 - line_style 3 - origin_attachment (562, 652) - terminal_attachment (562, 559) - drawSupplier @73) - (object ClassView "Class" "Logical View::sdo::DynamicStoreDataObject" @75 - ShowCompartmentStereotypes TRUE - SuppressOperation TRUE - IncludeAttribute TRUE - IncludeOperation TRUE - location (1680, 1056) - label (object ItemLabel - Parent_View @75 - location (1285, 1000) - fill_color 13434879 - nlines 1 - max_width 790 - justify 0 - label "DynamicStoreDataObject") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "43621F4203CD" - width 808 - height 136 - annotation 8) - (object InheritView "" @76 - stereotype TRUE - line_color 3342489 - quidu "43621F920242" - client @75 - supplier @72 - line_style 0) - (object InheritView "" @77 - stereotype TRUE - line_color 3342489 - quidu "43621F0B03A6" - client @72 - supplier @70 - line_style 3 - origin_attachment (1681, 652) - terminal_attachment (1681, 559) - drawSupplier @73))))) - (object Class_Category "ecore" - is_unit TRUE - is_loaded FALSE - file_name "$VABASE_PLUGINS_PATH\\org.eclipse.emf.ecore\\model\\org.eclipse.emf.Ecore.cat" - quid "39A5ED04004E") - (object Class_Category "change" - is_unit TRUE - is_loaded FALSE - file_name "$VABASE_PLUGINS_PATH\\org.eclipse.emf.ecore.change\\model\\org.eclipse.emf.ecore.Change.cat" - quid "4FAA8E8B0306") - (object Class_Category "type" - attributes (list Attribute_Set - (object Attribute - tool "Ecore" - name "packageName" - value "type") - (object Attribute - tool "Ecore" - name "nsPrefix" - value "xml.type") - (object Attribute - tool "Ecore" - name "nsURI" - value "http://www.eclipse.org/emf/2003/XMLType") - (object Attribute - tool "Ecore" - name "basePackage" - value "org.eclipse.emf.ecore.xml") - (object Attribute - tool "Ecore" - name "prefix" - value "XMLType")) - quid "40696924000C" - exportControl "Public" - logical_models (list unit_reference_list - (object Class "AnyType" - attributes (list Attribute_Set - (object Attribute - tool "Ecore" - name "xmlContentKind" - value ("ContentKind" 3))) - quid "40695FE40332" - class_attributes (list class_attribute_list - (object ClassAttribute "mixed" - attributes (list Attribute_Set - (object Attribute - tool "Ecore" - name "isUnique" - value FALSE)) - quid "40696039001D" - stereotype "0..*" - type "EFeatureMapEntry" - exportControl "Public") - (object ClassAttribute "any" - attributes (list Attribute_Set - (object Attribute - tool "Ecore" - name "isTransient" - value TRUE) - (object Attribute - tool "Ecore" - name "isVolatile" - value TRUE) - (object Attribute - tool "Ecore" - name "isUnique" - value FALSE)) - quid "40696084002F" - stereotype "0..*" - type "EFeatureMapEntry" - exportControl "Public" - derived TRUE) - (object ClassAttribute "anyAttribute" - attributes (list Attribute_Set - (object Attribute - tool "Ecore" - name "isUnique" - value FALSE)) - quid "4069609A0153" - stereotype "0..*" - type "EFeatureMapEntry" - exportControl "Public"))) - (object Class "SimpleAnyType" - attributes (list Attribute_Set - (object Attribute - tool "Ecore" - name "xmlContentKind" - value ("ContentKind" 2))) - quid "406961210099" - superclasses (list inheritance_relationship_list - (object Inheritance_Relationship - quid "40696143020B" - supplier "Logical View::type::AnyType" - quidu "40695FE40332")) - class_attributes (list class_attribute_list - (object ClassAttribute "rawValue" - attributes (list Attribute_Set - (object Attribute - tool "Ecore" - name "isTransient" - value TRUE) - (object Attribute - tool "Ecore" - name "isVolatile" - value TRUE) - (object Attribute - tool "Ecore" - name "isUnique" - value FALSE)) - quid "4069612E0391" - type "String" - exportControl "Public" - derived TRUE) - (object ClassAttribute "value" - attributes (list Attribute_Set - (object Attribute - tool "Ecore" - name "isTransient" - value TRUE) - (object Attribute - tool "Ecore" - name "isVolatile" - value TRUE) - (object Attribute - tool "Ecore" - name "isUnique" - value FALSE)) - quid "406961A40106" - type "EJavaObject" - exportControl "Public" - derived TRUE)))) - logical_presentations (list unit_reference_list))) - logical_presentations (list unit_reference_list - (object ClassDiagram "Main" - quid "3FAA8E8700D0" - title "Main" - zoom 100 - max_height 28350 - max_width 21600 - origin_x 0 - origin_y 0 - items (list diagram_item_list - (object CategoryView "Logical View::ecore" @78 - location (912, 272) - label (object ItemLabel - Parent_View @78 - location (768, 188) - fill_color 13434879 - nlines 2 - max_width 288 - justify 0 - label "ecore") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "39A5ED04004E" - width 300 - height 180) - (object CategoryView "Logical View::sdo" @79 - location (368, 272) - label (object ItemLabel - Parent_View @79 - location (224, 188) - fill_color 13434879 - nlines 2 - max_width 288 - justify 0 - label "sdo") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "3FAA8E8B0306" - width 300 - height 180) - (object CategoryView "Logical View::change" @80 - location (1440, 272) - label (object ItemLabel - Parent_View @80 - location (1296, 188) - fill_color 13434879 - nlines 2 - max_width 288 - justify 0 - label "change") - icon_style "Icon" - line_color 3342489 - fill_color 13434879 - quidu "4FAA8E8B0306" - width 300 - height 180))))) - root_subsystem (object SubSystem "Component View" - quid "3FAA8E8700BF" - physical_models (list unit_reference_list) - physical_presentations (list unit_reference_list - (object Module_Diagram "Main" - quid "3FAA8E8700EE" - title "Main" - zoom 100 - max_height 28350 - max_width 21600 - origin_x 0 - origin_y 0 - items (list diagram_item_list)))) - process_structure (object Processes - quid "3FAA8E8700C0" - ProcsNDevs (list - (object Process_Diagram "Deployment View" - quid "3FAA8E8700C2" - title "Deployment View" - zoom 100 - max_height 28350 - max_width 21600 - origin_x 0 - origin_y 0 - items (list diagram_item_list)))) - properties (object Properties - attributes (list Attribute_Set - (object Attribute - tool "DDL" - name "propertyId" - value "809135966") - (object Attribute - tool "DDL" - name "default__Project" - value (list Attribute_Set - (object Attribute - tool "DDL" - name "Directory" - value "AUTO GENERATE") - (object Attribute - tool "DDL" - name "DataBase" - value ("DataBaseSet" 800)) - (object Attribute - tool "DDL" - name "DataBaseSet" - value (list Attribute_Set - (object Attribute - tool "DDL" - name "ANSI" - value 800) - (object Attribute - tool "DDL" - name "Oracle" - value 801) - (object Attribute - tool "DDL" - name "SQLServer" - value 802) - (object Attribute - tool "DDL" - name "Sybase" - value 803) - (object Attribute - tool "DDL" - name "Watcom" - value 804))) - (object Attribute - tool "DDL" - name "PrimaryKeyColumnName" - value "Id") - (object Attribute - tool "DDL" - name "PrimaryKeyColumnType" - value "NUMBER(5)") - (object Attribute - tool "DDL" - name "ViewName" - value "V_") - (object Attribute - tool "DDL" - name "TableName" - value "T_") - (object Attribute - tool "DDL" - name "InheritSuffix" - value "_V") - (object Attribute - tool "DDL" - name "DropClause" - value FALSE) - (object Attribute - tool "DDL" - name "BaseViews" - value FALSE) - (object Attribute - tool "DDL" - name "DDLScriptFilename" - value "DDL1.SQL"))) - (object Attribute - tool "DDL" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "DDL" - name "ColumnType" - value "VARCHAR") - (object Attribute - tool "DDL" - name "Length" - value "") - (object Attribute - tool "DDL" - name "NullsOK" - value TRUE) - (object Attribute - tool "DDL" - name "PrimaryKey" - value FALSE) - (object Attribute - tool "DDL" - name "Unique" - value FALSE) - (object Attribute - tool "DDL" - name "CompositeUnique" - value FALSE) - (object Attribute - tool "DDL" - name "CheckConstraint" - value ""))) - (object Attribute - tool "DDL" - name "HiddenTool" - value FALSE) - (object Attribute - tool "IDL" - name "propertyId" - value "809135966") - (object Attribute - tool "IDL" - name "default__Project" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "CreateMissingDirectories" - value TRUE) - (object Attribute - tool "IDL" - name "StopOnError" - value TRUE) - (object Attribute - tool "IDL" - name "Directory" - value "AUTO GENERATE") - (object Attribute - tool "IDL" - name "GeneratePreserveRegions" - value TRUE))) - (object Attribute - tool "IDL" - name "default__Class" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "ImplementationType" - value "") - (object Attribute - tool "IDL" - name "ConstValue" - value "") - (object Attribute - tool "IDL" - name "GenerateDefaultSpecifier" - value FALSE) - (object Attribute - tool "IDL" - name "DefaultSpecifier" - value "") - (object Attribute - tool "IDL" - name "IDLElement" - value TRUE) - (object Attribute - tool "IDL" - name "IDLSpecificationType" - value ("IDLSpecSet" 22)) - (object Attribute - tool "IDL" - name "IDLSpecSet" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "Interface" - value 22) - (object Attribute - tool "IDL" - name "Typedef" - value 54) - (object Attribute - tool "IDL" - name "Enumeration" - value 8) - (object Attribute - tool "IDL" - name "Const" - value 71) - (object Attribute - tool "IDL" - name "Exception" - value 61) - (object Attribute - tool "IDL" - name "Struct" - value 51) - (object Attribute - tool "IDL" - name "Union" - value 81))))) - (object Attribute - tool "IDL" - name "default__Module-Spec" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "Generate" - value TRUE) - (object Attribute - tool "IDL" - name "CmIdentification" - value (value Text " %X% @(#) plugins/org.eclipse.emf.ecore.sdo/model/SDO.mdl, emf.ecore.sdo, org.eclipse.dev")) - (object Attribute - tool "IDL" - name "CopyrightNotice" - value (value Text "")) - (object Attribute - tool "IDL" - name "FileName" - value "AUTO GENERATE") - (object Attribute - tool "IDL" - name "GenerateIDLModule" - value FALSE) - (object Attribute - tool "IDL" - name "InclusionProtectionSymbol" - value "AUTO GENERATE") - (object Attribute - tool "IDL" - name "AdditionalIncludes" - value (value Text "")) - (object Attribute - tool "IDL" - name "IncludeBySimpleName" - value FALSE))) - (object Attribute - tool "IDL" - name "default__Module-Body" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "CmIdentification" - value (value Text " %X% @(#) plugins/org.eclipse.emf.ecore.sdo/model/SDO.mdl, emf.ecore.sdo, org.eclipse.dev")) - (object Attribute - tool "IDL" - name "CopyrightNotice" - value (value Text "")) - (object Attribute - tool "IDL" - name "FileName" - value "AUTO GENERATE") - (object Attribute - tool "IDL" - name "AdditionalIncludes" - value (value Text "")) - (object Attribute - tool "IDL" - name "IncludeBySimpleName" - value FALSE))) - (object Attribute - tool "IDL" - name "default__Operation" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "OperationIsOneWay" - value FALSE) - (object Attribute - tool "IDL" - name "Context" - value "") - (object Attribute - tool "IDL" - name "Raises" - value ""))) - (object Attribute - tool "IDL" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "CaseSpecifier" - value "") - (object Attribute - tool "IDL" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "IDL" - name "DataMemberName" - value "$relationship") - (object Attribute - tool "IDL" - name "IsReadOnly" - value FALSE) - (object Attribute - tool "IDL" - name "IsConst" - value FALSE) - (object Attribute - tool "IDL" - name "ConstValue" - value ""))) - (object Attribute - tool "IDL" - name "default__Has" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "NameIfUnlabeled" - value "the_$supplier") - (object Attribute - tool "IDL" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "IDL" - name "DataMemberName" - value "$relationship") - (object Attribute - tool "IDL" - name "GenerateForwardReference" - value FALSE) - (object Attribute - tool "IDL" - name "IsReadOnly" - value FALSE) - (object Attribute - tool "IDL" - name "BoundedHasRelType" - value ("HasRelTypeSet" 47)) - (object Attribute - tool "IDL" - name "HasRelTypeSet" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "Array" - value 24) - (object Attribute - tool "IDL" - name "Sequence" - value 47))))) - (object Attribute - tool "IDL" - name "default__Role" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "NameIfUnlabeled" - value "the_$supplier") - (object Attribute - tool "IDL" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "IDL" - name "DataMemberName" - value "$relationship") - (object Attribute - tool "IDL" - name "GenerateForwardReference" - value FALSE) - (object Attribute - tool "IDL" - name "IsReadOnly" - value FALSE) - (object Attribute - tool "IDL" - name "BoundedRoleType" - value ("AssocTypeSet" 47)) - (object Attribute - tool "IDL" - name "AssocTypeSet" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "Array" - value 24) - (object Attribute - tool "IDL" - name "Sequence" - value 47))))) - (object Attribute - tool "IDL" - name "default__Uses" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "GenerateForwardReference" - value FALSE))) - (object Attribute - tool "IDL" - name "default__Subsystem" - value (list Attribute_Set - (object Attribute - tool "IDL" - name "Directory" - value "AUTO GENERATE"))) - (object Attribute - tool "IDL" - name "HiddenTool" - value FALSE) - (object Attribute - tool "SCC" - name "HiddenTool" - value FALSE) - (object Attribute - tool "Ecore" - name "propertyId" - value "809135969") - (object Attribute - tool "Ecore" - name "default__Category" - value (list Attribute_Set - (object Attribute - tool "Ecore" - name "packageName" - value "") - (object Attribute - tool "Ecore" - name "nsPrefix" - value "") - (object Attribute - tool "Ecore" - name "nsURI" - value "") - (object Attribute - tool "Ecore" - name "basePackage" - value "") - (object Attribute - tool "Ecore" - name "prefix" - value "") - (object Attribute - tool "Ecore" - name "annotation" - value ""))) - (object Attribute - tool "Ecore" - name "default__Class" - value (list Attribute_Set - (object Attribute - tool "Ecore" - name "classifierName" - value "") - (object Attribute - tool "Ecore" - name "xmlName" - value "") - (object Attribute - tool "Ecore" - name "xmlContentKind" - value ("ContentKind" 0)) - (object Attribute - tool "Ecore" - name "ContentKind" - value (list Attribute_Set - (object Attribute - tool "Ecore" - name "Unspecified" - value 0) - (object Attribute - tool "Ecore" - name "Empty" - value 1) - (object Attribute - tool "Ecore" - name "Simple" - value 2) - (object Attribute - tool "Ecore" - name "Mixed" - value 3) - (object Attribute - tool "Ecore" - name "ElementOnly" - value 4))) - (object Attribute - tool "Ecore" - name "annotation" - value ""))) - (object Attribute - tool "Ecore" - name "default__Operation" - value (list Attribute_Set - (object Attribute - tool "Ecore" - name "operationName" - value "") - (object Attribute - tool "Ecore" - name "annotation" - value ""))) - (object Attribute - tool "Ecore" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "Ecore" - name "attributeName" - value "") - (object Attribute - tool "Ecore" - name "isTransient" - value FALSE) - (object Attribute - tool "Ecore" - name "isVolatile" - value FALSE) - (object Attribute - tool "Ecore" - name "isChangeable" - value TRUE) - (object Attribute - tool "Ecore" - name "isUnsettable" - value FALSE) - (object Attribute - tool "Ecore" - name "isUnique" - value TRUE) - (object Attribute - tool "Ecore" - name "isID" - value FALSE) - (object Attribute - tool "Ecore" - name "xmlName" - value "") - (object Attribute - tool "Ecore" - name "xmlNamespace" - value "") - (object Attribute - tool "Ecore" - name "xmlFeatureKind" - value ("FeatureKind" 0)) - (object Attribute - tool "Ecore" - name "FeatureKind" - value (list Attribute_Set - (object Attribute - tool "Ecore" - name "Unspecified" - value 0) - (object Attribute - tool "Ecore" - name "Simple" - value 1) - (object Attribute - tool "Ecore" - name "Attribute" - value 2) - (object Attribute - tool "Ecore" - name "Element" - value 4))) - (object Attribute - tool "Ecore" - name "annotation" - value ""))) - (object Attribute - tool "Ecore" - name "default__Role" - value (list Attribute_Set - (object Attribute - tool "Ecore" - name "referenceName" - value "") - (object Attribute - tool "Ecore" - name "isTransient" - value FALSE) - (object Attribute - tool "Ecore" - name "isVolatile" - value FALSE) - (object Attribute - tool "Ecore" - name "isChangeable" - value TRUE) - (object Attribute - tool "Ecore" - name "isUnsettable" - value FALSE) - (object Attribute - tool "Ecore" - name "isResolveProxies" - value TRUE) - (object Attribute - tool "Ecore" - name "xmlName" - value "") - (object Attribute - tool "Ecore" - name "xmlNamespace" - value "") - (object Attribute - tool "Ecore" - name "xmlFeatureKind" - value ("FeatureKind" 0)) - (object Attribute - tool "Ecore" - name "FeatureKind" - value (list Attribute_Set - (object Attribute - tool "Ecore" - name "Unspecified" - value 0) - (object Attribute - tool "Ecore" - name "Simple" - value 1) - (object Attribute - tool "Ecore" - name "Attribute" - value 2) - (object Attribute - tool "Ecore" - name "Element" - value 4))) - (object Attribute - tool "Ecore" - name "annotation" - value ""))) - (object Attribute - tool "framework" - name "HiddenTool" - value FALSE) - (object Attribute - tool "Java" - name "propertyId" - value "809135966") - (object Attribute - tool "Java" - name "default__Project" - value (list Attribute_Set - (object Attribute - tool "Java" - name "CreateMissingDirectories" - value TRUE) - (object Attribute - tool "Java" - name "StopOnError" - value FALSE) - (object Attribute - tool "Java" - name "Directory" - value "AUTO GENERATE") - (object Attribute - tool "Java" - name "UsePrefixes" - value FALSE) - (object Attribute - tool "Java" - name "InstanceVariablePrefix" - value "m_") - (object Attribute - tool "Java" - name "ClassVariablePrefix" - value "s_") - (object Attribute - tool "Java" - name "DefaultAttributeDataType" - value "int") - (object Attribute - tool "Java" - name "DefaultOperationReturnType" - value "void"))) - (object Attribute - tool "Java" - name "default__Class" - value (list Attribute_Set - (object Attribute - tool "Java" - name "Final" - value FALSE) - (object Attribute - tool "Java" - name "GenerateDefaultConstructor" - value TRUE) - (object Attribute - tool "Java" - name "ConstructorIs" - value ("Ctor_Set" 62)) - (object Attribute - tool "Java" - name "Ctor_Set" - value (list Attribute_Set - (object Attribute - tool "Java" - name "Public" - value 62) - (object Attribute - tool "Java" - name "Protected" - value 63) - (object Attribute - tool "Java" - name "Private" - value 64))) - (object Attribute - tool "Java" - name "GenerateFinalizer" - value FALSE) - (object Attribute - tool "Java" - name "GenerateStaticInitializer" - value FALSE) - (object Attribute - tool "Java" - name "GenerateInstanceInitializer" - value FALSE))) - (object Attribute - tool "Java" - name "default__Module-Spec" - value (list Attribute_Set - (object Attribute - tool "Java" - name "Generate" - value TRUE) - (object Attribute - tool "Java" - name "CmIdentification" - value (value Text "")) - (object Attribute - tool "Java" - name "CopyrightNotice" - value (value Text "")) - (object Attribute - tool "Java" - name "AdditionalImports" - value (value Text "")))) - (object Attribute - tool "Java" - name "default__Module-Body" - value (list Attribute_Set - (object Attribute - tool "Java" - name "Generate" - value TRUE) - (object Attribute - tool "Java" - name "CmIdentification" - value (value Text "")) - (object Attribute - tool "Java" - name "CopyrightNotice" - value (value Text "")) - (object Attribute - tool "Java" - name "AdditionalImports" - value (value Text "")))) - (object Attribute - tool "Java" - name "default__Operation" - value (list Attribute_Set - (object Attribute - tool "Java" - name "Abstract" - value FALSE) - (object Attribute - tool "Java" - name "Static" - value FALSE) - (object Attribute - tool "Java" - name "Final" - value FALSE) - (object Attribute - tool "Java" - name "Native" - value FALSE) - (object Attribute - tool "Java" - name "Synchronized" - value FALSE))) - (object Attribute - tool "Java" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "Java" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "Java" - name "Final" - value FALSE) - (object Attribute - tool "Java" - name "Transient" - value FALSE) - (object Attribute - tool "Java" - name "Volatile" - value FALSE))) - (object Attribute - tool "Java" - name "default__Role" - value (list Attribute_Set - (object Attribute - tool "Java" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "Java" - name "ContainerClass" - value "") - (object Attribute - tool "Java" - name "InitialValue" - value "") - (object Attribute - tool "Java" - name "Final" - value FALSE) - (object Attribute - tool "Java" - name "Transient" - value FALSE) - (object Attribute - tool "Java" - name "Volatile" - value FALSE))) - (object Attribute - tool "Java" - name "HiddenTool" - value FALSE) - (object Attribute - tool "Oracle8" - name "propertyId" - value "360000002") - (object Attribute - tool "Oracle8" - name "default__Project" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "DDLScriptFilename" - value "DDL1.SQL") - (object Attribute - tool "Oracle8" - name "DropClause" - value FALSE) - (object Attribute - tool "Oracle8" - name "PrimaryKeyColumnName" - value "_ID") - (object Attribute - tool "Oracle8" - name "PrimaryKeyColumnType" - value "NUMBER(5,0)") - (object Attribute - tool "Oracle8" - name "SchemaNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "SchemaNameSuffix" - value "") - (object Attribute - tool "Oracle8" - name "TableNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "TableNameSuffix" - value "") - (object Attribute - tool "Oracle8" - name "TypeNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "TypeNameSuffix" - value "") - (object Attribute - tool "Oracle8" - name "ViewNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "ViewNameSuffix" - value "") - (object Attribute - tool "Oracle8" - name "VarrayNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "VarrayNameSuffix" - value "") - (object Attribute - tool "Oracle8" - name "NestedTableNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "NestedTableNameSuffix" - value "") - (object Attribute - tool "Oracle8" - name "ObjectTableNamePrefix" - value "") - (object Attribute - tool "Oracle8" - name "ObjectTableNameSuffix" - value ""))) - (object Attribute - tool "Oracle8" - name "default__Module-Spec" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "IsSchema" - value FALSE))) - (object Attribute - tool "Oracle8" - name "default__Class" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "OID" - value "") - (object Attribute - tool "Oracle8" - name "WhereClause" - value "") - (object Attribute - tool "Oracle8" - name "CheckConstraint" - value "") - (object Attribute - tool "Oracle8" - name "CollectionTypeLength" - value "") - (object Attribute - tool "Oracle8" - name "CollectionTypePrecision" - value "") - (object Attribute - tool "Oracle8" - name "CollectionTypeScale" - value "") - (object Attribute - tool "Oracle8" - name "CollectionOfREFS" - value FALSE))) - (object Attribute - tool "Oracle8" - name "default__Operation" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "MethodKind" - value ("MethodKindSet" 1903)) - (object Attribute - tool "Oracle8" - name "OverloadID" - value "") - (object Attribute - tool "Oracle8" - name "OrderNumber" - value "") - (object Attribute - tool "Oracle8" - name "IsReadNoDataState" - value FALSE) - (object Attribute - tool "Oracle8" - name "IsReadNoProcessState" - value FALSE) - (object Attribute - tool "Oracle8" - name "IsWriteNoDataState" - value FALSE) - (object Attribute - tool "Oracle8" - name "IsWriteNoProcessState" - value FALSE) - (object Attribute - tool "Oracle8" - name "IsSelfish" - value FALSE) - (object Attribute - tool "Oracle8" - name "TriggerType" - value ("TriggerTypeSet" 1801)) - (object Attribute - tool "Oracle8" - name "TriggerEvent" - value ("TriggerEventSet" 1601)) - (object Attribute - tool "Oracle8" - name "TriggerText" - value "") - (object Attribute - tool "Oracle8" - name "TriggerReferencingNames" - value "") - (object Attribute - tool "Oracle8" - name "TriggerForEach" - value ("TriggerForEachSet" 1701)) - (object Attribute - tool "Oracle8" - name "TriggerWhenClause" - value "") - (object Attribute - tool "Oracle8" - name "MethodKindSet" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "MapMethod" - value 1901) - (object Attribute - tool "Oracle8" - name "OrderMethod" - value 1902) - (object Attribute - tool "Oracle8" - name "Function" - value 1903) - (object Attribute - tool "Oracle8" - name "Procedure" - value 1904) - (object Attribute - tool "Oracle8" - name "Operator" - value 1905) - (object Attribute - tool "Oracle8" - name "Constructor" - value 1906) - (object Attribute - tool "Oracle8" - name "Destructor" - value 1907) - (object Attribute - tool "Oracle8" - name "Trigger" - value 1908) - (object Attribute - tool "Oracle8" - name "Calculated" - value 1909))) - (object Attribute - tool "Oracle8" - name "TriggerTypeSet" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "AFTER" - value 1801) - (object Attribute - tool "Oracle8" - name "BEFORE" - value 1802) - (object Attribute - tool "Oracle8" - name "INSTEAD OF" - value 1803))) - (object Attribute - tool "Oracle8" - name "TriggerForEachSet" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "ROW" - value 1701) - (object Attribute - tool "Oracle8" - name "STATEMENT" - value 1702))) - (object Attribute - tool "Oracle8" - name "TriggerEventSet" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "INSERT" - value 1601) - (object Attribute - tool "Oracle8" - name "UPDATE" - value 1602) - (object Attribute - tool "Oracle8" - name "DELETE" - value 1603) - (object Attribute - tool "Oracle8" - name "INSERT OR UPDATE" - value 1604) - (object Attribute - tool "Oracle8" - name "INSERT OR DELETE" - value 1605) - (object Attribute - tool "Oracle8" - name "UPDATE OR DELETE" - value 1606) - (object Attribute - tool "Oracle8" - name "INSERT OR UPDATE OR DELETE" - value 1607))))) - (object Attribute - tool "Oracle8" - name "default__Role" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "OrderNumber" - value ""))) - (object Attribute - tool "Oracle8" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "Oracle8" - name "OrderNumber" - value "") - (object Attribute - tool "Oracle8" - name "IsUnique" - value FALSE) - (object Attribute - tool "Oracle8" - name "NullsAllowed" - value TRUE) - (object Attribute - tool "Oracle8" - name "Length" - value "") - (object Attribute - tool "Oracle8" - name "Precision" - value "2") - (object Attribute - tool "Oracle8" - name "Scale" - value "6") - (object Attribute - tool "Oracle8" - name "IsIndex" - value FALSE) - (object Attribute - tool "Oracle8" - name "IsPrimaryKey" - value FALSE) - (object Attribute - tool "Oracle8" - name "CompositeUnique" - value FALSE) - (object Attribute - tool "Oracle8" - name "CheckConstraint" - value ""))) - (object Attribute - tool "Oracle8" - name "HiddenTool" - value FALSE) - (object Attribute - tool "Repository" - name "HiddenTool" - value FALSE) - (object Attribute - tool "cg" - name "propertyId" - value "809135966") - (object Attribute - tool "cg" - name "default__Project" - value (list Attribute_Set - (object Attribute - tool "cg" - name "UseMSVC" - value FALSE) - (object Attribute - tool "cg" - name "HeaderFileExtension" - value "h") - (object Attribute - tool "cg" - name "HeaderFileBackupExtension" - value "h~") - (object Attribute - tool "cg" - name "HeaderFileTemporaryExtension" - value "h#") - (object Attribute - tool "cg" - name "CodeFileExtension" - value "cpp") - (object Attribute - tool "cg" - name "CodeFileBackupExtension" - value "cp~") - (object Attribute - tool "cg" - name "CodeFileTemporaryExtension" - value "cp#") - (object Attribute - tool "cg" - name "CreateMissingDirectories" - value TRUE) - (object Attribute - tool "cg" - name "StopOnError" - value FALSE) - (object Attribute - tool "cg" - name "ErrorLimit" - value 30) - (object Attribute - tool "cg" - name "Directory" - value "$ROSECPP_SOURCE") - (object Attribute - tool "cg" - name "PathSeparator" - value "") - (object Attribute - tool "cg" - name "FileNameFormat" - value "128vx_b") - (object Attribute - tool "cg" - name "BooleanType" - value "int") - (object Attribute - tool "cg" - name "AllowTemplates" - value TRUE) - (object Attribute - tool "cg" - name "AllowExplicitInstantiations" - value TRUE) - (object Attribute - tool "cg" - name "AllowProtectedInheritance" - value TRUE) - (object Attribute - tool "cg" - name "CommentWidth" - value 60) - (object Attribute - tool "cg" - name "OneByValueContainer" - value "$targetClass") - (object Attribute - tool "cg" - name "OneByReferenceContainer" - value "$targetClass *") - (object Attribute - tool "cg" - name "OptionalByValueContainer" - value "OptionalByValue<$targetClass>") - (object Attribute - tool "cg" - name "OptionalByReferenceContainer" - value "$targetClass *") - (object Attribute - tool "cg" - name "FixedByValueContainer" - value "$targetClass[$limit]") - (object Attribute - tool "cg" - name "UnorderedFixedByValueContainer" - value "$targetClass[$limit]") - (object Attribute - tool "cg" - name "FixedByReferenceContainer" - value "$targetClass *[$limit]") - (object Attribute - tool "cg" - name "UnorderedFixedByReferenceContainer" - value "$targetClass *[$limit]") - (object Attribute - tool "cg" - name "BoundedByValueContainer" - value "BoundedListByValue<$targetClass,$limit>") - (object Attribute - tool "cg" - name "UnorderedBoundedByValueContainer" - value "BoundedSetByValue<$targetClass,$limit>") - (object Attribute - tool "cg" - name "BoundedByReferenceContainer" - value "BoundedListByReference<$targetClass,$limit>") - (object Attribute - tool "cg" - name "UnorderedBoundedByReferenceContainer" - value "BoundedSetByReference<$targetClass,$limit>") - (object Attribute - tool "cg" - name "UnboundedByValueContainer" - value "UnboundedListByValue<$targetClass>") - (object Attribute - tool "cg" - name "UnorderedUnboundedByValueContainer" - value "UnboundedSetByValue<$targetClass>") - (object Attribute - tool "cg" - name "UnboundedByReferenceContainer" - value "UnboundedListByReference<$targetClass>") - (object Attribute - tool "cg" - name "UnorderedUnboundedByReferenceContainer" - value "UnboundedSetByReference<$targetClass>") - (object Attribute - tool "cg" - name "QualifiedByValueContainer" - value "AssociationByValue<$qualtype, $qualcont>") - (object Attribute - tool "cg" - name "UnorderedQualifiedByValueContainer" - value "DictionaryByValue<$qualtype, $qualcont>") - (object Attribute - tool "cg" - name "QualifiedByReferenceContainer" - value "AssociationByReference<$qualtype, $qualcont>") - (object Attribute - tool "cg" - name "UnorderedQualifiedByReferenceContainer" - value "DictionaryByReference<$qualtype, $qualcont>") - (object Attribute - tool "cg" - name "GeneratePreserveRegions" - value TRUE))) - (object Attribute - tool "cg" - name "default__Class" - value (list Attribute_Set - (object Attribute - tool "cg" - name "CodeName" - value "") - (object Attribute - tool "cg" - name "ImplementationType" - value "") - (object Attribute - tool "cg" - name "ClassKey" - value "class") - (object Attribute - tool "cg" - name "GenerateEmptyRegions" - value ("GenerateEmptyRegionSet" 3)) - (object Attribute - tool "cg" - name "GenerateEmptyRegionSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "None" - value 0) - (object Attribute - tool "cg" - name "Preserved" - value 1) - (object Attribute - tool "cg" - name "Unpreserved" - value 2) - (object Attribute - tool "cg" - name "All" - value 3))) - (object Attribute - tool "cg" - name "PutBodiesInSpec" - value FALSE) - (object Attribute - tool "cg" - name "GenerateDefaultConstructor" - value ("GenerateSet" 199)) - (object Attribute - tool "cg" - name "DefaultConstructorVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "InlineDefaultConstructor" - value FALSE) - (object Attribute - tool "cg" - name "ExplicitDefaultConstructor" - value FALSE) - (object Attribute - tool "cg" - name "GenerateCopyConstructor" - value ("GenerateSet" 199)) - (object Attribute - tool "cg" - name "CopyConstructorVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "InlineCopyConstructor" - value FALSE) - (object Attribute - tool "cg" - name "ExplicitCopyConstructor" - value FALSE) - (object Attribute - tool "cg" - name "GenerateDestructor" - value TRUE) - (object Attribute - tool "cg" - name "DestructorVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "DestructorKind" - value ("ThreeKindSet" 200)) - (object Attribute - tool "cg" - name "InlineDestructor" - value FALSE) - (object Attribute - tool "cg" - name "GenerateAssignmentOperation" - value ("GenerateSet" 199)) - (object Attribute - tool "cg" - name "AssignmentVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "AssignmentKind" - value ("ThreeKindSet" 200)) - (object Attribute - tool "cg" - name "InlineAssignmentOperation" - value FALSE) - (object Attribute - tool "cg" - name "GenerateEqualityOperations" - value ("GenerateSet" 199)) - (object Attribute - tool "cg" - name "EqualityVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "EqualityKind" - value ("FriendKindSet" 200)) - (object Attribute - tool "cg" - name "InlineEqualityOperations" - value FALSE) - (object Attribute - tool "cg" - name "GenerateRelationalOperations" - value FALSE) - (object Attribute - tool "cg" - name "RelationalVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "RelationalKind" - value ("FriendKindSet" 200)) - (object Attribute - tool "cg" - name "InlineRelationalOperations" - value FALSE) - (object Attribute - tool "cg" - name "GenerateStorageMgmtOperations" - value FALSE) - (object Attribute - tool "cg" - name "StorageMgmtVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "InlineStorageMgmtOperations" - value FALSE) - (object Attribute - tool "cg" - name "GenerateSubscriptOperation" - value FALSE) - (object Attribute - tool "cg" - name "SubscriptVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "SubscriptKind" - value ("ThreeKindSet" 200)) - (object Attribute - tool "cg" - name "SubscriptResultType" - value "") - (object Attribute - tool "cg" - name "InlineSubscriptOperation" - value FALSE) - (object Attribute - tool "cg" - name "GenerateDereferenceOperation" - value FALSE) - (object Attribute - tool "cg" - name "DereferenceVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "DereferenceKind" - value ("ThreeKindSet" 200)) - (object Attribute - tool "cg" - name "DereferenceResultType" - value "") - (object Attribute - tool "cg" - name "InlineDereferenceOperation" - value FALSE) - (object Attribute - tool "cg" - name "GenerateIndirectionOperation" - value FALSE) - (object Attribute - tool "cg" - name "IndirectionVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "IndirectionKind" - value ("ThreeKindSet" 200)) - (object Attribute - tool "cg" - name "IndirectionResultType" - value "") - (object Attribute - tool "cg" - name "InlineIndirectionOperation" - value FALSE) - (object Attribute - tool "cg" - name "GenerateStreamOperations" - value FALSE) - (object Attribute - tool "cg" - name "StreamVisibility" - value ("VisibilitySet" 45)) - (object Attribute - tool "cg" - name "InlineStreamOperations" - value FALSE) - (object Attribute - tool "cg" - name "ThreeKindSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202))) - (object Attribute - tool "cg" - name "KindSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202) - (object Attribute - tool "cg" - name "Static" - value 203))) - (object Attribute - tool "cg" - name "FriendKindSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202) - (object Attribute - tool "cg" - name "Friend" - value 204))) - (object Attribute - tool "cg" - name "GenerateSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "DeclareAndDefine" - value 199) - (object Attribute - tool "cg" - name "DeclareOnly" - value 205) - (object Attribute - tool "cg" - name "DoNotDeclare" - value 206))) - (object Attribute - tool "cg" - name "VisibilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Public" - value 45) - (object Attribute - tool "cg" - name "Protected" - value 44) - (object Attribute - tool "cg" - name "Private" - value 43) - (object Attribute - tool "cg" - name "Implementation" - value 14))) - (object Attribute - tool "cg" - name "ConstValue" - value "") - (object Attribute - tool "cg" - name "GenerateDefaultSpecifier" - value FALSE) - (object Attribute - tool "cg" - name "DefaultSpecifier" - value ""))) - (object Attribute - tool "cg" - name "default__Module-Spec" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Generate" - value TRUE) - (object Attribute - tool "cg" - name "GenerateEmptyRegions" - value ("GenerateEmptyRegionSet" 3)) - (object Attribute - tool "cg" - name "GenerateEmptyRegionSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "None" - value 0) - (object Attribute - tool "cg" - name "Preserved" - value 1) - (object Attribute - tool "cg" - name "Unpreserved" - value 2) - (object Attribute - tool "cg" - name "All" - value 3))) - (object Attribute - tool "cg" - name "CmIdentification" - value (value Text " %X% %Q% %Z% %W%")) - (object Attribute - tool "cg" - name "CopyrightNotice" - value (value Text "")) - (object Attribute - tool "cg" - name "FileName" - value "AUTO GENERATE") - (object Attribute - tool "cg" - name "AllowExtensionlessFileName" - value FALSE) - (object Attribute - tool "cg" - name "InclusionProtectionSymbol" - value "AUTO GENERATE") - (object Attribute - tool "cg" - name "IncludeFormat" - value (value Text -|// $package -|#include "$file" -| - )) - (object Attribute - tool "cg" - name "IncludeBySimpleName" - value FALSE) - (object Attribute - tool "cg" - name "IncludePrecompiledHeader" - value FALSE) - (object Attribute - tool "cg" - name "IncludeOrder" - value "AMIR") - (object Attribute - tool "cg" - name "AdditionalIncludes" - value (value Text "")) - (object Attribute - tool "cg" - name "InliningStyle" - value ("InliningStyleSet" 207)) - (object Attribute - tool "cg" - name "InliningStyleSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "InClassDeclaration" - value 208) - (object Attribute - tool "cg" - name "FollowingClassDeclaration" - value 207))) - (object Attribute - tool "cg" - name "TypesDefined" - value (value Text "")) - (object Attribute - tool "cg" - name "IncludeClosure" - value (value Text "")))) - (object Attribute - tool "cg" - name "default__Module-Body" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Generate" - value TRUE) - (object Attribute - tool "cg" - name "GenerateEmptyRegions" - value ("GenerateEmptyRegionSet" 3)) - (object Attribute - tool "cg" - name "GenerateEmptyRegionSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "None" - value 0) - (object Attribute - tool "cg" - name "Preserved" - value 1) - (object Attribute - tool "cg" - name "Unpreserved" - value 2) - (object Attribute - tool "cg" - name "All" - value 3))) - (object Attribute - tool "cg" - name "CmIdentification" - value (value Text " %X% %Q% %Z% %W%")) - (object Attribute - tool "cg" - name "CopyrightNotice" - value (value Text "")) - (object Attribute - tool "cg" - name "FileName" - value "AUTO GENERATE") - (object Attribute - tool "cg" - name "AllowExtensionlessFileName" - value FALSE) - (object Attribute - tool "cg" - name "IncludeFormat" - value (value Text -|// $package -|#include "$file" -| - )) - (object Attribute - tool "cg" - name "IncludeBySimpleName" - value FALSE) - (object Attribute - tool "cg" - name "IncludePrecompiledHeader" - value TRUE) - (object Attribute - tool "cg" - name "IncludeOrder" - value "AMIR") - (object Attribute - tool "cg" - name "AdditionalIncludes" - value (value Text "")) - (object Attribute - tool "cg" - name "InliningStyle" - value ("InliningStyleSet" 207)) - (object Attribute - tool "cg" - name "InliningStyleSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "InClassDeclaration" - value 208) - (object Attribute - tool "cg" - name "FollowingClassDeclaration" - value 207))) - (object Attribute - tool "cg" - name "TypesDefined" - value (value Text "")) - (object Attribute - tool "cg" - name "IncludeClosure" - value (value Text "")))) - (object Attribute - tool "cg" - name "default__Operation" - value (list Attribute_Set - (object Attribute - tool "cg" - name "CodeName" - value "") - (object Attribute - tool "cg" - name "OperationKind" - value ("OperationKindSet" 200)) - (object Attribute - tool "cg" - name "OperationKindSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202) - (object Attribute - tool "cg" - name "Static" - value 203) - (object Attribute - tool "cg" - name "Friend" - value 204))) - (object Attribute - tool "cg" - name "OperationIsConst" - value FALSE) - (object Attribute - tool "cg" - name "OperationIsExplicit" - value FALSE) - (object Attribute - tool "cg" - name "Inline" - value FALSE) - (object Attribute - tool "cg" - name "EntryCode" - value (value Text "")) - (object Attribute - tool "cg" - name "ExitCode" - value (value Text "")) - (object Attribute - tool "cg" - name "GenerateEmptyRegions" - value ("GenerateEmptyRegionSet" 3)) - (object Attribute - tool "cg" - name "GenerateEmptyRegionSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "None" - value 0) - (object Attribute - tool "cg" - name "Preserved" - value 1) - (object Attribute - tool "cg" - name "Unpreserved" - value 2) - (object Attribute - tool "cg" - name "All" - value 3))) - (object Attribute - tool "cg" - name "BodyAnnotations" - value "") - (object Attribute - tool "cg" - name "OperationIsOneWay" - value FALSE) - (object Attribute - tool "cg" - name "Context" - value "") - (object Attribute - tool "cg" - name "Raises" - value ""))) - (object Attribute - tool "cg" - name "default__Has" - value (list Attribute_Set - (object Attribute - tool "cg" - name "CodeName" - value "") - (object Attribute - tool "cg" - name "Ordered" - value TRUE) - (object Attribute - tool "cg" - name "NameIfUnlabeled" - value "the_$supplier") - (object Attribute - tool "cg" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "cg" - name "DataMemberName" - value "$relationship") - (object Attribute - tool "cg" - name "DataMemberVisibility" - value ("DataMemberVisibilitySet" 14)) - (object Attribute - tool "cg" - name "DataMemberVisibilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Public" - value 45) - (object Attribute - tool "cg" - name "Protected" - value 44) - (object Attribute - tool "cg" - name "Private" - value 43) - (object Attribute - tool "cg" - name "Implementation" - value 14) - (object Attribute - tool "cg" - name "AtRelationshipVisibility" - value 210))) - (object Attribute - tool "cg" - name "DataMemberMutability" - value ("DataMemberMutabilitySet" 0)) - (object Attribute - tool "cg" - name "DataMemberMutabilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Unrestricted" - value 0) - (object Attribute - tool "cg" - name "Mutable" - value 1) - (object Attribute - tool "cg" - name "Const" - value 2))) - (object Attribute - tool "cg" - name "DataMemberIsVolatile" - value FALSE) - (object Attribute - tool "cg" - name "DataMemberFieldSize" - value "") - (object Attribute - tool "cg" - name "InitialValue" - value (value Text "")) - (object Attribute - tool "cg" - name "GenerateGetOperation" - value TRUE) - (object Attribute - tool "cg" - name "GenerateSetOperation" - value TRUE) - (object Attribute - tool "cg" - name "GetName" - value "get_$relationship") - (object Attribute - tool "cg" - name "SetName" - value "set_$relationship") - (object Attribute - tool "cg" - name "GetSetKinds" - value ("GetSetKindsSet" 200)) - (object Attribute - tool "cg" - name "GetSetKindsSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202) - (object Attribute - tool "cg" - name "Static" - value 203) - (object Attribute - tool "cg" - name "Friend" - value 204))) - (object Attribute - tool "cg" - name "ContainerClass" - value "") - (object Attribute - tool "cg" - name "SelectorName" - value "") - (object Attribute - tool "cg" - name "SelectorType" - value "") - (object Attribute - tool "cg" - name "GetIsConst" - value TRUE) - (object Attribute - tool "cg" - name "GetResultIsConst" - value ("GetResultIsConstSet" 2)) - (object Attribute - tool "cg" - name "GetResultIsConstSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "False" - value 0) - (object Attribute - tool "cg" - name "True" - value 1) - (object Attribute - tool "cg" - name "Same_As_Function" - value 2))) - (object Attribute - tool "cg" - name "GetSetByReference" - value FALSE) - (object Attribute - tool "cg" - name "InlineGet" - value TRUE) - (object Attribute - tool "cg" - name "SetReturnsValue" - value FALSE) - (object Attribute - tool "cg" - name "InlineSet" - value TRUE) - (object Attribute - tool "cg" - name "ForwardReferenceOnly" - value FALSE) - (object Attribute - tool "cg" - name "GenerateForwardReference" - value FALSE) - (object Attribute - tool "cg" - name "IsReadOnly" - value FALSE) - (object Attribute - tool "cg" - name "BoundedHasRelType" - value ("HasRelTypeSet" 47)) - (object Attribute - tool "cg" - name "HasRelTypeSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Array" - value 24) - (object Attribute - tool "cg" - name "Sequence" - value 47))))) - (object Attribute - tool "cg" - name "default__Association" - value (list Attribute_Set - (object Attribute - tool "cg" - name "NameIfUnlabeled" - value "the_$targetClass"))) - (object Attribute - tool "cg" - name "default__Inherit" - value (list Attribute_Set - (object Attribute - tool "cg" - name "InstanceArguments" - value ""))) - (object Attribute - tool "cg" - name "default__Role" - value (list Attribute_Set - (object Attribute - tool "cg" - name "CodeName" - value "") - (object Attribute - tool "cg" - name "ForwardReferenceOnly" - value FALSE) - (object Attribute - tool "cg" - name "NameIfUnlabeled" - value "the_$targetClass") - (object Attribute - tool "cg" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "cg" - name "DataMemberName" - value "$target") - (object Attribute - tool "cg" - name "DataMemberVisibility" - value ("DataMemberVisibilitySet" 14)) - (object Attribute - tool "cg" - name "DataMemberVisibilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Public" - value 45) - (object Attribute - tool "cg" - name "Protected" - value 44) - (object Attribute - tool "cg" - name "Private" - value 43) - (object Attribute - tool "cg" - name "Implementation" - value 14) - (object Attribute - tool "cg" - name "AtRelationshipVisibility" - value 210))) - (object Attribute - tool "cg" - name "DataMemberMutability" - value ("DataMemberMutabilitySet" 0)) - (object Attribute - tool "cg" - name "DataMemberMutabilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Unrestricted" - value 0) - (object Attribute - tool "cg" - name "Mutable" - value 1) - (object Attribute - tool "cg" - name "Const" - value 2))) - (object Attribute - tool "cg" - name "DataMemberIsVolatile" - value FALSE) - (object Attribute - tool "cg" - name "DataMemberFieldSize" - value "") - (object Attribute - tool "cg" - name "InitialValue" - value (value Text "")) - (object Attribute - tool "cg" - name "ContainerClass" - value "") - (object Attribute - tool "cg" - name "ContainerGet" - value "$data.get($keys)") - (object Attribute - tool "cg" - name "ContainerSet" - value "$data.set($keys,$value)") - (object Attribute - tool "cg" - name "QualifiedContainer" - value "") - (object Attribute - tool "cg" - name "AssocClassContainer" - value "$supplier *") - (object Attribute - tool "cg" - name "AssocClassInitialValue" - value (value Text "")) - (object Attribute - tool "cg" - name "GetSetKinds" - value ("GetSetKindsSet" 200)) - (object Attribute - tool "cg" - name "GetSetKindsSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202) - (object Attribute - tool "cg" - name "Static" - value 203) - (object Attribute - tool "cg" - name "Friend" - value 204))) - (object Attribute - tool "cg" - name "GetSetByReference" - value FALSE) - (object Attribute - tool "cg" - name "GenerateGetOperation" - value TRUE) - (object Attribute - tool "cg" - name "GetName" - value "get_$target") - (object Attribute - tool "cg" - name "GetIsConst" - value TRUE) - (object Attribute - tool "cg" - name "GetResultIsConst" - value ("GetResultIsConstSet" 2)) - (object Attribute - tool "cg" - name "GetResultIsConstSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "False" - value 0) - (object Attribute - tool "cg" - name "True" - value 1) - (object Attribute - tool "cg" - name "Same_As_Function" - value 2))) - (object Attribute - tool "cg" - name "InlineGet" - value TRUE) - (object Attribute - tool "cg" - name "GenerateSetOperation" - value TRUE) - (object Attribute - tool "cg" - name "SetName" - value "set_$target") - (object Attribute - tool "cg" - name "SetReturnsValue" - value FALSE) - (object Attribute - tool "cg" - name "InlineSet" - value TRUE) - (object Attribute - tool "cg" - name "QualifiedGetSetByReference" - value ("QualifiedGetSetByReferenceSet" 2)) - (object Attribute - tool "cg" - name "QualifiedGetSetByReferenceSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "False" - value 0) - (object Attribute - tool "cg" - name "True" - value 1) - (object Attribute - tool "cg" - name "Same_As_GetSetByReference" - value 2))) - (object Attribute - tool "cg" - name "GenerateQualifiedGetOperation" - value TRUE) - (object Attribute - tool "cg" - name "QualifiedGetName" - value "get_$target") - (object Attribute - tool "cg" - name "QualifiedGetIsConst" - value TRUE) - (object Attribute - tool "cg" - name "QualifiedGetResultIsConst" - value ("GetResultIsConstSet" 2)) - (object Attribute - tool "cg" - name "InlineQualifiedGet" - value TRUE) - (object Attribute - tool "cg" - name "GenerateQualifiedSetOperation" - value TRUE) - (object Attribute - tool "cg" - name "QualifiedSetName" - value "set_$target") - (object Attribute - tool "cg" - name "QualifiedSetReturnsValue" - value FALSE) - (object Attribute - tool "cg" - name "InlineQualifiedSet" - value TRUE) - (object Attribute - tool "cg" - name "GenerateAssocClassDataMember" - value TRUE) - (object Attribute - tool "cg" - name "AssocClassDataMemberName" - value "$target") - (object Attribute - tool "cg" - name "AssocClassDataMemberVisibility" - value ("DataMemberVisibilitySet" 14)) - (object Attribute - tool "cg" - name "DataMemberVisibilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Public" - value 45) - (object Attribute - tool "cg" - name "Protected" - value 44) - (object Attribute - tool "cg" - name "Private" - value 43) - (object Attribute - tool "cg" - name "Implementation" - value 14) - (object Attribute - tool "cg" - name "AtRelationshipVisibility" - value 210))) - (object Attribute - tool "cg" - name "AssocClassDataMemberMutability" - value ("DataMemberMutabilitySet" 0)) - (object Attribute - tool "cg" - name "DataMemberMutabilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Unrestricted" - value 0) - (object Attribute - tool "cg" - name "Mutable" - value 1) - (object Attribute - tool "cg" - name "Const" - value 2))) - (object Attribute - tool "cg" - name "AssocClassDataMemberIsVolatile" - value FALSE) - (object Attribute - tool "cg" - name "AssocClassGetSetKinds" - value ("GetSetKindsSet" 200)) - (object Attribute - tool "cg" - name "GenerateAssocClassGetOperation" - value TRUE) - (object Attribute - tool "cg" - name "AssocClassGetName" - value "get_$target") - (object Attribute - tool "cg" - name "AssocClassGetIsConst" - value TRUE) - (object Attribute - tool "cg" - name "AssocClassGetResultIsConst" - value ("GetResultIsConstSet" 2)) - (object Attribute - tool "cg" - name "InlineAssocClassGet" - value TRUE) - (object Attribute - tool "cg" - name "GenerateAssocClassSetOperation" - value TRUE) - (object Attribute - tool "cg" - name "AssocClassSetName" - value "set_$target") - (object Attribute - tool "cg" - name "AssocClassSetReturnsValue" - value FALSE) - (object Attribute - tool "cg" - name "InlineAssocClassSet" - value TRUE) - (object Attribute - tool "cg" - name "AssocClassForwardReferenceOnly" - value TRUE) - (object Attribute - tool "cg" - name "GenerateForwardReference" - value FALSE) - (object Attribute - tool "cg" - name "IsReadOnly" - value FALSE) - (object Attribute - tool "cg" - name "BoundedRoleType" - value ("AssocTypeSet" 47)) - (object Attribute - tool "cg" - name "AssocTypeSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Array" - value 24) - (object Attribute - tool "cg" - name "Sequence" - value 47))))) - (object Attribute - tool "cg" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "cg" - name "CodeName" - value "") - (object Attribute - tool "cg" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "cg" - name "DataMemberName" - value "$attribute") - (object Attribute - tool "cg" - name "DataMemberVisibility" - value ("DataMemberVisibilitySet" 14)) - (object Attribute - tool "cg" - name "DataMemberVisibilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Public" - value 45) - (object Attribute - tool "cg" - name "Protected" - value 44) - (object Attribute - tool "cg" - name "Private" - value 43) - (object Attribute - tool "cg" - name "Implementation" - value 14) - (object Attribute - tool "cg" - name "AtAttributeVisibility" - value 211))) - (object Attribute - tool "cg" - name "DataMemberMutability" - value ("DataMemberMutabilitySet" 0)) - (object Attribute - tool "cg" - name "DataMemberMutabilitySet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Unrestricted" - value 0) - (object Attribute - tool "cg" - name "Mutable" - value 1) - (object Attribute - tool "cg" - name "Const" - value 2))) - (object Attribute - tool "cg" - name "DataMemberIsVolatile" - value FALSE) - (object Attribute - tool "cg" - name "DataMemberFieldSize" - value "") - (object Attribute - tool "cg" - name "GenerateGetOperation" - value TRUE) - (object Attribute - tool "cg" - name "GenerateSetOperation" - value TRUE) - (object Attribute - tool "cg" - name "GetName" - value "get_$attribute") - (object Attribute - tool "cg" - name "SetName" - value "set_$attribute") - (object Attribute - tool "cg" - name "GetSetKinds" - value ("GetSetKindsSet" 200)) - (object Attribute - tool "cg" - name "GetSetKindsSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Common" - value 200) - (object Attribute - tool "cg" - name "Virtual" - value 201) - (object Attribute - tool "cg" - name "Abstract" - value 202) - (object Attribute - tool "cg" - name "Static" - value 203) - (object Attribute - tool "cg" - name "Friend" - value 204))) - (object Attribute - tool "cg" - name "GetIsConst" - value TRUE) - (object Attribute - tool "cg" - name "GetResultIsConst" - value ("GetResultIsConstSet" 2)) - (object Attribute - tool "cg" - name "GetResultIsConstSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "False" - value 0) - (object Attribute - tool "cg" - name "True" - value 1) - (object Attribute - tool "cg" - name "Same_As_Function" - value 2))) - (object Attribute - tool "cg" - name "GetSetByReference" - value FALSE) - (object Attribute - tool "cg" - name "InlineGet" - value TRUE) - (object Attribute - tool "cg" - name "SetReturnsValue" - value FALSE) - (object Attribute - tool "cg" - name "InlineSet" - value TRUE) - (object Attribute - tool "cg" - name "CaseSpecifier" - value "") - (object Attribute - tool "cg" - name "IsReadOnly" - value FALSE))) - (object Attribute - tool "cg" - name "default__Uses" - value (list Attribute_Set - (object Attribute - tool "cg" - name "ForwardReferenceOnly" - value FALSE) - (object Attribute - tool "cg" - name "BodyReferenceOnly" - value FALSE) - (object Attribute - tool "cg" - name "GenerateForwardReference" - value FALSE))) - (object Attribute - tool "cg" - name "default__Subsystem" - value (list Attribute_Set - (object Attribute - tool "cg" - name "Directory" - value "AUTO GENERATE") - (object Attribute - tool "cg" - name "DirectoryIsOnSearchList" - value FALSE) - (object Attribute - tool "cg" - name "PrecompiledHeader" - value ""))) - (object Attribute - tool "cg" - name "default__Category" - value (list Attribute_Set - (object Attribute - tool "cg" - name "IsNamespace" - value FALSE) - (object Attribute - tool "cg" - name "Indent" - value 2) - (object Attribute - tool "cg" - name "CodeName" - value "") - (object Attribute - tool "cg" - name "GenerateEmptyRegions" - value ("GenerateEmptyRegionSet" 3)) - (object Attribute - tool "cg" - name "GenerateEmptyRegionSet" - value (list Attribute_Set - (object Attribute - tool "cg" - name "None" - value 0) - (object Attribute - tool "cg" - name "Preserved" - value 1) - (object Attribute - tool "cg" - name "Unpreserved" - value 2) - (object Attribute - tool "cg" - name "All" - value 3))))) - (object Attribute - tool "MSVC" - name "propertyId" - value "809135966") - (object Attribute - tool "MSVC" - name "default__Project" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Version" - value "5.0"))) - (object Attribute - tool "MSVC" - name "default__Class" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Type" - value ("MSVCClassTypeSet" 0)) - (object Attribute - tool "MSVC" - name "MSVCClassTypeSet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Normal" - value 0) - (object Attribute - tool "MSVC" - name "Interface_Part" - value 1) - (object Attribute - tool "MSVC" - name "Connection_Part" - value 2) - (object Attribute - tool "MSVC" - name "Class_Factory" - value 3))) - (object Attribute - tool "MSVC" - name "CObjectFunctionality" - value ("CObjectFunctionalitySet" 0)) - (object Attribute - tool "MSVC" - name "CObjectFunctionalitySet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "None" - value 0) - (object Attribute - tool "MSVC" - name "Dynamic" - value 1) - (object Attribute - tool "MSVC" - name "Dyncreate" - value 2) - (object Attribute - tool "MSVC" - name "Serial" - value 3))) - (object Attribute - tool "MSVC" - name "GenerateOverrideGroup" - value FALSE) - (object Attribute - tool "MSVC" - name "GenerateDataGroup" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_DATA_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateFieldGroup" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_FIELD_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateMessageGroup" - value FALSE) - (object Attribute - tool "MSVC" - name "GenerateMessageMap" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_MSG_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "MESSAGE_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "OLEFactory" - value ("OLEFactorySet" 0)) - (object Attribute - tool "MSVC" - name "OLEFactorySet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "None" - value 0) - (object Attribute - tool "MSVC" - name "Built_in" - value 1) - (object Attribute - tool "MSVC" - name "Simple" - value 2) - (object Attribute - tool "MSVC" - name "Licensed" - value 3))) - (object Attribute - tool "MSVC" - name "OLEName" - value "") - (object Attribute - tool "MSVC" - name "OLEClassID" - value "") - (object Attribute - tool "MSVC" - name "GenerateOLECtlType" - value FALSE) - (object Attribute - tool "MSVC" - name "OLECtlType" - value "") - (object Attribute - tool "MSVC" - name "GenerateOLETypeLib" - value FALSE) - (object Attribute - tool "MSVC" - name "OLETypeLibID" - value "") - (object Attribute - tool "MSVC" - name "OLETypeLibMajor" - value "") - (object Attribute - tool "MSVC" - name "OLETypeLibMinor" - value "") - (object Attribute - tool "MSVC" - name "GeneratePropPageIDs" - value FALSE) - (object Attribute - tool "MSVC" - name "OLEPropPageIDs" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateDispatchMap" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_DISPATCH_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "AFX_DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "StockProperties" - value (value Text "")) - (object Attribute - tool "MSVC" - name "StockFunctions" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DispatchDefValue" - value "") - (object Attribute - tool "MSVC" - name "GenerateDispIdEnum" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_DISP_ID_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateInterfaceMap" - value FALSE) - (object Attribute - tool "MSVC" - name "INTERFACE_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "InitInterface" - value "") - (object Attribute - tool "MSVC" - name "GenerateEventMap" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_EVENT_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "AFX_EVENT_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "EVENT_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "StockEvents" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateEventSinkMap" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_EVENTSINK_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "AFX_EVENTSINK_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "EVENTSINK_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "PropNotifySinks" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateConnectionMap" - value FALSE) - (object Attribute - tool "MSVC" - name "CONNECTION_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "ConnectionPointIID" - value "") - (object Attribute - tool "MSVC" - name "InheritanceType" - value "") - (object Attribute - tool "MSVC" - name "DeclSpec" - value "") - (object Attribute - tool "MSVC" - name "OLECommands" - value (value Text "")) - (object Attribute - tool "MSVC" - name "MFCDeclares" - value (value Text "")) - (object Attribute - tool "MSVC" - name "MFCImplements" - value (value Text "")) - (object Attribute - tool "MSVC" - name "ATL_Declares" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateCOMMap" - value FALSE) - (object Attribute - tool "MSVC" - name "COM_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateConnectionPointMap" - value FALSE) - (object Attribute - tool "MSVC" - name "CONNECTION_POINT_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateMsgMap" - value FALSE) - (object Attribute - tool "MSVC" - name "MSG_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GeneratePropertyMap" - value FALSE) - (object Attribute - tool "MSVC" - name "PROPERTY_MAP_Entries" - value (value Text "")))) - (object Attribute - tool "MSVC" - name "default__Operation" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Type" - value ("MSVCOperationTypeSet" 0)) - (object Attribute - tool "MSVC" - name "MSVCOperationTypeSet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Normal" - value 0) - (object Attribute - tool "MSVC" - name "Virtual_Override" - value 1) - (object Attribute - tool "MSVC" - name "Message_Handler" - value 2) - (object Attribute - tool "MSVC" - name "Dispatch_Handler" - value 3) - (object Attribute - tool "MSVC" - name "Event_Firing_Function" - value 4) - (object Attribute - tool "MSVC" - name "Event_Sink_Handler" - value 5) - (object Attribute - tool "MSVC" - name "Std_OLE_Method" - value 6) - (object Attribute - tool "MSVC" - name "Command_Parser" - value 7) - (object Attribute - tool "MSVC" - name "Property_Get_Function" - value 8) - (object Attribute - tool "MSVC" - name "Property_Set_Function" - value 9) - (object Attribute - tool "MSVC" - name "Property_Notify_Function" - value 10) - (object Attribute - tool "MSVC" - name "Macro_Generated_Function" - value 11))) - (object Attribute - tool "MSVC" - name "AFX_MSG_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "MESSAGE_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "AFX_DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "AFX_EVENT_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "EVENT_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "AFX_EVENTSINK_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "EVENTSINK_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "CallType" - value "") - (object Attribute - tool "MSVC" - name "DeclSpec" - value "") - (object Attribute - tool "MSVC" - name "BodyImage" - value (value Text "")))) - (object Attribute - tool "MSVC" - name "default__Role" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Type" - value ("MSVCAttributeTypeSet" 0)) - (object Attribute - tool "MSVC" - name "MSVCAttributeTypeSet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Normal" - value 0) - (object Attribute - tool "MSVC" - name "Member_Property" - value 1) - (object Attribute - tool "MSVC" - name "Get_Set_Property" - value 2) - (object Attribute - tool "MSVC" - name "Dialog_Data" - value 3) - (object Attribute - tool "MSVC" - name "Field_Data" - value 4) - (object Attribute - tool "MSVC" - name "Stock_Property" - value 5))) - (object Attribute - tool "MSVC" - name "AFX_DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DeclSpec" - value "") - (object Attribute - tool "MSVC" - name "PointerBase" - value "") - (object Attribute - tool "MSVC" - name "CallType" - value "") - (object Attribute - tool "MSVC" - name "StockPropertyImplementation" - value ""))) - (object Attribute - tool "MSVC" - name "default__Has" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Type" - value ("MSVCAttributeTypeSet" 0)) - (object Attribute - tool "MSVC" - name "MSVCAttributeTypeSet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Normal" - value 0) - (object Attribute - tool "MSVC" - name "Member_Property" - value 1) - (object Attribute - tool "MSVC" - name "Get_Set_Property" - value 2) - (object Attribute - tool "MSVC" - name "Dialog_Data" - value 3) - (object Attribute - tool "MSVC" - name "Field_Data" - value 4) - (object Attribute - tool "MSVC" - name "Stock_Property" - value 5))) - (object Attribute - tool "MSVC" - name "AFX_DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DeclSpec" - value "") - (object Attribute - tool "MSVC" - name "PointerBase" - value "") - (object Attribute - tool "MSVC" - name "CallType" - value "") - (object Attribute - tool "MSVC" - name "StockPropertyImplementation" - value ""))) - (object Attribute - tool "MSVC" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Type" - value ("MSVCAttributeTypeSet" 0)) - (object Attribute - tool "MSVC" - name "MSVCAttributeTypeSet" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "Normal" - value 0) - (object Attribute - tool "MSVC" - name "Member_Property" - value 1) - (object Attribute - tool "MSVC" - name "Get_Set_Property" - value 2) - (object Attribute - tool "MSVC" - name "Dialog_Data" - value 3) - (object Attribute - tool "MSVC" - name "Field_Data" - value 4) - (object Attribute - tool "MSVC" - name "Stock_Property" - value 5))) - (object Attribute - tool "MSVC" - name "AFX_DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DISPATCH_MAP_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "DeclSpec" - value "") - (object Attribute - tool "MSVC" - name "PointerBase" - value "") - (object Attribute - tool "MSVC" - name "CallType" - value "") - (object Attribute - tool "MSVC" - name "StockPropertyImplementation" - value ""))) - (object Attribute - tool "MSVC" - name "default__Module-Spec" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "GenerateIncludesGroup" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_INCLUDES_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateInsertLocation" - value FALSE))) - (object Attribute - tool "MSVC" - name "default__Module-Body" - value (list Attribute_Set - (object Attribute - tool "MSVC" - name "GenerateIncludesGroup" - value FALSE) - (object Attribute - tool "MSVC" - name "AFX_INCLUDES_Entries" - value (value Text "")) - (object Attribute - tool "MSVC" - name "GenerateInsertLocation" - value FALSE))) - (object Attribute - tool "cg" - name "HiddenTool" - value FALSE) - (object Attribute - tool "TypeLibImporter" - name "HiddenTool" - value FALSE) - (object Attribute - tool "Visual Basic" - name "propertyId" - value "783606378") - (object Attribute - tool "Visual Basic" - name "default__Class" - value (list Attribute_Set - (object Attribute - tool "Visual Basic" - name "CreatableSet" - value (list Attribute_Set - (object Attribute - tool "Visual Basic" - name "Private" - value 221) - (object Attribute - tool "Visual Basic" - name "PublicNotCreatable" - value 213) - (object Attribute - tool "Visual Basic" - name "SingleUse" - value 214) - (object Attribute - tool "Visual Basic" - name "GlobalSingleUse" - value 215) - (object Attribute - tool "Visual Basic" - name "MultiUse" - value 219) - (object Attribute - tool "Visual Basic" - name "GlobalMultiUse" - value 220))) - (object Attribute - tool "Visual Basic" - name "OptionBase" - value "0") - (object Attribute - tool "Visual Basic" - name "OptionExplicit" - value TRUE) - (object Attribute - tool "Visual Basic" - name "OptionCompare" - value ("CompareSet" 202)) - (object Attribute - tool "Visual Basic" - name "Creatable" - value ("CreatableSet" 221)) - (object Attribute - tool "Visual Basic" - name "GenerateInitialization" - value FALSE) - (object Attribute - tool "Visual Basic" - name "GenerateTermination" - value FALSE) - (object Attribute - tool "Visual Basic" - name "CollectionClass" - value "Collection") - (object Attribute - tool "Visual Basic" - name "CompareSet" - value (list Attribute_Set - (object Attribute - tool "Visual Basic" - name "None" - value 202) - (object Attribute - tool "Visual Basic" - name "Binary" - value 203) - (object Attribute - tool "Visual Basic" - name "Text" - value 204))))) - (object Attribute - tool "Visual Basic" - name "default__Operation" - value (list Attribute_Set - (object Attribute - tool "Visual Basic" - name "OperationName" - value "$operation") - (object Attribute - tool "Visual Basic" - name "LibraryName" - value "") - (object Attribute - tool "Visual Basic" - name "AliasName" - value "") - (object Attribute - tool "Visual Basic" - name "IsStatic" - value FALSE) - (object Attribute - tool "Visual Basic" - name "EntryCode" - value (value Text "")) - (object Attribute - tool "Visual Basic" - name "ExitCode" - value (value Text "")))) - (object Attribute - tool "Visual Basic" - name "default__Attribute" - value (list Attribute_Set - (object Attribute - tool "Visual Basic" - name "IsConst" - value FALSE) - (object Attribute - tool "Visual Basic" - name "New" - value FALSE) - (object Attribute - tool "Visual Basic" - name "WithEvents" - value FALSE) - (object Attribute - tool "Visual Basic" - name "Subscript" - value "") - (object Attribute - tool "Visual Basic" - name "NameIfUnlabeled" - value "the$supplier") - (object Attribute - tool "Visual Basic" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "Visual Basic" - name "DataMemberName" - value "$relationship") - (object Attribute - tool "Visual Basic" - name "GenerateGetOperation" - value FALSE) - (object Attribute - tool "Visual Basic" - name "GenerateSetOperation" - value FALSE) - (object Attribute - tool "Visual Basic" - name "GenerateLetOperation" - value FALSE))) - (object Attribute - tool "Visual Basic" - name "default__Role" - value (list Attribute_Set - (object Attribute - tool "Visual Basic" - name "New" - value FALSE) - (object Attribute - tool "Visual Basic" - name "WithEvents" - value FALSE) - (object Attribute - tool "Visual Basic" - name "Subscript" - value "") - (object Attribute - tool "Visual Basic" - name "NameIfUnlabeled" - value "the$supplier") - (object Attribute - tool "Visual Basic" - name "GenerateDataMember" - value TRUE) - (object Attribute - tool "Visual Basic" - name "DataMemberName" - value "$relationship") - (object Attribute - tool "Visual Basic" - name "GenerateGetOperation" - value FALSE) - (object Attribute - tool "Visual Basic" - name "GenerateSetOperation" - value FALSE) - (object Attribute - tool "Visual Basic" - name "GenerateLetOperation" - value FALSE))) - (object Attribute - tool "Visual Basic" - name "default__Inherit" - value (list Attribute_Set - (object Attribute - tool "Visual Basic" - name "ImplementsDelegation" - value TRUE))) - (object Attribute - tool "Visual Basic" - name "default__Module-Spec" - value (list Attribute_Set - (object Attribute - tool "Visual Basic" - name "ProjectFile" - value ""))) - (object Attribute - tool "Visual Basic" - name "HiddenTool" - value FALSE) - (object Attribute - tool "VisualStudio" - name "HiddenTool" - value FALSE)) - quid "3FAA8E8700C1")) diff --git a/tags/java-stable-20060304/sdo/impl/pom.xml b/tags/java-stable-20060304/sdo/impl/pom.xml deleted file mode 100644 index 2d96426735..0000000000 --- a/tags/java-stable-20060304/sdo/impl/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - org.apache.tuscany - tuscany-sdo - SNAPSHOT - - 4.0.0 - tuscany-sdo-impl - Tuscany SDO Implementation - Tuscany implementation of SDO API. - SNAPSHOT - - - - jeremy - http://people.apache.org/~jboynes/maven2 - - false - - - - - - - commonj - sdo-api - SNAPSHOT - compile - - - - asm - asm - 2.2 - compile - - - - org.eclipse.emf - common - 2.2.0-I200602160000 - compile - - - org.eclipse.emf - ecore - 2.2.0-I200602160000 - compile - - - org.eclipse.emf - ecore-change - 2.2.0-I200602160000 - compile - - - org.eclipse.emf - ecore-xmi - 2.2.0-I200602160000 - compile - - - org.eclipse.xsd - xsd - 2.2.0-I200602160000 - compile - - - - junit - junit - 3.8.1 - test - - - diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/AnyTypeDataObject.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/AnyTypeDataObject.java deleted file mode 100644 index 5eea403613..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/AnyTypeDataObject.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo; - -import commonj.sdo.DataObject; - -import org.eclipse.emf.ecore.xml.type.AnyType; - -/** - * - * A representation of the model object 'Any Type Data Object'. - * - * - * - * @see org.apache.tuscany.sdo.SDOPackage#getAnyTypeDataObject() - * @model extendedMetaData="kind='mixed'" - * @generated - */ -public interface AnyTypeDataObject extends DataObject, AnyType { -} // AnyTypeDataObject diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOFactory.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOFactory.java deleted file mode 100644 index 5b066bb6e3..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOFactory.java +++ /dev/null @@ -1,173 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo; - -import commonj.sdo.ChangeSummary; -import commonj.sdo.DataGraph; -import commonj.sdo.DataObject; -import org.eclipse.emf.ecore.EFactory; -import org.eclipse.emf.ecore.EStructuralFeature; - -import commonj.sdo.Property; -import commonj.sdo.Type; - -/** - * - * The Factory for the model. - * It provides a create method for each non-abstract class of the model. - * - * @see org.apache.tuscany.sdo.SDOPackage - * @generated - */ -public interface SDOFactory extends EFactory{ - /** - * The singleton instance of the factory. - * - * - * @generated - */ - SDOFactory eINSTANCE = org.apache.tuscany.sdo.impl.SDOFactoryImpl.init(); - - /** - * Returns a new object of class 'Change Summary'. - * - * - * @return a new object of class 'Change Summary'. - * @generated - */ - ChangeSummary createChangeSummary(); - - /** - * Returns a new object of class 'Change Summary Setting'. - * - * - * @return a new object of class 'Change Summary Setting'. - * @generated - */ - ChangeSummary.Setting createChangeSummarySetting(); - - /** - * Returns a new object of class 'Data Graph'. - * - * - * @return a new object of class 'Data Graph'. - * @generated - */ - DataGraph createDataGraph(); - - /** - * Returns a new object of class 'Any Type Data Object'. - * - * - * @return a new object of class 'Any Type Data Object'. - * @generated - */ - AnyTypeDataObject createAnyTypeDataObject(); - - /** - * Returns a new object of class 'Simple Any Type Data Object'. - * - * - * @return a new object of class 'Simple Any Type Data Object'. - * @generated - */ - SimpleAnyTypeDataObject createSimpleAnyTypeDataObject(); - - /** - * Returns a new object of class 'Class'. - * - * - * @return a new object of class 'Class'. - * @generated - */ - Type createClass(); - - /** - * Returns a new object of class 'Data Type'. - * - * - * @return a new object of class 'Data Type'. - * @generated - */ - Type createDataType(); - - /** - * Returns a new object of class 'Attribute'. - * - * - * @return a new object of class 'Attribute'. - * @generated - */ - Property createAttribute(); - - /** - * Returns a new object of class 'Reference'. - * - * - * @return a new object of class 'Reference'. - * @generated - */ - Property createReference(); - - /** - * Returns a new object of class 'Enum'. - * - * - * @return a new object of class 'Enum'. - * @generated - */ - Type createEnum(); - - /** - * Returns a new object of class 'Dynamic Data Object'. - * - * - * @return a new object of class 'Dynamic Data Object'. - * @generated - */ - DataObject createDynamicDataObject(); - - /** - * Returns a new object of class 'Store Data Object'. - * - * - * @return a new object of class 'Store Data Object'. - * @generated - */ - DataObject createStoreDataObject(); - - /** - * Returns a new object of class 'Dynamic Store Data Object'. - * - * - * @return a new object of class 'Dynamic Store Data Object'. - * @generated - */ - DataObject createDynamicStoreDataObject(); - - /** - * Returns the package supported by this factory. - * - * - * @return the package supported by this factory. - * @generated - */ - SDOPackage getSDOPackage(); - - ChangeSummary.Setting createChangeSummarySetting(EStructuralFeature eStructuralFeature, Object value, boolean isSet); - -} //SDOFactory diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOPackage.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOPackage.java deleted file mode 100644 index caa154baf5..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOPackage.java +++ /dev/null @@ -1,1599 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.change.ChangePackage; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @see org.apache.tuscany.sdo.SDOFactory - * @model kind="package" - * @generated - */ -public interface SDOPackage extends EPackage{ - /** - * The package name. - * - * - * @generated - */ - String eNAME = "sdo"; - - /** - * The package namespace URI. - * - * - * @generated - */ - String eNS_URI = "http://www.apache.org/tuscany/2005/SDO"; - - /** - * The package namespace name. - * - * - * @generated - */ - String eNS_PREFIX = "sdo"; - - /** - * The singleton instance of the package. - * - * - * @generated - */ - SDOPackage eINSTANCE = org.apache.tuscany.sdo.impl.SDOPackageImpl.init(); - - /** - * The meta object id for the '{@link org.apache.tuscany.sdo.impl.DataGraphImpl Data Graph}' class. - * - * - * @see org.apache.tuscany.sdo.impl.DataGraphImpl - * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getDataGraph() - * @generated - */ - int DATA_GRAPH = 2; - - /** - * The meta object id for the '{@link org.apache.tuscany.sdo.impl.ChangeSummaryImpl Change Summary}' class. - * - * - * @see org.apache.tuscany.sdo.impl.ChangeSummaryImpl - * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getChangeSummary() - * @generated - */ - int CHANGE_SUMMARY = 0; - - /** - * The feature id for the 'Object Changes' map. - * - * - * @generated - * @ordered - */ - int CHANGE_SUMMARY__OBJECT_CHANGES = ChangePackage.CHANGE_DESCRIPTION__OBJECT_CHANGES; - - /** - * The feature id for the 'Objects To Detach' reference list. - * - * - * @generated - * @ordered - */ - int CHANGE_SUMMARY__OBJECTS_TO_DETACH = ChangePackage.CHANGE_DESCRIPTION__OBJECTS_TO_DETACH; - - /** - * The feature id for the 'Objects To Attach' containment reference list. - * - * - * @generated - * @ordered - */ - int CHANGE_SUMMARY__OBJECTS_TO_ATTACH = ChangePackage.CHANGE_DESCRIPTION__OBJECTS_TO_ATTACH; - - /** - * The feature id for the 'Resource Changes' containment reference list. - * - * - * @generated - * @ordered - */ - int CHANGE_SUMMARY__RESOURCE_CHANGES = ChangePackage.CHANGE_DESCRIPTION__RESOURCE_CHANGES; - - /** - * The feature id for the 'EData Graph' reference. - * - * - * @generated - * @ordered - */ - int CHANGE_SUMMARY__EDATA_GRAPH = ChangePackage.CHANGE_DESCRIPTION_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Change Summary' class. - * - * - * @generated - * @ordered - */ - int CHANGE_SUMMARY_FEATURE_COUNT = ChangePackage.CHANGE_DESCRIPTION_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.apache.tuscany.sdo.impl.ChangeSummarySettingImpl Change Summary Setting}' class. - * - * - * @see org.apache.tuscany.sdo.impl.ChangeSummarySettingImpl - * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getChangeSummarySetting() - * @generated - */ - int CHANGE_SUMMARY_SETTING = 1; - - /** - * The feature id for the 'Feature Name' attribute. - * - * - * @generated - * @ordered - */ - int CHANGE_SUMMARY_SETTING__FEATURE_NAME = ChangePackage.FEATURE_CHANGE__FEATURE_NAME; - - /** - * The feature id for the 'Data Value' attribute. - * - * - * @generated - * @ordered - */ - int CHANGE_SUMMARY_SETTING__DATA_VALUE = ChangePackage.FEATURE_CHANGE__DATA_VALUE; - - /** - * The feature id for the 'Set' attribute. - * - * - * @generated - * @ordered - */ - int CHANGE_SUMMARY_SETTING__SET = ChangePackage.FEATURE_CHANGE__SET; - - /** - * The feature id for the 'Value' attribute. - * - * - * @generated - * @ordered - */ - int CHANGE_SUMMARY_SETTING__VALUE = ChangePackage.FEATURE_CHANGE__VALUE; - - /** - * The feature id for the 'Feature' reference. - * - * - * @generated - * @ordered - */ - int CHANGE_SUMMARY_SETTING__FEATURE = ChangePackage.FEATURE_CHANGE__FEATURE; - - /** - * The feature id for the 'Reference Value' reference. - * - * - * @generated - * @ordered - */ - int CHANGE_SUMMARY_SETTING__REFERENCE_VALUE = ChangePackage.FEATURE_CHANGE__REFERENCE_VALUE; - - /** - * The feature id for the 'List Changes' containment reference list. - * - * - * @generated - * @ordered - */ - int CHANGE_SUMMARY_SETTING__LIST_CHANGES = ChangePackage.FEATURE_CHANGE__LIST_CHANGES; - - /** - * The number of structural features of the 'Change Summary Setting' class. - * - * - * @generated - * @ordered - */ - int CHANGE_SUMMARY_SETTING_FEATURE_COUNT = ChangePackage.FEATURE_CHANGE_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Resource Set' attribute. - * - * - * @generated - * @ordered - */ - int DATA_GRAPH__RESOURCE_SET = EcorePackage.EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Root Resource' attribute. - * - * - * @generated - * @ordered - */ - int DATA_GRAPH__ROOT_RESOURCE = EcorePackage.EOBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'EChange Summary' reference. - * - * - * @generated - * @ordered - */ - int DATA_GRAPH__ECHANGE_SUMMARY = EcorePackage.EOBJECT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'ERoot Object' reference. - * - * - * @generated - * @ordered - */ - int DATA_GRAPH__EROOT_OBJECT = EcorePackage.EOBJECT_FEATURE_COUNT + 3; - - /** - * The number of structural features of the 'Data Graph' class. - * - * - * @generated - * @ordered - */ - int DATA_GRAPH_FEATURE_COUNT = EcorePackage.EOBJECT_FEATURE_COUNT + 4; - - /** - * The meta object id for the '{@link org.apache.tuscany.sdo.impl.DataObjectImpl Data Object}' class. - * - * - * @see org.apache.tuscany.sdo.impl.DataObjectImpl - * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getDataObject() - * @generated - */ - int DATA_OBJECT = 3; - - /** - * The meta object id for the '{@link commonj.sdo.Property Property}' class. - * - * - * @see commonj.sdo.Property - * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getProperty() - * @generated - */ - int PROPERTY = 4; - - /** - * The meta object id for the '{@link commonj.sdo.Sequence Sequence}' class. - * - * - * @see commonj.sdo.Sequence - * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getSequence() - * @generated - */ - int SEQUENCE = 5; - - /** - * The meta object id for the '{@link commonj.sdo.Type Type}' class. - * - * - * @see commonj.sdo.Type - * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getType() - * @generated - */ - int TYPE = 6; - - /** - * The number of structural features of the 'Data Object' class. - * - * - * @generated - * @ordered - */ - int DATA_OBJECT_FEATURE_COUNT = 0; - - /** - * The number of structural features of the 'Property' class. - * - * - * @generated - * @ordered - */ - int PROPERTY_FEATURE_COUNT = 0; - - /** - * The number of structural features of the 'Sequence' class. - * - * - * @generated - * @ordered - */ - int SEQUENCE_FEATURE_COUNT = 0; - - /** - * The number of structural features of the 'Type' class. - * - * - * @generated - * @ordered - */ - int TYPE_FEATURE_COUNT = 0; - - /** - * The meta object id for the '{@link org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl Any Type Data Object}' class. - * - * - * @see org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl - * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getAnyTypeDataObject() - * @generated - */ - int ANY_TYPE_DATA_OBJECT = 7; - - /** - * The feature id for the 'Mixed' attribute list. - * - * - * @generated - * @ordered - */ - int ANY_TYPE_DATA_OBJECT__MIXED = DATA_OBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Any' attribute list. - * - * - * @generated - * @ordered - */ - int ANY_TYPE_DATA_OBJECT__ANY = DATA_OBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Any Attribute' attribute list. - * - * - * @generated - * @ordered - */ - int ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE = DATA_OBJECT_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Any Type Data Object' class. - * - * - * @generated - * @ordered - */ - int ANY_TYPE_DATA_OBJECT_FEATURE_COUNT = DATA_OBJECT_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.apache.tuscany.sdo.impl.SimpleAnyTypeDataObjectImpl Simple Any Type Data Object}' class. - * - * - * @see org.apache.tuscany.sdo.impl.SimpleAnyTypeDataObjectImpl - * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getSimpleAnyTypeDataObject() - * @generated - */ - int SIMPLE_ANY_TYPE_DATA_OBJECT = 8; - - /** - * The feature id for the 'Mixed' attribute list. - * - * - * @generated - * @ordered - */ - int SIMPLE_ANY_TYPE_DATA_OBJECT__MIXED = ANY_TYPE_DATA_OBJECT__MIXED; - - /** - * The feature id for the 'Any' attribute list. - * - * - * @generated - * @ordered - */ - int SIMPLE_ANY_TYPE_DATA_OBJECT__ANY = ANY_TYPE_DATA_OBJECT__ANY; - - /** - * The feature id for the 'Any Attribute' attribute list. - * - * - * @generated - * @ordered - */ - int SIMPLE_ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE = ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE; - - /** - * The feature id for the 'Raw Value' attribute. - * - * - * @generated - * @ordered - */ - int SIMPLE_ANY_TYPE_DATA_OBJECT__RAW_VALUE = ANY_TYPE_DATA_OBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Value' attribute. - * - * - * @generated - * @ordered - */ - int SIMPLE_ANY_TYPE_DATA_OBJECT__VALUE = ANY_TYPE_DATA_OBJECT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Instance Type' reference. - * - * - * @generated - * @ordered - */ - int SIMPLE_ANY_TYPE_DATA_OBJECT__INSTANCE_TYPE = ANY_TYPE_DATA_OBJECT_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Simple Any Type Data Object' class. - * - * - * @generated - * @ordered - */ - int SIMPLE_ANY_TYPE_DATA_OBJECT_FEATURE_COUNT = ANY_TYPE_DATA_OBJECT_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.apache.tuscany.sdo.impl.ClassImpl Class}' class. - * - * - * @see org.apache.tuscany.sdo.impl.ClassImpl - * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getClass_() - * @generated - */ - int CLASS = 9; - - /** - * The feature id for the 'EAnnotations' containment reference list. - * - * - * @generated - * @ordered - */ - int CLASS__EANNOTATIONS = EcorePackage.ECLASS__EANNOTATIONS; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - int CLASS__NAME = EcorePackage.ECLASS__NAME; - - /** - * The feature id for the 'Instance Class Name' attribute. - * - * - * @generated - * @ordered - */ - int CLASS__INSTANCE_CLASS_NAME = EcorePackage.ECLASS__INSTANCE_CLASS_NAME; - - /** - * The feature id for the 'Instance Class' attribute. - * - * - * @generated - * @ordered - */ - int CLASS__INSTANCE_CLASS = EcorePackage.ECLASS__INSTANCE_CLASS; - - /** - * The feature id for the 'Default Value' attribute. - * - * - * @generated - * @ordered - */ - int CLASS__DEFAULT_VALUE = EcorePackage.ECLASS__DEFAULT_VALUE; - - /** - * The feature id for the 'EPackage' container reference. - * - * - * @generated - * @ordered - */ - int CLASS__EPACKAGE = EcorePackage.ECLASS__EPACKAGE; - - /** - * The feature id for the 'Abstract' attribute. - * - * - * @generated - * @ordered - */ - int CLASS__ABSTRACT = EcorePackage.ECLASS__ABSTRACT; - - /** - * The feature id for the 'Interface' attribute. - * - * - * @generated - * @ordered - */ - int CLASS__INTERFACE = EcorePackage.ECLASS__INTERFACE; - - /** - * The feature id for the 'ESuper Types' reference list. - * - * - * @generated - * @ordered - */ - int CLASS__ESUPER_TYPES = EcorePackage.ECLASS__ESUPER_TYPES; - - /** - * The feature id for the 'EOperations' containment reference list. - * - * - * @generated - * @ordered - */ - int CLASS__EOPERATIONS = EcorePackage.ECLASS__EOPERATIONS; - - /** - * The feature id for the 'EAll Attributes' reference list. - * - * - * @generated - * @ordered - */ - int CLASS__EALL_ATTRIBUTES = EcorePackage.ECLASS__EALL_ATTRIBUTES; - - /** - * The feature id for the 'EAll References' reference list. - * - * - * @generated - * @ordered - */ - int CLASS__EALL_REFERENCES = EcorePackage.ECLASS__EALL_REFERENCES; - - /** - * The feature id for the 'EReferences' reference list. - * - * - * @generated - * @ordered - */ - int CLASS__EREFERENCES = EcorePackage.ECLASS__EREFERENCES; - - /** - * The feature id for the 'EAttributes' reference list. - * - * - * @generated - * @ordered - */ - int CLASS__EATTRIBUTES = EcorePackage.ECLASS__EATTRIBUTES; - - /** - * The feature id for the 'EAll Containments' reference list. - * - * - * @generated - * @ordered - */ - int CLASS__EALL_CONTAINMENTS = EcorePackage.ECLASS__EALL_CONTAINMENTS; - - /** - * The feature id for the 'EAll Operations' reference list. - * - * - * @generated - * @ordered - */ - int CLASS__EALL_OPERATIONS = EcorePackage.ECLASS__EALL_OPERATIONS; - - /** - * The feature id for the 'EAll Structural Features' reference list. - * - * - * @generated - * @ordered - */ - int CLASS__EALL_STRUCTURAL_FEATURES = EcorePackage.ECLASS__EALL_STRUCTURAL_FEATURES; - - /** - * The feature id for the 'EAll Super Types' reference list. - * - * - * @generated - * @ordered - */ - int CLASS__EALL_SUPER_TYPES = EcorePackage.ECLASS__EALL_SUPER_TYPES; - - /** - * The feature id for the 'EID Attribute' reference. - * - * - * @generated - * @ordered - */ - int CLASS__EID_ATTRIBUTE = EcorePackage.ECLASS__EID_ATTRIBUTE; - - /** - * The feature id for the 'EStructural Features' containment reference list. - * - * - * @generated - * @ordered - */ - int CLASS__ESTRUCTURAL_FEATURES = EcorePackage.ECLASS__ESTRUCTURAL_FEATURES; - - /** - * The number of structural features of the 'Class' class. - * - * - * @generated - * @ordered - */ - int CLASS_FEATURE_COUNT = EcorePackage.ECLASS_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.apache.tuscany.sdo.impl.DataTypeImpl Data Type}' class. - * - * - * @see org.apache.tuscany.sdo.impl.DataTypeImpl - * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getDataType() - * @generated - */ - int DATA_TYPE = 10; - - /** - * The feature id for the 'EAnnotations' containment reference list. - * - * - * @generated - * @ordered - */ - int DATA_TYPE__EANNOTATIONS = EcorePackage.EDATA_TYPE__EANNOTATIONS; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - int DATA_TYPE__NAME = EcorePackage.EDATA_TYPE__NAME; - - /** - * The feature id for the 'Instance Class Name' attribute. - * - * - * @generated - * @ordered - */ - int DATA_TYPE__INSTANCE_CLASS_NAME = EcorePackage.EDATA_TYPE__INSTANCE_CLASS_NAME; - - /** - * The feature id for the 'Instance Class' attribute. - * - * - * @generated - * @ordered - */ - int DATA_TYPE__INSTANCE_CLASS = EcorePackage.EDATA_TYPE__INSTANCE_CLASS; - - /** - * The feature id for the 'Default Value' attribute. - * - * - * @generated - * @ordered - */ - int DATA_TYPE__DEFAULT_VALUE = EcorePackage.EDATA_TYPE__DEFAULT_VALUE; - - /** - * The feature id for the 'EPackage' container reference. - * - * - * @generated - * @ordered - */ - int DATA_TYPE__EPACKAGE = EcorePackage.EDATA_TYPE__EPACKAGE; - - /** - * The feature id for the 'Serializable' attribute. - * - * - * @generated - * @ordered - */ - int DATA_TYPE__SERIALIZABLE = EcorePackage.EDATA_TYPE__SERIALIZABLE; - - /** - * The number of structural features of the 'Data Type' class. - * - * - * @generated - * @ordered - */ - int DATA_TYPE_FEATURE_COUNT = EcorePackage.EDATA_TYPE_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.apache.tuscany.sdo.impl.AttributeImpl Attribute}' class. - * - * - * @see org.apache.tuscany.sdo.impl.AttributeImpl - * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getAttribute() - * @generated - */ - int ATTRIBUTE = 11; - - /** - * The feature id for the 'EAnnotations' containment reference list. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE__EANNOTATIONS = EcorePackage.EATTRIBUTE__EANNOTATIONS; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE__NAME = EcorePackage.EATTRIBUTE__NAME; - - /** - * The feature id for the 'Ordered' attribute. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE__ORDERED = EcorePackage.EATTRIBUTE__ORDERED; - - /** - * The feature id for the 'Unique' attribute. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE__UNIQUE = EcorePackage.EATTRIBUTE__UNIQUE; - - /** - * The feature id for the 'Lower Bound' attribute. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE__LOWER_BOUND = EcorePackage.EATTRIBUTE__LOWER_BOUND; - - /** - * The feature id for the 'Upper Bound' attribute. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE__UPPER_BOUND = EcorePackage.EATTRIBUTE__UPPER_BOUND; - - /** - * The feature id for the 'Many' attribute. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE__MANY = EcorePackage.EATTRIBUTE__MANY; - - /** - * The feature id for the 'Required' attribute. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE__REQUIRED = EcorePackage.EATTRIBUTE__REQUIRED; - - /** - * The feature id for the 'EType' reference. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE__ETYPE = EcorePackage.EATTRIBUTE__ETYPE; - - /** - * The feature id for the 'Changeable' attribute. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE__CHANGEABLE = EcorePackage.EATTRIBUTE__CHANGEABLE; - - /** - * The feature id for the 'Volatile' attribute. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE__VOLATILE = EcorePackage.EATTRIBUTE__VOLATILE; - - /** - * The feature id for the 'Transient' attribute. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE__TRANSIENT = EcorePackage.EATTRIBUTE__TRANSIENT; - - /** - * The feature id for the 'Default Value Literal' attribute. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE__DEFAULT_VALUE_LITERAL = EcorePackage.EATTRIBUTE__DEFAULT_VALUE_LITERAL; - - /** - * The feature id for the 'Default Value' attribute. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE__DEFAULT_VALUE = EcorePackage.EATTRIBUTE__DEFAULT_VALUE; - - /** - * The feature id for the 'Unsettable' attribute. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE__UNSETTABLE = EcorePackage.EATTRIBUTE__UNSETTABLE; - - /** - * The feature id for the 'Derived' attribute. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE__DERIVED = EcorePackage.EATTRIBUTE__DERIVED; - - /** - * The feature id for the 'EContaining Class' container reference. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE__ECONTAINING_CLASS = EcorePackage.EATTRIBUTE__ECONTAINING_CLASS; - - /** - * The feature id for the 'ID' attribute. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE__ID = EcorePackage.EATTRIBUTE__ID; - - /** - * The feature id for the 'EAttribute Type' reference. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE__EATTRIBUTE_TYPE = EcorePackage.EATTRIBUTE__EATTRIBUTE_TYPE; - - /** - * The number of structural features of the 'Attribute' class. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE_FEATURE_COUNT = EcorePackage.EATTRIBUTE_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.apache.tuscany.sdo.impl.ReferenceImpl Reference}' class. - * - * - * @see org.apache.tuscany.sdo.impl.ReferenceImpl - * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getReference() - * @generated - */ - int REFERENCE = 12; - - /** - * The feature id for the 'EAnnotations' containment reference list. - * - * - * @generated - * @ordered - */ - int REFERENCE__EANNOTATIONS = EcorePackage.EREFERENCE__EANNOTATIONS; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - int REFERENCE__NAME = EcorePackage.EREFERENCE__NAME; - - /** - * The feature id for the 'Ordered' attribute. - * - * - * @generated - * @ordered - */ - int REFERENCE__ORDERED = EcorePackage.EREFERENCE__ORDERED; - - /** - * The feature id for the 'Unique' attribute. - * - * - * @generated - * @ordered - */ - int REFERENCE__UNIQUE = EcorePackage.EREFERENCE__UNIQUE; - - /** - * The feature id for the 'Lower Bound' attribute. - * - * - * @generated - * @ordered - */ - int REFERENCE__LOWER_BOUND = EcorePackage.EREFERENCE__LOWER_BOUND; - - /** - * The feature id for the 'Upper Bound' attribute. - * - * - * @generated - * @ordered - */ - int REFERENCE__UPPER_BOUND = EcorePackage.EREFERENCE__UPPER_BOUND; - - /** - * The feature id for the 'Many' attribute. - * - * - * @generated - * @ordered - */ - int REFERENCE__MANY = EcorePackage.EREFERENCE__MANY; - - /** - * The feature id for the 'Required' attribute. - * - * - * @generated - * @ordered - */ - int REFERENCE__REQUIRED = EcorePackage.EREFERENCE__REQUIRED; - - /** - * The feature id for the 'EType' reference. - * - * - * @generated - * @ordered - */ - int REFERENCE__ETYPE = EcorePackage.EREFERENCE__ETYPE; - - /** - * The feature id for the 'Changeable' attribute. - * - * - * @generated - * @ordered - */ - int REFERENCE__CHANGEABLE = EcorePackage.EREFERENCE__CHANGEABLE; - - /** - * The feature id for the 'Volatile' attribute. - * - * - * @generated - * @ordered - */ - int REFERENCE__VOLATILE = EcorePackage.EREFERENCE__VOLATILE; - - /** - * The feature id for the 'Transient' attribute. - * - * - * @generated - * @ordered - */ - int REFERENCE__TRANSIENT = EcorePackage.EREFERENCE__TRANSIENT; - - /** - * The feature id for the 'Default Value Literal' attribute. - * - * - * @generated - * @ordered - */ - int REFERENCE__DEFAULT_VALUE_LITERAL = EcorePackage.EREFERENCE__DEFAULT_VALUE_LITERAL; - - /** - * The feature id for the 'Default Value' attribute. - * - * - * @generated - * @ordered - */ - int REFERENCE__DEFAULT_VALUE = EcorePackage.EREFERENCE__DEFAULT_VALUE; - - /** - * The feature id for the 'Unsettable' attribute. - * - * - * @generated - * @ordered - */ - int REFERENCE__UNSETTABLE = EcorePackage.EREFERENCE__UNSETTABLE; - - /** - * The feature id for the 'Derived' attribute. - * - * - * @generated - * @ordered - */ - int REFERENCE__DERIVED = EcorePackage.EREFERENCE__DERIVED; - - /** - * The feature id for the 'EContaining Class' container reference. - * - * - * @generated - * @ordered - */ - int REFERENCE__ECONTAINING_CLASS = EcorePackage.EREFERENCE__ECONTAINING_CLASS; - - /** - * The feature id for the 'Containment' attribute. - * - * - * @generated - * @ordered - */ - int REFERENCE__CONTAINMENT = EcorePackage.EREFERENCE__CONTAINMENT; - - /** - * The feature id for the 'Container' attribute. - * - * - * @generated - * @ordered - */ - int REFERENCE__CONTAINER = EcorePackage.EREFERENCE__CONTAINER; - - /** - * The feature id for the 'Resolve Proxies' attribute. - * - * - * @generated - * @ordered - */ - int REFERENCE__RESOLVE_PROXIES = EcorePackage.EREFERENCE__RESOLVE_PROXIES; - - /** - * The feature id for the 'EOpposite' reference. - * - * - * @generated - * @ordered - */ - int REFERENCE__EOPPOSITE = EcorePackage.EREFERENCE__EOPPOSITE; - - /** - * The feature id for the 'EReference Type' reference. - * - * - * @generated - * @ordered - */ - int REFERENCE__EREFERENCE_TYPE = EcorePackage.EREFERENCE__EREFERENCE_TYPE; - - /** - * The number of structural features of the 'Reference' class. - * - * - * @generated - * @ordered - */ - int REFERENCE_FEATURE_COUNT = EcorePackage.EREFERENCE_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.apache.tuscany.sdo.impl.EnumImpl Enum}' class. - * - * - * @see org.apache.tuscany.sdo.impl.EnumImpl - * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getEnum() - * @generated - */ - int ENUM = 13; - - /** - * The feature id for the 'EAnnotations' containment reference list. - * - * - * @generated - * @ordered - */ - int ENUM__EANNOTATIONS = EcorePackage.EENUM__EANNOTATIONS; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - int ENUM__NAME = EcorePackage.EENUM__NAME; - - /** - * The feature id for the 'Instance Class Name' attribute. - * - * - * @generated - * @ordered - */ - int ENUM__INSTANCE_CLASS_NAME = EcorePackage.EENUM__INSTANCE_CLASS_NAME; - - /** - * The feature id for the 'Instance Class' attribute. - * - * - * @generated - * @ordered - */ - int ENUM__INSTANCE_CLASS = EcorePackage.EENUM__INSTANCE_CLASS; - - /** - * The feature id for the 'Default Value' attribute. - * - * - * @generated - * @ordered - */ - int ENUM__DEFAULT_VALUE = EcorePackage.EENUM__DEFAULT_VALUE; - - /** - * The feature id for the 'EPackage' container reference. - * - * - * @generated - * @ordered - */ - int ENUM__EPACKAGE = EcorePackage.EENUM__EPACKAGE; - - /** - * The feature id for the 'Serializable' attribute. - * - * - * @generated - * @ordered - */ - int ENUM__SERIALIZABLE = EcorePackage.EENUM__SERIALIZABLE; - - /** - * The feature id for the 'ELiterals' containment reference list. - * - * - * @generated - * @ordered - */ - int ENUM__ELITERALS = EcorePackage.EENUM__ELITERALS; - - /** - * The number of structural features of the 'Enum' class. - * - * - * @generated - * @ordered - */ - int ENUM_FEATURE_COUNT = EcorePackage.EENUM_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.apache.tuscany.sdo.impl.DynamicDataObjectImpl Dynamic Data Object}' class. - * - * - * @see org.apache.tuscany.sdo.impl.DynamicDataObjectImpl - * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getDynamicDataObject() - * @generated - */ - int DYNAMIC_DATA_OBJECT = 14; - - /** - * The number of structural features of the 'Dynamic Data Object' class. - * - * - * @generated - * @ordered - */ - int DYNAMIC_DATA_OBJECT_FEATURE_COUNT = DATA_OBJECT_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.apache.tuscany.sdo.impl.StoreDataObjectImpl Store Data Object}' class. - * - * - * @see org.apache.tuscany.sdo.impl.StoreDataObjectImpl - * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getStoreDataObject() - * @generated - */ - int STORE_DATA_OBJECT = 15; - - /** - * The number of structural features of the 'Store Data Object' class. - * - * - * @generated - * @ordered - */ - int STORE_DATA_OBJECT_FEATURE_COUNT = DATA_OBJECT_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.apache.tuscany.sdo.impl.DynamicStoreDataObjectImpl Dynamic Store Data Object}' class. - * - * - * @see org.apache.tuscany.sdo.impl.DynamicStoreDataObjectImpl - * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getDynamicStoreDataObject() - * @generated - */ - int DYNAMIC_STORE_DATA_OBJECT = 16; - - /** - * The number of structural features of the 'Dynamic Store Data Object' class. - * - * - * @generated - * @ordered - */ - int DYNAMIC_STORE_DATA_OBJECT_FEATURE_COUNT = STORE_DATA_OBJECT_FEATURE_COUNT + 0; - - /** - * The meta object id for the 'EJava List' data type. - * - * - * @see java.util.List - * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getEJavaList() - * @generated - */ - int EJAVA_LIST = 17; - - /** - * The meta object id for the 'EObject Stream Exception' data type. - * - * - * @see java.io.ObjectStreamException - * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getEObjectStreamException() - * @generated - */ - int EOBJECT_STREAM_EXCEPTION = 18; - - - /** - * Returns the meta object for class '{@link commonj.sdo.ChangeSummary Change Summary}'. - * - * - * @return the meta object for class 'Change Summary'. - * @see commonj.sdo.ChangeSummary - * @model instanceClass="commonj.sdo.ChangeSummary" - * @generated - */ - EClass getChangeSummary(); - - /** - * Returns the meta object for the reference '{@link commonj.sdo.ChangeSummary#getEDataGraph EData Graph}'. - * - * - * @return the meta object for the reference 'EData Graph'. - * @see commonj.sdo.ChangeSummary#getEDataGraph() - * @see #getChangeSummary() - * @generated - */ - EReference getChangeSummary_EDataGraph(); - - /** - * Returns the meta object for class '{@link commonj.sdo.ChangeSummary.Setting Change Summary Setting}'. - * - * - * @return the meta object for class 'Change Summary Setting'. - * @see commonj.sdo.ChangeSummary.Setting - * @model instanceClass="commonj.sdo.ChangeSummary$Setting" - * @generated - */ - EClass getChangeSummarySetting(); - - /** - * Returns the meta object for class '{@link commonj.sdo.DataGraph Data Graph}'. - * - * - * @return the meta object for class 'Data Graph'. - * @see commonj.sdo.DataGraph - * @model instanceClass="commonj.sdo.DataGraph" - * @generated - */ - EClass getDataGraph(); - - /** - * Returns the meta object for the attribute '{@link commonj.sdo.DataGraph#getResourceSet Resource Set}'. - * - * - * @return the meta object for the attribute 'Resource Set'. - * @see commonj.sdo.DataGraph#getResourceSet() - * @see #getDataGraph() - * @generated - */ - EAttribute getDataGraph_ResourceSet(); - - /** - * Returns the meta object for the attribute '{@link commonj.sdo.DataGraph#getRootResource Root Resource}'. - * - * - * @return the meta object for the attribute 'Root Resource'. - * @see commonj.sdo.DataGraph#getRootResource() - * @see #getDataGraph() - * @generated - */ - EAttribute getDataGraph_RootResource(); - - /** - * Returns the meta object for the reference '{@link commonj.sdo.DataGraph#getEChangeSummary EChange Summary}'. - * - * - * @return the meta object for the reference 'EChange Summary'. - * @see commonj.sdo.DataGraph#getEChangeSummary() - * @see #getDataGraph() - * @generated - */ - EReference getDataGraph_EChangeSummary(); - - /** - * Returns the meta object for the reference '{@link commonj.sdo.DataGraph#getERootObject ERoot Object}'. - * - * - * @return the meta object for the reference 'ERoot Object'. - * @see commonj.sdo.DataGraph#getERootObject() - * @see #getDataGraph() - * @generated - */ - EReference getDataGraph_ERootObject(); - - /** - * Returns the meta object for class '{@link commonj.sdo.DataObject Data Object}'. - * - * - * @return the meta object for class 'Data Object'. - * @see commonj.sdo.DataObject - * @model instanceClass="commonj.sdo.DataObject" - * @generated - */ - EClass getDataObject(); - - /** - * Returns the meta object for class '{@link commonj.sdo.Property Property}'. - * - * - * @return the meta object for class 'Property'. - * @see commonj.sdo.Property - * @model instanceClass="commonj.sdo.Property" - * @generated - */ - EClass getProperty(); - - /** - * Returns the meta object for class '{@link commonj.sdo.Sequence Sequence}'. - * - * - * @return the meta object for class 'Sequence'. - * @see commonj.sdo.Sequence - * @model instanceClass="commonj.sdo.Sequence" - * @generated - */ - EClass getSequence(); - - /** - * Returns the meta object for class '{@link commonj.sdo.Type Type}'. - * - * - * @return the meta object for class 'Type'. - * @see commonj.sdo.Type - * @model instanceClass="commonj.sdo.Type" - * @generated - */ - EClass getType(); - - /** - * Returns the meta object for class '{@link org.apache.tuscany.sdo.AnyTypeDataObject Any Type Data Object}'. - * - * - * @return the meta object for class 'Any Type Data Object'. - * @see org.apache.tuscany.sdo.AnyTypeDataObject - * @generated - */ - EClass getAnyTypeDataObject(); - - /** - * Returns the meta object for class '{@link org.apache.tuscany.sdo.SimpleAnyTypeDataObject Simple Any Type Data Object}'. - * - * - * @return the meta object for class 'Simple Any Type Data Object'. - * @see org.apache.tuscany.sdo.SimpleAnyTypeDataObject - * @generated - */ - EClass getSimpleAnyTypeDataObject(); - - /** - * Returns the meta object for class '{@link commonj.sdo.Type Class}'. - * - * - * @return the meta object for class 'Class'. - * @see commonj.sdo.Type - * @model instanceClass="commonj.sdo.Type" - * @generated - */ - EClass getClass_(); - - /** - * Returns the meta object for class '{@link commonj.sdo.Type Data Type}'. - * - * - * @return the meta object for class 'Data Type'. - * @see commonj.sdo.Type - * @model instanceClass="commonj.sdo.Type" - * @generated - */ - EClass getDataType(); - - /** - * Returns the meta object for class '{@link commonj.sdo.Property Attribute}'. - * - * - * @return the meta object for class 'Attribute'. - * @see commonj.sdo.Property - * @model instanceClass="commonj.sdo.Property" - * @generated - */ - EClass getAttribute(); - - /** - * Returns the meta object for class '{@link commonj.sdo.Property Reference}'. - * - * - * @return the meta object for class 'Reference'. - * @see commonj.sdo.Property - * @model instanceClass="commonj.sdo.Property" - * @generated - */ - EClass getReference(); - - /** - * Returns the meta object for class '{@link commonj.sdo.Type Enum}'. - * - * - * @return the meta object for class 'Enum'. - * @see commonj.sdo.Type - * @model instanceClass="commonj.sdo.Type" - * @generated - */ - EClass getEnum(); - - /** - * Returns the meta object for class '{@link commonj.sdo.DataObject Dynamic Data Object}'. - * - * - * @return the meta object for class 'Dynamic Data Object'. - * @see commonj.sdo.DataObject - * @model instanceClass="commonj.sdo.DataObject" - * @generated - */ - EClass getDynamicDataObject(); - - /** - * Returns the meta object for class '{@link commonj.sdo.DataObject Store Data Object}'. - * - * - * @return the meta object for class 'Store Data Object'. - * @see commonj.sdo.DataObject - * @model instanceClass="commonj.sdo.DataObject" - * @generated - */ - EClass getStoreDataObject(); - - /** - * Returns the meta object for class '{@link commonj.sdo.DataObject Dynamic Store Data Object}'. - * - * - * @return the meta object for class 'Dynamic Store Data Object'. - * @see commonj.sdo.DataObject - * @model instanceClass="commonj.sdo.DataObject" - * @generated - */ - EClass getDynamicStoreDataObject(); - - /** - * Returns the meta object for data type '{@link java.util.List EJava List}'. - * - * - * @return the meta object for data type 'EJava List'. - * @see java.util.List - * @model instanceClass="java.util.List" serializable="false" - * @generated - */ - EDataType getEJavaList(); - - /** - * Returns the meta object for data type '{@link java.io.ObjectStreamException EObject Stream Exception}'. - * - * - * @return the meta object for data type 'EObject Stream Exception'. - * @see java.io.ObjectStreamException - * @model instanceClass="java.io.ObjectStreamException" serializable="false" - * @generated - */ - EDataType getEObjectStreamException(); - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - SDOFactory getSDOFactory(); - -} //SDOPackage diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOTypeVisitor.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOTypeVisitor.java deleted file mode 100644 index ced62cc058..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOTypeVisitor.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.sdo; - -import commonj.sdo.Property; -import commonj.sdo.Type; - -/** - * Visitor interface that allows applications to process SDO type metadata. - * - * @version $Rev$ $Date$ - */ -public interface SDOTypeVisitor { - /** - * Visit a type definition. - * - * @param type the type to visit - */ - void visitType(Type type); - - /** - * Visit a property definition. - * - * @param property the property to visit - */ - void visitProperty(Property property); - - /** - * Visit after all properties. - */ - void visitEnd(); -} diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/SimpleAnyTypeDataObject.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/SimpleAnyTypeDataObject.java deleted file mode 100644 index 5fed5829ae..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/SimpleAnyTypeDataObject.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo; - -import org.eclipse.emf.ecore.xml.type.SimpleAnyType; - -/** - * - * A representation of the model object 'Simple Any Type Data Object'. - * - * - * - * @see org.apache.tuscany.sdo.SDOPackage#getSimpleAnyTypeDataObject() - * @model extendedMetaData="kind='simple'" - * @generated - */ -public interface SimpleAnyTypeDataObject extends AnyTypeDataObject, SimpleAnyType { -} // SimpleAnyTypeDataObject diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/BytecodeInterfaceGenerator.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/BytecodeInterfaceGenerator.java deleted file mode 100644 index 534505a613..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/BytecodeInterfaceGenerator.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.sdo.codegen; - -import java.util.List; - -import commonj.sdo.Property; -import commonj.sdo.Type; -import org.objectweb.asm.ClassWriter; -import static org.objectweb.asm.Opcodes.*; - -import org.apache.tuscany.sdo.SDOTypeVisitor; - -/** - * Implementation of a generator that will directly emit bytecode for an interface that - * corresponds to the static properties of a SDO type. - * - * @version $Rev$ $Date$ - */ -public class BytecodeInterfaceGenerator implements SDOTypeVisitor { - private final ClassWriter cw; - - public BytecodeInterfaceGenerator() { - cw = new ClassWriter(false); - } - - public void visitType(Type type) { - String name = type.getName(); - int lastDot = name.lastIndexOf('.'); - if (lastDot != -1) { - name = name.replace('.', '/'); - } else { - name = Character.toUpperCase(name.charAt(0)) + name.substring(1); - } - - List baseTypes = type.getBaseTypes(); - String[] interfaces = new String[baseTypes.size()]; - for (int i = 0; i < baseTypes.size(); i++) { - Type baseType = (Type) baseTypes.get(i); - interfaces[i] = baseType.getInstanceClass().getName().replace('.', '/'); - } - - cw.visit(V1_5, ACC_PUBLIC + ACC_ABSTRACT + ACC_INTERFACE, name, null, "java/lang/Object", interfaces); - } - - public void visitProperty(Property property) { - String name = property.getName(); - String propertyName = Character.toUpperCase(name.charAt(0)) + name.substring(1); - Class javaType = property.getType().getInstanceClass(); - String desc = org.objectweb.asm.Type.getDescriptor(javaType); - - if (property.isMany()) { - cw.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, "get" + propertyName, "()Ljava/util/List;", null, null).visitEnd(); - } else { - if (boolean.class.equals(javaType)) { - cw.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, "is" + propertyName, "()Z", null, null).visitEnd(); - } else { - cw.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, "get" + propertyName, "()" + desc, null, null).visitEnd(); - } - if (!property.isReadOnly()) { - cw.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, "set" + propertyName, '(' + desc + ")V", null, null).visitEnd(); - } - } - } - - public void visitEnd() { - cw.visitEnd(); - } - - /** - * Return the bytecode for the interface class in a form that can be written - * to disk, added to a JAR file, or passed to a ClassLoader. - * - * @return the bytecode for the SDO Type's interface class - */ - public byte[] getClassData() { - return cw.toByteArray(); - } -} diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/GenerationException.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/GenerationException.java deleted file mode 100644 index 15ff8a7502..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/GenerationException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.sdo.codegen; - -/** - * Exception indicating there was a problem with code generation. - * - * @version $Rev$ $Date$ - */ -public abstract class GenerationException extends RuntimeException { - public GenerationException() { - } - - public GenerationException(String message) { - super(message); - } - - public GenerationException(String message, Throwable cause) { - super(message, cause); - } - - public GenerationException(Throwable cause) { - super(cause); - } -} diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/JavaInterfaceGenerator.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/JavaInterfaceGenerator.java deleted file mode 100644 index 64fc52d89a..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/JavaInterfaceGenerator.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.sdo.codegen; - -import java.io.PrintWriter; -import java.util.List; - -import commonj.sdo.Property; -import commonj.sdo.Type; - -import org.apache.tuscany.sdo.SDOTypeVisitor; - -/** - * Implementation of a generator that will output the source code for a Java interface - * that corresponds to the SDO Type's static properties. - * - * @version $Rev$ $Date$ - */ -public class JavaInterfaceGenerator implements SDOTypeVisitor { - private final PrintWriter writer; - - /** - * Constructor providing the Writer to output the source to. - * - * @param writer where the generated source code will be written to - */ - public JavaInterfaceGenerator(PrintWriter writer) { - this.writer = writer; - } - - public void visitType(Type type) { - String name = type.getName(); - int lastDot = name.lastIndexOf('.'); - if (lastDot != -1) { - writer.print("package "); - writer.print(name.substring(0, lastDot)); - writer.println(';'); - writer.println(); - - name = name.substring(lastDot + 1); - } else { - name = Character.toUpperCase(name.charAt(0)) + name.substring(1); - } - - writer.print("public interface "); - writer.print(name); - List baseTypes = type.getBaseTypes(); - for (int i = 0; i < baseTypes.size(); i++) { - Type baseType = (Type) baseTypes.get(i); - if (i == 0) { - writer.print(" extends "); - } else { - writer.print(", "); - } - writer.print(baseType.getInstanceClass().getName()); - } - - writer.println(" {"); - } - - public void visitProperty(Property property) { - String name = property.getName(); - String propertyName = Character.toUpperCase(name.charAt(0)) + name.substring(1); - String javaType = property.getType().getInstanceClass().getCanonicalName(); - - if (!property.isMany()) { - writer.print(" "); - writer.print(javaType); - writer.print("boolean".equals(javaType) ? " is" : " get"); - writer.print(propertyName); - writer.println("();"); - if (!property.isReadOnly()) { - writer.print(" void set"); - writer.print(propertyName); - writer.print('('); - writer.print(javaType); - writer.println(" value);"); - } - } else { - writer.print(" java.util.List get"); - writer.print(propertyName); - writer.println("();"); - } - } - - public void visitEnd() { - writer.println('}'); - writer.flush(); - } -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/NoJavaImplementationException.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/NoJavaImplementationException.java deleted file mode 100644 index 5b9b3742d5..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/NoJavaImplementationException.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.sdo.codegen; - -import commonj.sdo.Type; - -/** - * Exception that indicates there is no Java mapping for an SDO type. - * - * @version $Rev$ $Date$ - */ -public class NoJavaImplementationException extends GenerationException { - private final Type type; - - /** - * Constructor supplying the Type that did not have a Java implementation. - * A default message is provided of the form "${URI}#${Name}" - * - * @param type the type that did not have a Java implementation. - */ - public NoJavaImplementationException(Type type) { - super(type == null ? null : type.getURI() + "#" + type.getName()); - this.type = type; - } - - /** - * Constructor supplying a message and the Type that did not have a Java implementation. - * - * @param message the message - * @param type the type that did not have a Java implementation. - */ - public NoJavaImplementationException(String message, Type type) { - super(message); - this.type = type; - } - - /** - * Return the type that did not have a Java implementation. - * @return the type that did not have a Java implementation - */ - public Type getType() { - return type; - } -} diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/CopyHelperImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/CopyHelperImpl.java deleted file mode 100644 index 060bd381dc..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/CopyHelperImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.helper; - - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.util.EcoreUtil.Copier; - -import commonj.sdo.DataObject; -import commonj.sdo.helper.CopyHelper; - - -/** - * A helper for copying DataObjects. - */ -public class CopyHelperImpl implements CopyHelper -{ - public DataObject copyShallow(DataObject dataObject) - { - Copier copier = new Copier() - { - protected void copyContainment(EReference eReference, EObject eObject, EObject copyEObject) - { - } - }; - EObject result = copier.copy((EObject)dataObject); - copier.copyReferences(); - return (DataObject)result; - } - - public DataObject copy(DataObject dataObject) - { - return (DataObject)EcoreUtil.copy((EObject)dataObject); - } -} diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/DataFactoryImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/DataFactoryImpl.java deleted file mode 100644 index 5fcf3fa4c1..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/DataFactoryImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.helper; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.util.EcoreUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.Type; -import commonj.sdo.helper.DataFactory; -import commonj.sdo.helper.TypeHelper; - -/** - * A Factory for creating DataObjects. - * The created DataObjects are not connected to any other DataObjects. - */ -public class DataFactoryImpl implements DataFactory -{ - protected TypeHelper typeHelper; - - public DataFactoryImpl(TypeHelper typeHelper) - { - this.typeHelper = typeHelper; - } - - public DataObject create(String uri, String typeName) - { - Type type = typeHelper.getType(uri, typeName); - return create(type); - } - - public DataObject create(Class interfaceClass) - { - //TODO more efficient implementation ... this is a really bad one! - Type type = typeHelper.getType(interfaceClass); - return create(type); - } - - public DataObject create(Type type) - { - EClass eClass = (EClass)type; - return (DataObject)EcoreUtil.create(eClass); - } -} diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/DataHelperImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/DataHelperImpl.java deleted file mode 100644 index 3986fa4be7..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/DataHelperImpl.java +++ /dev/null @@ -1,303 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.helper; - -import java.util.Calendar; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.Locale; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; - - -import commonj.sdo.helper.DataHelper; - -/** - * Data helper methods. - */ -public class DataHelperImpl implements DataHelper -{ - /** - * @param dateString - Must comply to the pattern of yyyy-MM-dd'T'HH:mm:ss'.'SSS Z - * @return null if dataString couldn't be parsed - */ - public synchronized Date toDate(String dateString) - { - if (dateString == null) - { - return null; - } - - DateFormat [] DATE_PATTERNS = - { - new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.'SSS Z"), - new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.'SSS"), - new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"), - new SimpleDateFormat("yyyy-MM-dd'T'HH:mm"), - new SimpleDateFormat("yyyy-MM-dd") - }; - - for (int i = 0; i < DATE_PATTERNS.length; ++i) - { - try - { - return DATE_PATTERNS[i].parse(dateString); - } - catch (ParseException parseException) - { - } - } - - return null; - } - - public synchronized Calendar toCalendar(String dateString) - { - if (dateString == null) - { - return null; - } - - Date date = toDate(dateString); - if (date == null) - { - return null; - } - - Calendar calendar = new GregorianCalendar(); - calendar.setTime(date); - - return calendar; - } - - public synchronized Calendar toCalendar(String dateString, Locale locale) - { - if (dateString == null || locale == null) - { - return null; - } - - Date date = toDate(dateString); - if (date == null) - { - return null; - } - - Calendar calendar = new GregorianCalendar(locale); - calendar.setTime(date); - return calendar; - } - - public synchronized String toDateTime(Date date) - { - if (date == null) - { - return null; - } - - SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.'SSS zz"); - - return f.format(date); - } - - public synchronized String toDuration(Date date) - { - if (date == null) - { - return null; - } - - SimpleDateFormat f = new SimpleDateFormat("'P'yyyy'Y' MM'M' dd'D' 'T' HH'H' mm'M' ss'S.'SSS"); - - return f.format(date); - } - - public synchronized String toTime(Date date) - { - if (date == null) - { - return null; - } - - SimpleDateFormat f = new SimpleDateFormat("HH:mm:ss'.'SSS zz"); - - return f.format(date); - } - - public synchronized String toDay(Date date) - { - if (date == null) - { - return null; - } - - SimpleDateFormat f = new SimpleDateFormat("---dd zz"); - - return f.format(date); - } - - public synchronized String toMonth(Date date) - { - if (date == null) - { - return null; - } - - SimpleDateFormat f = new SimpleDateFormat("--MM zz"); - - return f.format(date); - } - - public synchronized String toMonthDay(Date date) - { - if (date == null) - { - return null; - } - - SimpleDateFormat f = new SimpleDateFormat("--MM-dd zz"); - - return f.format(date); - } - - public synchronized String toYear(Date date) - { - if (date == null) - { - return null; - } - - SimpleDateFormat f = new SimpleDateFormat("yyyy zz"); - - return f.format(date); - } - - public synchronized String toYearMonth(Date date) - { - if (date == null) - { - return null; - } - - SimpleDateFormat f = new SimpleDateFormat("yyyy-MM zz"); - - return f.format(date); - } - - public synchronized String toYearMonthDay(Date date) - { - if (date == null) - { - return null; - } - - SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd zz"); - - return f.format(date); - } - - public synchronized String toDateTime(Calendar calendar) - { - if (calendar == null) - { - return null; - } - - return toDateTime(calendar.getTime()); - } - - public synchronized String toDuration(Calendar calendar) - { - if (calendar == null) - { - return null; - } - - return toDuration(calendar.getTime()); - } - - public synchronized String toTime(Calendar calendar) - { - if (calendar == null) - { - return null; - } - - return toTime(calendar.getTime()); - } - - public synchronized String toDay(Calendar calendar) - { - if (calendar == null) - { - return null; - } - - return toDay(calendar.getTime()); - } - - public synchronized String toMonth(Calendar calendar) - { - if (calendar == null) - { - return null; - } - - return toMonth(calendar.getTime()); - } - - public synchronized String toMonthDay(Calendar calendar) - { - if (calendar == null) - { - return null; - } - - return toMonthDay(calendar.getTime()); - } - - public synchronized String toYear(Calendar calendar) - { - if (calendar == null) - { - return null; - } - - return toYear(calendar.getTime()); - } - - public synchronized String toYearMonth(Calendar calendar) - { - if (calendar == null) - { - return null; - } - - return toYearMonth(calendar.getTime()); - } - - public synchronized String toYearMonthDay(Calendar calendar) - { - if (calendar == null) - { - return null; - } - - return toYearMonthDay(calendar.getTime()); - } -} diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/EqualityHelperImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/EqualityHelperImpl.java deleted file mode 100644 index a31066d598..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/EqualityHelperImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.helper; - - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.util.EcoreUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.helper.EqualityHelper; - - -/** - * A helper for comparing DataObjects. - */ -public class EqualityHelperImpl implements EqualityHelper -{ - public boolean equalShallow(DataObject dataObject1, DataObject dataObject2) - { - EcoreUtil.EqualityHelper equalityHelper = new EcoreUtil.EqualityHelper() - { - protected boolean haveEqualFeature(EObject eObject1, EObject eObject2, EStructuralFeature feature) - { - if (feature instanceof EAttribute) - { - boolean eIsSet = eObject1.eIsSet(feature); - if (eIsSet != eObject2.eIsSet(feature) || !haveEqualAttribute(eObject1, eObject2, (EAttribute)feature)) - { - return false; - } - } - return true; - } - - protected boolean equalFeatureMapValues(Object value1, Object value2, EStructuralFeature feature) - { - if (feature instanceof EAttribute) - { - return value1 == null ? value2 == null : value1.equals(value2); - } - return true; - } - }; - return equalityHelper.equals((EObject)dataObject1, (EObject)dataObject2); - } - - public boolean equal(DataObject dataObject1, DataObject dataObject2) - { - return EcoreUtil.equals((EObject)dataObject1, (EObject)dataObject2); - } -} diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/HelperProviderImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/HelperProviderImpl.java deleted file mode 100644 index d0ece134e3..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/HelperProviderImpl.java +++ /dev/null @@ -1,110 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.helper; - - -import org.apache.tuscany.sdo.helper.CopyHelperImpl; -import org.apache.tuscany.sdo.helper.DataHelperImpl; -import org.apache.tuscany.sdo.helper.EqualityHelperImpl; -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.helper.CopyHelper; -import commonj.sdo.helper.DataFactory; -import commonj.sdo.helper.DataHelper; -import commonj.sdo.helper.EqualityHelper; -import commonj.sdo.helper.TypeHelper; -import commonj.sdo.helper.XMLHelper; -import commonj.sdo.helper.XSDHelper; -import commonj.sdo.impl.ExternalizableDelegator.Resolvable; -import commonj.sdo.impl.HelperProvider; - - -/** - * Create and manage all the default helper INSTANCEs - */ -public class HelperProviderImpl extends HelperProvider -{ - protected CopyHelper copyHelper; - - protected DataFactory dataFactory; - - protected DataHelper dataHelper; - - protected EqualityHelper equalityHelper; - - protected TypeHelper typeHelper; - - protected XMLHelper xmlHelper; - - protected XSDHelper xsdHelper; - - public HelperProviderImpl() - { - typeHelper = SDOUtil.createTypeHelper(); - dataFactory = SDOUtil.createDataFactory(typeHelper); - xmlHelper = SDOUtil.createXMLHelper(typeHelper); - xsdHelper = SDOUtil.createXSDHelper(typeHelper); - copyHelper = new CopyHelperImpl(); - equalityHelper = new EqualityHelperImpl(); - dataHelper = new DataHelperImpl(); - } - - public CopyHelper copyHelper() - { - return copyHelper; - } - - public DataFactory dataFactory() - { - return dataFactory; - } - - public DataHelper dataHelper() - { - return dataHelper; - } - - public EqualityHelper equalityHelper() - { - return equalityHelper; - } - - public TypeHelper typeHelper() - { - return typeHelper; - } - - public XMLHelper xmlHelper() - { - return xmlHelper; - } - - public XSDHelper xsdHelper() - { - return xsdHelper; - } - - public Resolvable resolvable() - { - throw new UnsupportedOperationException(); //TODO - } - - public Resolvable resolvable(Object target) - { - throw new UnsupportedOperationException(); //TODO - } -} diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/TypeHelperImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/TypeHelperImpl.java deleted file mode 100644 index 38c4c962e7..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/TypeHelperImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.helper; - - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.emf.ecore.EClassifier; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.util.ExtendedMetaData; - -import commonj.sdo.DataObject; -import commonj.sdo.Type; -import commonj.sdo.helper.TypeHelper; - - -/** - * Look up a Type given the uri and typeName or interfaceClass. - * SDO Types are available through the - * getType("commonj.sdo", typeName) method. - * Defines Types from DataObjects. - */ -public class TypeHelperImpl implements TypeHelper -{ - protected ExtendedMetaData extendedMetaData; - - public TypeHelperImpl(ExtendedMetaData extendedMetaData) - { - this.extendedMetaData = extendedMetaData; - } - - public Type getType(String uri, String typeName) - { - EPackage ePackage = extendedMetaData.getPackage(uri); - if (ePackage != null) - { - EClassifier eClassifier = ePackage.getEClassifier(typeName); - if (eClassifier == null) - { - eClassifier = extendedMetaData.getType(ePackage, typeName); - } - return (Type)eClassifier; - } - return null; - } - - public Type getType(Class interfaceClass) - { - //TODO more efficient implementation ... this is a really bad one! - for (Iterator iter = EPackage.Registry.INSTANCE.values().iterator(); iter.hasNext(); ) - { - Object value = iter.next(); - if (value instanceof EPackage) - { - EPackage ePackage = (EPackage)value; - for (Iterator iter2 = ePackage.getEClassifiers().iterator(); iter2.hasNext(); ) - { - EClassifier eClassifier = (EClassifier)iter2.next(); - if (eClassifier.getInstanceClass() == interfaceClass) - { - return (Type)eClassifier; - } - } - } - } - return null; - } - - public Type define(DataObject type) - { - throw new UnsupportedOperationException(); //TODO - } - - public List /*Type*/define(List /*DataObject*/types) - { - throw new UnsupportedOperationException(); //TODO - } - -} diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLDocumentImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLDocumentImpl.java deleted file mode 100644 index 2626eb12ff..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLDocumentImpl.java +++ /dev/null @@ -1,349 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.helper; - - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.Reader; -import java.io.Writer; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.sdo.SDOPackage; -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.util.ExtendedMetaData; -import org.eclipse.emf.ecore.xmi.XMLOptions; -import org.eclipse.emf.ecore.xmi.XMLParserPool; -import org.eclipse.emf.ecore.xmi.XMLResource; -import org.eclipse.emf.ecore.xmi.impl.XMLOptionsImpl; -import org.eclipse.emf.ecore.xmi.impl.XMLParserPoolImpl; -import org.xml.sax.InputSource; - -import commonj.sdo.DataObject; -import commonj.sdo.helper.XMLDocument; - - -/** - * Represents an XML Document containing a tree of DataObjects. - * - * An example XMLDocument fragment is: - * - * - * - * created from this XML Schema fragment: - * - * - * - * - * Upon loading this XMLDocument: - * DataObject is an instance of Type PurchaseOrderType. - * RootElementURI is null because the XSD has no targetNamespace URI. - * RootElementName is purchaseOrder. - * Encoding is null because the document did not specify an encoding. - * XMLDeclaration is true because the document contained an XML declaration. - * XMLVersion is 1.0 - * SchemaLocation and noNamespaceSchemaLocation are null because they are - * not specified in the document. - * - * When saving the root element, if the type of the root dataObject is not the - * type of global element specified by rootElementURI and rootElementName, - * or if a global element does not exist for rootElementURI and rootElementName, - * then an xsi:type declaration is written to record the root DataObject's Type. - * - * When loading the root element and an xsi:type declaration is found - * it is used as the type of the root DataObject. In this case, - * if validation is not being performed, it is not an error if the - * rootElementName is not a global element. - */ -public class XMLDocumentImpl implements XMLDocument -{ - protected ExtendedMetaData extendedMetaData; - - protected EObject rootObject; - - protected XMLResource resource; - - protected EStructuralFeature rootElement; - - protected EObject documentRoot; - - protected static XMLParserPool globalXMLParserPool = new XMLParserPoolImpl(); - - //TODO clean up the options thing - protected XMLDocumentImpl(ExtendedMetaData extendedMetaData, Object options) - { - this.extendedMetaData = extendedMetaData; - ResourceSet resourceSet = DataObjectUtil.createResourceSet(); - - if (options instanceof Map) - { - Class resourceFactoryClass = (Class)((Map)options).get("GENERATED_LOADER"); - if (resourceFactoryClass != null) - { - try - { - Object resourceFactory = resourceFactoryClass.newInstance(); - resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", resourceFactory); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - } - - resource = (XMLResource)resourceSet.createResource(URI.createURI("http:///temp.xml")); - - XMLOptions xmlOptions = new XMLOptionsImpl(); - xmlOptions.setProcessAnyXML(true); - resource.getDefaultLoadOptions().put(XMLResource.OPTION_XML_OPTIONS, xmlOptions); - - resource.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData); - resource.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData); - - resource.getDefaultLoadOptions().put(XMLResource.OPTION_USE_PARSER_POOL, globalXMLParserPool); - - resource.getDefaultLoadOptions().put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.FALSE); - - resource.getDefaultSaveOptions().put(XMLResource.OPTION_CONFIGURATION_CACHE, Boolean.TRUE); - resource.getDefaultLoadOptions().put(XMLResource.OPTION_CONFIGURATION_CACHE, Boolean.TRUE); - - resource.getDefaultLoadOptions().put(XMLResource.OPTION_ANY_TYPE, SDOPackage.eINSTANCE.getAnyTypeDataObject()); - resource.getDefaultSaveOptions().put(XMLResource.OPTION_ANY_TYPE, SDOPackage.eINSTANCE.getAnyTypeDataObject()); - - resource.getDefaultLoadOptions().put(XMLResource.OPTION_ANY_SIMPLE_TYPE, SDOPackage.eINSTANCE.getSimpleAnyTypeDataObject()); - resource.getDefaultSaveOptions().put(XMLResource.OPTION_ANY_SIMPLE_TYPE, SDOPackage.eINSTANCE.getSimpleAnyTypeDataObject()); - - //resource.getDefaultLoadOptions().put(XMLResource.OPTION_USE_XML_NAME_TO_FEATURE_MAP, globalHashMap); - - //resource.getDefaultSaveOptions().put(XMLResource.OPTION_FORMATTED, Boolean.FALSE); - } - - protected XMLDocumentImpl(ExtendedMetaData extendedMetaData) - { - this(extendedMetaData, null); - } - - protected XMLDocumentImpl(ExtendedMetaData extendedMetaData, DataObject dataObject, String rootElementURI, String rootElementName) - { - this(extendedMetaData); - - rootObject = (EObject)dataObject; - - rootElement = extendedMetaData.getElement(rootElementURI, rootElementName); - if (rootElement == null) - { - rootElement = ExtendedMetaData.INSTANCE.demandFeature(rootElementURI, rootElementName, true); - } - - EClass documentRootClass = rootElement.getEContainingClass(); - documentRoot = EcoreUtil.create(documentRootClass); - resource.getContents().add(documentRoot); - } - - protected void save(OutputStream outputStream, Object options) throws IOException - { - EObject oldContainer = null; - EReference oldContainmentReference = null; - int oldContainmentIndex = -1; - - if (documentRoot != null) - { - //TODO also check if rootObject is directly contained in a resource - oldContainer = rootObject.eContainer(); - if (oldContainer != null) - { - oldContainmentReference = rootObject.eContainmentFeature(); - } - if (oldContainer != documentRoot || oldContainmentReference != rootElement) - { - if (oldContainmentReference != null && oldContainmentReference.isMany()) - { - oldContainmentIndex = ((List)oldContainer.eGet(oldContainmentReference)).indexOf(rootObject); - } - documentRoot.eSet(rootElement, rootObject); - } - } - - resource.save(outputStream, (Map)options); - - if (oldContainer != null) - { - if (oldContainer != documentRoot || oldContainmentReference != rootElement) - { - if (oldContainmentReference.isMany()) - { - ((List)oldContainer.eGet(oldContainmentReference)).add(oldContainmentIndex, rootObject); - } - else - { - oldContainer.eSet(oldContainmentReference, rootObject); - } - } - } - else if (documentRoot != null) - { - documentRoot.eSet(rootElement, null); - } - } - - protected void save(Writer outputWriter, Object options) throws IOException - { - // TODO temporary brute-force implementation ... to be replaced - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - save(outputStream, options); - outputWriter.write(new String(outputStream.toByteArray())); - } - - protected void load(InputStream inputStream, String locationURI, Object options) throws IOException - { - InputSource inputSource = new InputSource(inputStream); - load(inputSource, locationURI, options); - } - - protected void load(Reader inputReader, String locationURI, Object options) throws IOException - { - InputSource inputSource = new InputSource(inputReader); - load(inputSource, locationURI, options); - } - - protected void load(InputSource inputSource, String locationURI, Object options) throws IOException - { - rootObject = null; - rootElement = null; - documentRoot = null; - - if (locationURI != null) - { - inputSource.setSystemId(locationURI); - resource.setURI(URI.createURI(locationURI)); - } - - resource.load(inputSource, (Map)options); - - if (!resource.getContents().isEmpty()) - { - documentRoot = (EObject)resource.getContents().get(0); - EClass documentRootClass = documentRoot.eClass(); - if ("".equals(extendedMetaData.getName(documentRootClass))) //TODO efficient way to check this? Maybe DataObject.getContainer should also check this? - { - if (!documentRoot.eContents().isEmpty()) - { - rootObject = (EObject)documentRoot.eContents().get(0); - rootElement = rootObject.eContainmentFeature(); - documentRoot.eUnset(rootElement); - } - } - else - { - rootObject = documentRoot; - documentRoot = null; - } - } - } - - public DataObject getRootObject() - { - return (DataObject)rootObject; - } - - public String getRootElementURI() - { - if (rootElement != null) - { - return extendedMetaData.getNamespace(rootElement); - } - else if (rootObject != null) - { - return extendedMetaData.getNamespace(rootObject.eClass()); - } - return null; - } - - public String getRootElementName() - { - if (rootElement != null) - { - return extendedMetaData.getName(rootElement); - } - else if (rootObject != null) - { - return extendedMetaData.getName(rootObject.eClass()); - } - return null; - } - - public String getEncoding() - { - return resource.getEncoding(); - } - - public void setEncoding(String encoding) - { - resource.setEncoding(encoding); - } - - public boolean isXMLDeclaration() - { - return Boolean.FALSE.equals(resource.getDefaultSaveOptions().get(XMLResource.OPTION_DECLARE_XML)); - } - - public void setXMLDeclaration(boolean xmlDeclaration) - { - resource.getDefaultSaveOptions().put(XMLResource.OPTION_DECLARE_XML, xmlDeclaration ? Boolean.TRUE : Boolean.FALSE); - } - - public String getXMLVersion() - { - return "1.0"; //TODO - } - - public void setXMLVersion(String xmlVersion) - { - throw new UnsupportedOperationException(); //TODO - } - - public String getSchemaLocation() - { - throw new UnsupportedOperationException(); //TODO - } - - public void setSchemaLocation(String schemaLocation) - { - throw new UnsupportedOperationException(); //TODO - } - - public String getNoNamespaceSchemaLocation() - { - throw new UnsupportedOperationException(); //TODO - } - - public void setNoNamespaceSchemaLocation(String schemaLocation) - { - throw new UnsupportedOperationException(); //TODO - } -} diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLHelperImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLHelperImpl.java deleted file mode 100644 index 653665e1b8..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLHelperImpl.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.helper; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.Reader; -import java.io.StringReader; -import java.io.StringWriter; -import java.io.Writer; - -import org.eclipse.emf.ecore.util.ExtendedMetaData; - -import commonj.sdo.DataObject; -import commonj.sdo.helper.TypeHelper; -import commonj.sdo.helper.XMLDocument; -import commonj.sdo.helper.XMLHelper; - -/** - * A helper to convert XML documents into DataObects and - * DataObjects into XML documnets. - */ -public class XMLHelperImpl implements XMLHelper -{ - ExtendedMetaData extendedMetaData; - - public XMLHelperImpl(ExtendedMetaData extendedMetaData) - { - this.extendedMetaData = extendedMetaData; - } - - public XMLHelperImpl(TypeHelper typeHelper) - { - this.extendedMetaData = ((TypeHelperImpl)typeHelper).extendedMetaData; - } - - public XMLDocument load(String inputString) - { - try - { - return load(new StringReader(inputString), null, null); - } - catch (IOException e) - { - throw new RuntimeException(e); // should never happen - } - } - - public XMLDocument load(InputStream inputStream) throws IOException - { - return load(inputStream, null, null); - } - - public XMLDocument load(InputStream inputStream, String locationURI, Object options) throws IOException - { - XMLDocumentImpl document = new XMLDocumentImpl(extendedMetaData, options); - document.load(inputStream, locationURI, options); - return document; - } - - public XMLDocument load(Reader inputReader, String locationURI, Object options) throws IOException - { - XMLDocumentImpl document = new XMLDocumentImpl(extendedMetaData, options); - document.load(inputReader, locationURI, options); - return document; - } - - public String save(DataObject dataObject, String rootElementURI, String rootElementName) - { - StringWriter stringWriter = new StringWriter(); - try - { - save(createDocument(dataObject, rootElementURI, rootElementName), stringWriter, null); - return stringWriter.toString(); - } - catch (IOException e) - { - throw new RuntimeException(e); // should never happen - } - } - - public void save(DataObject dataObject, String rootElementURI, String rootElementName, OutputStream outputStream) throws IOException - { - save(createDocument(dataObject, rootElementURI, rootElementName), outputStream, null); - } - - public void save(XMLDocument xmlDocument, OutputStream outputStream, Object options) throws IOException - { - ((XMLDocumentImpl)xmlDocument).save(outputStream, options); - } - - public void save(XMLDocument xmlDocument, Writer outputWriter, Object options) throws IOException - { - ((XMLDocumentImpl)xmlDocument).save(outputWriter, options); - } - - public XMLDocument createDocument(DataObject dataObject, String rootElementURI, String rootElementName) - { - return new XMLDocumentImpl(extendedMetaData, dataObject, rootElementURI, rootElementName); - } -} diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XSDHelperImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XSDHelperImpl.java deleted file mode 100644 index 3173601861..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XSDHelperImpl.java +++ /dev/null @@ -1,273 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.helper; - - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.io.Reader; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.tuscany.sdo.impl.DynamicDataObjectImpl; -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EClassifier; -import org.eclipse.emf.ecore.EModelElement; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.util.ExtendedMetaData; -import org.eclipse.xsd.XSDConcreteComponent; -import org.eclipse.xsd.XSDSchema; -import org.eclipse.xsd.XSDTypeDefinition; -import org.eclipse.xsd.ecore.XSDEcoreBuilder; -import org.eclipse.xsd.util.XSDResourceImpl; -import org.w3c.dom.Element; -import org.xml.sax.InputSource; - -import commonj.sdo.Property; -import commonj.sdo.Type; -import commonj.sdo.helper.TypeHelper; -import commonj.sdo.helper.XSDHelper; - - -/** - * Provides access to additional information when the - * Type or Property is defined by an XML Schema (XSD). - * Methods return null/false otherwise or if the information is unavailable. - * Defines Types from an XSD. - */ -public class XSDHelperImpl implements XSDHelper -{ - private XSDEcoreBuilder ecoreBuilder; - - private ExtendedMetaData extendedMetaData; - - public XSDHelperImpl(ExtendedMetaData extendedMetaData) - { - this.extendedMetaData = extendedMetaData; - ecoreBuilder = new SDOXSDEcoreBuilder(extendedMetaData); - } - - public XSDHelperImpl(TypeHelper typeHelper) - { - this(((TypeHelperImpl)typeHelper).extendedMetaData); - } - - public String getLocalName(Type type) - { - return extendedMetaData.getName((EClassifier)type); - } - - public String getLocalName(Property property) - { - return extendedMetaData.getName((EStructuralFeature)property); - } - - public String getNamespaceURI(Property property) - { - return extendedMetaData.getNamespace((EStructuralFeature)property); - } - - public boolean isAttribute(Property property) - { - return extendedMetaData.getFeatureKind((EStructuralFeature)property) == ExtendedMetaData.ATTRIBUTE_FEATURE; - } - - public boolean isElement(Property property) - { - return extendedMetaData.getFeatureKind((EStructuralFeature)property) == ExtendedMetaData.ELEMENT_FEATURE; - } - - public boolean isMixed(Type type) - { - if (type instanceof EClass) - { - return extendedMetaData.getContentKind((EClass)type) == ExtendedMetaData.MIXED_CONTENT; - } - else - { - return false; - } - } - - public boolean isXSD(Type type) - { - return ((EModelElement)type).getEAnnotation(ExtendedMetaData.ANNOTATION_URI) != null; - } - - public Property getGlobalProperty(String uri, String propertyName, boolean isElement) - { - if (isElement) - { - return (Property)extendedMetaData.getElement(uri, propertyName); - } - else - { - return (Property)extendedMetaData.getAttribute(uri, propertyName); - } - } - - public String getAppinfo(Type type, String source) - { - return getAppinfo((EModelElement)type, source); - } - - public String getAppinfo(Property property, String source) - { - return getAppinfo((EModelElement)property, source); - } - - protected String getAppinfo(EModelElement eModelElement, String source) - { - return (String)eModelElement.getEAnnotation(source).getDetails().get("appinfo"); - } - - public List /*Type*/define(String xsd) - { - InputStream inputStream = new ByteArrayInputStream(xsd.getBytes()); - return define(inputStream, "*.xsd"); - - } - - public List /*Type*/define(Reader xsdReader, String schemaLocation) - { - - InputSource inputSource = new InputSource(xsdReader); - return define(inputSource, schemaLocation); - - } - - public List /*Type*/define(InputStream xsdInputStream, String schemaLocation) - { - InputSource inputSource = new InputSource(xsdInputStream); - return define(inputSource, schemaLocation); - } - - protected List /*Type*/define(InputSource inputSource, String schemaLocation) - { - try - { - ResourceSet resourceSet = DataObjectUtil.createResourceSet(); - Resource model = resourceSet.createResource(URI.createURI(schemaLocation != null ? schemaLocation : "null.xsd")); - ((XSDResourceImpl)model).load(inputSource, null); - XSDSchema schema = (XSDSchema)model.getContents().get(0); - - // If define() is called more than once for the same XMLSchema, return the existing defined types - //FIXME ... need to rethink this design - //if (!ecoreBuilder.getTargetNamespaceToEPackageMap().containsKey(schema.getTargetNamespace())) - // also return generated types registered via SDOUtil.registerStaticTypes() - EPackage ePackage = extendedMetaData.getPackage(schema.getTargetNamespace()); - if (ePackage == null) - { - ecoreBuilder.generate(schema); - Collection newEPackages = ecoreBuilder.getTargetNamespaceToEPackageMap().values(); - - for (Iterator iter = newEPackages.iterator(); iter.hasNext();) - { - EPackage currentPackage = (EPackage)iter.next(); - currentPackage.setEFactoryInstance(new DynamicDataObjectImpl.FactoryImpl()); - EcoreUtil.freeze(currentPackage); - } - } - ePackage = extendedMetaData.getPackage(schema.getTargetNamespace()); - return ePackage.getEClassifiers(); - } - catch (Exception e) - { - throw new IllegalArgumentException(); - } - } - - public String generate(List /*Type*/types) - { - throw new UnsupportedOperationException(); //TODO - } - - public String generate(List /*Type*/types, Map /*String, String*/namespaceToSchemaLocation) - { - throw new UnsupportedOperationException(); //TODO - } - - protected static class SDOXSDEcoreBuilder extends XSDEcoreBuilder - { - public SDOXSDEcoreBuilder(ExtendedMetaData extendedMetaData) - { - super(extendedMetaData); - } - - protected String getEcoreAttribute(Element element, String attribute) - { - String sdoAttribute = null; - - if ("name".equals(attribute)) - sdoAttribute = "name"; - else if ("opposite".equals(attribute)) - sdoAttribute = "oppositeProperty"; - else if ("mixed".equals(attribute)) - sdoAttribute = "sequence"; - - if (sdoAttribute != null) - { - return - element != null && element.hasAttributeNS("commonj.sdo/xml", sdoAttribute) ? - element.getAttributeNS("commonj.sdo/xml", sdoAttribute) : - null; - } - - if ("package".equals(attribute)) - sdoAttribute = "package"; - else if ("instanceClass".equals(attribute)) - sdoAttribute = "instanceClass"; - - if (sdoAttribute != null) - { - return - element != null && element.hasAttributeNS("commonj.sdo/java", sdoAttribute) ? - element.getAttributeNS("commonj.sdo/java", sdoAttribute) : - null; - } - - return super.getEcoreAttribute(element, attribute); - } - - protected XSDTypeDefinition getEcoreTypeQNameAttribute(XSDConcreteComponent xsdConcreteComponent, String attribute) - { - String sdoAttribute = null; - - if ("reference".equals(attribute)) sdoAttribute = "propertyType"; - - if (sdoAttribute != null) - { - Element element = xsdConcreteComponent.getElement(); - return element == null ? null : getEcoreTypeQNameAttribute(xsdConcreteComponent, element, "commonj.sdo/xml", sdoAttribute); - } - - return super.getEcoreTypeQNameAttribute(xsdConcreteComponent, attribute); - } - - } - -} diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/AnyTypeDataObjectImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/AnyTypeDataObjectImpl.java deleted file mode 100644 index a1bb922d69..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/AnyTypeDataObjectImpl.java +++ /dev/null @@ -1,296 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.impl; - -import org.apache.tuscany.sdo.AnyTypeDataObject; -import org.apache.tuscany.sdo.SDOPackage; -import org.apache.tuscany.sdo.util.BasicSequence; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.util.BasicFeatureMap; -import org.eclipse.emf.ecore.util.FeatureMap; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.emf.ecore.xml.type.AnyType; -import org.eclipse.emf.ecore.xml.type.XMLTypePackage; - -/** - * - * An implementation of the model object 'EData Object Any Type'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl#getMixed Mixed}
  • - *
  • {@link org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl#getAny Any}
  • - *
  • {@link org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl#getAnyAttribute Any Attribute}
  • - *
- *

- * - * @generated - */ -public class AnyTypeDataObjectImpl extends DataObjectImpl implements AnyTypeDataObject -{ - /** - * The cached value of the '{@link #getMixed() Mixed}' attribute list. - * - * - * @see #getMixed() - * @generated - * @ordered - */ - protected FeatureMap mixed = null; - - /** - * The cached value of the '{@link #getAnyAttribute() Any Attribute}' attribute list. - * - * - * @see #getAnyAttribute() - * @generated - * @ordered - */ - protected FeatureMap anyAttribute = null; - - /** - * - * - * @generated - */ - protected AnyTypeDataObjectImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return SDOPackage.eINSTANCE.getAnyTypeDataObject(); - } - - /** - * - * - * @generated NOT - */ - public FeatureMap getMixed() - { - if (mixed == null) - { - //mixed = new BasicFeatureMap(this, SDOPackage.ANY_TYPE_DATA_OBJECT__MIXED); - mixed = new BasicSequence(new BasicFeatureMap(this, SDOPackage.ANY_TYPE_DATA_OBJECT__MIXED)).featureMap(); - } - return mixed; - } - - /** - * - * - * @generated NOT - */ - public FeatureMap getAny() - { - //return (FeatureMap)((FeatureMap)getMixed()).list(XMLTypePackage.eINSTANCE.getAnyType_Any()); - return new BasicSequence((FeatureMap.Internal)((FeatureMap)getMixed()).list(XMLTypePackage.eINSTANCE.getAnyType_Any())).featureMap(); - } - - /** - * - * - * @generated NOT - */ - public FeatureMap getAnyAttribute() - { - if (anyAttribute == null) - { - //anyAttribute = new BasicFeatureMap(this, SDOPackage.ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE); - anyAttribute = new BasicSequence(new BasicFeatureMap(this, SDOPackage.ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE)).featureMap(); - } - return anyAttribute; - } - - /** - * - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) - { - if (featureID >= 0) - { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) - { - case SDOPackage.ANY_TYPE_DATA_OBJECT__MIXED: - return ((InternalEList)getMixed()).basicRemove(otherEnd, msgs); - case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY: - return ((InternalEList)getAny()).basicRemove(otherEnd, msgs); - case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE: - return ((InternalEList)getAnyAttribute()).basicRemove(otherEnd, msgs); - default: - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case SDOPackage.ANY_TYPE_DATA_OBJECT__MIXED: - if (coreType) return getMixed(); - return ((FeatureMap.Internal)getMixed()).getWrapper(); - case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY: - if (coreType) return getAny(); - return ((FeatureMap.Internal)getAny()).getWrapper(); - case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE: - if (coreType) return getAnyAttribute(); - return ((FeatureMap.Internal)getAnyAttribute()).getWrapper(); - } - return eDynamicGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case SDOPackage.ANY_TYPE_DATA_OBJECT__MIXED: - ((FeatureMap.Internal)getMixed()).set(newValue); - return; - case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY: - ((FeatureMap.Internal)getAny()).set(newValue); - return; - case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE: - ((FeatureMap.Internal)getAnyAttribute()).set(newValue); - return; - } - eDynamicSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case SDOPackage.ANY_TYPE_DATA_OBJECT__MIXED: - getMixed().clear(); - return; - case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY: - getAny().clear(); - return; - case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE: - getAnyAttribute().clear(); - return; - } - eDynamicUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case SDOPackage.ANY_TYPE_DATA_OBJECT__MIXED: - return mixed != null && !mixed.isEmpty(); - case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY: - return !getAny().isEmpty(); - case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE: - return anyAttribute != null && !anyAttribute.isEmpty(); - } - return eDynamicIsSet(featureID); - } - - /** - * - * - * @generated - */ - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) - { - if (baseClass == AnyType.class) - { - switch (derivedFeatureID) - { - case SDOPackage.ANY_TYPE_DATA_OBJECT__MIXED: return XMLTypePackage.ANY_TYPE__MIXED; - case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY: return XMLTypePackage.ANY_TYPE__ANY; - case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE: return XMLTypePackage.ANY_TYPE__ANY_ATTRIBUTE; - default: return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) - { - if (baseClass == AnyType.class) - { - switch (baseFeatureID) - { - case XMLTypePackage.ANY_TYPE__MIXED: return SDOPackage.ANY_TYPE_DATA_OBJECT__MIXED; - case XMLTypePackage.ANY_TYPE__ANY: return SDOPackage.ANY_TYPE_DATA_OBJECT__ANY; - case XMLTypePackage.ANY_TYPE__ANY_ATTRIBUTE: return SDOPackage.ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE; - default: return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (mixed: "); - result.append(mixed); - result.append(", anyAttribute: "); - result.append(anyAttribute); - result.append(')'); - return result.toString(); - } - -} //EDataObjectAnyTypeImpl diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/AttributeImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/AttributeImpl.java deleted file mode 100644 index 415787f1e8..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/AttributeImpl.java +++ /dev/null @@ -1,163 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.impl; - -import java.util.List; - -//import org.apache.tuscany.sdo.SDOPackage; - -import org.apache.tuscany.sdo.util.BasicSequence; -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.EAttributeImpl; -import org.eclipse.emf.ecore.util.FeatureMap; - -import commonj.sdo.Property; -import commonj.sdo.Type; - -/** - * - * An implementation of the model object 'Attribute'. - * - *

- *

- * - * @generated - */ -public class AttributeImpl extends EAttributeImpl implements Property -{ - /** - * - * - * @generated - */ - protected AttributeImpl() - { - super(); - } - - /** - * - * - * @generated NOT - */ - protected EClass eStaticClass() - { - return EcorePackage.eINSTANCE.getEAttribute(); - } - - /** - * - * - * @generated NOT - */ - public Object getDefault() - { - return getDefaultValue(); - } - - /** - * - * - * @generated NOT - */ - public boolean isReadOnly() - { - //return "true".equals(EcoreUtil.getAnnotation(this, "commonj.sdo", "readOnly")); - return !isChangeable(); //TODO semantics don't exactly match? - } - - protected List aliasNames = null; - - /** - * - * - * @generated NOT - */ - public List getAliasNames() - { - if (aliasNames == null) - { - aliasNames = DataObjectUtil.getAliasNames(this); - } - return aliasNames; - } - - /** - * - * - * @generated NOT - */ - public Type getType() - { - return (Type)getEType(); - } - - /** - * - * - * @generated NOT - */ - public Type getContainingType() - { - return (Type)getEContainingClass(); - } - - /** - * - * - * @generated NOT - */ - public Property getOpposite() - { - return null; - } - - /** - * - * - * @generated NOT - */ - public boolean isContainment() - { - return false; - } - - protected EStructuralFeature.Internal.SettingDelegate createFeatureMapSettingDelegate() - { - return new InternalSettingDelegateSequence(this); - } - - public static class InternalSettingDelegateSequence extends InternalSettingDelegateMany - { - InternalSettingDelegateSequence(EStructuralFeature feature) - { - super(InternalSettingDelegateMany.FEATURE_MAP, feature); - } - - protected EStructuralFeature.Setting createDynamicSetting(InternalEObject owner) - { - FeatureMap.Internal featureMap = (FeatureMap.Internal)super.createDynamicSetting(owner); - new BasicSequence(featureMap); - return featureMap; - } - } - -} //AttributeImpl diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummaryImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummaryImpl.java deleted file mode 100644 index 9c749ff598..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummaryImpl.java +++ /dev/null @@ -1,692 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.impl; - - -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.tuscany.sdo.SDOFactory; -import org.apache.tuscany.sdo.SDOPackage; -import org.apache.tuscany.sdo.util.BasicSequence; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.UniqueEList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.change.ChangeDescription; -import org.eclipse.emf.ecore.change.FeatureChange; -import org.eclipse.emf.ecore.change.impl.ChangeDescriptionImpl; -import org.eclipse.emf.ecore.change.util.ChangeRecorder; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.DelegatingFeatureMap; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.util.FeatureMapUtil; -import org.eclipse.emf.ecore.util.InternalEList; - -import commonj.sdo.ChangeSummary; -//import commonj.sdo.ChangeSummary.Setting; - -import commonj.sdo.DataGraph; -import commonj.sdo.DataObject; -import commonj.sdo.Property; -import commonj.sdo.Sequence; - - -/** - * - * An implementation of the model object 'EChange Summary'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.apache.tuscany.sdo.impl.ChangeSummaryImpl#getEDataGraph EData Graph}
  • - *
- *

- * - * @generated - */ -public class ChangeSummaryImpl extends ChangeDescriptionImpl implements ChangeSummary -{ - /** - * The cached value of the '{@link #getEDataGraph() EData Graph}' reference. - * - * - * @see #getEDataGraph() - * @generated - * @ordered - */ - protected DataGraph eDataGraph = null; - - protected ChangeRecorder changeRecorder = null; - protected EList cachedObjectsToDetach = null; - protected HashMap cachedSDOObjectChanges = new HashMap(); - - /** - * - * - * @generated - */ - protected ChangeSummaryImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return SDOPackage.eINSTANCE.getChangeSummary(); - } - - /** - * - * - * @generated NOT - */ - public boolean isLogging() - { - return changeRecorder != null; - } - - /** - * - * - * @generated - */ - public DataGraph getEDataGraph() - { - return eDataGraph; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetEDataGraph(DataGraph newEDataGraph, NotificationChain msgs) - { - DataGraph oldEDataGraph = eDataGraph; - eDataGraph = newEDataGraph; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH, oldEDataGraph, newEDataGraph); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - public void setEDataGraph(DataGraph newEDataGraph) - { - if (newEDataGraph != eDataGraph) - { - NotificationChain msgs = null; - if (eDataGraph != null) - msgs = ((InternalEObject)eDataGraph).eInverseRemove(this, SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY, DataGraph.class, msgs); - if (newEDataGraph != null) - msgs = ((InternalEObject)newEDataGraph).eInverseAdd(this, SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY, DataGraph.class, msgs); - msgs = basicSetEDataGraph(newEDataGraph, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH, newEDataGraph, newEDataGraph)); - } - - /** - * - * - * @generated NOT - */ - public void beginLogging() - { - if (isLogging()) - { - throw new IllegalStateException("Already logging"); - } - - getObjectsToAttach().clear(); - getObjectChanges().clear(); - getResourceChanges().clear(); - - oldContainmentInformation = null; - changeRecorder = new SDOChangeRecorder(); - changeRecorder.beginRecording(Collections.singleton(((DataGraphImpl)getEDataGraph()).getRootResource())); -// if (eNotificationRequired()) -// eNotify(new ENotificationImpl(this, Notification.SET, SDOPackage.ECHANGE_SUMMARY__LOGGING, false, true)); - } - - /** - * - * - * @generated NOT - */ - public void resumeLogging() - { - if (isLogging()) - { - throw new IllegalStateException("Already logging"); - } - - oldContainmentInformation = null; - - changeRecorder = new SDOChangeRecorder(); - changeRecorder.beginRecording(this, Collections.singleton(((DataGraphImpl)getEDataGraph()).getRootResource())); - -// if (eNotificationRequired()) -// eNotify(new ENotificationImpl(this, Notification.SET, SDOPackage.ECHANGE_SUMMARY__LOGGING, false, true)); - } - - /** - * - * - * @generated - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) - { - if (featureID >= 0) - { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) - { - case SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH: - if (eDataGraph != null) - msgs = ((InternalEObject)eDataGraph).eInverseRemove(this, SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY, DataGraph.class, msgs); - return basicSetEDataGraph((DataGraph)otherEnd, msgs); - default: - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) - { - if (featureID >= 0) - { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) - { - case SDOPackage.CHANGE_SUMMARY__OBJECT_CHANGES: - return ((InternalEList)getObjectChanges()).basicRemove(otherEnd, msgs); - case SDOPackage.CHANGE_SUMMARY__OBJECTS_TO_ATTACH: - return ((InternalEList)getObjectsToAttach()).basicRemove(otherEnd, msgs); - case SDOPackage.CHANGE_SUMMARY__RESOURCE_CHANGES: - return ((InternalEList)getResourceChanges()).basicRemove(otherEnd, msgs); - case SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH: - return basicSetEDataGraph(null, msgs); - default: - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case SDOPackage.CHANGE_SUMMARY__OBJECT_CHANGES: - if (coreType) return getObjectChanges(); - else return getObjectChanges().map(); - case SDOPackage.CHANGE_SUMMARY__OBJECTS_TO_DETACH: - return getObjectsToDetach(); - case SDOPackage.CHANGE_SUMMARY__OBJECTS_TO_ATTACH: - return getObjectsToAttach(); - case SDOPackage.CHANGE_SUMMARY__RESOURCE_CHANGES: - return getResourceChanges(); - case SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH: - return getEDataGraph(); - } - return eDynamicGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case SDOPackage.CHANGE_SUMMARY__OBJECT_CHANGES: - ((EStructuralFeature.Setting)getObjectChanges()).set(newValue); - return; - case SDOPackage.CHANGE_SUMMARY__OBJECTS_TO_DETACH: - getObjectsToDetach().clear(); - getObjectsToDetach().addAll((Collection)newValue); - return; - case SDOPackage.CHANGE_SUMMARY__OBJECTS_TO_ATTACH: - getObjectsToAttach().clear(); - getObjectsToAttach().addAll((Collection)newValue); - return; - case SDOPackage.CHANGE_SUMMARY__RESOURCE_CHANGES: - getResourceChanges().clear(); - getResourceChanges().addAll((Collection)newValue); - return; - case SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH: - setEDataGraph((DataGraph)newValue); - return; - } - eDynamicSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case SDOPackage.CHANGE_SUMMARY__OBJECT_CHANGES: - getObjectChanges().clear(); - return; - case SDOPackage.CHANGE_SUMMARY__OBJECTS_TO_DETACH: - getObjectsToDetach().clear(); - return; - case SDOPackage.CHANGE_SUMMARY__OBJECTS_TO_ATTACH: - getObjectsToAttach().clear(); - return; - case SDOPackage.CHANGE_SUMMARY__RESOURCE_CHANGES: - getResourceChanges().clear(); - return; - case SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH: - setEDataGraph((DataGraph)null); - return; - } - eDynamicUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case SDOPackage.CHANGE_SUMMARY__OBJECT_CHANGES: - return objectChanges != null && !objectChanges.isEmpty(); - case SDOPackage.CHANGE_SUMMARY__OBJECTS_TO_DETACH: - return objectsToDetach != null && !objectsToDetach.isEmpty(); - case SDOPackage.CHANGE_SUMMARY__OBJECTS_TO_ATTACH: - return objectsToAttach != null && !objectsToAttach.isEmpty(); - case SDOPackage.CHANGE_SUMMARY__RESOURCE_CHANGES: - return resourceChanges != null && !resourceChanges.isEmpty(); - case SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH: - return eDataGraph != null; - } - return eDynamicIsSet(featureID); - } - - protected class SDOChangeRecorder extends ChangeRecorder - { - public SDOChangeRecorder() - { - super(); - } - - public void beginRecording(ChangeDescription changeDescription, Collection rootObjects) - { - deletedObjects = null; - cachedObjectsToDetach = null; - cachedSDOObjectChanges.clear(); - super.beginRecording(changeDescription, rootObjects); - } - - protected ChangeDescription createChangeDescription() - { - return ChangeSummaryImpl.this; - } - - protected FeatureChange createFeatureChange(EObject eObject, EStructuralFeature eStructuralFeature, Object value, boolean isSet) - { - Property property = (Property)eStructuralFeature; - if (property.isReadOnly()) - { - if (((DataObject)eObject).getDataGraph() != null) - { - throw - new IllegalStateException - ("The property '" + property.getName() + "' of type '" + - property.getContainingType().getName() + "' is read only"); - } - } - return (FeatureChange)SDOFactory.eINSTANCE.createChangeSummarySetting(eStructuralFeature, value, isSet); - } - - protected void consolidateChanges() - { - deletedObjects = null; - cachedObjectsToDetach = null; - cachedSDOObjectChanges.clear(); - super.consolidateChanges(); - } - - protected void addAdapter(Notifier notifier) - { - if (notifier instanceof DataObjectImpl) - ((DataObjectImpl)notifier).setChangeRecorder(this); - else - super.addAdapter(notifier); - } - - protected void removeAdapter(Notifier notifier) - { - if (notifier instanceof DataObjectImpl) - ((DataObjectImpl)notifier).setChangeRecorder(null); - else - super.removeAdapter(notifier); - } - - } - - /** - * - * - * @generated NOT - */ - public void endLogging() - { - if (!isLogging()) - { - throw new IllegalStateException("Not currently logging"); - } - - changeRecorder.endRecording(); - changeRecorder.dispose(); - changeRecorder = null; -// if (eNotificationRequired()) -// eNotify(new ENotificationImpl(this, Notification.SET, SDOPackage.ECHANGE_SUMMARY__LOGGING, true, false)); - } - - /** - * - * - * @generated NOT - */ - public boolean isCreated(DataObject dataObject) - { - return getObjectsToDetach().contains(dataObject); - } - - /** - * - * - * @generated NOT - */ - public boolean isDeleted(DataObject dataObject) - { - return getDeletedObjects().contains(dataObject); - } - - /** - * - * - * @generated NOT - */ - public List getOldValues(DataObject dataObject) - { - List sdoSettings = (List)cachedSDOObjectChanges.get(dataObject); - if (sdoSettings != null) - { - return sdoSettings; - } - - List settings = (List)getObjectChanges().get(dataObject); - if (settings == null) - { - settings = Collections.EMPTY_LIST; - } - else - { - for (int i = 0; i < settings.size(); i++) - { - FeatureChange change = (FeatureChange)settings.get(i); - EStructuralFeature feature = change.getFeature(); - if (FeatureMapUtil.isFeatureMap(feature)) - { - final List values = (List)change.getValue(); - if (sdoSettings == null) - { - sdoSettings = new BasicEList(settings); - } - DelegatingFeatureMap featureMap = new DelegatingFeatureMap(((InternalEObject)dataObject), feature) - { - protected final List theList = values; - - protected List delegateList() - { - return theList; - } - }; - - // create new settings and replace the setting for mixed feature - sdoSettings.set(i, SDOFactory.eINSTANCE.createChangeSummarySetting(feature, new BasicSequence(featureMap), change.isSet())); - // add all derived features - for (int k = 0; k < featureMap.size(); k++) - { - EStructuralFeature f = featureMap.getEStructuralFeature(k); - sdoSettings.add(SDOFactory.eINSTANCE.createChangeSummarySetting(f, featureMap.get(f, false), true)); - } - } - } - } - sdoSettings = (sdoSettings != null) ? sdoSettings : settings; - cachedSDOObjectChanges.put(dataObject, sdoSettings); - return sdoSettings; - } - - /** - * - * - * @generated - */ - public boolean isModified(DataObject dataObject) - { - // TODO: implement this method - // Ensure that you remove @generated or mark it @generated NOT - throw new UnsupportedOperationException(); - } - - /** - * - * - * @generated NOT - */ - public void summarize() - { - if (!isLogging()) - { - throw new IllegalStateException("Not currently logging"); - } - - changeRecorder.summarize(); - } - - public boolean isChanged(DataObject dataObject) - { - return getObjectChanges().containsKey(dataObject) && !isDeleted(dataObject) && !isCreated(dataObject); - } - - public Setting getOldValue(DataObject dataObject, Property property) - { - for (Iterator i = getOldValues(dataObject).iterator(); i.hasNext(); ) - { - Setting setting = (Setting)i.next(); - if (setting.getProperty() == property) - { - return setting; - } - } - - return null; - } - - public DataObject getOldContainer(DataObject dataObject) - { - return (DataObject)getOldContainer((EObject)dataObject); - } - - public Property getOldContainmentProperty(DataObject dataObject) - { - return (Property)getOldContainmentFeature((EObject)dataObject); - } - - /** - * - * - * @generated - */ - public Sequence getOldSequence(DataObject dataObject) - { - // TODO: implement this method - // Ensure that you remove @generated or mark it @generated NOT - throw new UnsupportedOperationException(); - } - - /** - * - * - * @generated - */ - public void undoChanges() - { - // TODO: implement this method - // Ensure that you remove @generated or mark it @generated NOT - throw new UnsupportedOperationException(); - } - - public EList getObjectsToDetach() - { - if (cachedObjectsToDetach == null) - { - cachedObjectsToDetach = super.getObjectsToDetach(); - } - return cachedObjectsToDetach; - } - - /** - * - * - * @generated NOT - */ - public DataGraph getDataGraph() - { - return getEDataGraph(); - } - - /** - * - * - * @generated - */ - public List getChangedObjects() - { - // TODO: implement this method - // Ensure that you remove @generated or mark it @generated NOT - throw new UnsupportedOperationException(); - } - - protected Set deletedObjects; - - protected void preApply(boolean reverse) - { - super.preApply(reverse); - deletedObjects = null; - } - - protected Set getDeletedObjects() - { - if (deletedObjects == null) - { - deletedObjects = new HashSet(); - for (Iterator i = EcoreUtil.getAllContents(getObjectsToAttach()); i.hasNext(); ) - { - deletedObjects.add(i.next()); - } - } - return deletedObjects; - } - - /** - * - * - * @generated NOT - */ - public EList getChangedDataObjectsGen() - { - EList result = new UniqueEList.FastCompare(getDeletedObjects()); - result.addAll(getObjectsToDetach()); - for (Iterator i = getObjectChanges().iterator(); i.hasNext(); ) - { - Map.Entry entry = (Map.Entry)i.next(); - result.add(entry.getKey()); - } - return result; - } - - public List getChangedDataObjects() - { - return getChangedDataObjectsGen(); - } - - /** - * - * - * @generated - */ - public DataObject getRootObject() - { - // TODO: implement this method - // Ensure that you remove @generated or mark it @generated NOT - throw new UnsupportedOperationException(); - } - -} //EChangeSummaryImpl diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummarySettingImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummarySettingImpl.java deleted file mode 100644 index 9f714b9cfa..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummarySettingImpl.java +++ /dev/null @@ -1,110 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.impl; - - -import java.util.Map; - -import org.apache.tuscany.sdo.SDOPackage; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.change.impl.FeatureChangeImpl; - -import commonj.sdo.ChangeSummary; -import commonj.sdo.Property; -/** - * - * An implementation of the model object 'EChange Summary Setting'. - * - *

- *

- * - * @generated - */ -public class ChangeSummarySettingImpl extends FeatureChangeImpl implements ChangeSummary.Setting -{ - /** - * - * - * @generated - */ - protected ChangeSummarySettingImpl() - { - super(); - } - - protected ChangeSummarySettingImpl(EStructuralFeature feature, Object value, boolean isSet) - { - super(feature, value, isSet); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return SDOPackage.eINSTANCE.getChangeSummarySetting(); - } - - /** - * - * - * @generated NOT - */ - public Object getValue() - { - EStructuralFeature feature = getFeature(); - if (feature.isMany()) - { - if (value == null) - { - EObject eObject = (EObject)((Map.Entry)eContainer()).getKey(); - value = getListValue((EList)eObject.eGet(feature)); - } - return value; - } - else - { - return super.getValue(); - } - } - - /** - * - * - * @generated NOT - */ - public Property getProperty() - { - return (Property)getFeature(); - } - - /** - * - * - * @generated NOT - */ - public boolean isSet() - { - return super.isSet(); - } - -} //EChangeSummarySettingImpl diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ClassImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ClassImpl.java deleted file mode 100644 index a56c5f9fb2..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ClassImpl.java +++ /dev/null @@ -1,192 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.impl; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.impl.EClassImpl; -import org.eclipse.emf.ecore.util.ExtendedMetaData; - -import commonj.sdo.Property; -import commonj.sdo.Type; - -/** - * - * An implementation of the model object 'Class'. - * - *

- *

- * - * @generated - */ -public class ClassImpl extends EClassImpl implements Type -{ - /** - * - * - * @generated - */ - protected ClassImpl() - { - super(); - } - - /** - * - * - * @generated NOT - */ - protected EClass eStaticClass() - { - return EcorePackage.eINSTANCE.getEClass(); - } - - /** - * - * - * @generated NOT - */ - public String getURI() - { - return getEPackage().getNsURI(); - } - - /** - * - * - * @generated NOT - */ - public boolean isDataType() - { - return false; - } - - /** - * - * - * @generated NOT - */ - public boolean isOpen() - { - for (int i = 0, count = getFeatureCount(); i < count; ++i) - { - EStructuralFeature eStructuralFeature = getEStructuralFeature(i); - switch (ExtendedMetaData.INSTANCE.getFeatureKind(eStructuralFeature)) - { - case ExtendedMetaData.ELEMENT_WILDCARD_FEATURE: - case ExtendedMetaData.ATTRIBUTE_WILDCARD_FEATURE: - case ExtendedMetaData.GROUP_FEATURE: - return true; - } - } - return false; - } - - /** - * - * - * @generated NOT - */ - public boolean isSequenced() - { - // isSequenced == isMixed - return ExtendedMetaData.INSTANCE.getMixedFeature(this) != null; - } - - protected List aliasNames = null; - - /** - * - * - * @generated NOT - */ - public List getAliasNames() - { - if (aliasNames == null) - { - aliasNames = DataObjectUtil.getAliasNames(this); - } - return aliasNames; - } - - /** - * - * - * @generated NOT - */ - public List getDeclaredProperties() - { - return getEStructuralFeatures(); - } - - /** - * - * - * @generated NOT - */ - public List getProperties() - { - return getEAllStructuralFeatures(); - } - - /** - * - * - * @generated NOT - */ - public List getBaseTypes() - { - return getESuperTypes(); - } - - /** - * - * - * @generated NOT - */ - public Property getProperty(String propertyName) - { - if (propertyNameToPropertyMap == null) //FB use eNameToFeatureMap for this? - { - Map result = new HashMap(); - for (Iterator i = getProperties().iterator(); i.hasNext(); ) - { - Property property = (Property)i.next(); - result.put(property.getName(), property); - - List aliasNames = property.getAliasNames(); - for (int count = aliasNames.size(); count > 0; ) - { - result.put(aliasNames.get(--count), property); - } - } - propertyNameToPropertyMap = result; - } - - return (Property)propertyNameToPropertyMap.get(propertyName); - } - - protected Map propertyNameToPropertyMap; - -} //ClassTypeImpl diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataGraphImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataGraphImpl.java deleted file mode 100644 index 725c0211dc..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataGraphImpl.java +++ /dev/null @@ -1,816 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.impl; - - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.Externalizable; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.io.Serializable; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.sdo.SDOFactory; -import org.apache.tuscany.sdo.SDOPackage; -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EClassifier; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.util.BasicExtendedMetaData; -import org.eclipse.emf.ecore.util.ExtendedMetaData; - -import commonj.sdo.ChangeSummary; -import commonj.sdo.DataGraph; -import commonj.sdo.DataObject; -import commonj.sdo.Type; -import commonj.sdo.helper.TypeHelper; - - -/** - * - * An implementation of the model object 'EData Graph'. - * @extends DataGraph, Adapter, Serializable - * - *

- * The following features are implemented: - *

    - *
  • {@link org.apache.tuscany.sdo.impl.DataGraphImpl#getResourceSet Resource Set}
  • - *
  • {@link org.apache.tuscany.sdo.impl.DataGraphImpl#getRootResource Root Resource}
  • - *
  • {@link org.apache.tuscany.sdo.impl.DataGraphImpl#getEChangeSummary EChange Summary}
  • - *
  • {@link org.apache.tuscany.sdo.impl.DataGraphImpl#getERootObject ERoot Object}
  • - *
- *

- * - * @generated - */ -public class DataGraphImpl extends EObjectImpl implements DataGraph, Adapter, Serializable -{ - /** - * The default value of the '{@link #getResourceSet() Resource Set}' attribute. - * - * - * @see #getResourceSet() - * @generated - * @ordered - */ - protected static final ResourceSet RESOURCE_SET_EDEFAULT = null; - - /** - * The cached value of the '{@link #getResourceSet() Resource Set}' attribute. - * - * - * @see #getResourceSet() - * @generated - * @ordered - */ - protected ResourceSet resourceSet = RESOURCE_SET_EDEFAULT; - - /** - * The default value of the '{@link #getRootResource() Root Resource}' attribute. - * - * - * @see #getRootResource() - * @generated - * @ordered - */ - protected static final Resource ROOT_RESOURCE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getEChangeSummary() EChange Summary}' reference. - * - * - * @see #getEChangeSummary() - * @generated - * @ordered - */ - protected ChangeSummary eChangeSummary = null; - - /** - * The cached value of the '{@link #getERootObject() ERoot Object}' reference. - * - * - * @see #getERootObject() - * @generated - * @ordered - */ - protected EObject eRootObject = null; - - /** - * The cached extended metadata to wrap the resource set's package registry. - */ - protected ExtendedMetaData extendedMetaData; - - /** - * - * - * @generated - */ - protected DataGraphImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return SDOPackage.eINSTANCE.getDataGraph(); - } - - public boolean isAdapterForType(Object type) - { - return type == DataGraph.class; - } - - public void notifyChanged(Notification msg) - { - } - - public Notifier getTarget() - { - return getResourceSet(); - } - - public void setTarget(Notifier newTarget) - { - } - - protected ExtendedMetaData getExtendedMetaData() - { - if (extendedMetaData == null) - { - getResourceSet(); - } - return extendedMetaData; - } - - /** - * - * - * @generated NOT - */ - public ResourceSet getResourceSet() - { - if (resourceSet == null) - { - if (eResource() != null) - { - resourceSet = eResource().getResourceSet(); - } - if (resourceSet == null) - { - resourceSet = createResourceSet(); - } - initializeResourceSet(resourceSet); - } - return resourceSet; - } - - protected ResourceSet createResourceSet() - { - return DataObjectUtil.createResourceSet(); - } - - protected Resource createRootResource() - { - Resource result = resourceSet.createResource(URI.createURI("root.xml")); - result.getContents().clear(); - return result; - } - - protected Resource createChangeSummaryResource() - { - Resource result = resourceSet.createResource(URI.createURI("change-summary.xml")); - result.getContents().clear(); - return result; - } - - protected void initializeResourceSet(ResourceSet resourceSet) - { - if (resourceSet == null) - { - extendedMetaData = null; - } - else - { - extendedMetaData = new BasicExtendedMetaData(resourceSet.getPackageRegistry()); - resourceSet.eAdapters().add(this); - } - } - - /** - * - * - * @generated - */ - public void setResourceSetGen(ResourceSet newResourceSet) - { - ResourceSet oldResourceSet = resourceSet; - resourceSet = newResourceSet; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, SDOPackage.DATA_GRAPH__RESOURCE_SET, oldResourceSet, resourceSet)); - } - - public void setResourceSet(ResourceSet newResourceSet) - { - if (resourceSet != null) - { - resourceSet.eAdapters().remove(this); - } - setResourceSetGen(newResourceSet); - initializeResourceSet(newResourceSet); - } - - /** - * - * - * @generated NOT - */ - public Resource getRootResource() - { - if (eRootObject == null) - { - Resource result = getResourceSet().getResource(URI.createURI("root.xml"), false); - if (result == null) - { - result = createRootResource(); - } - - return result; - } - else - { - return eRootObject.eResource(); - } - } - - public Resource getDataGraphResource() - { - Resource result = eResource(); - if (result == null) - { - result = getResourceSet().createResource(URI.createURI("all.datagraph")); - result.getContents().add(this); - } - return result; - } - - /** - * - * - * @generated - */ - public ChangeSummary getEChangeSummary() - { - return eChangeSummary; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetEChangeSummary(ChangeSummary newEChangeSummary, NotificationChain msgs) - { - ChangeSummary oldEChangeSummary = eChangeSummary; - eChangeSummary = newEChangeSummary; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY, oldEChangeSummary, newEChangeSummary); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - public void setEChangeSummary(ChangeSummary newEChangeSummary) - { - if (newEChangeSummary != eChangeSummary) - { - NotificationChain msgs = null; - if (eChangeSummary != null) - msgs = ((InternalEObject)eChangeSummary).eInverseRemove(this, SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH, ChangeSummary.class, msgs); - if (newEChangeSummary != null) - msgs = ((InternalEObject)newEChangeSummary).eInverseAdd(this, SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH, ChangeSummary.class, msgs); - msgs = basicSetEChangeSummary(newEChangeSummary, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY, newEChangeSummary, newEChangeSummary)); - } - - /** - * - * - * @generated - */ - public EObject getERootObject() - { - return eRootObject; - } - - /** - * - * - * @generated - */ - public void setERootObjectGen(EObject newERootObject) - { - EObject oldERootObject = eRootObject; - eRootObject = newERootObject; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, SDOPackage.DATA_GRAPH__EROOT_OBJECT, oldERootObject, eRootObject)); - } - - public void setERootObject(EObject newERootObject) - { - // If there is a resource set already... - // - if (resourceSet != null) - { - // Get the root resource and if there's a root object in it already, clear it. - // Then set the root object and add it to the root resource. - // - List contents = getRootResource().getContents(); - if (eRootObject != null) - { - contents.clear(); - } - setERootObjectGen(newERootObject); - if (newERootObject != null) - { - contents.add(newERootObject); - } - } - else - { - // Set the root object and see if it has a resource we can reuse. - // - setERootObjectGen(newERootObject); - Resource rootResource = newERootObject.eResource(); - if (rootResource != null) - { - // If there is no resource set - // - if (rootResource.getResourceSet() == null) - { - // Demand create one and add this resource to it. - // - getResourceSet().getResources().add(rootResource); - } - else - { - // Reuse the existing resource set. - // - setResourceSet(rootResource.getResourceSet()); - } - } - else - { - // Demand create the resource set and the root resource, and add to it's contents. - // - getResourceSet(); - createRootResource().getContents().add(newERootObject); - } - } - } - - /** - * - * - * @generated NOT - */ - public EClassifier getEClassifier(String namespaceURI, String typeName) - { - ExtendedMetaData extendedMetaData = getExtendedMetaData(); - EPackage ePackage = extendedMetaData.getPackage(namespaceURI); - if (ePackage != null) - { - EClassifier eClassifier = ePackage.getEClassifier(typeName); - if (eClassifier == null) - { - eClassifier = extendedMetaData.getType(ePackage, typeName); - } - return eClassifier; - } - else - { - return null; - } - } - - /** - * - * - * @generated NOT - */ - public Type getType(String namespaceURI, String typeName) - { - return TypeHelper.INSTANCE.getType(namespaceURI, typeName); - //EClassifier eClassifier = getEClassifier(namespaceURI, typeName); - //return eClassifier == null ? null : SDOUtil.getType(eClassifier); - } - - /** - * - * - * @generated - */ - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) - { - if (featureID >= 0) - { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) - { - case SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY: - if (eChangeSummary != null) - msgs = ((InternalEObject)eChangeSummary).eInverseRemove(this, SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH, ChangeSummary.class, msgs); - return basicSetEChangeSummary((ChangeSummary)otherEnd, msgs); - default: - return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); - } - } - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - return eBasicSetContainer(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) - { - if (featureID >= 0) - { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) - { - case SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY: - return basicSetEChangeSummary(null, msgs); - default: - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case SDOPackage.DATA_GRAPH__RESOURCE_SET: - return getResourceSet(); - case SDOPackage.DATA_GRAPH__ROOT_RESOURCE: - return getRootResource(); - case SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY: - return getEChangeSummary(); - case SDOPackage.DATA_GRAPH__EROOT_OBJECT: - return getERootObject(); - } - return eDynamicGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case SDOPackage.DATA_GRAPH__RESOURCE_SET: - setResourceSet((ResourceSet)newValue); - return; - case SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY: - setEChangeSummary((ChangeSummary)newValue); - return; - case SDOPackage.DATA_GRAPH__EROOT_OBJECT: - setERootObject((EObject)newValue); - return; - } - eDynamicSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case SDOPackage.DATA_GRAPH__RESOURCE_SET: - setResourceSet(RESOURCE_SET_EDEFAULT); - return; - case SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY: - setEChangeSummary((ChangeSummary)null); - return; - case SDOPackage.DATA_GRAPH__EROOT_OBJECT: - setERootObject((EObject)null); - return; - } - eDynamicUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case SDOPackage.DATA_GRAPH__RESOURCE_SET: - return RESOURCE_SET_EDEFAULT == null ? resourceSet != null : !RESOURCE_SET_EDEFAULT.equals(resourceSet); - case SDOPackage.DATA_GRAPH__ROOT_RESOURCE: - return ROOT_RESOURCE_EDEFAULT == null ? getRootResource() != null : !ROOT_RESOURCE_EDEFAULT.equals(getRootResource()); - case SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY: - return eChangeSummary != null; - case SDOPackage.DATA_GRAPH__EROOT_OBJECT: - return eRootObject != null; - } - return eDynamicIsSet(featureID); - } - - public DataObject createEDataObject(Type type) - { - return DataObjectUtil.create(type); - } - - public DataObject getRootObject() - { - return (DataObject)getERootObject(); - } - - public DataObject createRootObject(String namespaceURI, String typeName) - { - DataObject dataObject = DataObjectUtil.create(getType(namespaceURI, typeName)); - setERootObject((EObject)dataObject); - return dataObject; - } - - public DataObject createRootObject(Type type) - { - DataObject dataObject = DataObjectUtil.create(type); - setERootObject((EObject)dataObject); - return dataObject; - } - - public ChangeSummary getChangeSummary() - { - //FB is this the right place to create the resources? - ChangeSummary changeSummary = getEChangeSummary(); - if (changeSummary == null) - { - getRootResource(); - changeSummary = createEChangeSummary(); - setEChangeSummary(changeSummary); - } - - if (((ChangeSummaryImpl)changeSummary).eResource() == null) - { - Resource changeSummaryResource = createChangeSummaryResource(); - changeSummaryResource.getContents().add(changeSummary); - } - - return changeSummary; - } - - protected ChangeSummaryImpl createEChangeSummary() - { - return (ChangeSummaryImpl)SDOFactory.eINSTANCE.createChangeSummary(); - } - - public static class EDataGraphExternalizable implements Externalizable - { - protected DataGraphImpl eDataGraph; - protected Map writeReplacements = new HashMap(); - - public EDataGraphExternalizable() - { - } - - public EDataGraphExternalizable(DataGraphImpl eDataGraph) - { - this.eDataGraph = eDataGraph; - } - - public void writeExternal(ObjectOutput objectOutput) throws IOException - { - ByteArrayOutputStream byteArrayOutputStream = - new ByteArrayOutputStream() - { - public byte [] toByteArray() - { - return super.toByteArray(); - } - }; - - eDataGraph.getDataGraphResource().save(byteArrayOutputStream, null); - objectOutput.writeInt(byteArrayOutputStream.toByteArray().length); - objectOutput.write(byteArrayOutputStream.toByteArray()); - } - - public void readExternal(ObjectInput objectInput) throws IOException - { - int length = objectInput.readInt(); - byte [] bytes = new byte [length]; - objectInput.readFully(bytes); - - ResourceSet resourceSet = createResourceSet(); - Resource resource = resourceSet.createResource(URI.createURI("all.datagraph")); - resource.load(new ByteArrayInputStream(bytes), null); - eDataGraph = (DataGraphImpl)resource.getContents().get(0); - } - - protected ResourceSet createResourceSet() - { - return DataObjectUtil.createResourceSet(); - } - - public Object getWriteReplacement(EObject eObject) - { - Object result = writeReplacements.get(eObject); - if (result == null) - { - result = new EDataObjectExternalizable(eDataGraph, eObject); - writeReplacements.put(eObject, result); - } - return result; - } - - protected Object readResolve() - { - return eDataGraph; - } - } - - public static class EDataObjectExternalizable implements Externalizable - { - protected EObject eObject; - protected DataGraphImpl eDataGraph; - - public EDataObjectExternalizable() - { - } - - public EDataObjectExternalizable(DataGraphImpl eDataGraph, EObject eObject) - { - this.eDataGraph = eDataGraph; - this.eObject = eObject; - } - - public void writeExternal(ObjectOutput objectOutput) throws IOException - { - // Write the data object reference too. - String uri = eObject.eResource().getURIFragment(eObject); - objectOutput.writeUTF(uri); - objectOutput.writeObject(eDataGraph.getWriteReplacement()); - } - - public void readExternal(ObjectInput objectInput) throws IOException, ClassNotFoundException - { - String uri = objectInput.readUTF(); - eDataGraph = (DataGraphImpl)objectInput.readObject(); - eObject = eDataGraph.getRootResource().getEObject(uri); - } - - protected Object readResolve() - { - return eObject; - } - } - - - protected EDataGraphExternalizable eDataGraphExternalizable; - protected Adapter modificationTracker; - - public Object getWriteReplacement() - { - if (eDataGraphExternalizable == null) - { - eDataGraphExternalizable = createEDataGraphExternalizable(); - getRootResource().setTrackingModification(true); - modificationTracker = - new AdapterImpl() - { - public void notifyChanged(Notification notification) - { - if (notification.getFeatureID(Resource.class) == Resource.RESOURCE__IS_MODIFIED && notification.getNewBooleanValue()) - { - eDataGraphExternalizable = null; - modificationTracker = null; - ((Resource)target).eAdapters().remove(this); - } - } - }; - getRootResource().eAdapters().add(modificationTracker); - } - return eDataGraphExternalizable; - } - - protected EDataGraphExternalizable createEDataGraphExternalizable() - { - return new EDataGraphExternalizable(this); - } - - public Object getWriteReplacement(EObject eObject) - { - return ((EDataGraphExternalizable)getWriteReplacement()).getWriteReplacement(eObject); - } - - public Object writeReplace() - { - return getWriteReplacement(); - } - - public EObject eObjectForURIFragmentSegment(String uriFragmentSegment) - { - if (uriFragmentSegment.startsWith("@models.")) - { - if (resourceSet != null) - { - int count = Integer.parseInt(uriFragmentSegment.substring(8)); - for (Iterator i = resourceSet.getResources().iterator(); i.hasNext(); ) - { - Resource ePackageResource = (Resource)i.next(); - List resourceContents = ePackageResource.getContents(); - if (resourceContents.size() == 1 && resourceContents.get(0) instanceof EPackage && count-- == 0) - { - return (EObject)resourceContents.get(0); - } - } - } - - return null; - } - else - { - return super.eObjectForURIFragmentSegment(uriFragmentSegment); - } - } - - /** - * - * - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (resourceSet: "); - result.append(resourceSet); - result.append(')'); - return result.toString(); - } - -} //EDataGraphImpl diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectImpl.java deleted file mode 100644 index a815d28e4d..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectImpl.java +++ /dev/null @@ -1,1705 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.impl; - - -import java.io.InvalidObjectException; -import java.io.ObjectStreamException; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -//import org.apache.sdo.util.SDOUtil; - -import org.apache.tuscany.sdo.SDOPackage; -import org.apache.tuscany.sdo.impl.ChangeSummaryImpl.SDOChangeRecorder; -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.common.util.UniqueEList; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.EStructuralFeature.Internal.DynamicValueHolder; -import org.eclipse.emf.ecore.impl.BasicEObjectImpl; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.util.BasicExtendedMetaData; -import org.eclipse.emf.ecore.util.EContentsEList; -import org.eclipse.emf.ecore.util.ECrossReferenceEList; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.util.FeatureMap; -import org.eclipse.emf.ecore.util.FeatureMapUtil; - -import commonj.sdo.ChangeSummary; -import commonj.sdo.DataGraph; -import commonj.sdo.DataObject; -import commonj.sdo.Property; -import commonj.sdo.Sequence; -import commonj.sdo.Type; - - -/** - * - * Base implementation of the SDO DataObject interface. This implementation allocates the minimum storage - * overhead needed for SDO. It provides a complete implementation of the API, but does not, however, allocate - * any storage for the actual properties of the data object. It instead requires subclasses for this purpose. - * The subclass, DynamicDataObjectImpl serves as a concrete implementation class for dynamic data objects. - * Static data object storage is provided by generated classes, which also directly or indirectly derive from - * this class. - * - *

- *

- * - * @generated - */ -public abstract class DataObjectImpl extends BasicEObjectImpl implements DataObject -{ - protected InternalEObject eContainer; - protected int eContainerFeatureID; - protected SDOChangeRecorder changeRecorder; - protected Object location; // Resource.Internal (if object is directly contained in a resource) or URI (if it is a proxy) - - /** - * - * - * @generated - */ - protected DataObjectImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return SDOPackage.eINSTANCE.getDataObject(); - } - - /** - * - * - * @generated NOT - */ - public Object writeReplace() throws ObjectStreamException - { - //TODO implement this method properly - DataGraph dataGraph = getDataGraph(); - if (dataGraph != null) - { - return ((DataGraphImpl)dataGraph).getWriteReplacement(this); - } - else - { - throw new InvalidObjectException("The object must be in a datagraph to be serialized " + this); - } - } - - /** - * - * - * @generated NOT - */ - public Object get(String path) - { - Property property = getType().getProperty(path); - if (property != null) - { - return get(property); - } - else - { - return DataObjectUtil.Accessor.create(this, path).getAndRecyle(); - } - } - - /** - * - * - * @generated NOT - */ - public void set(String path, Object value) - { - Property property = getType().getProperty(path); - if (property != null) - { - set(property, value); - } - else - { - DataObjectUtil.Accessor.create(this, path).setAndRecyle(value); - } - } - - /** - * - * - * @generated NOT - */ - public boolean isSet(String path) - { - Property property = getType().getProperty(path); - if (property != null) - { - return isSet(property); - } - else - { - return DataObjectUtil.Accessor.create(this, path).isSetAndRecyle(); - } - } - - /** - * - * - * @generated NOT - */ - public void unset(String path) - { - Property property = getType().getProperty(path); - if (property != null) - { - unset(property); - } - else - { - DataObjectUtil.Accessor.create(this, path).unsetAndRecyle(); - } - } - - /** - * - * - * @generated NOT - */ - public Object get(int propertyIndex) - { - return eGet(propertyIndex, true, false); - } - - /** - * - * - * @generated NOT - */ - public void set(int propertyIndex, Object value) - { - eSet(propertyIndex, value); - } - - /** - * - * - * @generated NOT - */ - public boolean isSet(int propertyIndex) - { - return eIsSet(propertyIndex); - } - - /** - * - * - * @generated NOT - */ - public void unset(int propertyIndex) - { - eUnset(propertyIndex); - } - - /** - * - * - * @generated NOT - */ - public Object get(Property property) - { - return eGet((EStructuralFeature)property, true, false); - } - - /** - * - * - * @generated NOT - */ - public void set(Property property, Object value) - { - eSet((EStructuralFeature)property, value); - } - - /** - * - * - * @generated NOT - */ - public boolean isSet(Property property) - { - return eIsSet((EStructuralFeature)property); - } - - /** - * - * - * @generated NOT - */ - public void unset(Property property) - { - eUnset((EStructuralFeature)property); - } - - /** - * - * - * @generated NOT - */ - public DataObject getContainer() - { - return (DataObject)eContainer(); - } - - /** - * - * - * @generated NOT - */ - public Property getContainmentProperty() - { - return (Property)eContainmentFeature(); - } - - /** - * - * - * @generated NOT - */ - public DataGraph getDataGraph() - { - Resource resource = eResource(); - if (resource != null) - { - ResourceSet resourceSet = resource.getResourceSet(); - if (resourceSet != null) - { - return (DataGraphImpl)EcoreUtil.getAdapter(resourceSet.eAdapters(), DataGraph.class); - } - } - return null; - } - - /** - * - * - * @generated NOT - */ - public Type getType() - { - return (Type)eClass(); - } - - /** - * - * - * @generated NOT - */ - public BigDecimal getBigDecimal(String path) - { - return DataObjectUtil.getBigDecimal(get(path)); - } - - /** - * - * - * @generated NOT - */ - public BigInteger getBigInteger(String path) - { - return DataObjectUtil.getBigInteger(get(path)); - } - - /** - * - * - * @generated NOT - */ - public boolean getBoolean(String path) - { - return DataObjectUtil.getBoolean(get(path)); - } - - /** - * - * - * @generated NOT - */ - public byte getByte(String path) - { - return DataObjectUtil.getByte(get(path)); - } - - /** - * - * - * @generated NOT - */ - public byte[] getBytes(String path) - { - return DataObjectUtil.getBytes(get(path)); - } - - /** - * - * - * @generated NOT - */ - public char getChar(String path) - { - return DataObjectUtil.getChar(get(path)); - } - - /** - * - * - * @generated NOT - */ - public DataObject getDataObject(String path) - { - return (DataObject)get(path); - } - - /** - * - * - * @generated NOT - */ - public Date getDate(String path) - { - return DataObjectUtil.getDate(get(path)); - } - - /** - * - * - * @generated NOT - */ - public double getDouble(String path) - { - return DataObjectUtil.getDouble(get(path)); - } - - /** - * - * - * @generated NOT - */ - public float getFloat(String path) - { - return DataObjectUtil.getFloat(get(path)); - } - - /** - * - * - * @generated NOT - */ - public int getInt(String path) - { - return DataObjectUtil.getInt(get(path)); - } - - /** - * - * - * @generated NOT - */ - public List getList(String path) - { - return (List)get(path); - } - - /** - * - * - * @generated NOT - */ - public long getLong(String path) - { - return DataObjectUtil.getLong(get(path)); - } - - /** - * - * - * @generated NOT - */ - public Sequence getSequence(String path) - { - return (Sequence)get(path); - } - - /** - * - * - * @generated NOT - */ - public short getShort(String path) - { - return DataObjectUtil.getShort(get(path)); - } - - /** - * - * - * @generated NOT - */ - public String getString(String path) - { - return DataObjectUtil.getString(get(path)); - } - - /** - * - * - * @generated NOT - */ - public void setBigDecimal(String path, BigDecimal value) - { - Property property = getType().getProperty(path); - if (property != null) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - else - { - DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create(this, path); - accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value)); - } - } - - /** - * - * - * @generated NOT - */ - public void setBigInteger(String path, BigInteger value) - { - Property property = getType().getProperty(path); - if (property != null) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - else - { - DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create(this, path); - accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value)); - } - } - - /** - * - * - * @generated NOT - */ - public void setBoolean(String path, boolean value) - { - Property property = getType().getProperty(path); - if (property != null) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - else - { - DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create(this, path); - accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value)); - } - } - - /** - * - * - * @generated NOT - */ - public void setByte(String path, byte value) - { - Property property = getType().getProperty(path); - if (property != null) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - else - { - DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create(this, path); - accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value)); - } - } - - /** - * - * - * @generated NOT - */ - public void setBytes(String path, byte[] value) - { - Property property = getType().getProperty(path); - if (property != null) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - else - { - DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create(this, path); - accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value)); - } - } - - /** - * - * - * @generated NOT - */ - public void setChar(String path, char value) - { - Property property = getType().getProperty(path); - if (property != null) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - else - { - DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create(this, path); - accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value)); - } - } - - /** - * - * - * @generated NOT - */ - public void setDataObject(String path, DataObject value) - { - set(path, value); - } - - /** - * - * - * @generated NOT - */ - public void setDate(String path, Date value) - { - Property property = getType().getProperty(path); - if (property != null) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - else - { - DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create(this, path); - accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value)); - } - } - - /** - * - * - * @generated NOT - */ - public void setDouble(String path, double value) - { - Property property = getType().getProperty(path); - if (property != null) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - else - { - DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create(this, path); - accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value)); - } - } - - /** - * - * - * @generated NOT - */ - public void setFloat(String path, float value) - { - Property property = getType().getProperty(path); - if (property != null) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - else - { - DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create(this, path); - accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value)); - } - } - - /** - * - * - * @generated NOT - */ - public void setInt(String path, int value) - { - Property property = getType().getProperty(path); - if (property != null) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - else - { - DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create(this, path); - accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value)); - } - } - - /** - * - * - * @generated NOT - */ - public void setList(String path, List value) - { - set(path, value); - } - - /** - * - * - * @generated NOT - */ - public void setLong(String path, long value) - { - Property property = getType().getProperty(path); - if (property != null) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - else - { - DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create(this, path); - accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value)); - } - } - - /** - * - * - * @generated NOT - */ - public void setShort(String path, short value) - { - Property property = getType().getProperty(path); - if (property != null) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - else - { - DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create(this, path); - accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value)); - } - } - - /** - * - * - * @generated NOT - */ - public void setString(String path, String value) - { - Property property = getType().getProperty(path); - if (property != null) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - else - { - DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create(this, path); - accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value)); - } - } - - /** - * - * - * @generated NOT - */ - public BigDecimal getBigDecimal(int propertyIndex) - { - return DataObjectUtil.getBigDecimal(get(propertyIndex)); - } - - /** - * - * - * @generated NOT - */ - public BigInteger getBigInteger(int propertyIndex) - { - return DataObjectUtil.getBigInteger(get(propertyIndex)); - } - - /** - * - * - * @generated NOT - */ - public boolean getBoolean(int propertyIndex) - { - return DataObjectUtil.getBoolean(get(propertyIndex)); - } - - /** - * - * - * @generated NOT - */ - public byte getByte(int propertyIndex) - { - return DataObjectUtil.getByte(get(propertyIndex)); - } - - /** - * - * - * @generated NOT - */ - public byte[] getBytes(int propertyIndex) - { - return DataObjectUtil.getBytes(get(propertyIndex)); - } - - /** - * - * - * @generated NOT - */ - public char getChar(int propertyIndex) - { - return DataObjectUtil.getChar(get(propertyIndex)); - } - - /** - * - * - * @generated NOT - */ - public DataObject getDataObject(int propertyIndex) - { - return (DataObject)get(propertyIndex); - } - - /** - * - * - * @generated NOT - */ - public Date getDate(int propertyIndex) - { - return DataObjectUtil.getDate(get(propertyIndex)); - } - - /** - * - * - * @generated NOT - */ - public double getDouble(int propertyIndex) - { - return DataObjectUtil.getDouble(get(propertyIndex)); - } - - /** - * - * - * @generated NOT - */ - public float getFloat(int propertyIndex) - { - return DataObjectUtil.getFloat(get(propertyIndex)); - } - - /** - * - * - * @generated NOT - */ - public int getInt(int propertyIndex) - { - return DataObjectUtil.getInt(get(propertyIndex)); - } - - /** - * - * - * @generated NOT - */ - public List getList(int propertyIndex) - { - return (List)get(propertyIndex); - } - - /** - * - * - * @generated NOT - */ - public long getLong(int propertyIndex) - { - return DataObjectUtil.getLong(get(propertyIndex)); - } - - /** - * - * - * @generated NOT - */ - public Sequence getSequence(int propertyIndex) - { - return (Sequence)get(propertyIndex); - } - - /** - * - * - * @generated NOT - */ - public short getShort(int propertyIndex) - { - return DataObjectUtil.getShort(get(propertyIndex)); - } - - /** - * - * - * @generated NOT - */ - public String getString(int propertyIndex) - { - return DataObjectUtil.getString(get(propertyIndex)); - } - - /** - * - * - * @generated NOT - */ - public void setBigDecimal(int propertyIndex, BigDecimal value) - { - set(propertyIndex, DataObjectUtil.getSetValue((Property)eClass().getEStructuralFeature(propertyIndex), value)); - } - - /** - * - * - * @generated NOT - */ - public void setBigInteger(int propertyIndex, BigInteger value) - { - set(propertyIndex, DataObjectUtil.getSetValue((Property)eClass().getEStructuralFeature(propertyIndex), value)); - } - - /** - * - * - * @generated NOT - */ - public void setBoolean(int propertyIndex, boolean value) - { - set(propertyIndex, DataObjectUtil.getSetValue((Property)eClass().getEStructuralFeature(propertyIndex), value)); - } - - /** - * - * - * @generated NOT - */ - public void setByte(int propertyIndex, byte value) - { - set(propertyIndex, DataObjectUtil.getSetValue((Property)eClass().getEStructuralFeature(propertyIndex), value)); - } - - /** - * - * - * @generated NOT - */ - public void setBytes(int propertyIndex, byte[] value) - { - set(propertyIndex, DataObjectUtil.getSetValue((Property)eClass().getEStructuralFeature(propertyIndex), value)); - } - - /** - * - * - * @generated NOT - */ - public void setChar(int propertyIndex, char value) - { - set(propertyIndex, DataObjectUtil.getSetValue((Property)eClass().getEStructuralFeature(propertyIndex), value)); - } - - /** - * - * - * @generated NOT - */ - public void setDataObject(int propertyIndex, DataObject value) - { - set(propertyIndex, value); - } - - /** - * - * - * @generated NOT - */ - public void setDate(int propertyIndex, Date value) - { - set(propertyIndex, DataObjectUtil.getSetValue((Property)eClass().getEStructuralFeature(propertyIndex), value)); - } - - /** - * - * - * @generated NOT - */ - public void setDouble(int propertyIndex, double value) - { - set(propertyIndex, DataObjectUtil.getSetValue((Property)eClass().getEStructuralFeature(propertyIndex), value)); - } - - /** - * - * - * @generated NOT - */ - public void setFloat(int propertyIndex, float value) - { - set(propertyIndex, DataObjectUtil.getSetValue((Property)eClass().getEStructuralFeature(propertyIndex), value)); - } - - /** - * - * - * @generated NOT - */ - public void setInt(int propertyIndex, int value) - { - set(propertyIndex, DataObjectUtil.getSetValue((Property)eClass().getEStructuralFeature(propertyIndex), value)); - } - - /** - * - * - * @generated NOT - */ - public void setList(int propertyIndex, List value) - { - set(propertyIndex, value); - } - - /** - * - * - * @generated NOT - */ - public void setLong(int propertyIndex, long value) - { - set(propertyIndex, DataObjectUtil.getSetValue((Property)eClass().getEStructuralFeature(propertyIndex), value)); - } - - /** - * - * - * @generated NOT - */ - public void setShort(int propertyIndex, short value) - { - set(propertyIndex, DataObjectUtil.getSetValue((Property)eClass().getEStructuralFeature(propertyIndex), value)); - } - - /** - * - * - * @generated NOT - */ - public void setString(int propertyIndex, String value) - { - set(propertyIndex, DataObjectUtil.getSetValue((Property)eClass().getEStructuralFeature(propertyIndex), value)); - } - - /** - * - * - * @generated NOT - */ - public BigDecimal getBigDecimal(Property property) - { - return DataObjectUtil.getBigDecimal(get(property)); - } - - /** - * - * - * @generated NOT - */ - public BigInteger getBigInteger(Property property) - { - return DataObjectUtil.getBigInteger(get(property)); - } - - /** - * - * - * @generated NOT - */ - public boolean getBoolean(Property property) - { - return DataObjectUtil.getBoolean(get(property)); - } - - /** - * - * - * @generated NOT - */ - public byte getByte(Property property) - { - return DataObjectUtil.getByte(get(property)); - } - - /** - * - * - * @generated NOT - */ - public byte[] getBytes(Property property) - { - return DataObjectUtil.getBytes(get(property)); - } - - /** - * - * - * @generated NOT - */ - public char getChar(Property property) - { - return DataObjectUtil.getChar(get(property)); - } - - /** - * - * - * @generated NOT - */ - public DataObject getDataObject(Property property) - { - return (DataObject)get(property); - } - - /** - * - * - * @generated NOT - */ - public Date getDate(Property property) - { - return DataObjectUtil.getDate(get(property)); - } - - /** - * - * - * @generated NOT - */ - public double getDouble(Property property) - { - return DataObjectUtil.getDouble(get(property)); - } - - /** - * - * - * @generated NOT - */ - public float getFloat(Property property) - { - return DataObjectUtil.getFloat(get(property)); - } - - /** - * - * - * @generated NOT - */ - public int getInt(Property property) - { - return DataObjectUtil.getInt(get(property)); - } - - /** - * - * - * @generated NOT - */ - public List getList(Property property) - { - return (List)get(property); - } - - /** - * - * - * @generated NOT - */ - public long getLong(Property property) - { - return DataObjectUtil.getLong(get(property)); - } - - /** - * - * - * @generated NOT - */ - public Sequence getSequence(Property property) - { - return (Sequence)get(property); - } - - /** - * - * - * @generated NOT - */ - public short getShort(Property property) - { - return DataObjectUtil.getShort(get(property)); - } - - /** - * - * - * @generated NOT - */ - public String getString(Property property) - { - return DataObjectUtil.getString(get(property)); - } - - /** - * - * - * @generated NOT - */ - public void setBigDecimal(Property property, BigDecimal value) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - - /** - * - * - * @generated NOT - */ - public void setBigInteger(Property property, BigInteger value) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - - /** - * - * - * @generated NOT - */ - public void setBoolean(Property property, boolean value) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - - /** - * - * - * @generated NOT - */ - public void setByte(Property property, byte value) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - - /** - * - * - * @generated NOT - */ - public void setBytes(Property property, byte[] value) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - - /** - * - * - * @generated NOT - */ - public void setChar(Property property, char value) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - - /** - * - * - * @generated NOT - */ - public void setDataObject(Property property, DataObject value) - { - set(property, value); - } - - /** - * - * - * @generated NOT - */ - public void setDate(Property property, Date value) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - - /** - * - * - * @generated NOT - */ - public void setDouble(Property property, double value) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - - /** - * - * - * @generated NOT - */ - public void setFloat(Property property, float value) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - - /** - * - * - * @generated NOT - */ - public void setInt(Property property, int value) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - - /** - * - * - * @generated NOT - */ - public void setList(Property property, List value) - { - set(property, value); - } - - /** - * - * - * @generated NOT - */ - public void setLong(Property property, long value) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - - /** - * - * - * @generated NOT - */ - public void setShort(Property property, short value) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - - /** - * - * - * @generated NOT - */ - public void setString(Property property, String value) - { - set(property, DataObjectUtil.getSetValue(property, value)); - } - - /** - * - * - * @generated NOT - */ - public DataObject createDataObject(String propertyName) - { - Property property = (Property)DataObjectUtil.getProperty(this, propertyName); - Type type = property.getType(); - return createDataObject(property, type); - } - - /** - * - * - * @generated NOT - */ - public DataObject createDataObject(int propertyIndex) - { - Property property = DataObjectUtil.getProperty(this, propertyIndex); - Type type = property.getType(); - return createDataObject(property, type); - } - - /** - * - * - * @generated NOT - */ - public DataObject createDataObject(Property property) - { - Type type = property.getType(); - return createDataObject(property, type); - } - - /** - * - * - * @generated NOT - */ - public DataObject createDataObject(String propertyName, String namespaceURI, String typeName) - { - Property property = DataObjectUtil.getProperty(this, propertyName); - Type type = DataObjectUtil.getType(this, namespaceURI, typeName); - return createDataObject(property, type); - } - - /** - * - * - * @generated NOT - */ - public DataObject createDataObject(int propertyIndex, String namespaceURI, String typeName) - { - Property property = DataObjectUtil.getProperty(this, propertyIndex); - Type type = DataObjectUtil.getType(this, namespaceURI, typeName); - return createDataObject(property, type); - } - - /** - * - * - * @generated NOT - */ - public DataObject createDataObject(Property property, Type type) - { - if (!property.isContainment()) - { - throw new IllegalArgumentException("The property '" + property.getName() + "' of '" + property.getContainingType().getName() - + "' isn't a containment"); - } - DataObject result = DataObjectUtil.create(type); - if (FeatureMapUtil.isMany(this, (EStructuralFeature)property)) - { - ((List)get(property)).add(result); - } - else - { - set(property, result); - } - return result; - } - - /** - * - * - * @generated NOT - */ - public void delete() - { - EcoreUtil.remove(this); - List contents = new ArrayList(eContents()); - for (int i = 0, size = contents.size(); i < size; ++i) - { - ((DataObject)contents.get(i)).delete(); - } - EClass eClass = eClass(); - for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i) - { - EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i); - if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived() && !((Property)eStructuralFeature).isReadOnly()) - { - eUnset(eStructuralFeature); - } - } - } - - /** - * - * - * @generated NOT - */ - public Sequence getSequence() - { - EAttribute mixedFeature = BasicExtendedMetaData.INSTANCE.getMixedFeature(eClass()); - return mixedFeature != null ? (Sequence)eGet(mixedFeature, true, false) : null; - } - - /** - * - * - * @generated NOT - */ - public List getInstanceProperties() - { - //TODO maybe optimize this to just return type.getProperties if type.isOpen (isOpen would need to be cached) - List result = new UniqueEList(eClass().getEAllStructuralFeatures()); - for (int i = 0, count = result.size(); i < count; ++i) - { - EStructuralFeature eStructuralFeature = (EStructuralFeature)result.get(i); - if (!eStructuralFeature.isDerived() && FeatureMapUtil.isFeatureMap(eStructuralFeature)) - { - List features = (List)eGet(eStructuralFeature); - for (int j = 0, size = features.size(); j < size; ++j) - { - FeatureMap.Entry entry = (FeatureMap.Entry)features.get(j); - EStructuralFeature entryFeature = entry.getEStructuralFeature(); - result.add(entryFeature); - } - } - } - return result; - } - - /** - * - * - * @generated NOT - */ - public Property getProperty(String propertyName) - { - Property property = getType().getProperty(propertyName); - if (property == null) - { - property = (Property)DataObjectUtil.getOpenFeature(this, propertyName); - } - return property; - } - - /** - * - * - * @generated NOT - */ - public DataObject getRootObject() - { - return (DataObject)EcoreUtil.getRootContainer(this); - } - - /** - * - * - * @generated NOT - */ - public ChangeSummary getChangeSummary() - { - // TODO: implement this method - throw new UnsupportedOperationException(); - } - - /** - * - * - * @generated NOT - */ - public void detach() - { - EcoreUtil.remove(this); - } - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Following methods customize BasicEObjectImpl, optimized for SDO - //////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - public boolean eNotificationRequired() - { - return changeRecorder != null; - } - - public void eNotify(Notification notification) - { - changeRecorder.notifyChanged(notification); - } - - public void setChangeRecorder(SDOChangeRecorder changeRecorder) - { - if (this.changeRecorder != null) - { - this.changeRecorder.unsetTarget(this); - } - - if (changeRecorder != null) - { - changeRecorder.setTarget(this); - } - - this.changeRecorder = changeRecorder; - } - - public InternalEObject eInternalContainer() - { - return eContainer; - } - - public int eContainerFeatureID() - { - return eContainerFeatureID; - } - - protected void eBasicSetContainer(InternalEObject newContainer, int newContainerFeatureID) - { - eContainer = newContainer; - eContainerFeatureID = newContainerFeatureID; - } - - public EClass eClass() - { - return eStaticClass(); - } - - public EList eContents() - { - return new EContentsEList(this); - } - - public EList eCrossReferences() - { - return new ECrossReferenceEList(this); - } - - public Resource.Internal eDirectResource() - { - return location instanceof Resource.Internal ? (Resource.Internal)location : null; - } - - protected EClass eDynamicClass() - { - return null; - } - - protected boolean eHasSettings() - { - return false; - } - - public boolean eIsProxy() - { - return location instanceof URI; - } - - public URI eProxyURI() - { - return location instanceof URI ? (URI)location : null; - } - - public void eSetClass(EClass eClass) - { - throw new UnsupportedOperationException(); - } - - protected void eSetDirectResource(Resource.Internal resource) - { - location = resource; - } - - public void eSetProxyURI(URI uri) - { - location = uri; - } - - protected DynamicValueHolder eSettings() - { - return null; - } - - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - return eDynamicGet(featureID, resolve, coreType); - } - - public void eSet(int featureID, Object newValue) - { - eDynamicSet(featureID, newValue); - } - - public void eUnset(int featureID) - { - eDynamicUnset(featureID); - } - - public boolean eIsSet(int featureID) - { - return eDynamicIsSet(featureID); - } - - public Object eDynamicGet(int featureID, boolean resolve, boolean coreType) - { - return eOpenGet(DataObjectUtil.getOpenFeature(this, featureID), resolve); - } - - public void eDynamicSet(int featureID, Object newValue) - { - eOpenSet(DataObjectUtil.getOpenFeature(this, featureID), newValue); - } - - public void eDynamicUnset(int featureID) - { - eOpenUnset(DataObjectUtil.getOpenFeature(this, featureID)); - } - - public boolean eDynamicIsSet(int featureID) - { - return eOpenIsSet(DataObjectUtil.getOpenFeature(this, featureID)); - } - -} //EDataObjectImpl - diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataTypeImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataTypeImpl.java deleted file mode 100644 index cbe5f36cab..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataTypeImpl.java +++ /dev/null @@ -1,177 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.impl; - -import java.util.Collections; -import java.util.List; - -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.impl.EDataTypeImpl; -import org.eclipse.emf.ecore.util.ExtendedMetaData; - -import commonj.sdo.Property; -import commonj.sdo.Type; - -/** - * - * An implementation of the model object 'Data Type'. - * - *

- *

- * - * @generated - */ -public class DataTypeImpl extends EDataTypeImpl implements Type -{ - /** - * - * - * @generated - */ - protected DataTypeImpl() - { - super(); - } - - /** - * - * - * @generated NOT - */ - protected EClass eStaticClass() - { - return EcorePackage.eINSTANCE.getEDataType(); - } - - /** - * - * - * @generated NOT - */ - public String getURI() - { - return getEPackage().getNsURI(); - } - - /** - * - * - * @generated NOT - */ - public boolean isDataType() - { - return true; - } - - /** - * - * - * @generated NOT - */ - public boolean isOpen() - { - return false; - } - - /** - * - * - * @generated NOT - */ - public boolean isSequenced() - { - return false; - } - - protected List aliasNames = null; - - /** - * - * - * @generated NOT - */ - public List getAliasNames() - { - if (aliasNames == null) - { - aliasNames = DataObjectUtil.getAliasNames(this); - } - return aliasNames; - } - - /** - * - * - * @generated NOT - */ - public List getDeclaredProperties() - { - return Collections.EMPTY_LIST; - } - - /** - * - * - * @generated NOT - */ - public List getProperties() - { - return Collections.EMPTY_LIST; - } - - /** - * - * - * @generated NOT - */ - public List getBaseTypes() - { - EDataType dataType = ExtendedMetaData.INSTANCE.getBaseType(this); - if (dataType == null) - { - return Collections.EMPTY_LIST; - } - else - { - return Collections.singletonList(dataType); - } - } - - /** - * - * - * @generated NOT - */ - public Property getProperty(String propertyName) - { - return null; - } - - /** - * - * - * @generated NOT - */ - public boolean isAbstract() - { - return false; - } - -} //DataTypeImpl diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicDataObjectImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicDataObjectImpl.java deleted file mode 100644 index dd9cdfa779..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicDataObjectImpl.java +++ /dev/null @@ -1,196 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.impl; - -import org.apache.tuscany.sdo.SDOPackage; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.impl.EFactoryImpl; - -import commonj.sdo.DataObject; - -/** - * - * An implementation of the model object 'Dynamic Data Object'. - * @extends EStructuralFeature.Internal.DynamicValueHolder - * - *

- *

- * - * @generated - */ -public class DynamicDataObjectImpl extends DataObjectImpl implements DataObject, EStructuralFeature.Internal.DynamicValueHolder -{ - protected EClass eClass; - protected Object [] eSettings; - - protected static final Object [] ENO_SETTINGS = new Object [0]; - - /** - * - * - * @generated - */ - protected DynamicDataObjectImpl() - { - super(); - } - - /** - * Creates a dynamic DataObject. - */ - public DynamicDataObjectImpl(EClass eClass) - { - super(); - eSetClass(eClass); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return SDOPackage.eINSTANCE.getDynamicDataObject(); - } - - protected int eStaticFeatureCount() - { - return 0; - } - - public int eDerivedStructuralFeatureID(EStructuralFeature eStructuralFeature) - { - return eClass().getFeatureID(eStructuralFeature); - } - - protected boolean eHasSettings() - { - return eSettings != null; - } - - protected EStructuralFeature.Internal.DynamicValueHolder eSettings() - { - if (eSettings == null) - { - int size = eClass().getFeatureCount() - eStaticFeatureCount(); - eSettings = size == 0 ? ENO_SETTINGS : new Object [size]; - } - - return this; - } - - protected EClass eDynamicClass() - { - return eClass; - } - - public EClass eClass() - { - return eClass; - } - - public void eSetClass(EClass eClass) - { - this.eClass = eClass; - } - - public Object dynamicGet(int dynamicFeatureID) - { - return eSettings[dynamicFeatureID]; - } - - public void dynamicSet(int dynamicFeatureID, Object value) - { - eSettings[dynamicFeatureID] = value; - } - - public void dynamicUnset(int dynamicFeatureID) - { - eSettings[dynamicFeatureID] = null; - } - - public Object eDynamicGet(int featureID, boolean resolve, boolean coreType) - { - if (featureID < eClass().getFeatureCount()) - { - EStructuralFeature eFeature = eClass().getEStructuralFeature(featureID); - return eSettingDelegate(eFeature).dynamicGet(this, eSettings(), featureID, resolve, coreType); - } - else - { - return super.eDynamicGet(featureID, resolve, coreType); - } - } - - public void eDynamicSet(int featureID, Object newValue) - { - if (featureID < eClass().getFeatureCount()) - { - EStructuralFeature eFeature = eClass().getEStructuralFeature(featureID); - eDynamicSet(featureID, eFeature, newValue); - } - else - { - super.eDynamicSet(featureID, newValue); - } - } - - public void eDynamicUnset(int featureID) - { - if (featureID < eClass().getFeatureCount()) - { - EStructuralFeature eFeature = eClass().getEStructuralFeature(featureID); - eDynamicUnset(featureID, eFeature); - } - else - { - super.eDynamicUnset(featureID); - } - } - - public boolean eDynamicIsSet(int featureID) - { - if (featureID < eClass().getFeatureCount()) - { - EStructuralFeature eFeature = eClass().getEStructuralFeature(featureID); - return eSettingDelegate(eFeature).dynamicIsSet(this, eSettings(), featureID); - } - else - { - return super.eDynamicIsSet(featureID); - } - } - - /** - * An EFactoryImpl that creates DynamicEDataObjectImpl instances. - */ - public static class FactoryImpl extends EFactoryImpl - { - public FactoryImpl() - { - } - - public EObject basicCreate(EClass eClass) - { - return new DynamicDataObjectImpl(eClass); - } - } - -} //DynamicDataObjectImpl diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicStoreDataObjectImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicStoreDataObjectImpl.java deleted file mode 100644 index d3b709c070..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicStoreDataObjectImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.impl; - -import org.apache.tuscany.sdo.SDOPackage; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import commonj.sdo.DataObject; - -/** - * - * An implementation of the model object 'Dynamic Store Data Object'. - * - *

- *

- * - * @generated - */ -public class DynamicStoreDataObjectImpl extends StoreDataObjectImpl implements DataObject -{ - protected EClass eClass; - - /** - * - * - * @generated - */ - protected DynamicStoreDataObjectImpl() - { - super(); - } - - public DynamicStoreDataObjectImpl(InternalEObject.EStore eStore) - { - super(eStore); - } - - public DynamicStoreDataObjectImpl(EClass eClass) - { - super(eClass); - } - - public DynamicStoreDataObjectImpl(EClass eClass, InternalEObject.EStore eStore) - { - super(eClass, eStore); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return SDOPackage.eINSTANCE.getDynamicStoreDataObject(); - } - - protected EClass eDynamicClass() - { - return eClass; - } - - public EClass eClass() - { - return eClass; - } - - public void eSetClass(EClass eClass) - { - this.eClass = eClass; - } - -} //DynamicStoreDataObjectImpl diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/EnumImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/EnumImpl.java deleted file mode 100644 index 5f7256da9a..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/EnumImpl.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.impl; - -import java.util.Collections; -import java.util.List; - -//import org.apache.tuscany.sdo.SDOPackage; - -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.impl.EEnumImpl; - -import commonj.sdo.Property; -import commonj.sdo.Type; - -/** - * - * An implementation of the model object 'Enum'. - * - *

- *

- * - * @generated - */ -public class EnumImpl extends EEnumImpl implements Type -{ - /** - * - * - * @generated - */ - protected EnumImpl() - { - super(); - } - - /** - * - * - * @generated NOT - */ - protected EClass eStaticClass() - { - return EcorePackage.eINSTANCE.getEEnum(); - } - - /** - * - * - * @generated NOT - */ - public String getURI() - { - return getEPackage().getNsURI(); - } - - /** - * - * - * @generated NOT - */ - public boolean isDataType() - { - return true; - } - - /** - * - * - * @generated NOT - */ - public boolean isOpen() - { - return false; - } - - /** - * - * - * @generated NOT - */ - public boolean isSequenced() - { - return false; - } - - protected List aliasNames = null; - - /** - * - * - * @generated NOT - */ - public List getAliasNames() - { - if (aliasNames == null) - { - aliasNames = DataObjectUtil.getAliasNames(this); - } - return aliasNames; - } - - /** - * - * - * @generated NOT - */ - public List getDeclaredProperties() - { - return Collections.EMPTY_LIST; - } - - /** - * - * - * @generated NOT - */ - public List getProperties() - { - return Collections.EMPTY_LIST; - } - - /** - * - * - * @generated NOT - */ - public List getBaseTypes() - { - return Collections.EMPTY_LIST; - } - - /** - * - * - * @generated NOT - */ - public Property getProperty(String propertyName) - { - return null; - } - - /** - * - * - * @generated NOT - */ - public boolean isAbstract() - { - return false; - } - -} //EnumTypeImpl diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ReferenceImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ReferenceImpl.java deleted file mode 100644 index 8dbdec3d41..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ReferenceImpl.java +++ /dev/null @@ -1,129 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.impl; - -import java.util.List; - -//import org.apache.tuscany.sdo.SDOPackage; - -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.impl.EReferenceImpl; - -import commonj.sdo.Property; -import commonj.sdo.Type; - -/** - * - * An implementation of the model object 'Reference'. - * - *

- *

- * - * @generated - */ -public class ReferenceImpl extends EReferenceImpl implements Property -{ - /** - * - * - * @generated - */ - protected ReferenceImpl() - { - super(); - } - - /** - * - * - * @generated NOT - */ - protected EClass eStaticClass() - { - return EcorePackage.eINSTANCE.getEReference(); - } - - /** - * - * - * @generated NOT - */ - public Object getDefault() - { - return getDefaultValue(); - } - - /** - * - * - * @generated NOT - */ - public boolean isReadOnly() - { - //return "true".equals(EcoreUtil.getAnnotation(this, "commonj.sdo", "readOnly")); - return !isChangeable(); //TODO semantics don't exactly match? - } - - protected List aliasNames = null; - - /** - * - * - * @generated NOT - */ - public List getAliasNames() - { - if (aliasNames == null) - { - aliasNames = DataObjectUtil.getAliasNames(this); - } - return aliasNames; - } - - /** - * - * - * @generated NOT - */ - public Type getType() - { - return (Type)getEType(); - } - - /** - * - * - * @generated NOT - */ - public Type getContainingType() - { - return (Type)getEContainingClass(); - } - - /** - * - * - * @generated NOT - */ - public Property getOpposite() - { - return (Property)getEOpposite(); - } - -} //ReferenceImpl diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SDOFactoryImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SDOFactoryImpl.java deleted file mode 100644 index fa299cb95e..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SDOFactoryImpl.java +++ /dev/null @@ -1,325 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.impl; - - -import org.apache.tuscany.sdo.AnyTypeDataObject; -import org.apache.tuscany.sdo.SDOFactory; -import org.apache.tuscany.sdo.SDOPackage; -import org.apache.tuscany.sdo.SimpleAnyTypeDataObject; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.impl.EFactoryImpl; -import org.eclipse.emf.ecore.plugin.EcorePlugin; - -import org.eclipse.emf.ecore.impl.EcoreFactoryImpl; - -import commonj.sdo.ChangeSummary; -import commonj.sdo.DataGraph; -import commonj.sdo.DataObject; -import commonj.sdo.Property; -import commonj.sdo.Type; -/** - * - * An implementation of the model Factory. - * - * @generated - */ -public class SDOFactoryImpl extends EFactoryImpl implements SDOFactory -{ - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static SDOFactory init() - { - try - { - SDOFactory theSDOFactory = (SDOFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/emf/2003/SDO"); - if (theSDOFactory != null) - { - return theSDOFactory; - } - } - catch (Exception exception) - { - EcorePlugin.INSTANCE.log(exception); - } - return new SDOFactoryImpl(); - } - - public static class SDOEcoreFactory extends EcoreFactoryImpl - { - public EClass createEClass() { return new ClassImpl(); } - public EDataType createEDataType() { return new DataTypeImpl(); } - public EEnum createEEnum() { return new EnumImpl(); } - public EAttribute createEAttribute() { return new AttributeImpl(); } - public EReference createEReference() { return new ReferenceImpl(); } - -// public EFactory createEFactory() -// { -// EFactoryImpl eFactory = new EFactoryImpl() { OVERRIDE basicCreate(); } // TODO think about doing this -// return eFactory; -// } - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public SDOFactoryImpl() - { - super(); - } - - /** - * - * - * @generated - */ - public EObject create(EClass eClass) - { - switch (eClass.getClassifierID()) - { - case SDOPackage.CHANGE_SUMMARY: return (EObject)createChangeSummary(); - case SDOPackage.CHANGE_SUMMARY_SETTING: return (EObject)createChangeSummarySetting(); - case SDOPackage.DATA_GRAPH: return (EObject)createDataGraph(); - case SDOPackage.ANY_TYPE_DATA_OBJECT: return createAnyTypeDataObject(); - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT: return createSimpleAnyTypeDataObject(); - case SDOPackage.CLASS: return (EObject)createClass(); - case SDOPackage.DATA_TYPE: return (EObject)createDataType(); - case SDOPackage.ATTRIBUTE: return (EObject)createAttribute(); - case SDOPackage.REFERENCE: return (EObject)createReference(); - case SDOPackage.ENUM: return (EObject)createEnum(); - case SDOPackage.DYNAMIC_DATA_OBJECT: return (EObject)createDynamicDataObject(); - case SDOPackage.STORE_DATA_OBJECT: return (EObject)createStoreDataObject(); - case SDOPackage.DYNAMIC_STORE_DATA_OBJECT: return (EObject)createDynamicStoreDataObject(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - public Object createFromString(EDataType eDataType, String initialValue) - { - switch (eDataType.getClassifierID()) - { - default: - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - public String convertToString(EDataType eDataType, Object instanceValue) - { - switch (eDataType.getClassifierID()) - { - default: - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - public ChangeSummary createChangeSummary() - { - ChangeSummaryImpl changeSummary = new ChangeSummaryImpl(); - return changeSummary; - } - - /** - * - * - * @generated - */ - public ChangeSummary.Setting createChangeSummarySetting() - { - ChangeSummarySettingImpl changeSummarySetting = new ChangeSummarySettingImpl(); - return changeSummarySetting; - } - - /** - * - * - * @generated - */ - public DataGraph createDataGraph() - { - DataGraphImpl dataGraph = new DataGraphImpl(); - return dataGraph; - } - - /** - * - * - * @generated - */ - public AnyTypeDataObject createAnyTypeDataObject() - { - AnyTypeDataObjectImpl anyTypeDataObject = new AnyTypeDataObjectImpl(); - return anyTypeDataObject; - } - - /** - * - * - * @generated - */ - public SimpleAnyTypeDataObject createSimpleAnyTypeDataObject() - { - SimpleAnyTypeDataObjectImpl simpleAnyTypeDataObject = new SimpleAnyTypeDataObjectImpl(); - return simpleAnyTypeDataObject; - } - - /** - * - * - * @generated - */ - public Type createClass() - { - ClassImpl class_ = new ClassImpl(); - return class_; - } - - /** - * - * - * @generated - */ - public Type createDataType() - { - DataTypeImpl dataType = new DataTypeImpl(); - return dataType; - } - - /** - * - * - * @generated - */ - public Property createAttribute() - { - AttributeImpl attribute = new AttributeImpl(); - return attribute; - } - - /** - * - * - * @generated - */ - public Property createReference() - { - ReferenceImpl reference = new ReferenceImpl(); - return reference; - } - - /** - * - * - * @generated - */ - public Type createEnum() - { - EnumImpl enum_ = new EnumImpl(); - return enum_; - } - - /** - * - * - * @generated - */ - public DataObject createDynamicDataObject() - { - DynamicDataObjectImpl dynamicDataObject = new DynamicDataObjectImpl(); - return dynamicDataObject; - } - - /** - * - * - * @generated - */ - public DataObject createStoreDataObject() - { - StoreDataObjectImpl storeDataObject = new StoreDataObjectImpl(); - return storeDataObject; - } - - /** - * - * - * @generated - */ - public DataObject createDynamicStoreDataObject() - { - DynamicStoreDataObjectImpl dynamicStoreDataObject = new DynamicStoreDataObjectImpl(); - return dynamicStoreDataObject; - } - - /** - * - * - * @generated - */ - public SDOPackage getSDOPackage() - { - return (SDOPackage)getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - public static SDOPackage getPackage() - { - return SDOPackage.eINSTANCE; - } - - public ChangeSummary.Setting createChangeSummarySetting(EStructuralFeature eStructuralFeature, Object value, boolean isSet) - { - ChangeSummarySettingImpl eChangeSummarySetting = new ChangeSummarySettingImpl(eStructuralFeature, value, isSet); - return eChangeSummarySetting; - } - -} //SDOFactoryImpl diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SDOPackageImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SDOPackageImpl.java deleted file mode 100644 index 15011fc37f..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SDOPackageImpl.java +++ /dev/null @@ -1,2133 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.impl; - -import java.io.ObjectStreamException; -import java.util.List; - -import org.apache.tuscany.sdo.AnyTypeDataObject; -import org.apache.tuscany.sdo.SDOFactory; -import org.apache.tuscany.sdo.SDOPackage; -import org.apache.tuscany.sdo.SimpleAnyTypeDataObject; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EOperation; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.change.ChangePackage; -import org.eclipse.emf.ecore.change.impl.ChangePackageImpl; -import org.eclipse.emf.ecore.impl.EPackageImpl; -import org.eclipse.emf.ecore.impl.EcorePackageImpl; -import org.eclipse.emf.ecore.xml.type.XMLTypePackage; -import org.eclipse.emf.ecore.xml.type.impl.XMLTypePackageImpl; - -import commonj.sdo.ChangeSummary; -import commonj.sdo.DataGraph; -import commonj.sdo.DataObject; -import commonj.sdo.Property; -import commonj.sdo.Sequence; -import commonj.sdo.Type; - -/** - * - * An implementation of the model Package. - * - * @generated - */ -public class SDOPackageImpl extends EPackageImpl implements SDOPackage -{ - /** - * - * - * @generated - */ - private EClass changeSummaryEClass = null; - - /** - * - * - * @generated - */ - private EClass changeSummarySettingEClass = null; - - /** - * - * - * @generated - */ - private EClass dataGraphEClass = null; - - /** - * - * - * @generated - */ - private EClass dataObjectEClass = null; - - /** - * - * - * @generated - */ - private EClass propertyEClass = null; - - /** - * - * - * @generated - */ - private EClass sequenceEClass = null; - - /** - * - * - * @generated - */ - private EClass typeEClass = null; - - /** - * - * - * @generated - */ - private EClass anyTypeDataObjectEClass = null; - - /** - * - * - * @generated - */ - private EClass simpleAnyTypeDataObjectEClass = null; - - /** - * - * - * @generated - */ - private EClass classEClass = null; - - /** - * - * - * @generated - */ - private EClass dataTypeEClass = null; - - /** - * - * - * @generated - */ - private EClass attributeEClass = null; - - /** - * - * - * @generated - */ - private EClass referenceEClass = null; - - /** - * - * - * @generated - */ - private EClass enumEClass = null; - - /** - * - * - * @generated - */ - private EClass dynamicDataObjectEClass = null; - - /** - * - * - * @generated - */ - private EClass storeDataObjectEClass = null; - - /** - * - * - * @generated - */ - private EClass dynamicStoreDataObjectEClass = null; - - /** - * - * - * @generated - */ - private EDataType eJavaListEDataType = null; - - /** - * - * - * @generated - */ - private EDataType eObjectStreamExceptionEDataType = null; - - /** - * Creates an instance of the model Package, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - *

Note: the correct way to create the package is via the static - * factory method {@link #init init()}, which also performs - * initialization of the package, or returns the registered package, - * if one already exists. - * - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.apache.tuscany.sdo.SDOPackage#eNS_URI - * @see #init() - * @generated - */ - private SDOPackageImpl() - { - super(eNS_URI, SDOFactory.eINSTANCE); - } - - /** - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this - * model, and for any others upon which it depends. Simple - * dependencies are satisfied by calling this method on all - * dependent packages before doing anything else. This method drives - * initialization for interdependent packages directly, in parallel - * with this package, itself. - *

Of this package and its interdependencies, all packages which - * have not yet been registered by their URI values are first created - * and registered. The packages are then initialized in two steps: - * meta-model objects for all of the packages are created before any - * are initialized, since one package's meta-model objects may refer to - * those of another. - *

Invocation of this method will not affect any packages that have - * already been initialized. - * - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static SDOPackage init() - { - if (isInited) return (SDOPackage)EPackage.Registry.INSTANCE.getEPackage(SDOPackage.eNS_URI); - - // Obtain or create and register package - SDOPackageImpl theSDOPackage = (SDOPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof SDOPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new SDOPackageImpl()); - - isInited = true; - - // Initialize simple dependencies - EcorePackageImpl.init(); - XMLTypePackageImpl.init(); - ChangePackageImpl.init(); - - // Create package meta-data objects - theSDOPackage.createPackageContents(); - - // Initialize created meta-data - theSDOPackage.initializePackageContents(); - - // Mark meta-data to indicate it can't be changed - theSDOPackage.freeze(); - - return theSDOPackage; - } - - /** - * - * - * @generated - */ - public EClass getChangeSummary() - { - return changeSummaryEClass; - } - - /** - * - * - * @generated - */ - public EReference getChangeSummary_EDataGraph() - { - return (EReference)changeSummaryEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EClass getChangeSummarySetting() - { - return changeSummarySettingEClass; - } - - /** - * - * - * @generated - */ - public EClass getDataGraph() - { - return dataGraphEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getDataGraph_ResourceSet() - { - return (EAttribute)dataGraphEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getDataGraph_RootResource() - { - return (EAttribute)dataGraphEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EReference getDataGraph_EChangeSummary() - { - return (EReference)dataGraphEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - public EReference getDataGraph_ERootObject() - { - return (EReference)dataGraphEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - public EClass getDataObject() - { - return dataObjectEClass; - } - - /** - * - * - * @generated - */ - public EClass getProperty() - { - return propertyEClass; - } - - /** - * - * - * @generated - */ - public EClass getSequence() - { - return sequenceEClass; - } - - /** - * - * - * @generated - */ - public EClass getType() - { - return typeEClass; - } - - /** - * - * - * @generated - */ - public EClass getAnyTypeDataObject() - { - return anyTypeDataObjectEClass; - } - - /** - * - * - * @generated - */ - public EClass getSimpleAnyTypeDataObject() - { - return simpleAnyTypeDataObjectEClass; - } - - /** - * - * - * @generated - */ - public EClass getClass_() - { - return classEClass; - } - - /** - * - * - * @generated - */ - public EClass getDataType() - { - return dataTypeEClass; - } - - /** - * - * - * @generated - */ - public EClass getAttribute() - { - return attributeEClass; - } - - /** - * - * - * @generated - */ - public EClass getReference() - { - return referenceEClass; - } - - /** - * - * - * @generated - */ - public EClass getEnum() - { - return enumEClass; - } - - /** - * - * - * @generated - */ - public EClass getDynamicDataObject() - { - return dynamicDataObjectEClass; - } - - /** - * - * - * @generated - */ - public EClass getStoreDataObject() - { - return storeDataObjectEClass; - } - - /** - * - * - * @generated - */ - public EClass getDynamicStoreDataObject() - { - return dynamicStoreDataObjectEClass; - } - - /** - * - * - * @generated - */ - public EDataType getEJavaList() - { - return eJavaListEDataType; - } - - /** - * - * - * @generated - */ - public EDataType getEObjectStreamException() - { - return eObjectStreamExceptionEDataType; - } - - /** - * - * - * @generated - */ - public SDOFactory getSDOFactory() - { - return (SDOFactory)getEFactoryInstance(); - } - - /** - * - * - * @generated - */ - private boolean isCreated = false; - - /** - * Creates the meta-model objects for the package. This method is - * guarded to have no affect on any invocation but its first. - * - * - * @generated - */ - public void createPackageContents() - { - if (isCreated) return; - isCreated = true; - - // Create classes and their features - changeSummaryEClass = createEClass(CHANGE_SUMMARY); - createEReference(changeSummaryEClass, CHANGE_SUMMARY__EDATA_GRAPH); - - changeSummarySettingEClass = createEClass(CHANGE_SUMMARY_SETTING); - - dataGraphEClass = createEClass(DATA_GRAPH); - createEAttribute(dataGraphEClass, DATA_GRAPH__RESOURCE_SET); - createEAttribute(dataGraphEClass, DATA_GRAPH__ROOT_RESOURCE); - createEReference(dataGraphEClass, DATA_GRAPH__ECHANGE_SUMMARY); - createEReference(dataGraphEClass, DATA_GRAPH__EROOT_OBJECT); - - dataObjectEClass = createEClass(DATA_OBJECT); - - propertyEClass = createEClass(PROPERTY); - - sequenceEClass = createEClass(SEQUENCE); - - typeEClass = createEClass(TYPE); - - anyTypeDataObjectEClass = createEClass(ANY_TYPE_DATA_OBJECT); - - simpleAnyTypeDataObjectEClass = createEClass(SIMPLE_ANY_TYPE_DATA_OBJECT); - - classEClass = createEClass(CLASS); - - dataTypeEClass = createEClass(DATA_TYPE); - - attributeEClass = createEClass(ATTRIBUTE); - - referenceEClass = createEClass(REFERENCE); - - enumEClass = createEClass(ENUM); - - dynamicDataObjectEClass = createEClass(DYNAMIC_DATA_OBJECT); - - storeDataObjectEClass = createEClass(STORE_DATA_OBJECT); - - dynamicStoreDataObjectEClass = createEClass(DYNAMIC_STORE_DATA_OBJECT); - - // Create data types - eJavaListEDataType = createEDataType(EJAVA_LIST); - eObjectStreamExceptionEDataType = createEDataType(EOBJECT_STREAM_EXCEPTION); - } - - /** - * - * - * @generated - */ - private boolean isInitialized = false; - - /** - * Complete the initialization of the package and its meta-model. This - * method is guarded to have no affect on any invocation but its first. - * - * - * @generated - */ - public void initializePackageContents() - { - if (isInitialized) return; - isInitialized = true; - - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - - // Obtain other dependent packages - ChangePackageImpl theChangePackage = (ChangePackageImpl)EPackage.Registry.INSTANCE.getEPackage(ChangePackage.eNS_URI); - EcorePackageImpl theEcorePackage = (EcorePackageImpl)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); - XMLTypePackageImpl theXMLTypePackage = (XMLTypePackageImpl)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); - - // Add supertypes to classes - changeSummaryEClass.getESuperTypes().add(theChangePackage.getChangeDescription()); - changeSummarySettingEClass.getESuperTypes().add(theChangePackage.getFeatureChange()); - dataGraphEClass.getESuperTypes().add(theEcorePackage.getEObject()); - anyTypeDataObjectEClass.getESuperTypes().add(this.getDataObject()); - anyTypeDataObjectEClass.getESuperTypes().add(theXMLTypePackage.getAnyType()); - simpleAnyTypeDataObjectEClass.getESuperTypes().add(this.getAnyTypeDataObject()); - simpleAnyTypeDataObjectEClass.getESuperTypes().add(theXMLTypePackage.getSimpleAnyType()); - classEClass.getESuperTypes().add(theEcorePackage.getEClass()); - classEClass.getESuperTypes().add(this.getType()); - dataTypeEClass.getESuperTypes().add(theEcorePackage.getEDataType()); - dataTypeEClass.getESuperTypes().add(this.getType()); - attributeEClass.getESuperTypes().add(theEcorePackage.getEAttribute()); - attributeEClass.getESuperTypes().add(this.getProperty()); - referenceEClass.getESuperTypes().add(theEcorePackage.getEReference()); - referenceEClass.getESuperTypes().add(this.getProperty()); - enumEClass.getESuperTypes().add(theEcorePackage.getEEnum()); - enumEClass.getESuperTypes().add(this.getType()); - dynamicDataObjectEClass.getESuperTypes().add(this.getDataObject()); - storeDataObjectEClass.getESuperTypes().add(this.getDataObject()); - dynamicStoreDataObjectEClass.getESuperTypes().add(this.getStoreDataObject()); - - // Initialize classes and features; add operations and parameters - initEClass(changeSummaryEClass, ChangeSummary.class, "ChangeSummary", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - initEReference(getChangeSummary_EDataGraph(), this.getDataGraph(), this.getDataGraph_EChangeSummary(), "eDataGraph", null, 1, 1, ChangeSummary.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - addEOperation(changeSummaryEClass, null, "beginLogging"); - - addEOperation(changeSummaryEClass, null, "endLogging"); - - EOperation op = addEOperation(changeSummaryEClass, ecorePackage.getEBoolean(), "isCreated"); - addEParameter(op, this.getDataObject(), "dataObject"); - - op = addEOperation(changeSummaryEClass, ecorePackage.getEBoolean(), "isDeleted"); - addEParameter(op, this.getDataObject(), "dataObject"); - - op = addEOperation(changeSummaryEClass, this.getEJavaList(), "getOldValues"); - addEParameter(op, this.getDataObject(), "dataObject"); - - op = addEOperation(changeSummaryEClass, ecorePackage.getEBoolean(), "isModified"); - addEParameter(op, this.getDataObject(), "dataObject"); - - op = addEOperation(changeSummaryEClass, this.getChangeSummarySetting(), "getOldValue"); - addEParameter(op, this.getDataObject(), "dataObject"); - addEParameter(op, this.getProperty(), "property"); - - op = addEOperation(changeSummaryEClass, this.getDataObject(), "getOldContainer"); - addEParameter(op, this.getDataObject(), "dataObject"); - - op = addEOperation(changeSummaryEClass, this.getProperty(), "getOldContainmentProperty"); - addEParameter(op, this.getDataObject(), "dataObject"); - - op = addEOperation(changeSummaryEClass, this.getSequence(), "getOldSequence"); - addEParameter(op, this.getDataObject(), "dataObject"); - - addEOperation(changeSummaryEClass, null, "undoChanges"); - - addEOperation(changeSummaryEClass, ecorePackage.getEBoolean(), "isLogging"); - - addEOperation(changeSummaryEClass, this.getDataGraph(), "getDataGraph"); - - addEOperation(changeSummaryEClass, this.getEJavaList(), "getChangedObjects"); - - addEOperation(changeSummaryEClass, this.getDataObject(), "getRootObject"); - - initEClass(changeSummarySettingEClass, ChangeSummary.Setting.class, "ChangeSummarySetting", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - addEOperation(changeSummarySettingEClass, ecorePackage.getEBoolean(), "isSet"); - - addEOperation(changeSummarySettingEClass, theEcorePackage.getEJavaObject(), "getValue"); - - addEOperation(changeSummarySettingEClass, this.getProperty(), "getProperty"); - - initEClass(dataGraphEClass, DataGraph.class, "DataGraph", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getDataGraph_ResourceSet(), theEcorePackage.getEResourceSet(), "resourceSet", null, 0, 1, DataGraph.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getDataGraph_RootResource(), theEcorePackage.getEResource(), "rootResource", null, 0, 1, DataGraph.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - initEReference(getDataGraph_EChangeSummary(), this.getChangeSummary(), this.getChangeSummary_EDataGraph(), "eChangeSummary", null, 1, 1, DataGraph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDataGraph_ERootObject(), theEcorePackage.getEObject(), null, "eRootObject", null, 1, 1, DataGraph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - op = addEOperation(dataGraphEClass, this.getDataObject(), "createRootObject"); - addEParameter(op, ecorePackage.getEString(), "namespaceURI"); - addEParameter(op, ecorePackage.getEString(), "typeName"); - - op = addEOperation(dataGraphEClass, this.getDataObject(), "createRootObject"); - addEParameter(op, this.getType(), "type"); - - op = addEOperation(dataGraphEClass, this.getType(), "getType"); - addEParameter(op, ecorePackage.getEString(), "namespaceURI"); - addEParameter(op, ecorePackage.getEString(), "typeName"); - - addEOperation(dataGraphEClass, this.getDataObject(), "getRootObject"); - - addEOperation(dataGraphEClass, this.getChangeSummary(), "getChangeSummary"); - - initEClass(dataObjectEClass, DataObject.class, "DataObject", IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - op = addEOperation(dataObjectEClass, theEcorePackage.getEJavaObject(), "get"); - addEParameter(op, ecorePackage.getEString(), "path"); - - op = addEOperation(dataObjectEClass, null, "set"); - addEParameter(op, ecorePackage.getEString(), "path"); - addEParameter(op, theEcorePackage.getEJavaObject(), "value"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEBoolean(), "isSet"); - addEParameter(op, ecorePackage.getEString(), "path"); - - op = addEOperation(dataObjectEClass, null, "unset"); - addEParameter(op, ecorePackage.getEString(), "path"); - - op = addEOperation(dataObjectEClass, theEcorePackage.getEJavaObject(), "get"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - - op = addEOperation(dataObjectEClass, null, "set"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - addEParameter(op, theEcorePackage.getEJavaObject(), "value"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEBoolean(), "isSet"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - - op = addEOperation(dataObjectEClass, null, "unset"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - - op = addEOperation(dataObjectEClass, theEcorePackage.getEJavaObject(), "get"); - addEParameter(op, this.getProperty(), "property"); - - op = addEOperation(dataObjectEClass, null, "set"); - addEParameter(op, this.getProperty(), "property"); - addEParameter(op, theEcorePackage.getEJavaObject(), "value"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEBoolean(), "isSet"); - addEParameter(op, this.getProperty(), "property"); - - op = addEOperation(dataObjectEClass, null, "unset"); - addEParameter(op, this.getProperty(), "property"); - - addEOperation(dataObjectEClass, this.getDataObject(), "getContainer"); - - addEOperation(dataObjectEClass, this.getProperty(), "getContainmentProperty"); - - addEOperation(dataObjectEClass, this.getDataGraph(), "getDataGraph"); - - addEOperation(dataObjectEClass, this.getType(), "getType"); - - op = addEOperation(dataObjectEClass, theEcorePackage.getEBigDecimal(), "getBigDecimal"); - addEParameter(op, ecorePackage.getEString(), "path"); - - op = addEOperation(dataObjectEClass, theEcorePackage.getEBigInteger(), "getBigInteger"); - addEParameter(op, ecorePackage.getEString(), "path"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEBoolean(), "getBoolean"); - addEParameter(op, ecorePackage.getEString(), "path"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEByte(), "getByte"); - addEParameter(op, ecorePackage.getEString(), "path"); - - op = addEOperation(dataObjectEClass, theEcorePackage.getEByteArray(), "getBytes"); - addEParameter(op, ecorePackage.getEString(), "path"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEChar(), "getChar"); - addEParameter(op, ecorePackage.getEString(), "path"); - - op = addEOperation(dataObjectEClass, this.getDataObject(), "getDataObject"); - addEParameter(op, ecorePackage.getEString(), "path"); - - op = addEOperation(dataObjectEClass, theEcorePackage.getEDate(), "getDate"); - addEParameter(op, ecorePackage.getEString(), "path"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEDouble(), "getDouble"); - addEParameter(op, ecorePackage.getEString(), "path"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEFloat(), "getFloat"); - addEParameter(op, ecorePackage.getEString(), "path"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEInt(), "getInt"); - addEParameter(op, ecorePackage.getEString(), "path"); - - op = addEOperation(dataObjectEClass, this.getEJavaList(), "getList"); - addEParameter(op, ecorePackage.getEString(), "path"); - - op = addEOperation(dataObjectEClass, ecorePackage.getELong(), "getLong"); - addEParameter(op, ecorePackage.getEString(), "path"); - - op = addEOperation(dataObjectEClass, this.getSequence(), "getSequence"); - addEParameter(op, ecorePackage.getEString(), "path"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEShort(), "getShort"); - addEParameter(op, ecorePackage.getEString(), "path"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEString(), "getString"); - addEParameter(op, ecorePackage.getEString(), "path"); - - op = addEOperation(dataObjectEClass, null, "setBigDecimal"); - addEParameter(op, ecorePackage.getEString(), "path"); - addEParameter(op, theEcorePackage.getEBigDecimal(), "value"); - - op = addEOperation(dataObjectEClass, null, "setBigInteger"); - addEParameter(op, ecorePackage.getEString(), "path"); - addEParameter(op, theEcorePackage.getEBigInteger(), "value"); - - op = addEOperation(dataObjectEClass, null, "setBoolean"); - addEParameter(op, ecorePackage.getEString(), "path"); - addEParameter(op, ecorePackage.getEBoolean(), "value"); - - op = addEOperation(dataObjectEClass, null, "setByte"); - addEParameter(op, ecorePackage.getEString(), "path"); - addEParameter(op, ecorePackage.getEByte(), "value"); - - op = addEOperation(dataObjectEClass, null, "setBytes"); - addEParameter(op, ecorePackage.getEString(), "path"); - addEParameter(op, theEcorePackage.getEByteArray(), "value"); - - op = addEOperation(dataObjectEClass, null, "setChar"); - addEParameter(op, ecorePackage.getEString(), "path"); - addEParameter(op, ecorePackage.getEChar(), "value"); - - op = addEOperation(dataObjectEClass, null, "setDataObject"); - addEParameter(op, ecorePackage.getEString(), "path"); - addEParameter(op, this.getDataObject(), "value"); - - op = addEOperation(dataObjectEClass, null, "setDate"); - addEParameter(op, ecorePackage.getEString(), "path"); - addEParameter(op, theEcorePackage.getEDate(), "value"); - - op = addEOperation(dataObjectEClass, null, "setDouble"); - addEParameter(op, ecorePackage.getEString(), "path"); - addEParameter(op, ecorePackage.getEDouble(), "value"); - - op = addEOperation(dataObjectEClass, null, "setFloat"); - addEParameter(op, ecorePackage.getEString(), "path"); - addEParameter(op, ecorePackage.getEFloat(), "value"); - - op = addEOperation(dataObjectEClass, null, "setInt"); - addEParameter(op, ecorePackage.getEString(), "path"); - addEParameter(op, ecorePackage.getEInt(), "value"); - - op = addEOperation(dataObjectEClass, null, "setList"); - addEParameter(op, ecorePackage.getEString(), "path"); - addEParameter(op, this.getEJavaList(), "value"); - - op = addEOperation(dataObjectEClass, null, "setLong"); - addEParameter(op, ecorePackage.getEString(), "path"); - addEParameter(op, ecorePackage.getELong(), "value"); - - op = addEOperation(dataObjectEClass, null, "setShort"); - addEParameter(op, ecorePackage.getEString(), "path"); - addEParameter(op, ecorePackage.getEShort(), "value"); - - op = addEOperation(dataObjectEClass, null, "setString"); - addEParameter(op, ecorePackage.getEString(), "path"); - addEParameter(op, ecorePackage.getEString(), "value"); - - op = addEOperation(dataObjectEClass, theEcorePackage.getEBigDecimal(), "getBigDecimal"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - - op = addEOperation(dataObjectEClass, theEcorePackage.getEBigInteger(), "getBigInteger"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEBoolean(), "getBoolean"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEByte(), "getByte"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - - op = addEOperation(dataObjectEClass, theEcorePackage.getEByteArray(), "getBytes"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEChar(), "getChar"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - - op = addEOperation(dataObjectEClass, this.getDataObject(), "getDataObject"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - - op = addEOperation(dataObjectEClass, theEcorePackage.getEDate(), "getDate"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEDouble(), "getDouble"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEFloat(), "getFloat"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEInt(), "getInt"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - - op = addEOperation(dataObjectEClass, this.getEJavaList(), "getList"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - - op = addEOperation(dataObjectEClass, ecorePackage.getELong(), "getLong"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - - op = addEOperation(dataObjectEClass, this.getSequence(), "getSequence"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEShort(), "getShort"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEString(), "getString"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - - op = addEOperation(dataObjectEClass, null, "setBigDecimal"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - addEParameter(op, theEcorePackage.getEBigDecimal(), "value"); - - op = addEOperation(dataObjectEClass, null, "setBigInteger"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - addEParameter(op, theEcorePackage.getEBigInteger(), "value"); - - op = addEOperation(dataObjectEClass, null, "setBoolean"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - addEParameter(op, ecorePackage.getEBoolean(), "value"); - - op = addEOperation(dataObjectEClass, null, "setByte"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - addEParameter(op, ecorePackage.getEByte(), "value"); - - op = addEOperation(dataObjectEClass, null, "setBytes"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - addEParameter(op, theEcorePackage.getEByteArray(), "value"); - - op = addEOperation(dataObjectEClass, null, "setChar"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - addEParameter(op, ecorePackage.getEChar(), "value"); - - op = addEOperation(dataObjectEClass, null, "setDataObject"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - addEParameter(op, this.getDataObject(), "value"); - - op = addEOperation(dataObjectEClass, null, "setDate"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - addEParameter(op, theEcorePackage.getEDate(), "value"); - - op = addEOperation(dataObjectEClass, null, "setDouble"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - addEParameter(op, ecorePackage.getEDouble(), "value"); - - op = addEOperation(dataObjectEClass, null, "setFloat"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - addEParameter(op, ecorePackage.getEFloat(), "value"); - - op = addEOperation(dataObjectEClass, null, "setInt"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - addEParameter(op, ecorePackage.getEInt(), "value"); - - op = addEOperation(dataObjectEClass, null, "setList"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - addEParameter(op, this.getEJavaList(), "value"); - - op = addEOperation(dataObjectEClass, null, "setLong"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - addEParameter(op, ecorePackage.getELong(), "value"); - - op = addEOperation(dataObjectEClass, null, "setShort"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - addEParameter(op, ecorePackage.getEShort(), "value"); - - op = addEOperation(dataObjectEClass, null, "setString"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - addEParameter(op, ecorePackage.getEString(), "value"); - - op = addEOperation(dataObjectEClass, theEcorePackage.getEBigDecimal(), "getBigDecimal"); - addEParameter(op, this.getProperty(), "property"); - - op = addEOperation(dataObjectEClass, theEcorePackage.getEBigInteger(), "getBigInteger"); - addEParameter(op, this.getProperty(), "property"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEBoolean(), "getBoolean"); - addEParameter(op, this.getProperty(), "property"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEByte(), "getByte"); - addEParameter(op, this.getProperty(), "property"); - - op = addEOperation(dataObjectEClass, theEcorePackage.getEByteArray(), "getBytes"); - addEParameter(op, this.getProperty(), "property"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEChar(), "getChar"); - addEParameter(op, this.getProperty(), "property"); - - op = addEOperation(dataObjectEClass, this.getDataObject(), "getDataObject"); - addEParameter(op, this.getProperty(), "property"); - - op = addEOperation(dataObjectEClass, theEcorePackage.getEDate(), "getDate"); - addEParameter(op, this.getProperty(), "property"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEDouble(), "getDouble"); - addEParameter(op, this.getProperty(), "property"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEFloat(), "getFloat"); - addEParameter(op, this.getProperty(), "property"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEInt(), "getInt"); - addEParameter(op, this.getProperty(), "property"); - - op = addEOperation(dataObjectEClass, this.getEJavaList(), "getList"); - addEParameter(op, this.getProperty(), "property"); - - op = addEOperation(dataObjectEClass, ecorePackage.getELong(), "getLong"); - addEParameter(op, this.getProperty(), "property"); - - op = addEOperation(dataObjectEClass, this.getSequence(), "getSequence"); - addEParameter(op, this.getProperty(), "property"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEShort(), "getShort"); - addEParameter(op, this.getProperty(), "property"); - - op = addEOperation(dataObjectEClass, ecorePackage.getEString(), "getString"); - addEParameter(op, this.getProperty(), "property"); - - op = addEOperation(dataObjectEClass, null, "setBigDecimal"); - addEParameter(op, this.getProperty(), "property"); - addEParameter(op, theEcorePackage.getEBigDecimal(), "value"); - - op = addEOperation(dataObjectEClass, null, "setBigInteger"); - addEParameter(op, this.getProperty(), "property"); - addEParameter(op, theEcorePackage.getEBigInteger(), "value"); - - op = addEOperation(dataObjectEClass, null, "setBoolean"); - addEParameter(op, this.getProperty(), "property"); - addEParameter(op, ecorePackage.getEBoolean(), "value"); - - op = addEOperation(dataObjectEClass, null, "setByte"); - addEParameter(op, this.getProperty(), "property"); - addEParameter(op, ecorePackage.getEByte(), "value"); - - op = addEOperation(dataObjectEClass, null, "setBytes"); - addEParameter(op, this.getProperty(), "property"); - addEParameter(op, theEcorePackage.getEByteArray(), "value"); - - op = addEOperation(dataObjectEClass, null, "setChar"); - addEParameter(op, this.getProperty(), "property"); - addEParameter(op, ecorePackage.getEChar(), "value"); - - op = addEOperation(dataObjectEClass, null, "setDataObject"); - addEParameter(op, this.getProperty(), "property"); - addEParameter(op, this.getDataObject(), "value"); - - op = addEOperation(dataObjectEClass, null, "setDate"); - addEParameter(op, this.getProperty(), "property"); - addEParameter(op, theEcorePackage.getEDate(), "value"); - - op = addEOperation(dataObjectEClass, null, "setDouble"); - addEParameter(op, this.getProperty(), "property"); - addEParameter(op, ecorePackage.getEDouble(), "value"); - - op = addEOperation(dataObjectEClass, null, "setFloat"); - addEParameter(op, this.getProperty(), "property"); - addEParameter(op, ecorePackage.getEFloat(), "value"); - - op = addEOperation(dataObjectEClass, null, "setInt"); - addEParameter(op, this.getProperty(), "property"); - addEParameter(op, ecorePackage.getEInt(), "value"); - - op = addEOperation(dataObjectEClass, null, "setList"); - addEParameter(op, this.getProperty(), "property"); - addEParameter(op, this.getEJavaList(), "value"); - - op = addEOperation(dataObjectEClass, null, "setLong"); - addEParameter(op, this.getProperty(), "property"); - addEParameter(op, ecorePackage.getELong(), "value"); - - op = addEOperation(dataObjectEClass, null, "setShort"); - addEParameter(op, this.getProperty(), "property"); - addEParameter(op, ecorePackage.getEShort(), "value"); - - op = addEOperation(dataObjectEClass, null, "setString"); - addEParameter(op, this.getProperty(), "property"); - addEParameter(op, ecorePackage.getEString(), "value"); - - op = addEOperation(dataObjectEClass, this.getDataObject(), "createDataObject"); - addEParameter(op, ecorePackage.getEString(), "propertyName"); - - op = addEOperation(dataObjectEClass, this.getDataObject(), "createDataObject"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - - op = addEOperation(dataObjectEClass, this.getDataObject(), "createDataObject"); - addEParameter(op, this.getProperty(), "property"); - - op = addEOperation(dataObjectEClass, this.getDataObject(), "createDataObject"); - addEParameter(op, ecorePackage.getEString(), "propertyName"); - addEParameter(op, ecorePackage.getEString(), "namespaceURI"); - addEParameter(op, ecorePackage.getEString(), "typeName"); - - op = addEOperation(dataObjectEClass, this.getDataObject(), "createDataObject"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - addEParameter(op, ecorePackage.getEString(), "namespaceURI"); - addEParameter(op, ecorePackage.getEString(), "typeName"); - - op = addEOperation(dataObjectEClass, this.getDataObject(), "createDataObject"); - addEParameter(op, this.getProperty(), "property"); - addEParameter(op, this.getType(), "type"); - - addEOperation(dataObjectEClass, null, "delete"); - - addEOperation(dataObjectEClass, this.getSequence(), "getSequence"); - - addEOperation(dataObjectEClass, this.getEJavaList(), "getInstanceProperties"); - - op = addEOperation(dataObjectEClass, this.getProperty(), "getProperty"); - addEParameter(op, ecorePackage.getEString(), "propertyName"); - - addEOperation(dataObjectEClass, this.getDataObject(), "getRootObject"); - - addEOperation(dataObjectEClass, this.getChangeSummary(), "getChangeSummary"); - - addEOperation(dataObjectEClass, null, "detach"); - - initEClass(propertyEClass, Property.class, "Property", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - addEOperation(propertyEClass, ecorePackage.getEString(), "getName"); - - addEOperation(propertyEClass, this.getType(), "getType"); - - addEOperation(propertyEClass, ecorePackage.getEBoolean(), "isMany"); - - addEOperation(propertyEClass, ecorePackage.getEBoolean(), "isContainment"); - - addEOperation(propertyEClass, ecorePackage.getEBoolean(), "isReadOnly"); - - addEOperation(propertyEClass, this.getType(), "getContainingType"); - - addEOperation(propertyEClass, this.getEJavaList(), "getAliasNames"); - - addEOperation(propertyEClass, this.getProperty(), "getOpposite"); - - addEOperation(propertyEClass, theEcorePackage.getEJavaObject(), "getDefault"); - - initEClass(sequenceEClass, Sequence.class, "Sequence", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - addEOperation(sequenceEClass, ecorePackage.getEInt(), "size"); - - op = addEOperation(sequenceEClass, this.getProperty(), "getProperty"); - addEParameter(op, ecorePackage.getEInt(), "index"); - - op = addEOperation(sequenceEClass, theEcorePackage.getEJavaObject(), "getValue"); - addEParameter(op, ecorePackage.getEInt(), "index"); - - op = addEOperation(sequenceEClass, theEcorePackage.getEJavaObject(), "setValue"); - addEParameter(op, ecorePackage.getEInt(), "index"); - addEParameter(op, theEcorePackage.getEJavaObject(), "value"); - - op = addEOperation(sequenceEClass, ecorePackage.getEBoolean(), "add"); - addEParameter(op, ecorePackage.getEString(), "propertyName"); - addEParameter(op, theEcorePackage.getEJavaObject(), "value"); - - op = addEOperation(sequenceEClass, ecorePackage.getEBoolean(), "add"); - addEParameter(op, ecorePackage.getEInt(), "propertIndex"); - addEParameter(op, theEcorePackage.getEJavaObject(), "value"); - - op = addEOperation(sequenceEClass, ecorePackage.getEBoolean(), "add"); - addEParameter(op, this.getProperty(), "property"); - addEParameter(op, theEcorePackage.getEJavaObject(), "value"); - - op = addEOperation(sequenceEClass, null, "add"); - addEParameter(op, ecorePackage.getEInt(), "index"); - addEParameter(op, ecorePackage.getEString(), "propertyName"); - addEParameter(op, theEcorePackage.getEJavaObject(), "value"); - - op = addEOperation(sequenceEClass, null, "add"); - addEParameter(op, ecorePackage.getEInt(), "index"); - addEParameter(op, ecorePackage.getEInt(), "propertyIndex"); - addEParameter(op, theEcorePackage.getEJavaObject(), "value"); - - op = addEOperation(sequenceEClass, null, "add"); - addEParameter(op, ecorePackage.getEInt(), "index"); - addEParameter(op, this.getProperty(), "property"); - addEParameter(op, theEcorePackage.getEJavaObject(), "value"); - - op = addEOperation(sequenceEClass, null, "add"); - addEParameter(op, ecorePackage.getEString(), "text"); - - op = addEOperation(sequenceEClass, null, "add"); - addEParameter(op, ecorePackage.getEInt(), "index"); - addEParameter(op, ecorePackage.getEString(), "text"); - - initEClass(typeEClass, Type.class, "Type", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - addEOperation(typeEClass, ecorePackage.getEString(), "getName"); - - addEOperation(typeEClass, ecorePackage.getEString(), "getURI"); - - addEOperation(typeEClass, theEcorePackage.getEJavaClass(), "getInstanceClass"); - - op = addEOperation(typeEClass, ecorePackage.getEBoolean(), "isInstance"); - addEParameter(op, theEcorePackage.getEJavaObject(), "object"); - - addEOperation(typeEClass, ecorePackage.getEBoolean(), "isDataType"); - - addEOperation(typeEClass, ecorePackage.getEBoolean(), "isSequenced"); - - addEOperation(typeEClass, ecorePackage.getEBoolean(), "isOpen"); - - addEOperation(typeEClass, ecorePackage.getEBoolean(), "isAbstract"); - - addEOperation(typeEClass, this.getEJavaList(), "getBaseTypes"); - - addEOperation(typeEClass, this.getEJavaList(), "getAliasNames"); - - addEOperation(typeEClass, this.getEJavaList(), "getProperties"); - - addEOperation(typeEClass, this.getEJavaList(), "getDeclaredProperties"); - - op = addEOperation(typeEClass, this.getProperty(), "getProperty"); - addEParameter(op, ecorePackage.getEString(), "propertyName"); - - initEClass(anyTypeDataObjectEClass, AnyTypeDataObject.class, "AnyTypeDataObject", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - initEClass(simpleAnyTypeDataObjectEClass, SimpleAnyTypeDataObject.class, "SimpleAnyTypeDataObject", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - initEClass(classEClass, Type.class, "Class", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(dataTypeEClass, Type.class, "DataType", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(attributeEClass, Property.class, "Attribute", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(referenceEClass, Property.class, "Reference", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(enumEClass, Type.class, "Enum", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(dynamicDataObjectEClass, DataObject.class, "DynamicDataObject", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(storeDataObjectEClass, DataObject.class, "StoreDataObject", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(dynamicStoreDataObjectEClass, DataObject.class, "DynamicStoreDataObject", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - // Initialize data types - initEDataType(eJavaListEDataType, List.class, "EJavaList", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); - initEDataType(eObjectStreamExceptionEDataType, ObjectStreamException.class, "EObjectStreamException", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); - - // Create resource - createResource(eNS_URI); - - // Create annotations - // http://www.eclipse.org/emf/2002/GenModel - createGenModelAnnotations(); - // http:///org/eclipse/emf/ecore/util/ExtendedMetaData - createExtendedMetaDataAnnotations(); - } - - /** - * Initializes the annotations for http://www.eclipse.org/emf/2002/GenModel. - * - * - * @generated - */ - protected void createGenModelAnnotations() - { - String source = "http://www.eclipse.org/emf/2002/GenModel"; - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(0), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.get(this, path);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(1), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.set(this, path, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(2), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.isSet(this, path);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(3), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.unset(this, path);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(4), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.get(this, propertyIndex);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(5), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.set(this, propertyIndex, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(6), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.isSet(this, propertyIndex);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(7), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.unset(this, propertyIndex);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(8), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.get(this, property);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(9), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.set(this, property, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(10), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.isSet(this, property);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(11), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.unset(this, property);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(12), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getContainer(this);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(13), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getContainmentProperty(this);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(14), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getDataGraph(this);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(15), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getType(this);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(16), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getBigDecimal(this, path);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(17), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getBigInteger(this, path);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(18), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getBoolean(this, path);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(19), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getByte(this, path);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(20), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getBytes(this, path);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(21), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getChar(this, path);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(22), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getDataObject(this, path);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(23), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getDate(this, path);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(24), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getDouble(this, path);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(25), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getFloat(this, path);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(26), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getInt(this, path);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(27), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getList(this, path);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(28), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getLong(this, path);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(29), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getSequence(this, path);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(30), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getShort(this, path);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(31), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getString(this, path);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(32), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setBigDecimal(this, path, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(33), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setBigInteger(this, path, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(34), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setBoolean(this, path, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(35), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setByte(this, path, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(36), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setBytes(this, path, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(37), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setChar(this, path, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(38), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setDataObject(this, path, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(39), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setDate(this, path, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(40), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setDouble(this, path, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(41), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setFloat(this, path, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(42), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setInt(this, path, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(43), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setList(this, path, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(44), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setLong(this, path, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(45), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setShort(this, path, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(46), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setString(this, path, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(47), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getBigDecimal(this, propertyIndex);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(48), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getBigInteger(this, propertyIndex);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(49), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getBoolean(this, propertyIndex);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(50), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getByte(this, propertyIndex);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(51), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getBytes(this, propertyIndex);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(52), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getChar(this, propertyIndex);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(53), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getDataObject(this, propertyIndex);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(54), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getDate(this, propertyIndex);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(55), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getDouble(this, propertyIndex);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(56), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getFloat(this, propertyIndex);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(57), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getInt(this, propertyIndex);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(58), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getList(this, propertyIndex);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(59), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getLong(this, propertyIndex);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(60), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getSequence(this, propertyIndex);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(61), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getShort(this, propertyIndex);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(62), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getString(this, propertyIndex);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(63), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setBigDecimal(this, propertyIndex, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(64), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setBigInteger(this, propertyIndex, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(65), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setBoolean(this, propertyIndex, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(66), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setByte(this, propertyIndex, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(67), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setBytes(this, propertyIndex, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(68), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setChar(this, propertyIndex, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(69), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setDataObject(this, propertyIndex, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(70), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setDate(this, propertyIndex, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(71), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setDouble(this, propertyIndex, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(72), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setFloat(this, propertyIndex, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(73), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setInt(this, propertyIndex, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(74), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setList(this, propertyIndex, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(75), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setLong(this, propertyIndex, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(76), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setShort(this, propertyIndex, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(77), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setString(this, propertyIndex, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(78), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getBigDecimal(this, property);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(79), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getBigInteger(this, property);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(80), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getBoolean(this, property);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(81), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getByte(this, property);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(82), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getBytes(this, property);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(83), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getChar(this, property);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(84), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getDataObject(this, property);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(85), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getDate(this, property);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(86), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getDouble(this, property);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(87), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getFloat(this, property);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(88), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getInt(this, property);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(89), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getList(this, property);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(90), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getLong(this, property);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(91), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getSequence(this, property);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(92), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getShort(this, property);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(93), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getString(this, property);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(94), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setBigDecimal(this, property, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(95), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setBigInteger(this, property, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(96), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setBoolean(this, property, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(97), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setByte(this, property, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(98), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setBytes(this, property, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(99), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setChar(this, property, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(100), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setDataObject(this, property, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(101), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setDate(this, property, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(102), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setDouble(this, property, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(103), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setFloat(this, property, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(104), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setInt(this, property, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(105), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setList(this, property, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(106), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setLong(this, property, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(107), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setShort(this, property, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(108), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.setString(this, property, value);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(109), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, propertyName);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(110), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, propertyIndex);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(111), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, property);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(112), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, propertyName, namespaceURI, typeName);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(113), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, propertyIndex, namespaceURI, typeName);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(114), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, property, type);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(115), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.delete(this);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(116), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getSequence(this);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(117), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getInstanceProperties(this);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(118), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getProperty(this, propertyName);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(119), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getRootObject(this);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(120), - source, - new String[] - { - "body", "return <%org.apache.sdo.util.SDOUtil%>.getChangeSummary(this);" - }); - addAnnotation - ((EOperation)dataObjectEClass.getEOperations().get(121), - source, - new String[] - { - "body", "<%org.apache.sdo.util.SDOUtil%>.detach(this);" - }); - } - - /** - * Initializes the annotations for http:///org/eclipse/emf/ecore/util/ExtendedMetaData. - * - * - * @generated - */ - protected void createExtendedMetaDataAnnotations() - { - String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; - addAnnotation - (anyTypeDataObjectEClass, - source, - new String[] - { - "kind", "mixed" - }); - addAnnotation - (simpleAnyTypeDataObjectEClass, - source, - new String[] - { - "kind", "simple" - }); - } - -} //SDOPackageImpl diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SimpleAnyTypeDataObjectImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SimpleAnyTypeDataObjectImpl.java deleted file mode 100644 index 33ca015ac9..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SimpleAnyTypeDataObjectImpl.java +++ /dev/null @@ -1,330 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.impl; - -import java.util.Iterator; - -import org.apache.tuscany.sdo.SDOPackage; -import org.apache.tuscany.sdo.SimpleAnyTypeDataObject; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.util.FeatureMap; -import org.eclipse.emf.ecore.xml.type.SimpleAnyType; -import org.eclipse.emf.ecore.xml.type.XMLTypePackage; - -/** - * - * An implementation of the model object 'EData Object Simple Any Type'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.apache.tuscany.sdo.impl.SimpleAnyTypeDataObjectImpl#getRawValue Raw Value}
  • - *
  • {@link org.apache.tuscany.sdo.impl.SimpleAnyTypeDataObjectImpl#getValue Value}
  • - *
  • {@link org.apache.tuscany.sdo.impl.SimpleAnyTypeDataObjectImpl#getInstanceType Instance Type}
  • - *
- *

- * - * @generated - */ -public class SimpleAnyTypeDataObjectImpl extends AnyTypeDataObjectImpl implements SimpleAnyTypeDataObject -{ - /** - * The default value of the '{@link #getRawValue() Raw Value}' attribute. - * - * - * @see #getRawValue() - * @generated - * @ordered - */ - protected static final String RAW_VALUE_EDEFAULT = null; - - /** - * The default value of the '{@link #getValue() Value}' attribute. - * - * - * @see #getValue() - * @generated - * @ordered - */ - protected static final Object VALUE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getInstanceType() Instance Type}' reference. - * - * - * @see #getInstanceType() - * @generated - * @ordered - */ - protected EDataType instanceType = null; - - /** - * - * - * @generated - */ - protected SimpleAnyTypeDataObjectImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return SDOPackage.eINSTANCE.getSimpleAnyTypeDataObject(); - } - - /** - * - * - * @generated NOT - */ - public String getRawValue() - { - StringBuffer value = new StringBuffer(); - for (Iterator i = getMixed().iterator(); i.hasNext(); ) - { - FeatureMap.Entry entry = (FeatureMap.Entry)i.next(); - if (entry.getEStructuralFeature() == XMLTypePackage.eINSTANCE.getXMLTypeDocumentRoot_Text()) - { - value.append(entry.getValue()); - } - } - return value.toString(); - } - - /** - * - * - * @generated NOT - */ - public void setRawValue(String newRawValue) - { - getMixed().clear(); - if (newRawValue != null) - { - getMixed().add(XMLTypePackage.eINSTANCE.getXMLTypeDocumentRoot_Text(), newRawValue); - } - } - - /** - * - * - * @generated NOT - */ - public Object getValue() - { - return EcoreUtil.createFromString(instanceType, getRawValue()); - } - - /** - * - * - * @generated NOT - */ - public void setValue(Object newValue) - { - setRawValue(EcoreUtil.convertToString(instanceType, newValue)); - } - - /** - * - * - * @generated - */ - public EDataType getInstanceType() - { - return instanceType; - } - - /** - * - * - * @generated - */ - public void setInstanceType(EDataType newInstanceType) - { - EDataType oldInstanceType = instanceType; - instanceType = newInstanceType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__INSTANCE_TYPE, oldInstanceType, instanceType)); - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__MIXED: - if (coreType) return getMixed(); - return ((FeatureMap.Internal)getMixed()).getWrapper(); - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__ANY: - if (coreType) return getAny(); - return ((FeatureMap.Internal)getAny()).getWrapper(); - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE: - if (coreType) return getAnyAttribute(); - return ((FeatureMap.Internal)getAnyAttribute()).getWrapper(); - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__RAW_VALUE: - return getRawValue(); - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__VALUE: - return getValue(); - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__INSTANCE_TYPE: - return getInstanceType(); - } - return eDynamicGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__MIXED: - ((FeatureMap.Internal)getMixed()).set(newValue); - return; - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__ANY: - ((FeatureMap.Internal)getAny()).set(newValue); - return; - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE: - ((FeatureMap.Internal)getAnyAttribute()).set(newValue); - return; - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__RAW_VALUE: - setRawValue((String)newValue); - return; - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__VALUE: - setValue((Object)newValue); - return; - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__INSTANCE_TYPE: - setInstanceType((EDataType)newValue); - return; - } - eDynamicSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__MIXED: - getMixed().clear(); - return; - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__ANY: - getAny().clear(); - return; - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE: - getAnyAttribute().clear(); - return; - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__RAW_VALUE: - setRawValue(RAW_VALUE_EDEFAULT); - return; - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__VALUE: - setValue(VALUE_EDEFAULT); - return; - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__INSTANCE_TYPE: - setInstanceType((EDataType)null); - return; - } - eDynamicUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__MIXED: - return mixed != null && !mixed.isEmpty(); - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__ANY: - return !getAny().isEmpty(); - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE: - return anyAttribute != null && !anyAttribute.isEmpty(); - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__RAW_VALUE: - return RAW_VALUE_EDEFAULT == null ? getRawValue() != null : !RAW_VALUE_EDEFAULT.equals(getRawValue()); - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__VALUE: - return VALUE_EDEFAULT == null ? getValue() != null : !VALUE_EDEFAULT.equals(getValue()); - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__INSTANCE_TYPE: - return instanceType != null; - } - return eDynamicIsSet(featureID); - } - - /** - * - * - * @generated - */ - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) - { - if (baseClass == SimpleAnyType.class) - { - switch (derivedFeatureID) - { - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__RAW_VALUE: return XMLTypePackage.SIMPLE_ANY_TYPE__RAW_VALUE; - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__VALUE: return XMLTypePackage.SIMPLE_ANY_TYPE__VALUE; - case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__INSTANCE_TYPE: return XMLTypePackage.SIMPLE_ANY_TYPE__INSTANCE_TYPE; - default: return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) - { - if (baseClass == SimpleAnyType.class) - { - switch (baseFeatureID) - { - case XMLTypePackage.SIMPLE_ANY_TYPE__RAW_VALUE: return SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__RAW_VALUE; - case XMLTypePackage.SIMPLE_ANY_TYPE__VALUE: return SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__VALUE; - case XMLTypePackage.SIMPLE_ANY_TYPE__INSTANCE_TYPE: return SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__INSTANCE_TYPE; - default: return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - -} //EDataObjectSimpleAnyTypeImpl diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/StoreDataObjectImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/StoreDataObjectImpl.java deleted file mode 100644 index 06bb3a6d05..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/StoreDataObjectImpl.java +++ /dev/null @@ -1,311 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.impl; - -import org.apache.tuscany.sdo.SDOPackage; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.EStoreEObjectImpl.EStoreEList; -import org.eclipse.emf.ecore.impl.EStoreEObjectImpl.EStoreFeatureMap; -import org.eclipse.emf.ecore.util.FeatureMap; -import org.eclipse.emf.ecore.util.FeatureMapUtil; - -import commonj.sdo.DataObject; - -/** - * - * An implementation of the model object 'Store Data Object'. - * @extends EStructuralFeature.Internal.DynamicValueHolder - * - *

- *

- * - * @generated - */ -public class StoreDataObjectImpl extends DataObjectImpl implements DataObject, EStructuralFeature.Internal.DynamicValueHolder -{ - //TODO consider factoring the eSettings code into a new base class that this and DynamicDataObjectImpl could extend - - protected static final Object [] ENO_SETTINGS = new Object [0]; - protected static final InternalEObject EUNINITIALIZED_CONTAINER = new DynamicDataObjectImpl(); - - protected Object [] eSettings; - protected InternalEObject.EStore eStore; - - /** - * Creates a store-based DataObject. - */ - public StoreDataObjectImpl() - { - super(); - eContainer = EUNINITIALIZED_CONTAINER; - } - - /** - * Creates a store-based DataObject. - */ - public StoreDataObjectImpl(InternalEObject.EStore eStore) - { - super(); - eSetStore(eStore); - eContainer = EUNINITIALIZED_CONTAINER; - } - - /** - * Creates a store-based DataObject. - */ - public StoreDataObjectImpl(EClass eClass) - { - super(); - eSetClass(eClass); - eContainer = EUNINITIALIZED_CONTAINER; - } - - /** - * Creates a store-based DataObject. - */ - public StoreDataObjectImpl(EClass eClass, InternalEObject.EStore eStore) - { - super(); - eSetClass(eClass); - eSetStore(eStore); - eContainer = EUNINITIALIZED_CONTAINER; - } - - protected boolean eIsCaching() - { - return true; - } - - public Object dynamicGet(int dynamicFeatureID) - { - Object result = eSettings[dynamicFeatureID]; - if (result == null) - { - EStructuralFeature eStructuralFeature = eDynamicFeature(dynamicFeatureID); - if (!eStructuralFeature.isTransient()) - { - if (FeatureMapUtil.isFeatureMap(eStructuralFeature)) - { - eSettings[dynamicFeatureID] = result = createFeatureMap(eStructuralFeature); - } - else if (eStructuralFeature.isMany()) - { - eSettings[dynamicFeatureID] = result = createList(eStructuralFeature); - } - else - { - result = eStore().get(this, eStructuralFeature, InternalEObject.EStore.NO_INDEX); - if (eIsCaching()) - { - eSettings[dynamicFeatureID] = result; - } - } - } - } - return result; - } - - public void dynamicSet(int dynamicFeatureID, Object value) - { - EStructuralFeature eStructuralFeature = eDynamicFeature(dynamicFeatureID); - if (eStructuralFeature.isTransient()) - { - eSettings[dynamicFeatureID] = value; - } - else - { - eStore().set(this, eStructuralFeature, InternalEObject.EStore.NO_INDEX, value == NIL ? null : value); - if (eIsCaching()) - { - eSettings[dynamicFeatureID] = value; - } - } - } - - public void dynamicUnset(int dynamicFeatureID) - { - eStore().unset(this, eDynamicFeature(dynamicFeatureID)); - eSettings[dynamicFeatureID] = null; - } - - public Object eDynamicGet(int featureID, boolean resolve, boolean coreType) - { - if (featureID < eClass().getFeatureCount()) - { - EStructuralFeature eFeature = eClass().getEStructuralFeature(featureID); - return eSettingDelegate(eFeature).dynamicGet(this, eSettings(), featureID, resolve, coreType); - } - else - { - return super.eDynamicGet(featureID, resolve, coreType); - } - } - - public void eDynamicSet(int featureID, Object newValue) - { - if (featureID < eClass().getFeatureCount()) - { - EStructuralFeature eFeature = eClass().getEStructuralFeature(featureID); - eDynamicSet(featureID, eFeature, newValue); - } - else - { - super.eDynamicSet(featureID, newValue); - } - } - - public void eDynamicUnset(int featureID) - { - if (featureID < eClass().getFeatureCount()) - { - EStructuralFeature eFeature = eClass().getEStructuralFeature(featureID); - eDynamicUnset(featureID, eFeature); - } - else - { - super.eDynamicUnset(featureID); - } - } - - public boolean eDynamicIsSet(int featureID) - { - if (featureID < eClass().getFeatureCount()) - { - EStructuralFeature eFeature = eClass().getEStructuralFeature(featureID); - return eFeature.isTransient() ? - eSettingDelegate(eFeature).dynamicIsSet(this, eSettings(), featureID) : - eStore().isSet(this, eFeature); - } - else - { - return super.eDynamicIsSet(featureID); - } - } - - /* - public boolean eDynamicIsSet(EStructuralFeature eStructuralFeature) - { - return - eStructuralFeature.isTransient() ? - super.eDynamicIsSet(eStructuralFeature) : - eStore().isSet(this, eStructuralFeature); - } - */ - - protected EList createList(EStructuralFeature eStructuralFeature) - { - return new EStoreEList(this, eStructuralFeature, eStore()); - } - - protected FeatureMap createFeatureMap(EStructuralFeature eStructuralFeature) - { - return new EStoreFeatureMap(this, eStructuralFeature, eStore()); - } - - public EObject eContainer() - { - if (eContainer == EUNINITIALIZED_CONTAINER) - { - eInitializeContainer(); - } - - return eContainer; - } - - public int eContainerFeatureID() - { - if (eContainer == EUNINITIALIZED_CONTAINER) - { - eInitializeContainer(); - } - - return eContainerFeatureID; - } - - protected void eInitializeContainer() - { - eContainer = eStore().getContainer(this); - if (eContainer != null) - { - EStructuralFeature eContainingFeature = eStore().getContainingFeature(this); - if (eContainingFeature instanceof EReference) - { - EReference eContainingReference = (EReference)eContainingFeature; - EReference eOpposite = eContainingReference.getEOpposite(); - if (eOpposite != null) - { - eContainerFeatureID = eClass().getFeatureID(eOpposite); - return; - } - } - - eContainerFeatureID = EOPPOSITE_FEATURE_BASE - eContainer.eClass().getFeatureID(eContainingFeature); - } - } - - public InternalEObject.EStore eStore() - { - return eStore; - } - - public void eSetStore(InternalEObject.EStore store) - { - this.eStore = store; - } - - protected int eStaticFeatureCount() - { - return 0; - } - - public int eDerivedStructuralFeatureID(EStructuralFeature eStructuralFeature) - { - return eClass().getFeatureID(eStructuralFeature); - } - - protected boolean eHasSettings() - { - return eSettings != null; - } - - protected EStructuralFeature.Internal.DynamicValueHolder eSettings() - { - if (eSettings == null) - { - int size = eClass().getFeatureCount() - eStaticFeatureCount(); - eSettings = size == 0 ? ENO_SETTINGS : new Object [size]; - } - - return this; - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return SDOPackage.eINSTANCE.getStoreDataObject(); - } - -} //StoreDataObjectImpl diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/BasicSequence.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/BasicSequence.java deleted file mode 100644 index 5a631dde77..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/BasicSequence.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.util; - -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.util.FeatureMap; -import org.eclipse.emf.ecore.util.FeatureMapUtil; -import org.eclipse.emf.ecore.xml.type.XMLTypePackage; - -import commonj.sdo.Property; -import commonj.sdo.Sequence; - -/** - * SDO Sequance implementation which delegates to a feature map. - */ -public class BasicSequence implements Sequence, FeatureMap.Internal.Wrapper -{ - protected FeatureMap.Internal featureMap; - - public BasicSequence(FeatureMap.Internal featureMap) - { - this.featureMap = featureMap; - featureMap.setWrapper(this); - } - - public FeatureMap featureMap() - { - return featureMap; - } - - public int size() - { - return featureMap.size(); - } - - public Property getProperty(int index) - { - EStructuralFeature feature = featureMap.getEStructuralFeature(index); - boolean isText = - feature == XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__TEXT || - feature == XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__CDATA || - feature == XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__COMMENT; - return isText ? null : (Property)feature; - } - - public Object getValue(int index) - { - return featureMap.getValue(index); - } - - public Object setValue(int index, Object value) - { - return featureMap.setValue(index, value); - } - - protected EStructuralFeature getEStructuralFeature(String propertyName) - { - return featureMap.getEObject().eClass().getEStructuralFeature(propertyName); - } - - protected EStructuralFeature getEStructuralFeature(int propertyIndex) - { - return featureMap.getEObject().eClass().getEStructuralFeature(propertyIndex); - } - - public boolean add(String propertyName, Object value) - { - return featureMap.add(getEStructuralFeature(propertyName), value); - } - - public boolean add(int propertyIndex, Object value) - { - return featureMap.add(getEStructuralFeature(propertyIndex), value); - } - - public boolean add(Property property, Object value) - { - return featureMap.add((EStructuralFeature)property, value); - } - - public void add(int index, String propertyName, Object value) - { - featureMap.add(index, getEStructuralFeature(propertyName), value); - } - - public void add(int index, int propertyIndex, Object value) - { - featureMap.add(index, getEStructuralFeature(propertyIndex), value); - } - - public void add(int index, Property property, Object value) - { - featureMap.add(index, (EStructuralFeature)property, value); - } - - public void add(String text) - { - FeatureMapUtil.addText(featureMap, text); - } - - public void add(int index, String text) - { - FeatureMapUtil.addText(featureMap, index, text); - } - - public void remove(int index) - { - featureMap.remove(index); - } - - public void move(int toIndex, int fromIndex) - { - featureMap.move(toIndex, fromIndex); - } - - public String toString() - { - return featureMap.toString(); - } -} diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataGraphResourceFactoryImpl.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataGraphResourceFactoryImpl.java deleted file mode 100644 index 3631a88203..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataGraphResourceFactoryImpl.java +++ /dev/null @@ -1,644 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.util; - - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.sdo.SDOFactory; -import org.apache.tuscany.sdo.SDOPackage; -import org.apache.tuscany.sdo.impl.ChangeSummaryImpl; -import org.apache.tuscany.sdo.impl.DataGraphImpl; -import org.apache.tuscany.sdo.impl.DynamicDataObjectImpl; -import org.eclipse.emf.common.util.EMap; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EFactory; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.util.ExtendedMetaData; -import org.eclipse.emf.ecore.xmi.EcoreBuilder; -import org.eclipse.emf.ecore.xmi.NameInfo; -import org.eclipse.emf.ecore.xmi.XMLHelper; -import org.eclipse.emf.ecore.xmi.XMLLoad; -import org.eclipse.emf.ecore.xmi.XMLResource; -import org.eclipse.emf.ecore.xmi.XMLSave; -import org.eclipse.emf.ecore.xmi.impl.SAXXMLHandler; -import org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl; -import org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl; -import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl; -import org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl; -import org.eclipse.emf.ecore.xmi.util.DefaultEcoreBuilder; -import org.w3c.dom.Element; -import org.xml.sax.helpers.DefaultHandler; - -import commonj.sdo.ChangeSummary; - - -public class DataGraphResourceFactoryImpl extends ResourceFactoryImpl -{ - /** - * Constructor for DataGraphResourceFactoryImpl. - */ - public DataGraphResourceFactoryImpl() - { - super(); - } - - public Resource createResource(URI uri) - { - XMLResourceImpl result = new DataGraphResourceImpl(uri); - - result.setEncoding("UTF-8"); - - result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE); - - result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); - result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); - - result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); - result.getDefaultSaveOptions().put(XMLResource.OPTION_LINE_WIDTH, new Integer(80)); - - result.getDefaultLoadOptions().put(XMLResource.OPTION_ANY_TYPE, SDOPackage.eINSTANCE.getAnyTypeDataObject()); - result.getDefaultSaveOptions().put(XMLResource.OPTION_ANY_TYPE, SDOPackage.eINSTANCE.getAnyTypeDataObject()); - - result.getDefaultLoadOptions().put(XMLResource.OPTION_ANY_SIMPLE_TYPE, SDOPackage.eINSTANCE.getSimpleAnyTypeDataObject()); - result.getDefaultSaveOptions().put(XMLResource.OPTION_ANY_SIMPLE_TYPE, SDOPackage.eINSTANCE.getSimpleAnyTypeDataObject()); - - return result; - } - - public static class DataGraphResourceImpl extends XMLResourceImpl - { - public DataGraphResourceImpl(URI uri) - { - super(uri); - } - - public static class HelperImpl extends XMLHelperImpl - { - protected DataGraphImpl eDataGraph; - - protected List resources; - protected List uris; - - public HelperImpl(XMLResource xmlResource) - { - super(xmlResource); - } - - public void setResource(XMLResource resource) - { - super.setResource(resource); - if (!resource.getContents().isEmpty()) - { - eDataGraph = (DataGraphImpl)resource.getContents().get(0); - - resources = new ArrayList(); - uris = new ArrayList(); - - resources.add(eDataGraph.getRootResource()); - uris.add("#" + resource.getURIFragment(eDataGraph) + "/@eRootObject"); - - if (eDataGraph.getEChangeSummary() != null) - { - // Ensure that resource exists. - // - resources.add(((EObject)eDataGraph.getChangeSummary()).eResource()); - uris.add("#" + resource.getURIFragment(eDataGraph) + "/@eChangeSummary"); - } - - if (eDataGraph.eResource() != null && eDataGraph.eResource().getResourceSet() != null) - { - int count = 0; - for (Iterator i = eDataGraph.eResource().getResourceSet().getResources().iterator(); i.hasNext();) - { - Resource ePackageResource = (Resource)i.next(); - List resourceContents = ePackageResource.getContents(); - if (resourceContents.size() == 1 && resourceContents.get(0) instanceof EPackage) - { - resources.add(ePackageResource); - uris.add("#" + resource.getURIFragment(eDataGraph) + "/@models." + count++); - } - } - } - } - } - - public String getID(EObject eObject) - { - return super.getID(eObject); - } - - public String getIDREF(EObject eObject) - { - return super.getIDREF(eObject); - } - - public String getHREF(EObject eObject) - { - return super.getHREF(eObject); - } - - protected URI getHREF(Resource otherResource, EObject obj) - { - int index = resources.indexOf(otherResource); - if (index == -1) - { - return super.getHREF(otherResource, obj); - } - else - { - return createHREF((String)uris.get(index), otherResource.getURIFragment(obj)); - } - } - - protected URI createHREF(String baseURI, String fragment) - { - if (fragment.startsWith("/")) - { - return URI.createURI(baseURI + fragment.substring(1)); - } - else - { - return URI.createURI("#" + fragment); - } - } - - public void populateNameInfo(NameInfo nameInfo, EClass c) - { - if (c == SDOPackage.eINSTANCE.getDataGraph()) - { - if (extendedMetaData != null) - { - extendedMetaData.demandPackage("commonj.sdo").setNsPrefix("sdo"); - } - nameInfo.setQualifiedName(getQName("commonj.sdo", "datagraph")); - nameInfo.setNamespaceURI("commonj.sdo"); - nameInfo.setLocalPart("datagraph"); - } - else if (c == SDOPackage.eINSTANCE.getChangeSummary()) - { - if (extendedMetaData != null) - { - extendedMetaData.demandPackage("commonj.sdo").setNsPrefix("sdo"); - } - nameInfo.setQualifiedName("changeSummary"); - nameInfo.setNamespaceURI(null); - nameInfo.setLocalPart("changeSummary"); - } - else - { - super.populateNameInfo(nameInfo, c); - } - } - - public String getQName(EClass c) - { - if (c == SDOPackage.eINSTANCE.getDataGraph()) - { - if (extendedMetaData != null) - { - extendedMetaData.demandPackage("commonj.sdo").setNsPrefix("sdo"); - } - return getQName("commonj.sdo", "datagraph"); - } - else if (c == SDOPackage.eINSTANCE.getChangeSummary()) - { - if (extendedMetaData != null) - { - extendedMetaData.demandPackage("commonj.sdo").setNsPrefix("sdo"); - } - return getQName((String)null, "changeSummary"); - } - else - { - return super.getQName(c); - } - } - } - - protected XMLHelper createXMLHelper() - { - return new HelperImpl(this); - } - - protected EObject getEObjectByID(String id) - { - List contents = getContents(); - if (contents.size() >= 1) - { - Object rootObject = contents.get(0); - if (rootObject instanceof DataGraphImpl) - { - DataGraphImpl eDataGraph = (DataGraphImpl)rootObject; - EObject result = eDataGraph.getRootResource().getEObject(id); - if (result != null) - { - return result; - } - else - { - ChangeSummary eChangeSummary = eDataGraph.getEChangeSummary(); - if (eChangeSummary != null) - { - result = ((EObject)eDataGraph.getChangeSummary()).eResource().getEObject(id); - if (result != null) - { - return result; - } - } - } - } - } - return super.getEObjectByID(id); - } - - public static class SaveImpl extends XMLSaveImpl - { - protected DataGraphImpl eDataGraph; - - public SaveImpl(XMLHelper xmlHelper) - { - super(xmlHelper); - } - - public void traverse(List contents) - { - if (contents.size() >= 1 && contents.get(0) instanceof DataGraphImpl) - { - eDataGraph = (DataGraphImpl)contents.get(0); - - Object datagraphMark = null; - if (!toDOM) - { - if (declareXML) - { - doc.add(""); - doc.addLine(); - } - String elementName = helper.getQName(eDataGraph.eClass()); - doc.startElement(elementName); - datagraphMark = doc.mark(); - } - else - { - helper.populateNameInfo(nameInfo, eDataGraph.eClass()); - currentNode = document.createElementNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName()); - document.appendChild(currentNode); - // not calling handler since there is no corresponding EObject - } - - if (eDataGraph.eResource() != null && eDataGraph.eResource().getResourceSet() != null) - { - List ePackages = new ArrayList(); - for (Iterator i = eDataGraph.eResource().getResourceSet().getResources().iterator(); i.hasNext();) - { - List resourceContents = ((Resource)i.next()).getContents(); - if (resourceContents.size() == 1 && resourceContents.get(0) instanceof EPackage) - { - ePackages.add(resourceContents.get(0)); - } - } - if (!ePackages.isEmpty()) - { - if (!toDOM) - { - doc.startElement("models"); - doc.addAttribute("xmlns", ""); - } - else - { - currentNode = currentNode.appendChild(document.createElementNS(null, "models")); - ((Element)currentNode).setAttributeNS(ExtendedMetaData.XMLNS_URI, ExtendedMetaData.XMLNS_PREFIX, ""); - // not calling handler since there is no corresponding EObject - } - for (Iterator i = ePackages.iterator(); i.hasNext();) - { - writeTopObject((EPackage)i.next()); - } - if (!toDOM) - { - doc.endElement(); - } - else - { - currentNode = currentNode.getParentNode(); - } - } - } - - // use namespace declarations defined in the document (if any) - EObject eRootObject = eDataGraph.getERootObject(); - EReference xmlnsPrefixMapFeature = extendedMetaData.getXMLNSPrefixMapFeature(eRootObject.eClass()); - if (xmlnsPrefixMapFeature != null) - { - EMap xmlnsPrefixMap = (EMap)eRootObject.eGet(xmlnsPrefixMapFeature); - helper.setPrefixToNamespaceMap(xmlnsPrefixMap); - } - ChangeSummary changeSummary = eDataGraph.getEChangeSummary(); - - if (changeSummary != null) - { - helper.setMustHavePrefix(true); - if (changeSummary.isLogging()) - { - ((ChangeSummaryImpl)changeSummary).summarize(); - writeTopObject((EObject)changeSummary); - } - else - { - writeTopObject((EObject)changeSummary); - } - helper.setMustHavePrefix(false); - } - - if (eRootObject != null && writeTopObject(eRootObject) == null && !toDOM) - { - doc.addLine(); - doc.setMixed(false); - } - if (!toDOM) - { - doc.endElement(); - // reset to add namespace declarations - // - doc.resetToMark(datagraphMark); - } - else - { - currentNode = document.getFirstChild(); - } - addNamespaceDeclarations(); - } - else - { - super.traverse(contents); - } - } - - protected void writeTopAttributes(EObject top) - { - if (top == eDataGraph.getEChangeSummary()) - { - if (!toDOM) - { - doc.addAttribute("xmlns", ""); - } - else - { - ((Element)currentNode).setAttributeNS(ExtendedMetaData.XMLNS_URI, ExtendedMetaData.XMLNS_PREFIX, ""); - } - } - } - - protected EObject getSchemaLocationRoot(EObject eObject) - { - return eDataGraph.getERootObject(); - } - } - - protected XMLSave createXMLSave() - { - return new SaveImpl(createXMLHelper()); - } - - public static class LoadImpl extends XMLLoadImpl - { - public LoadImpl(XMLHelper xmlHelper) - { - super(xmlHelper); - } - - protected DefaultHandler makeDefaultHandler() - { - return new SAXXMLHandler(resource, helper, options) - { - protected DataGraphImpl eDataGraph; - - protected boolean isInModels; - - protected List ePackages = new ArrayList(); - - protected EMap recordNamespacesSchemaLocations(EObject root) - { - EObject dgroot = eDataGraph.getERootObject(); - if (dgroot == null) - { - return null; - } - EMap prefixToNamespaceMap = super.recordNamespacesSchemaLocations(dgroot); - if (prefixToNamespaceMap != null) - { - for (Iterator i = prefixToNamespaceMap.iterator(); i.hasNext();) - { - Map.Entry entry = (Map.Entry)i.next(); - String prefix = (String)entry.getKey(); - String namespace = (String)entry.getValue(); - if (namespace.equals("commonj.sdo")) - { - prefixToNamespaceMap.removeKey(prefix); - break; - } - } - } - return prefixToNamespaceMap; - } - - protected void handleFeature(String prefix, String name) - { - if (isInModels && objects.size() == 2) - { - EObject modelObject = createObjectByType(prefix, name, false); - processObject(modelObject); - ePackages.add(modelObject); - } - else if (objects.size() == 1) - { - eDataGraph = (DataGraphImpl)objects.peek(); - eDataGraph.getResourceSet(); - if ("".equals(prefix) && "changeSummary".equals(name)) - { - ChangeSummary eChangeSummary = (ChangeSummary)createObjectFromFactory(SDOFactory.eINSTANCE, "EChangeSummary"); - eDataGraph.setEChangeSummary(eChangeSummary); - processObject((EObject)eChangeSummary); - } - else if ("".equals(prefix) && "models".equals(name)) - { - isInModels = true; - types.push(OBJECT_TYPE); - objects.push(eDataGraph); - mixedTargets.push(null); - } - else if (eDataGraph.getERootObject() == null) - { - if (processAnyXML) - { - // Ensure that anything can be handled, even if it's not recognized. - // - String namespaceURI = helper.getURI(prefix); - if (extendedMetaData.getPackage(namespaceURI) == null) - { - EStructuralFeature rootFeature = extendedMetaData.demandFeature(namespaceURI, name, true); - rootFeature.getEContainingClass().getEPackage().setEFactoryInstance(new DynamicDataObjectImpl.FactoryImpl()); - } - } - - EObject rootObject = createObjectByType(prefix, name, false); - eDataGraph.setERootObject(rootObject); - processObject(rootObject); - if (rootObject != null - && rootObject.eClass() == ExtendedMetaData.INSTANCE.getDocumentRoot(rootObject.eClass().getEPackage())) - { - super.handleFeature(prefix, name); - - // Remove the document root from the stack. - // - Object mixedTarget = mixedTargets.pop(); - Object object = objects.pop(); - mixedTargets.pop(); - objects.pop(); - mixedTargets.push(mixedTarget); - objects.push(object); - } - } - } - else - { - super.handleFeature(prefix, name); - } - } - - public void endElement(String uri, String localName, String name) - { - if (isInModels && objects.size() == 2) - { - if (!ePackages.isEmpty()) - { - for (Iterator i = ePackages.iterator(); i.hasNext();) - { - EPackage ePackage = (EPackage)i.next(); - ePackage.setEFactoryInstance(new DynamicDataObjectImpl.FactoryImpl()); - Resource resource = resourceSet.createResource(URI.createURI("*.ecore")); - resource.getContents().add(ePackage); - if (ePackage.getNsURI() != null) - { - resource.setURI(URI.createURI(ePackage.getNsURI())); - } - - if (extendedMetaData != null) - { - extendedMetaData.putPackage(extendedMetaData.getNamespace(ePackage), ePackage); - } - else - { - packageRegistry.put(ePackage.getNsURI(), ePackage); - } - } - handleForwardReferences(); - } - isInModels = false; - } - super.endElement(uri, localName, name); - } - - protected EPackage getPackageForURI(String uriString) - { - if ("commonj.sdo".equals(uriString)) - { - return SDOPackage.eINSTANCE; - } - else - { - return super.getPackageForURI(uriString); - } - } - - protected EObject createObjectFromFactory(EFactory factory, String typeName) - { - if (factory == SDOFactory.eINSTANCE) - { - if ("datagraph".equals(typeName)) - { - return super.createObjectFromFactory(factory, "EDataGraph"); - } - } - return super.createObjectFromFactory(factory, typeName); - } - - protected EcoreBuilder createEcoreBuilder(Map options, ExtendedMetaData extendedMetaData) - { - return new DefaultEcoreBuilder(extendedMetaData) - { - public Collection generate(Map urisToLocations) throws Exception - { - Collection result = super.generate(urisToLocations); - return updateDynamicFactory(result); - } - - public Collection generate(Collection urisToLocations) throws Exception - { - Collection result = super.generate(urisToLocations); - return updateDynamicFactory(result); - } - - protected Collection updateDynamicFactory(Collection result) - { - for (Iterator i = result.iterator(); i.hasNext();) - { - Resource resource = (Resource)i.next(); - for (Iterator j = EcoreUtil.getObjectsByType(resource.getContents(), EcorePackage.eINSTANCE.getEPackage()).iterator(); j.hasNext();) - { - EPackage ePackage = (EPackage)j.next(); - ePackage.setEFactoryInstance(new DynamicDataObjectImpl.FactoryImpl()); - } - } - return result; - } - - }; - } - - protected EPackage handleMissingPackage(String uriString) - { - EPackage result = super.handleMissingPackage(uriString); - if (processAnyXML && objects.size() == 1) - { - result = extendedMetaData.demandPackage(uriString); - } - return result; - } - }; - } - } - - protected XMLLoad createXMLLoad() - { - return new LoadImpl(createXMLHelper()); - } - } -} diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataObjectUtil.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataObjectUtil.java deleted file mode 100644 index 6c816090a4..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataObjectUtil.java +++ /dev/null @@ -1,1727 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.util; - - -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.tuscany.sdo.impl.SDOFactoryImpl; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EClassifier; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EFactory; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.util.ExtendedMetaData; -import org.eclipse.emf.ecore.util.FeatureMap; -import org.eclipse.emf.ecore.util.FeatureMapUtil; -import org.eclipse.emf.ecore.xmi.impl.EMOFResourceFactoryImpl; -import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl; -import org.eclipse.emf.ecore.xmi.impl.XMLResourceFactoryImpl; -import org.eclipse.emf.ecore.xml.type.internal.XMLCalendar; -import org.eclipse.xsd.util.XSDResourceFactoryImpl; - -import commonj.sdo.DataGraph; -import commonj.sdo.DataObject; -import commonj.sdo.Property; -import commonj.sdo.Type; -import commonj.sdo.helper.TypeHelper; - - -public final class DataObjectUtil -{ - public static BigDecimal getBigDecimal(Object value) - { - if (value instanceof BigDecimal) - { - return (BigDecimal)value; - } - - if (value instanceof BigInteger) - { - return new BigDecimal((BigInteger)value); - } - - if (value instanceof Number) - { - return new BigDecimal(((Number)value).doubleValue()); - } - - if (value instanceof String) - { - return new BigDecimal((String)value); - } - - if (value == null) - { - return null; - } - - throw new IllegalArgumentException("The value of type '" + value.getClass().getName() + "' cannot be converted to BigDecimal"); - } - - public static Object getSetValue(Property property, BigDecimal value) - { - EStructuralFeature eStructuralFeature = (EStructuralFeature)property; - EClassifier eType = eStructuralFeature.getEType(); - if (value == null) - { - return eType.getDefaultValue(); - } - - String name = eType.getInstanceClassName(); - if (name == "java.math.BigDecimal") - { - return value; - } - - if (name == "java.math.BigInteger") - { - return value.toBigInteger(); - } - - if (name == "java.lang.Byte" || name == "byte") - { - return new Byte(value.byteValue()); - } - - if (name == "java.lang.Double" || name == "double") - { - return new Double(value.doubleValue()); - } - - if (name == "java.lang.Float" || name == "float") - { - return new Float(value.floatValue()); - } - - if (name == "java.lang.Integer" || name == "int") - { - return new Integer(value.intValue()); - } - - if (name == "java.lang.Long" || name == "long") - { - return new Long(value.longValue()); - } - - if (name == "java.lang.Short" || name == "short") - { - return new Short(value.shortValue()); - } - - if (name == "java.lang.String") - { - return String.valueOf(value); - } - - //Instead of throwing an IllegalArgumentException we will pass the value to the property - return value; - } - - public static BigInteger getBigInteger(Object value) - { - if (value instanceof BigInteger) - { - return (BigInteger)value; - } - - if (value instanceof BigDecimal) - { - return ((BigDecimal)value).toBigInteger(); - } - - if (value instanceof Number) - { - return BigInteger.valueOf(((Number)value).longValue()); - } - - if (value instanceof String) - { - return new BigInteger((String)value); - } - - if (value instanceof byte[]) - { - return new BigInteger((byte[])value); - } - - if (value == null) - { - return null; - } - - throw new IllegalArgumentException("The value of type '" + value.getClass().getName() + "' cannot be converted to BigInteger"); - } - - public static Object getSetValue(Property property, BigInteger value) - { - EStructuralFeature eStructuralFeature = (EStructuralFeature)property; - EClassifier eType = eStructuralFeature.getEType(); - if (value == null) - { - return eType.getDefaultValue(); - } - - String name = eType.getInstanceClassName(); - if (name == "java.math.BigInteger") - { - return value; - } - - if (name == "java.math.BigDecimal") - { - return new BigDecimal(value); - } - - if (name == "java.lang.Byte" || name == "byte") - { - return new Byte(value.byteValue()); - } - - if (name == "java.lang.Double" || name == "double") - { - return new Double(value.doubleValue()); - } - - if (name == "java.lang.Float" || name == "float") - { - return new Float(value.floatValue()); - } - - if (name == "java.lang.Integer" || name == "int") - { - return new Integer(value.intValue()); - } - - if (name == "java.lang.Long" || name == "long") - { - return new Long(value.longValue()); - } - - if (name == "java.lang.Short" || name == "short") - { - return new Short(value.shortValue()); - } - - if (name == "java.lang.String") - { - return String.valueOf(value); - } - - if (name == "byte[]") - { - return value.toByteArray(); - } - - //Instead of throwing an IllegalArgumentException we will pass the value to the property - return value; - } - - public static boolean getBoolean(Object value) - { - if (value instanceof Boolean) - { - return ((Boolean)value).booleanValue(); - } - - if (value instanceof String) - { - return Boolean.valueOf((String)value).booleanValue(); - } - - if (value == null) - { - return false; - } - - throw new IllegalArgumentException("The value of type '" + value.getClass().getName() + "' cannot be converted to boolean"); - } - - public static Object getSetValue(Property property, boolean value) - { - EStructuralFeature eStructuralFeature = (EStructuralFeature)property; - String name = eStructuralFeature.getEType().getInstanceClassName(); - if (name == "java.lang.Boolean" || name == "boolean") - { - return value ? Boolean.TRUE : Boolean.FALSE; - } - - if (name == "java.lang.String") - { - return String.valueOf(value); - } - - //Instead of throwing an IllegalArgumentException we will pass the value to the property - return value ? Boolean.TRUE : Boolean.FALSE; - } - - public static byte getByte(Object value) - { - if (value instanceof Number) - { - return ((Number)value).byteValue(); - } - - if (value instanceof String) - { - return Byte.parseByte((String)value); - } - - if (value == null) - { - return 0; - } - - throw new IllegalArgumentException("The value of type '" + value.getClass().getName() + "' cannot be converted to byte"); - } - - public static Object getSetValue(Property property, byte value) - { - EStructuralFeature eStructuralFeature = (EStructuralFeature)property; - String name = eStructuralFeature.getEType().getInstanceClassName(); - if (name == "java.lang.Byte" || name == "byte") - { - return new Byte(value); - } - - if (name == "java.lang.Double" || name == "double") - { - return new Double(value); - } - - if (name == "java.lang.Float" || name == "float") - { - return new Float(value); - } - - if (name == "java.lang.Integer" || name == "int") - { - return new Integer(value); - } - - if (name == "java.lang.Long" || name == "long") - { - return new Long(value); - } - - if (name == "java.lang.Short" || name == "short") - { - return new Short(value); - } - - if (name == "java.math.BigDecimal") - { - return getBigDecimal(new Byte(value)); - } - - if (name == "java.math.BigInteger") - { - return getBigInteger(new Byte(value)); - } - - if (name == "java.lang.String") - { - return String.valueOf(value); - } - - //Instead of throwing an IllegalArgumentException we will pass the value to the property - return new Byte(value); - } - - public static byte[] getBytes(Object value) - { - if (value instanceof byte[]) - { - return (byte[])value; - } - - if (value instanceof BigInteger) - { - return ((BigInteger)value).toByteArray(); - } - - if (value == null) - { - return null; - } - - throw new IllegalArgumentException("The value of type '" + value.getClass().getName() + "' cannot be converted to byte array"); - } - - public static Object getSetValue(Property property, byte[] value) - { - EStructuralFeature eStructuralFeature = (EStructuralFeature)property; - EClassifier eType = eStructuralFeature.getEType(); - if (value == null) - { - return eType.getDefaultValue(); - } - - String name = eType.getInstanceClassName(); - if (name == "byte[]") - { - return value; - } - - if (name == "java.math.BigInteger") - { - return new BigInteger(value); - } - - //Instead of throwing an IllegalArgumentException we will pass the value to the property - return value; - } - - public static char getChar(Object value) - { - if (value instanceof Character) - { - return ((Character)value).charValue(); - } - - if (value instanceof String) - { - return ((String)value).charAt(0); - } - - if (value == null) - { - return 0; - } - - throw new IllegalArgumentException("The value of type '" + value.getClass().getName() + "' cannot be converted to char"); - } - - public static Object getSetValue(Property property, char value) - { - EStructuralFeature eStructuralFeature = (EStructuralFeature)property; - String name = eStructuralFeature.getEType().getInstanceClassName(); - if (name == "java.lang.Character" || name == "char") - { - return new Character(value); - } - - if (name == "java.lang.String") - { - return String.valueOf(value); - } - - //Instead of throwing an IllegalArgumentException we will pass the value to the property - return new Character(value); - } - - public static Date getDate(Object value) - { - if (value instanceof XMLCalendar) - { - return ((XMLCalendar)value).getDate(); - } - - if (value instanceof Date) - { - return (Date)value; - } - - if (value instanceof Long) - { - return new Date(((Long)value).longValue()); - } - - if (value == null) - { - return null; - } - - throw new IllegalArgumentException("The value of type '" + value.getClass().getName() + "' cannot be converted to Date"); - } - - public static Object getSetValue(Property property, Date value) - { - EStructuralFeature eStructuralFeature = (EStructuralFeature)property; - EClassifier eType = eStructuralFeature.getEType(); - if (value == null) - { - return eType.getDefaultValue(); - } - - String name = eType.getInstanceClassName(); - if (name == "java.lang.Object") - { - String typeName = getDateTypeName((EDataType)eType); - if ("Date".equals(typeName)) - { - return new XMLCalendar(value, XMLCalendar.DATE); - } - if ("DateTime".equals(typeName)) - { - return new XMLCalendar(value, XMLCalendar.DATETIME); - } - // Instead of throwing an IllegalArgumentException we will pass the value to the property - return value; - } - - if (name == "java.lang.Long" || name == "long") - { - return new Long(value.getTime()); - } - if (name == "java.lang.String") - { - return value.toString(); - } - - // Instead of throwing an IllegalArgumentException we will pass the value to the property - return value; - } - - protected static String getDateTypeName(EDataType eDataType) - { - String name = eDataType.getName(); - if (("DateTime".equals(name)) || ("Date".equals(name))) - { - return name; - } - - EDataType baseType = ExtendedMetaData.INSTANCE.getBaseType(eDataType); - if (baseType != null) - { - return getDateTypeName(baseType); - } - - List memberTypes = ExtendedMetaData.INSTANCE.getMemberTypes(eDataType); - if (!memberTypes.isEmpty()) - { - for (int i = 0, size = memberTypes.size(); i < size; ++i) - { - EDataType memberType = (EDataType)memberTypes.get(i); - String memberTypeName = getDateTypeName(memberType); - if (("DateTime".equals(memberTypeName)) || ("Date".equals(memberTypeName))) - { - return memberTypeName; - } - } - } - - return ""; - } - - public static double getDouble(Object value) - { - if (value instanceof Number) - { - return ((Number)value).doubleValue(); - } - - if (value instanceof String) - { - return Double.parseDouble((String)value); - } - - if (value == null) - { - return 0; - } - - throw new IllegalArgumentException("The value of type '" + value.getClass().getName() + "' cannot be converted to double"); - } - - public static Object getSetValue(Property property, double value) - { - EStructuralFeature eStructuralFeature = (EStructuralFeature)property; - String name = eStructuralFeature.getEType().getInstanceClassName(); - if (name == "java.lang.Byte" || name == "byte") - { - return new Byte((byte)value); - } - - if (name == "java.lang.Double" || name == "double") - { - return new Double(value); - } - - if (name == "java.lang.Float" || name == "float") - { - return new Float(value); - } - - if (name == "java.lang.Integer" || name == "int") - { - return new Integer((int)value); - } - - if (name == "java.lang.Long" || name == "long") - { - return new Long((long)value); - } - - if (name == "java.lang.Short" || name == "short") - { - return new Short((short)value); - } - - if (name == "java.math.BigDecimal") - { - return getBigDecimal(new Double(value)); - } - - if (name == "java.math.BigInteger") - { - return getBigInteger(new Double(value)); - } - - if (name == "java.lang.String") - { - return String.valueOf(value); - } - - //Instead of throwing an IllegalArgumentException we will pass the value to the property - return new Double(value); - } - - public static float getFloat(Object value) - { - if (value instanceof Number) - { - return ((Number)value).floatValue(); - } - - if (value instanceof String) - { - return Float.parseFloat((String)value); - } - - if (value == null) - { - return 0; - } - - throw new IllegalArgumentException("The value of type '" + value.getClass().getName() + "' cannot be converted to float"); - } - - public static Object getSetValue(Property property, float value) - { - EStructuralFeature eStructuralFeature = (EStructuralFeature)property; - String name = eStructuralFeature.getEType().getInstanceClassName(); - if (name == "java.lang.Byte" || name == "byte") - { - return new Byte((byte)value); - } - - if (name == "java.lang.Double" || name == "double") - { - return new Double(value); - } - - if (name == "java.lang.Float" || name == "float") - { - return new Float(value); - } - - if (name == "java.lang.Integer" || name == "int") - { - return new Integer((int)value); - } - - if (name == "java.lang.Long" || name == "long") - { - return new Long((long)value); - } - - if (name == "java.lang.Short" || name == "short") - { - return new Short((short)value); - } - - if (name == "java.math.BigDecimal") - { - return getBigDecimal(new Float(value)); - } - - if (name == "java.math.BigInteger") - { - return getBigInteger(new Float(value)); - } - - if (name == "java.lang.String") - { - return String.valueOf(value); - } - - // Instead of throwing an IllegalArgumentException we will pass the value to the property - return new Float(value); - } - - public static int getInt(Object value) - { - if (value instanceof Number) - { - return ((Number)value).intValue(); - } - - if (value instanceof String) - { - return Integer.parseInt((String)value); - } - - if (value == null) - { - return 0; - } - - throw new IllegalArgumentException("The value of type '" + value.getClass().getName() + "' cannot be converted to int"); - } - - public static Object getSetValue(Property property, int value) - { - EStructuralFeature eStructuralFeature = (EStructuralFeature)property; - String name = eStructuralFeature.getEType().getInstanceClassName(); - if (name == "java.lang.Byte" || name == "byte") - { - return new Byte((byte)value); - } - - if (name == "java.lang.Double" || name == "double") - { - return new Double(value); - } - - if (name == "java.lang.Float" || name == "float") - { - return new Float(value); - } - - if (name == "java.lang.Integer" || name == "int") - { - return new Integer(value); - } - - if (name == "java.lang.Long" || name == "long") - { - return new Long(value); - } - - if (name == "java.lang.Short" || name == "short") - { - return new Short((short)value); - } - - if (name == "java.math.BigDecimal") - { - return getBigDecimal(new Integer(value)); - } - - if (name == "java.math.BigInteger") - { - return getBigInteger(new Integer(value)); - } - - if (name == "java.lang.String") - { - return String.valueOf(value); - } - - // Instead of throwing an IllegalArgumentException we will pass the value to the property - return new Integer(value); - } - - public static long getLong(Object value) - { - if (value instanceof Number) - { - return ((Number)value).longValue(); - } - - if (value instanceof String) - { - return Long.parseLong((String)value); - } - - if (value instanceof Date) - { - return ((Date)value).getTime(); - } - - if (value == null) - { - return 0; - } - - throw new IllegalArgumentException("The value of type '" + value.getClass().getName() + "' cannot be converted to long"); - } - - public static Object getSetValue(Property property, long value) - { - EStructuralFeature eStructuralFeature = (EStructuralFeature)property; - String name = eStructuralFeature.getEType().getInstanceClassName(); - if (name == "java.lang.Byte" || name == "byte") - { - return new Byte((byte)value); - } - - if (name == "java.lang.Double" || name == "double") - { - return new Double(value); - } - - if (name == "java.lang.Float" || name == "float") - { - return new Float(value); - } - - if (name == "java.lang.Integer" || name == "int") - { - return new Integer((int)value); - } - - if (name == "java.lang.Long" || name == "long") - { - return new Long(value); - } - - if (name == "java.lang.Short" || name == "short") - { - return new Short((short)value); - } - - if (name == "java.math.BigDecimal") - { - return getBigDecimal(new Long(value)); - } - - if (name == "java.math.BigInteger") - { - return getBigInteger(new Long(value)); - } - - if (name == "java.lang.String") - { - return String.valueOf(value); - } - - if (name == "java.util.Date") - { - return new Date(value); - } - - // Instead of throwing an IllegalArgumentException we will pass the value to the property - return new Long(value); - } - - public static short getShort(Object value) - { - if (value instanceof Number) - { - return ((Number)value).shortValue(); - } - - if (value instanceof String) - { - return Short.parseShort((String)value); - } - - if (value == null) - { - return 0; - } - - throw new IllegalArgumentException("The value of type '" + value.getClass().getName() + "' cannot be converted to short"); - } - - public static Object getSetValue(Property property, short value) - { - EStructuralFeature eStructuralFeature = (EStructuralFeature)property; - String name = eStructuralFeature.getEType().getInstanceClassName(); - if (name == "java.lang.Byte" || name == "byte") - { - return new Byte((byte)value); - } - - if (name == "java.lang.Double" || name == "double") - { - return new Double(value); - } - - if (name == "java.lang.Float" || name == "float") - { - return new Float(value); - } - - if (name == "java.lang.Integer" || name == "int") - { - return new Integer(value); - } - - if (name == "java.lang.Long" || name == "long") - { - return new Long(value); - } - - if (name == "java.lang.Short" || name == "short") - { - return new Short(value); - } - - if (name == "java.math.BigDecimal") - { - return getBigDecimal(new Short(value)); - } - - if (name == "java.math.BigInteger") - { - return getBigInteger(new Short(value)); - } - - if (name == "java.lang.String") - { - return String.valueOf(value); - } - - // Instead of throwing an IllegalArgumentException we will pass the value to the property - return new Short(value); - } - - public static String getString(Object value) - { - if (value instanceof String) - { - return (String)value; - } - - if (value instanceof Number || value instanceof Boolean || value instanceof Character) - { - return String.valueOf(value); - } - - if (value == null) - { - return null; - } - - throw new IllegalArgumentException("The value of type '" + value.getClass().getName() + "' cannot be converted to String"); - } - - public static Object getSetValue(Property property, String value) - { - EStructuralFeature eStructuralFeature = (EStructuralFeature)property; - EClassifier eType = eStructuralFeature.getEType(); - if (value == null) - { - return eType.getDefaultValue(); - } - - String name = eType.getInstanceClassName(); - if (name == "java.lang.String") - { - return value; - } - - if (name == "java.lang.Byte" || name == "byte") - { - return Byte.valueOf(value); - } - - if (name == "java.lang.Double" || name == "double" || name == "java.lang.Number") - { - return Double.valueOf(value); - } - - if (name == "java.lang.Float" || name == "float") - { - return new Float(value); - } - - if (name == "java.lang.Integer" || name == "int") - { - return Integer.valueOf(value); - } - - if (name == "java.lang.Long" || name == "long") - { - return Long.valueOf(value); - } - - if (name == "java.lang.Short" || name == "short") - { - return Short.valueOf(value); - } - - if (name == "java.lang.Character" || name == "char") - { - return new Character(value.charAt(0)); - } - - if (name == "java.math.BigDecimal") - { - return getBigDecimal(value); - } - - if (name == "java.math.BigInteger") - { - return getBigInteger(value); - } - - if (name == "java.lang.Boolean" || name == "boolean") - { - return Boolean.valueOf(value); - } - - // Instead of throwing an IllegalArgumentException we will pass the value to the property - return value; - } - - public static EStructuralFeature getOpenFeature(EObject eObject, int featureID) - { - EClass eClass = eObject.eClass(); - int openFeatureCount = featureID - eClass.getFeatureCount(); - Set openFeatureSet = new HashSet(); - for (int i = 0, count = eClass.getEAllStructuralFeatures().size(); i < count; ++i) - { - EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i); - if (!eStructuralFeature.isDerived() && FeatureMapUtil.isFeatureMap(eStructuralFeature)) - { - List features = (List)eObject.eGet(eStructuralFeature); - for (int j = 0, size = features.size(); j < size; ++j) - { - FeatureMap.Entry entry = (FeatureMap.Entry)features.get(j); - EStructuralFeature entryFeature = entry.getEStructuralFeature(); - if (openFeatureSet.add(entryFeature)) - { - if (--openFeatureCount < 0) return entryFeature; - } - } - } - } - throw new IndexOutOfBoundsException(); - } - - public static EStructuralFeature getOpenFeature(EObject eObject, String featureName) - { - EClass eClass = eObject.eClass(); - Set openFeatureSet = new HashSet(); - for (int i = 0, count = eClass.getEAllStructuralFeatures().size(); i < count; ++i) - { - EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i); - if (/*!eStructuralFeature.isDerived() && */FeatureMapUtil.isFeatureMap(eStructuralFeature)) - { - List features = (List)eObject.eGet(eStructuralFeature); - for (int j = 0, size = features.size(); j < size; ++j) - { - FeatureMap.Entry entry = (FeatureMap.Entry)features.get(j); - EStructuralFeature entryFeature = entry.getEStructuralFeature(); - if (openFeatureSet.add(entryFeature)) - { - Property property = (Property)entryFeature; - if (property.getName().equals(featureName)) return entryFeature; - - List aliasNames = property.getAliasNames(); - for (int aliasCount = aliasNames.size(); aliasCount > 0; ) - { - if (aliasNames.get(--aliasCount).equals(featureName)) return entryFeature; - } - } - } - } - } - throw new IllegalArgumentException("Class '" + eObject.eClass().getName() + "' does not have a feature named '" + featureName + "'"); - } - - public static List getAliasNames(EStructuralFeature eStructuralFeature) - { - List aliasNames = new ArrayList(); - String xmlName = ExtendedMetaData.INSTANCE.getName(eStructuralFeature); - if (!xmlName.equals(eStructuralFeature.getName())) - { - aliasNames.add(xmlName); - } - return aliasNames; - } - - public static List getAliasNames(EClassifier eClassifier) - { - List aliasNames = new ArrayList(); - String xmlName = ExtendedMetaData.INSTANCE.getName(eClassifier); - if (!xmlName.equals(eClassifier.getName())) - { - aliasNames.add(xmlName); - } - return aliasNames; - } - - /** - * Process the default EMF path and minimal XPath syntax. - * This design is still under review and construction. - * - * Syntax: - * - *
-   * path = /? (step '/')* step
-   * step = feature
-   *      | feature '.' index_from_0 
-   *      | feature '[' index_from_1 ']'
-   *      | reference '[' attribute '=' value ']'
-   *      | ..
-   *      | '@' step
-   *
- * - * feature = the name of an attribute or reference - * attribute = the name of an attribute - * reference = the name of a reference - * index = positive integer - * value = the string value of an attribute - * leading / begins at the root - * .. is containing object - * - * features must be multi-valued to use '.' and '[' operations. - * Only the last step may have an attribute as the feature. - */ - public static final class Accessor //TODO rewrite this using SDO APIs - { - /** - * Creates an accessor for the path of the object. - */ - public static Accessor create(EObject eObject, String path) - { - Accessor result = pool.get(); - result.init(eObject, path); - return result; - } - - /** - * Only the get and recycle methods should be call; they are the only synchronized methods. - */ - protected static class Pool extends BasicEList - { - protected Accessor[] accessors; - - public Pool() - { - super(10); - } - - protected Object[] newData(int capacity) - { - return accessors = new Accessor [capacity]; - } - - /** - * Returns a recyled instance or a new instance. - */ - public synchronized Accessor get() - { - if (size > 0) - { - return accessors[--size]; - } - else - { - return new Accessor(); - } - } - - /** Safely gives the accessor back for recycled use. - */ - public synchronized void recycle(Accessor accessor) - { - int minimumCapacity = size + 1; - if (minimumCapacity > data.length) - { - grow(minimumCapacity); - } - accessors[size++] = accessor; - } - } - - /** - * A static thread safe pool of Accessors. - */ - static final Pool pool = new Pool(); - - protected static final int NO_INDEX = -1; - - protected EObject eObject; - - protected EStructuralFeature feature; - - protected int index; - - protected Accessor() - { - } - - protected Accessor(EObject eObject, String path) - { - init(eObject, path); - } - - protected void init(EObject eObject, String path) - { - this.eObject = eObject; - - // This should only be called with a path right now. - // - //feature = getType(eObject).getProperty(path).getEStructuralFeature(); - //if (feature == null) - { - process(path); - } - //else - { - //index = NO_INDEX; - } - } - - public Object get() - { - if (feature == null) - { - return eObject; - } - else - { - Object value = eObject.eGet(feature, true); - if (index >= 0) - { - value = ((List)value).get(index); - if (value instanceof FeatureMap.Entry) - { - value = ((FeatureMap.Entry)value).getValue(); - } - } - else if (FeatureMapUtil.isFeatureMap(feature)) - { - value = new BasicSequence((FeatureMap.Internal)value); - } - return value; - } - } - - public Object getAndRecyle() - { - Object result = get(); - pool.recycle(this); - return result; - } - - public void set(Object newValue) - { - if (index >= 0) - { - List list = (List)eObject.eGet(feature, true); - list.set(index, newValue); - } - else - { - // EATM newValue = string2Enum(feature, newValue); - eObject.eSet(feature, newValue); - } - } - - public void setAndRecyle(Object newValue) - { - set(newValue); - pool.recycle(this); - } - - public boolean isSet() - { - return eObject.eIsSet(feature); - } - - public boolean isSetAndRecyle() - { - boolean result = isSet(); - pool.recycle(this); - return result; - } - - public void unset() - { - eObject.eUnset(feature); - } - - public void unsetAndRecyle() - { - unset(); - pool.recycle(this); - } - - public void recycle() - { - pool.recycle(this); - } - - public EObject getEObject() - { - return eObject; - } - - protected void setEObject(EObject eObject) - { - this.eObject = eObject; - feature = null; - index = NO_INDEX; - } - - public EStructuralFeature getEStructuralFeature() - { - return feature; - } - - public Property getProperty() - { - return (Property)feature; - } - - protected void setFeatureName(String name) - { - if (name != null) - { - feature = (EStructuralFeature)((DataObject)eObject).getProperty(name); - } - else - { - feature = null; - } - index = NO_INDEX; - } - - protected int getIndex() - { - return index; - } - - protected void setIndex(int index) - { - this.index = index; - if (!FeatureMapUtil.isMany(eObject, feature)) - { - throw new IndexOutOfBoundsException("Index applies only to multi-valued features."); - } - } - - protected void process(String pathString) - { - TokenList tokens = new TokenList(pathString.toCharArray()); - String token; - int size = tokens.size(); - int x = 0; - - if ("/".equals(tokens.peek(0))) - { - setEObject(EcoreUtil.getRootContainer(eObject)); - x++; - } - - for (; x < size; x++) - { - token = tokens.peek(x); - char c = token.charAt(0); - if ('/' == c) - { - setEObject((EObject)get()); - } - else if ("..".equals(token)) - { - EObject container = eObject.eContainer(); - if (container == null) - { - throw new IllegalArgumentException("No containing object for " + eObject); - } - setEObject(container); - } - else if ('.' == c) - { - x++; // skip . - token = tokens.peek(x); - int index = Integer.parseInt(token); - setIndex(index); - } - else if ('[' == c) - { - x++; // skip [ - token = tokens.peek(x); // name or index - char following = tokens.peek(x + 1).charAt(0); - if ('=' != following) - { - int index = Integer.parseInt(token) - 1; - setIndex(index); - x++; // skip ] - } - else - { - x++; // done name - x++; // skip = - String attributeValue = tokens.peek(x); // value - if ("\"".equals(attributeValue)) - { - x++; // skip " - attributeValue = tokens.peek(++x); - } - x++; // skip ] - int index = matchingIndex((List)get(), token, attributeValue); - if (index < 0) - { - setEObject(null); - } - else - { - setIndex(index); - } - } - } - else if ('@' == c) - { - x++; // skip @ - } - else - { - setFeatureName(token); - } - } - } - - protected static int matchingIndex(List eObjects, String attributeName, String attributeValue) - { - for (int i = 0, size = eObjects.size(); i < size; i++) - { - EObject eObject = (EObject)eObjects.get(i); - EStructuralFeature feature = (EStructuralFeature)((Type)eObject.eClass()).getProperty(attributeName); - if (feature != null) - { - Object test = eObject.eGet(feature, true); - if (test != null) - { - String testString = EcoreUtil.convertToString((EDataType)feature.getEType(), test); - if (attributeValue.equals(testString)) - { - return i; - } - } - } - } - return -1; - } - - protected static class TokenList extends BasicEList - { - public TokenList(char[] path) - { - super(4); - - int pathLength = path.length; - StringBuffer token = new StringBuffer(); - char cPrev; - char c = 0; - char cNext; - char stringConstant = 0; - for (int pos = 0; pos < pathLength; pos++) - { - cPrev = c; - c = path[pos]; - cNext = pos < pathLength - 1 ? path[pos + 1] : 0; - - if (stringConstant != 0) - { - if (c == stringConstant) - { - endToken(token, true); - stringConstant = 0; - } - else - { - token.append(c); - } - } - else - { - switch (c) - { - case ' ': - case 0xA: - case 0xD: - case 0x9: - if (cPrev != ' ') - { - endToken(token, false); - } - c = ' '; - break; - - case '"': - case '\'': - endToken(token, false); - stringConstant = c; - break; - - // double or single tokens - case '/': - case ':': - case '.': - if (cPrev != c) - { - endToken(token, false); - } - token.append(c); - if (cNext != c) - { - endToken(token, false); - } - break; - - // single tokens - case '*': - case '@': - case '[': - case ']': - case '(': - case ')': - case '|': - endToken(token, false); - add(String.valueOf(c)); - break; - - // TODO: < > <= >= + - != - case '!': - endToken(token, false); - token.append(c); - break; - - case '=': - endToken(token, false); - add(String.valueOf(c)); - break; - - default: - token.append(c); - } - } - } - endToken(token, false); - } - - public String peek() - { - return size > 0 ? (String)data[0] : " "; - } - - public String peek(int index) - { - return index < size ? (String)data[index] : " "; - } - - public TokenList pop() - { - remove(0); - return this; - } - - public TokenList pop(int count) - { - while (count-- > 0) - { - remove(count); - } - return this; - } - - protected void endToken(StringBuffer token, boolean includeEmpty) - { - if (includeEmpty || token.length() > 0) - { - add(token.toString()); - } - token.setLength(0); - } - - protected boolean canContainNull() - { - return false; - } - - protected Object[] newData(int capacity) - { - return new String [capacity]; - } - } - - public String toString() - { - StringBuffer result = new StringBuffer("Accessor (object:"); - result.append(eObject == null ? "null" : eObject.toString()); - result.append(", feature:"); - result.append(feature == null ? "null" : feature.getName()); - result.append(", index:"); - result.append(index); - result.append(")"); - return result.toString(); - } - } - - public static Type getType(DataObject dataObject, String namespaceURI, String typeName) - { - DataGraph dataGraph = dataObject.getDataGraph(); - if (dataGraph != null) - { - return dataGraph.getType(namespaceURI, typeName); - } - else - { - //TODO think about where else to find the type - return TypeHelper.INSTANCE.getType(namespaceURI, typeName); - } - } - - public static Property getProperty(DataObject dataObject, String propertyName) - { - Property property = dataObject.getProperty(propertyName); - if (property == null) - { - throw new IllegalArgumentException("Type '" + dataObject.getType().getName() + "' does not have a property named '" + propertyName + "'"); - } - - return property; - } - - public static Property getProperty(DataObject dataObject, int propertyIndex) - { - List typeProperties = dataObject.getType().getProperties(); - - Property property = propertyIndex < typeProperties.size() ? - (Property)typeProperties.get(propertyIndex) : - (Property)dataObject.getInstanceProperties().get(propertyIndex); - - //FB maybe should catch bad index exception and throw IllegalArgumentException? - return property; - } - - public static Property getContainmentProperty(Property property) - { - if (property.isContainment()) - { - return property; - } - throw new IllegalArgumentException("The property '" + property.getName() + "' of '" + property.getContainingType().getName() - + "' isn't a containment"); - } - - public static DataObject create(Type type) - { - return (DataObject)EcoreUtil.create((EClass)type); - } - - public static ResourceSet createResourceSet() - { - ResourceSet result = new ResourceSetImpl(); - configureResourceSet(result); - return result; - } - - protected static Map registrations; - - protected static Map getRegistrations() - { - if (registrations == null) - { - Map result = new HashMap(); - - if (!(Resource.Factory.Registry.INSTANCE.getFactory(URI.createURI("*.datagraph")) instanceof DataGraphResourceFactoryImpl)) - { - result.put("datagraph", new DataGraphResourceFactoryImpl()); - } - if (!(Resource.Factory.Registry.INSTANCE.getFactory(URI.createURI("*.ecore")) instanceof EcoreResourceFactoryImpl)) - { - result.put("ecore", new EcoreResourceFactoryImpl()); - } - - if (!(Resource.Factory.Registry.INSTANCE.getFactory(URI.createURI("*.emof")) instanceof EMOFResourceFactoryImpl)) - { - result.put("emof", new EMOFResourceFactoryImpl()); - } - - if (Resource.Factory.Registry.INSTANCE.getFactory(URI.createURI("*.xsd")) == null) - { - result.put("xsd", new XSDResourceFactoryImpl()); - } - - //FIXME ClassCastException in XSDHelper.define() if you give it a WSDL file - // Patch for JIRA TUSCANY-42 - if (Resource.Factory.Registry.INSTANCE.getFactory(URI.createURI("*.wsdl")) == null) - { - result.put("wsdl", new XSDResourceFactoryImpl()); - } - - if (Resource.Factory.Registry.INSTANCE.getFactory(URI.createURI("*.*")) == null) - { - result.put("*", new XMLResourceFactoryImpl()); - } - - registrations = result; - } - - return registrations; - } - - protected static void configureResourceSet(ResourceSet resourceSet) - { - resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().putAll(getRegistrations()); - } - - /** - * Configure EMF to support the SDO runtime by registering a specialized Ecore factory, SDOEcoreFactory. - * This static initializion must run before any SDO metadata is created or loaded. - * As long as SDO helper classes (e.g., TypeHelper, XMLHelper, etc.) are accessed though their - * corresponding INSTANCE fields (e.g., TypeHelper.INSTANCE), or using the SDOUtil methods (e.g., - * SDOUtil.createTypeHelper(), this will always be the case. - */ - static - { - EPackage.Registry.INSTANCE.put(EcorePackage.eNS_URI, new EPackage.Descriptor() - { - public EPackage getEPackage() - { - return EcorePackage.eINSTANCE; - } - - public EFactory getEFactory() - { - return new SDOFactoryImpl.SDOEcoreFactory(); - } - }); - } - - public static void initRuntime() - { - // NOOP since init is done during static initialization of this class. See above. - } - -} diff --git a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/SDOUtil.java b/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/SDOUtil.java deleted file mode 100644 index 521bdec886..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/SDOUtil.java +++ /dev/null @@ -1,221 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.util; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.lang.reflect.Field; -import java.util.Map; - -import org.apache.tuscany.sdo.SDOFactory; -import org.apache.tuscany.sdo.SDOPackage; -import org.apache.tuscany.sdo.helper.DataFactoryImpl; -import org.apache.tuscany.sdo.helper.TypeHelperImpl; -import org.apache.tuscany.sdo.helper.XMLHelperImpl; -import org.apache.tuscany.sdo.helper.XSDHelperImpl; -import org.apache.tuscany.sdo.impl.DataGraphImpl; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EClassifier; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.util.BasicExtendedMetaData; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.util.ExtendedMetaData; -import org.eclipse.emf.ecore.xml.type.XMLTypePackage; - -import commonj.sdo.DataGraph; -import commonj.sdo.Type; -import commonj.sdo.helper.DataFactory; -import commonj.sdo.helper.TypeHelper; -import commonj.sdo.helper.XMLHelper; -import commonj.sdo.helper.XSDHelper; - -/** - * This class provides some useful static utility functions which are not specified in the SDO - * specification itself. Use of the functions in this class is recommended, instead of resorting - * to low-level implementation-specific APIs. - */ -public final class SDOUtil -{ - /** - * Creates an instance of a data type from the specified string. - * @param dataType a Type, for which isDataType() returns true, to instantiate. - * @param literal the string value of the dataType. - * @return an instance of the dataType. - * @see #convertToString(Type, Object) - */ - public static Object createFromString(Type dataType, String literal) - { - return EcoreUtil.createFromString((EDataType)dataType, literal); - } - - /** - * Converts an instance of a data type to a string literal representation. - * @param dataType the Type, for which isDataType() returns true, of the value to convert. - * @param value a value of the dataType. - * @return the string literal representation of the value. - * @see #createFromString(Type, String) - */ - public static String convertToString(Type dataType, Object value) - { - return EcoreUtil.convertToString((EDataType)dataType, value); - } - - /** - * Get the SDO built-in type corresponding to the specified XSD type in the XML Schema - * namespace ("http://www.w3.org/2001/XMLSchema"). - * @param xsdType a type name in the XML Schema namespace. - * @return the SDO built-in Type corresponding to the specified XSD type. - */ - public static Type getXSDSDOType(String xsdType) - { - //FIXME Temporary impl to be replaced with proper XSD to SDO mapping (see SDO spec - pg 95) - return (Type) - ("anyType".equals(xsdType) ? - SDOPackage.eINSTANCE.getDataObject() : - ExtendedMetaData.INSTANCE.getType(XMLTypePackage.eINSTANCE, xsdType)); - } - - /** - * Create an empty data graph. - * @return the new data graph instance. - */ - public static DataGraph createDataGraph() - { - return SDOFactory.eINSTANCE.createDataGraph(); - } - - /** - * Load a serialized data graph from the specified insputStream. - * @param inputStream the inputStream of the data graph. - * @param options loader control options, or null. - * @return the de-serialized data graph. - * @throws IOException - */ - public static DataGraph loadDataGraph(InputStream inputStream, Map options) throws IOException - { - ResourceSet resourceSet = DataObjectUtil.createResourceSet(); - Resource resource = resourceSet.createResource(URI.createURI("all.datagraph")); - resource.load(inputStream, options); - return (DataGraph)resource.getContents().get(0); - } - - /** - * Serialize the specified data graph to the specified outputStream. - * @param dataGraph the data graph to save. - * @param outputStream the outputStream for the data graph. - * @param options serializer control options, or null. - * @throws IOException - */ - public static void saveDataGraph(DataGraph dataGraph, OutputStream outputStream, Map options) throws IOException - { - ((DataGraphImpl)dataGraph).getDataGraphResource().save(outputStream, options); - } - - /** - * Create a new TypeHelper instance. The returned type helper will have visibility of types registered - * directly by calling a define method on it or by calling define on an associated XSDHelper. It will - * also have visibility of static types registered by calling SDOUtil.registerStaticTypes in the - * same classLoader scope. - * @return the new TypeHelper. - */ - public static TypeHelper createTypeHelper() - { - EPackage.Registry registry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE); - ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(registry); //TODO create subclass that makes demand() methods synchronous - return new TypeHelperImpl(extendedMetaData); - } - - /** - * Create a new DataFactory, with visibility to types in the specified TypeHelper scope. - * @param scope the TypeHelper to use for locating types. - * @return the new DataFactory. - */ - public static DataFactory createDataFactory(TypeHelper scope) - { - return new DataFactoryImpl(scope); - } - - /** - * Create a new XMLHelper, with visibility to types in the specified TypeHelper scope. - * @param scope the TypeHelper to use for locating types. - * @return the new XMLHelper. - */ - public static XMLHelper createXMLHelper(TypeHelper scope) - { - return new XMLHelperImpl(scope); - } - - /** - * Create a new XSDHelper, with visibility to types in the specified TypeHelper scope. - * @param scope the TypeHelper to use for locating and populating types. - * @return the new XSDHelper. - */ - public static XSDHelper createXSDHelper(TypeHelper scope) - { - return new XSDHelperImpl(scope); - } - - /** - * Register and initialize the SDO types supported by the specified generated factory class. - * This function must be called before instances of the generated types can be created/used. - * The registered types will be visible in all TypeHelper's created in the same classLoader - * scope as the call to this function. - * @param factoryClass the generated factory class. - */ - public static void registerStaticTypes(Class factoryClass) - { - //TODO this implementation is a temporary kludge until the SDO generated factory pattern is decided - String temp = factoryClass.getName().replaceFirst("Factory$", "PackageImpl"); - int lastDot = temp.lastIndexOf('.'); - String packageName = temp.substring(0, lastDot) + ".impl" + temp.substring(lastDot); - try - { - Class javaClass = factoryClass.getClassLoader().loadClass(packageName); - Field field = javaClass.getField("eINSTANCE"); - field.get(null); - } - catch (Exception e1) - { - packageName = factoryClass.getName().replaceFirst("Factory$", "Package"); - try - { - Class javaClass = factoryClass.getClassLoader().loadClass(packageName); - Field field = javaClass.getField("eINSTANCE"); - field.get(null); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - } - - /** - * Initialize SDO runtime. - */ - static - { - DataObjectUtil.initRuntime(); - } - -} diff --git a/tags/java-stable-20060304/sdo/impl/src/main/resources/META-INF/MANIFEST.MF b/tags/java-stable-20060304/sdo/impl/src/main/resources/META-INF/MANIFEST.MF deleted file mode 100644 index 240400a930..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/resources/META-INF/MANIFEST.MF +++ /dev/null @@ -1,19 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: SDO Runtime Implementation -Bundle-SymbolicName: org.apache.tuscany.sdo.impl -Bundle-Version: 1.0.0 -Bundle-Localization: plugin -Bundle-Vendor: Apache -Require-Bundle: org.eclipse.emf.common, - org.eclipse.emf.ecore, - org.eclipse.emf.ecore.change, - org.eclipse.emf.ecore.xmi, - org.eclipse.xsd, - org.apache.tuscany.sdo.spec;visibility:=reexport -Export-Package: commonj.sdo.impl, - org.apache.tuscany.sdo, - org.apache.tuscany.sdo.helper, - org.apache.tuscany.sdo.impl, - org.apache.tuscany.sdo.test, - org.apache.tuscany.sdo.util diff --git a/tags/java-stable-20060304/sdo/impl/src/main/resources/META-INF/services/commonj.sdo.impl.HelperProvider b/tags/java-stable-20060304/sdo/impl/src/main/resources/META-INF/services/commonj.sdo.impl.HelperProvider deleted file mode 100644 index 73693d6556..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/main/resources/META-INF/services/commonj.sdo.impl.HelperProvider +++ /dev/null @@ -1 +0,0 @@ -org.apache.tuscany.sdo.helper.HelperProviderImpl \ No newline at end of file diff --git a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Bar1.java b/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Bar1.java deleted file mode 100644 index f862837715..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Bar1.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.sdo.codegen; - -/** - * @version $Rev$ $Date$ - */ -public interface Bar1 { -} diff --git a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Bar2.java b/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Bar2.java deleted file mode 100644 index 35a878015f..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Bar2.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.sdo.codegen; - -/** - * @version $Rev$ $Date$ - */ -public interface Bar2 { -} diff --git a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/BytecodeInterfaceGeneratorTestCase.java b/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/BytecodeInterfaceGeneratorTestCase.java deleted file mode 100644 index 61f0ebd4fe..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/BytecodeInterfaceGeneratorTestCase.java +++ /dev/null @@ -1,164 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.sdo.codegen; - -import java.lang.reflect.Method; -import java.util.List; - -import junit.framework.TestCase; - -/** - * @version $Rev$ $Date$ - */ -public class BytecodeInterfaceGeneratorTestCase extends TestCase { - private MockType foo; - private BytecodeInterfaceGenerator gen; - private TestClassLoader cl; - - public void testHeaderNoBaseClass() { - gen.visitType(foo); - gen.visitEnd(); - Class c = cl.addClass(gen.getClassData()); - assertEquals("Foo", c.getName()); - assertTrue(c.isInterface()); - assertEquals(0, c.getInterfaces().length); - assertEquals(0, c.getMethods().length); - } - - public void testHeaderWithPackage() { - gen.visitType(new MockType("org.apache.Foo", null)); - gen.visitEnd(); - Class c = cl.addClass(gen.getClassData()); - assertEquals("org.apache.Foo", c.getName()); - assertEquals(0, c.getInterfaces().length); - assertEquals(0, c.getMethods().length); - } - - public void testHeaderOneBaseClass() throws NoJavaImplementationException { - foo.addBaseType(new MockType("bar1", Bar1.class)); - gen.visitType(foo); - gen.visitEnd(); - Class c = cl.addClass(gen.getClassData()); - assertEquals("Foo", c.getName()); - assertEquals(1, c.getInterfaces().length); - assertEquals(Bar1.class, c.getInterfaces()[0]); - assertEquals(0, c.getMethods().length); - } - - public void testHeaderMultipleBaseClass() throws NoJavaImplementationException { - foo.addBaseType(new MockType("bar1", Bar1.class)); - foo.addBaseType(new MockType("bar2", Bar2.class)); - gen.visitType(foo); - gen.visitEnd(); - Class c = cl.addClass(gen.getClassData()); - assertEquals("Foo", c.getName()); - assertEquals(2, c.getInterfaces().length); - assertEquals(Bar1.class, c.getInterfaces()[0]); - assertEquals(Bar2.class, c.getInterfaces()[1]); - assertEquals(0, c.getMethods().length); - } - - public void testBooleanProperty() throws NoJavaImplementationException, NoSuchMethodException { - gen.visitType(foo); - gen.visitProperty(new MockProperty("true", Boolean.TYPE, false, false)); - gen.visitEnd(); - Class c = cl.addClass(gen.getClassData()); - assertEquals(2, c.getMethods().length); - Method getter = c.getMethod("isTrue"); - assertEquals(boolean.class, getter.getReturnType()); - Method setter = c.getMethod("setTrue", boolean.class); - assertEquals(void.class, setter.getReturnType()); - } - - public void testByteArrayProperty() throws NoJavaImplementationException, NoSuchMethodException { - gen.visitType(foo); - gen.visitProperty(new MockProperty("bytes", byte[].class, false, false)); - gen.visitEnd(); - Class c = cl.addClass(gen.getClassData()); - assertEquals(2, c.getMethods().length); - Method getter = c.getMethod("getBytes"); - assertEquals(byte[].class, getter.getReturnType()); - Method setter = c.getMethod("setBytes", byte[].class); - assertEquals(void.class, setter.getReturnType()); - } - - public void testObjectProperty() throws NoJavaImplementationException, NoSuchMethodException { - gen.visitType(foo); - gen.visitProperty(new MockProperty("bar", Bar1.class, false, false)); - gen.visitEnd(); - Class c = cl.addClass(gen.getClassData()); - assertEquals(2, c.getMethods().length); - Method getter = c.getMethod("getBar"); - assertEquals(Bar1.class, getter.getReturnType()); - Method setter = c.getMethod("setBar", Bar1.class); - assertEquals(void.class, setter.getReturnType()); - } - - public void testReadOnlyProperty() throws NoJavaImplementationException, NoSuchMethodException { - gen.visitType(foo); - gen.visitProperty(new MockProperty("int", Integer.TYPE, false, true)); - gen.visitEnd(); - Class c = cl.addClass(gen.getClassData()); - assertEquals(1, c.getMethods().length); - Method getter = c.getMethod("getInt"); - assertEquals(int.class, getter.getReturnType()); - } - - public void testManyProperty() throws NoJavaImplementationException, NoSuchMethodException { - gen.visitType(foo); - gen.visitProperty(new MockProperty("list", Integer.TYPE, true, false)); - gen.visitEnd(); - Class c = cl.addClass(gen.getClassData()); - assertEquals(1, c.getMethods().length); - Method getter = c.getMethod("getList"); - assertEquals(List.class, getter.getReturnType()); - } - - public void testTwoProperties() throws NoJavaImplementationException, NoSuchMethodException { - gen.visitType(foo); - gen.visitProperty(new MockProperty("true", Boolean.TYPE, false, false)); - gen.visitProperty(new MockProperty("int", Integer.TYPE, false, false)); - gen.visitEnd(); - Class c = cl.addClass(gen.getClassData()); - assertEquals(4, c.getMethods().length); - Method getter = c.getMethod("isTrue"); - assertEquals(boolean.class, getter.getReturnType()); - Method setter = c.getMethod("setTrue", boolean.class); - assertEquals(void.class, setter.getReturnType()); - getter = c.getMethod("getInt"); - assertEquals(int.class, getter.getReturnType()); - setter = c.getMethod("setInt", int.class); - assertEquals(void.class, setter.getReturnType()); - } - - protected void setUp() throws Exception { - super.setUp(); - foo = new MockType("foo", null); - gen = new BytecodeInterfaceGenerator(); - cl = new TestClassLoader(); - } - - private class TestClassLoader extends ClassLoader { - public TestClassLoader() { - super(TestClassLoader.class.getClassLoader()); - } - - Class addClass(byte[] bytes) { - return defineClass(null, bytes, 0, bytes.length); - } - } -} diff --git a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Foo.java b/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Foo.java deleted file mode 100644 index 6a401d48bb..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Foo.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.sdo.codegen; - -/** - * @version $Rev$ $Date$ - */ -public interface Foo { -} diff --git a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/JavaInterfaceGeneratorTestCase.java b/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/JavaInterfaceGeneratorTestCase.java deleted file mode 100644 index ada15e151d..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/JavaInterfaceGeneratorTestCase.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.sdo.codegen; - -import java.io.PrintWriter; -import java.io.StringWriter; - -import junit.framework.TestCase; - -/** - * @version $Rev$ $Date$ - */ -public class JavaInterfaceGeneratorTestCase extends TestCase { - private static final String SEP = System.getProperty("line.separator"); - - private JavaInterfaceGenerator gen; - private StringWriter writer; - private MockType foo; - - public void testHeaderNoBaseClass() { - gen.visitType(foo); - gen.visitEnd(); - assertEquals(localize("public interface Foo {\n}\n"), writer.toString()); - } - - public void testHeaderWithPackage() { - gen.visitType(new MockType("org.apache.Foo", null)); - gen.visitEnd(); - assertEquals(localize("package org.apache;\n\npublic interface Foo {\n}\n"), writer.toString()); - } - - public void testHeaderOneBaseClass() throws NoJavaImplementationException { - foo.addBaseType(new MockType("bar1", Bar1.class)); - gen.visitType(foo); - gen.visitEnd(); - assertEquals(localize("public interface Foo extends org.apache.tuscany.sdo.codegen.Bar1 {\n}\n"), writer.toString()); - } - - public void testHeaderMultipleBaseClass() throws NoJavaImplementationException { - foo.addBaseType(new MockType("bar1", Bar1.class)); - foo.addBaseType(new MockType("bar2", Bar2.class)); - gen.visitType(foo); - gen.visitEnd(); - assertEquals(localize("public interface Foo extends org.apache.tuscany.sdo.codegen.Bar1, org.apache.tuscany.sdo.codegen.Bar2 {\n}\n"), writer.toString()); - } - - public void testBooleanProperty() throws NoJavaImplementationException { - gen.visitType(foo); - gen.visitProperty(new MockProperty("true", Boolean.TYPE, false, false)); - gen.visitEnd(); - assertEquals(localize("public interface Foo {\n\tboolean isTrue();\n\tvoid setTrue(boolean value);\n}\n"), writer.toString()); - } - - public void testByteArrayProperty() throws NoJavaImplementationException { - gen.visitType(foo); - gen.visitProperty(new MockProperty("bytes", byte[].class, false, false)); - gen.visitEnd(); - assertEquals(localize("public interface Foo {\n\tbyte[] getBytes();\n\tvoid setBytes(byte[] value);\n}\n"), writer.toString()); - } - - public void testObjectProperty() throws NoJavaImplementationException { - gen.visitType(foo); - gen.visitProperty(new MockProperty("bar", Bar1.class, false, false)); - gen.visitEnd(); - assertEquals(localize("public interface Foo {\n\torg.apache.tuscany.sdo.codegen.Bar1 getBar();\n\tvoid setBar(org.apache.tuscany.sdo.codegen.Bar1 value);\n}\n"), writer.toString()); - } - - public void testReadOnlyProperty() throws NoJavaImplementationException { - gen.visitType(foo); - gen.visitProperty(new MockProperty("int", Integer.TYPE, false, true)); - gen.visitEnd(); - assertEquals(localize("public interface Foo {\n\tint getInt();\n}\n"), writer.toString()); - } - - public void testManyProperty() throws NoJavaImplementationException { - gen.visitType(foo); - gen.visitProperty(new MockProperty("list", Integer.TYPE, true, false)); - gen.visitEnd(); - assertEquals(localize("public interface Foo {\n\tjava.util.List getList();\n}\n"), writer.toString()); - } - - public void testTwoProperties() throws NoJavaImplementationException { - gen.visitType(foo); - gen.visitProperty(new MockProperty("true", Boolean.TYPE, false, false)); - gen.visitProperty(new MockProperty("int", Integer.TYPE, false, false)); - gen.visitEnd(); - assertEquals(localize("public interface Foo {\n\tboolean isTrue();\n\tvoid setTrue(boolean value);\n\tint getInt();\n\tvoid setInt(int value);\n}\n"), writer.toString()); - } - - protected void setUp() throws Exception { - super.setUp(); - writer = new StringWriter(); - gen = new JavaInterfaceGenerator(new PrintWriter(writer)); - foo = new MockType("foo", null); - } - - private String localize(String s) { - StringBuilder b = new StringBuilder(s.length() + s.length()/10); - for (int i = 0; i < s.length(); i++) { - char ch = s.charAt(i); - if (ch == '\t') { - b.append(" "); - } else if (ch == '\n') { - b.append(SEP); - } else { - b.append(ch); - } - } - return b.toString(); - } - -} diff --git a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/MockProperty.java b/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/MockProperty.java deleted file mode 100644 index 5cee856217..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/MockProperty.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.sdo.codegen; - -import java.util.List; - -import commonj.sdo.Property; -import commonj.sdo.Type; - -/** - * @version $Rev$ $Date$ - */ -class MockProperty implements Property { - private final String name; - private final Type type; - private final boolean many; - private final boolean readOnly; - - public MockProperty(String name, Class type, boolean many, boolean readOnly) { - this.name = name; - this.type = new MockType(null, type); - this.many = many; - this.readOnly = readOnly; - } - - public String getName() { - return name; - } - - public Type getType() { - return type; - } - - public boolean isMany() { - return many; - } - - public boolean isContainment() { - throw new UnsupportedOperationException(); - } - - public Type getContainingType() { - throw new UnsupportedOperationException(); - } - - public Object getDefault() { - throw new UnsupportedOperationException(); - } - - public boolean isReadOnly() { - return readOnly; - } - - public Property getOpposite() { - throw new UnsupportedOperationException(); - } - - public List /*String*/ getAliasNames() { - throw new UnsupportedOperationException(); - } -} diff --git a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/MockType.java b/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/MockType.java deleted file mode 100644 index 7aa880b1e9..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/MockType.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation - * - * 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. - */ -package org.apache.tuscany.sdo.codegen; - -import java.util.List; -import java.util.ArrayList; - -import commonj.sdo.Type; -import commonj.sdo.Property; - -/** - * @version $Rev$ $Date$ - */ -class MockType implements Type { - private final String name; - private final Class javaClass; - private final List baseTypes = new ArrayList(); - - public MockType(String name, Class javaClass) { - this.javaClass = javaClass; - this.name = name; - } - - public void addBaseType(Type baseType) { - baseTypes.add(baseType); - } - - public String getName() { - return name; - } - - public String getURI() { - throw new UnsupportedOperationException(); - } - - public Class getInstanceClass() { - return javaClass; - } - - public boolean isInstance(Object object) { - throw new UnsupportedOperationException(); - } - - public List /*Property*/ getProperties() { - throw new UnsupportedOperationException(); - } - - public Property getProperty(String propertyName) { - throw new UnsupportedOperationException(); - } - - public boolean isDataType() { - throw new UnsupportedOperationException(); - } - - public boolean isOpen() { - throw new UnsupportedOperationException(); - } - - public boolean isSequenced() { - throw new UnsupportedOperationException(); - } - - public boolean isAbstract() { - throw new UnsupportedOperationException(); - } - - public List /*Type*/ getBaseTypes() { - return baseTypes; - } - - public List /*Property*/ getDeclaredProperties() { - throw new UnsupportedOperationException(); - } - - public List /*String*/ getAliasNames() { - throw new UnsupportedOperationException(); - } -} diff --git a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryTestCase.java b/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryTestCase.java deleted file mode 100644 index dbb6b7af46..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryTestCase.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.test; - - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.math.BigDecimal; -import java.net.URL; - -import commonj.sdo.ChangeSummary; -import commonj.sdo.DataGraph; -import commonj.sdo.DataObject; -import commonj.sdo.helper.XSDHelper; -import junit.framework.TestCase; - -import org.apache.tuscany.sdo.util.SDOUtil; - - -public class ChangeSummaryTestCase extends TestCase { - private final String TEST_MODEL = "/simple.xsd"; - private final String TEST_DATA = "/simplechangesummary.xml"; - - /** - * Simple ChangeSummary test. - */ - public void testChangeSummary() throws IOException { - // Create an empty data graph and add a root object, an instance of type Quote - // - - DataGraph dataGraph = SDOUtil.createDataGraph(); - DataObject quote = dataGraph.createRootObject("http://www.example.com/simple", "Quote"); - - // Begin logging changes - // - ChangeSummary changeSummary = dataGraph.getChangeSummary(); - changeSummary.beginLogging(); - - // Modify the data graph in various fun and interesting ways - // - quote.setString("symbol", "fbnt"); - quote.setString("companyName", "FlyByNightTechnology"); - quote.setBigDecimal("price", new BigDecimal("1000.0")); - quote.setBigDecimal("open1", new BigDecimal("1000.0")); - quote.setBigDecimal("high", new BigDecimal("1000.0")); - quote.setBigDecimal("low", new BigDecimal("1000.0")); - quote.setDouble("volume", 1000); - quote.setDouble("change1", 1000); - - DataObject child = quote.createDataObject("quotes"); - child.setBigDecimal("price", new BigDecimal("2000.0")); - - // Stop logging changes and print the resulting data graph to stdout - // - changeSummary.endLogging(); - - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - SDOUtil.saveDataGraph(dataGraph, baos, null); - - assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(TEST_DATA))); - } - - protected void setUp() throws Exception { - super.setUp(); - - // Populate the meta data for the test (Stock Quote) model - URL url = getClass().getResource(TEST_MODEL); - InputStream inputStream = url.openStream(); - XSDHelper.INSTANCE.define(inputStream, url.toString()); - inputStream.close(); - } -} diff --git a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DataTypeBaseTypeTestCase.java b/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DataTypeBaseTypeTestCase.java deleted file mode 100644 index faa8782a77..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DataTypeBaseTypeTestCase.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.test; - - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.util.List; - -import junit.framework.TestCase; - -import commonj.sdo.Type; -import commonj.sdo.helper.TypeHelper; -import commonj.sdo.helper.XSDHelper; - - -public class DataTypeBaseTypeTestCase extends TestCase { - private final String TEST_MODEL = "/datatype.xsd"; - private final String TEST_NAMESPACE = "http://www.example.com/datatype"; - - public void testSimpleSDOType() throws IOException - { - Type type = TypeHelper.INSTANCE.getType(TEST_NAMESPACE, "SimpleSDOType"); - List baseTypes = type.getBaseTypes(); - assertTrue(baseTypes.size() == 1); - } - - public void testSimpleSDOTypeInstanceClass() throws IOException - { - Type type = TypeHelper.INSTANCE.getType(TEST_NAMESPACE, "SimpleSDOTypeInstanceClass"); - List baseTypes = type.getBaseTypes(); - assertTrue(baseTypes.size() == 0); - } - - public void testSimpleSDOTypeExtendedInstanceClass() throws IOException - { - Type type = TypeHelper.INSTANCE.getType(TEST_NAMESPACE, "SimpleSDOTypeExtendedInstanceClass"); - List baseTypes = type.getBaseTypes(); - assertTrue(baseTypes.size() == 1); - } - - public void setUp() throws Exception - { - URL url = getClass().getResource(TEST_MODEL); - InputStream inputStream = url.openStream(); - XSDHelper.INSTANCE.define(inputStream, url.toString()); - inputStream.close(); - } - -} diff --git a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/MixedTypeTestCase.java b/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/MixedTypeTestCase.java deleted file mode 100644 index e46f9858e2..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/MixedTypeTestCase.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.test; - - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.math.BigDecimal; -import java.net.URL; - -import commonj.sdo.DataObject; -import commonj.sdo.Sequence; -import commonj.sdo.Type; -import commonj.sdo.helper.DataFactory; -import commonj.sdo.helper.TypeHelper; -import commonj.sdo.helper.XMLHelper; -import commonj.sdo.helper.XSDHelper; -import junit.framework.TestCase; - - -public class MixedTypeTestCase extends TestCase { - private final String TEST_MODEL = "/mixed.xsd"; - private final String TEST_NAMESPACE = "http://www.example.com/mixed"; - private final String TEST_DATA = "/mixed.xml"; - - /** - * Sequenced type SDO 2 test. - */ - public void testSequencedType() throws IOException { - Type quoteType = TypeHelper.INSTANCE.getType(TEST_NAMESPACE, "MixedQuote"); - DataObject quote = DataFactory.INSTANCE.create(quoteType); - - Sequence sequence = quote.getSequence(); - - sequence.add("\n "); - - quote.setString("symbol", "fbnt"); - - sequence.add("\n "); - - quote.setString("companyName", "FlyByNightTechnology"); - - sequence.add("\n some text\n "); - - DataObject child = quote.createDataObject("quotes"); - child.setBigDecimal("price", new BigDecimal("2000.0")); - - sequence.add("\n more text\n "); - - // quote.setBigDecimal("price", new BigDecimal("1000.0")); - sequence.add("price", new BigDecimal("1000.0")); - - sequence.add("\n"); - - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - XMLHelper.INSTANCE.save(quote, TEST_NAMESPACE, "mixedStockQuote", baos); - - assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(TEST_DATA))); - } - - protected void setUp() throws Exception { - super.setUp(); - - // Populate the meta data for the test (Stock Quote) model - URL url = getClass().getResource(TEST_MODEL); - InputStream inputStream = url.openStream(); - XSDHelper.INSTANCE.define(inputStream, url.toString()); - inputStream.close(); - } -} diff --git a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/OpenTypeTestCase.java b/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/OpenTypeTestCase.java deleted file mode 100644 index 7e743e296a..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/OpenTypeTestCase.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.test; - - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.math.BigDecimal; -import java.net.URL; -import java.util.Iterator; - -import commonj.sdo.DataObject; -import commonj.sdo.Property; -import commonj.sdo.Type; -import commonj.sdo.helper.DataFactory; -import commonj.sdo.helper.TypeHelper; -import commonj.sdo.helper.XMLHelper; -import commonj.sdo.helper.XSDHelper; -import junit.framework.TestCase; - - -public class OpenTypeTestCase extends TestCase { - private final String TEST_MODEL = "/open.xsd"; - private final String TEST_NAMESPACE = "http://www.example.com/open"; - private final String TEST_DATA = "/open.xml"; - - /** - * Open content SDO 2 test. - */ - public void testOpenType() throws IOException { - Type quoteType = TypeHelper.INSTANCE.getType(TEST_NAMESPACE, "OpenQuote"); - DataObject quote = DataFactory.INSTANCE.create(quoteType); - - quote.setString("symbol", "s1"); - - for (Iterator iter = quote.getInstanceProperties().iterator(); iter.hasNext();) { - Property property = (Property) iter.next(); - } - - Property companyProperty = XSDHelper.INSTANCE.getGlobalProperty(TEST_NAMESPACE, "company", true); - DataObject company = quote.createDataObject(companyProperty); - company.setString("name", "FlyByNightTechnology"); - - Property priceProperty = XSDHelper.INSTANCE.getGlobalProperty(TEST_NAMESPACE, "price", true); - quote.getList(priceProperty).add(new BigDecimal("1000.0")); - - for (Iterator iter = quote.getInstanceProperties().iterator(); iter.hasNext();) { - Property property = (Property) iter.next(); - } - - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - XMLHelper.INSTANCE.save(quote, TEST_NAMESPACE, "openStockQuote", baos); - - assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(TEST_DATA))); - } - - protected void setUp() throws Exception { - super.setUp(); - - // Populate the meta data for the test (Stock Quote) model - URL url = getClass().getResource(TEST_MODEL); - InputStream inputStream = url.openStream(); - XSDHelper.INSTANCE.define(inputStream, url.toString()); - inputStream.close(); - } -} diff --git a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleCopyTestCase.java b/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleCopyTestCase.java deleted file mode 100644 index 2e91a1a66f..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleCopyTestCase.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.test; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; - -import commonj.sdo.DataObject; -import commonj.sdo.helper.CopyHelper; -import commonj.sdo.helper.XMLDocument; -import commonj.sdo.helper.XMLHelper; -import commonj.sdo.helper.XSDHelper; -import junit.framework.TestCase; - -public class SimpleCopyTestCase extends TestCase { - - private final String TEST_MODEL = "/simple.xsd"; - private final String TEST_NAMESPACE = "http://www.example.com/simple"; - private final String QUOTE_XML = "/quote.xml"; - private final String SHALLOW_QUOTE_XML = "/shallowquote.xml"; - - public void testSimpleCopy() throws IOException { - XMLDocument doc = XMLHelper.INSTANCE.load(getClass().getResourceAsStream(QUOTE_XML)); - DataObject sdo = doc.getRootObject(); - - DataObject copiedSdo = CopyHelper.INSTANCE.copyShallow(sdo); - - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - XMLHelper.INSTANCE.save(copiedSdo, TEST_NAMESPACE, "stockQuote", baos); - assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(SHALLOW_QUOTE_XML))); - assertFalse(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(QUOTE_XML))); - - copiedSdo = CopyHelper.INSTANCE.copy(sdo); - - baos.reset(); - XMLHelper.INSTANCE.save(copiedSdo, TEST_NAMESPACE, "stockQuote", baos); - assertFalse(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(SHALLOW_QUOTE_XML))); - assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(QUOTE_XML))); - } - - protected void setUp() throws Exception { - super.setUp(); - - // Populate the meta data for the test (Stock Quote) model - URL url = getClass().getResource(TEST_MODEL); - InputStream inputStream = url.openStream(); - XSDHelper.INSTANCE.define(inputStream, url.toString()); - inputStream.close(); - } - -} diff --git a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleDynamicTestCase.java b/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleDynamicTestCase.java deleted file mode 100644 index d4f425457f..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleDynamicTestCase.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.test; - - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.File; -import java.io.FileInputStream; -import java.math.BigDecimal; -import java.net.URL; - -import commonj.sdo.DataObject; -import commonj.sdo.Type; -import commonj.sdo.helper.DataFactory; -import commonj.sdo.helper.TypeHelper; -import commonj.sdo.helper.XMLDocument; -import commonj.sdo.helper.XMLHelper; -import commonj.sdo.helper.XSDHelper; -import junit.framework.TestCase; - - -public class SimpleDynamicTestCase extends TestCase { - private final String TEST_MODEL = "/simple.xsd"; - private final String TEST_NAMESPACE = "http://www.example.com/simple"; - private final String QUOTE_XML = "/quote.xml"; - - /** - * Simple Dynamic SDO 2 test. - */ - public void testDynamic() throws IOException { - Type quoteType = TypeHelper.INSTANCE.getType(TEST_NAMESPACE, "Quote"); - DataObject quote = DataFactory.INSTANCE.create(quoteType); - - quote.setString("symbol", "fbnt"); - quote.setString("companyName", "FlyByNightTechnology"); - quote.setBigDecimal("price", new BigDecimal("1000.0")); - quote.setBigDecimal("open1", new BigDecimal("1000.0")); - quote.setBigDecimal("high", new BigDecimal("1000.0")); - quote.setBigDecimal("low", new BigDecimal("1000.0")); - quote.setDouble("volume", 1000); - quote.setDouble("change1", 1000); - - DataObject child = quote.createDataObject("quotes"); - child.setBigDecimal("price", new BigDecimal("2000.0")); - - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - XMLHelper.INSTANCE.save(quote, TEST_NAMESPACE, "stockQuote", baos); - - assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(QUOTE_XML))); - } - - - protected void setUp() throws Exception { - super.setUp(); - - // Populate the meta data for the test (Stock Quote) model - URL url = getClass().getResource(TEST_MODEL); - InputStream inputStream = url.openStream(); - XSDHelper.INSTANCE.define(inputStream, url.toString()); - inputStream.close(); - } - -} diff --git a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleEqualityTestCase.java b/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleEqualityTestCase.java deleted file mode 100644 index ac05b362d9..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleEqualityTestCase.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.test; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; - -import commonj.sdo.DataObject; -import commonj.sdo.helper.EqualityHelper; -import commonj.sdo.helper.XMLDocument; -import commonj.sdo.helper.XMLHelper; -import commonj.sdo.helper.XSDHelper; -import junit.framework.TestCase; - -public class SimpleEqualityTestCase extends TestCase { - private static final String TEST_MODEL = "/simple.xsd"; - private static final String QUOTE_XML = "/quote.xml"; - private static final String SHALLOW_QUOTE_XML = "/shallowquote.xml"; - - public void testEquality() throws IOException { - - XMLDocument doc = XMLHelper.INSTANCE.load(getClass().getResourceAsStream(QUOTE_XML)); - DataObject sdo = doc.getRootObject(); - - doc = XMLHelper.INSTANCE.load(getClass().getResourceAsStream(SHALLOW_QUOTE_XML)); - DataObject shallowSdo = doc.getRootObject(); - - boolean result = EqualityHelper.INSTANCE.equalShallow(sdo, shallowSdo); - assertTrue(result); - - result = EqualityHelper.INSTANCE.equal(sdo, shallowSdo); - assertFalse(result); - } - - - protected void setUp() throws Exception { - super.setUp(); - - // Populate the meta data for the test (Stock Quote) model - URL url = getClass().getResource(TEST_MODEL); - InputStream inputStream = url.openStream(); - XSDHelper.INSTANCE.define(inputStream, url.toString()); - inputStream.close(); - } -} diff --git a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TestUtil.java b/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TestUtil.java deleted file mode 100644 index a377281622..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TestUtil.java +++ /dev/null @@ -1,168 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.test; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.FactoryConfigurationError; -import javax.xml.parsers.ParserConfigurationException; - -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; - -public class TestUtil -{ - private static void getAllNodes(NodeList nodeList, List nodes) - { - int length = nodeList.getLength(); - if (length == 0) - { - return; - } - - for (int i=0; i sourceNodes = new ArrayList(); - ArrayList targetNodes = new ArrayList(); - - getAllNodes(sourceNodeList, sourceNodes); - getAllNodes(targetNodeList, targetNodes); - - int sourceLength = sourceNodes.size(); - int targetLength = targetNodes.size(); - - if (sourceLength != targetLength) - { - return false; - } - - for (int i=0; i types = XSDHelper.INSTANCE.define(modelURL.openStream(), modelURL.toString()); - assertEquals(2, types.size()); - } - - public void testDefineWithNoLocation() { - List types = XSDHelper.INSTANCE.define(getClass().getResourceAsStream(TEST_MODEL), null); - assertEquals(2, types.size()); - } - - public void testDuplicateDefineWithLocation() throws IOException { - List types = XSDHelper.INSTANCE.define(modelURL.openStream(), modelURL.toString()); - assertEquals(2, types.size()); - - List types2 = XSDHelper.INSTANCE.define(modelURL.openStream(), modelURL.toString()); - assertEquals(types, types2); - } - - protected void setUp() throws Exception { - super.setUp(); - modelURL = getClass().getResource(TEST_MODEL); - } -} diff --git a/tags/java-stable-20060304/sdo/impl/src/test/resources/datatype.xsd b/tags/java-stable-20060304/sdo/impl/src/test/resources/datatype.xsd deleted file mode 100644 index 73b2c25e79..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/resources/datatype.xsd +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sdo/impl/src/test/resources/mixed.xml b/tags/java-stable-20060304/sdo/impl/src/test/resources/mixed.xml deleted file mode 100644 index 42ff3a3a5b..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/resources/mixed.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - fbnt - FlyByNightTechnology - some text - 2000.0 - more text - 1000.0 - \ No newline at end of file diff --git a/tags/java-stable-20060304/sdo/impl/src/test/resources/mixed.xsd b/tags/java-stable-20060304/sdo/impl/src/test/resources/mixed.xsd deleted file mode 100644 index d4881d915e..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/resources/mixed.xsd +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sdo/impl/src/test/resources/open.xml b/tags/java-stable-20060304/sdo/impl/src/test/resources/open.xml deleted file mode 100644 index d4a5b92e0c..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/resources/open.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - s1 - - FlyByNightTechnology - - 1000.0 - \ No newline at end of file diff --git a/tags/java-stable-20060304/sdo/impl/src/test/resources/open.xsd b/tags/java-stable-20060304/sdo/impl/src/test/resources/open.xsd deleted file mode 100644 index bac23dd051..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/resources/open.xsd +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sdo/impl/src/test/resources/quote.xml b/tags/java-stable-20060304/sdo/impl/src/test/resources/quote.xml deleted file mode 100644 index d7b5969e23..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/resources/quote.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - fbnt - FlyByNightTechnology - 1000.0 - 1000.0 - 1000.0 - 1000.0 - 1000.0 - 1000.0 - - 2000.0 - - \ No newline at end of file diff --git a/tags/java-stable-20060304/sdo/impl/src/test/resources/shallowquote.xml b/tags/java-stable-20060304/sdo/impl/src/test/resources/shallowquote.xml deleted file mode 100644 index a56f2fe2b7..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/resources/shallowquote.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - fbnt - FlyByNightTechnology - 1000.0 - 1000.0 - 1000.0 - 1000.0 - 1000.0 - 1000.0 - \ No newline at end of file diff --git a/tags/java-stable-20060304/sdo/impl/src/test/resources/simple.xsd b/tags/java-stable-20060304/sdo/impl/src/test/resources/simple.xsd deleted file mode 100644 index f5b0b982af..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/resources/simple.xsd +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sdo/impl/src/test/resources/simplechangesummary.xml b/tags/java-stable-20060304/sdo/impl/src/test/resources/simplechangesummary.xml deleted file mode 100644 index 7ac7a7cb2a..0000000000 --- a/tags/java-stable-20060304/sdo/impl/src/test/resources/simplechangesummary.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - fbnt - FlyByNightTechnology - 1000.0 - 1000.0 - 1000.0 - 1000.0 - 1000.0 - 1000.0 - - 2000.0 - - - diff --git a/tags/java-stable-20060304/sdo/plugin/pom.xml b/tags/java-stable-20060304/sdo/plugin/pom.xml deleted file mode 100644 index 925c1de881..0000000000 --- a/tags/java-stable-20060304/sdo/plugin/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - org.apache.tuscany - tuscany-sdo - SNAPSHOT - - 4.0.0 - tuscany-sdo-plugin - maven-plugin - SNAPSHOT - Tuscany SDO Maven Plugin - - - - org.apache.maven - maven-plugin-api - 2.0 - - - org.apache.tuscany - tuscany-sdo-tools - ${pom.version} - compile - - - diff --git a/tags/java-stable-20060304/sdo/plugin/src/main/java/org/apache/tuscany/sdo/plugin/GeneratorMojo.java b/tags/java-stable-20060304/sdo/plugin/src/main/java/org/apache/tuscany/sdo/plugin/GeneratorMojo.java deleted file mode 100644 index 9ded67e657..0000000000 --- a/tags/java-stable-20060304/sdo/plugin/src/main/java/org/apache/tuscany/sdo/plugin/GeneratorMojo.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * - * Copyright 2005 BEA Systems Inc. - * Copyright 2005 International Business Machines Corporation - * - * 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. - */ -package org.apache.tuscany.sdo.plugin; - -import java.io.File; -import java.io.FileFilter; -import java.io.IOException; -import java.util.List; - -import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; - -import org.apache.tuscany.sdo.generate.JavaGenerator; - -/** - * @version $Rev$ $Date$ - * @goal generate - * @phase generate-sources - * @description Generate SDO interface classes from an XML Schema - */ -public class GeneratorMojo extends AbstractMojo { - /** - * The directory containing schema files; defaults to ${basedir}/src/main/xsd - * @parameter expression="${basedir}/src/main/xsd" - */ - private String schemaDir; - - /** - * Name of the schema file; if omitted all files in the directory are processed - * @parameter - */ - private File schemaFile; - - /** - * The Java package to generate into. By default the value is derived from the schema URI. - * - * @parameter - */ - private String javaPackage; - - /** - * The directory to generate into; defaults to ${project.build.directory}/sdo-source - * - * @parameter expression="${project.build.directory}/sdo-source" - */ - private String targetDirectory; - - /** - * Specifies the prefix string to use for naming the generated factory. - * @parameter - */ - private String prefix; - - /** - * This option can be used to eliminate the generated interface and to generate only an implementation class. - * @parameter - */ - private boolean noInterfaces; - - /** - * Turns off container management for containment properties. - * @parameter - */ - private boolean noContainment; - - /** - * This option eliminates all change notification overhead in the generated classes. - * @parameter - */ - private boolean noNotification; - - /** - * With this option, all generated properties will not record their unset state. - * @parameter - */ - private boolean noUnsettable; - - /** - * Generate a fast XML parser/loader for instances of the model. - * @parameter - */ - private boolean generateLoader; - - /** - * Generate a Switch class for the model. - * @parameter - */ - private boolean generateSwitch; - - /** - * @parameter expression="${project.compileSourceRoots}" - * @readonly - */ - private List compilerSourceRoots; - - public void execute() throws MojoExecutionException { - File[] files; - if (schemaFile == null) { - files = new File(schemaDir).listFiles(FILTER); - } else { - files = new File[]{schemaFile}; - } - - int genOptions = 0; - if (noInterfaces) { - genOptions |= JavaGenerator.OPTION_NO_INTERFACES; - } - if (noContainment) { - genOptions |= JavaGenerator.OPTION_NO_CONTAINMENT; - } - if (noNotification) { - genOptions |= JavaGenerator.OPTION_NO_NOTIFICATION; - } - if (generateLoader) { - genOptions |= JavaGenerator.OPTION_GENERATE_LOADER; - } - if (noUnsettable) { - genOptions |= JavaGenerator.OPTION_NO_UNSETTABLE; - } - if (generateSwitch) { - genOptions |= JavaGenerator.OPTION_GENERATE_SWITCH; - } - - for (int i = 0; i < files.length; i++) { - File file = files[i]; - File marker = new File(targetDirectory, ".gen#" + file.getName()); - if (file.lastModified() > marker.lastModified()) { - getLog().info("Generating SDO interfaces from " + file); - JavaGenerator.generateFromXMLSchema(file.toString(), targetDirectory, javaPackage, prefix, genOptions); - } - try { - marker.createNewFile(); - } catch (IOException e) { - throw new MojoExecutionException(e.getMessage(), e); - } - marker.setLastModified(System.currentTimeMillis()); - } - - compilerSourceRoots.add(targetDirectory); - } - - private static final FileFilter FILTER = new FileFilter() { - public boolean accept(File pathname) { - return (pathname.isFile() || !pathname.isHidden()); - } - }; -} \ No newline at end of file diff --git a/tags/java-stable-20060304/sdo/pom.xml b/tags/java-stable-20060304/sdo/pom.xml deleted file mode 100644 index 32a072fa46..0000000000 --- a/tags/java-stable-20060304/sdo/pom.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - org.apache.tuscany - tuscany-project - SNAPSHOT - - 4.0.0 - tuscany-sdo - pom - Tuscany SDO Implementation Project - SNAPSHOT - - - impl - tools - plugin - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*TestCase.java - - - - - - diff --git a/tags/java-stable-20060304/sdo/tools/.settings/org.eclipse.core.resources.prefs b/tags/java-stable-20060304/sdo/tools/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index f7f32994f2..0000000000 --- a/tags/java-stable-20060304/sdo/tools/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Mon Nov 28 13:32:35 EST 2005 -eclipse.preferences.version=1 -encoding//src/test/resources/enum.xsd=UTF8 -encoding//src/test/resources/simple.xsd=UTF8 diff --git a/tags/java-stable-20060304/sdo/tools/LICENSE.txt b/tags/java-stable-20060304/sdo/tools/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/tags/java-stable-20060304/sdo/tools/LICENSE.txt +++ /dev/null @@ -1,202 +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/tags/java-stable-20060304/sdo/tools/pom.xml b/tags/java-stable-20060304/sdo/tools/pom.xml deleted file mode 100644 index 7a87b1392c..0000000000 --- a/tags/java-stable-20060304/sdo/tools/pom.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - org.apache.tuscany - tuscany-sdo - SNAPSHOT - - 4.0.0 - tuscany-sdo-tools - Tuscany SDO Tools - SDO Tools. - SNAPSHOT - - - - jeremy - http://people.apache.org/~jboynes/maven2 - - false - - - - - - - org.apache.tuscany - tuscany-sdo-impl - SNAPSHOT - compile - - - - org.eclipse.emf - codegen - 2.2.0-I200602160000 - compile - - - - org.eclipse.emf - codegen-ecore - 2.2.0-I200602160000 - compile - - - - junit - junit - 3.8.1 - test - - - diff --git a/tags/java-stable-20060304/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java b/tags/java-stable-20060304/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java deleted file mode 100644 index 517f150c09..0000000000 --- a/tags/java-stable-20060304/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java +++ /dev/null @@ -1,535 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.generate; - - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.StringTokenizer; - -import org.apache.tuscany.sdo.helper.XSDHelperImpl; -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.eclipse.emf.codegen.ecore.genmodel.GenClass; -import org.eclipse.emf.codegen.ecore.genmodel.GenDelegationKind; -import org.eclipse.emf.codegen.ecore.genmodel.GenModel; -import org.eclipse.emf.codegen.ecore.genmodel.GenModelFactory; -import org.eclipse.emf.codegen.ecore.genmodel.GenPackage; -import org.eclipse.emf.codegen.ecore.genmodel.GenResourceKind; -import org.eclipse.emf.codegen.util.CodeGenUtil; -import org.eclipse.emf.common.util.BasicMonitor; -import org.eclipse.emf.common.util.Diagnostic; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.util.BasicExtendedMetaData; -import org.eclipse.emf.ecore.util.Diagnostician; -import org.eclipse.emf.ecore.util.ExtendedMetaData; -import org.eclipse.xsd.XSDSchema; -import org.eclipse.xsd.util.XSDResourceImpl; - -import commonj.sdo.helper.XSDHelper; - - -public class JavaGenerator -{ - public static int OPTION_NO_INTERFACES=0x1; - public static int OPTION_SPARSE_PATTERN=0x2; - public static int OPTION_STORE_PATTERN=0x4; - public static int OPTION_NO_CONTAINMENT=0x8; - public static int OPTION_NO_NOTIFICATION=0x10; - public static int OPTION_ARRAY_ACCESSORS=0x20; - public static int OPTION_GENERATE_LOADER=0x40; - public static int OPTION_NO_UNSETTABLE=0x80; - //FIXME Temporary, I need this option for now to get Switch classes generated for the SCDL models - public static int OPTION_GENERATE_SWITCH=0x100; - - /** - * Generate static SDOs from XML Schema - * - * Usage arguments: - * - * [ -targetDirectory ] - * [ -javaPackage ] - * [ -prefix ] - * [ -sparsePattern | -storePattern ] - * [ -noInterfaces ] - * [ -noContainment ] - * [ -noNotification ] - * [ -arrayAccessors ] - * [ -generateLoader ] - * [ -noUnsettable ] - * | - * - * For example: - * - * generate somedir/somefile.xsd - * - * Basic options: - * - * -targetDirectory - * Generates the Java source code in the specified directory. By default, the code is generated - * in the same directory as the input xsd or wsdl file. - * -javaPackage - * Overrides the Java package for the generated classes. By default the package name is derived - * from the targetNamespace of the XML schema being generated. For example, if the targetNamespace is - * "http://www.example.com/simple", the default package will be "com.example.simple". - * -prefix - * Specifies the prefix string to use for naming the generated factory. For example "-prefix Foo" will - * result in a factory interface with the name "FooFactory". - * -sparsePattern - * For SDO metamodels that have classes with many properties of which only a few are typically set at - * runtime, this option can be used to produce a space-optimized implementation (at the expense of speed). - * -storePattern - * This option can be used to generate static classes that work with a Store-based DataObject - * implementation. It changes the generator pattern to generate accessors which delegate to the - * reflective methods (as opposed to the other way around) and changes the DataObject base class - * to org.apache.tuscany.sdo.impl.StoreDataObjectImpl. Note that this option generates classes that - * require a Store implementation to be provided before they can be run. - * - * The following options can be used to increase performance, but with some loss of SDO functionality: - * - * -noInterfaces - * By default, each DataObject generates both a Java interface and a corresponding implementation - * class. If an SDO metamodel does not use multiple inheritance (which is always the case for - * XML Schema derived models), then this option can be used to eliminate the interface and to generate - * only an implementation class. - * - * Following are planned but not supported yet: - * - * -noNotification - * This option eliminates all change notification overhead in the generated classes. Changes to - * DataObjects generated using this option cannot be recorded, and consequently the classes cannot - * be used with an SDO ChangeSummary or DataGraph. - * -noContainment - * Turns off container management for containment properties. DataObject.getContainer() will always - * return null for data objects generated with this option, even if a containment reference is set. - * Setting a containment reference will also not automatically remove the target object from its - * previous container, if it had one, so it will need to be explicitly removed by the client. Use - * of this option is only recommended for scenarios where this kind of container movement/management - * is not necessary. - * -arrayAccessors - * Generates Java array getters/setters for multiplicity-many properties. With this option, - * the set of "standard" JavaBean array accessor methods (e.g., Foo[] getFoo(), Foo getFoo(int), - * int getFooLength(), setFoo(Foo[]), and void setFoo(int, Foo)) are generated. The normal - * List-returning accessor is renamed with the suffix "List" (e.g., List getFooList()). The array - * returned by the generated method is not a copy, but instead a pointer to the underlying storage - * array, so directly modifying it can have undesirable consequences and should be avoided. - * -generateLoader - * Generate a fast XML parser/loader for instances of the model. The details of this option are - * subject to change, but currently it generates two additional classes in a "util" package: - * ResourceImpl and ResourceFactoryImpl. To use the generated loader at runtime, - * you need to pass an option to the XMLHelper.load() method like this: - * Map options = new HashMap(); - * options.put("GENERATED_LOADER", ResourceFactoryImpl.class); - * XMLDocument doc = XMLHelper.INSTANCE.load(new FileInputStream("somefile.xml"), null, options); - * Note: this option currently only works for simple schemas without substitution groups or wildcards. - * -noUnsettable - * By default, some XML constructs result in SDO property implementations that maintain additional - * state information to record when the property has been set to the "default value", as opposed to - * being truly unset (see DataObject.isSet() and DataObject.unset()). The SDO specification allows an - * implementation to choose to provide this behavior or not. With this option, all generated properties - * will not record their unset state. The generated isSet() methods simply returns whether the current - * value is equal to the property's "default value". - */ - public static void main(String args[]) - { - if (args.length == 0) - { - printUsage(); - return; - } - - String targetDirectory = null; - String javaPackage = null; - String prefix = null; - - int genOptions = 0; - - int index = 0; - for (; index < args.length && args[index].startsWith("-"); ++index) - { - if (args[index].equalsIgnoreCase("-targetDirectory")) - { - targetDirectory = args[++index]; - } - else if (args[index].equalsIgnoreCase("-javaPackage")) - { - javaPackage = args[++index]; - } - else if (args[index].equalsIgnoreCase("-prefix")) - { - prefix = args[++index]; - } - else if (args[index].equalsIgnoreCase("-noInterfaces")) - { - genOptions |= OPTION_NO_INTERFACES; - } - else if (args[index].equalsIgnoreCase("-sparsePattern")) - { - genOptions |= OPTION_SPARSE_PATTERN; - } - else if (args[index].equalsIgnoreCase("-storePattern")) - { - genOptions |= OPTION_STORE_PATTERN; - } - else if (args[index].equalsIgnoreCase("-noContainment")) - { - genOptions |= OPTION_NO_CONTAINMENT; - } - else if (args[index].equalsIgnoreCase("-noNotification")) - { - genOptions |= OPTION_NO_NOTIFICATION; - } - else if (args[index].equalsIgnoreCase("-arrayAccessors")) - { - genOptions |= OPTION_ARRAY_ACCESSORS; - } - else if (args[index].equalsIgnoreCase("-generateLoader")) - { - genOptions |= OPTION_GENERATE_LOADER; - } - else if (args[index].equalsIgnoreCase("-noUnsettable")) - { - genOptions |= OPTION_NO_UNSETTABLE; - } - //else if (...) - else - { - printUsage(); - return; - } - } - - String xsdFileName = args[index]; - - generateFromXMLSchema(xsdFileName, targetDirectory, javaPackage, prefix, genOptions); - } - - public static void generateFromXMLSchema(String xsdFileName, String targetDirectory, String javaPackage, String prefix, int genOptions) - { - DataObjectUtil.initRuntime(); - EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE) - { - public EPackage firstPackage = null; - - }; - ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(packageRegistry); - XSDHelper xsdHelper = new XSDHelperImpl(extendedMetaData); - - try - { - File inputFile = new File(xsdFileName).getAbsoluteFile(); - InputStream inputStream = new FileInputStream(inputFile); - xsdHelper.define(inputStream, inputFile.toURI().toString()); - - if (targetDirectory == null) - { - targetDirectory = new File(xsdFileName).getCanonicalFile().getParent(); - } - else - { - targetDirectory = new File(targetDirectory).getCanonicalPath(); - } - - if (!packageRegistry.values().isEmpty()) - { - String packageURI = getSchemaNamespace(xsdFileName); - ResourceSet resourceSet = DataObjectUtil.createResourceSet(); - - List usedGenPackages = new ArrayList(); - GenModel genModel = null; - - for (Iterator iter = packageRegistry.values().iterator(); iter.hasNext();) - { - EPackage currentEPackage = (EPackage)iter.next(); - String currentBasePackage = extractBasePackageName(currentEPackage, javaPackage); - String currentPrefix = prefix == null ? CodeGenUtil.capName(currentEPackage.getName()) : prefix; - - GenPackage currentGenPackage = createGenPackage(currentEPackage, currentBasePackage, currentPrefix, genOptions, resourceSet); - if (currentEPackage.getNsURI().equals(packageURI)) - { - genModel = currentGenPackage.getGenModel(); - } - else - { - usedGenPackages.add(currentGenPackage); - } - } - - genModel.getUsedGenPackages().addAll(usedGenPackages); - generateFromGenModel(genModel, targetDirectory); - } - - /* - for (Iterator iter = packageRegistry.values().iterator(); iter.hasNext();) - { - EPackage ePackage = (EPackage)iter.next(); - String basePackage = extractBasePackageName(ePackage, javaPackage); - if (prefix == null) - { - prefix = CodeGenUtil.capName(ePackage.getName()); - } - generateFromEPackage(ePackage, targetDirectory, basePackage, prefix, genOptions); - } - */ - } - catch (IOException e) - { - e.printStackTrace(); - } - } - - public static String getSchemaNamespace(String xsdFileName) - { - File inputFile = new File(xsdFileName).getAbsoluteFile(); - ResourceSet resourceSet = DataObjectUtil.createResourceSet(); - Resource model = resourceSet.createResource(URI.createURI(inputFile.toURI().toString())); - try { - InputStream inputStream = new FileInputStream(inputFile); - ((XSDResourceImpl)model).load(inputStream, null); - } - catch (Exception e) {} - XSDSchema schema = (XSDSchema)model.getContents().get(0); - return schema.getTargetNamespace(); - - } - - public static GenPackage createGenPackage(EPackage ePackage, String basePackage, String prefix, int genOptions, ResourceSet resourceSet) - { - GenModel genModel = ecore2GenModel(ePackage, basePackage, prefix, genOptions); - - URI ecoreURI = URI.createURI("file:///" + ePackage.getName() + ".ecore"); - URI genModelURI = ecoreURI.trimFileExtension().appendFileExtension("genmodel"); - - Resource ecoreResource = resourceSet.createResource(ecoreURI); - ecoreResource.getContents().add(ePackage); - - Resource genModelResource = resourceSet.createResource(genModelURI); - genModelResource.getContents().add(genModel); - - return (GenPackage)genModel.getGenPackages().get(0); - } - - public static void generateFromEPackage(EPackage ePackage, String targetDirectory, String basePackage, String prefix, int genOptions) - { - GenModel genModel = ecore2GenModel(ePackage, basePackage, prefix, genOptions); - - ResourceSet resourceSet = DataObjectUtil.createResourceSet(); - URI ecoreURI = URI.createURI("file:///temp.ecore"); - URI genModelURI = ecoreURI.trimFileExtension().appendFileExtension("genmodel"); - - Resource ecoreResource = resourceSet.createResource(ecoreURI); - ecoreResource.getContents().add(ePackage); - - Resource genModelResource = resourceSet.createResource(genModelURI); - genModelResource.getContents().add(genModel); - - generateFromGenModel(genModel, targetDirectory); - } - - public static void generateFromGenModel(GenModel genModel, String targetDirectory) - { - Resource resource = genModel.eResource(); - - if (targetDirectory != null) - { - resource.getResourceSet().getURIConverter().getURIMap().put( - URI.createURI("platform:/resource/TargetProject/"), - URI.createFileURI(targetDirectory + "/")); - genModel.setModelDirectory("/TargetProject"); - } - - genModel.gen(new BasicMonitor.Printing(System.out)); - - for (Iterator j = resource.getContents().iterator(); j.hasNext();) - { - EObject eObject = (EObject)j.next(); - Diagnostic diagnostic = Diagnostician.INSTANCE.validate(eObject); - if (diagnostic.getSeverity() != Diagnostic.OK) - { - printDiagnostic(diagnostic, ""); - } - } - } - - public static GenModel ecore2GenModel(EPackage ePackage, String basePackage, String prefix, int genOptions) - { - GenModel genModel = GenModelFactory.eINSTANCE.createGenModel(); - genModel.initialize(Collections.singleton(ePackage)); - - genModel.setRootExtendsInterface(""); - genModel.setRootImplementsInterface("commonj.sdo.DataObject"); - genModel.setRootExtendsClass("org.apache.tuscany.sdo.impl.DataObjectImpl"); - genModel.setFeatureMapWrapperInterface("commonj.sdo.Sequence"); - genModel.setFeatureMapWrapperInternalInterface("org.apache.tuscany.sdo.util.BasicSequence"); - genModel.setFeatureMapWrapperClass("org.apache.tuscany.sdo.util.BasicSequence"); - genModel.setSuppressEMFTypes(true); - genModel.setSuppressEMFMetaData(true); - genModel.setSuppressEMFModelTags(true); - genModel.setCanGenerate(true); - //FIXME workaround java.lang.NoClassDefFoundError: org/eclipse/jdt/core/jdom/IDOMNode with 02162006 build - genModel.setFacadeHelperClass("Hack"); - genModel.setForceOverwrite(true); - - if ((genOptions & OPTION_NO_INTERFACES) != 0) - { - genModel.setSuppressInterfaces(true); - } - - if ((genOptions & OPTION_SPARSE_PATTERN) != 0) - { - genModel.setFeatureDelegation(GenDelegationKind.VIRTUAL_LITERAL); - } - else if ((genOptions & OPTION_STORE_PATTERN) != 0) - { - genModel.setFeatureDelegation(GenDelegationKind.REFLECTIVE_LITERAL); - genModel.setRootExtendsClass("org.apache.tuscany.sdo.impl.StoreDataObjectImpl"); - } - - if ((genOptions & OPTION_NO_CONTAINMENT) != 0) - { - genModel.setSuppressContainment(true); - } - - if ((genOptions & OPTION_NO_NOTIFICATION) != 0) - { - genModel.setSuppressNotification(true); - } - - if ((genOptions & OPTION_ARRAY_ACCESSORS) != 0) - { - genModel.setArrayAccessors(true); - } - - if ((genOptions & OPTION_NO_UNSETTABLE) != 0) - { - genModel.setSuppressUnsettable(true); - } - - GenPackage genPackage = (GenPackage)genModel.getGenPackages().get(0); - - if (basePackage != null) - { - genPackage.setBasePackage(basePackage); - } - if (prefix != null) - { - genPackage.setPrefix(prefix); - } - - //FIXME Temporary, I need this option for now to get Switch classes generated for the SCDL models - if ((genOptions & OPTION_GENERATE_SWITCH) == 0) - { - genPackage.setAdapterFactory(false); - } - - if ((genOptions & OPTION_GENERATE_LOADER) != 0) - { - //FIXME workaround compile error with 02162006 build, generated code references non-existent EcoreResourceImpl class - genPackage.setResource(GenResourceKind.XML_LITERAL); - //genPackage.setDataTypeConverters(true); - } - else - { - genPackage.setResource(GenResourceKind.NONE_LITERAL); - for (Iterator iter = genPackage.getGenClasses().iterator(); iter.hasNext();) - { - GenClass genClass = (GenClass)iter.next(); - if ("DocumentRoot".equals(genClass.getName())) - { - genClass.setDynamic(true); // Don't generate DocumentRoot class - break; - } - } - } - - return genModel; - } - - public static String extractBasePackageName(EPackage ePackage, String javaPackage) - { - String qualifiedName = javaPackage != null ? javaPackage : ePackage.getName(); - String name = /*CodeGenUtil.*/shortName(qualifiedName); - String baseName = qualifiedName.substring(0, qualifiedName.length() - name.length()); - if (javaPackage != null || !name.equals(qualifiedName)) - { - ePackage.setName(name); - } - return baseName != null ? /*CodeGenUtil.*/safeQualifiedName(baseName) : null; - } - - public static String shortName(String qualifiedName) - { - int index = qualifiedName.lastIndexOf("."); - return index != -1 ? qualifiedName.substring(index + 1) : qualifiedName; - } - - public static String safeQualifiedName(String qualifiedName) - { - StringBuffer safeQualifiedName = new StringBuffer(); - for (StringTokenizer stringTokenizer = new StringTokenizer(qualifiedName, "."); stringTokenizer.hasMoreTokens();) - { - String name = stringTokenizer.nextToken(); - safeQualifiedName.append(CodeGenUtil.safeName(name)); - if (stringTokenizer.hasMoreTokens()) - { - safeQualifiedName.append('.'); - } - } - return safeQualifiedName.toString(); - } - - protected static void printDiagnostic(Diagnostic diagnostic, String indent) - { - System.out.print(indent); - System.out.println(diagnostic.getMessage()); - for (Iterator i = diagnostic.getChildren().iterator(); i.hasNext();) - { - printDiagnostic((Diagnostic)i.next(), indent + " "); - } - } - - protected static void printUsage() - { - System.out.println("Usage arguments:"); - System.out.println(" [ -targetDirectory ]"); - System.out.println(" [ -javaPackage ]"); - System.out.println(" [ -prefix ]"); - System.out.println(" [ -sparsePattern | -storePattern ]"); - System.out.println(" [ -noInterfaces ]"); - System.out.println(" [ -noContainment ]"); - System.out.println(" [ -noNotification ]"); - System.out.println(" [ -arrayAccessors ]"); - System.out.println(" [ -generateLoader ]"); - System.out.println(" [ -noUnsettable ]"); - System.out.println(" | "); - System.out.println(""); - System.out.println("For example:"); - System.out.println(""); - System.out.println(" generate somedir/somefile.xsd"); - } - -} diff --git a/tags/java-stable-20060304/sdo/tools/src/main/resources/META-INF/MANIFEST.MF b/tags/java-stable-20060304/sdo/tools/src/main/resources/META-INF/MANIFEST.MF deleted file mode 100644 index 59c4a00c07..0000000000 --- a/tags/java-stable-20060304/sdo/tools/src/main/resources/META-INF/MANIFEST.MF +++ /dev/null @@ -1,13 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: SDO Tools -Bundle-SymbolicName: org.apache.tuscany.sdo.tools -Bundle-Version: 1.0.0 -Bundle-Localization: plugin -Bundle-Vendor: Apache -Require-Bundle: org.apache.tuscany.sdo.impl, - org.eclipse.emf.codegen.ecore, - org.eclipse.emf.common, - org.eclipse.emf.ecore, - org.eclipse.emf.ecore.xmi, - org.eclipse.xsd diff --git a/tags/java-stable-20060304/sdo/tools/src/test/java/com/example/simple/Quote.java b/tags/java-stable-20060304/sdo/tools/src/test/java/com/example/simple/Quote.java deleted file mode 100644 index 57b12ef331..0000000000 --- a/tags/java-stable-20060304/sdo/tools/src/test/java/com/example/simple/Quote.java +++ /dev/null @@ -1,307 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package com.example.simple; - -import java.math.BigDecimal; - -import java.util.List; - -/** - * - * A representation of the model object 'Quote'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link com.example.simple.Quote#getSymbol Symbol}
  • - *
  • {@link com.example.simple.Quote#getCompanyName Company Name}
  • - *
  • {@link com.example.simple.Quote#getPrice Price}
  • - *
  • {@link com.example.simple.Quote#getOpen1 Open1}
  • - *
  • {@link com.example.simple.Quote#getHigh High}
  • - *
  • {@link com.example.simple.Quote#getLow Low}
  • - *
  • {@link com.example.simple.Quote#getVolume Volume}
  • - *
  • {@link com.example.simple.Quote#getChange1 Change1}
  • - *
  • {@link com.example.simple.Quote#getQuotes Quotes}
  • - *
- *

- * - * @generated - */ -public interface Quote -{ - /** - * Returns the value of the 'Symbol' attribute. - * - *

- * If the meaning of the 'Symbol' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Symbol' attribute. - * @see #setSymbol(String) - * @generated - */ - String getSymbol(); - - /** - * Sets the value of the '{@link com.example.simple.Quote#getSymbol Symbol}' attribute. - * - * - * @param value the new value of the 'Symbol' attribute. - * @see #getSymbol() - * @generated - */ - void setSymbol(String value); - - /** - * Returns the value of the 'Company Name' attribute. - * - *

- * If the meaning of the 'Company Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Company Name' attribute. - * @see #setCompanyName(String) - * @generated - */ - String getCompanyName(); - - /** - * Sets the value of the '{@link com.example.simple.Quote#getCompanyName Company Name}' attribute. - * - * - * @param value the new value of the 'Company Name' attribute. - * @see #getCompanyName() - * @generated - */ - void setCompanyName(String value); - - /** - * Returns the value of the 'Price' attribute. - * - *

- * If the meaning of the 'Price' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Price' attribute. - * @see #setPrice(BigDecimal) - * @generated - */ - BigDecimal getPrice(); - - /** - * Sets the value of the '{@link com.example.simple.Quote#getPrice Price}' attribute. - * - * - * @param value the new value of the 'Price' attribute. - * @see #getPrice() - * @generated - */ - void setPrice(BigDecimal value); - - /** - * Returns the value of the 'Open1' attribute. - * - *

- * If the meaning of the 'Open1' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Open1' attribute. - * @see #setOpen1(BigDecimal) - * @generated - */ - BigDecimal getOpen1(); - - /** - * Sets the value of the '{@link com.example.simple.Quote#getOpen1 Open1}' attribute. - * - * - * @param value the new value of the 'Open1' attribute. - * @see #getOpen1() - * @generated - */ - void setOpen1(BigDecimal value); - - /** - * Returns the value of the 'High' attribute. - * - *

- * If the meaning of the 'High' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'High' attribute. - * @see #setHigh(BigDecimal) - * @generated - */ - BigDecimal getHigh(); - - /** - * Sets the value of the '{@link com.example.simple.Quote#getHigh High}' attribute. - * - * - * @param value the new value of the 'High' attribute. - * @see #getHigh() - * @generated - */ - void setHigh(BigDecimal value); - - /** - * Returns the value of the 'Low' attribute. - * - *

- * If the meaning of the 'Low' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Low' attribute. - * @see #setLow(BigDecimal) - * @generated - */ - BigDecimal getLow(); - - /** - * Sets the value of the '{@link com.example.simple.Quote#getLow Low}' attribute. - * - * - * @param value the new value of the 'Low' attribute. - * @see #getLow() - * @generated - */ - void setLow(BigDecimal value); - - /** - * Returns the value of the 'Volume' attribute. - * - *

- * If the meaning of the 'Volume' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Volume' attribute. - * @see #isSetVolume() - * @see #unsetVolume() - * @see #setVolume(double) - * @generated - */ - double getVolume(); - - /** - * Sets the value of the '{@link com.example.simple.Quote#getVolume Volume}' attribute. - * - * - * @param value the new value of the 'Volume' attribute. - * @see #isSetVolume() - * @see #unsetVolume() - * @see #getVolume() - * @generated - */ - void setVolume(double value); - - /** - * Unsets the value of the '{@link com.example.simple.Quote#getVolume Volume}' attribute. - * - * - * @see #isSetVolume() - * @see #getVolume() - * @see #setVolume(double) - * @generated - */ - void unsetVolume(); - - /** - * Returns whether the value of the '{@link com.example.simple.Quote#getVolume Volume}' attribute is set. - * - * - * @return whether the value of the 'Volume' attribute is set. - * @see #unsetVolume() - * @see #getVolume() - * @see #setVolume(double) - * @generated - */ - boolean isSetVolume(); - - /** - * Returns the value of the 'Change1' attribute. - * - *

- * If the meaning of the 'Change1' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Change1' attribute. - * @see #isSetChange1() - * @see #unsetChange1() - * @see #setChange1(double) - * @generated - */ - double getChange1(); - - /** - * Sets the value of the '{@link com.example.simple.Quote#getChange1 Change1}' attribute. - * - * - * @param value the new value of the 'Change1' attribute. - * @see #isSetChange1() - * @see #unsetChange1() - * @see #getChange1() - * @generated - */ - void setChange1(double value); - - /** - * Unsets the value of the '{@link com.example.simple.Quote#getChange1 Change1}' attribute. - * - * - * @see #isSetChange1() - * @see #getChange1() - * @see #setChange1(double) - * @generated - */ - void unsetChange1(); - - /** - * Returns whether the value of the '{@link com.example.simple.Quote#getChange1 Change1}' attribute is set. - * - * - * @return whether the value of the 'Change1' attribute is set. - * @see #unsetChange1() - * @see #getChange1() - * @see #setChange1(double) - * @generated - */ - boolean isSetChange1(); - - /** - * Returns the value of the 'Quotes' containment reference list. - * The list contents are of type {@link com.example.simple.Quote}. - * - *

- * If the meaning of the 'Quotes' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Quotes' containment reference list. - * @generated - */ - List getQuotes(); - -} // Quote diff --git a/tags/java-stable-20060304/sdo/tools/src/test/java/com/example/simple/SimpleFactory.java b/tags/java-stable-20060304/sdo/tools/src/test/java/com/example/simple/SimpleFactory.java deleted file mode 100644 index 9203976521..0000000000 --- a/tags/java-stable-20060304/sdo/tools/src/test/java/com/example/simple/SimpleFactory.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package com.example.simple; - - -/** - * - * The Factory for the model. - * It provides a create method for each non-abstract class of the model. - * - * @generated - */ -public interface SimpleFactory -{ - /** - * The singleton instance of the factory. - * - * - * @generated - */ - SimpleFactory INSTANCE = com.example.simple.impl.SimpleFactoryImpl.eINSTANCE; - - /** - * Returns a new object of class 'Quote'. - * - * - * @return a new object of class 'Quote'. - * @generated - */ - Quote createQuote(); - -} //SimpleFactory diff --git a/tags/java-stable-20060304/sdo/tools/src/test/java/com/example/simple/impl/QuoteImpl.java b/tags/java-stable-20060304/sdo/tools/src/test/java/com/example/simple/impl/QuoteImpl.java deleted file mode 100644 index 5b407dd311..0000000000 --- a/tags/java-stable-20060304/sdo/tools/src/test/java/com/example/simple/impl/QuoteImpl.java +++ /dev/null @@ -1,712 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package com.example.simple.impl; - -import com.example.simple.Quote; - -import java.math.BigDecimal; - -import java.util.Collection; -import java.util.List; - -import org.apache.tuscany.sdo.impl.DataObjectImpl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * - * An implementation of the model object 'Quote'. - * - *

- * The following features are implemented: - *

    - *
  • {@link com.example.simple.impl.QuoteImpl#getSymbol Symbol}
  • - *
  • {@link com.example.simple.impl.QuoteImpl#getCompanyName Company Name}
  • - *
  • {@link com.example.simple.impl.QuoteImpl#getPrice Price}
  • - *
  • {@link com.example.simple.impl.QuoteImpl#getOpen1 Open1}
  • - *
  • {@link com.example.simple.impl.QuoteImpl#getHigh High}
  • - *
  • {@link com.example.simple.impl.QuoteImpl#getLow Low}
  • - *
  • {@link com.example.simple.impl.QuoteImpl#getVolume Volume}
  • - *
  • {@link com.example.simple.impl.QuoteImpl#getChange1 Change1}
  • - *
  • {@link com.example.simple.impl.QuoteImpl#getQuotes Quotes}
  • - *
- *

- * - * @generated - */ -public class QuoteImpl extends DataObjectImpl implements Quote -{ - /** - * The default value of the '{@link #getSymbol() Symbol}' attribute. - * - * - * @see #getSymbol() - * @generated - * @ordered - */ - protected static final String SYMBOL_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSymbol() Symbol}' attribute. - * - * - * @see #getSymbol() - * @generated - * @ordered - */ - protected String symbol = SYMBOL_EDEFAULT; - - /** - * The default value of the '{@link #getCompanyName() Company Name}' attribute. - * - * - * @see #getCompanyName() - * @generated - * @ordered - */ - protected static final String COMPANY_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getCompanyName() Company Name}' attribute. - * - * - * @see #getCompanyName() - * @generated - * @ordered - */ - protected String companyName = COMPANY_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getPrice() Price}' attribute. - * - * - * @see #getPrice() - * @generated - * @ordered - */ - protected static final BigDecimal PRICE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getPrice() Price}' attribute. - * - * - * @see #getPrice() - * @generated - * @ordered - */ - protected BigDecimal price = PRICE_EDEFAULT; - - /** - * The default value of the '{@link #getOpen1() Open1}' attribute. - * - * - * @see #getOpen1() - * @generated - * @ordered - */ - protected static final BigDecimal OPEN1_EDEFAULT = null; - - /** - * The cached value of the '{@link #getOpen1() Open1}' attribute. - * - * - * @see #getOpen1() - * @generated - * @ordered - */ - protected BigDecimal open1 = OPEN1_EDEFAULT; - - /** - * The default value of the '{@link #getHigh() High}' attribute. - * - * - * @see #getHigh() - * @generated - * @ordered - */ - protected static final BigDecimal HIGH_EDEFAULT = null; - - /** - * The cached value of the '{@link #getHigh() High}' attribute. - * - * - * @see #getHigh() - * @generated - * @ordered - */ - protected BigDecimal high = HIGH_EDEFAULT; - - /** - * The default value of the '{@link #getLow() Low}' attribute. - * - * - * @see #getLow() - * @generated - * @ordered - */ - protected static final BigDecimal LOW_EDEFAULT = null; - - /** - * The cached value of the '{@link #getLow() Low}' attribute. - * - * - * @see #getLow() - * @generated - * @ordered - */ - protected BigDecimal low = LOW_EDEFAULT; - - /** - * The default value of the '{@link #getVolume() Volume}' attribute. - * - * - * @see #getVolume() - * @generated - * @ordered - */ - protected static final double VOLUME_EDEFAULT = 0.0; - - /** - * The cached value of the '{@link #getVolume() Volume}' attribute. - * - * - * @see #getVolume() - * @generated - * @ordered - */ - protected double volume = VOLUME_EDEFAULT; - - /** - * This is true if the Volume attribute has been set. - * - * - * @generated - * @ordered - */ - protected boolean volumeESet = false; - - /** - * The default value of the '{@link #getChange1() Change1}' attribute. - * - * - * @see #getChange1() - * @generated - * @ordered - */ - protected static final double CHANGE1_EDEFAULT = 0.0; - - /** - * The cached value of the '{@link #getChange1() Change1}' attribute. - * - * - * @see #getChange1() - * @generated - * @ordered - */ - protected double change1 = CHANGE1_EDEFAULT; - - /** - * This is true if the Change1 attribute has been set. - * - * - * @generated - * @ordered - */ - protected boolean change1ESet = false; - - /** - * The cached value of the '{@link #getQuotes() Quotes}' containment reference list. - * - * - * @see #getQuotes() - * @generated - * @ordered - */ - protected EList quotes = null; - - /** - * - * - * @generated - */ - protected QuoteImpl() - { - super(); - } - - /** - * - * - * @generated - */ - protected EClass eStaticClass() - { - return SimplePackageImpl.Literals.QUOTE; - } - - /** - * - * - * @generated - */ - public String getSymbol() - { - return symbol; - } - - /** - * - * - * @generated - */ - public void setSymbol(String newSymbol) - { - String oldSymbol = symbol; - symbol = newSymbol; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__SYMBOL, oldSymbol, symbol)); - } - - /** - * - * - * @generated - */ - public String getCompanyName() - { - return companyName; - } - - /** - * - * - * @generated - */ - public void setCompanyName(String newCompanyName) - { - String oldCompanyName = companyName; - companyName = newCompanyName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__COMPANY_NAME, oldCompanyName, companyName)); - } - - /** - * - * - * @generated - */ - public BigDecimal getPrice() - { - return price; - } - - /** - * - * - * @generated - */ - public void setPrice(BigDecimal newPrice) - { - BigDecimal oldPrice = price; - price = newPrice; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__PRICE, oldPrice, price)); - } - - /** - * - * - * @generated - */ - public BigDecimal getOpen1() - { - return open1; - } - - /** - * - * - * @generated - */ - public void setOpen1(BigDecimal newOpen1) - { - BigDecimal oldOpen1 = open1; - open1 = newOpen1; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__OPEN1, oldOpen1, open1)); - } - - /** - * - * - * @generated - */ - public BigDecimal getHigh() - { - return high; - } - - /** - * - * - * @generated - */ - public void setHigh(BigDecimal newHigh) - { - BigDecimal oldHigh = high; - high = newHigh; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__HIGH, oldHigh, high)); - } - - /** - * - * - * @generated - */ - public BigDecimal getLow() - { - return low; - } - - /** - * - * - * @generated - */ - public void setLow(BigDecimal newLow) - { - BigDecimal oldLow = low; - low = newLow; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__LOW, oldLow, low)); - } - - /** - * - * - * @generated - */ - public double getVolume() - { - return volume; - } - - /** - * - * - * @generated - */ - public void setVolume(double newVolume) - { - double oldVolume = volume; - volume = newVolume; - boolean oldVolumeESet = volumeESet; - volumeESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__VOLUME, oldVolume, volume, !oldVolumeESet)); - } - - /** - * - * - * @generated - */ - public void unsetVolume() - { - double oldVolume = volume; - boolean oldVolumeESet = volumeESet; - volume = VOLUME_EDEFAULT; - volumeESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, SimplePackageImpl.QUOTE__VOLUME, oldVolume, VOLUME_EDEFAULT, oldVolumeESet)); - } - - /** - * - * - * @generated - */ - public boolean isSetVolume() - { - return volumeESet; - } - - /** - * - * - * @generated - */ - public double getChange1() - { - return change1; - } - - /** - * - * - * @generated - */ - public void setChange1(double newChange1) - { - double oldChange1 = change1; - change1 = newChange1; - boolean oldChange1ESet = change1ESet; - change1ESet = true; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__CHANGE1, oldChange1, change1, !oldChange1ESet)); - } - - /** - * - * - * @generated - */ - public void unsetChange1() - { - double oldChange1 = change1; - boolean oldChange1ESet = change1ESet; - change1 = CHANGE1_EDEFAULT; - change1ESet = false; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.UNSET, SimplePackageImpl.QUOTE__CHANGE1, oldChange1, CHANGE1_EDEFAULT, oldChange1ESet)); - } - - /** - * - * - * @generated - */ - public boolean isSetChange1() - { - return change1ESet; - } - - /** - * - * - * @generated - */ - public List getQuotes() - { - if (quotes == null) - { - quotes = new EObjectContainmentEList(Quote.class, this, SimplePackageImpl.QUOTE__QUOTES); - } - return quotes; - } - - /** - * - * - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case SimplePackageImpl.QUOTE__QUOTES: - return ((InternalEList)getQuotes()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case SimplePackageImpl.QUOTE__SYMBOL: - return getSymbol(); - case SimplePackageImpl.QUOTE__COMPANY_NAME: - return getCompanyName(); - case SimplePackageImpl.QUOTE__PRICE: - return getPrice(); - case SimplePackageImpl.QUOTE__OPEN1: - return getOpen1(); - case SimplePackageImpl.QUOTE__HIGH: - return getHigh(); - case SimplePackageImpl.QUOTE__LOW: - return getLow(); - case SimplePackageImpl.QUOTE__VOLUME: - return new Double(getVolume()); - case SimplePackageImpl.QUOTE__CHANGE1: - return new Double(getChange1()); - case SimplePackageImpl.QUOTE__QUOTES: - return getQuotes(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case SimplePackageImpl.QUOTE__SYMBOL: - setSymbol((String)newValue); - return; - case SimplePackageImpl.QUOTE__COMPANY_NAME: - setCompanyName((String)newValue); - return; - case SimplePackageImpl.QUOTE__PRICE: - setPrice((BigDecimal)newValue); - return; - case SimplePackageImpl.QUOTE__OPEN1: - setOpen1((BigDecimal)newValue); - return; - case SimplePackageImpl.QUOTE__HIGH: - setHigh((BigDecimal)newValue); - return; - case SimplePackageImpl.QUOTE__LOW: - setLow((BigDecimal)newValue); - return; - case SimplePackageImpl.QUOTE__VOLUME: - setVolume(((Double)newValue).doubleValue()); - return; - case SimplePackageImpl.QUOTE__CHANGE1: - setChange1(((Double)newValue).doubleValue()); - return; - case SimplePackageImpl.QUOTE__QUOTES: - getQuotes().clear(); - getQuotes().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - public void eUnset(int featureID) - { - switch (featureID) - { - case SimplePackageImpl.QUOTE__SYMBOL: - setSymbol(SYMBOL_EDEFAULT); - return; - case SimplePackageImpl.QUOTE__COMPANY_NAME: - setCompanyName(COMPANY_NAME_EDEFAULT); - return; - case SimplePackageImpl.QUOTE__PRICE: - setPrice(PRICE_EDEFAULT); - return; - case SimplePackageImpl.QUOTE__OPEN1: - setOpen1(OPEN1_EDEFAULT); - return; - case SimplePackageImpl.QUOTE__HIGH: - setHigh(HIGH_EDEFAULT); - return; - case SimplePackageImpl.QUOTE__LOW: - setLow(LOW_EDEFAULT); - return; - case SimplePackageImpl.QUOTE__VOLUME: - unsetVolume(); - return; - case SimplePackageImpl.QUOTE__CHANGE1: - unsetChange1(); - return; - case SimplePackageImpl.QUOTE__QUOTES: - getQuotes().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case SimplePackageImpl.QUOTE__SYMBOL: - return SYMBOL_EDEFAULT == null ? symbol != null : !SYMBOL_EDEFAULT.equals(symbol); - case SimplePackageImpl.QUOTE__COMPANY_NAME: - return COMPANY_NAME_EDEFAULT == null ? companyName != null : !COMPANY_NAME_EDEFAULT.equals(companyName); - case SimplePackageImpl.QUOTE__PRICE: - return PRICE_EDEFAULT == null ? price != null : !PRICE_EDEFAULT.equals(price); - case SimplePackageImpl.QUOTE__OPEN1: - return OPEN1_EDEFAULT == null ? open1 != null : !OPEN1_EDEFAULT.equals(open1); - case SimplePackageImpl.QUOTE__HIGH: - return HIGH_EDEFAULT == null ? high != null : !HIGH_EDEFAULT.equals(high); - case SimplePackageImpl.QUOTE__LOW: - return LOW_EDEFAULT == null ? low != null : !LOW_EDEFAULT.equals(low); - case SimplePackageImpl.QUOTE__VOLUME: - return isSetVolume(); - case SimplePackageImpl.QUOTE__CHANGE1: - return isSetChange1(); - case SimplePackageImpl.QUOTE__QUOTES: - return quotes != null && !quotes.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (symbol: "); - result.append(symbol); - result.append(", companyName: "); - result.append(companyName); - result.append(", price: "); - result.append(price); - result.append(", open1: "); - result.append(open1); - result.append(", high: "); - result.append(high); - result.append(", low: "); - result.append(low); - result.append(", volume: "); - if (volumeESet) result.append(volume); else result.append(""); - result.append(", change1: "); - if (change1ESet) result.append(change1); else result.append(""); - result.append(')'); - return result.toString(); - } - -} //QuoteImpl diff --git a/tags/java-stable-20060304/sdo/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java b/tags/java-stable-20060304/sdo/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java deleted file mode 100644 index 06b0e3891e..0000000000 --- a/tags/java-stable-20060304/sdo/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java +++ /dev/null @@ -1,138 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package com.example.simple.impl; - -import com.example.simple.*; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.impl.EFactoryImpl; - -import org.eclipse.emf.ecore.plugin.EcorePlugin; - -/** - * - * An implementation of the model Factory. - * - * @generated - */ -public class SimpleFactoryImpl extends EFactoryImpl implements SimpleFactory -{ - /** - * The singleton instance of the factory. - * - * - * @generated - */ - public static final SimpleFactoryImpl eINSTANCE = init(); - - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static SimpleFactoryImpl init() - { - try - { - SimpleFactoryImpl theSimpleFactory = (SimpleFactoryImpl)EPackage.Registry.INSTANCE.getEFactory("http://www.example.com/simple"); - if (theSimpleFactory != null) - { - return theSimpleFactory; - } - } - catch (Exception exception) - { - EcorePlugin.INSTANCE.log(exception); - } - return new SimpleFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public SimpleFactoryImpl() - { - super(); - } - - /** - * - * - * @generated - */ - public EObject create(EClass eClass) - { - switch (eClass.getClassifierID()) - { - case SimplePackageImpl.DOCUMENT_ROOT: return (EObject)createDocumentRoot(); - case SimplePackageImpl.QUOTE: return (EObject)createQuote(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - public EObject createDocumentRoot() - { - EObject documentRoot = super.create(SimplePackageImpl.Literals.DOCUMENT_ROOT); - return documentRoot; - } - - /** - * - * - * @generated - */ - public Quote createQuote() - { - QuoteImpl quote = new QuoteImpl(); - return quote; - } - - /** - * - * - * @generated - */ - public SimplePackageImpl getSimplePackageImpl() - { - return (SimplePackageImpl)getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - public static SimplePackageImpl getPackage() - { - return SimplePackageImpl.eINSTANCE; - } - -} //SimpleFactoryImpl diff --git a/tags/java-stable-20060304/sdo/tools/src/test/java/com/example/simple/impl/SimplePackageImpl.java b/tags/java-stable-20060304/sdo/tools/src/test/java/com/example/simple/impl/SimplePackageImpl.java deleted file mode 100644 index e8fe40c24d..0000000000 --- a/tags/java-stable-20060304/sdo/tools/src/test/java/com/example/simple/impl/SimplePackageImpl.java +++ /dev/null @@ -1,908 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package com.example.simple.impl; - -import com.example.simple.Quote; -import com.example.simple.SimpleFactory; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EFactory; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - -import org.eclipse.emf.ecore.impl.EPackageImpl; - -import org.eclipse.emf.ecore.xml.type.XMLTypePackage; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @see com.example.simple.SimpleFactory - * @generated - */ -public class SimplePackageImpl extends EPackageImpl -{ - /** - * The package name. - * - * - * @generated - */ - public static final String eNAME = "simple"; - - /** - * The package namespace URI. - * - * - * @generated - */ - public static final String eNS_URI = "http://www.example.com/simple"; - - /** - * The package namespace name. - * - * - * @generated - */ - public static final String eNS_PREFIX = "simple"; - - /** - * The singleton instance of the package. - * - * - * @generated - */ - public static final SimplePackageImpl eINSTANCE = com.example.simple.impl.SimplePackageImpl.init(); - - /** - * The meta object id for the '{@link com.example.simple.impl.DocumentRootImpl Document Root}' class. - * - * - * @see com.example.simple.impl.DocumentRootImpl - * @see com.example.simple.impl.SimplePackageImpl#getDocumentRoot() - * @generated - */ - public static final int DOCUMENT_ROOT = 0; - - /** - * The feature id for the 'Mixed' attribute list. - * - * - * @generated - * @ordered - */ - public static final int DOCUMENT_ROOT__MIXED = 0; - - /** - * The feature id for the 'XMLNS Prefix Map' map. - * - * - * @generated - * @ordered - */ - public static final int DOCUMENT_ROOT__XMLNS_PREFIX_MAP = 1; - - /** - * The feature id for the 'XSI Schema Location' map. - * - * - * @generated - * @ordered - */ - public static final int DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = 2; - - /** - * The feature id for the 'Stock Quote' containment reference. - * - * - * @generated - * @ordered - */ - public static final int DOCUMENT_ROOT__STOCK_QUOTE = 3; - - /** - * The number of structural features of the 'Document Root' class. - * - * - * @generated - * @ordered - */ - public static final int DOCUMENT_ROOT_FEATURE_COUNT = 4; - - /** - * The meta object id for the '{@link com.example.simple.impl.QuoteImpl Quote}' class. - * - * - * @see com.example.simple.impl.QuoteImpl - * @see com.example.simple.impl.SimplePackageImpl#getQuote() - * @generated - */ - public static final int QUOTE = 1; - - /** - * The feature id for the 'Symbol' attribute. - * - * - * @generated - * @ordered - */ - public static final int QUOTE__SYMBOL = 0; - - /** - * The feature id for the 'Company Name' attribute. - * - * - * @generated - * @ordered - */ - public static final int QUOTE__COMPANY_NAME = 1; - - /** - * The feature id for the 'Price' attribute. - * - * - * @generated - * @ordered - */ - public static final int QUOTE__PRICE = 2; - - /** - * The feature id for the 'Open1' attribute. - * - * - * @generated - * @ordered - */ - public static final int QUOTE__OPEN1 = 3; - - /** - * The feature id for the 'High' attribute. - * - * - * @generated - * @ordered - */ - public static final int QUOTE__HIGH = 4; - - /** - * The feature id for the 'Low' attribute. - * - * - * @generated - * @ordered - */ - public static final int QUOTE__LOW = 5; - - /** - * The feature id for the 'Volume' attribute. - * - * - * @generated - * @ordered - */ - public static final int QUOTE__VOLUME = 6; - - /** - * The feature id for the 'Change1' attribute. - * - * - * @generated - * @ordered - */ - public static final int QUOTE__CHANGE1 = 7; - - /** - * The feature id for the 'Quotes' containment reference list. - * - * - * @generated - * @ordered - */ - public static final int QUOTE__QUOTES = 8; - - /** - * The number of structural features of the 'Quote' class. - * - * - * @generated - * @ordered - */ - public static final int QUOTE_FEATURE_COUNT = 9; - - /** - * - * - * @generated - */ - private EClass documentRootEClass = null; - - /** - * - * - * @generated - */ - private EClass quoteEClass = null; - - /** - * Creates an instance of the model Package, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - *

Note: the correct way to create the package is via the static - * factory method {@link #init init()}, which also performs - * initialization of the package, or returns the registered package, - * if one already exists. - * - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see com.example.simple.impl.SimplePackageImpl#eNS_URI - * @see #init() - * @generated - */ - private SimplePackageImpl() - { - super(eNS_URI, ((EFactory)SimpleFactory.INSTANCE)); - } - - /** - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this - * model, and for any others upon which it depends. Simple - * dependencies are satisfied by calling this method on all - * dependent packages before doing anything else. This method drives - * initialization for interdependent packages directly, in parallel - * with this package, itself. - *

Of this package and its interdependencies, all packages which - * have not yet been registered by their URI values are first created - * and registered. The packages are then initialized in two steps: - * meta-model objects for all of the packages are created before any - * are initialized, since one package's meta-model objects may refer to - * those of another. - *

Invocation of this method will not affect any packages that have - * already been initialized. - * - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static SimplePackageImpl init() - { - if (isInited) return (SimplePackageImpl)EPackage.Registry.INSTANCE.getEPackage(SimplePackageImpl.eNS_URI); - - // Obtain or create and register package - SimplePackageImpl theSimplePackageImpl = (SimplePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof SimplePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new SimplePackageImpl()); - - isInited = true; - - // Initialize simple dependencies - XMLTypePackage.eINSTANCE.eClass(); - - // Create package meta-data objects - theSimplePackageImpl.createPackageContents(); - - // Initialize created meta-data - theSimplePackageImpl.initializePackageContents(); - - // Mark meta-data to indicate it can't be changed - theSimplePackageImpl.freeze(); - - return theSimplePackageImpl; - } - - - /** - * Returns the meta object for class '{@link org.eclipse.emf.ecore.EObject Document Root}'. - * - * - * @return the meta object for class 'Document Root'. - * @see org.eclipse.emf.ecore.EObject - * @generated - */ - public EClass getDocumentRoot() - { - return documentRootEClass; - } - - /** - * Returns the meta object for the attribute list '{@link org.eclipse.emf.ecore.EObject#getMixed Mixed}'. - * - * - * @return the meta object for the attribute list 'Mixed'. - * @see org.eclipse.emf.ecore.EObject#getMixed() - * @see #getDocumentRoot() - * @generated - */ - public EAttribute getDocumentRoot_Mixed() - { - return (EAttribute)documentRootEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the map '{@link org.eclipse.emf.ecore.EObject#getXMLNSPrefixMap XMLNS Prefix Map}'. - * - * - * @return the meta object for the map 'XMLNS Prefix Map'. - * @see org.eclipse.emf.ecore.EObject#getXMLNSPrefixMap() - * @see #getDocumentRoot() - * @generated - */ - public EReference getDocumentRoot_XMLNSPrefixMap() - { - return (EReference)documentRootEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the map '{@link org.eclipse.emf.ecore.EObject#getXSISchemaLocation XSI Schema Location}'. - * - * - * @return the meta object for the map 'XSI Schema Location'. - * @see org.eclipse.emf.ecore.EObject#getXSISchemaLocation() - * @see #getDocumentRoot() - * @generated - */ - public EReference getDocumentRoot_XSISchemaLocation() - { - return (EReference)documentRootEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.emf.ecore.EObject#getStockQuote Stock Quote}'. - * - * - * @return the meta object for the containment reference 'Stock Quote'. - * @see org.eclipse.emf.ecore.EObject#getStockQuote() - * @see #getDocumentRoot() - * @generated - */ - public EReference getDocumentRoot_StockQuote() - { - return (EReference)documentRootEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for class '{@link com.example.simple.Quote Quote}'. - * - * - * @return the meta object for class 'Quote'. - * @see com.example.simple.Quote - * @generated - */ - public EClass getQuote() - { - return quoteEClass; - } - - /** - * Returns the meta object for the attribute '{@link com.example.simple.Quote#getSymbol Symbol}'. - * - * - * @return the meta object for the attribute 'Symbol'. - * @see com.example.simple.Quote#getSymbol() - * @see #getQuote() - * @generated - */ - public EAttribute getQuote_Symbol() - { - return (EAttribute)quoteEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link com.example.simple.Quote#getCompanyName Company Name}'. - * - * - * @return the meta object for the attribute 'Company Name'. - * @see com.example.simple.Quote#getCompanyName() - * @see #getQuote() - * @generated - */ - public EAttribute getQuote_CompanyName() - { - return (EAttribute)quoteEClass.getEStructuralFeatures().get(1); - } - - /** - * Returns the meta object for the attribute '{@link com.example.simple.Quote#getPrice Price}'. - * - * - * @return the meta object for the attribute 'Price'. - * @see com.example.simple.Quote#getPrice() - * @see #getQuote() - * @generated - */ - public EAttribute getQuote_Price() - { - return (EAttribute)quoteEClass.getEStructuralFeatures().get(2); - } - - /** - * Returns the meta object for the attribute '{@link com.example.simple.Quote#getOpen1 Open1}'. - * - * - * @return the meta object for the attribute 'Open1'. - * @see com.example.simple.Quote#getOpen1() - * @see #getQuote() - * @generated - */ - public EAttribute getQuote_Open1() - { - return (EAttribute)quoteEClass.getEStructuralFeatures().get(3); - } - - /** - * Returns the meta object for the attribute '{@link com.example.simple.Quote#getHigh High}'. - * - * - * @return the meta object for the attribute 'High'. - * @see com.example.simple.Quote#getHigh() - * @see #getQuote() - * @generated - */ - public EAttribute getQuote_High() - { - return (EAttribute)quoteEClass.getEStructuralFeatures().get(4); - } - - /** - * Returns the meta object for the attribute '{@link com.example.simple.Quote#getLow Low}'. - * - * - * @return the meta object for the attribute 'Low'. - * @see com.example.simple.Quote#getLow() - * @see #getQuote() - * @generated - */ - public EAttribute getQuote_Low() - { - return (EAttribute)quoteEClass.getEStructuralFeatures().get(5); - } - - /** - * Returns the meta object for the attribute '{@link com.example.simple.Quote#getVolume Volume}'. - * - * - * @return the meta object for the attribute 'Volume'. - * @see com.example.simple.Quote#getVolume() - * @see #getQuote() - * @generated - */ - public EAttribute getQuote_Volume() - { - return (EAttribute)quoteEClass.getEStructuralFeatures().get(6); - } - - /** - * Returns the meta object for the attribute '{@link com.example.simple.Quote#getChange1 Change1}'. - * - * - * @return the meta object for the attribute 'Change1'. - * @see com.example.simple.Quote#getChange1() - * @see #getQuote() - * @generated - */ - public EAttribute getQuote_Change1() - { - return (EAttribute)quoteEClass.getEStructuralFeatures().get(7); - } - - /** - * Returns the meta object for the containment reference list '{@link com.example.simple.Quote#getQuotes Quotes}'. - * - * - * @return the meta object for the containment reference list 'Quotes'. - * @see com.example.simple.Quote#getQuotes() - * @see #getQuote() - * @generated - */ - public EReference getQuote_Quotes() - { - return (EReference)quoteEClass.getEStructuralFeatures().get(8); - } - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - public SimpleFactory getSimpleFactory() - { - return (SimpleFactory)getEFactoryInstance(); - } - - /** - * - * - * @generated - */ - private boolean isCreated = false; - - /** - * Creates the meta-model objects for the package. This method is - * guarded to have no affect on any invocation but its first. - * - * - * @generated - */ - public void createPackageContents() - { - if (isCreated) return; - isCreated = true; - - // Create classes and their features - documentRootEClass = createEClass(DOCUMENT_ROOT); - createEAttribute(documentRootEClass, DOCUMENT_ROOT__MIXED); - createEReference(documentRootEClass, DOCUMENT_ROOT__XMLNS_PREFIX_MAP); - createEReference(documentRootEClass, DOCUMENT_ROOT__XSI_SCHEMA_LOCATION); - createEReference(documentRootEClass, DOCUMENT_ROOT__STOCK_QUOTE); - - quoteEClass = createEClass(QUOTE); - createEAttribute(quoteEClass, QUOTE__SYMBOL); - createEAttribute(quoteEClass, QUOTE__COMPANY_NAME); - createEAttribute(quoteEClass, QUOTE__PRICE); - createEAttribute(quoteEClass, QUOTE__OPEN1); - createEAttribute(quoteEClass, QUOTE__HIGH); - createEAttribute(quoteEClass, QUOTE__LOW); - createEAttribute(quoteEClass, QUOTE__VOLUME); - createEAttribute(quoteEClass, QUOTE__CHANGE1); - createEReference(quoteEClass, QUOTE__QUOTES); - } - - /** - * - * - * @generated - */ - private boolean isInitialized = false; - - /** - * Complete the initialization of the package and its meta-model. This - * method is guarded to have no affect on any invocation but its first. - * - * - * @generated - */ - public void initializePackageContents() - { - if (isInitialized) return; - isInitialized = true; - - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - - // Obtain other dependent packages - XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); - - // Add supertypes to classes - - // Initialize classes and features; add operations and parameters - initEClass(documentRootEClass, null, "DocumentRoot", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getDocumentRoot_Mixed(), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDocumentRoot_XMLNSPrefixMap(), ecorePackage.getEStringToStringMapEntry(), null, "xMLNSPrefixMap", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDocumentRoot_XSISchemaLocation(), ecorePackage.getEStringToStringMapEntry(), null, "xSISchemaLocation", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDocumentRoot_StockQuote(), this.getQuote(), null, "stockQuote", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); - - initEClass(quoteEClass, Quote.class, "Quote", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getQuote_Symbol(), theXMLTypePackage.getString(), "symbol", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getQuote_CompanyName(), theXMLTypePackage.getString(), "companyName", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getQuote_Price(), theXMLTypePackage.getDecimal(), "price", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getQuote_Open1(), theXMLTypePackage.getDecimal(), "open1", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getQuote_High(), theXMLTypePackage.getDecimal(), "high", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getQuote_Low(), theXMLTypePackage.getDecimal(), "low", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getQuote_Volume(), theXMLTypePackage.getDouble(), "volume", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getQuote_Change1(), theXMLTypePackage.getDouble(), "change1", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getQuote_Quotes(), this.getQuote(), null, "quotes", null, 0, -1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - // Create resource - createResource(eNS_URI); - - // Create annotations - // http:///org/eclipse/emf/ecore/util/ExtendedMetaData - createExtendedMetaDataAnnotations(); - } - - /** - * Initializes the annotations for http:///org/eclipse/emf/ecore/util/ExtendedMetaData. - * - * - * @generated - */ - protected void createExtendedMetaDataAnnotations() - { - String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; - addAnnotation - (documentRootEClass, - source, - new String[] - { - "name", "", - "kind", "mixed" - }); - addAnnotation - (getDocumentRoot_Mixed(), - source, - new String[] - { - "kind", "elementWildcard", - "name", ":mixed" - }); - addAnnotation - (getDocumentRoot_XMLNSPrefixMap(), - source, - new String[] - { - "kind", "attribute", - "name", "xmlns:prefix" - }); - addAnnotation - (getDocumentRoot_XSISchemaLocation(), - source, - new String[] - { - "kind", "attribute", - "name", "xsi:schemaLocation" - }); - addAnnotation - (getDocumentRoot_StockQuote(), - source, - new String[] - { - "kind", "element", - "name", "stockQuote", - "namespace", "##targetNamespace" - }); - addAnnotation - (quoteEClass, - source, - new String[] - { - "name", "Quote", - "kind", "elementOnly" - }); - addAnnotation - (getQuote_Symbol(), - source, - new String[] - { - "kind", "element", - "name", "symbol" - }); - addAnnotation - (getQuote_CompanyName(), - source, - new String[] - { - "kind", "element", - "name", "companyName" - }); - addAnnotation - (getQuote_Price(), - source, - new String[] - { - "kind", "element", - "name", "price" - }); - addAnnotation - (getQuote_Open1(), - source, - new String[] - { - "kind", "element", - "name", "open1" - }); - addAnnotation - (getQuote_High(), - source, - new String[] - { - "kind", "element", - "name", "high" - }); - addAnnotation - (getQuote_Low(), - source, - new String[] - { - "kind", "element", - "name", "low" - }); - addAnnotation - (getQuote_Volume(), - source, - new String[] - { - "kind", "element", - "name", "volume" - }); - addAnnotation - (getQuote_Change1(), - source, - new String[] - { - "kind", "element", - "name", "change1" - }); - addAnnotation - (getQuote_Quotes(), - source, - new String[] - { - "kind", "element", - "name", "quotes" - }); - } - - /** - * - * Defines literals for the meta objects that represent - *

    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @generated - */ - public interface Literals - { - /** - * The meta object literal for the '{@link com.example.simple.impl.DocumentRootImpl Document Root}' class. - * - * - * @see com.example.simple.impl.DocumentRootImpl - * @see com.example.simple.impl.SimplePackageImpl#getDocumentRoot() - * @generated - */ - public static final EClass DOCUMENT_ROOT = eINSTANCE.getDocumentRoot(); - - /** - * The meta object literal for the 'Mixed' attribute list feature. - * - * - * @generated - */ - public static final EAttribute DOCUMENT_ROOT__MIXED = eINSTANCE.getDocumentRoot_Mixed(); - - /** - * The meta object literal for the 'XMLNS Prefix Map' map feature. - * - * - * @generated - */ - public static final EReference DOCUMENT_ROOT__XMLNS_PREFIX_MAP = eINSTANCE.getDocumentRoot_XMLNSPrefixMap(); - - /** - * The meta object literal for the 'XSI Schema Location' map feature. - * - * - * @generated - */ - public static final EReference DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = eINSTANCE.getDocumentRoot_XSISchemaLocation(); - - /** - * The meta object literal for the 'Stock Quote' containment reference feature. - * - * - * @generated - */ - public static final EReference DOCUMENT_ROOT__STOCK_QUOTE = eINSTANCE.getDocumentRoot_StockQuote(); - - /** - * The meta object literal for the '{@link com.example.simple.impl.QuoteImpl Quote}' class. - * - * - * @see com.example.simple.impl.QuoteImpl - * @see com.example.simple.impl.SimplePackageImpl#getQuote() - * @generated - */ - public static final EClass QUOTE = eINSTANCE.getQuote(); - - /** - * The meta object literal for the 'Symbol' attribute feature. - * - * - * @generated - */ - public static final EAttribute QUOTE__SYMBOL = eINSTANCE.getQuote_Symbol(); - - /** - * The meta object literal for the 'Company Name' attribute feature. - * - * - * @generated - */ - public static final EAttribute QUOTE__COMPANY_NAME = eINSTANCE.getQuote_CompanyName(); - - /** - * The meta object literal for the 'Price' attribute feature. - * - * - * @generated - */ - public static final EAttribute QUOTE__PRICE = eINSTANCE.getQuote_Price(); - - /** - * The meta object literal for the 'Open1' attribute feature. - * - * - * @generated - */ - public static final EAttribute QUOTE__OPEN1 = eINSTANCE.getQuote_Open1(); - - /** - * The meta object literal for the 'High' attribute feature. - * - * - * @generated - */ - public static final EAttribute QUOTE__HIGH = eINSTANCE.getQuote_High(); - - /** - * The meta object literal for the 'Low' attribute feature. - * - * - * @generated - */ - public static final EAttribute QUOTE__LOW = eINSTANCE.getQuote_Low(); - - /** - * The meta object literal for the 'Volume' attribute feature. - * - * - * @generated - */ - public static final EAttribute QUOTE__VOLUME = eINSTANCE.getQuote_Volume(); - - /** - * The meta object literal for the 'Change1' attribute feature. - * - * - * @generated - */ - public static final EAttribute QUOTE__CHANGE1 = eINSTANCE.getQuote_Change1(); - - /** - * The meta object literal for the 'Quotes' containment reference list feature. - * - * - * @generated - */ - public static final EReference QUOTE__QUOTES = eINSTANCE.getQuote_Quotes(); - - } - -} //SimplePackageImpl diff --git a/tags/java-stable-20060304/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTest.java b/tags/java-stable-20060304/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTest.java deleted file mode 100644 index 520cf707e7..0000000000 --- a/tags/java-stable-20060304/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.sdo.test; - -import java.math.BigDecimal; - -import org.apache.tuscany.sdo.util.SDOUtil; - -import com.example.simple.Quote; -import com.example.simple.SimpleFactory; -import commonj.sdo.DataObject; -import commonj.sdo.helper.XMLHelper; - - -public class SimpleStaticTest -{ - /** - * Simple Static SDO 2 test. - */ - public static void main(String[] args) - { - try - { - SDOUtil.registerStaticTypes(SimpleFactory.class); - - //Quote quote = (Quote)DataFactory.INSTANCE.create(Quote.class); - Quote quote = SimpleFactory.INSTANCE.createQuote(); - - quote.setSymbol("fbnt"); - quote.setCompanyName("FlyByNightTechnology"); - quote.setPrice(new BigDecimal("1000.0")); - quote.setOpen1(new BigDecimal("1000.0")); - quote.setHigh(new BigDecimal("1000.0")); - quote.setLow(new BigDecimal("1000.0")); - quote.setVolume(1000); - quote.setChange1(1000); - - //Quote child = (Quote)((DataObject)quote).createDataObject(8); - Quote child = SimpleFactory.INSTANCE.createQuote(); - quote.getQuotes().add(child); - child.setPrice(new BigDecimal("2000.0")); - - XMLHelper.INSTANCE.save((DataObject)quote, "http://www.example.com/simple", "stockQuote", System.out); - } - catch (Exception e) - { - e.printStackTrace(); - } - } -} diff --git a/tags/java-stable-20060304/sdo/tools/src/test/resources/enum.xsd b/tags/java-stable-20060304/sdo/tools/src/test/resources/enum.xsd deleted file mode 100644 index 4cbde32849..0000000000 --- a/tags/java-stable-20060304/sdo/tools/src/test/resources/enum.xsd +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/sdo/tools/src/test/resources/simple.xsd b/tags/java-stable-20060304/sdo/tools/src/test/resources/simple.xsd deleted file mode 100644 index c15028544e..0000000000 --- a/tags/java-stable-20060304/sdo/tools/src/test/resources/simple.xsd +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/spec/pom.xml b/tags/java-stable-20060304/spec/pom.xml deleted file mode 100644 index 893b82a5b9..0000000000 --- a/tags/java-stable-20060304/spec/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - 4.0.0 - org.osoa - spec - pom - OSOA Specification API jars - SNAPSHOT - - - 2.0 - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - ibiblio - ibiblio - http://www.ibiblio.org/maven2 - - - - - sdo - sca - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - - src/main/resources - - **/* - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - src/main/resources/META-INF/MANIFEST.MF - - - - - install - - - - - - maven-javadoc-plugin - - - maven-jxr-plugin - - - - diff --git a/tags/java-stable-20060304/spec/sca/LICENSE.txt b/tags/java-stable-20060304/spec/sca/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/tags/java-stable-20060304/spec/sca/LICENSE.txt +++ /dev/null @@ -1,202 +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/tags/java-stable-20060304/spec/sca/pom.xml b/tags/java-stable-20060304/spec/sca/pom.xml deleted file mode 100644 index b58e5845b4..0000000000 --- a/tags/java-stable-20060304/spec/sca/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - org.osoa - spec - SNAPSHOT - - 4.0.0 - sca-api - SCA API - SNAPSHOT - - - - commonj - sdo-api - SNAPSHOT - provided - - - - junit - junit - 3.8.1 - test - - - diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/CurrentModuleContext.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/CurrentModuleContext.java deleted file mode 100644 index 84fb9ba95a..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/CurrentModuleContext.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca; - -/** - * Class providing access to the current ModuleContext. - *

- * The current context is set by the SCA container implementation before dispatching - * a request to any component in the module. - * - * @version $Rev$ $Date$ - */ -public final class CurrentModuleContext { - private static final ThreadLocal CURRENT_CONTEXT = new InheritableThreadLocal(); - - /** - * Return the current ModuleContext. - * - * @return the current ModuleContext - */ - public static ModuleContext getContext() { - return (ModuleContext) CURRENT_CONTEXT.get(); - } - - static void setContext(ModuleContext ctx) { - CURRENT_CONTEXT.set(ctx); - } -} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ModuleContext.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ModuleContext.java deleted file mode 100644 index e48235be3b..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ModuleContext.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca; - - -/** - * @version $Rev$ $Date$ - */ -public interface ModuleContext { - - /** - * Returns the name of the module. - * - * @return the name of the module - */ - String getName(); - - /** - * Returns the absolute URI of the module component. - * - * @return the absolute URI of the module component - */ - String getURI(); - -//FIXME This is not implemented yet, we need the SCA spec to define the metadata model first. -// /** -// * Returns the Module metadata object. -// * This represents the root <module> element in the SCA module definition. -// * -// * @return the module metadata object -// */ -// Module getMetaData(); - - /** - * Returns the request context that corresponds to the last remotable service invocation. - * If this is invoked from outside an SCA component then null is returned. - * - * @return the current request context - */ - RequestContext getRequestContext(); - - /** - * Returns an object implementing the interface defined for the named service. - * - * @param serviceName the name of another service in the current module - * @return an object that implements the service's interface - */ - Object locateService(String serviceName); - - /** - * Create a reference to the supplied component. - * The component must define only one service. - * - * @param self the component to be referenced - * @return a reference to the component - */ - ServiceReference createServiceReferenceForSession(Object self); - - /** - * Create a reference to the named service implemented by the supplied component. - * - * @param self the component to be referenced - * @param serviceName the service to be referenced - * @return a reference to the service - */ - ServiceReference createServiceReferenceForSession(Object self, String serviceName); - - ServiceReference newSession(String serviceName); - - ServiceReference newSession(String serviceName, Object sessionId); -} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/NoRegisteredCallbackException.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/NoRegisteredCallbackException.java deleted file mode 100644 index 11e693f603..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/NoRegisteredCallbackException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca; - -/** - * @version $Rev$ $Date$ - */ -public class NoRegisteredCallbackException extends ServiceRuntimeException { - private static final long serialVersionUID = 3734864942222558406L; - - public NoRegisteredCallbackException() { - } - - public NoRegisteredCallbackException(String message) { - super(message); - } - - public NoRegisteredCallbackException(String message, Throwable cause) { - super(message, cause); - } - - public NoRegisteredCallbackException(Throwable cause) { - super(cause); - } -} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/RequestContext.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/RequestContext.java deleted file mode 100644 index e5f3ee63b1..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/RequestContext.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca; - -import javax.security.auth.Subject; - -/** - * Interface that provides information on the current request. - * - * @version $Rev$ $Date$ - */ -public interface RequestContext { - /** - * Returns the JAAS Subject of the current request. - * - * @return the Subject of the current request - */ - Subject getSecuritySubject(); - - /** - * Returns the name of the service that was invoked. - * - * @return the name of the service that was invoked - */ - String getServiceName(); - - /** - * Returns a reference to the service that was invoked. - * - * @return a reference to the service that was invoked - */ - ServiceReference getServiceReference(); -} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/SCA.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/SCA.java deleted file mode 100644 index e74a3def11..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/SCA.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca; - -/** - * Class providing access to an SCA implementation. - * SCA implementation providers may allow applications to bootstrap an SCA environment - * by providing a publically available subclass. - * - * @version $Rev$ $Date$ - */ -public abstract class SCA { - /** - * Protected method that allows an SCA implementation to set the current module context - * that will be returned by {@link org.osoa.sca.CurrentModuleContext#getContext()}. - * - * @param ctx the new current module context - */ - protected static void setModuleContext(ModuleContext ctx) { - CurrentModuleContext.setContext(ctx); - } - - /** - * Start the SCA implementation. - * If this method completes successfully then a module context will be associated with the current thread. - */ - public abstract void start(); - - /** - * Stop the SCA implementation. - * Once this method completes (successfully or abnormally) then no module context will be associated - * with the current thread. - */ - public abstract void stop(); -} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceReference.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceReference.java deleted file mode 100644 index 651b21a9b0..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceReference.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca; - - -/** - * Interface that provides access to other services. - * Any ServiceReference can be cast to the business interface of the service to - * which it refers. - * - * @version $Rev$ $Date$ - */ -public interface ServiceReference { - /** - * Returns the session ID. - * - * @return the session ID - */ - Object getSessionID(); - - /** - * End the client's session with the referenced service. - */ - void endSession(); - - /** - * Returns the callback ID - * - * @return the callback ID - */ - Object getCallbackID(); - - /** - * Sets the callback ID. - * - * @param callbackID the callback ID - */ - void setCallbackID(Object callbackID); - - /** - * Returns the callback object - * - * @return the callback object - */ - Object getCallback(); - - /** - * Sets the callback object - * - * @param callback the callback object - */ - void setCallback(Object callback); -} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceRuntimeException.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceRuntimeException.java deleted file mode 100644 index bea0af5f8d..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceRuntimeException.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca; - - -/** - * @version $Rev$ $Date$ - */ -public class ServiceRuntimeException extends RuntimeException { - private static final long serialVersionUID = -3876058842262557092L; - - public ServiceRuntimeException() { - } - - public ServiceRuntimeException(String message) { - super(message); - } - - public ServiceRuntimeException(String message, Throwable cause) { - super(message, cause); - } - - public ServiceRuntimeException(Throwable cause) { - super(cause); - } -} \ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceUnavailableException.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceUnavailableException.java deleted file mode 100644 index 8f51fc966c..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceUnavailableException.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca; - -/** - * Exception used to indicate that a runtime exception occurred during the invocation of and external service. - * - * @version $Rev$ $Date$ - */ -public class ServiceUnavailableException extends ServiceRuntimeException { - - private static final long serialVersionUID = -5869397223249401047L; - - /** - * Constructs a new ServiceUnavailableException. - */ - public ServiceUnavailableException() { - super((Throwable) null); - } - - /** - * Constructs a new ServiceUnavailableException with the specified detail message. - * - * @param message The detail message (which is saved to later retrieval by the getMessage() method). - */ - public ServiceUnavailableException(String message) { - super(message); - } - - /** - * Constructs a new ServiceUnavailableException with the specified cause. - * - * @param cause The cause (which is saved to later retrieval by the getCause() method). - */ - public ServiceUnavailableException(Throwable cause) { - super(cause); - } - - /** - * Constructs a new ServiceUnavailableException with the specified detail message and cause. - * @param message - * The message (which is saved to later retrieval by the getMessage() method). - * @param cause - * The cause (which is saved to later retrieval by the getCause() method). - */ - public ServiceUnavailableException(String message, Throwable cause) { - super(message, cause); - } - -} \ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/SessionEndedException.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/SessionEndedException.java deleted file mode 100644 index 4bdb82f9da..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/SessionEndedException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca; - -/** - * @version $Rev$ $Date$ - */ -public class SessionEndedException extends ServiceRuntimeException { - private static final long serialVersionUID = 3734864942222558406L; - - public SessionEndedException() { - } - - public SessionEndedException(String message) { - super(message); - } - - public SessionEndedException(String message, Throwable cause) { - super(message, cause); - } - - public SessionEndedException(Throwable cause) { - super(cause); - } -} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/Version.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/Version.java deleted file mode 100644 index 6f3ab8fb4e..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/Version.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca; - -/** - * Class providing information on the version of the specification - * supported by these API classes. - * - * @version $Rev$ $Date$ - */ -public final class Version { - /** - * Identifier for version 0.9 - */ - public static final String VERSION_0_9 = "0.9"; - - /** - * Identifier for the XML Namespace for version 0.9 - */ - public static final String XML_NAMESPACE_0_9 = "http://www.osoa.org/xmlns/sca/0.9"; - - /** - * The specification version of these API classes. - */ - public static final String API_VERSION = VERSION_0_9; - - private Version() { - } -} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/AllowsPassByReference.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/AllowsPassByReference.java deleted file mode 100644 index c972c44468..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/AllowsPassByReference.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca.annotations; - -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.TYPE; -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import java.lang.annotation.Target; - -/** - * @version $Rev$ $Date$ - */ -@Target({TYPE, METHOD}) -@Retention(RUNTIME) -public @interface AllowsPassByReference { -} - diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Callback.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Callback.java deleted file mode 100644 index 19bc9ab624..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Callback.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca.annotations; - -import static java.lang.annotation.ElementType.*; -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import java.lang.annotation.Target; - -/** - * @version $Rev$ $Date$ - */ -@Target({TYPE, METHOD, FIELD}) -@Retention(RUNTIME) -public @interface Callback { - Class value() default Void.class; -} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/ComponentMetaData.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/ComponentMetaData.java deleted file mode 100644 index c35b023ea4..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/ComponentMetaData.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca.annotations; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import java.lang.annotation.Target; - -/** - * Annotation used to indicate a field or method that is used to inject the component's metadata object. - * - * @version $Rev$ $Date$ - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) -public @interface ComponentMetaData { -} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/ComponentName.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/ComponentName.java deleted file mode 100644 index 46a117ea04..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/ComponentName.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca.annotations; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import java.lang.annotation.Target; - -/** - * Annotation used to indicate a field or method that is used to inject the component's name. - * - * @version $Rev$ $Date$ - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) -public @interface ComponentName { -} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Context.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Context.java deleted file mode 100644 index 1139e97a96..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Context.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca.annotations; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import java.lang.annotation.Target; - -/** - * Annotation used to indicate a field or method that is used to inject the component's ModuleContext. - * - * @version $Rev$ $Date$ - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) -public @interface Context { -} - diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Destroy.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Destroy.java deleted file mode 100644 index c75e0fc165..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Destroy.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca.annotations; - -import static java.lang.annotation.ElementType.METHOD; -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import java.lang.annotation.Target; - -/** - * Annotation used to indicate a method that will be called by the container when the - * scope defined for the local service ends. - * - * @version $Rev$ $Date$ - */ -@Target(METHOD) -@Retention(RUNTIME) -public @interface Destroy { -} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Init.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Init.java deleted file mode 100644 index 94745a64d2..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Init.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca.annotations; - -import static java.lang.annotation.ElementType.METHOD; -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import java.lang.annotation.Target; - -/** - * Annotation used to indicate a method that will be called by the container when the - * scope defined for the local service begins. - * - * @version $Rev$ $Date$ - */ -@Target(METHOD) -@Retention(RUNTIME) -public @interface Init { - /** - * Instructs the container when a component instance should be instantiated. - * If true, then the component will be instantiated when its scope begins; - * if false it will be instantiated when first referenced. - */ - public boolean eager() default false; -} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Property.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Property.java deleted file mode 100644 index b9cee1765a..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Property.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca.annotations; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import java.lang.annotation.Target; - -/** - * Annotation used to indicate a field or method that is used to inject a configuration property value. - * - * @version $Rev$ $Date$ - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) -public @interface Property { - /** - * The name of the property. If not specified then the name will be derived from the annotated field. - */ - public String name() default ""; - - /** - * Indicates if a value must be specified. - */ - public boolean required() default false; -} - diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Reference.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Reference.java deleted file mode 100644 index f7f390da0d..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Reference.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca.annotations; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import java.lang.annotation.Target; - -/** - * Annotation used to indicate a field or method that is used to inject a reference. - * - * @version $Rev$ $Date$ - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) -public @interface Reference { - /** - * The name of the reference. If not specified then the name will be derived from the annotated field. - */ - public String name() default ""; - - /** - * Indicates if a reference must be specified. - */ - public boolean required() default false; -} - diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Remotable.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Remotable.java deleted file mode 100644 index 4048e240b6..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Remotable.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca.annotations; - -import static java.lang.annotation.ElementType.TYPE; -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import java.lang.annotation.Target; - -/** - * Annotation used to indicate a Java interface as remotable. - * Remotable interfaces use pass-by-value semantics, can be published as entry points - * and used for external services. - * - * @version $Rev$ $Date$ - */ -@Target(TYPE) -@Retention(RUNTIME) -public @interface Remotable { -} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Scope.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Scope.java deleted file mode 100644 index 2e0f474687..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Scope.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca.annotations; - -import static java.lang.annotation.ElementType.TYPE; -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import java.lang.annotation.Target; - -/** - * Annotation used to indicate a scoped service. - * - * @version $Rev$ $Date$ - */ -@Target(TYPE) -@Retention(RUNTIME) -public @interface Scope { - /** - * The name of the scope. Values currently defined by the specification are: - *

    - *
  • stateless (default)
  • - *
  • request
  • - *
  • session
  • - *
  • module
  • - *
- */ - String value() default "stateless"; -} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Service.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Service.java deleted file mode 100644 index 3c51316c14..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Service.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca.annotations; - -import static java.lang.annotation.ElementType.TYPE; -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import java.lang.annotation.Target; - -/** - * Annotation used to indicate the service interfaces exposed by a Java class. - * - * @version $Rev$ $Date$ - */ -@Target({TYPE}) -@Retention(RUNTIME) -public @interface Service { - /** - * Array of interfaces that should be exposed as services. - */ - Class[] interfaces() default {}; - - /** - * Shortcut allowing a single interface to be exposed. - */ - Class value() default Void.class; -} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Session.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Session.java deleted file mode 100644 index 11a90d3159..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Session.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca.annotations; - -import static java.lang.annotation.ElementType.TYPE; -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import java.lang.annotation.Target; - -/** - * Annotation used to indicate the characteristics of a session. - * - * @version $Rev$ $Date$ - */ -@Target(TYPE) -@Retention(RUNTIME) -public @interface Session { - /** - * The maximum time that can pass between operations in a single conversation. - * If this time is exceeded the container may end the conversation. - */ - public String maxIdleTime() default ""; - - /** - * The maximum time that a conversation may remain active. - * If this time is exceeded the container may end the conversation. - */ - public String maxAge() default ""; - - /** - * If true, indicates that only the user that initiated the conversation - * has the authority to continue it. - */ - public boolean singlePrincipal() default false; -} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/SessionID.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/SessionID.java deleted file mode 100644 index 86d9605bb6..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/SessionID.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca.annotations; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import java.lang.annotation.Target; - -/** - * Annotation used to indicate a field or method that is used to inject the session ID. - * - * @version $Rev$ $Date$ - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) -public @interface SessionID { -} diff --git a/tags/java-stable-20060304/spec/sca/src/main/resources/META-INF/MANIFEST.MF b/tags/java-stable-20060304/spec/sca/src/main/resources/META-INF/MANIFEST.MF deleted file mode 100644 index f1f6da216d..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/resources/META-INF/MANIFEST.MF +++ /dev/null @@ -1,8 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: SCA APIs -Bundle-SymbolicName: org.apache.tuscany.sca.spec -Bundle-Version: 1.0.0 -Bundle-Localization: plugin -Bundle-Vendor: Apache -Export-Package: org.osoa.sca, org.osoa.sca.annotations, org.osoa.sca.model diff --git a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-binding-sca.xsd b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-binding-sca.xsd deleted file mode 100644 index 2e379cfa59..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-binding-sca.xsd +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-binding-webservice.xsd b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-binding-webservice.xsd deleted file mode 100644 index 51b6458958..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-binding-webservice.xsd +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-core.xsd b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-core.xsd deleted file mode 100644 index a92bb4d0bf..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-core.xsd +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-implementation-java.xsd b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-implementation-java.xsd deleted file mode 100644 index cf155e3dfb..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-implementation-java.xsd +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-interface-java.xsd b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-interface-java.xsd deleted file mode 100644 index b0f9aec48c..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-interface-java.xsd +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-interface-wsdl.xsd b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-interface-wsdl.xsd deleted file mode 100644 index 7f67de3d29..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-interface-wsdl.xsd +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca.xsd b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca.xsd deleted file mode 100644 index b0493eb42e..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca.xsd +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sca/src/test/java/org/osoa/sca/annotations/CallbackTestCase.java b/tags/java-stable-20060304/spec/sca/src/test/java/org/osoa/sca/annotations/CallbackTestCase.java deleted file mode 100644 index d45f1198fb..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/test/java/org/osoa/sca/annotations/CallbackTestCase.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca.annotations; - -import java.lang.reflect.Field; -import java.lang.reflect.Method; - -import junit.framework.TestCase; -import org.osoa.sca.annotations.usage.CallbackType; - -/** - * @version $Rev$ $Date$ - */ -public class CallbackTestCase extends TestCase { - private Class type; - private Field field; - private Method method; - - public void testTypeDeclaration() { - assertTrue(type.isAnnotationPresent(Callback.class)); - Callback callback = type.getAnnotation(Callback.class); - assertEquals(Object.class, callback.value()); - } - - public void testField() { - assertTrue(field.isAnnotationPresent(Callback.class)); - Callback callback = field.getAnnotation(Callback.class); - assertEquals(Void.class, callback.value()); - } - - public void testMethod() { - assertTrue(method.isAnnotationPresent(Callback.class)); - Callback callback = method.getAnnotation(Callback.class); - assertEquals(Void.class, callback.value()); - } - - protected void setUp() throws Exception { - super.setUp(); - type = CallbackType.class; - field = type.getDeclaredField("cbField"); - method = type.getMethod("cbMethod"); - } -} \ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sca/src/test/java/org/osoa/sca/annotations/usage/CallbackType.java b/tags/java-stable-20060304/spec/sca/src/test/java/org/osoa/sca/annotations/usage/CallbackType.java deleted file mode 100644 index e43e8f146e..0000000000 --- a/tags/java-stable-20060304/spec/sca/src/test/java/org/osoa/sca/annotations/usage/CallbackType.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.osoa.sca.annotations.usage; - -import org.osoa.sca.annotations.Callback; - -/** - * @version $Rev$ $Date$ - */ -@Callback(Object.class) -public class CallbackType { - @Callback - private Object cbField; - - @Callback - public void cbMethod() { - } -} diff --git a/tags/java-stable-20060304/spec/sdo/LICENSE.txt b/tags/java-stable-20060304/spec/sdo/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/tags/java-stable-20060304/spec/sdo/LICENSE.txt +++ /dev/null @@ -1,202 +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/tags/java-stable-20060304/spec/sdo/pom.xml b/tags/java-stable-20060304/spec/sdo/pom.xml deleted file mode 100644 index b9236c3008..0000000000 --- a/tags/java-stable-20060304/spec/sdo/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - org.osoa - spec - SNAPSHOT - - 4.0.0 - commonj - sdo-api - SDO API - SNAPSHOT - - - - junit - junit - 3.8.1 - test - - - diff --git a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/ChangeSummary.java b/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/ChangeSummary.java deleted file mode 100644 index 3eeacf4c01..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/ChangeSummary.java +++ /dev/null @@ -1,204 +0,0 @@ -/** - * - * - * Service Data Objects - * Version 2.0 - * Licensed Materials - Property of BEA and IBM - * - * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved. - * - * - * - */ - -package commonj.sdo; - -import java.util.List; - -/** - * A change summary is used to record changes to DataObjects, - * allowing applications to efficiently and incrementally update back-end storage when required. - */ -public interface ChangeSummary -{ - /** - * Indicates whether change logging is on (true) or off (false). - * @return true if change logging is on. - * @see #beginLogging - * @see #endLogging - */ - boolean isLogging(); - - /** - * Returns the {@link DataGraph data graph} associated with this change summary or null. - * @return the data graph. - * @see DataGraph#getChangeSummary - */ - DataGraph getDataGraph(); - - /** - * Returns a list consisting of all the {@link DataObject data objects} that have been changed while {@link #isLogging logging}. - *

- * The {@link #isCreated new} and {@link #isModified modified} objects in the List are references to objects - * associated with this ChangeSummary. - * The {@link #isDeleted deleted} objects in the List are references to objects - * at the time that event logging was enabled; - *

Each changed object must have exactly one of the following methods return true: - * {@link #isCreated isCreated}, - * {@link #isDeleted isDeleted}, or - * {@link #isModified isModified}. - * @return a list of changed data objects. - * @see #isCreated(DataObject) - * @see #isDeleted(DataObject) - * @see #isModified(DataObject) - */ - List /*DataObject*/ getChangedDataObjects(); - - /** - * Returns whether or not the specified data object was created while {@link #isLogging logging}. - * Any object that was added to the scope - * but was not in the scope when logging began, - * will be considered created. - * @param dataObject the data object in question. - * @return true if the specified data object was created. - * @see #getChangedDataObjects - */ - boolean isCreated(DataObject dataObject); - - /** - * Returns whether or not the specified data object was deleted while {@link #isLogging logging}. - * Any object that is not in scope but was in scope when logging began - * will be considered deleted. - * @param dataObject the data object in question. - * @return true if the specified data object was deleted. - * @see #getChangedDataObjects - */ - boolean isDeleted(DataObject dataObject); - - /** - * A setting encapsulates a {@link Property property} and a corresponding single value of the property's {@link Property#getType type}. - */ - public interface Setting - { - /** - * Returns the property of the setting. - * @return the setting property. - */ - Property getProperty(); - - /** - * Returns the value of the setting. - * @return the setting value. - */ - Object getValue(); - - /** - * Returns whether or not the property is set. - * @return true if the property is set. - */ - boolean isSet(); - } - - /** - * Returns a list of {@link ChangeSummary.Setting settings} - * that represent the property values of the given dataObject - * at the point when logging {@link #beginLogging() began}. - *

In the case of a {@link #isDeleted(DataObject) deleted} object, - * the List will include settings for all the Properties. - *

An old value setting indicates the value at the - * point logging begins. A setting is only produced for - * {@link #isModified modified} objects if - * either the old value differs from the current value or - * if the isSet differs from the current value. - *

No settings are produced for {@link #isCreated created} objects. - * @param dataObject the object in question. - * @return a list of settings. - * @see #getChangedDataObjects - */ - List /*ChangeSummary.Setting*/ getOldValues(DataObject dataObject); - - /** - * Clears the List of {@link #getChangedDataObjects changes} and turns change logging on. - * No operation occurs if logging is already on. - * @see #endLogging - * @see #isLogging - */ - void beginLogging(); - - /** - * An implementation that requires logging may throw an UnsupportedOperationException. - * Turns change logging off. No operation occurs if logging is already off. - * @see #beginLogging - * @see #isLogging - */ - void endLogging(); - - - /** - * Returns whether or not the specified data object was updated while {@link #isLogging logging}. - * An object that was contained in the scope when logging began - * and remains in the scope when logging ends will be considered potentially modified. - *

An object considered modified must have at least one old value setting. - * @param dataObject the data object in question. - * @return true if the specified data object was modified. - * @see #getChangedDataObjects - */ - boolean isModified(DataObject dataObject); - - /** - * Returns the ChangeSummary root DataObject - the object from which - * changes are tracked. - * When a DataGraph is used, this is the same as getDataGraph().getRootObject(). - * @return the ChangeSummary root DataObject - */ - DataObject getRootObject(); - - /** - * Returns a {@link ChangeSummary.Setting setting} for the specified property - * representing the property value of the given dataObject - * at the point when logging {@link #beginLogging() began}. - *

Returns null if the property was not modified and - * has not been {@link #isDeleted(DataObject) deleted}. - * @param dataObject the object in question. - * @param property the property of the object. - * @return the Setting for the specified property. - * @see #getChangedDataObjects - */ - Setting getOldValue(DataObject dataObject, Property property); - - /** - * Returns the value of the {@link DataObject#getContainer container} data object - * at the point when logging {@link #beginLogging() began}. - * @param dataObject the object in question. - * @return the old container data object. - */ - DataObject getOldContainer(DataObject dataObject); - - /** - * Returns the value of the {@link DataObject#getContainmentProperty containment property} data object property - * at the point when logging {@link #beginLogging() began}. - * @param dataObject the object in question. - * @return the old containment property. - */ - Property getOldContainmentProperty(DataObject dataObject); - - /** - * Returns the value of the {@link DataObject#getSequence sequence} for the data object - * at the point when logging {@link #beginLogging() began}. - * @param dataObject the object in question. - * @return the old containment property. - */ - Sequence getOldSequence(DataObject dataObject); - - /** - * This method is intended for use by service implementations only. - * Undoes all changes in the log to restore the tree of - * DataObjects to its original state when logging began. - * isLogging() is unchanged. The log is cleared. - * @see #beginLogging - * @see #endLogging - * @see #isLogging - */ - void undoChanges(); - -} diff --git a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/DataGraph.java b/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/DataGraph.java deleted file mode 100644 index 78bc7227a1..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/DataGraph.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * - * - * Service Data Objects - * Version 2.0 - * Licensed Materials - Property of BEA and IBM - * - * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved. - * - * - * - */ - -package commonj.sdo; - -import java.io.Serializable; - -/** - * A data graph is used to package a graph of {@link DataObject data objects} along with their - * metadata, that is, data describing the data. - * A data graph also contains a {@link #getChangeSummary change summary} - * which is used to record changes made to the objects in the graph. - */ - -public interface DataGraph extends Serializable -{ - /** - * Returns the root {@link DataObject data object} of this data graph. - * @return the root data object. - * @see DataObject#getDataGraph - */ - DataObject getRootObject(); - - /** - * Returns the {@link ChangeSummary change summary} associated with this data graph. - * @return the change summary. - * @see ChangeSummary#getDataGraph - */ - ChangeSummary getChangeSummary(); - - /** - * Returns the {@link Type type} with the given the {@link Type#getURI() URI}, - * or contained by the resource at the given URI, - * and with the given {@link Type#getName name}. - * @param uri the namespace URI of a type or the location URI of a resource containing a type. - * @param typeName name of a type. - * @return the type with the corresponding namespace and name. - */ - Type getType(String uri, String typeName); - - /** - * Creates a new root data object of the {@link #getType specified type}. - * An exception is thrown if a root object exists. - * @param namespaceURI namespace of the type. - * @param typeName name of the type. - * @return the new root. - * @throws IllegalStateException if the root object already exists. - * @see #createRootObject(Type) - * @see #getType(String, String) - */ - DataObject createRootObject(String namespaceURI, String typeName); - - /** - * Creates a new root data object of the specified type. - * An exception is thrown if a root object exists. - * @param type the type of the new root. - * @return the new root. - * @throws IllegalStateException if the root object already exists. - * @see #createRootObject(String, String) - */ - DataObject createRootObject(Type type); - -} diff --git a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/DataObject.java b/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/DataObject.java deleted file mode 100644 index 8a1819f475..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/DataObject.java +++ /dev/null @@ -1,1105 +0,0 @@ -/** - * - * - * Service Data Objects - * Version 2.0 - * Licensed Materials - Property of BEA and IBM - * - * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved. - * - * - * - */ - -package commonj.sdo; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Date; -import java.util.List; - -/** - * A data object is a representation of some structured data. - * It is the fundamental component in the SDO (Service Data Objects) package. - * Data objects support reflection, path-based accesss, convenience creation and deletion methods, - * and the ability to be part of a {@link DataGraph data graph}. - *

- * Each data object holds its data as a series of {@link Property Properties}. - * Properties can be accessed by name, property index, or using the property meta object itself. - * A data object can also contain references to other data objects, through reference-type Properties. - *

- * A data object has a series of convenience accessors for its Properties. - * These methods either use a path (String), - * a property index, - * or the {@link Property property's meta object} itself, to identify the property. - * Some examples of the path-based accessors are as follows: - *

- * DataObject company = ...;
- * company.get("name");                   is the same as company.get(company.getType().getProperty("name"))
- * company.set("name", "acme");
- * company.get("department.0/name")       is the same as ((DataObject)((List)company.get("department")).get(0)).get("name")
- *                                        .n  indexes from 0 ... implies the name property of the first department
- * company.get("department[1]/name")      [] indexes from 1 ... implies the name property of the first department
- * company.get("department[number=123]")  returns the first department where number=123
- * company.get("..")                      returns the containing data object
- * company.get("/")                       returns the root containing data object
- *
- *

There are general accessors for Properties, i.e., {@link #get(Property) get} and {@link #set(Property, Object) set}, - * as well as specific accessors for the primitive types and commonly used data types like - * String, Date, List, BigInteger, and BigDecimal. - */ -public interface DataObject extends Serializable -{ - /** - * Returns the value of a property of either this object or an object reachable from it, as identified by the - * specified path. - * @param path the path to a valid object and property. - * @return the value of the specified property. - * @see #get(Property) - */ - Object get(String path); - - /** - * Sets a property of either this object or an object reachable from it, as identified by the specified path, - * to the specified value. - * @param path the path to a valid object and property. - * @param value the new value for the property. - * @see #set(Property, Object) - */ - void set(String path, Object value); - - /** - * Returns whether a property of either this object or an object reachable from it, as identified by the specified path, - * is considered to be set. - * @param path the path to a valid object and property. - * @see #isSet(Property) - */ - boolean isSet(String path); - - /** - * Unsets a property of either this object or an object reachable from it, as identified by the specified path. - * @param path the path to a valid object and property. - * @see #unset(Property) - */ - void unset(String path); - - /** - * Returns the value of a boolean property identified by the specified path. - * @param path the path to a valid object and property. - * @return the boolean value of the specified property. - * @see #get(String) - */ - boolean getBoolean(String path); - - /** - * Returns the value of a byte property identified by the specified path. - * @param path the path to a valid object and property. - * @return the byte value of the specified property. - * @see #get(String) - */ - byte getByte(String path); - - /** - * Returns the value of a char property identified by the specified path. - * @param path the path to a valid object and property. - * @return the char value of the specified property. - * @see #get(String) - */ - char getChar(String path); - - /** - * Returns the value of a double property identified by the specified path. - * @param path the path to a valid object and property. - * @return the double value of the specified property. - * @see #get(String) - */ - double getDouble(String path); - - /** - * Returns the value of a float property identified by the specified path. - * @param path the path to a valid object and property. - * @return the float value of the specified property. - * @see #get(String) - */ - float getFloat(String path); - - /** - * Returns the value of a int property identified by the specified path. - * @param path the path to a valid object and property. - * @return the int value of the specified property. - * @see #get(String) - */ - int getInt(String path); - - /** - * Returns the value of a long property identified by the specified path. - * @param path the path to a valid object and property. - * @return the long value of the specified property. - * @see #get(String) - */ - long getLong(String path); - - /** - * Returns the value of a short property identified by the specified path. - * @param path the path to a valid object and property. - * @return the short value of the specified property. - * @see #get(String) - */ - short getShort(String path); - - /** - * Returns the value of a byte[] property identified by the specified path. - * @param path the path to a valid object and property. - * @return the byte[] value of the specified property. - * @see #get(String) - */ - byte[] getBytes(String path); - - /** - * Returns the value of a BigDecimal property identified by the specified path. - * @param path the path to a valid object and property. - * @return the BigDecimal value of the specified property. - * @see #get(String) - */ - BigDecimal getBigDecimal(String path); - - /** - * Returns the value of a BigInteger property identified by the specified path. - * @param path the path to a valid object and property. - * @return the BigInteger value of the specified property. - * @see #get(String) - */ - BigInteger getBigInteger(String path); - - /** - * Returns the value of a DataObject property identified by the specified path. - * @param path the path to a valid object and property. - * @return the DataObject value of the specified property. - * @see #get(String) - */ - DataObject getDataObject(String path); - - /** - * Returns the value of a Date property identified by the specified path. - * @param path the path to a valid object and property. - * @return the Date value of the specified property. - * @see #get(String) - */ - Date getDate(String path); - - /** - * Returns the value of a String property identified by the specified path. - * @param path the path to a valid object and property. - * @return the String value of the specified property. - * @see #get(String) - */ - String getString(String path); - - /** - * Returns the value of a List property identified by the specified path. - * @param path the path to a valid object and property. - * @return the List value of the specified property. - * @see #get(String) - */ - List getList(String path); - - /** - * Returns the value of a Sequence property identified by the specified path. - * @param path the path to a valid object and property. - * @return the Sequence value of the specified property. - * @see #get(String) - */ - Sequence getSequence(String path); - - /** - * Sets the value of a boolean property identified by the specified path, to the specified value. - * @param path the path to a valid object and property. - * @param value the new value for the property. - * @see #set(String, Object) - */ - void setBoolean(String path, boolean value); - - /** - * Sets the value of a byte property identified by the specified path, to the specified value. - * @param path the path to a valid object and property. - * @param value the new value for the property. - * @see #set(String, Object) - */ - void setByte(String path, byte value); - - /** - * Sets the value of a char property identified by the specified path, to the specified value. - * @param path the path to a valid object and property. - * @param value the new value for the property. - * @see #set(String, Object) - */ - void setChar(String path, char value); - - /** - * Sets the value of a double property identified by the specified path, to the specified value. - * @param path the path to a valid object and property. - * @param value the new value for the property. - * @see #set(String, Object) - */ - void setDouble(String path, double value); - - /** - * Sets the value of a float property identified by the specified path, to the specified value. - * @param path the path to a valid object and property. - * @param value the new value for the property. - * @see #set(String, Object) - */ - void setFloat(String path, float value); - - /** - * Sets the value of a int property identified by the specified path, to the specified value. - * @param path the path to a valid object and property. - * @param value the new value for the property. - * @see #set(String, Object) - */ - void setInt(String path, int value); - - /** - * Sets the value of a long property identified by the specified path, to the specified value. - * @param path the path to a valid object and property. - * @param value the new value for the property. - * @see #set(String, Object) - */ - void setLong(String path, long value); - - /** - * Sets the value of a short property identified by the specified path, to the specified value. - * @param path the path to a valid object and property. - * @param value the new value for the property. - * @see #set(String, Object) - */ - void setShort(String path, short value); - - /** - * Sets the value of a byte[] property identified by the specified path, to the specified value. - * @param path the path to a valid object and property. - * @param value the new value for the property. - * @see #set(String, Object) - */ - void setBytes(String path, byte[] value); - - /** - * Sets the value of a BigDecimal property identified by the specified path, to the specified value. - * @param path the path to a valid object and property. - * @param value the new value for the property. - * @see #set(String, Object) - */ - void setBigDecimal(String path, BigDecimal value); - - /** - * Sets the value of a BigInteger property identified by the specified path, to the specified value. - * @param path the path to a valid object and property. - * @param value the new value for the property. - * @see #set(String, Object) - */ - void setBigInteger(String path, BigInteger value); - - /** - * Sets the value of a DataObject property identified by the specified path, to the specified value. - * @param path the path to a valid object and property. - * @param value the new value for the property. - * @see #set(String, Object) - */ - void setDataObject(String path, DataObject value); - - /** - * Sets the value of a Date property identified by the specified path, to the specified value. - * @param path the path to a valid object and property. - * @param value the new value for the property. - * @see #set(String, Object) - */ - void setDate(String path, Date value); - - /** - * Sets the value of a String property identified by the specified path, to the specified value. - * @param path the path to a valid object and property. - * @param value the new value for the property. - * @see #set(String, Object) - */ - void setString(String path, String value); - - /** - * Sets the value of a List property identified by the specified path, to the specified value. - * @param path the path to a valid object and property. - * @param value the new value for the property. - * @see #set(String, Object) - * @see #setList(Property, List) - */ - void setList(String path, List value); - - /** - * Returns the value of the property at the specified index in {@link Type#getProperties property list} - * of this object's {@link Type type}. - * @param propertyIndex the index of the property. - * @return the value of the specified property. - * @see #get(Property) - */ - Object get(int propertyIndex); - - /** - * Sets the property at the specified index in {@link Type#getProperties property list} of this object's - * {@link Type type}, to the specified value. - * @param propertyIndex the index of the property. - * @param value the new value for the property. - * @see #set(Property, Object) - */ - void set(int propertyIndex, Object value); - - /** - * Returns whether the the property at the specified index in {@link Type#getProperties property list} of this object's - * {@link Type type}, is considered to be set. - * @param propertyIndex the index of the property. - * @return whether the specified property is set. - * @see #isSet(Property) - */ - boolean isSet(int propertyIndex); - - /** - * Unsets the property at the specified index in {@link Type#getProperties property list} of this object's {@link Type type}. - * @param propertyIndex the index of the property. - * @see #unset(Property) - */ - void unset(int propertyIndex); - - /** - * Returns the value of a boolean property identified by the specified property index. - * @param propertyIndex the index of the property. - * @return the boolean value of the specified property. - * @see #get(int) - */ - boolean getBoolean(int propertyIndex); - - /** - * Returns the value of a byte property identified by the specified property index. - * @param propertyIndex the index of the property. - * @return the byte value of the specified property. - * @see #get(int) - */ - byte getByte(int propertyIndex); - - /** - * Returns the value of a char property identified by the specified property index. - * @param propertyIndex the index of the property. - * @return the char value of the specified property. - * @see #get(int) - */ - char getChar(int propertyIndex); - - /** - * Returns the value of a double property identified by the specified property index. - * @param propertyIndex the index of the property. - * @return the double value of the specified property. - * @see #get(int) - */ - double getDouble(int propertyIndex); - - /** - * Returns the value of a float property identified by the specified property index. - * @param propertyIndex the index of the property. - * @return the float value of the specified property. - * @see #get(int) - */ - float getFloat(int propertyIndex); - - /** - * Returns the value of a int property identified by the specified property index. - * @param propertyIndex the index of the property. - * @return the int value of the specified property. - * @see #get(int) - */ - int getInt(int propertyIndex); - - /** - * Returns the value of a long property identified by the specified property index. - * @param propertyIndex the index of the property. - * @return the long value of the specified property. - * @see #get(int) - */ - long getLong(int propertyIndex); - - /** - * Returns the value of a short property identified by the specified property index. - * @param propertyIndex the index of the property. - * @return the short value of the specified property. - * @see #get(int) - */ - short getShort(int propertyIndex); - - /** - * Returns the value of a byte[] property identified by the specified property index. - * @param propertyIndex the index of the property. - * @return the byte[] value of the specified property. - * @see #get(int) - */ - byte[] getBytes(int propertyIndex); - - /** - * Returns the value of a BigDecimal property identified by the specified property index. - * @param propertyIndex the index of the property. - * @return the BigDecimal value of the specified property. - * @see #get(int) - */ - BigDecimal getBigDecimal(int propertyIndex); - - /** - * Returns the value of a BigInteger property identified by the specified property index. - * @param propertyIndex the index of the property. - * @return the BigInteger value of the specified property. - * @see #get(int) - */ - BigInteger getBigInteger(int propertyIndex); - - /** - * Returns the value of a DataObject property identified by the specified property index. - * @param propertyIndex the index of the property. - * @return the DataObject value of the specified property. - * @see #get(int) - */ - DataObject getDataObject(int propertyIndex); - - /** - * Returns the value of a Date property identified by the specified property index. - * @param propertyIndex the index of the property. - * @return the Date value of the specified property. - * @see #get(int) - */ - Date getDate(int propertyIndex); - - /** - * Returns the value of a String property identified by the specified property index. - * @param propertyIndex the index of the property. - * @return the String value of the specified property. - * @see #get(int) - */ - String getString(int propertyIndex); - - /** - * Returns the value of a List property identified by the specified property index. - * @param propertyIndex the index of the property. - * @return the List value of the specified property. - * @see #get(int) - */ - List getList(int propertyIndex); - - /** - * Returns the value of a Sequence property identified by the specified property index. - * @param propertyIndex the index of the property. - * @return the Sequence value of the specified property. - * @see #get(int) - */ - Sequence getSequence(int propertyIndex); - - /** - * Sets the value of a boolean property identified by the specified property index, to the specified value. - * @param propertyIndex the index of the property. - * @param value the new value for the property. - * @see #set(int, Object) - */ - void setBoolean(int propertyIndex, boolean value); - - /** - * Sets the value of a byte property identified by the specified property index, to the specified value. - * @param propertyIndex the index of the property. - * @param value the new value for the property. - * @see #set(int, Object) - */ - void setByte(int propertyIndex, byte value); - - /** - * Sets the value of a char property identified by the specified property index, to the specified value. - * @param propertyIndex the index of the property. - * @param value the new value for the property. - * @see #set(int, Object) - */ - void setChar(int propertyIndex, char value); - - /** - * Sets the value of a double property identified by the specified property index, to the specified value. - * @param propertyIndex the index of the property. - * @param value the new value for the property. - * @see #set(int, Object) - */ - void setDouble(int propertyIndex, double value); - - /** - * Sets the value of a float property identified by the specified property index, to the specified value. - * @param propertyIndex the index of the property. - * @param value the new value for the property. - * @see #set(int, Object) - */ - void setFloat(int propertyIndex, float value); - - /** - * Sets the value of a int property identified by the specified property index, to the specified value. - * @param propertyIndex the index of the property. - * @param value the new value for the property. - * @see #set(int, Object) - */ - void setInt(int propertyIndex, int value); - - /** - * Sets the value of a long property identified by the specified property index, to the specified value. - * @param propertyIndex the index of the property. - * @param value the new value for the property. - * @see #set(int, Object) - */ - void setLong(int propertyIndex, long value); - - /** - * Sets the value of a short property identified by the specified property index, to the specified value. - * @param propertyIndex the index of the property. - * @param value the new value for the property. - * @see #set(int, Object) - */ - void setShort(int propertyIndex, short value); - - /** - * Sets the value of a byte[] property identified by the specified property index, to the specified value. - * @param propertyIndex the index of the property. - * @param value the new value for the property. - * @see #set(int, Object) - */ - void setBytes(int propertyIndex, byte[] value); - - /** - * Sets the value of a BigDecimal property identified by the specified property index, to the specified value. - * @param propertyIndex the index of the property. - * @param value the new value for the property. - * @see #set(int, Object) - */ - void setBigDecimal(int propertyIndex, BigDecimal value); - - /** - * Sets the value of a BigInteger property identified by the specified property index, to the specified value. - * @param propertyIndex the index of the property. - * @param value the new value for the property. - * @see #set(int, Object) - */ - void setBigInteger(int propertyIndex, BigInteger value); - - /** - * Sets the value of a DataObject property identified by the specified property index, to the specified value. - * @param propertyIndex the index of the property. - * @param value the new value for the property. - * @see #set(int, Object) - */ - void setDataObject(int propertyIndex, DataObject value); - - /** - * Sets the value of a Date property identified by the specified property index, to the specified value. - * @param propertyIndex the index of the property. - * @param value the new value for the property. - * @see #set(int, Object) - */ - void setDate(int propertyIndex, Date value); - - /** - * Sets the value of a String property identified by the specified property index, to the specified value. - * @param propertyIndex the index of the property. - * @param value the new value for the property. - * @see #set(int, Object) - */ - void setString(int propertyIndex, String value); - - /** - * Sets the value of a List property identified by the specified property index, to the specified value. - * @param propertyIndex the index of the property. - * @param value the new value for the property. - * @see #set(int, Object) - * @see #setList(Property, List) - */ - void setList(int propertyIndex, List value); - - /** - * Returns the value of the given property of this object. - *

- * If the property is {@link Property#isMany many-valued}, - * the result will be a {@link java.util.List} - * and each object in the List will be {@link Type#isInstance an instance of} - * the property's {@link Property#getType type}. - * Otherwise the result will directly be an instance of the property's type. - * @param property the property of the value to fetch. - * @return the value of the given property of the object. - * @see #set(Property, Object) - * @see #unset(Property) - * @see #isSet(Property) - */ - Object get(Property property); - - /** - * Sets the value of the given property of the object to the new value. - *

- * If the property is {@link Property#isMany many-valued}, - * the new value must be a {@link java.util.List} - * and each object in that list must be {@link Type#isInstance an instance of} - * the property's {@link Property#getType type}; - * the existing contents are cleared and the contents of the new value are added. - * Otherwise the new value directly must be an instance of the property's type - * and it becomes the new value of the property of the object. - * @param property the property of the value to set. - * @param value the new value for the property. - * @see #unset(Property) - * @see #isSet(Property) - * @see #get(Property) - */ - void set(Property property, Object value); - - /** - * Returns whether the property of the object is considered to be set. - *

- * isSet() for many-valued Properties returns true if the List is not empty and - * false if the List is empty. For single-valued Properties: - *

  • If the Property has not been set() or has been unset() then isSet() returns false.
  • - *
  • If the current value is not the Property's default or null, isSet() returns true.
  • - *
  • For the remaining cases the implementation may decide between two policies:
  • - *
    1. any call to set() without a call to unset() will cause isSet() to return true, or
    2. - *
    3. the current value is compared to the default value and isSet() returns true when they differ.
    4. - *

- * @param property the property in question. - * @return whether the property of the object is set. - * @see #set(Property, Object) - * @see #unset(Property) - * @see #get(Property) - */ - boolean isSet(Property property); - - /** - * Unsets the property of the object. - *

- * If the property is {@link Property#isMany many-valued}, - * the value must be an {@link java.util.List} - * and that list is cleared. - * Otherwise, - * the value of the property of the object - * is set to the property's {@link Property#getDefault default value}. - * The property will no longer be considered {@link #isSet set}. - * @param property the property in question. - * @see #isSet(Property) - * @see #set(Property, Object) - * @see #get(Property) - */ - void unset(Property property); - - /** - * Returns the value of the specified boolean property. - * @param property the property to get. - * @return the boolean value of the specified property. - * @see #get(Property) - */ - boolean getBoolean(Property property); - - /** - * Returns the value of the specified byte property. - * @param property the property to get. - * @return the byte value of the specified property. - * @see #get(Property) - */ - byte getByte(Property property); - - /** - * Returns the value of the specified char property. - * @param property the property to get. - * @return the char value of the specified property. - * @see #get(Property) - */ - char getChar(Property property); - - /** - * Returns the value of the specified double property. - * @param property the property to get. - * @return the double value of the specified property. - * @see #get(Property) - */ - double getDouble(Property property); - - /** - * Returns the value of the specified float property. - * @param property the property to get. - * @return the float value of the specified property. - * @see #get(Property) - */ - float getFloat(Property property); - - /** - * Returns the value of the specified int property. - * @param property the property to get. - * @return the int value of the specified property. - * @see #get(Property) - */ - int getInt(Property property); - - /** - * Returns the value of the specified long property. - * @param property the property to get. - * @return the long value of the specified property. - * @see #get(Property) - */ - long getLong(Property property); - - /** - * Returns the value of the specified short property. - * @param property the property to get. - * @return the short value of the specified property. - * @see #get(Property) - */ - short getShort(Property property); - - /** - * Returns the value of the specified byte[] property. - * @param property the property to get. - * @return the byte[] value of the specified property. - * @see #get(Property) - */ - byte[] getBytes(Property property); - - /** - * Returns the value of the specified BigDecimal property. - * @param property the property to get. - * @return the BigDecimal value of the specified property. - * @see #get(Property) - */ - BigDecimal getBigDecimal(Property property); - - /** - * Returns the value of the specified BigInteger property. - * @param property the property to get. - * @return the BigInteger value of the specified property. - * @see #get(Property) - */ - BigInteger getBigInteger(Property property); - - /** - * Returns the value of the specified DataObject property. - * @param property the property to get. - * @return the DataObject value of the specified property. - * @see #get(Property) - */ - DataObject getDataObject(Property property); - - /** - * Returns the value of the specified Date property. - * @param property the property to get. - * @return the Date value of the specified property. - * @see #get(Property) - */ - Date getDate(Property property); - - /** - * Returns the value of the specified String property. - * @param property the property to get. - * @return the String value of the specified property. - * @see #get(Property) - */ - String getString(Property property); - - /** - * Returns the value of the specified List property. - * The List returned contains the current values. - * Updates through the List interface operate on the current values of the DataObject. - * Each access returns the same List object. - * @param property the property to get. - * @return the List value of the specified property. - * @see #get(Property) - */ - List getList(Property property); - - /** - * Returns the value of the specified Sequence property. - * @param property the property to get. - * @return the Sequence value of the specified property. - * @see #get(Property) - */ - Sequence getSequence(Property property); - - /** - * Sets the value of the specified boolean property, to the specified value. - * @param property the property to set. - * @param value the new value for the property. - * @see #set(Property, Object) - */ - void setBoolean(Property property, boolean value); - - /** - * Sets the value of the specified byte property, to the specified value. - * @param property the property to set. - * @param value the new value for the property. - * @see #set(Property, Object) - */ - void setByte(Property property, byte value); - - /** - * Sets the value of the specified char property, to the specified value. - * @param property the property to set. - * @param value the new value for the property. - * @see #set(Property, Object) - */ - void setChar(Property property, char value); - - /** - * Sets the value of the specified double property, to the specified value. - * @param property the property to set. - * @param value the new value for the property. - * @see #set(Property, Object) - */ - void setDouble(Property property, double value); - - /** - * Sets the value of the specified float property, to the specified value. - * @param property the property to set. - * @param value the new value for the property. - * @see #set(Property, Object) - */ - void setFloat(Property property, float value); - - /** - * Sets the value of the specified int property, to the specified value. - * @param property the property to set. - * @param value the new value for the property. - * @see #set(Property, Object) - */ - void setInt(Property property, int value); - - /** - * Sets the value of the specified long property, to the specified value. - * @param property the property to set. - * @param value the new value for the property. - * @see #set(Property, Object) - */ - void setLong(Property property, long value); - - /** - * Sets the value of the specified short property, to the specified value. - * @param property the property to set. - * @param value the new value for the property. - * @see #set(Property, Object) - */ - void setShort(Property property, short value); - - /** - * Sets the value of the specified byte[] property, to the specified value. - * @param property the property to set. - * @param value the new value for the property. - * @see #set(Property, Object) - */ - void setBytes(Property property, byte[] value); - - /** - * Sets the value of the specified BigDecimal property, to the specified value. - * @param property the property to set. - * @param value the new value for the property. - * @see #set(Property, Object) - */ - void setBigDecimal(Property property, BigDecimal value); - - /** - * Sets the value of the specified BigInteger property, to the specified value. - * @param property the property to set. - * @param value the new value for the property. - * @see #set(Property, Object) - */ - void setBigInteger(Property property, BigInteger value); - - /** - * Sets the value of the specified DataObject property, to the specified value. - * @param property the property to set. - * @param value the new value for the property. - * @see #set(Property, Object) - */ - void setDataObject(Property property, DataObject value); - - /** - * Sets the value of the specified Date property, to the specified value. - * @param property the property to set. - * @param value the new value for the property. - * @see #set(Property, Object) - */ - void setDate(Property property, Date value); - - /** - * Sets the value of the specified String property, to the specified value. - * @param property the property to set. - * @param value the new value for the property. - * @see #set(Property, Object) - */ - void setString(Property property, String value); - - /** - * Sets the value of the specified List property, to the specified value. - *

The new value must be a {@link java.util.List} - * and each object in that list must be {@link Type#isInstance an instance of} - * the property's {@link Property#getType type}; - * the existing contents are cleared and the contents of the new value are added. - * @param property the property to set. - * @param value the new value for the property. - * @see #set(Property, Object) - */ - void setList(Property property, List value); - - /** - * Returns a new {@link DataObject data object} contained by this object using the specified property, - * which must be a {@link Property#isContainment containment property}. - * The type of the created object is the {@link Property#getType declared type} of the specified property. - * @param propertyName the name of the specified containment property. - * @return the created data object. - * @see #createDataObject(String, String, String) - */ - DataObject createDataObject(String propertyName); - - /** - * Returns a new {@link DataObject data object} contained by this object using the specified property, - * which must be a {@link Property#isContainment containment property}. - * The type of the created object is the {@link Property#getType declared type} of the specified property. - * @param propertyIndex the index of the specified containment property. - * @return the created data object. - * @see #createDataObject(int, String, String) - */ - DataObject createDataObject(int propertyIndex); - - /** - * Returns a new {@link DataObject data object} contained by this object using the specified property, - * which must be a {@link Property#isContainment containment property}. - * The type of the created object is the {@link Property#getType declared type} of the specified property. - * @param property the specified containment property. - * @return the created data object. - * @see #createDataObject(Property, Type) - */ - DataObject createDataObject(Property property); - - /** - * Returns a new {@link DataObject data object} contained by this object using the specified property, - * which must be a {@link Property#isContainment containment property}. - * The type of the created object is specified by the packageURI and typeName arguments. - * The specified type must be a compatible target for the property identified by propertyName. - * @param propertyName the name of the specified containment property. - * @param namespaceURI the namespace URI of the package containing the type of object to be created. - * @param typeName the name of a type in the specified package. - * @return the created data object. - * @see #createDataObject(String) - * @see DataGraph#getType - */ - DataObject createDataObject(String propertyName, String namespaceURI, String typeName); - - /** - * Returns a new {@link DataObject data object} contained by this object using the specified property, - * which must be a {@link Property#isContainment containment property}. - * The type of the created object is specified by the packageURI and typeName arguments. - * The specified type must be a compatible target for the property identified by propertyIndex. - * @param propertyIndex the index of the specified containment property. - * @param namespaceURI the namespace URI of the package containing the type of object to be created. - * @param typeName the name of a type in the specified package. - * @return the created data object. - * @see #createDataObject(int) - * @see DataGraph#getType - */ - DataObject createDataObject(int propertyIndex, String namespaceURI, String typeName); - - /** - * Returns a new {@link DataObject data object} contained by this object using the specified property, - * which must be of {@link Property#isContainment containment type}. - * The type of the created object is specified by the type argument, - * which must be a compatible target for the speicifed property. - * @param property a containment property of this object. - * @param type the type of object to be created. - * @return the created data object. - * @see #createDataObject(int) - */ - DataObject createDataObject(Property property, Type type); - - /** - * Remove this object from its container and then unset all its non-{@link Property#isReadOnly readOnly} Properties. - * If this object is contained by a {@link Property#isReadOnly readOnly} {@link Property#isContainment containment property}, its non-{@link Property#isReadOnly readOnly} Properties will be unset but the object will not be removed from its container. - * All DataObjects recursively contained by {@link Property#isContainment containment Properties} will also be deleted. - */ - void delete(); - - /** - * Returns the containing {@link DataObject data object} - * or null if there is no container. - * @return the containing data object or null. - */ - DataObject getContainer(); - - /** - * Return the Property of the {@link DataObject data object} containing this data object - * or null if there is no container. - * @return the property containing this data object. - */ - Property getContainmentProperty(); - - /** - * Returns the {@link DataGraph data graph} for this object or null if there isn't one. - * @return the containing data graph or null. - */ - DataGraph getDataGraph(); - - /** - * Returns the data object's type. - *

- * The type defines the Properties available for reflective access. - * @return the type. - */ - Type getType(); - - /** - * Returns the Sequence for this DataObject. - * When getType().isSequencedType() == true, - * the Sequence of a DataObject corresponds to the - * XML elements representing the values of its Properties. - * Updates through DataObject and the Lists or Sequences returned - * from DataObject operate on the same data. - * When getType().isSequencedType() == false, null is returned. - * @return the Sequence or null. - */ - Sequence getSequence(); - - /** - * Returns a read-only List of the Properties currently used in this DataObject. - * This list will contain all of the Properties in getType().getProperties() - * and any Properties where isSet(property) is true. - * For example, Properties resulting from the use of - * open or mixed XML content are present if allowed by the Type. - * the List does not contain duplicates. - * The order of the Properties in the List begins with getType().getProperties() - * and the order of the remaining Properties is determined by the implementation. - * The same list will be returned unless the DataObject is updated so that - * the contents of the List change. - * @return the List of Properties currently used in this DataObject. - */ - List /* Property */ getInstanceProperties(); - - /** - * Returns the named Property from the current instance properties, - * or null if not found. The instance properties are getInstanceProperties(). - * @param propertyName the name of the Property - * @return the named Property from the DataObject's current instance properties, or null. - */ - Property getProperty(String propertyName); - - /** - * Returns the root {@link DataObject data object}. - * @return the root data object. - */ - DataObject getRootObject(); - - /** - * Returns the ChangeSummary with scope covering this dataObject, or null - * if there is no ChangeSummary. - * @return the ChangeSummary with scope covering this dataObject, or null. - */ - ChangeSummary getChangeSummary(); - - /** - * Removes this DataObject from its container, if any. - * Same as - * getContainer().getList(getContainmentProperty()).remove(this) or - * getContainer().unset(getContainmentProperty()) - * depending on getContainmentProperty().isMany() respectively. - */ - void detach(); -} diff --git a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/Property.java b/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/Property.java deleted file mode 100644 index cc96e90b44..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/Property.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * - * - * Service Data Objects - * Version 2.0 - * Licensed Materials - Property of BEA and IBM - * - * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved. - * - * - * - */ - -package commonj.sdo; - -import java.util.List; - -/** - * A representation of a Property in the {@link Type type} of a {@link DataObject data object}. - */ -public interface Property -{ - /** - * Returns the name of the Property. - * @return the Property name. - */ - String getName(); - - /** - * Returns the type of the Property. - * @return the Property type. - */ - Type getType(); - - /** - * Returns whether the Property is many-valued. - * @return true if the Property is many-valued. - */ - boolean isMany(); - - /** - * Returns whether the Property is containment, i.e., whether it represents by-value composition. - * @return true if the Property is containment. - */ - boolean isContainment(); - - /** - * Returns the containing type of this Property. - * @return the Property's containing type. - * @see Type#getProperties() - */ - Type getContainingType(); - - /** - * Returns the default value this Property will have in a {@link DataObject data object} where the Property hasn't been set. - * @return the default value. - */ - Object getDefault(); - - /** - * Returns true if values for this Property cannot be modified using the SDO APIs. - * When true, DataObject.set(Property property, Object value) throws an exception. - * Values may change due to other factors, such as services operating on DataObjects. - * @return true if values for this Property cannot be modified. - */ - boolean isReadOnly(); - - /** - * Returns the opposite Property if the Property is bi-directional or null otherwise. - * @return the opposite Property if the Property is bi-directional or null - */ - Property getOpposite(); - - /** - * Return a list of alias names for this Property. - * @return a list of alias names for this Property. - */ - List /*String*/ getAliasNames(); -} diff --git a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/Sequence.java b/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/Sequence.java deleted file mode 100644 index b46a5be7e0..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/Sequence.java +++ /dev/null @@ -1,131 +0,0 @@ -/** - * - * - * Service Data Objects - * Version 2.0 - * Licensed Materials - Property of BEA and IBM - * - * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved. - * - * - * - */ - -package commonj.sdo; - -/** - * A sequence is a heterogeneous list of {@link Property properties} and corresponding values. - * It represents an ordered arbitrary mixture of data values from more than one property of a {@link DataObject data object}. - */ -public interface Sequence -{ - /** - * Returns the number of entries in the sequence. - * @return the number of entries. - */ - int size(); - - /** - * Returns the property for the given entry index. - * Returns null for mixed text entries. - * @param index the index of the entry. - * @return the property or null for the given entry index. - */ - Property getProperty(int index); - - /** - * Returns the property value for the given entry index. - * @param index the index of the entry. - * @return the value for the given entry index. - */ - Object getValue(int index); - - /** - * Sets the entry at a specified index to the new value. - * @param index the index of the entry. - * @param value the new value for the entry. - */ - Object setValue(int index, Object value); - - /** - * Adds a new entry with the specified property name and value - * to the end of the entries. - * @param propertyName the name of the entry's property. - * @param value the value for the entry. - */ - boolean add(String propertyName, Object value); - - /** - * Adds a new entry with the specified property index and value - * to the end of the entries. - * @param propertyIndex the index of the entry's property. - * @param value the value for the entry. - */ - boolean add(int propertyIndex, Object value); - - /** - * Adds a new entry with the specified property and value - * to the end of the entries. - * @param property the property of the entry. - * @param value the value for the entry. - */ - boolean add(Property property, Object value); - - /** - * Adds a new entry with the specified property name and value - * at the specified entry index. - * @param index the index at which to add the entry. - * @param propertyName the name of the entry's property. - * @param value the value for the entry. - */ - void add(int index, String propertyName, Object value); - - /** - * Adds a new entry with the specified property index and value - * at the specified entry index. - * @param index the index at which to add the entry. - * @param propertyIndex the index of the entry's property. - * @param value the value for the entry. - */ - void add(int index, int propertyIndex, Object value); - - /** - * Adds a new entry with the specified property and value - * at the specified entry index. - * @param index the index at which to add the entry. - * @param property the property of the entry. - * @param value the value for the entry. - */ - void add(int index, Property property, Object value); - - /** - * Removes the entry at the given entry index. - * @param index the index of the entry. - */ - void remove(int index); - - /** - * Moves the entry at fromIndex to toIndex. - * @param toIndex the index of the entry destination. - * @param fromIndex the index of the entry to move. - */ - void move(int toIndex, int fromIndex); - - /** - * Adds a new entry with the SDO text Property - * to the end of the Sequence. - * Same as add(property, text) where property is the SDO text Property. - * @param text value of the entry. - */ - void add(String text); - - /** - * Adds a new entry with the SDO text Property - * at the given index. - * Same as add(index, property, text) where property is the SDO text Property. - * @param index the index at which to add the entry. - * @param text value of the entry. - */ - void add(int index, String text); - -} diff --git a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/Type.java b/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/Type.java deleted file mode 100644 index 85d43aad60..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/Type.java +++ /dev/null @@ -1,143 +0,0 @@ -/** - * - * - * Service Data Objects - * Version 2.0 - * Licensed Materials - Property of BEA and IBM - * - * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved. - * - * - * - */ - -package commonj.sdo; - -import java.util.List; - -/** - * A representation of the type of a {@link Property property} of a {@link DataObject data object}. - */ -public interface Type -{ - /** - * Returns the name of the type. - * @return the type name. - */ - String getName(); - - /** - * Returns the namespace URI of the type. - * @return the namespace URI. - */ - String getURI(); - - /** - * Returns the Java class that this type represents. - * @return the Java class. - */ - Class getInstanceClass(); - - /** - * Returns whether the specified object is an instance of this type. - * @param object the object in question. - * @return true if the object is an instance. - * @see Class#isInstance - */ - boolean isInstance(Object object); - - /** - * Returns the List of the {@link Property Properties} of this type. - *

- * The expression - *

-   *   type.getProperties().indexOf(property)
-   *
- * yields the property's index relative to this type. - * As such, these expressions are equivalent: - *
-   *    dataObject.{@link DataObject#get(int) get}(i)
-   *    dataObject.{@link DataObject#get(Property) get}((Property)dataObject.getType().getProperties().get(i));
-   *
- *

- * @return the Properties of the type. - * @see Property#getContainingType - */ - List /*Property*/ getProperties(); - - /** - * Returns from {@link #getProperties all the Properties} of this type, the one with the specified name. - * As such, these expressions are equivalent: - *
-   *    dataObject.{@link DataObject#get(String) get}("name")
-   *    dataObject.{@link DataObject#get(Property) get}(dataObject.getType().getProperty("name"))
-   *
- *

- * @return the Property with the specified name. - * @see #getProperties - */ - Property getProperty(String propertyName); - - /** - * Indicates if this Type specifies DataTypes (true) or DataObjects (false). - * When false, any object that is an instance of this type - * also implements the DataObject interface. - * True for simple types such as Strings and numbers. - * For any object: - *
-   *   isInstance(object) && !isDataType() implies
-   *   DataObject.class.isInstance(object) returns true. 
-   * 
- * @return true if Type specifies DataTypes, false for DataObjects. - */ - boolean isDataType(); - - /** - * Indicates if this Type allows any form of open content. If false, - * dataObject.getInstanceProperties() must be the same as - * dataObject.getType().getProperties() for any DataObject dataObject of this Type. - * @return true if this Type allows open content. - */ - boolean isOpen(); - - /** - * Indicates if this Type specifies Sequenced DataObjects. - * Sequenced DataObjects are used when the order of values - * between Properties must be preserved. - * When true, a DataObject will return a Sequence. For example, - *
-   *  Sequence elements = dataObject.{@link DataObject#getSequence() getSequence}();
-   * 
- * @return true if this Type specifies Sequenced DataObjects. - */ - boolean isSequenced(); - - /** - * Indicates if this Type is abstract. If true, this Type cannot be - * instantiated. Abstract types cannot be used in DataObject or - * DataFactory create methods. - * @return true if this Type is abstract. - */ - boolean isAbstract(); - - /** - * Returns the List of base Types for this Type. The List is empty - * if there are no base Types. XSD , , and - * Java extends keyword are mapped to this list. - * @return the List of base Types for this Type. - */ - List /*Type*/ getBaseTypes(); - - /** - * Returns the Properties declared in this Type as opposed to - * those declared in base Types. - * @return the Properties declared in this Type. - */ - List /*Property*/ getDeclaredProperties(); - - /** - * Return a list of alias names for this Type. - * @return a list of alias names for this Type. - */ - List /*String*/ getAliasNames(); -} diff --git a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/CopyHelper.java b/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/CopyHelper.java deleted file mode 100644 index f0bf98aada..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/CopyHelper.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * - * - * Service Data Objects - * Version 2.0 - * Licensed Materials - Property of BEA and IBM - * - * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved. - * - * - * - */ - -package commonj.sdo.helper; - -import commonj.sdo.DataObject; -import commonj.sdo.impl.HelperProvider; - -/** - * A helper for copying DataObjects. - */ -public interface CopyHelper -{ - /** - * Create a shallow copy of the DataObject dataObject: - * Creates a new DataObject copiedDataObject with the same values - * as the source dataObject for each property where - * property.getType().isDataType() is true. - * The value of such a Property property in copiedDataObject is: - * dataObject.get(property) for single-valued Properties - * (copiedDataObject.get(property) equals() dataObject.get(property)), or - * a List where each member is equal to the member at the - * same index in dataObject for multi-valued Properties - * copiedDataObject.getList(property).get(i) equals() dataObject.getList(property).get(i) - * The copied Object is unset for each Property where - * property.getType().isDataType() is false - * since they are not copied. - * Read-only properties are copied. - * A copied object shares metadata with the source object - * sourceDO.getType() == copiedDO.getType() - * If a ChangeSummary is part of the source DataObject - * the copy has a new, empty ChangeSummary. - * Logging state is the same as the source ChangeSummary. - * - * @param dataObject to be copied - * @return copy of dataObject - */ - DataObject copyShallow(DataObject dataObject); - - /** - * Create a deep copy of the DataObject tree: - * Copies the dataObject and all its {@link commonj.sdo.Property#isContainment() contained} - * DataObjects recursively. - * Values of Properties are copied as in shallow copy, - * and values of Properties where - * property.getType().isDataType() is false - * are copied where each value copied must be a - * DataObject contained by the source dataObject. - * If a DataObject is outside the DataObject tree and the - * property is bidirectional, then the DataObject is skipped. - * If a DataObject is outside the DataObject tree and the - * property is unidirectional, then the same DataObject is referenced. - * Read-only properties are copied. - * If any DataObject referenced is not in the containment - * tree an IllegalArgumentException is thrown. - * If a ChangeSummary is part of the copy tree the new - * ChangeSummary refers to objects in the new DataObject tree. - * Logging state is the same as the source ChangeSummary. - * - * @param dataObject to be copied. - * @return copy of dataObject - * @throws IllegalArgumentException if any referenced DataObject - * is not part of the containment tree. - */ - DataObject copy(DataObject dataObject); - - /** - * The default CopyHelper. - */ - CopyHelper INSTANCE = HelperProvider.getCopyHelper(); - -} diff --git a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/DataFactory.java b/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/DataFactory.java deleted file mode 100644 index fc9bf96ba4..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/DataFactory.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * - * - * Service Data Objects - * Version 2.0 - * Licensed Materials - Property of BEA and IBM - * - * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved. - * - * - * - */ - -package commonj.sdo.helper; - -import commonj.sdo.DataObject; -import commonj.sdo.Type; -import commonj.sdo.impl.HelperProvider; - -/** - * A Factory for creating DataObjects. - * The created DataObjects are not connected to any other DataObjects. - */ -public interface DataFactory -{ - /** - * Create a DataObject of the Type specified by typeName with the given package uri. - * @param uri The uri of the Type. - * @param typeName The name of the Type. - * @return the created DataObject. - * @throws IllegalArgumentException if the uri and typeName does - * not correspond to a Type this factory can instantiate. - */ - DataObject create(String uri, String typeName); - - /** - * Create a DataObject supporting the given interface. - * InterfaceClass is the interface for the DataObject's Type. - * The DataObject created is an instance of the interfaceClass. - * @param interfaceClass is the interface for the DataObject's Type. - * @return the created DataObject. - * @throws IllegalArgumentException if the instanceClass does - * not correspond to a Type this factory can instantiate. - */ - DataObject create(Class interfaceClass); - - /** - * Create a DataObject of the Type specified. - * @param type The Type. - * @return the created DataObject. - * @throws IllegalArgumentException if the Type - * cannot be instantiaed by this factory. - */ - DataObject create(Type type); - - /** - * The default DataFactory. - */ - DataFactory INSTANCE = HelperProvider.getDataFactory(); - -} diff --git a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/DataHelper.java b/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/DataHelper.java deleted file mode 100644 index 1a630e4118..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/DataHelper.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * - * - * Service Data Objects - * Version 2.0 - * Licensed Materials - Property of BEA and IBM - * - * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved. - * - * - * - */ - -package commonj.sdo.helper; - -import java.util.Calendar; -import java.util.Date; -import java.util.Locale; - -import commonj.sdo.impl.HelperProvider; - -/** - * Data helper methods. - */ -public interface DataHelper -{ - /** - * Convert from a String representation of an SDO date type to a Date. - * @param dateString the String representation of an SDO date type - * @return a Date representation of an SDO date type. - * @throws IllegalArgumentException for invalid formats. - */ - Date toDate(String dateString); - - /** - * Convert from a String representation of an SDO date type to a Calendar using the - * default locale. Same as toCalendar(dateString, null). - * @param dateString the String representation of an SDO date type - * @return a Calendar representation of an SDO date type. - * @throws IllegalArgumentException for invalid formats. - */ - Calendar toCalendar(String dateString); - - /** - * Convert from a String representation of an SDO date type to a Calendar using the - * specified locale, or the default locale if the locale is null. - * @param dateString the String representation of an SDO date type - * @param locale the locale or null for default locale. - * @return a Calendar representation of an SDO date type. - * @throws IllegalArgumentException for invalid formats. - */ - Calendar toCalendar(String dateString, Locale locale); - - /** - * Convert from a Date to a String representation of the DateTime type. - * @param date the date - * @return a Date to a String representation of the DateTime type. - */ - String toDateTime(Date date); - - /** - * Convert from a Date to a String representation of the Duration type. - * @param date the date - * @return a Date to a String representation of the Duration type. - */ - String toDuration(Date date); - - /** - * Convert from a Date to a String representation of the Time type. - * @param date the date - * @return a Date to a String representation of the Time type. - */ - String toTime(Date date); - - /** - * Convert from a Date to a String representation of the Day type. - * @param date the date - * @return a Date to a String representation of the Day type. - */ - String toDay(Date date); - - /** - * Convert from a Date to a String representation of the Month type. - * @param date the date - * @return a Date to a String representation of the Month type. - */ - String toMonth(Date date); - - /** - * Convert from a Date to a String representation of the MonthDay type. - * @param date the date - * @return a Date to a String representation of the MonthDay type. - */ - String toMonthDay(Date date); - - /** - * Convert from a Date to a String representation of the Year type. - * @param date the date - * @return a Date to a String representation of the Year type. - */ - String toYear(Date date); - - /** - * Convert from a Date to a String representation of the YearMonth type. - * @param date the date - * @return a Date to a String representation of the YearMonth type. - */ - String toYearMonth(Date date); - - /** - * Convert from a Date to a String representation of the YearMonthDay type. - * @param date the date - * @return a Date to a String representation of the YearMonthDay type. - */ - String toYearMonthDay(Date date); - - /** - * Convert from a Calendar to a String representation of the DateTime type. - * @param calendar the calendar to convert - * @return a Calendar to a String representation of the DateTime type. - */ - String toDateTime(Calendar calendar); - - /** - * Convert from a Calendar to a String representation of the Duration type. - * @param calendar the calendar to convert - * @return a Calendar to a String representation of the Duration type. - */ - String toDuration(Calendar calendar); - - /** - * Convert from a Calendar to a String representation of the Time type. - * @param calendar the calendar to convert - * @return a Calendar to a String representation of the Time type. - */ - String toTime(Calendar calendar); - - /** - * Convert from a Calendar to a String representation of the Day type. - * @param calendar the calendar to convert - * @return a Calendar to a String representation of the Day type. - */ - String toDay(Calendar calendar); - - /** - * Convert from a Calendar to a String representation of the Month type. - * @param calendar the calendar to convert - * @return a Calendar to a String representation of the Month type. - */ - String toMonth(Calendar calendar); - - /** - * Convert from a Calendar to a String representation of the MonthDay type. - * @param calendar the calendar to convert - * @return a Calendar to a String representation of the MonthDay type. - */ - String toMonthDay(Calendar calendar); - - /** - * Convert from a Calendar to a String representation of the Year type. - * @param calendar the calendar to convert - * @return a Calendar to a String representation of the Year type. - */ - String toYear(Calendar calendar); - - /** - * Convert from a Calendar to a String representation of the YearMonth type. - * @param calendar the calendar to convert - * @return a Calendar to a String representation of the YearMonth type. - */ - String toYearMonth(Calendar calendar); - - /** - * Convert from a Calendar to a String representation of the YearMonthDay type. - * @param calendar the calendar to convert - * @return a Calendar to a String representation of the YearMonthDay type. - */ - String toYearMonthDay(Calendar calendar); - - /** - * The default TypeHelper. - */ - DataHelper INSTANCE = HelperProvider.getDataHelper(); -} diff --git a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/EqualityHelper.java b/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/EqualityHelper.java deleted file mode 100644 index 6214020701..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/EqualityHelper.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * - * - * Service Data Objects - * Version 2.0 - * Licensed Materials - Property of BEA and IBM - * - * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved. - * - * - * - */ - -package commonj.sdo.helper; - -import commonj.sdo.DataObject; -import commonj.sdo.impl.HelperProvider; - -/** - * A helper for comparing DataObjects. - */ -public interface EqualityHelper -{ - /** - *

Two DataObjects are equalShallow if - * they have the same {@link DataObject#getType Type} - * and all their compared Properties are equal. - * The set of Properties compared are the - * {@link DataObject#getInstanceProperties() instance properties} - * where property.getType().isDataType() is true - * and property.getType() is not ChangeSummaryType. - *
Two of these Property values are equal if they are both not - * {@link DataObject#isSet(Property) set}, or set to an equal value - * dataObject1.get(property).equals(dataObject2.get(property)) - *
If the type is a sequenced type, the sequence entries must be the same. - * For each entry x in the sequence where the property is used in the comparison, - * dataObject1.getSequence().getValue(x).equals( - * dataObject2.getSequence().getValue(x)) and - * dataObject1.getSequence().getProperty(x) == - * dataObject2.getSequence().getProperty(x) - * must be true. - *

- * Returns true the objects have the same Type and all values of all compared Properties are equal. - * @param dataObject1 DataObject to be compared - * @param dataObject2 DataObject to be compared - * @return true the objects have the same Type and all values of all compared Properties are equal. - */ - boolean equalShallow(DataObject dataObject1, DataObject dataObject2); - - /** - *

Two DataObjects are equal(Deep) if they are equalShallow, - * all their compared Properties are equal, and all reachable DataObjects in their - * graphs excluding containers are equal. - * The set of Properties compared are the - * {@link DataObject#getInstanceProperties() instance properties} - * where property.getType().isDataType() is false, - * and is not a container property, ie !property.getOpposite().isContainment() - *
Two of these Property values are equal if they are both not - * {@link DataObject#isSet(Property) set}, or all the DataObjects - * they refer to are {@link #equal(DataObject, DataObject) equal} in the - * context of dataObject1 and dataObject2. - *
Note that properties to a containing DataObject are not compared - * which means two DataObject trees can be equal even if their containers are not equal. - *
If the type is a sequenced type, the sequence entries must be the same. - * For each entry x in the sequence where the property is used in the comparison, - * equal(dataObject1.getSequence().getValue(x), - * dataObject2.getSequence().getValue(x)) and - * dataObject1.getSequence().getProperty(x) == - * dataObject2.getSequence().getProperty(x) - * must be true. - *

- * A DataObject directly or indirectly referenced by dataObject1 or dataObject2 - * can only be equal to exactly one DataObject directly or indirectly referenced - * by dataObject1 or dataObject2, respectively. - * This ensures that dataObject1 and dataObject2 are equal if the graph formed by - * all their referenced DataObjects have the same shape. - *

- * Returns true if the trees of DataObjects are equal(Deep). - * @param dataObject1 DataObject to be compared - * @param dataObject2 DataObject to be compared - * @return true if the trees of DataObjects are equal(Deep). - */ - boolean equal(DataObject dataObject1, DataObject dataObject2); - - /** - * The default EqualityHelper. - */ - EqualityHelper INSTANCE = HelperProvider.getEqualityHelper(); -} diff --git a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/TypeHelper.java b/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/TypeHelper.java deleted file mode 100644 index 13f013ed50..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/TypeHelper.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * - * - * Service Data Objects - * Version 2.0 - * Licensed Materials - Property of BEA and IBM - * - * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved. - * - * - * - */ - -package commonj.sdo.helper; - -import java.util.List; - -import commonj.sdo.DataObject; -import commonj.sdo.Type; -import commonj.sdo.impl.HelperProvider; - -/** - * Look up a Type given the uri and typeName or interfaceClass. - * SDO Types are available through the - * getType("commonj.sdo", typeName) method. - * Defines Types from DataObjects. - */ -public interface TypeHelper -{ - /** - * Return the Type specified by typeName with the given uri, - * or null if not found. - * @param uri The uri of the Type - type.getURI(); - * @param typeName The name of the Type - type.getName(); - * @return the Type specified by typeName with the given uri, - * or null if not found. - */ - Type getType(String uri, String typeName); - - /** - * Return the Type for this interfaceClass or null if not found. - * @param interfaceClass is the interface for the DataObject's Type - - * type.getInstanceClass(); - * @return the Type for this interfaceClass or null if not found. - */ - Type getType(Class interfaceClass); - - /** - * Define the DataObject as a Type. - * The Type is available through TypeHelper and DataGraph getType() methods. - * @param type the DataObject representing the Type. - * @return the defined Type. - * @throws IllegalArgumentException if the Type could not be defined. - */ - Type define(DataObject type); - - /** - * Define the list of DataObjects as Types. - * The Types are available through TypeHelper and DataGraph getType() methods. - * @param types a List of DataObjects representing the Types. - * @return the defined Types. - * @throws IllegalArgumentException if the Types could not be defined. - */ - List /*Type*/ define(List /*DataObject*/ types); - - /** - * The default TypeHelper. - */ - TypeHelper INSTANCE = HelperProvider.getTypeHelper(); -} diff --git a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/XMLDocument.java b/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/XMLDocument.java deleted file mode 100644 index 3ef7fd70c8..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/XMLDocument.java +++ /dev/null @@ -1,152 +0,0 @@ -/** - * - * - * Service Data Objects - * Version 2.0 - * Licensed Materials - Property of BEA and IBM - * - * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved. - * - * - * - */ - -package commonj.sdo.helper; - -import commonj.sdo.DataObject; - -/** - * Represents an XML Document containing a tree of DataObjects. - * - * An example XMLDocument fragment is: - * - * - * - * created from this XML Schema fragment: - * - * - * - * - * Upon loading this XMLDocument: - * DataObject is an instance of Type PurchaseOrderType. - * RootElementURI is null because the XSD has no targetNamespace URI. - * RootElementName is purchaseOrder. - * Encoding is null because the document did not specify an encoding. - * XMLDeclaration is true because the document contained an XML declaration. - * XMLVersion is 1.0 - * SchemaLocation and noNamespaceSchemaLocation are null because they are - * not specified in the document. - * - * When saving the root element, if the type of the root dataObject is not the - * type of global element specified by rootElementURI and rootElementName, - * or if a global element does not exist for rootElementURI and rootElementName, - * then an xsi:type declaration is written to record the root DataObject's Type. - * - * When loading the root element and an xsi:type declaration is found - * it is used as the type of the root DataObject. In this case, - * if validation is not being performed, it is not an error if the - * rootElementName is not a global element. - */ -public interface XMLDocument -{ - /** - * Return the root DataObject for the XMLDocument. - * @return root DataObject for the XMLDocument. - */ - DataObject getRootObject(); - - /** - * Return the targetNamespace URI for the root element. - * If there is no targetNamespace URI, the value is null. - * The root element is a global element of the XML Schema - * with a type compatible to the DataObject. - * @return the targetNamespace URI for the root element. - */ - String getRootElementURI(); - - /** - * Return the name of the root element. - * The root element is a global element of the XML Schema - * with a type compatible to the DataObject. - * @return the name of the root element. - */ - String getRootElementName(); - - /** - * Return the XML encoding of the document, or null if not specified. - * The default value is "UTF-8". - * Specification of other values is implementation-dependent. - * @return the XML encoding of the document, or null if not specified. - */ - String getEncoding(); - - /** - * Set the XML encoding of the document, or null if not specified. - * @param encoding - */ - void setEncoding(String encoding); - - /** - * Return the XML declaration of the document. If true, - * XMLHelper save() will produce a declaration of the form: - * - * Encoding will be suppressed if getEncoding() is null. - * The default value is true. - * @return the XML declaration of the document. - */ - boolean isXMLDeclaration(); - - /** - * Set the XML declaration version of the document. - * @param xmlDeclaration the XML declaration version of the document. - */ - void setXMLDeclaration(boolean xmlDeclaration); - - /** - * Return the XML version of the document, or null if not specified. - * The default value is "1.0". - * Specification of other values is implementation-dependent. - * @return the XML version of the document, or null if not specified. - */ - String getXMLVersion(); - - /** - * Set the XML version of the document, or null if not specified. - * @param xmlVersion the XML version of the document, or null if not specified. - */ - void setXMLVersion(String xmlVersion); - - /** - * Return the value of the schemaLocation declaration - * for the http://www.w3.org/2001/XMLSchema-instance namespace in the - * root element, or null if not present. - * @return the value of the schemaLocation declaration, - * or null if not present. - */ - String getSchemaLocation(); - - /** - * Sets the value of the schemaLocation declaration - * for the http://www.w3.org/2001/XMLSchema-instance namespace in the - * root element, or null if it should not be present. - * @param schemaLocation the value of the schemaLocation declaration, or null. - */ - void setSchemaLocation(String schemaLocation); - - /** - * Return the value of the noNamespaceSchemaLocation declaration - * for the http://www.w3.org/2001/XMLSchema-instance namespace in the - * root element, or null if not present. - * @return the value of the noNamespaceSchemaLocation declaration, - * or null if not present. - */ - String getNoNamespaceSchemaLocation(); - - /** - * Sets the value of the noNamespaceSchemaLocation declaration - * for the http://www.w3.org/2001/XMLSchema-instance namespace in the - * root element, or null if it should not be present. - * @param schemaLocation the value of the noNamespaceSchemaLocation declaration, or null. - */ - void setNoNamespaceSchemaLocation(String schemaLocation); -} diff --git a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/XMLHelper.java b/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/XMLHelper.java deleted file mode 100644 index 1d0c6ca127..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/XMLHelper.java +++ /dev/null @@ -1,167 +0,0 @@ -/** - * - * - * Service Data Objects - * Version 2.0 - * Licensed Materials - Property of BEA and IBM - * - * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved. - * - * - * - */ - -package commonj.sdo.helper; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.Reader; -import java.io.Writer; - -import commonj.sdo.DataObject; -import commonj.sdo.impl.HelperProvider; - -/** - * A helper to convert XML documents into DataObects and - * DataObjects into XML documnets. - */ -public interface XMLHelper -{ - /** - * Creates and returns an XMLDocument from the input String. - * By default does not perform XSD validation. - * Same as - * load(new StringReader(inputString), null, null); - * - * @param inputString specifies the String to read from - * @return the new XMLDocument loaded - * @throws RuntimeException for errors in XML parsing or - * implementation-specific validation. - */ - XMLDocument load(String inputString); - - /** - * Creates and returns an XMLDocument from the inputStream. - * The InputStream will be closed after reading. - * By default does not perform XSD validation. - * Same as - * load(inputStream, null, null); - * - * @param inputStream specifies the InputStream to read from - * @return the new XMLDocument loaded - * @throws IOException for stream exceptions. - * @throws RuntimeException for errors in XML parsing or - * implementation-specific validation. - */ - XMLDocument load(InputStream inputStream) throws IOException; - - /** - * Creates and returns an XMLDocument from the inputStream. - * The InputStream will be closed after reading. - * By default does not perform XSD validation. - * @param inputStream specifies the InputStream to read from - * @param locationURI specifies the URI of the document for relative schema locations - * @param options implementation-specific options. - * @return the new XMLDocument loaded - * @throws IOException for stream exceptions. - * @throws RuntimeException for errors in XML parsing or - * implementation-specific validation. - */ - XMLDocument load(InputStream inputStream, String locationURI, Object options) throws IOException; - - /** - * Creates and returns an XMLDocument from the inputReader. - * The InputStream will be closed after reading. - * By default does not perform XSD validation. - * @param inputReader specifies the Reader to read from - * @param locationURI specifies the URI of the document for relative schema locations - * @param options implementation-specific options. - * @return the new XMLDocument loaded - * @throws IOException for stream exceptions. - * @throws RuntimeException for errors in XML parsing or - * implementation-specific validation. - */ - XMLDocument load(Reader inputReader, String locationURI, Object options) throws IOException; - - /** - * Returns the DataObject saved as an XML document with the specified root element. - * Same as - * StringWriter stringWriter = new StringWriter(); - * save(createDocument(dataObject, rootElementURI, rootElementName), - * stringWriter, null); - * stringWriter.toString(); - * - * @param dataObject specifies DataObject to be saved - * @param rootElementURI the Target Namespace URI of the root XML element - * @param rootElementName the Name of the root XML element - * @return the saved XML document as a string - * @throws IllegalArgumentException if the dataObject tree - * is not closed or has no container. - */ - String save(DataObject dataObject, String rootElementURI, String rootElementName); - - /** - * Saves the DataObject as an XML document with the specified root element. - * Same as - * save(createDocument(dataObject, rootElementURI, rootElementName), - * outputStream, null); - * - * @param dataObject specifies DataObject to be saved - * @param rootElementURI the Target Namespace URI of the root XML element - * @param rootElementName the Name of the root XML element - * @param outputStream specifies the OutputStream to write to. - * @throws IOException for stream exceptions. - * @throws IllegalArgumentException if the dataObject tree - * is not closed or has no container. - */ - void save(DataObject dataObject, String rootElementURI, String rootElementName, OutputStream outputStream) throws IOException; - - /** - * Serializes an XMLDocument as an XML document into the outputStream. - * If the DataObject's Type was defined by an XSD, the serialization - * will follow the XSD. - * Otherwise the serialization will follow the format as if an XSD - * were generated as defined by the SDO specification. - * The OutputStream will be flushed after writing. - * Does not perform validation to ensure compliance with an XSD. - * @param xmlDocument specifies XMLDocument to be saved - * @param outputStream specifies the OutputStream to write to. - * @param options implementation-specific options. - * @throws IOException for stream exceptions. - * @throws IllegalArgumentException if the dataObject tree - * is not closed or has no container. - */ - void save(XMLDocument xmlDocument, OutputStream outputStream, Object options) throws IOException; - - /** - * Serializes an XMLDocument as an XML document into the outputWriter. - * If the DataObject's Type was defined by an XSD, the serialization - * will follow the XSD. - * Otherwise the serialization will follow the format as if an XSD - * were generated as defined by the SDO specification. - * The OutputStream will be flushed after writing. - * Does not perform validation to ensure compliance with an XSD. - * @param xmlDocument specifies XMLDocument to be saved - * @param outputWriter specifies the Writer to write to. - * @param options implementation-specific options. - * @throws IOException for stream exceptions. - * @throws IllegalArgumentException if the dataObject tree - * is not closed or has no container. - */ - void save(XMLDocument xmlDocument, Writer outputWriter, Object options) throws IOException; - - /** - * Creates an XMLDocument with the specified XML rootElement for the DataObject. - * @param dataObject specifies DataObject to be saved - * @param rootElementURI the Target Namespace URI of the root XML element - * @param rootElementName the Name of the root XML element - * @return XMLDocument a new XMLDocument set with the specified parameters. - */ - XMLDocument createDocument(DataObject dataObject, String rootElementURI, String rootElementName); - - /** - * The default XMLHelper. - */ - XMLHelper INSTANCE = HelperProvider.getXMLHelper(); -} diff --git a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/XSDHelper.java b/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/XSDHelper.java deleted file mode 100644 index 7b4a99493c..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/helper/XSDHelper.java +++ /dev/null @@ -1,193 +0,0 @@ -/** - * - * - * Service Data Objects - * Version 2.0 - * Licensed Materials - Property of BEA and IBM - * - * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved. - * - * - * - */ - -package commonj.sdo.helper; - -import java.io.InputStream; -import java.io.Reader; -import java.util.List; -import java.util.Map; - -import commonj.sdo.Property; -import commonj.sdo.Type; -import commonj.sdo.impl.HelperProvider; - -/** - * Provides access to additional information when the - * Type or Property is defined by an XML Schema (XSD). - * Methods return null/false otherwise or if the information is unavailable. - * Defines Types from an XSD. -*/ -public interface XSDHelper -{ - /** - * Returns the local name as declared in the XSD. - * @param type to return local name for. - * @return the local name as declared in the XSD. - */ - String getLocalName(Type type); - - /** - * Returns the local name as declared in the XSD. - * @param property to return local name for. - * @return the local name as declared in the XSD. - */ - String getLocalName(Property property); - - /** - * Returns the namespace URI as declared in the XSD. - * @param property to return namespace URI for. - * @return the namespace URI as declared in the XSD. - */ - String getNamespaceURI(Property property); - - /** - * Returns true if the property is declared as an attribute in the XSD. - * Returns false if not known or for advanced cases. - * It is possible for both isAttribute and isElement to return false - * but they will not both return true. - * @param property to identify if an attribute. - * @return true if the property is declared as an attribute in the XSD. - */ - boolean isAttribute(Property property); - - /** - * Returns true if the property is declared as an element in the XSD. - * Returns false if not known or for advanced cases. - * It is possible for both isAttribute and isElement to return false - * but they will not both return true. - * @param property to identify if an element. - * @return true if the property is declared as an element in the XSD. - */ - boolean isElement(Property property); - - /** - * Returns true if the Type is declared to contain mixed content. - * A DataObject's mixed content values are typically accessed via a Sequence. - * @param type to identify if mixed content. - * @return true if the Type is declared to contain mixed content. - */ - boolean isMixed(Type type); - - /** - * Indicates if this helper contains XSD information for the specified type. - * @param type the type. - * @return true if this helper contains XSD information for the specified type. - */ - boolean isXSD(Type type); - - /** - * Returns the Property defined by the named global element or attribute - * in the targetNamespace uri, or null if not found. - * @param uri The uri of the targetNamespace. - * @param propertyName The name of the global property. - * @param isElement is true for global elements, false for global attributes. - * @return the Property defined by the named global element or attribute - * in the targetNamespace uri, or null if not found. - */ - Property getGlobalProperty(String uri, String propertyName, boolean isElement); - - /** - * Return the appinfo declared for this Type and source. - * The appinfo start and end tags and content are returned. - * The xml namespace context is preserved in the appinfo element. - * If more than one appinfo with the same source is declared on the same - * Type their contents are concatenated. - * @param type the type with the appinfo declaration - * @param source the source of the appinfo declaration. - * @return the appinfo declared for this Type and source. - */ - String getAppinfo(Type type, String source); - - /** - * Return the content of the appinfo declared for this Property and source. - * If the property is defined by ref= the appinfo of the referenced - * element or attribute is included. - * The appinfo start and end tags and content are returned. - * The xml namespace context is preserved in the appinfo element. - * If more than one appinfo with the same source is declared on the same - * Type their contents are concatenated. - * @param property the Property with the appinfo declaration - * @param source the source of the appinfo declaration. - * @return the appinfo declared for this Property and source. - */ - String getAppinfo(Property property, String source); - - /** - * Define the XML Schema as Types. - * The Types are available through TypeHelper and DataGraph getType() methods. - * Same as define(new StringReader(xsd), null) - * @param xsd the XML Schema. - * @return the defined Types. - * @throws IllegalArgumentException if the Types could not be defined. - */ - List /*Type*/ define(String xsd); - - /** - * Define XML Schema as Types. - * The Types are available through TypeHelper and DataGraph getType() methods. - * @param xsdReader reader to an XML Schema. - * @param schemaLocation the URI of the location of the schema, used - * for processing relative imports and includes. May be null if not used. - * @return the defined Types. - * @throws IllegalArgumentException if the Types could not be defined. - */ - List /*Type*/ define(Reader xsdReader, String schemaLocation); - - /** - * Define XML Schema as Types. - * The Types are available through TypeHelper and DataGraph getType() methods. - * @param xsdInputStream input stream to an XML Schema. - * @param schemaLocation the URI of the location of the schema, used - * for processing relative imports and includes. May be null if not used. - * @return the defined Types. - * @throws IllegalArgumentException if the Types could not be defined. - */ - List /*Type*/ define(InputStream xsdInputStream, String schemaLocation); - - /** - * Generate an XML Schema Declaration (XSD) from Types. - * Same as generate(types, null); - * @param types a List containing the Types - * @return a String containing the generated XSD. - * @throws IllegalArgumentException if the XSD could not be generated. - */ - String generate(List /*Type*/ types); - - /** - * Generate an XML Schema Declaration (XSD) from Types. - * Round trip from SDO to XSD to SDO is supported. - * Round trip from XSD to SDO to XSD is not supported. - * Use the original schema if one exists instead of generating a new one, as - * the generated XSD validates a different set of documents than the original XSD. - * Generating an XSD does not affect the XSDHelper or the Types. - * The Types must all have the same URI. - * The result is a String containing the generated XSD. - * All Types referenced with the same URI will be generated in the XSD - * and the list will be expanded to include all types generated. - * Any Types referenced with other URIs will cause - * imports to be produced as appropriate. - * Imports will include a schemaLocation if a Map is provided with an entry - * of the form key=import target namespace, value=schemaLocation - * @param types a List containing the Types - * @param namespaceToSchemaLocation map of target namespace to schema locations or null - * @return a String containing the generated XSD. - * @throws IllegalArgumentException if the XSD could not be generated. - */ - String generate(List /*Type*/ types, Map /*String, String*/ namespaceToSchemaLocation); - - /** - * The default XSDHelper. - */ - XSDHelper INSTANCE = HelperProvider.getXSDHelper(); -} diff --git a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/impl/ExternalizableDelegator.java b/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/impl/ExternalizableDelegator.java deleted file mode 100644 index a833bb63a9..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/impl/ExternalizableDelegator.java +++ /dev/null @@ -1,74 +0,0 @@ -package commonj.sdo.impl; - -import java.io.Externalizable; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.io.ObjectStreamException; - -/** - * Delegates DataObject serialization while ensuring implementation independent - * java.io.Serialization. An implementation of DataObject - * returns an ExternalizableDelegator from its writeReplace() method. - * - * The root DataObject is the object returned from do.getRootObject() where - * do is the DataObject being serialized in a java.io.ObjectOutputStream. - * When do.getContainer() == null then do is a root object. - * - * The byte format for each DataObject in the stream is: - * [0] [path] [root] // when do is not a root object - * [1] [rootXML] // when do is a root object - * - * where: - * [0] is the byte 0, serialized using writeByte(0). - * [1] is the byte 1, serialized using writeByte(1). - * - * [path] is an SDO path expression from the root DataObject to the serialized - * DataObject such that root.getDataObject(path) == do. - * Serialized using writeUTF(path). - * - * [root] is the root object serialized using writeObject(root). - * - * [rootXML] is the GZip of the XML serialization of the root DataObject. - * The XML serialization is the same as - * XMLHelper.INSTANCE.save(root, "commonj.sdo", "dataObject", stream); - * where stream is a GZIPOutputStream, length is the number of bytes - * in the stream, and bytes are the contents of the stream. - * Serialized using writeInt(length), write(bytes). - * - */ -public class ExternalizableDelegator implements Externalizable -{ - public interface Resolvable extends Externalizable - { - Object readResolve() throws ObjectStreamException; - } - - static final long serialVersionUID = 1; - transient Resolvable delegate; - - public ExternalizableDelegator() - { - delegate = HelperProvider.createResolvable(); - } - - public ExternalizableDelegator(Object target) - { - delegate = HelperProvider.createResolvable(target); - } - - public void writeExternal(ObjectOutput out) throws IOException - { - delegate.writeExternal(out); - } - - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException - { - delegate.readExternal(in); - } - - public Object readResolve() throws ObjectStreamException - { - return delegate.readResolve(); - } -} diff --git a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/impl/HelperProvider.java b/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/impl/HelperProvider.java deleted file mode 100644 index 9f1f0d4642..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/impl/HelperProvider.java +++ /dev/null @@ -1,365 +0,0 @@ -/** - * - * Copyright 2006 The Apache Software Foundation - * - * 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. - */ - -package commonj.sdo.impl; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; -import java.security.AccessController; -import java.security.PrivilegedAction; - -import commonj.sdo.helper.CopyHelper; -import commonj.sdo.helper.DataFactory; -import commonj.sdo.helper.DataHelper; -import commonj.sdo.helper.EqualityHelper; -import commonj.sdo.helper.TypeHelper; -import commonj.sdo.helper.XMLHelper; -import commonj.sdo.helper.XSDHelper; - -/** - * A HelperProvider obtains specific default helpers and other - * implementation-specific objects used by a Java implementation of SDO. - * - * @version $Rev$ $Date$ - */ -public abstract class HelperProvider { - /** - * The default HelperProvider INSTANCE. This is located using the ClassLoader used - * to load the HelperProvider class itself and if no default implementation is available - * this field will be set to null. - */ - public static final HelperProvider INSTANCE; - - /** - * The name of the resource that is used for service location. - */ - public static final String SERVICE_RESOURCE_NAME = "META-INF/services/commonj.sdo.impl.HelperProvider"; - - /** - * The name of the system property that will be checked for an implementation name. - */ - public static final String PROPERTY_NAME = "commonj.sdo.impl.HelperProvider"; - - static { - // initialize the default instance using this class's classloader - // set to null if none could be located (implies no default implementation) - HelperProvider provider; - try { - provider = getInstance(HelperProvider.class.getClassLoader()); - } catch (NoHelperProviderException e) { - provider = null; - } - INSTANCE = provider; - } - - /** - * Locate and instantiate a HelperProvider. - *

- * Attempt to locate a HelperProvider using first the Thread's current context classloader and then, - * if that is not set, not readable, or does not provide an implementation, using the classloader - * used to load the HelperProvider class itself. - *

- * A new instance is returned for each sucessful invocation. - * - * @return an implementation of HelperProvider - * @throws NoHelperProviderException if no provider implementation was defined or it could not be instantiated - */ - public static HelperProvider getInstance() throws NoHelperProviderException { - String implName = getImplementationName(); - - ClassLoader cl = getContextClassLoader(); - if (cl != null) { - HelperProvider provider = loadImplementation(cl, implName); - if (provider != null) { - return provider; - } - } - - cl = HelperProvider.class.getClassLoader(); - HelperProvider provider = loadImplementation(cl, implName); - if (provider != null) { - return provider; - } - - throw new NoHelperProviderException(implName); - } - - - /** - * Locate and instantiate a HelperProvider using the supplied ClassLoader. - *

- * The name of the implementation to use is determined by the value of the "commonj.sdo.impl.HelperProvider" - * system property. If this is not set or this code does not have permission to read it then the name - * will be retrieved from the META-INF/services/commonj.sdo.impl.HelperProvider resource as returned - * by the supplied classloader as described in the - * JAR file specification. - *

- * A new instance is returned for each sucessful invocation. - * - * @param cl the classloader to use to locate and instantiate the implementation - * @return the specified implementation of HelperProvider - * @throws NoHelperProviderException if no provider implementation was defined or it could not be instantiated - */ - public static HelperProvider getInstance(ClassLoader cl) throws NoHelperProviderException { - String implName = getImplementationName(); - HelperProvider provider = loadImplementation(cl, implName); - if (provider == null) { - throw new NoHelperProviderException(implName); - } - return provider; - } - - private static ClassLoader getContextClassLoader() { - try { - return AccessController.doPrivileged(new PrivilegedAction() { - public ClassLoader run() { - return Thread.currentThread().getContextClassLoader(); - } - }); - } catch (SecurityException e) { - return null; - } - } - - private static HelperProvider loadImplementation(ClassLoader cl, String implName) throws NoHelperProviderException { - // if no name is requested, locate using the supplied classloader - if (implName == null) { - implName = getImplementationName(cl); - } - // no implementation to try, return null - if (implName == null) { - return null; - } - - // try an instantiate the implementation - try { - return (HelperProvider) cl.loadClass(implName).newInstance(); - } catch (InstantiationException e) { - throw new NoHelperProviderException(implName, e); - } catch (IllegalAccessException e) { - throw new NoHelperProviderException(implName, e); - } catch (ClassNotFoundException e) { - throw new NoHelperProviderException(implName, e); - } - } - - private static String getImplementationName() { - try { - return AccessController.doPrivileged(new PrivilegedAction() { - @SuppressWarnings({"AccessOfSystemProperties"}) - public String run() { - return System.getProperty(PROPERTY_NAME); - } - }); - } catch (SecurityException e) { - return null; - } - } - - private static String getImplementationName(ClassLoader cl) { - InputStream is = cl.getResourceAsStream(SERVICE_RESOURCE_NAME); - if (is == null) { - return null; - } - - InputStreamReader in; - try { - in = new InputStreamReader(is, "UTF-8"); - } catch (UnsupportedEncodingException e) { - throw new AssertionError("UTF-8 encoding not available"); - } - - try { - BufferedReader reader = new BufferedReader(in, 128); - try { - String line; - while ((line = reader.readLine()) != null) { - int i = line.indexOf('#'); - if (i != -1) { - line = line.substring(0, i); - } - line = line.trim(); - if (line.length() > 0) { - return line; - } - } - return null; - } finally { - reader.close(); - } - } catch (IOException e) { - throw new NoHelperProviderException(e); - } - } - - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // implementation specific methods for users that don't want to use the default implementation - - /** - * Returns a CopyHelper obtained from this implementation. - * - * @return a CopyHelper obtained from this implementation - */ - public abstract CopyHelper copyHelper(); - - /** - * Returns a DataFactory obtained from this implementation. - * - * @return a DataFactory obtained from this implementation - */ - public abstract DataFactory dataFactory(); - - /** - * Returns a DataHelper obtained from this implementation. - * - * @return a DataHelper obtained from this implementation - */ - public abstract DataHelper dataHelper(); - - /** - * Returns a EqualityHelper obtained from this implementation. - * - * @return a EqualityHelper obtained from this implementation - */ - public abstract EqualityHelper equalityHelper(); - - /** - * Returns a TypeHelper obtained from this implementation. - * - * @return a TypeHelper obtained from this implementation - */ - public abstract TypeHelper typeHelper(); - - /** - * Returns a XMLHelper obtained from this implementation. - * - * @return a XMLHelper obtained from this implementation - */ - public abstract XMLHelper xmlHelper(); - - /** - * Returns a XSDHelper obtained from this implementation. - * - * @return a XSDHelper obtained from this implementation - */ - public abstract XSDHelper xsdHelper(); - - /** - * Create a Resolvable using this implementation - * - * @return a Resolvable created using this implementation - */ - public abstract ExternalizableDelegator.Resolvable resolvable(); - - /** - * Create a Resolvable using this implementation - * - * @param target the object to be resolved - * @return a Resolvable created using this implementation - */ - public abstract ExternalizableDelegator.Resolvable resolvable(Object target); - - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // static helper methods required by the specification - - /** - * Returns a CopyHelper obtained from the default HelperProvider. - * - * @return a CopyHelper obtained from the default HelperProvider - */ - public static CopyHelper getCopyHelper() { - return INSTANCE.copyHelper(); - } - - /** - * Returns a DataFactory obtained from the default HelperProvider. - * - * @return a DataFactory obtained from the default HelperProvider - */ - public static DataFactory getDataFactory() { - return INSTANCE.dataFactory(); - } - - /** - * Returns a DataHelper obtained from the default HelperProvider. - * - * @return a DataHelper obtained from the default HelperProvider - */ - public static DataHelper getDataHelper() { - return INSTANCE.dataHelper(); - } - - /** - * Returns a EqualityHelper obtained from the default HelperProvider. - * - * @return a EqualityHelper obtained from the default HelperProvider - */ - public static EqualityHelper getEqualityHelper() { - return INSTANCE.equalityHelper(); - } - - /** - * Returns a TypeHelper obtained from the default HelperProvider. - * - * @return a TypeHelper obtained from the default HelperProvider - */ - public static TypeHelper getTypeHelper() { - return INSTANCE.typeHelper(); - } - - /** - * Returns a XMLHelper obtained from the default HelperProvider. - * - * @return a XMLHelper obtained from the default HelperProvider - */ - public static XMLHelper getXMLHelper() { - return INSTANCE.xmlHelper(); - } - - /** - * Returns a XSDHelper obtained from the default HelperProvider. - * - * @return a XSDHelper obtained from the default HelperProvider - */ - public static XSDHelper getXSDHelper() { - return INSTANCE.xsdHelper(); - } - - /** - * Create a Resolvable using the default HelperProvider - * - * @return a Resolvable created using the default HelperProvider - */ - public static ExternalizableDelegator.Resolvable createResolvable() { - return INSTANCE.resolvable(); - } - - /** - * Create a Resolvable using the default HelperProvider - * - * @param target the object to be resolved - * @return a Resolvable created using the default HelperProvider - */ - public static ExternalizableDelegator.Resolvable createResolvable(Object target) { - return INSTANCE.resolvable(target); - } -} \ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/impl/NoHelperProviderException.java b/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/impl/NoHelperProviderException.java deleted file mode 100644 index e42f83476c..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/java/commonj/sdo/impl/NoHelperProviderException.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * - * Copyright 2005 International Business Machines Corporation - * - * 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. - */ -package commonj.sdo.impl; - -/** - * Exception indicating that a HelperProvider could not be located or instantiated. - * The message will be set to the name of the implementation class; a null value - * indicates that the name of the implementation could not be determined. - * The cause will be set to the Throwable that prevented the provider from being - * located or created. - * - * @version $Revision$ $Date$ - */ -public class NoHelperProviderException extends RuntimeException { - private static final long serialVersionUID = 727646133930924084L; - - public NoHelperProviderException() { - } - - public NoHelperProviderException(String message) { - super(message); - } - - public NoHelperProviderException(String message, Throwable cause) { - super(message, cause); - } - - public NoHelperProviderException(Throwable cause) { - super(cause); - } - - /** - * Return the name of the implementation class that could not be provided. - * - * @return the name of the implementation class; may be null if not known - */ - public String getImplementationName() { - return getMessage(); - } -} diff --git a/tags/java-stable-20060304/spec/sdo/src/main/resources/META-INF/MANIFEST.MF b/tags/java-stable-20060304/spec/sdo/src/main/resources/META-INF/MANIFEST.MF deleted file mode 100644 index d9844bfc6a..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/resources/META-INF/MANIFEST.MF +++ /dev/null @@ -1,10 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: SDO CommonJ APIs -Bundle-SymbolicName: org.apache.tuscany.sdo.spec -Bundle-Version: 1.0.0 -Bundle-Localization: plugin -Bundle-Vendor: Apache -Export-Package: commonj.sdo, - commonj.sdo.helper, - commonj.sdo.impl diff --git a/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/datagraph.xsd b/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/datagraph.xsd deleted file mode 100644 index 30727473a0..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/datagraph.xsd +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Expected type is emof:Package. - - - - - - - - - - - Expected type is xsd:schema. - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoJava.xml b/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoJava.xml deleted file mode 100644 index 08c3b9734c..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoJava.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoJava.xsd b/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoJava.xsd deleted file mode 100644 index da029a58b8..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoJava.xsd +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoModel.xml b/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoModel.xml deleted file mode 100644 index fcd1a4e283..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoModel.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoModel.xsd b/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoModel.xsd deleted file mode 100644 index a041c9e02b..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoModel.xsd +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoXML.xml b/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoXML.xml deleted file mode 100644 index ac831576fb..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoXML.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoXML.xsd b/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoXML.xsd deleted file mode 100644 index 88fc7daaf6..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/main/resources/xml/sdoXML.xsd +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/spec/sdo/src/test/java/commonj/sdo/impl/HelperProviderTestCase.java b/tags/java-stable-20060304/spec/sdo/src/test/java/commonj/sdo/impl/HelperProviderTestCase.java deleted file mode 100644 index 8dac797574..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/test/java/commonj/sdo/impl/HelperProviderTestCase.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * - * Copyright 2005 International Business Machines Corporation - * - * 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. - */ -package commonj.sdo.impl; - -import java.net.URL; -import java.net.URLClassLoader; - -import junit.framework.TestCase; -import test.DefaultHelperProvider; -import test.TCCL1HelperProvider; - -/** - * @version $Revision$ $Date$ - */ -@SuppressWarnings({"ClassLoader2Instantiation"}) -public class HelperProviderTestCase extends TestCase { - private URL classes; - private URL testClasses; - private URL def; - private URL tccl1; - - public void testInstanceIsNullWithNoImplementation() throws Exception { - assertNull(HelperProvider.INSTANCE); - } - - public void testDefaultInstance() throws Exception { - ClassLoader cl = new URLClassLoader(new URL[]{classes, def, testClasses}, null); - Class providerClass = cl.loadClass(HelperProvider.class.getName()); - Class implClass = cl.loadClass(DefaultHelperProvider.class.getName()); - Object instance = providerClass.getField("INSTANCE").get(null); - assertNotNull(instance); - assertEquals(implClass, instance.getClass()); - } - - public void testLocateFromClassLoader() throws Exception { - ClassLoader cl = new URLClassLoader(new URL[]{classes, tccl1, testClasses}, null); - Class providerClass = cl.loadClass(HelperProvider.class.getName()); - Object provider = providerClass.getMethod("getInstance", ClassLoader.class).invoke(null, cl); - assertNotNull(provider); - assertEquals(TCCL1HelperProvider.class.getName(), provider.getClass().getName()); - } - - public void testThreadContextInstance() throws Exception { - ClassLoader cl = new URLClassLoader(new URL[]{classes, tccl1, testClasses}, null); - ClassLoader tccl = Thread.currentThread().getContextClassLoader(); - try { - Thread.currentThread().setContextClassLoader(cl); - Class providerClass = cl.loadClass(HelperProvider.class.getName()); - Object provider = providerClass.getMethod("getInstance").invoke(null); - assertNotNull(provider); - assertEquals(TCCL1HelperProvider.class.getName(), provider.getClass().getName()); - } finally { - Thread.currentThread().setContextClassLoader(tccl); - } - - } - - @SuppressWarnings({"AccessOfSystemProperties"}) - public void testSystemProperty() { - System.setProperty("commonj.sdo.impl.HelperProvider", "test.TCCL1HelperProvider"); - try { - HelperProvider provider = HelperProvider.getInstance(); - assertNotNull(provider); - assertEquals(TCCL1HelperProvider.class, provider.getClass()); - } finally { - System.getProperties().remove("commonj.sdo.impl.HelperProvider"); - } - } - - protected void setUp() throws Exception { - super.setUp(); - classes = new URL(HelperProvider.class.getResource("HelperProvider.class"), "../../.."); - testClasses = new URL(HelperProviderTestCase.class.getResource("HelperProviderTestCase.class"), "../../.."); - tccl1 = new URL(testClasses, "tccl1/"); - def = new URL(testClasses, "default/"); - } -} diff --git a/tags/java-stable-20060304/spec/sdo/src/test/java/test/DefaultHelperProvider.java b/tags/java-stable-20060304/spec/sdo/src/test/java/test/DefaultHelperProvider.java deleted file mode 100644 index ef1a03e9ff..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/test/java/test/DefaultHelperProvider.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ===================================================================== - * - * Copyright (c) 2005 Jeremy Boynes. All rights reserved. - * - * ===================================================================== - */ -package test; - -import commonj.sdo.impl.HelperProvider; -import commonj.sdo.impl.ExternalizableDelegator; -import commonj.sdo.helper.CopyHelper; -import commonj.sdo.helper.DataFactory; -import commonj.sdo.helper.DataHelper; -import commonj.sdo.helper.EqualityHelper; -import commonj.sdo.helper.TypeHelper; -import commonj.sdo.helper.XMLHelper; -import commonj.sdo.helper.XSDHelper; - -/** - * @version $Revision$ $Date$ - */ -public class DefaultHelperProvider extends HelperProvider { - public CopyHelper copyHelper() { - throw new UnsupportedOperationException(); - } - - public DataFactory dataFactory() { - throw new UnsupportedOperationException(); - } - - public DataHelper dataHelper() { - throw new UnsupportedOperationException(); - } - - public EqualityHelper equalityHelper() { - throw new UnsupportedOperationException(); - } - - public TypeHelper typeHelper() { - throw new UnsupportedOperationException(); - } - - public XMLHelper xmlHelper() { - throw new UnsupportedOperationException(); - } - - public XSDHelper xsdHelper() { - throw new UnsupportedOperationException(); - } - - public ExternalizableDelegator.Resolvable resolvable() { - throw new UnsupportedOperationException(); - } - - public ExternalizableDelegator.Resolvable resolvable(Object target) { - throw new UnsupportedOperationException(); - } -} diff --git a/tags/java-stable-20060304/spec/sdo/src/test/java/test/TCCL1HelperProvider.java b/tags/java-stable-20060304/spec/sdo/src/test/java/test/TCCL1HelperProvider.java deleted file mode 100644 index 69214640f1..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/test/java/test/TCCL1HelperProvider.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ===================================================================== - * - * Copyright (c) 2005 Jeremy Boynes. All rights reserved. - * - * ===================================================================== - */ -package test; - -import commonj.sdo.impl.HelperProvider; -import commonj.sdo.impl.ExternalizableDelegator; -import commonj.sdo.helper.CopyHelper; -import commonj.sdo.helper.DataFactory; -import commonj.sdo.helper.DataHelper; -import commonj.sdo.helper.EqualityHelper; -import commonj.sdo.helper.TypeHelper; -import commonj.sdo.helper.XMLHelper; -import commonj.sdo.helper.XSDHelper; - -/** - * @version $Revision$ $Date$ - */ -public class TCCL1HelperProvider extends HelperProvider { - public CopyHelper copyHelper() { - throw new UnsupportedOperationException(); - } - - public DataFactory dataFactory() { - throw new UnsupportedOperationException(); - } - - public DataHelper dataHelper() { - throw new UnsupportedOperationException(); - } - - public EqualityHelper equalityHelper() { - throw new UnsupportedOperationException(); - } - - public TypeHelper typeHelper() { - throw new UnsupportedOperationException(); - } - - public XMLHelper xmlHelper() { - throw new UnsupportedOperationException(); - } - - public XSDHelper xsdHelper() { - throw new UnsupportedOperationException(); - } - - public ExternalizableDelegator.Resolvable resolvable() { - throw new UnsupportedOperationException(); - } - - public ExternalizableDelegator.Resolvable resolvable(Object target) { - throw new UnsupportedOperationException(); - } -} diff --git a/tags/java-stable-20060304/spec/sdo/src/test/resources/default/META-INF/services/commonj.sdo.impl.HelperProvider b/tags/java-stable-20060304/spec/sdo/src/test/resources/default/META-INF/services/commonj.sdo.impl.HelperProvider deleted file mode 100644 index 5175e5abea..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/test/resources/default/META-INF/services/commonj.sdo.impl.HelperProvider +++ /dev/null @@ -1,3 +0,0 @@ -# test comment and blank line - - test.DefaultHelperProvider # comment diff --git a/tags/java-stable-20060304/spec/sdo/src/test/resources/tccl1/META-INF/services/commonj.sdo.impl.HelperProvider b/tags/java-stable-20060304/spec/sdo/src/test/resources/tccl1/META-INF/services/commonj.sdo.impl.HelperProvider deleted file mode 100644 index c7f46ba91e..0000000000 --- a/tags/java-stable-20060304/spec/sdo/src/test/resources/tccl1/META-INF/services/commonj.sdo.impl.HelperProvider +++ /dev/null @@ -1 +0,0 @@ -test.TCCL1HelperProvider \ No newline at end of file diff --git a/tags/java-stable-20060304/testing/tomcat/axis2.xml b/tags/java-stable-20060304/testing/tomcat/axis2.xml deleted file mode 100644 index a38cf9864a..0000000000 --- a/tags/java-stable-20060304/testing/tomcat/axis2.xml +++ /dev/null @@ -1,167 +0,0 @@ - - - - - false - false - false - - - - - admin - axis2 - - . - - 127.0.0.1 - 5555 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6060 - - - - - - - - - - - - - - - - - HTTP/1.1 - chunked - - - HTTP/1.1 - chunked - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/testing/tomcat/bigbank/.classpath b/tags/java-stable-20060304/testing/tomcat/bigbank/.classpath deleted file mode 100644 index 82ffd111b6..0000000000 --- a/tags/java-stable-20060304/testing/tomcat/bigbank/.classpath +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/testing/tomcat/bigbank/.project b/tags/java-stable-20060304/testing/tomcat/bigbank/.project deleted file mode 100644 index 7a5fbfdeb1..0000000000 --- a/tags/java-stable-20060304/testing/tomcat/bigbank/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - bigbankacceptance - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/tags/java-stable-20060304/testing/tomcat/bigbank/src/test/java/org/apache/tuscany/samples/bigbank/TestBigBankTestCase.java b/tags/java-stable-20060304/testing/tomcat/bigbank/src/test/java/org/apache/tuscany/samples/bigbank/TestBigBankTestCase.java deleted file mode 100644 index 59928aeb7d..0000000000 --- a/tags/java-stable-20060304/testing/tomcat/bigbank/src/test/java/org/apache/tuscany/samples/bigbank/TestBigBankTestCase.java +++ /dev/null @@ -1,110 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.bigbank; - -import java.net.URL; -import java.util.Iterator; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import junit.framework.TestCase; - -import com.gargoylesoftware.htmlunit.Page; -import com.gargoylesoftware.htmlunit.WebClient; -import com.gargoylesoftware.htmlunit.WebResponse; -import com.gargoylesoftware.htmlunit.html.HtmlForm; -import com.gargoylesoftware.htmlunit.html.HtmlInput; -import com.gargoylesoftware.htmlunit.html.HtmlPage; - - -public class TestBigBankTestCase extends TestCase { - // public static final String testUrl = "http://localhost:8080/tuscany-samples-bigbank-webclient"; - public static final String testUrl = "http://localhost:8080/tuscany-samples-bigbank-webclient/login.html"; - - - public void testBigBankDefault() throws Exception - { - System.err.println("Running: testcase:"); - // New HTMLunit web client - WebClient client = new WebClient(); - client.setRedirectEnabled(true); - - // Going to have the WebClient connect to this URL - URL url = new URL(testUrl); - HtmlPage page = (HtmlPage)client.getPage(url); - //System.out.println(page.getTitleText()); - - // Check response code - WebResponse resp = page.getWebResponse(); - assertTrue(resp.getStatusCode() <= 200); - List forms = page.getForms(); - Iterator iter = forms.iterator(); - - // Iterate over all forms on page, should only be one. - while(iter.hasNext()) - { - HtmlForm form = (HtmlForm)iter.next(); - - - HtmlInput login = form.getInputByName("login"); - HtmlInput password = form.getInputByName("password"); - login.setValueAttribute("test"); - password.setValueAttribute("password"); - - Page resultPage = form.submit(); - // Check response from servlet - WebResponse resultResponse = resultPage.getWebResponse(); - assertTrue(resultResponse.getStatusCode() <= 200); - - // TODO Check response content.. - String response = resultResponse.getContentAsString(); - assertTrue(-1 != response.indexOf("Account")); - assertTrue(-1 != response.indexOf("Balance")); - assertTrue(-1 != response.indexOf("12345_CHA12345")); - assertTrue(-1 != response.indexOf("1200.0")); - - - - /** - * or.. - * - * HtmlPage htmlResponse = (HtmlPage)resultPage; - * HtmlElement element = htmlResponse.getHtmlElementById("ELEMENT-ID"); - * assertEquals(element.getNodeValue(), ... ); - * - * or.. - * - * String resultString = resultResponse.getContentAsString(); - * assertEquals(resultString, ... ); - * - * etc. - * - **/ - } - - } - - /** - * @param args - */ - public static void main(String[] args) { - - - } - -} diff --git a/tags/java-stable-20060304/testing/tomcat/build.xml b/tags/java-stable-20060304/testing/tomcat/build.xml deleted file mode 100644 index b3fdc8f0a9..0000000000 --- a/tags/java-stable-20060304/testing/tomcat/build.xml +++ /dev/null @@ -1,348 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/testing/tomcat/context.xsl b/tags/java-stable-20060304/testing/tomcat/context.xsl deleted file mode 100644 index 82db3ef81b..0000000000 --- a/tags/java-stable-20060304/testing/tomcat/context.xsl +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/testing/tomcat/helloworldaxis/.classpath b/tags/java-stable-20060304/testing/tomcat/helloworldaxis/.classpath deleted file mode 100644 index 97a91ebf9f..0000000000 --- a/tags/java-stable-20060304/testing/tomcat/helloworldaxis/.classpath +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/testing/tomcat/helloworldaxis/.project b/tags/java-stable-20060304/testing/tomcat/helloworldaxis/.project deleted file mode 100644 index dbdfaba8be..0000000000 --- a/tags/java-stable-20060304/testing/tomcat/helloworldaxis/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - helloworldaxisacceptance - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/tags/java-stable-20060304/testing/tomcat/helloworldaxis/src/test/java/org/apache/tuscany/samples/helloworldaxis/TestHelloWorldAxisTestCase.java b/tags/java-stable-20060304/testing/tomcat/helloworldaxis/src/test/java/org/apache/tuscany/samples/helloworldaxis/TestHelloWorldAxisTestCase.java deleted file mode 100644 index e558e68b89..0000000000 --- a/tags/java-stable-20060304/testing/tomcat/helloworldaxis/src/test/java/org/apache/tuscany/samples/helloworldaxis/TestHelloWorldAxisTestCase.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldaxis; - -import junit.framework.TestCase; - -import org.apache.tuscany.samples.helloworldaxis.HelloWorldAxisClient; - - -public class TestHelloWorldAxisTestCase extends TestCase { - final static String urlstrAxisService= "http://localhost:8080/tuscany-samples-helloworldaxissvc/services/helloworld"; - final static String urlstrTuscanyService= "http://localhost:8080/tuscany-samples-helloworldws-service/services/HelloWorldService"; - /** - * Test using axis client against axis server - * @throws Exception - */ - public void testHelloWorldAgainstAxis() throws Exception - { - - helloWorld(urlstrAxisService); - - - } - - public void testHelloWorldAgainstTuscany() throws Exception - { - - helloWorld(urlstrTuscanyService); - - - } - - - private void helloWorld(final String serviceURL) throws Exception - { - - - String val= (new HelloWorldAxisClient()).getGreetings(serviceURL,"World"); - assertEquals(val,"Hello World"); - val= (new HelloWorldAxisClient()).getGreetings(serviceURL,"Axis World"); - assertEquals(val,"Hello Axis World"); - - } - -} diff --git a/tags/java-stable-20060304/testing/tomcat/helloworldweb/.classpath b/tags/java-stable-20060304/testing/tomcat/helloworldweb/.classpath deleted file mode 100644 index 833509ff51..0000000000 --- a/tags/java-stable-20060304/testing/tomcat/helloworldweb/.classpath +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/testing/tomcat/helloworldweb/.project b/tags/java-stable-20060304/testing/tomcat/helloworldweb/.project deleted file mode 100644 index 207c1f6159..0000000000 --- a/tags/java-stable-20060304/testing/tomcat/helloworldweb/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - helloworldwebacceptance - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/tags/java-stable-20060304/testing/tomcat/helloworldweb/pom.xml b/tags/java-stable-20060304/testing/tomcat/helloworldweb/pom.xml deleted file mode 100644 index 8767c3e170..0000000000 --- a/tags/java-stable-20060304/testing/tomcat/helloworldweb/pom.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - org.apache.tuscany - tuscany-testing-tomcat - SNAPSHOT - - 4.0.0 - tuscany-testing-tomcat-helloworldweb - jar - Tuscany Testing Tomcat HelloWorld WEB acceptance - Acceptance test for Helloworld web - SNAPSHOT - - - - - junit - junit - 3.8.1 - test - - - - htmlunit - htmlunit - 1.7 - test - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - jakarta-regexp - jakarta-regexp - 1.4 - - - ant - ant-jakarta-regexp - 1.6.1 - - - ant - ant-xslp - 1.6.5 - - - ant - ant-trax - 1.6.5 - - - - - - diff --git a/tags/java-stable-20060304/testing/tomcat/helloworldweb/src/test/java/org/apache/tuscany/samples/helloworldweb/TestHelloWorldWebTestCase.java b/tags/java-stable-20060304/testing/tomcat/helloworldweb/src/test/java/org/apache/tuscany/samples/helloworldweb/TestHelloWorldWebTestCase.java deleted file mode 100644 index 4a23c53583..0000000000 --- a/tags/java-stable-20060304/testing/tomcat/helloworldweb/src/test/java/org/apache/tuscany/samples/helloworldweb/TestHelloWorldWebTestCase.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldweb; - -import java.net.URL; -import java.util.Iterator; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import junit.framework.TestCase; - -import com.gargoylesoftware.htmlunit.Page; -import com.gargoylesoftware.htmlunit.WebClient; -import com.gargoylesoftware.htmlunit.WebResponse; -import com.gargoylesoftware.htmlunit.html.HtmlForm; -import com.gargoylesoftware.htmlunit.html.HtmlInput; -import com.gargoylesoftware.htmlunit.html.HtmlPage; - - -public class TestHelloWorldWebTestCase extends TestCase { - public static final String testUrl = "http://localhost:8080/tuscany-samples-helloworldWEB/"; - - public void testHelloWorldDefault() throws Exception - { - System.err.println("Running: testcase:"); - // New HTMLunit web client - WebClient client = new WebClient(); - // Going to have the WebClient connect to this URL - URL url = new URL(testUrl); - HtmlPage page = (HtmlPage)client.getPage(url); - //System.out.println(page.getTitleText()); - - // Check response code - WebResponse resp = page.getWebResponse(); - assertTrue(resp.getStatusCode() <= 200); - List forms = page.getForms(); - Iterator iter = forms.iterator(); - - // Iterate over all forms on page, should only be one. - while(iter.hasNext()) - { - HtmlForm form = (HtmlForm)iter.next(); - // Get the "name" form input field - HtmlInput login = form.getInputByName("name"); - System.err.println(login.getValueAttribute()); - Page resultPage = form.submit(); - // Check response from servlet - WebResponse resultResponse = resultPage.getWebResponse(); - assertTrue(resultResponse.getStatusCode() <= 200); - - // TODO Check response content.. - String response = resultResponse.getContentAsString(); - - Pattern pattern = Pattern.compile("Hello World"); - Matcher matcher = pattern.matcher(response.subSequence(0,response.length())); - assertTrue(matcher.find()); - - /** - * or.. - * - * HtmlPage htmlResponse = (HtmlPage)resultPage; - * HtmlElement element = htmlResponse.getHtmlElementById("ELEMENT-ID"); - * assertEquals(element.getNodeValue(), ... ); - * - * or.. - * - * String resultString = resultResponse.getContentAsString(); - * assertEquals(resultString, ... ); - * - * etc. - * - **/ - } - - } - - /** - * @param args - */ - public static void main(String[] args) { - - - } - -} diff --git a/tags/java-stable-20060304/testing/tomcat/helloworldwebdas/src/test/java/org/apache/tuscany/samples/helloworldwebdas/TestHelloWorldWebDasTestCase.java b/tags/java-stable-20060304/testing/tomcat/helloworldwebdas/src/test/java/org/apache/tuscany/samples/helloworldwebdas/TestHelloWorldWebDasTestCase.java deleted file mode 100644 index 545edfc01c..0000000000 --- a/tags/java-stable-20060304/testing/tomcat/helloworldwebdas/src/test/java/org/apache/tuscany/samples/helloworldwebdas/TestHelloWorldWebDasTestCase.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldwebdas; - -import java.net.URL; -import java.util.Iterator; -import java.util.List; - -import junit.framework.TestCase; - -import com.gargoylesoftware.htmlunit.Page; -import com.gargoylesoftware.htmlunit.WebClient; -import com.gargoylesoftware.htmlunit.WebResponse; -import com.gargoylesoftware.htmlunit.html.HtmlForm; -import com.gargoylesoftware.htmlunit.html.HtmlPage; -import com.gargoylesoftware.htmlunit.html.HtmlTable; -import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput; - -public class TestHelloWorldWebDasTestCase extends TestCase { - public static final String testUrl = "http://localhost:8080/tuscany-samples-customerWEB/"; - - public void testHelloWorldDefault() throws Exception - { - System.err.println("Running: testcase:"); - - // New HTMLunit web client - WebClient client = new WebClient(); - - // Going to have the WebClient connect to this URL - URL url = new URL(testUrl); - HtmlPage page = (HtmlPage)client.getPage(url); - - // Check response code - WebResponse resp = page.getWebResponse(); - assertTrue(resp.getStatusCode() <= 200); - List forms = page.getForms(); - - //There is one form - HtmlForm form = (HtmlForm)page.getForms().get(0); - HtmlSubmitInput button = (HtmlSubmitInput)form.getInputByName("submit"); - - // Click the button and get back the second page - final HtmlPage page2 = (HtmlPage)button.click(); - - HtmlTable table = (HtmlTable)page2.getHtmlElementById("table1"); - assertEquals("1", (table.getCellAt(1,0)).asText()); - assertEquals("Phil", (table.getCellAt(1,1)).asText()); - assertEquals("Smith", (table.getCellAt(1,2)).asText()); - - } - - -} diff --git a/tags/java-stable-20060304/testing/tomcat/helloworldws/pom.xml b/tags/java-stable-20060304/testing/tomcat/helloworldws/pom.xml deleted file mode 100644 index eb685ba57c..0000000000 --- a/tags/java-stable-20060304/testing/tomcat/helloworldws/pom.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - org.apache.tuscany - tuscany-testing-tomcat - SNAPSHOT - - 4.0.0 - tuscany-testing-tomcat-helloworldws - jar - Tuscany Testing Tomcat HelloWorld WS - Testing Tomcat HelloWorld WS end user test - SNAPSHOT - - - - - org.apache.tuscany.samples.helloworld - helloworldwsclient - ${pom.version} - compile - - - org.apache.tuscany - tuscany-container-js - ${pom.version} - compile - - - junit - junit - 3.8.1 - test - - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - jakarta-regexp - jakarta-regexp - 1.4 - - - ant - ant-jakarta-regexp - 1.6.1 - - - ant - ant-xslp - 1.6.5 - - - ant - ant-trax - 1.6.5 - - - - - - diff --git a/tags/java-stable-20060304/testing/tomcat/helloworldws/src/test/java/org/apache/tuscany/samples/helloworldws/TestHelloWorldWSTestCase.java b/tags/java-stable-20060304/testing/tomcat/helloworldws/src/test/java/org/apache/tuscany/samples/helloworldws/TestHelloWorldWSTestCase.java deleted file mode 100644 index 58b7cfe2be..0000000000 --- a/tags/java-stable-20060304/testing/tomcat/helloworldws/src/test/java/org/apache/tuscany/samples/helloworldws/TestHelloWorldWSTestCase.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * 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. - */ -package org.apache.tuscany.samples.helloworldws; - -import junit.framework.TestCase; - -import org.apache.tuscany.core.client.TuscanyRuntime; -import org.apache.tuscany.core.config.ConfigurationException; -import org.apache.tuscany.samples.helloworldwsclient.HelloWorldService; -import org.osoa.sca.CurrentModuleContext; -import org.osoa.sca.ModuleContext; - - -public class TestHelloWorldWSTestCase extends TestCase { - - String getGreetings(String name) throws ConfigurationException { - // Obtain Tuscany runtime - TuscanyRuntime tuscany = new TuscanyRuntime("hello", null); - - // Start the runtime - tuscany.start(); - - // Obtain SCA module context. - ModuleContext moduleContext = CurrentModuleContext.getContext(); - - // Locate the HelloWorld service component and invoke it - HelloWorldService helloworldService = (HelloWorldService) moduleContext.locateService("HelloWorldServiceComponent"); - - String value = helloworldService.getGreetings(name); - - System.out.println(value); - - // Stop the runtime - tuscany.stop(); - - return value; - } - - public void testHelloWorldDefault() throws Exception { - final String name= "World"; - String greeting= getGreetings(name); - assertEquals(greeting, "Hello " + name); - - final String name2= "SCA World!"; - greeting= getGreetings(name2); - assertEquals(greeting, "Hello " + name2); - - } - -} diff --git a/tags/java-stable-20060304/testing/tomcat/pom.xml b/tags/java-stable-20060304/testing/tomcat/pom.xml deleted file mode 100644 index 25a9dab49b..0000000000 --- a/tags/java-stable-20060304/testing/tomcat/pom.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - org.apache.tuscany - tuscany-project - SNAPSHOT - - 4.0.0 - tuscany-testing-tomcat - pom - Tuscany Testing in Tomcat - SNAPSHOT - - - - helloworldws - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*TestCase.java - - - - - - - src/test/java - - **/*.componentType - - - - src/test/resources - - **/* - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - 1.1 - - - prepareTomcat - process-test-resources - - - - - - - - - - run - - - - cleanupTomcat - clean - - - - - - - run - - - - - - - test - - diff --git a/tags/java-stable-20060304/testing/tomcat/server.xml b/tags/java-stable-20060304/testing/tomcat/server.xml deleted file mode 100644 index 0205a458f0..0000000000 --- a/tags/java-stable-20060304/testing/tomcat/server.xml +++ /dev/null @@ -1,369 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/java-stable-20060304/testing/tomcat/server.xsl b/tags/java-stable-20060304/testing/tomcat/server.xsl deleted file mode 100644 index b7ee22e7d6..0000000000 --- a/tags/java-stable-20060304/testing/tomcat/server.xsl +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - -- cgit v1.2.3